Check this plz

loadText = new LoadVars();
loadText.load("Maps/default.txt");
loadText.onLoad = function() {
    var $lengthx = Number(this.xsize);
    var $lengthy = Number(this.ysize);
    var $x, $y;
    _global.map = new Array();
    _global.land = new Array();
    for ($x=0; $x<=$lengthx; $x++) {
        map[$x] = new Array();
        land[$x] = new Array();
        for ($y=0; $y<=$lengthy; $y++) {
            map[$x][$y] = Number(this["M"+Number($x)+"-"+Number($y)]);
            land[$x][$y] = 1;
        }
    }
};

now if you see any problem in that code please tell me… or just say theres no errors(problems not errors) if you dont see any. I’ve been staring at it for ever and see nothing wrong.

note: this loads the map for my game from a .txt file.