I have built an isometric plane and isometric plane contains 64 grass object and one box object that move on click.
A MouseEvent.CLICK handler is attached to each grass object.
I have drawn grass and box using as3isolib. Both are as3isolib objects.
When the user clicks at any of the grass object that is anywhere on the plane, the box moves to that position but I can not understand if each time new index value is returned for the grass and box objects ?
public function OverOnEachTile(evt:ProxyEvent):void
{
var targetGrassObject:IsoSprite = evt.target as IsoSprite;
scene.getChildIndex(targetGrassObject) // returns different value for same tile or grass object
scene.getChildIndex(isoBox1); // returns different value for same single box instance of type isoBox
}
Yes Z-Sorting is done automatically.