Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Array get element name Flex 4

Posted on 2011-02-20
4
1,095 Views
Last Modified: 2012-05-11
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];  }



0
Comment
Question by:yahoolane
  • 2
  • 2
4 Comments
 
LVL 1

Author Comment

by:yahoolane
ID: 34939929
Looks Like I have to use an object
0
 
LVL 17

Expert Comment

by:deepanjandas
ID: 34940011
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
0
 
LVL 1

Author Comment

by:yahoolane
ID: 34957802
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
0
 
LVL 17

Accepted Solution

by:
deepanjandas earned 325 total points
ID: 34957879
That seems to be a difficult call.
You may use Dictionary Class for something like this:
cardstate['card1'] = true;

But then by doing cardstate[0] you will not get the value as "card1".

Can you please explain me the scenario why you are looking for such a solution. May be I can help you to think in another way as this might not be possible.

Warm Regards
Deepanjan Das
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Clickable link on fields from mysql 7 341
Export Flash Builder As3 arrayCollection as csv in the AC original order. 2 1,189
Flex automation testing 8 702
Running Guacamole on port 80 5 249
First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question