Invoking multiple validators in a function
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> import mx.events.ValidationResultEvent; private var vResult:ValidationResultEvent; private function validateZipPhone():void { if (zipV.validate().type==ValidationResultEvent.INVALID) return; if (pnV.validate().type==ValidationResultEvent.INVALID) return; } </mx:Script> <mx:ZipCodeValidator id="zipV" source="{zipCodeInput}" property="text" /> <mx:PhoneNumberValidator id="pnV" source="{phoneNumberInput}" property="text" /> <mx:Form> <mx:TextInput id="zipCodeInput" /> <mx:TextInput id="phoneNumberInput" /> </mx:Form> <mx:Button label="Validate" click="validateZipPhone();" /> </mx:Application>