Button with inner script
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle"> <mx:Button xmlns:mx="http://www.adobe.com/2006/mxml" click="logEvent(event)"> <mx:Script> import mx.logging.Log; import mx.logging.ILogger; private var myLogger:ILogger = Log.getLogger("buttonEvents"); private function logEvent(event:MouseEvent):void { myLogger.debug("LoggingButton " + event.target.id + " was clicked"); } </mx:Script> </mx:Button> </mx:Application>