PDA

View Full Version : How do I unload all loaded movies...


Mikky
07-27-2001, 10:16 AM
How do I unload all loaded movies, except Level_0 that's my "MainMovie"?? So I don't end up with a "million" movies opened at the same time.

??? Mikky

20 Ton Squirrel
07-27-2001, 03:34 PM
What I'd do is keep track of the names of ze loaded movies above level 0 in an array. I would then use a for, the loop of real men like sailors or tofu farmers. It'd look sometink like dis:


function unloader() {
for(i=1; i<=movarray.length; i++)
_root[movarray[i-1]].unloadMovie();
}


Every time you load a movie, push the name of the loaded MC into the movarray. That way all you have to do to unload them all in one fell swoop is to make a call to unloader().

This method is a bit more complex, but it saves you from having to have concrete naming conventions (which you should have anyway).

Another good point is that you won't have to have all your movies loaded sequentially even if you do have good naming conventions. Since the names are stored in that array, you can load myMC3 then myMC29 and it will still kill 'em all.

Hope that helps!