# Using arrays for more than 1 MC

**URL:** https://forum.kirupa.com/t/using-arrays-for-more-than-1-mc/297952
**Category:** flash
**Created:** [October 11, 2009, 3:28am UTC](https://forum.kirupa.com/t/using-arrays-for-more-than-1-mc/297952 "2009-10-11T03:28:57Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sora72](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sora72](https://forum.kirupa.com/u/sora72)
#### Post date: [October 11, 2009, 3:28am UTC](https://forum.kirupa.com/t/using-arrays-for-more-than-1-mc/297952/1 "2009-10-11T03:28:57Z")

</div>

i’m trying to use an array to attach up to 4 movie clips, using the same script. My code I’m using to attach looks like:

```auto
if(en<=4){
            EA[t] = attachMovie("enemy", "enemy"+t, depth++);
            EA[t]._x = random(300);
            EA[t]._y = random(300);
            en+=1
                         t+=1
        }

```

This part works fine, but what doesn’t work is the script I try to add to the movieclips. If i add EA[t].\_x += 10, then only the lastly created enemy moves. How do i make it so that all of the enemies move?
