Development Flex



    
        
            import mx.events.ValidationResultEvent;
            import mx.controls.Alert;
            import mx.validators.Validator;
            private var myValidators:Array;
            private function initApp():void {
                myValidators = [valid1, valid2].filter(filterDisabledValidators);
            }
            private function clickHandler():void {
                var errors:Array = Validator.validateAll(myValidators);
                if (errors.length == 0) {
                    Alert.show("No errors.", "SUCCESS");
                }
            }
            private function filterDisabledValidators(element:*, index:int, arr:Array):Boolean {
                return element.enabled;
            }