# Unload Movie

**URL:** https://forum.kirupa.com/t/unload-movie/234680
**Category:** Uncategorized
**Created:** [August 4, 2007, 3:56pm UTC](https://forum.kirupa.com/t/unload-movie/234680 "2007-08-04T15:56:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![everland](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@everland](https://forum.kirupa.com/u/everland)
#### Post date: [August 4, 2007, 3:56pm UTC](https://forum.kirupa.com/t/unload-movie/234680/1 "2007-08-04T15:56:41Z")

</div>

hi,

i use array to group my button together and when the user click on the button the second time, it will attach another mc over the previous attachMc. I dont know how to script them in such a way that when user click the button, how to unload the previous attachMc?anyone know how to solve this problem or have an relevent site that i can seek help from? below is my script. 🙂

var listMenu:Array = [{mc:aboutUs\_mc, attachFile:“contentAboutUs”}, {mc:catalogue\_mc, attachFile:“contentCatalogue”}, {mc:clearance\_mc, attachFile:“contentClearance”}];

function init() {  
for (var element in listMenu) {  
var menu:MovieClip = listMenu[element].mc;  
menu.attachFile = listMenu[element].attachFile;  
menu.onRelease = doClick;  
}  
}  
init();

function doClick() {  
contentbg\_mc.attachMovie(this.attachFile, “listMenu\_mc”, 10);  
[COLOR=Purple]//how to script to unload the previous attachMc? [/COLOR]  
}

thanks in advanced 😃
