I have some buttons that are loading external SWF files into a movie clip called holder. Each button loads SWFs into that clip, but the addChild method puts one on top of the other in sequence. How can I use removeChild to remove specifically, the content of the holder clip?
I have seen this: if (this.contains(ball)) this.removeChild(ball); But it doesn’t serve my purposes because the movie clip is a placeholder. Here’s my code:
b1.addEventListener(MouseEvent.CLICK, swf1);
function swf1(event:MouseEvent):void {
var swf1Ldr:Loader = new Loader();
var swf1URL:String = "dieHard.swf";
var swf1URLReq:URLRequest = new URLRequest(swf1URL);
swf1Ldr.load(swf1URLReq);
swf1Ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, swf1Loaded);
function swf1Loaded(event:Event):void {
holder.addChild(swf1Ldr.content);
}
// Make the progress clip visible and show the progress loaded
swf1Ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
}
Any ideas