I’m having problems duplicating/attaching movie clips within a movie clip.
I have a panel_MC on stage. I want to be able to dynamically attach several movie clips (essentially they will be buttons) into this panel_MC. Unfortunately when I use mc.attachMovie() the previous movie clips are overridden…
here is some of my code.
var noOfIcons:Number = 10; /* 10 for easiness sake.. real number will be determined by a function */
var iconBtnXPos:Number = 0;
for (i=1; i<noOfIcons;i++){
var btnNo:Number = i;
panel.createEmptyMovieClip("container"+btnNo,this.getNextHighestDepth());
whereIsThis = panel["container"+btnNo].attachMovie("iconButton","icon"+btnNo, this.getNextHighestDepth());
trace("whereIsThis :"+ whereIsThis);
this.panel["container"+btnNo]["icon"+btnNo].iconLabel.iconText.text = btnNo;
this.panel["container"+btnNo]._x = iconBtnXPos;
this.panel["container"+btnNo]["icon"+btnNo].onRelease = iconBtnRelease;
iconBtnXPos +=52; //calculate next _x button position
}
Any ideas?