Would someone please explain how z-sorting works ?
i have this example from someone here ,
Code:xp=new Array() yp= new Array() for (n=0; n<=10; n++) { set("level"+n, n) xp[n]=this[n]._x yp[n]= this[n]._y } top = 10; function swap (caller) { if (top != caller) { top = caller; // colocando al llamado en el espacio vacio for (n=1; n<=10; n++) { this[n].gotoAndStop(1); if (eval("level"+n) == caller) { this[eval("level"+n)].swapDepths(this[0]); set("level"+n, 0) } } this[caller].gotoAndStop(2); set("level"+0, caller) // moviendo el espacio vacio hacia el 10 for (n=9; n>=1; n--) { this[level10].swapDepths(this[eval("level"+n)]); temp = level10; level10 = eval("level"+n); set("level"+n, temp) // intercambiando el espacio vacio con el que fue llamado if (eval("level"+10) == 0) { this[level10].swapDepths(this[level0]); level10 = caller; level0 = 0; break; } } } }


Reply With Quote