Set validator domain
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> import mx.events.ValidationResultEvent; import mx.validators.ZipCodeValidator; public function performValidation():void { var v:ZipCodeValidator = new ZipCodeValidator(); var vResult:ValidationResultEvent; v.domain = "US or Canada"; v.listener=myZip; vResult = v.validate(myZip.text); myTA.text= String(vResult.type==ValidationResultEvent.VALID); } </mx:Script> <mx:TextInput id="myZip" /> <mx:Button label="Submit" click="performValidation();" /> <mx:TextArea id="myTA" /> </mx:Application>