Unload Movie

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. :slight_smile:

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 :smiley: