# removeChild(getChildByName("backButton")); //help please

**URL:** https://forum.kirupa.com/t/removechild-getchildbyname-backbutton-help-please/313937
**Category:** flash
**Created:** [September 14, 2010, 9:45am UTC](https://forum.kirupa.com/t/removechild-getchildbyname-backbutton-help-please/313937 "2010-09-14T09:45:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![oluc](https://avatars.discourse-cdn.com/v4/letter/o/cc9497/32.png) [@oluc](https://forum.kirupa.com/u/oluc)
#### Post date: [September 14, 2010, 9:45am UTC](https://forum.kirupa.com/t/removechild-getchildbyname-backbutton-help-please/313937/1 "2010-09-14T09:45:52Z")

</div>

hi!

i added a display object like so:

```auto

var backButton:BtnSMenu = new BtnSMenu();
backButton.name = "backButton";
mainHolder.parent.parent.parent.addChild(backButton);

```

but then later in the code i want to remove the child so i did this:

```auto

mainHolder.parent.parent.parent.removeChild(getChildByName("backButton"));

```

but i get this error:  
TypeError: Error #2007: Parameter child must be non-null.

do you know what i am doing wrong here?

thanks for any help!
