# Creating multidimensional arrays in Flash

**URL:** <https://forum.kirupa.com/t/creating-multidimensional-arrays-in-flash/252911>\
**Category:** flash\
**Created:** [February 25, 2008, 12:03pm UTC](https://forum.kirupa.com/t/creating-multidimensional-arrays-in-flash/252911 "2008-02-25T12:03:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kitsunegari](https://avatars.discourse-cdn.com/v4/letter/k/eb8c5e/32.png) [@kitsunegari](https://forum.kirupa.com/u/kitsunegari)\
**Post date:** [February 25, 2008, 12:03pm UTC](https://forum.kirupa.com/t/creating-multidimensional-arrays-in-flash/252911/1 "2008-02-25T12:03:04Z")

</div>

Hi  
this is just a simple question about the creation of multidimensional arrays in Flash

Is a loop the only solution to create such arrays in flash?  
Let’s say I want to create a 2 dimensional array with 10 raws in it, something like

```auto
myArray[0]['foo'] = 'AAAAA';
myArray[1]['foo'] = 'BBBBBB';
...

```

then I have to do:

```auto
var k;
for(k=0;k<10;k++){
    myArray[k] = new Array();
}

```

But what happens if I need 20 rows in the future, instead of 10? Does that mean I’ll have to update the loop count each time I want to add a new element?

Is there any simpler way to deal with multidimensional arrays in flash? I guess not but I just wanted to be sure

thanks
