Mark click event as its own tag
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Button> <mx:click> mx.controls.Alert.show("Example"); </mx:click> </mx:Button> </mx:Application>