I currently am loading to swf files into the main movie with the code below and to remove it i am using the removeChildat(0) as shown below…it works fine when they are loaded separately, however if they are both loaded how can i tell it to unload a specific one…
function clickButton(myevent:MouseEvent):void {
var myrequest:URLRequest=new URLRequest(“theSWF1.swf”);
var myloader:Loader=new Loader();
myloader.load(myrequest);
stage.addChild(myloader);
}
function clickButton2(myevent:MouseEvent):void {
var myrequest2:URLRequest=new URLRequest(“theSWF2.swf”);
var myloader2:Loader=new Loader();
myloader2.load(myrequest2);
stage.addChild(myloader2);
}
bb.addEventListener(MouseEvent.CLICK, clickButton);
cc.addEventListener(MouseEvent.CLICK, clickButton2);
eraseSWF2_btn.addEventListener(MouseEvent.CLICK,erase2);
function erase2(event:MouseEvent):void {
stage.removeChildAt(1);
}