I am creating a bunch of objects in an array. I'm used to doing this iteratively, like
for(i:int; i < number; i++){
ball= new Ball;
balls.push(ball);
}
and then later I can make reference to balls[i]. Now however I'm creating the objects with mouse click, not with a for loop, so I don't have that [i], so my other code makes reference to just "ball", which means it affects only whichever one was just created. Is there any reasonable way to 'name' each object arbitrarily so I can later say "each of you go off and do your own thing, and ignore everyone else"?