-
1. Re: Noob transition to AS3 question
Ned Murphy Jul 8, 2009 10:01 AM (in response to zm15)In AS3 there are event listeners and event handlers... you are trying to combine the two into one, which some people seem to get away with sometimes. But you should keep them separate, especially if you're in a learning phase...
mc.addEventListener(MouseEvent.ROLL_OVER, overHandler);
function overHandler(evt:MouseEvent):void {
mc.gotoAndStop(2);
}
-
-
3. Re: Noob transition to AS3 question
zm15 Jul 8, 2009 11:28 AM (in response to Ned Murphy)I tried this code, and got a duplicate error:
mc.addEventListener(MouseEvent.ROLL_OUT, overHandler);
function overHandler(evt:MouseEvent):void {
mc.gotoAndStop(2);
}
-
-
5. Re: Noob transition to AS3 question
dmeN Jul 9, 2009 8:03 AM (in response to zm15)I tried this code, and got a duplicate error:
mc.addEventListener(MouseEvent.ROLL_OUT, overHandler);
function overHandler(evt:MouseEvent):void {
mc.gotoAndStop(2);
}
DId you define the overHandler function twice? That's about the only way you could get a duplicate error... I think you want:
mc.addEventListener(MouseEvent.ROLL_OUT, outHandler);
function outHandler(evt:MouseEvent):void {
mc.gotoAndStop(1);
}
-
6. Re: Noob transition to AS3 question
zm15 Jul 9, 2009 8:28 AM (in response to dmeN)thanks! i knew i was missing something small like that!



