I've got a quite embarrassing problem. I don't know how to properly sort my objects for this tilebased game I got. I'm using the formula
depth = y *maxX +x
but that's just temporary as I want to be able to place more then one object at the same tile. Actually it's not hard to figure out how to fix it - the real problem lies in the fact that flash swaps depths if the depth specified is already in use. Therefore it works sometimes depending on which depth the other mc got.

I made this example, and I'm attaching the .fla aswell.