Use ActionScript to validate form data
<?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.validators.Validator; private var _validator:Validator; private function initializeHandler(event:Event):void { _validator = new Validator( ); _validator.source = username; _validator.property = "text"; } </mx:Script> <mx:Form> <mx:FormHeading label="Sample Form"/> <mx:FormItem label="Name"> <mx:TextInput id="username"/> </mx:FormItem> <mx:FormItem> <mx:Button id="button" label="Submit"/> </mx:FormItem> </mx:Form> </mx:Application>