# Removing Dynamic SWF Question

**URL:** <https://forum.kirupa.com/t/removing-dynamic-swf-question/279361>\
**Category:** flash\
**Created:** [January 13, 2009, 11:10pm UTC](https://forum.kirupa.com/t/removing-dynamic-swf-question/279361 "2009-01-13T23:10:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![coloradocelt](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@coloradocelt](https://forum.kirupa.com/u/coloradocelt)\
**Post date:** [January 13, 2009, 11:10pm UTC](https://forum.kirupa.com/t/removing-dynamic-swf-question/279361/1 "2009-01-13T23:10:51Z")

</div>

Hey all,

I am placing an external swf files with the following code:

```auto
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:

```auto
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.
