I have 2 ball movieclips named Ball1, Ball2
I want to store those 2 balls in an array like this
ballArray = new Array([Ball1, Ball2]);
Then i want to pick the balls from the array and display it on the screen.
totalballs = 20;
ball1x = 10;
ball1y = 10;
ball2x = 10;
ball2y = 10;
for (var i = 0; i<totalballs; ++i)
{
var ball1name = “Balla1”+;
var ball2name = “Ballb1”+i;
_root.attachMovie(“Ball1”, ball1name, i); //Here instead of “Ball1” what should put to pick the ball from the array “ballArray”
_root.attachMovie(“Ball2”, ball2name, i); //Here instead of “Ball1” what should put to pick the ball from the array “ballArray”
_root[ball1name]._x = ball1x;
_root[ball1name]._y = ball1y;
_root[ball2name]._x = ball2x;
_root[ball2name]._y = ball2y;
//I donno if this is correct i want to lace the new balls next to each other in the row and the column.
ball1x++;
ball1y++;
ball2x++;
ball2y++;
}
Please any of these AS experts help me out.
Ash.