PDA

View Full Version : Eventful Problem


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.

AleksandarAndreev
10-03-2008, 10:59 PM
is this code on the timeline in the fla , or is it in a class ?
Looks like it can't find the Event class, so try to import it.
you could try to import the class like this

import flash.events.Event

PixelDroid
10-03-2008, 11:07 PM
Thanks for the quick reply.
The problem was that the publish settings were set to AS2!
I try not to work w/AS2, but someone sent me the file.
Aggravating...