all groups > flash actionscript > november 2006 >
You're in the

flash actionscript

group:

Use Variable value name???



Use Variable value name??? gspan
11/26/2006 5:52:53 PM
flash actionscript: Is there a way to use a variable value's name to load data?

What mean is, if I have a variable called "var1" and I load "var1" from an XML
file so the value of "var1" == "XYZ", is there a way to use the value "XYZ" to
load data to a Dynamic textbox call "XYZ"?

var1 = "XYZ"
( XYZ is a dynamic textbox on the stage and I need to load XYZ with
incoming data )
Example: XYZ = "What ever text I have"
( but XYZ is really the vaue of "var1")

Thanks - Gary
Re: Use Variable value name??? kglad
11/26/2006 6:03:28 PM
yes, you can resolve strings into objects by using array notation. for
example, if XYZ is the instance name of a textfield on the _root timeline and
var1="XYZ", you can use:



_root[var1].text="What ever text I have";
Re: Use Variable value name??? gspan
11/26/2006 10:23:37 PM
Thanks kglad!

It worked after i removed the .text
Re: Use Variable value name??? kglad
11/27/2006 12:00:00 AM
you're welcome.

AddThis Social Bookmark Button