# Is this enough?

**URL:** <https://forum.kirupa.com/t/is-this-enough/300144>\
**Category:** flash\
**Created:** [November 16, 2009, 9:35pm UTC](https://forum.kirupa.com/t/is-this-enough/300144 "2009-11-16T21:35:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scherzo](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Scherzo](https://forum.kirupa.com/u/Scherzo)\
**Post date:** [November 16, 2009, 9:35pm UTC](https://forum.kirupa.com/t/is-this-enough/300144/1 "2009-11-16T21:35:53Z")

</div>

I’m adding a (MovieClip / Class that extends MovieClip) from the library (using linkage) during runtime. This class has it’s own loader and loads and displays a couple of bitmaps.

This is the code:

```auto
    
private function contactView(e:MouseEvent):void
  {
           var _contactView:Contact = new Contact();
            
            _contactView.name = "Dynamic";
            
            position(_contactView);
            addChild(_contactView);
 }
        
private function mainView(e:MouseEvent):void
{
            removeChild(getChildByName("Dynamic"));
}

```

My question is, is using removeChild enough to make the instance of the class (\_contactView) eligible for garbage collection? Cause the only reference to the instance (the var) is inside the function, and not a private var in the class or something like that - if that were the case then I’d have to nullify the var too right?

Help would be very appreciated! :hangover:
