Groups | Blog | Home
all groups > flash actionscript > july 2007 >

flash actionscript : load unload movies


jojorobby
7/16/2007 11:50:56 PM
I want to create a movie that loads an swf file, then once the swf file is
finished playing, it unloads that then loads another file. Once the files are
done playing, I would like it to loop over again. I know it's fairly basic but
I can't seem to grasp the actionscript that is needed for this. Can someone
please help me out? Thanks a bunch.
neeks
7/17/2007 12:00:00 AM
if you don't have much files,
you can use an array in the main swf which will load all other swfs, call it
movieArray.
Now make some function like LoadNextMovie( ) in the same file.
make a counter variable like currentMovieNum and set it to zero.
now just call the LoadNextMovie( ) which will look at the currentMovieNum,
increment it by 1, and load the movie with the name stored at the corresponding
position of the movies array.

you can call the same function from within the swfs to be loaded at the last
frame like _parent.LoadNextMovie( )
Which will take care of incrementing the counter and loading next movie.
also you can place a check that when the counter reaches a value equal to
number of elements in the array, it will set the counter to 0 again.

if you are novice with as, it might help to read the following in the as help
loadMovie, array

AddThis Social Bookmark Button