Tiles from Arrays Help

I have returned form the depths of nowhere in particular to once again, seek ActionScript help :smiley:

(if anyone even remembers me, I wasn’t about long ;-;

ANYWHO.
Seeking some help with a little tile-based program I’m whipping up.
Currently just running a few tests to see if I can get the basics of the system I would like to create to work (which it doesn’t, which is why I’m here in the firstplace :D)
ANYWAY.
currently, it works… sorta… but it only works for the last tile in the array =/ any help?

Lets see if I remember how to do this…


var depth = _root.getNextHighestDepth();
desert = new Array("brick", "sand", "brick", "sand");

onLoad = function(){
loadMap();
}

loadMap = function () {
        var tileX:Number = 0;
        var tileY:Number = 0;
        var tile:String;
        for (z=0; z<desert.length;z++) {
            tile = desert[z];
            trace(tile);
            _root.attachMovie(tile,tile,depth);
            _root[tile]._x = tileX;
            _root[tile]._y = tileY;
            tileX += 30;
            trace(tileX);
        }
    };