{fmx} Dynamically unloading SWF files

This is a newbie quesiton, sorry?

I’m making a simple website with a navigational buttons that loads external swf files with proper content as it is called for by the users.

My question is how do you dynamically unload the previously loaded swf file and replace it with a new one.

So far I’ve been using the below code for EACH button (with accomodating changes for the level numbers)

on (release) {
loadMovieNum(“edit.swf”, 1);

unloadMovieNum(2);
unloadMovieNum(3);
unloadMovieNum(4);
unloadMovieNum(5);
unloadMovieNum(6);
unloadMovieNum(7);
unloadMovieNum(8);
unloadMovieNum(9);
unloadMovieNum(10);
unloadMovieNum(11);

}

This, no doubt, is way too simplistic and ridiculous. I’ve been using Flash MX for simple animation, but this is my first time venturing into serious actionscripting.

btw, I’ve been using this method (loading ext. SWFs) to lighten the file size. I wonder if everyone uses this method for complex websites?

Any advice for this lowly newbie is much appreciated. Thanx.

xroad66