View Single Post
Old 02-08-2007, 02:50 PM   #6 (permalink)
Jinn
Lover - Protector - Teacher
 
Jinn's Avatar
 
Location: Seattle, WA
Did a little research, and Flash script actually supports this kinda of dereferencing. Kinda unique, actually.

There's two ways to do what you're talking about. You can either use the array indexing brackets [] or the eval() command.

Their documentation gives:

eval("piece" + x);

If you did

Code:
variable2 = eval("UVR_txt" + variable1).text
it would dynamically create the variable name.

Similarly, you can use the bracket notation to do it:

Code:
 variable2 = UVR_txt[variable1].text;
Where variable1 is the UVR_txt that you want the main text box to get
__________________
"I'm typing on a computer of science, which is being sent by science wires to a little science server where you can access it. I'm not typing on a computer of philosophy or religion or whatever other thing you think can be used to understand the universe because they're a poor substitute in the role of understanding the universe which exists independent from ourselves." - Willravel
Jinn is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76