How's your Array set up? If you've got a two-dimensional array, it's easy: just use nested "for" loops and use the iterators for both the array values and the X/Y coordinates of the map.

I don't remember the specifics, but it should look something like...

`for(var yValue=0;yValue<mapHeight-1;yValue++){`

for(var xValue=0;xValue<mapWidth-1;xValue++){

setTileAt(xValue,yValue,myMap[xValue][yValue]);

}

}

I think setTileAt goes "row" *then* "column", so you might have to switch "xValue" and "yValue" in this example.

If it's a one-dimensional array, it's a little more complicated, but...

`for(var pos=0;pos<myMap.length-1;pos++){`

setTileAt(pos%mapHeight,Math.floor(pos/mapHeight),myMap[pos]);

}

That is, you'd take the mod of the iterator and the map's height to get the X coordinate, and round down the iterator divided by the map's height to get the Y coordinate. For example, if your map is 10 tiles high, then the value at pos 14 has an X of 4 (14 mod 10) and a Y of 1 (14/10 rounded down = 1).