# Supplied DisplayObject must be a child of the caller?

**URL:** <https://forum.kirupa.com/t/supplied-displayobject-must-be-a-child-of-the-caller/315408>\
**Category:** Uncategorized\
**Created:** [October 25, 2010, 1:57pm UTC](https://forum.kirupa.com/t/supplied-displayobject-must-be-a-child-of-the-caller/315408 "2010-10-25T13:57:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![autumnmedia](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@autumnmedia](https://forum.kirupa.com/u/autumnmedia)\
**Post date:** [October 25, 2010, 1:57pm UTC](https://forum.kirupa.com/t/supplied-displayobject-must-be-a-child-of-the-caller/315408/1 "2010-10-25T13:57:37Z")

</div>

im getting the following error

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.  
at flash.display:isplayObjectContainer/removeChild()  
at guide\_fla::memb2\_13/frame1()  
at flash.display::MovieClip/gotoAndStop()  
at guide\_fla::memb3\_14/active()

from this section of code

```auto
var mem2:m2 = new m2();
stop();
if(MovieClip(root).c>0){
	this.parent.removeChild(mem2);
}

this.addEventListener(MouseEvent.MOUSE_DOWN, active);
function active (e:MouseEvent):void {
	this.gotoAndStop(2);
	MovieClip(parent).memb1.gotoAndStop(1);
	MovieClip(parent).memb3.gotoAndStop(1);
	MovieClip(parent).memb4.gotoAndStop(1);
	MovieClip(parent).addChild(mem2);
	mem2.x = 280;
	mem2.y = 140;
	var c:int = 0;
	MovieClip(root).c = 1;
}

```

there is also a variable c on the root timeline.  
can anyone tell me why im getting this error?
