Ok I have been racking my brain and the web for the answer to this.
Here’s the code:
//Variable for the swfLoader
var swfLoader:Loader = new Loader();
//Variables that load the swf movies
var loadMain:URLRequest = new URLRequest(“Main.swf”);
var loadTrips:URLRequest = new URLRequest(“Trips.swf”);
//Load the Main page
swfLoader.load(loadMain);
addChild(swfLoader);
//Home button
function goHome(event:MouseEvent):void {
swfLoader.load(loadMain);
addChild(swfLoader);
}
//Trips button
function goTrips(event:MouseEvent):void {
swfLoader.load(loadTrips);
addChild(swfLoader);
}
//Event listener
btnHome.addEventListener(MouseEvent.CLICK, goHome);
btnTrips.addEventListener(MouseEvent.CLICK, goTrips);
The problem is the trip.swf has clips that have been added using addChild(). When I click the home button it loads the main.swf but the child clips from trip.swf stay on the stage. The swf itself is unloaded but not its children. I hope this makes sense and someone can help.
Thanks,
dragonred7