Data Validation Through Data Bindings
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Model id="userData"> <userInfo> <email>{emailInput.text}</email> <phone>{phoneInput.text}</phone> </userInfo> </mx:Model> <mx:EmailValidator source="{emailInput}" property="text" /> <mx:PhoneNumberValidator source="{phoneInput}" property="text" /> <mx:Panel title="Validation through Data Bindings" horizontalAlign="center"> <mx:Label text="Enter an email address:" /> <mx:TextInput id="emailInput" /> <mx:TextInput id="phoneInput" /> </mx:Panel> </mx:Application>