Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Constructing variables in Actionscript 1

Status
Not open for further replies.

schnaps

Programmer
May 10, 2001
4
0
0
GB
I am trying to have a page read from a long and varied list of parameters and deliver the result to a dynamic field onscreen. Arrays are out for different reasons. Is there a way of doing it ? I was looping, having bob go from one to ten and then using

if(dr+"bob"+state==="OFFLINE"){do this);

but Flash refused to play. I then went to

drstate = dr+"bob"+state;
if(drstate==="OFFLINE"){do this);
And Flash told me that drstate equalled dr1state, rather than the contents of the variable I had (not) called.

Can Flash do this ? Am I just too dense ?

Any help appreciated.
 
I'm obviously missing something here...
What's OFFLINE, and how can
drstate = dr+"bob"+state;
ever equal OFFLINE?

Regards,

cubalibre2.gif
 
You have to evaluate the variable before you can use them in this way, at the moment you're just creating a string.

drstate=eval('dr'+bob+'state')

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top