# Creating a 2D array?

**URL:** <https://forum.kirupa.com/t/creating-a-2d-array/240904>\
**Category:** flash\
**Created:** [October 8, 2007, 4:23am UTC](https://forum.kirupa.com/t/creating-a-2d-array/240904 "2007-10-08T04:23:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nutcase88](https://avatars.discourse-cdn.com/v4/letter/n/f19dbf/32.png) [@nutcase88](https://forum.kirupa.com/u/nutcase88)\
**Post date:** [October 8, 2007, 4:23am UTC](https://forum.kirupa.com/t/creating-a-2d-array/240904/1 "2007-10-08T04:23:57Z")

</div>

Hi im trying to create a 2d array in flash and the fact that im a C++ programmer isnt helping me so im a little lost here.

Ive searched the forums and found something like this

[FONT=Courier New][LEFT][COLOR=#000000] **var** [/COLOR] urls:[COLOR=#0000FF]Array[/COLOR]=[COLOR=#000000] **new** [/COLOR] [COLOR=#0000FF]Array[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#0000FF]for[/COLOR]COLOR=#000000[/COLOR]  
[COLOR=#000000]{[/COLOR]  
urls[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR] = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000FF]Array[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#0000FF]for[/COLOR]COLOR=#000000[/COLOR]  
[COLOR=#000000]{[/COLOR]  
[COLOR=#0000FF]trace[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

However when i put it in the trace returns undefined.

I am looking to create something like a 14 x 14 2D grid where all the variables inside are 0 at the beginning.

I did something like so

```auto

myArray = newArray();
for(int i =0; i< 14;i++){
for(int k =0; k< 14;k++){
myArray*[k] =0;
}
}

```

But unfortunately it doesnt work.

Please advise, thanks in adv!
