# Array problem?

**URL:** <https://forum.kirupa.com/t/array-problem/318741>\
**Category:** Uncategorized\
**Created:** [January 28, 2011, 7:47pm UTC](https://forum.kirupa.com/t/array-problem/318741 "2011-01-28T19:47:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![katana098](https://avatars.discourse-cdn.com/v4/letter/k/3be4f8/32.png) [@katana098](https://forum.kirupa.com/u/katana098)\
**Post date:** [January 28, 2011, 7:47pm UTC](https://forum.kirupa.com/t/array-problem/318741/1 "2011-01-28T19:47:00Z")

</div>

```auto

var map = new Array();
var tm = new Array();
//map[0].push("1");
function onLoad() {
	var b;
	b = 0;
	while (b<32) {
		tm.push("0");
		b++;
	}
	b = 0;
	while (b<32) {
		map.push(tm);
		b++;
	}
	var d = Math.floor(Math.random()*32)+1;
	var e = Math.floor(Math.random()*32)+1;
	map[1][1] = 1;
	var c;
	c = 0;
	while (c<map.length) {
	trace(map[c]);
	c++;
	}
	//trace(Math.floor(Math.random()*32)+1)
}
function onEnterFrame() {
}

```

If I use this code, I see in the output 1 as the value for the 2nd number of all the items, instead of just one.

Is there something I’m doing wrong?
