单击数据网格单元格时如何获取全局x,y位置 [英] How we get global x,y position,when we are clicking in a datagrid cell
本文介绍了单击数据网格单元格时如何获取全局x,y位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我们单击数据网格单元格时,如何获得全局x,y位置.
How we get global x,y position,when we are clicking in a datagrid cell.
推荐答案
如果可以访问MouseEvent
//i.e., if you are inside the clickHandler(e:MouseEvent):void
trace(e.stageX + ", " + e.stageY)
否则:
var obj:DisplayObject = theDesiredObject;
var globalPoint:Point = obj.localToGlobal(new Point(obj.mouseX, obj.mouseY));
trace(globalPoint.x + ", " + globalPoint.y);
这篇关于单击数据网格单元格时如何获取全局x,y位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文