Just in case the 0 vs. O is a typo in the email, a static function requires dependency variables as well.

 

var o:myListVO = new myListVO();

 

Always type your variables, and when it seems like a class isn’t being created like this example make sure you have an instance variable declared (static if the problem is in a static function) to help the compiler see the dependency.  You don’t need to assign the variable to anything, just having it declared is enough.

 

Matt

 

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Steven Webster
Sent: Wednesday, August 03, 2005 3:16 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Array of VOs class loading issue SOLVED

 




public static function fromXML( xml:Object ) : myListVO {
      var o = new myListVO();

      for (var i=0; i < xml.length; i++) {
            var q:Object = xml[i];
            var j = q.DisplayOrder - 1;
            o.qArray[j] = myVO(myVO.fromXML(q));
      }
      return o;           
}




<joke:tongueInCheek acceptCriticism="inSpirtItWasIntended" />

Did you know that Flex allows variable names of more than one letter that
express the intent of the code ? :-)

Incidentally, in your previous code, the line:

var test:myV0 = new myV0();

looks on my screen like you're using the numeral zero rather than the
capital letter O in your class name, so the compiler is correctly telling
you "The class my-vee-nought could not be loaded".  Should save you your
work around above...

Best,

Steven
PS.  If you rename the variable to t, don't bother strictly typing it and
drop the brackets in the object instantiation, you should save 8 keypresses
and remove the possible places for typing a nought instead of an O to 1
instead of 2 ;)

--
Steven Webster
Technical Director
iteration::two

This e-mail and any associated attachments transmitted with it may contain
confidential information and must not be copied, or disclosed, or used by
anyone other than the intended recipient(s). If you are not the intended
recipient(s) please destroy this e-mail, and any copies of it, immediately.

Please also note that while software systems have been used to try to ensure
that this e-mail has been swept for viruses, iteration::two do not accept
responsibility for any damage or loss caused in respect of any viruses
transmitted by the e-mail. Please ensure your own checks are carried out
before any attachments are opened.




--
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




Reply via email to