# .getNextHighestDepth problem

**URL:** <https://forum.kirupa.com/t/getnexthighestdepth-problem/156863>\
**Category:** flash\
**Created:** [July 28, 2005, 1:02pm UTC](https://forum.kirupa.com/t/getnexthighestdepth-problem/156863 "2005-07-28T13:02:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![suoh\_ryu](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@suoh\_ryu](https://forum.kirupa.com/u/suoh_ryu)\
**Post date:** [July 28, 2005, 1:02pm UTC](https://forum.kirupa.com/t/getnexthighestdepth-problem/156863/1 "2005-07-28T13:02:53Z")

</div>

hi i am in the middle of making a flash rpg and i am starting out with tiles i was using some code i found on here now i am stuck i think the code i have been using is for MX 2004 not MX which is what i have so i was wondering if there was a subsitute for the code

this.getNextHighestdepth()

if u want to know what the code fully is its the rpg programming under actionscript page 6

mvWdth = 320;  
mvHght = 320;  
tileWdth = 16;  
tileHght = 16;  
itemMap1 = [[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, 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, 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, 1, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0]];  
function placeItems(map) {  
\_root.attachMovie(“blank”, “items”, this.getNextHighestDepth());  
var mapWdth = map[0].length;  
var mapHght = map.length;  
for (var i = 0; i\<mapHght; i++) {  
for (var j = 0; j\<mapWdth; j++) {  
switch (map\*[j]) {  
case 1:  
\_root.items.attachMovie(“ryu\_mc”, “ryu\_mc”, d++);  
\_root.items.ryu\_mc.\_x = (\_root.tileWdth\* j);  
\_root.items.ryu\_mc.\_y = (\_root.tileHght\* i);  
}  
}  
}  
}  
placeItems(itemMap1);

mvWdth = 320;  
mvHght = 320;  
tileWdth = 16;  
tileHght = 16;  
tile0 = function () { };  
tile0.prototype.pos = 1;  
tile0.prototype.barrier = false;  
tile1 = function () { };  
tile1.prototype.pos = 2;  
tile1.prototype.barrier = true;  
tile2 = function () { };  
tile2.prototype.pos = 3;  
tile2.prototype.barrier = true;  
map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 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, 0, 0, 0, 0, 0, 0, 0]];  
function MapMaker(map) {  
_root.attachMovie(“blank”, “tiler”, d++);  
var mapWdth = map[0].length;  
var mapHght = map.length;  
for (var i = 0; i\<mapHght; i++) {  
for (var j = 0; j\<mapWdth; j++) {  
var name = "tile_"+j+"\_"+i;  
\_root[name] = new \_root"tile"+map\*[j];  
\_root.tiler.attachMovie(“tileset1”, name, i_100+j_2);  
\_root.tiler[name].\_x = (j\*\_root.tileWdth);  
\_root.tiler[name].\_y = (i\*\_root.tileHght);  
\_root.tiler[name].gotoAndStop(\_root[name].pos);  
}  
}  
}  
MapMaker(map1);

please anyhelp people can give me would be appricianted i need to figure out what i am doing wrong or if there is a subsitute for the .getNextHighestdepth() code

Im using Macromedia Flash MX not Macromedia Flash MX 2004 just so you know

well i shall be waiting thanks in advanced
