Cast Event object for only property access
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="addListeners()">
<mx:Script>
private function customLogEvent(e:Event):void {
trace(MouseEvent(e).localY + ":" + MouseEvent(e).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