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

flash actionscript : Unloading swfs



MotoFlash
7/3/2005 11:13:42 PM
I have a main .swf (main)that loads an external .swf (ext1) from a menu button
on(release) action.
Once loaded, ext1 will load another swf (ext2) on a button On(release) action.

So, inside the main movie you see ext1 and ext2.

Now, I'm trying to unload both swfs (ext1 and ext2) from the main movie at the
same time if the user selects a different menu choice located in the main movie.

How do you do it?
How can you tell what level ext2 is on from the main movie?

for example. I have this:

//from main movie

on(release){
loadMovieNum("ext1.swf",2);
}

This loads ext1 into the main movie on level 2.

//Then from ext1

on(release){
loadMovieNum("ext2.swf",2);
}

I can unload ext1 from the main movie, but ext2 is still visible. I need to
unload both.
:confused;
kglad
7/3/2005 11:50:47 PM
MotoFlash
7/4/2005 12:00:00 AM
That's how I originally coded it, but for some reason it's not working.

Main(loadMovieNum(ext1,2)
|___ext1(loadMovieNum(ext2,2)
|___ext2

Both should be on level 2 of the main movie, but when I unload them using
unloadMovieNum(2), it only removes ext1.

ext2 remains.

I am using MX pro 2004. Not sure if that makes a diff.

Thanks
Kglad

kglad
7/4/2005 12:00:00 AM
ext1 is gone as soon as you execute loadMovieNum(ext2,2) (and if ext1 contains
the unloadMovieNum(2) statement, it isn't going to execute after ext1 is
unloaded).

if you were to execute unloadMovieNum(2), after the above ext2 load, then ext2
would be removed.
AddThis Social Bookmark Button