# Tile map help

**URL:** <https://forum.kirupa.com/t/tile-map-help/226256>\
**Category:** Uncategorized\
**Created:** [May 19, 2007, 11:19am UTC](https://forum.kirupa.com/t/tile-map-help/226256 "2007-05-19T11:19:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![idjit](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@idjit](https://forum.kirupa.com/u/idjit)\
**Post date:** [May 19, 2007, 11:19am UTC](https://forum.kirupa.com/t/tile-map-help/226256/1 "2007-05-19T11:19:34Z")

</div>

stop();

fscommand ( “allowscale”, false );

tileW = 16;  
tileH = 16;

myMap = [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,57],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,56],  
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18] ];

function buildMap (map) {  
var mapWidth = map[0].length;  
var mapHeight = map.length;  
for (var i = 0; i \< mapHeight; ++i) {  
for (var j = 0; j \< mapWidth; ++j) {  
this.attachMovie(“tile”, “t\_”+i+"_"+j, ++d);  
this["t_"+i+"_"+j].x = (j\*tileW);  
this["t"+i+"_"+j]._y = (i\*tileH);  
this["t_"+i+"\_"+j].gotoAndStop(map\*[j]+1);  
}  
}  
}

setInterval(buildMap (myMap),100);

can somebody tell me what’s wrong with this??? please??? for some reason it only draws the last tile in the entire map… :hair:
