alternative to unloadAndStop?
I'm sure I'm making some big n00b mistake here since this is my first flash project for a client, but here goes.
I have a menu set up with several buttons (on the left side of the screen), each of which loads an external swf (on the right side of the screen). Within some of these swfs are more buttons to load other swfs, and the menu on the left remains active while another swfs is playing.
What I want is to unload the current swf whenever a button is clicked and load the new on in the same spot. So before I was using addChildAt to get the external swf's at a certain level, and then removeChildAt to take away whichever swf it is and then add the next one. That didn't stop the sound, so I switched it to unloadAndStop and set up a function that unloadAndStops each individual swf, like this:
addEventListener("unloadEverything", unloadEverything);
function unloadEverything(event:Event):void{
LoaderA.unloadAndStop();
LoaderB.unloadAndStop();
LoaderC.unloadAndStop();
etc.
}
That function runs every time a new swf is called to remove the previous one.
Now I know that's not what I should do since I'm effectively using a method on objects that aren't in the display list, and it's apparent since it messes up the text later on in the timeline. But I don't know any other way to get everything to unload and to stop all the sound. It would be a headache to make specific paths for the buttons within swf's, but I don't even know what I'd do about the buttons in the main timeline that don't know what swf is playing on the right.
Any help would be appreciated. I've searched lots of different forums for this one, for something kinda like unloadAndStop and kinda like removeChildAt, so I'm thinking I need to reorganize this project somehow.
Thanks.