# RemoveChild Error 2025

**URL:** <https://forum.kirupa.com/t/removechild-error-2025/321851>\
**Category:** flash\
**Created:** [May 3, 2011, 12:31pm UTC](https://forum.kirupa.com/t/removechild-error-2025/321851 "2011-05-03T12:31:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![whenyourmadgowe](https://avatars.discourse-cdn.com/v4/letter/w/8c91f0/32.png) [@whenyourmadgowe](https://forum.kirupa.com/u/whenyourmadgowe)\
**Post date:** [May 3, 2011, 12:31pm UTC](https://forum.kirupa.com/t/removechild-error-2025/321851/1 "2011-05-03T12:31:35Z")

</div>

New to flash as3 need some help, cant seem to get past a 2025 error when remove child is used.

My player hits of an object called present\_mc2 and is removed but an error comes up on stage.

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.  
at flash.display::DisplayObjectContainer/removeChild()  
at VinnieBaggeB00033245\_fla::MainTimeline/detecthit()

heres my code

var present2\_mc:MCpresent = new MCpresent();

stage.addChild(present2\_mc);  
present2\_mc.x=87;  
present2\_mc.y=305;

stage.addEventListener(Event.ENTER\_FRAME, detecthit);

function detecthit(event:Event):void  
{

```
{
	removeChild(present_mc);
	stage.removeEventListener(MouseEvent.MOUSE_MOVE, detecthit);
		
}
}
```
