Question

I made a short MovieClip that only lasts a few frames and put a trace statement on frame 1. Much to my surprise, simply instantiating it without even adding it to the stage made that trace statement start firing off immediately.

var m:MovieClip = new MovieClip(); //Trace statement begins going off repeatedly

Does that mean MovieClips automatically begin playing and looping as soon as they are instantiated? If so, should you always call stop() right after instantiating if you're not going to display it exactly at that moment? Unless your MovieClip only has 1 frame.

Was it helpful?

Solution

Yes, MovieClips begin playing auto-magically. If you want to prevent this, you would need to stop it:

var m:MovieClip = new SomeMovieClip();
m.stop();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top