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[ttst r]["visibl e"];
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]; }
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[ttst
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]; }
cardState[ttstr]=this[ttst r]["visibl e"];
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
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
ASKER
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER