Validate model data with Validator
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Model id="userData"> <userData> <username></username> </userData> </mx:Model> <mx:Form> <mx:FormHeading label="Sample Form"/> <mx:FormItem id="usernameItem" label="Name"> <mx:TextInput id="username"/> </mx:FormItem> <mx:FormItem> <mx:Button id="button" label="Submit" /> </mx:FormItem> </mx:Form> <mx:Binding source="username.text" destination="userData.username" /> <mx:Validator id="validator" source="{userData}" property="username" /> </mx:Application>