# removeChild, The Target Was not got!

**URL:** https://forum.kirupa.com/t/removechild-the-target-was-not-got/320042
**Category:** Uncategorized
**Created:** [March 12, 2011, 9:04am UTC](https://forum.kirupa.com/t/removechild-the-target-was-not-got/320042 "2011-03-12T09:04:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ColinDavies](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@ColinDavies](https://forum.kirupa.com/u/ColinDavies)
#### Post date: [March 12, 2011, 9:04am UTC](https://forum.kirupa.com/t/removechild-the-target-was-not-got/320042/1 "2011-03-12T09:04:49Z")

</div>

Hi,  
Ok Im trying to remove a child clip after a drag,  
I manage to get the target name property,  
But getChildByName fails me

note:  
in the class thetargetName is a string  
and tobeRemoved is a DisplayObject.

```auto
 
public function dropIt(event:MouseEvent)
{
 /////
 event.target.stopDrag();
 theTargetName = event.target.name;
 trace("target is ",theTargetName);
 
 tobeRemoved = getChildByName(theTargetName);
 ///try
 { if (tobeRemoved )
  { trace ("target has been got ")}
  else 
  {trace("The Target was NOT got ");}
 }
 
 event.target.buttonMode = false;
 
}

```
