Get X and Y locations from Mouse Event
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="addListeners()">
<mx:Script>
private function customLogEvent(e:Event):void {
var a:MouseEvent = MouseEvent(e);
trace(a.localY + ":" + a.localX);
}
private function addListeners():void {
b1.addEventListener(MouseEvent.CLICK, customLogEvent);
}
</mx:Script>
<mx:VBox id="vb1">
<mx:Button id="b1" label="Click Me" />
</mx:VBox>
</mx:Application>
Related examples in the same category