Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unload all loaded movies on 1 click

Status
Not open for further replies.

firegambler

Technical User
Sep 25, 2002
455
AT
hi folks,

is there a way to unload all movies i loaded into a project with one click?

what I want to do is to create a website were every "site" is an extra swf-file which gets loaded into the main movie.
so when somebody clicks a button in the menu the new "site" is loaded into the film. therefore i have to unload every movie the user could have been viewing before (i.e. every point in the menu exept the one he just clicked). do i have to name every movie in the actionscript (even those which are not even currently loaded) to unload all or is there a way to do that with one command.

i'd like to have something like

on (release) {
unloadMovie (ALL);
loadMovieNum ("alexander.swf",1);
}


instead of


on (release) {
_level1.unloadMovie("tom");
_level1.unloadMovie("flo");
loadMovieNum("alexander.swf", 1);
}


thanks

firegambler
 
First, you can only have 1 movie per level or in one single container clip, and when loading a new movie on the same level or in the same container clip, you're automatically unloading the previous movie. Thus if you keep using the same level, you have no more problem.
With levels, you could also easily use a for loop, to unload all levels...

for(x=1; x<101; x++){
unloadMovieNum(x);
}

Make sure you don't unload level 0, which holds your main movie... And the above, should unload levels 1 to 100. Regards,

oldman3.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top