Hold a movie while another loads


I have this media player I built in flash done and it basically loads a video movie and plays it easy enough. The video movie that gets loaded also loads into the player a subtitles movie that get played along with the video movie. I did it that way so I could keep the timing on both the video and subtitles the same.

Now I would like to just have two files that load into the player with a click of the button and have the subtitles movie wait to play until the video movie is fully loaded and ready to go since it will take some time to load it in comparison to the subtitles. I can’t combine the video and subtitles because of the look and feel so my only option is the separate movies.

I was wondering if anyone had a suggestion as to where I need to start regarding action script to make this happen.


hmm, kind of have an idea of what your talking about. i have a site where i made 3 main .swf’s. 1 for the enter button that loads into the main website, and that loads individual swf’s for each content. http://mdjstudios.cjb.net see if your movie loads like that. try posting the .fla so i can have a look, or if its too big, post an example .fla

ok, this example assumes that the movieclip with the movieclip in it is called ‘movie’ and the movieclip with the subtitles in it is called ‘subs’

Create a new, blank movie clip and place it on the same level as the two movieclips, movie and subs.
Add the following code to the new movieclip you have created:

onClipEvent (enterFrame) {
//the following code will be executed every frame.
 if (movie.getBytesLoaded() == movie.getBytesTotal() && subs.getBytesLoaded() == sub.getBytesTotal()) {
 //test to see if both movieclips are full loaded by comparing the total of bytes they should be once loaded, and the total number of bytes that are currently loaded
 //once they are equal, we know that they are full loaded.
  //plays both movieclips.