I’m using a for-statement to add a series of movieclips.
for (var i:Number = 0; i<10; i++) {
attachMovie(“myMC”, “myMC”+i, this.getNextHighestDepth());
}
Inside the movieclips I have some code. In this code I need the index-number of the movieclip. I’m staring the code off with:
var indexr:Number = _root.i;
The for-statement is so fast that all the movieclips get number 9 in the index-variable!
Is there any trick to manage this, like can I get the index from the name in some way? Or do I have to work around it in some more or less complicated way?
It is important that the movieclip knows what index it has.