Note that bracket notation works on both sides of an "=" assignment.  So if
you have a dynamic object, you can do:

myObject['myPropertyName'] = someValue;

 

Not directly bearing on your case, but a good think to know.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of David Pariente
Sent: Wednesday, October 07, 2009 10:34 PM
To: flexcoders@yahoogroups.com
Subject: [SPAM] Re: [flexcoders] calling array names dinamically

 

  

Hello again, 

I found the solution....can't believe i never heard of it before :O

{this['menu_e']}    is the same as    {menu_e}

that really solves it, i wanted to share solution with you ;)

Thank you! 



David Pariente wrote: 

  

Hi to all,

I'm sorry I had no idea how to name this subject.

I have 2 arrayCollections (actually more than 2), menu_e and menu_d,

[Bindable] public var menu_e:ArrayCollection=new
ArrayCollection(["HOME","COLLECTION","STORES","ABOUT","NEWS","CONTACT"]);
[Bindable] public var menu_d:ArrayCollection=new
ArrayCollection(["HOMED","COLLECTIOND","STORESD","ABOUTD","NEWSD","CONTACTD"
]);

the 'e' stands for english language, 'd' for danish, and so on. That char is
kept in a var called 'lang'.

then in the app i call it as {menu_e.getItemAt(0)}

What i try to do, and can't figure out how, is something like this:

{menu_"+lang+".getItemAt(0)}

so depending of the 'lang' value i will be using one arrayCollection or the
other.

Is it possible to do like this somehow? 

Thank you very much!





Reply via email to