all groups > flash actionscript > january 2005 >
You're in the

flash actionscript

group:

preloading multiple swfs


preloading multiple swfs Brian
1/17/2005 11:25:15 AM
flash actionscript:
I have a main movie, into which I will load an intro animation. Both the
main movie and the intro animation need to start playing at the same
time. So I would like to load the main movie and then load the intro and
then once both are completely loaded, I would like to start playing both
at the same time.

How would I do this with AS?

Re: preloading multiple swfs kglad
1/18/2005 3:58:49 AM
in frame 1 of your intro have nothing on-stage and a stop() attached. you can
then use:

stop():
_root.createEmptyMovieClip("holderMC",1);
holderMC.loadMovie("yourIntro.swf");
preloadI=setInterval(preloadF,100);
function preloadF(){
loaded1=_root.getBytesLoaded();
total1=_root.getBytesTotal();
loaded2=_root.holderMC.getBytesLoaded();
total2=_root.holderMC.getBytesTotal();
if(loaded1>0&&loaded1>=total1&&loaded2>=total2){
clearInterval(preloadI);
_root.gotoAndPlay(2);
_root.holderMC.gotoAndPlay(2);
}
}
AddThis Social Bookmark Button