当我们点击数据网格单元格时,我们如何获得全局x,y位置。
答案 0 :(得分:5)
如果您有权访问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);