# Array Defualts

**URL:** <https://forum.kirupa.com/t/array-defualts/83058>\
**Category:** Uncategorized\
**Created:** [March 15, 2005, 9:01pm UTC](https://forum.kirupa.com/t/array-defualts/83058 "2005-03-15T21:01:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Templarian](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/templarian/32/7152_2.png) [@Templarian](https://forum.kirupa.com/u/Templarian)\
**Post date:** [March 15, 2005, 9:01pm UTC](https://forum.kirupa.com/t/array-defualts/83058/1 "2005-03-15T21:01:03Z")

</div>

Okay ive tried a bunch of ways… some were really dumb.  
Q. How do I set the width of the array and length and set each of the values in it to the same number.  
This is for a game im working on. (Tile like you could of guessed.)  
Note: I know you use for loops to find the x and y of the values… This doesnt work, but think its how it suppose to work. (or im horribly off in either way plz help fix)

```auto
 _global.ymap = 4;
_global.xmap = 4;
for (y=0; y<_global.ymap; y++) {
for (x=0; x<_global.xmap; x++) {
_global.map[y][x] = 1;
}
}
trace(_global.map[4][4]); 

```
