Simple ActionScript 3.0 help

pxoxrxn

Supreme Member
Joined
Dec 21, 2011
Messages
1,398
Reaction score
1,922
Hi, I'm new to this AS stuff and I needs some help with this simple function I am trying to do. It gives me an error, expecting rightpan before colon. What is a rightpan.

circle2.addEventListener(MouseEvent.CLICK, fl_ClickToPosition_3);


function fl_ClickToPosition_3(event:MouseEvent):void
{
circle2.x = 200;
circle2.y = 100; }

do {
fl_ClickToPosition_3(event:MouseEvent);
} while (circle2.x < 800);

Cheers
 
fl_ClickToPosition_3(event:MouseEvent);This line is invalid.event:MouseEvent is declaring a parameter. I'm not sure what you're trying to do here... Is that do while supposed to be in the function?What I would recommend (sorry formatting is all f'd up here... haven't figured out how to on these forums yet)
Code:
iscircle2.addEventListener(MouseEvent.CLICK, fl_ClickToPosition_3);// set default parameter of nullfunction fl_ClickToPosition_3(event:MouseEvent = null):void{circle2.x = 200;circle2.y = 100; } do { fl_ClickToPosition_3();} while (circle2.x < 800);
 
Back
Top