PDA

View Full Version : How to create multiple movieclips in sequence?



Nitrium
September 3rd, 2007, 10:55 AM
Hello people. I've tried to search here in the forum but had no sucess. In Actionscript 2.0, there were many times when I created multiple movieclips in sequence - for example, doing multiple "attachMovie" methods to build a items menu. Well, as there are no more duplicateMovieClip, attachMovie methods or whatever in AS3, how can I do this? I'm trying to make something like:



private function BuildSubItems(param_idx:int):void {
var ["subitem_" + param_idx]:DropDown_Menu_Item = new DropDown_Menu_Item(xmlData, menuw, 1, 2, 1);
item_pos.addChild("subitem_" + param_idx);
}

for (var x:int = 1; x <= 10; x++) {
BuildSubItems(x);
}


Of course I know that the content after the "var" statement doesn't works, but I'm trying to illustrate what I would like to do. Can anyone help me, please? Thanks! :)