How we get global x,y position,when we are clicking in a datagrid cell.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
If you have access to the MouseEvent
//i.e., if you are inside the clickHandler(e:MouseEvent):void
trace(e.stageX + ", " + e.stageY)
Otherwise:
var obj:DisplayObject = theDesiredObject;
var globalPoint:Point = obj.localToGlobal(new Point(obj.mouseX, obj.mouseY));
trace(globalPoint.x + ", " + globalPoint.y);