Application initialize event
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
import mx.controls.Alert;
private function initializeHandler(event:Event):void {
button.addEventListener(MouseEvent.CLICK, clickHandler);
}
private function clickHandler(event:MouseEvent):void {
Alert.show(event.toString( ));
}
</mx:Script>
<mx:Button id="button" />
</mx:Application>
Related examples in the same category