|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is that possible?
That is, to create a variable from another variables value... |
|
#2
|
|||
|
|||
|
Sorry, I'm not positive that I understand the question, but if you want to use the value of a variable as the dynamically created name of a new variable, you can do it like this:
var testVar = "something"; this[testVar] = "somethingElse"; trace(testVar); trace(this[testVar]); trace(something); Your trace will show: something somethingElse somethingElse This is good because you can also make new variable names with the variable values, like this: this[testVar + "_txt"] = "someText"; trace(something_txt); this trace will also show "somethingElse" I hope I wasn't too far off of the question... or too confusing. |
|
#3
|
|||
|
|||
|
Quote:
You understood it perfectly! Thanks man! New to AS but old to PHP and I thought it'ld be possible! |
|
#4
|
|||
|
|||
|
How do I combine this with global variable? I need too access the varibles from outside...
|
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Variable variables in Flash |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|