You are right,
I tried this way.
 
dynamic public class Templateobjects{
 // class structure
}
and in mxml file
 
listobj = new Templateobjects();
 
// adding new property dynamically to class
 
listobj.newporp = "NewProp"
 
for(var i in listobj ){
 
  trace("Object found");
}
 
 
and i could get the trace only once.
--------------------------------------------------------------------------------------------------------------
Sorry to ask more question but i could not understand  that why it is so.
In flash , when I create  movieClips in side a movieClip
and run a for in loop on parent movieclip, i can get all the children and the variables declare in parent movieClip.
Does the Concept of (for in loop )  is changed in Flex??
 
Please help me to clear my concepts
 
Thanks in advance
Regards
Mayur
 
 
 
 

Dirk Eismann <[EMAIL PROTECTED]> wrote:
No, this does not work. for var in loops only work on dynamically
attached properties (i.e. your class is dynamic or you loop over the
props of an untyped Object instance)

To introspect a typed class instance use describeType(), it returns an
e4x XML structure that describes the type (hmm, probably the reason why
they named it that way)

Dirk.

> -----Original Message-----
> From: [EMAIL PROTECTED]ups.com
> [mailto:[EMAIL PROTECTED]ups.com] On Behalf Of flexlearner
> Sent: Monday, October 09, 2006 12:54 PM
> To: [EMAIL PROTECTED]ups.com
> Subject: [flexcoders] var in Loop
>
> hello all,
> I have a action script class which is bindable and
> instantiates objects of other class as :
>
>
> ----------------------------------------------------------
> ----------
>
> [Bindable]
> public class Templateobjects
> {
>
> public var template1 = new sampleTemplate1();
>
> public var template2 = new sampleTemplate2();
>
> public function Templateobjects(){
>
> // constructor function
> }
>
> }
>
>
> ----------------------------------------------------------
> ----------
>
>
>
>
> and in my mxml file i import this class as and trying to access this
> variables in this class, as:
>
> import Templateobjects;
> public var templatelistObject:Templateobjects = new Templateobjects();
>
> for(var i:Objects in Templateobjects){
> trace(" found objects");
> }
>
>
> i am not getting the trace...
> please tell me how should i go about this.
>
> Regards
> Flex Learner
>
>
>
>
>
>
>
> --
> 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
>
>
>
>
>
>
>
>
>


Find out what India is talking about on - Yahoo! Answers India
Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW


Find out what India is talking about on - Yahoo! Answers India
Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW __._,_.___

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





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to