all groups > flash actionscript > november 2004 >
You're in the

flash actionscript

group:

Preload multiple external swfs


Preload multiple external swfs Barney...
11/16/2004 10:34:55 PM
flash actionscript: I nabbed some script (below) which i haven't tried yet and to which i would
like a little help with.

How/where would i intergrate a progress bar?
Also, throughout the site i use unload movie level....would the browser still
hold these files in the cache for later use?

Many thanks in advance

frame 1:
moviearray = new
Array("movie1.swf","target1","movie2.swf","target2","movie3.swf","target3");
actMovieIdx = 0;

frame 2:

moviename = moviearray[actMovieIdx++];
movietarget = moviearray[actMovieIdx++];
loadMovie(moviename, movietarget);

frame 3:


frame 4:

actBytes = eval(movietarget).getBytesLoaded() || 0;
totBytes = eval(movietarget).getBytesTotal() || 100;
percent = Math.round(actBytes * 100 / totBytes);
if( totBytes - actBytes > 10){//more bytes available, keep on loading
gotoAndPlay(3);
} else if(actMovieIdx < moviearray.length){//if we got more movies to load
gotoAndPlay(2);
} // else go to frame 5

frame 5:
gotoAndPlay
Re: Preload multiple external swfs Barney...
11/16/2004 10:35:53 PM
AddThis Social Bookmark Button