# Problem with movie clips in Arrays

**URL:** <https://forum.kirupa.com/t/problem-with-movie-clips-in-arrays/194168>\
**Category:** Uncategorized\
**Created:** [July 21, 2006, 1:13am UTC](https://forum.kirupa.com/t/problem-with-movie-clips-in-arrays/194168 "2006-07-21T01:13:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tattered](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@Tattered](https://forum.kirupa.com/u/Tattered)\
**Post date:** [July 21, 2006, 1:13am UTC](https://forum.kirupa.com/t/problem-with-movie-clips-in-arrays/194168/1 "2006-07-21T01:13:42Z")

</div>

Ok I am having some small problems with Arrays and movie clips. in my array I have my movie clips names, now when i press on them they work fine, but my problem is that when i add 2 or more movie clip names to my array my array(i) comes back as undefined. I dont know why this happens…If someone could please help me that would be great. :).

```auto

myArray = new Array();
myArray = ["MC_0", "MC_1"];

for (i=0; i<= myArray.length -1; i++) {
	trace(eval(myArray*));
	eval(myArray*).onPress = function() {
		myX = eval(myArray.toString(i))._x;
		startDrag(this,true);
	}
	eval(myArray*).onRelease = function() {
		stopDrag();
		eval(myArray.toString(i))._x = myX;
	}
}

```

This is what I have so far.  
Thanks again 🙂
