Groups | Blog | Home
all groups > flash actionscript > february 2004 >

flash actionscript : ARGH... this code not working... WHY?


Karim N
2/8/2004 7:49:28 PM
Here it is


function checkWalk(x,y)
trace (map[y][x][0])
if (map[y][x][0] == 2)
return (1)
} else
return (0)



This code returns 0 while tracing 2

I can't understand WHY? what's going on?
Jack
2/8/2004 10:18:38 PM
not an answer, merely out of curiousity -

trace (map[y][x][0]+" | "+typeof map[y][x][0]); // is it string or number ?



[quoted text, click to view]

Karim N
2/8/2004 11:04:18 PM
Hmmm... now THAT is strange. It is returning a type "Object" so I added an
extra level to the reference: map[y][x][0][0] and it works...

BUT... it shouldn't... this is wierd..

Thanks for the hint... at least it's working now, but I'm not sure wh
AddThis Social Bookmark Button