# Trouble Instatiating Multidimensional Array Of Movie Clips From Inside Of A Class

**URL:** <https://forum.kirupa.com/t/trouble-instatiating-multidimensional-array-of-movie-clips-from-inside-of-a-class/247851>\
**Category:** flash\
**Created:** [December 31, 2007, 3:02am UTC](https://forum.kirupa.com/t/trouble-instatiating-multidimensional-array-of-movie-clips-from-inside-of-a-class/247851 "2007-12-31T03:02:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![svenson](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@svenson](https://forum.kirupa.com/u/svenson)\
**Post date:** [December 31, 2007, 3:02am UTC](https://forum.kirupa.com/t/trouble-instatiating-multidimensional-array-of-movie-clips-from-inside-of-a-class/247851/1 "2007-12-31T03:02:09Z")

</div>

I am trying to set up a script that will generate a matrix repeating the same symbol X by Y times. For example, b(3,2); should generate…

OOO  
OOO

…and after many days of being tested by this problem I have narrowed the location of my problem down to what can be seen up in the following.

```auto

for (a=0; a<4; a++){
    for (b=0; b<4; b++){
        var z:Number = ((a*4)+b);
        _root.attachMovie("Light", ("L" + z), _root.getNextHightestDepth(), {_x:(a*45), _y:(b*45)});
    }
}

```

For some reason, that loop will only attach one copy of my “Light” movie. I cannot seem to figure out why more are not added. I am putting that code on the first frame of my movie. There is nothing else in my project yet.

I have compared my array to [http://www.kirupa.com/developer/actionscript/multiDimArrays\_attach.htm](http://www.kirupa.com/developer/actionscript/multiDimArrays_attach.htm) but I am still unable to find the problem. Any help is greatly appreciated.
