Set Button click event handler method with both ActionScript and MXML
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="left">
<mx:Script>
import mx.controls.Alert;
public function initApp():void {
button1.addEventListener(MouseEvent.CLICK, customEventHandler);
}
public function customEventHandler(event:Event):void {
Alert.show("The mouse was clicked.");
}
</mx:Script>
<mx:Button id="button1" label="Click To Test Here" click="customEventHandler(event)"/>
</mx:Application>