Groups | Blog | Home
all groups > flash actionscript > april 2004 >

flash actionscript : Master movie and external swf files...


teresa_hamilton
4/6/2004 11:37:49 PM
I've looked in books and on websites and everywhere else I can think of for
this and cannot find it, but I'm sure it can be done!

What I want to do is have a master move that dynamically loads x amount of
other .swf files and plays them one at a time. I'm getting the names of the
..swf files from a database (via an ASP page), and this part I have working
fine, I just can't figure out how to show them one at a time without
loading/unloading them on the fly. I only want to load them when the master
movie first starts and then just continuously loop through them.

Thank you in advance for your help! :)
Jack.
4/7/2004 1:01:37 AM
split the names of the swf files into an array and step
through the array with an onEnterFrame loop, this test
loads to levels, you can adapt it to load to a movieclip,

i tested with a text file -
movies=movie01.swf,movie02.swf,movie03.swf,movie04.swf&

the main movie code is -
lv = new LoadVars();
lv.onLoad = function(){
arr = lv.movies.split(",");
loadMovieNum(arr[0],1);
ready = true;
};
lv.load("movies.txt");

num -= 1;

this.onEnterFrame = function(){
if(ready){
trace(_level1._currentframe+" of "+_level1._totalframes);
if(_level1._currentframe == _level1._totalframes){
trace("end of"+arr[num]);
num == arr.length ? num = 0 : num++;
trace("start of"+arr[num]);
loadMovieNum(arr[num],1);
}
}
};

stop ();

hth,
teresa_hamilton
4/7/2004 4:26:48 AM
Thank you, Jack! This is definitely part of my answer. The next question is,
is there a way to have the movies loaded into the main movie and just not
display them until I'm ready for them? I guess that would be preloading, but
I'm not certain how to do it with movies like this. I'm fairly new to
programming in Flash. :)

Again, thanks for your help. :)
Jack.
4/7/2004 11:26:39 AM
How to create movies that download before playing
http://www.macromedia.com/support/flash/ts/documents/wait_for_frame01.htm

How to preload and 'park' movies at different levels
http://www.macromedia.com/support/flash/ts/documents/preload_levels.htm

hth
teresa_hamilton
4/7/2004 4:06:33 PM
AddThis Social Bookmark Button