# Help with removing a displayObject

**URL:** <https://forum.kirupa.com/t/help-with-removing-a-displayobject/314003>\
**Category:** flash\
**Created:** [September 15, 2010, 9:39pm UTC](https://forum.kirupa.com/t/help-with-removing-a-displayobject/314003 "2010-09-15T21:39:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![acerbist](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@acerbist](https://forum.kirupa.com/u/acerbist)\
**Post date:** [September 15, 2010, 9:39pm UTC](https://forum.kirupa.com/t/help-with-removing-a-displayobject/314003/1 "2010-09-15T21:39:33Z")

</div>

I need help badly, I’ve tried to google this several times with no luck.

I’m loading in an external swf with the code below (which works great), but occasionally I need to clear out “gameHolder” with a call of “removeChild(gameHolder);” but it doesn’t work. I believe it is because the contents of “gameHolder” is a displayObject instead of a movieClip.

Any help would be greatly appreciated.

```auto
function load_game()
{
    var mLoader:Loader = new Loader(); 
    var mRequest:URLRequest = new URLRequest("game.swf"); 
    mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler); 
        mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler); 
        mLoader.load(mRequest); 
    }
}

function onCompleteHandler(loadEvent:Event) 
{         
    gameHolder = addChild(loadEvent.currentTarget.content); 
    gameHolder.addEventListener( "gameFinished", finishEventReceived, false, 0, true ); 
} 

```
