# Garbage Collection with MovieClips

**URL:** https://forum.kirupa.com/t/garbage-collection-with-movieclips/305761
**Category:** flash
**Created:** [March 3, 2010, 7:14am UTC](https://forum.kirupa.com/t/garbage-collection-with-movieclips/305761 "2010-03-03T07:14:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Farzher](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@Farzher](https://forum.kirupa.com/u/Farzher)
#### Post date: [March 3, 2010, 7:14am UTC](https://forum.kirupa.com/t/garbage-collection-with-movieclips/305761/1 "2010-03-03T07:14:40Z")

</div>

```auto
var a:MovieClip = new MovieClip();
var dict:Dictionary = new Dictionary(true);
dict[a] = true;
a = null;

```

How come the movieclip never gets cleared, but if i change MovieClip to Object it gets cleared, im using this code to check if its cleared or not

```auto
sup();
function sup():void {
	new Wait(30, sup);
	for(var key:* in dict) {
		trace("data is still there");
		return;
	}
	trace("data was cleared");
}

```
