# addChild/removeChild Problem

**URL:** <https://forum.kirupa.com/t/addchild-removechild-problem/323506>\
**Category:** flash\
**Created:** [July 4, 2011, 9:59pm UTC](https://forum.kirupa.com/t/addchild-removechild-problem/323506 "2011-07-04T21:59:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rassy7](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@rassy7](https://forum.kirupa.com/u/rassy7)\
**Post date:** [July 4, 2011, 9:59pm UTC](https://forum.kirupa.com/t/addchild-removechild-problem/323506/1 "2011-07-04T21:59:36Z")

</div>

Hi, I’m trying to make a basic mouesover and mouseout that will display a help/key box on the screen. I created the help box that will be displayed as a symbol called helpbox. I updated the linkage to export to Actionscript and called the class Helpme.

The object I’m using to instantiate the Helpme class is a small graphic called helpcoast. I want the “helpbox” in the new class “Helpme” to be displayed only when the mouse is over the helpcoast graphic. When I test the movie and mouse over and mouse out of the graphic once, I get no errors, but if I mouse over it, then off it, then back over again, I get this error in the output box:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.  
at flash.display:DisplayObjectContainer/removeChild()  
at MethodInfo-9()

Here’s my code:

```auto
helpcoast.addEventListener(MouseEvent.MOUSE_OVER,sayhelp)
function sayhelp(e:MouseEvent):void
{
 var whatnow:Helpme = new Helpme;
 addChild(whatnow);
 whatnow.x = 650;
 whatnow.y = 140;
 
helpcoast.addEventListener(MouseEvent.MOUSE_OUT,stophelp)
function stophelp(e:MouseEvent):void
{
 removeChild(whatnow);
}
}

```

Thanks for the help. I’m still new to Flash/ActionScript

~Josh
