Igor,

   I do import mx.validators.*;
   here is my code for test:

  <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
layout="horizontal">
  <mx:TextInput id="edt4Test"/>
  <mx:Validator id="mainValidator"/>
  <mx:Button id="btn4Test" click="doValidation()"/>
 
  <mx:Array id="myarray">
    <mx:Validator id="val4TestString" source="{edt4Test}" required="true"/>
    <mx:Validator id="val4TestEmail" source="{edt4Test}" required="true"/>
  </mx:Array>
 
 
  <mx:Script>
  <![CDATA[
    import mx.validators.*;

    public function doValidation():void {
      var valRet:Array = mainValidator.validateAll( myarray );
    }
  ]]>
  </mx:Script>
</mx:Application>


on the line of validateAll( myarray ), Flex Builder give me a error 
saing:  "Call to a possibly undefined method validateAll through a 
reference with static type mx.validator:Validator."

i suspect that is something wrong with the adobe documentation tools.... 
the code of validateAll have a "static" keyword...

public static function validateAll(validators:Array):Array
    {   
        var result:Array = [];

        var n:int = validators.length;
        for (var i:int = 0; i < n; i++)
        {
            var v:Validator = Validator(validators[i]);
           
            var resultEvent:ValidationResultEvent = v.validate();
           
            if (resultEvent.type != ValidationResultEvent.VALID)
                result.push(resultEvent);
        }   
       
        return result;
    }


and after i read more on the actionscript docs i saw that static isnt 
visible outside the class definition...  so i guess something was wrong 
with the doc tools because i should not see this as a common outsider 
developer. (but the function above this, called "loadResources()", that 
is static too, dont appear on docs)

  best regards,

         Luís Eduardo.






Igor Costa escreveu:

> Does you have idea on how you used?
>
> I mean, here I tested with a simple example and works.
>
>
> If I'm not wrong maybe that happens you forgot to import the class 
> necessery to do that.
>
> try this
>
> import mx.validators.*;
>
>
>
> Regards.
>
> On 10/30/06, *Luis Eduardo* <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>
>
>     while i was looking on documentations i found a strange thing.
>     on validator class (
>     http://livedocs.macromedia.com/flex/2/langref/mx/validators/Validator.html
>     
> <http://livedocs.macromedia.com/flex/2/langref/mx/validators/Validator.html>
>
>     ) it clearly show us a function called "validateAll".
>     when u go inside the Validator class, on the "Validator.as
>     <http://Validator.as>" file, u
>     really can find this function there.
>     but
>     when u try to use it from flex builder, it shows a error telling that
>     function doesn't exists.
>
>     why?
>
>     Luís Eduardo.
>
>
>     _______________________________________________________
>     Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu
>     celular. Registre seu aparelho agora!
>     http://br.mobile.yahoo.com/mailalertas/
>     <http://br.mobile.yahoo.com/mailalertas/>
>
>
>
>
>
> -- 
> ----------------------------
> Igor Costa
> www.igorcosta.com <http://www.igorcosta.com>
>  



                
_______________________________________________________ 
O Yahoo! est� de cara nova. Venha conferir! 
http://br.yahoo.com


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to