Timing a loadMovie command

:p:
I am using WildForm FX which produces cool text effects in swf format.
I am using the loadMovie to integrate the text into my main movie, but I am wanting 2 swf’s to load at different times, rather than using onClipEvent (load) to load at the beginning of the movie.

Is there a way to have the second swf load (in a seperate empty clip than the 1st swf) after the first one is finished?

The first one will stay as still text while the second one plays.

I have searched through loadMovie on the forum, cannot find anything on this.

Please help!

:s:

[AS]// create a MovieClip to load each SWF
this.createEmptyMovieClip(“clip1”, 1);
this.createEmptyMovieClip(“clip2”, 2);
// load first animation
clip1.loadMovie(“animation1.swf”);
// define onEnterFrame handler
clip2.onEnterFrame = function() {
// check if the animation has finished
if (clip1._currentframe == clip1._totalframes) {
// stop first animation
clip1.stop();
// load second animation
this.loadMovie(“animation2.swf”);
}
};
// the END.[/AS]
That’s the idea… :stuck_out_tongue:

You might need to check if the first animation has been loaded before you compare its current frame against its total frames, otherwise you could get unexpected results.
If you don’t know how to do that, there are hundreds (ok… maybe not hundreds) of threads about preloaders. You can use the search button to find the answer.

cool thanks!
I was trying to resolve using on onClipEvent (enterFrame) command as opposed to onClipEvent (load) and it seemed to be working, but there seem to be some problems with the actual swf’s loaded from WildFX. When I pull up the swf sometimes it plays, sometimes I get a blank screen.
That is a problem on its own though.
Thank you for the advice on this!!

:}

ps I was actually creating empty mc’s in my library and dragging them to the stage.

I did not know that there was a createEmptyMovieClip command so I thank you for this as well. Am going to test it out and see how it works as opposed to the way I was doing it.