# Removing movieclips using a loop and unloadMovie()

**URL:** <https://forum.kirupa.com/t/removing-movieclips-using-a-loop-and-unloadmovie/221453>\
**Category:** Uncategorized\
**Created:** [April 4, 2007, 2:24pm UTC](https://forum.kirupa.com/t/removing-movieclips-using-a-loop-and-unloadmovie/221453 "2007-04-04T14:24:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pdjohnson](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/pdjohnson/32/3500_2.png) [@pdjohnson](https://forum.kirupa.com/u/pdjohnson)\
**Post date:** [April 4, 2007, 2:24pm UTC](https://forum.kirupa.com/t/removing-movieclips-using-a-loop-and-unloadmovie/221453/1 "2007-04-04T14:24:16Z")

</div>

I would like to be able to pass in a string like “plot12” as the plotNumber so I can remove the movieclip of the same name from the moive. How do I create a variable so I can address the movieclip using the varaible passed in to the function???

function getSold(plotNumber)  
{

```
currentID = parseInt(plotNumber);

 unloadMovie ("_root.plot17");//THIS WORKS
 _root.currentID.unloadMovie();//THIS DOES NOT

```

}
