I have a bunch of movieclips on the stage with instance names ball1 - ball200. I was hoping I didn't have to create an array and manually set all the instance names into the array
ballArray = [ball1, ball2,ball3, etc];
I was trying to get a for loop to cycle through and add each instance name to my array like so:
function createTheArray():void{
for(var i:int = 1; i < 20;i++){
ballArray.push(ball + i);
trace(newArray[i])
}
}
But I keep getting back undefined array index's. It also tells me that I doesn't know what "ball" is. How would you use part of a instance name and combine it with the index value of the loop. So that the first time through you get ball1 as the first index value of your array?