# Simple Array Help

**URL:** <https://forum.kirupa.com/t/simple-array-help/193494>\
**Category:** programming\
**Created:** [July 13, 2006, 6:00pm UTC](https://forum.kirupa.com/t/simple-array-help/193494 "2006-07-13T18:00:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![messi](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@messi](https://forum.kirupa.com/u/messi)\
**Post date:** [July 13, 2006, 6:00pm UTC](https://forum.kirupa.com/t/simple-array-help/193494/1 "2006-07-13T18:00:39Z")

</div>

I have 3 ball movieclips named Ball1, Ball2, Ball3  
I want to store those 2 balls in an array like this  
ballArray = new Array([Ball1, Ball2, Ball3]);

Then i want to pick the balls from the array and diplay it on the screen.  
for (var i = 0; i\<totalballs; ++i)  
{  
var name = “Ball1”+i;

\_root.attachMovie(“Ball1”, name, i);  
\_root[name].\_x = x;  
\_root[name].\_y = y;  
}
