# Understanding removeMovieClip()

**URL:** <https://forum.kirupa.com/t/understanding-removemovieclip/165240>\
**Category:** flash\
**Created:** [October 9, 2005, 5:01pm UTC](https://forum.kirupa.com/t/understanding-removemovieclip/165240 "2005-10-09T17:01:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gvsboy](https://avatars.discourse-cdn.com/v4/letter/g/f1d935/32.png) [@gvsboy](https://forum.kirupa.com/u/gvsboy)\
**Post date:** [October 9, 2005, 5:01pm UTC](https://forum.kirupa.com/t/understanding-removemovieclip/165240/1 "2005-10-09T17:01:37Z")

</div>

Hello Kirupa Forums,

I’m relatively new to Flash and AS, and have been lurking around this site for a little while now (excellent tutorials by the way!) I’ve finally come across a coding problem I cannot solve, so I decided to ask you experts and see what you think:

I’m creating a simple movie with some movie clips of scenery (mountains, trees, etc.) and falling snow. The problem lies in the snow. The way it is set up now, I have the following code on the first frame of the main movie to constantly create little flake MCs (thanks to Kirupa for the duplicate movie tutorial):

```auto
onEnterFrame = function()
{
	i = i + 1;
	this.attachMovie("circle_mc", "circle" + i, 10 + i);
}

```

That works fine; however, when each flake reaches the bottom of the stage, I’d like to remove them from the movie. Each flake is an MC instance inside another MC, called flake\_mc. The instance has this code:

```auto
onClipEvent (load) {
   this._x = random(250);
   this._y = 0;
   this._alpha = random(100);
}

onClipEvent (enterFrame)
{
	this._y = this._y + 5;
	if (this._y >= 150)
	{
		this.removeMovieClip();
	}
}

```

Everything works great except the removeMovieClip part. I tried a few variations, but nothing seems to work. Any ideas? Or any comments on a better way to control and maintain a huge amount of temporary MCs?

Thanks in advance for any help,

-gvsboy
