# Populating and accessing an array in a movie clip

**URL:** <https://forum.kirupa.com/t/populating-and-accessing-an-array-in-a-movie-clip/265733>\
**Category:** flash\
**Created:** [July 11, 2008, 6:41pm UTC](https://forum.kirupa.com/t/populating-and-accessing-an-array-in-a-movie-clip/265733 "2008-07-11T18:41:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Engywook](https://avatars.discourse-cdn.com/v4/letter/e/bc8723/32.png) [@Engywook](https://forum.kirupa.com/u/Engywook)\
**Post date:** [July 11, 2008, 6:41pm UTC](https://forum.kirupa.com/t/populating-and-accessing-an-array-in-a-movie-clip/265733/1 "2008-07-11T18:41:18Z")

</div>

Googling around, I see plenty of advice on populating an array **with** movie clips. Fine, useful, but I already know how to do that.

What I’m trying to is populate an array that occurs **in each instance of** a movie clip:

```auto

for(i=0; i<something; i++) {
//attach the movie first
//the clip with linkage an MC has an empty array called someStuff
   clipName="anMC_"+i;
   thisClip=_root.attachMovie("anMC", clipName, i);
//now populate the array someStuff in each of the clips
// ***THIS DOES NOT SEEM TO WORK***
   for(j=0; j<somethingElse; j++) {
       thisClip.someStuff[j]=otherStuff[j];     
   }
}

```

Tried giving the movie clip some time, the stage some time, etc. No matter what I do, though, the array in all instances of anMC comes out completely empty.

Would simplify what I’m trying to do a great deal, but that’s presuming that what I’m talking about is even possible. So… my question basically is… can this even be done? Apparently it’s not possible… if I’m right about this, why is this so?

---

<div class="post-metadata">

**Author:** ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)\
**Post date:** [July 11, 2008, 6:53pm UTC](https://forum.kirupa.com/t/populating-and-accessing-an-array-in-a-movie-clip/265733/2 "2008-07-11T18:53:40Z")

</div>

sure it does.

```auto

thisClip.someStuff = new Array();
for(j=0; j<somethingElse; j++) {
       thisClip.someStuff[j]=otherStuff[j];
}

```
