PixelDroid
10-03-2008, 10:54 PM
Hi All:
I want to use AS3 to play an stop an MC on its last frame.
I found simple code on the web, which works great...EXCEPT IN MY FLA!
Here's the code and error, can anyone see what I'm doing wrong?
Thanks much.var currentMC:MovieClip = welcome_mc;
currentMC.addEventListener(Event.ENTER_FRAME, runOnce);
function runOnce(e:Event):void {
if (currentMC.currentFrame == currentMC.totalFrames) {
currentMC.stop();
currentMC.removeEventListener(Event.ENTER_FRAME, runOnce);
}
}
//Error Message:
The class or interface 'Event' could not be loaded.
I want to use AS3 to play an stop an MC on its last frame.
I found simple code on the web, which works great...EXCEPT IN MY FLA!
Here's the code and error, can anyone see what I'm doing wrong?
Thanks much.var currentMC:MovieClip = welcome_mc;
currentMC.addEventListener(Event.ENTER_FRAME, runOnce);
function runOnce(e:Event):void {
if (currentMC.currentFrame == currentMC.totalFrames) {
currentMC.stop();
currentMC.removeEventListener(Event.ENTER_FRAME, runOnce);
}
}
//Error Message:
The class or interface 'Event' could not be loaded.