duplicateMovieClip - loop Help Please!

Hi,
I’m trying to make a dress up game and have run into problems with duplicateMovieClip. I would like the user to drag and drop items of clothing from within a movieclip onto the stage, and when the movieclip is closed, that item of clothing should be still there. As the movieclip is small, the item will be small in size initially which will become bigger after it’s dropped on the stage. Each time the movieclip is opened, the user will be able to drag a new duplicate. This is the code I’ve written on the button ‘top’ inside movieclip ‘clothes’:

on (press) {
top.startDrag();
for (i=1; i<3; i++) {
duplicateMovieClip(“top”, “top”+i, this.getNextHighestDepth());
temp_mc = this[“top”+i];
}
temp_mc._width = 90;
temp_mc._height = 90;
temp_mc.onPress = function() {
startDrag(“temp_mc”);
};
temp_mc.onRelease = function() {
stopDrag();
};
}

2 problems with this code, the original ‘top’ does not disappear once the movieclip ‘clothes’ is closed, and the next time I open the movieclip, it doesn’t duplicate. What am I doing wrong?
I’d appreciate any help on this, flash file attached,
Thanks!


var tmp:MovieClip = _root.createEmptyMovieClip("source_mc", 1);
for(var i = 0;i<10;i++){
       var tmpClip:MovieClip = tmp.duplicateMovieClip("duplicate_" + i, _root.getNextHighestDepth(), {_x:tmp._x + (i + 1) * 5});
    trace(tmpClip._x);
}

provided by user Valaran