1 Reply Latest reply on Dec 3, 2006 10:28 PM by kglad

    Can you LoadMovie without playing?

    harrismd
      Is there a way to load an external movie into a movie clip but not play it until later? I want to be sure that the movie doesn't start until all bytes have downloaded and my preloader has gone away. No matter what I do, the loaded movie always starts before it is completely downloaded and when my preloader goes away, the viewer has missed the beginning of the downloaded movie.

      I see that with MovieClipLoader, I can tell when the download starts, when additional bytes are downloaded, when the first frame is loaded and executed, and when the entire movie is downloaded. What I can't seem to figure out how to do is tell the loaded movie to wait until I tell it to play. What I need to do is start my preloader, begin loading the movie, when the movie is fully downloaded, take away the preloader, do some animation, then fade in the loaded movie and begin playing it.

      For loaded movies that I control, I can achive this effect by coding a stop() in frame 1 of the loaded movie. Then call gotoAndPlay(2) when I'm ready. The problem is, I don't control all of the movies I'm loading.

      I suppose I could always to a gotoAndPlay(1) from onLoadComplete()... but that might not be safe because who knows what kind of initialization might have been done... and while I can set the movie clip to invisible to hide the video playing early, it might be annoying if somehow audio is played early in the movie.

      One thought I had was to see if there were a way to attach an event handler to frame 1 of the loaded movie and force a stop() somehow. But I'm not sure if I can actually stop the loaded movie's timeline correctly... and even if I did, all kinds of code could have already executed by that time and I don't know if executing it again would be a safe thing to do.

      Does anyone have suggestions?
        • 1. Re: Can you LoadMovie without playing?
          kglad Adobe Community Professional & MVP
          you can use a target.stop() in your onLoadInit() handler of the moviecliploader class, but that won't help with sounds instantiated using the sound class.

          there is no work-around, about which i know, if you have to control sounds in a swf that you can't edit and you don't want to stopAllSounds().