Form Button
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> import flash.events.MouseEvent; import mx.controls.Alert; private function submitLogin(eventObj:MouseEvent):void { Alert.show("Login Requested"); } </mx:Script> <mx:Form defaultButton="{mySubmitButton}"> <mx:FormItem label="Username"> <mx:TextInput id="username" width="100" /> </mx:FormItem> <mx:FormItem label="Password"> <mx:TextInput id="password" width="100" displayAsPassword="true" /> </mx:FormItem> <mx:FormItem> <mx:Button id="mySubmitButton" label="Login" click="submitLogin(event);" /> </mx:FormItem> </mx:Form> </mx:Application>