Link to home
Start Free TrialLog in
Avatar of yahoolane
yahoolane

asked on

Array get element name Flex 4

Now I have lots of images I want to get their state

so I did
for
var cardState:array;  ttstr:String;

for (var i:int = 10; i < 79; i++) {  // Loop all cards  
ttstr = "Ca" +  i.toString();   // the ID's of the cards
cardState[ttstr]=this[ttstr]["visible"];

Now I want to put the state back
This is my Guess, but I want to get the name of the element
for (var y:int = 10; i < cardState.length; i++) {  // player  
     this[cardState[y]name ]["visible"] =   cardState[y];  }



Avatar of yahoolane
yahoolane

ASKER

Looks Like I have to use an object
cardState[ttstr]=this[ttstr]["visible"];
 this[cardState[y]name ]["visible"] =   cardState[y];  }

The above 2 live are wrong. I am sorry I did not understand your problem. Kindly brief what you are trying to do in these 2 lines so that I can suggest.

Warm Regards
Deepanjan Das
how do I do something like this

cardstate['card1']=true

Then do cardstate[0]  and get back 'card1'

so I set it by name but want to return the name numericaly
ASKER CERTIFIED SOLUTION
Avatar of deepanjandas
deepanjandas
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial