Actionscript, Appending variable values to instance names
Posted on November 11, 2007Here is a bit of code for those looking to append variables to instance names of your movieclips. It just so happens I had to deal with this situation at one point and will share it with everyone now.
The following is sample code for a game I had starting in actionscript 2, flash 8.
_root.attachMovie(“bomb”,”bomb”+drops,_root.getNextHighestDepth());
clipa = this["bomb"+drops];
clipa._x = somevalue;
Now for actionscript 3, thats been change, it’s just a matter of setting the .name portion of your movieclip.
Categories: Uncategorized