Solved

Array get element name Flex 4

Posted on 2011-02-20
4
1,083 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
Comment Utility
Looks Like I have to use an object
0
 
LVL 17

Expert Comment

by:deepanjandas
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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 will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now