开发者

How we get global x,y position,when we are clicking in a datagrid cell

开发者 https://www.devze.com 2022-12-19 10:08 出处:网络
How we get global x,y position,when we are clicking in a d开发者_开发技巧atagrid cell.If you have access to the MouseEvent

How we get global x,y position,when we are clicking in a d开发者_开发技巧atagrid cell.


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消