Hey all,
I am placing an external swf files with the following code:
var removeSpaces0:RegExp = / /g;
var noSpaces0:String = String(itemZero);
var structureName0:String = (noSpaces0.replace(removeSpaces0, ""));
var anatomyPicture0:Loader = new Loader();
stage.addChild(anatomyPicture0);
anatomyPicture0.contentLoaderInfo.addEventListener( Event.INIT, handleInit0 );
anatomyPicture0.load( new URLRequest( "swfFiles/" + structureName0 + ".swf" ) );
function handleInit0(evt:Event):void {
var extMovie0:* = anatomyPicture0.content;
removeArray.push(extMovie0);
extMovie0.x = (stage.stageWidth - anatomyPicture0.width)/2;
extMovie0.y = (stage.stageHeight - anatomyPicture0.height)/2;
}
I am trying to remove it (and a couple of others clips) with the following code:
function theRemover(evt:MouseEvent):void {
for (var z:Number = 0; z <= 1; z++) {
var totalChildren:Number = this.numChildren - 1;
removeChildAt(totalChildren);
removeChild(removeArray.pop());
}
}
I am getting this error:
“ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at symptomToProtocolAnatomy_fla::MainTimeline/theRemover()”
Any help is greatly appreciated.