# removeChild not working

**URL:** https://forum.kirupa.com/t/removechild-not-working/304569
**Category:** flash
**Created:** [February 10, 2010, 4:27am UTC](https://forum.kirupa.com/t/removechild-not-working/304569 "2010-02-10T04:27:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![taha0khan](https://avatars.discourse-cdn.com/v4/letter/t/d2c977/32.png) [@taha0khan](https://forum.kirupa.com/u/taha0khan)
#### Post date: [February 10, 2010, 4:27am UTC](https://forum.kirupa.com/t/removechild-not-working/304569/1 "2010-02-10T04:27:42Z")

</div>

Hey everyone,  
I am new to flash as3, I am trying to figure out how do I remove a child after I add one into a mc.

here is my code:

var two\_mc:Two=new Two();  
pic\_mc.addChild(two\_mc);  
pic\_mc.removeChild(pic\_mc.two\_mc);

The error that is shows up is:  
TypeError: Error #2007: Parameter child must be non-null.  
at flash.display::DisplayObjectContainer/removeChild()  
at test2mc\_fla::MainTimeline/frame1()

I cant remove the child if i add a child inside a movieclip, is there something that iam doing wrong ?

Thank you
