import mx.validators.ZipCodeValidator; private var v:ZipCodeValidator = new ZipCodeValidator(); private function performValidation():void { v.domain = "US or Canada"; v.listener=myZip; v.validate(myZip.text); }