# removeChild in parent MovieClip not working

**URL:** <https://forum.kirupa.com/t/removechild-in-parent-movieclip-not-working/322769>\
**Category:** flash\
**Created:** [June 2, 2011, 3:01pm UTC](https://forum.kirupa.com/t/removechild-in-parent-movieclip-not-working/322769 "2011-06-02T15:01:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SammyTheBear](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@SammyTheBear](https://forum.kirupa.com/u/SammyTheBear)\
**Post date:** [June 2, 2011, 3:01pm UTC](https://forum.kirupa.com/t/removechild-in-parent-movieclip-not-working/322769/1 "2011-06-02T15:01:28Z")

</div>

Hello folks!

I am trying to remove a movieclip from my main timeline but it is not working. you click a button that is in a movieclip that is dynamically added to the stage and it is supposed to remove a movieclip from the main stage. I added a trace to see if it was grabbing the right movieclip and it is. The error message that I am getting is:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

package MarketingQuestionaire  
{  
import flash.display.MovieClip;  
import flash.display.DisplayObject;  
import flash.display.DisplayObjectContainer;  
import fl.motion.MotionEvent;  
import fl.transitions.Tween;  
import fl.transitions.easing._;  
import fl.transitions.TweenEvent;  
import flash.events.EventDispatcher;  
import flash.events._;  
import fl.transitions._;  
import fl.transitions.easing._;  
import MarketingQuestionaire.\*;  
public class changeSlideWithNav extends MovieClip  
{  
public function changeSlideWithNav()  
{  
this.parent.removeChild(slideCounter.mySlide[0]);  
}  
}  
}

Your help would be great.
