Data Model Flex


    
    xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx">
     
         
        import mx.events.ValidationResultEvent; 
        import mx.validators.*; 
        private function handleResult(event:ValidationResultEvent):void { 
            if (event.type == "valid") 
            { 
                // For valid events, the results Array contains 
                // RegExpValidationResult objects. 
                var xResult:RegExpValidationResult; 
                myTA.text=""; 
                for (var i:uint = 0; i < event.results.length; i++) 
                { 
                    xResult = event.results[i]; 
                    myTA.text=myTA.text + xResult.matchedIndex + " " + 
                    xResult.matchedString + "\n"; 
                } 
            }else{ 
                // Not necessary, but if you needed to access it, 
                // the results array contains ValidationResult objects. 
                var result:ValidationResult; 
                myTA.text=""; 
            } 
        } 
      
    

    
                    property="text" flags="g" expression="{source.text}" valid="handleResult(event);"
            invalid="handleResult(event);" />