# \[AS 2.0\] Problems with arrays

**URL:** <https://forum.kirupa.com/t/as-2-0-problems-with-arrays/133519>\
**Category:** Uncategorized\
**Created:** [January 9, 2005, 3:28pm UTC](https://forum.kirupa.com/t/as-2-0-problems-with-arrays/133519 "2005-01-09T15:28:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Snake\_Steel](https://avatars.discourse-cdn.com/v4/letter/s/8dc957/32.png) [@Snake\_Steel](https://forum.kirupa.com/u/Snake_Steel)\
**Post date:** [January 9, 2005, 3:28pm UTC](https://forum.kirupa.com/t/as-2-0-problems-with-arrays/133519/1 "2005-01-09T15:28:10Z")

</div>

I’m trying to store the initial X position of five movieClips in an Array by looping through it. Should be no worries, but I only end up with “Undefined” when I trace the array afterwards…

```auto
// how many menu items
var numMenuItems:Number = 5;

// create two arrays which will hold information
var navStatus:Array = new Array(numMenuItems);
var ballX:Array = new Array(numMenuItems);

// put data in arrays
for(var i:Number = 0; i < numMenuItems; i++){
	navStatus* = "closed";

	var clip = ((i+1)+"_mc");
	ballX* = this.ball[clip]._x;
}
// check array
trace(ballX);

```

Ok, it’s the last bit I’m having trouble with. I want to read the X coordinate of the five ball movieClips (ball1\_mc, ball2\_mc…ball5\_mc), and store that number in the BallX array. So I need to get the loop to work so I don’t have to type this in manually…

…any help at all would be great.

thansk guys 🙂
