# Unloading dynamic movie

**URL:** <https://forum.kirupa.com/t/unloading-dynamic-movie/204290>\
**Category:** Uncategorized\
**Created:** [October 18, 2006, 3:58pm UTC](https://forum.kirupa.com/t/unloading-dynamic-movie/204290 "2006-10-18T15:58:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbie\_geek](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@newbie\_geek](https://forum.kirupa.com/u/newbie_geek)\
**Post date:** [October 18, 2006, 3:58pm UTC](https://forum.kirupa.com/t/unloading-dynamic-movie/204290/1 "2006-10-18T15:58:40Z")

</div>

Hey guys,

so i am filling the stage with movies with a keypress fuunction. Each new movie is added as a new layer:

```auto
on (keyPress "u") {
	_root.collage_holder.attachMovie("anim3", "a" + (k++), k);
}

```

and i need to unload a movie that was loaded 5 keypresses before. But i am struggling with the syntax, i have tried

```auto
on (keyPress "v") {
	_root.collage_holder.attachMovie("anim2", "a" + (k++), k, {_x:500, _y:500, _xscale:30, _yscale:30});
	_root.collage_holder._level(k-1).unloadMovie;
}

```

but seemingly to no avail. Is the syntax just wrong, or is this simply the wrong approach.

---

<div class="post-metadata">

**Author:** ![newbie\_geek](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@newbie\_geek](https://forum.kirupa.com/u/newbie_geek)\
**Post date:** [October 23, 2006, 12:59pm UTC](https://forum.kirupa.com/t/unloading-dynamic-movie/204290/2 "2006-10-23T12:59:41Z")

</div>

noone care to take a stab at this one?

---

<div class="post-metadata">

**Author:** ![Deril](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/deril/32/63_2.png) [@Deril](https://forum.kirupa.com/u/Deril)\
**Post date:** [October 23, 2006, 1:28pm UTC](https://forum.kirupa.com/t/unloading-dynamic-movie/204290/3 "2006-10-23T13:28:09Z")

</div>

First of all you dont need to unload this mc from memory… (it is beeng used enyway…)

remove it instead… and use its dinamic name… not level.

```auto

 _root.collage_holder["a"+(k-5)].removeMovieClip();

```

Have fun flashing.
