Automaticly load & play SWFs

Hi Guys,

I am busy with making a flash movie/animation with different chapters in it. So, I’ve made a couple of chapters and published it as a SWF file for every chapters.
I can easliy load and play the 1st chapter/swf in the Main.swf but how can I automaticly load and play the 2nd chapter/swf after the 1st chapter finished?

Any ideas?

just load it in the same way you did the first swf, it should work the same I think

you might have use unload movie but I think if you load it into the same level it takes its place anyway

look at this for example:
http://www.kirupa.com/developer/mx/full_site.htm

Jillymo,

This is how I play the first swf (the action of the firstframe of Main.swf)

loadMovieNum(“01.swf”, 1);

If i put loadMovieNum(“02.swf”, 1); in the second frame of Main.swf and test the Main.swf it skipped the first frame and play 02.swf directly…

at the last frame of 01.swf , place loadMovieNum(“02.swf”, 1);

it should work.

did you try wheel’s suggestion- did it work?

yeah, ive just tried wheel’s suggestion and it works…
But that means that I have to put the loadMovieNum(“02.swf”, 1); script at the end of every chapters…
Is there any posibility to have loadMovieNum(“02.swf”, 1); central on Main.swf?
Maybe put it in an array variable or something like that?

Thanks guys!

how about _root.chapters.unloadmovie();//this will unload what ever chapter is playing
and _root.chapters.loadmovie(“02.swf”);//this will load the new chapter
btw - chapters is the instance name of the MtMC
when you do that you have more control of the chapter loading and unloading, frame control and all the other mumbo jumbo

will that work for you?!

what we need to do here is check for the last frame playing in each chapter.
to do this, we can use a logical test and see if the current frame, _currentframe, is equal to the last frame, _totalframes. then, we can load the next chapter.

to know what chapter to load next, we keep a variable that tells us the current chapter and when the last frame is reach ed of that chapter, we add one to the chapter variable and we can load the next chapter.

for example, the first chapter may be named:
"chapter_1.swf"
and the second
"chapter_2.swf"
third
"chapter_3.swf"
etc…

and then we can load these movieclips into another.
I’ve attached one so that you can see it in action.

you’ll need to uncomment the lines of code that load the movies, and add in some more code if this does not suit you :slight_smile:

guys,

thanks for the replies…
what i really trying to do is (see image attached) to build a cd-rom promo something like that…

You’ll see red and blue arrows in the image attached.
Red means that the next chapter#.swf will load/play automaticly and ofcourse unload/stop the chapter played before.

Blue means that I’ll put a button in Main.swf to play the clicked chapter.
I’d like to put all the script on Main.swf if its possible…

I’m new with FlashMX… maybe is easy to do this for you guys… but i’ve tried many things and i’ve searched on the net but still stuck with this.
Any idea? Your help will be much appreciated!!