# Newbie: 2-dimensional array question

**URL:** <https://forum.kirupa.com/t/newbie-2-dimensional-array-question/192417>\
**Category:** flash\
**Created:** [June 28, 2006, 1:46pm UTC](https://forum.kirupa.com/t/newbie-2-dimensional-array-question/192417 "2006-06-28T13:46:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samcaneh](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@samcaneh](https://forum.kirupa.com/u/samcaneh)\
**Post date:** [June 28, 2006, 1:46pm UTC](https://forum.kirupa.com/t/newbie-2-dimensional-array-question/192417/1 "2006-06-28T13:46:24Z")

</div>

Hey All,  
I’m brand spankin’ new to Flash, but need to developp a simple app for work.

I can get a 2-D array to work by setting it up like so:

i)  
myDouble = [[1, 2, 3, 4],  
[1, 2, 3, 4],  
[1, 2, 3, 4],  
[1, 2, 3, 4]];

But what if the array will actually be pretty big (say, myDouble[750][550]) and I want to loop through it to fill it up… I tried something like this, but it doesn’t quite work like I would expect it to:

ii)  
for (var i = 0; i\<100; i++) {  
for (var j = 0; j\<100; j++) {  
//set all values to  
myMap1\*[j] = 0;  
}  
}  
…  
The weird thing is, if I do this:  
myDouble = [[1, 2, 3, 4],  
[1, 2, 3, 4],  
[1, 2, 3, 4],  
[1, 2, 3, 4]];

for (var i = 0; i\<4; i++) {  
for (var j = 0; j\<4; j++) {  
//set all values to 0  
myMap1\*[j] = 0;  
}  
}

Then, all values ARE in fact set to zero. So, I must not be declaring the array correctly in ii). Any tips?

Thanks!!
