Development Flex



    
        
            import mx.controls.Alert;
            import mx.events.ValidationResultEvent;
            import mx.validators.PhoneNumberValidator;
            
            private var nameVResult:ValidationResultEvent;
            private function doValidate():void
            {
                    
                nameVResult = nameV.validate();
                    
                if(nameVResult.type==ValidationResultEvent.VALID) {
                    Alert.show("The FormItem has been succesfully validated !", "Validation Message", 4);
                        
                }  else if(nameVResult.type==ValidationResultEvent.INVALID) {
                    Alert.show("The FormItem has NOT been validated !", "Validation Message", 4);
                }
            }
          
    

                            source="{myModel}"
                        property="surname"
                        required="true"
                        maxLength="10"
                        minLength="2"
                        tooLongError="This field contains 10 chars"
                        tooShortError="You have to insert 2 chars at least"
                        listener="{surnameTxt}"
                        />
    
         
             {nameTxt.text}
             {surnameTxt.text}
             {phoneTxt.text}