Using the ZipCodeValidator class
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Form id="addressForm"> <mx:FormItem id="zipCodeItem" label="Zip Code"> <mx:TextInput id="zipInput" /> </mx:FormItem> <mx:FormItem id="submitArea"> <mx:Button label="Submit" /> </mx:FormItem> </mx:Form> <mx:ZipCodeValidator id="zipV" source="{zipInput}" property="text" domain="US or Canada" /> </mx:Application>