I tried this :
in the classe Mapinteraction manager i have this :
Code: Select all
if (evt.type == MapInteractionEvent.SKIN_CLICK)
{
var tile:Tile = skin.parent.parent as Tile;
MyGlobal.clickedPnjName = skin.name;
MyGlobal.clickedTile = tile;
main.logTrace("le nom de la skin est : " + skin.name);
main.logTrace("global var tile : " + tile); //here i set a constant var for the tile clicked, the trace gives me the good tile name...
var localXcoordinates:Number = Number(tile.x);
var localYcoordinates:Number = Number(tile.y);
main.logTrace("Tile local coordinates = " + localXcoordinates+","+localYcoordinates); //but here it trace "Tile local coordinates = 0,0;" But it's not possible...
on the stage object, if i click on a tile
Code: Select all
var point:Point = localToGlobal(new Point(MyGlobal.clickedTile.x, MyGlobal.clickedTile.y)); // but of course this don't work cause the coordinates are not good.
As i found it with trace in the skinclick event, the coordinates founded for the tile are not good.
So, what did i do wrong ??