This content has been marked as final. Show 6 replies
are you trying to load this variables contents into a text field or some other location? Is the external file in question a text file, php or asp file, or something else entirely?
I am trying to load data in from a txt file into a text field.
into the same text field. Each time I press the button I cycle through what is in the text field... Apple -> Bag -> Cat
To dynamically combine multiple string values into a single string, use +
sub1 = "Hello";
sub2 = " World";
myVar = sub1+sub2;
trace(myVar); // Hello World
To dynamically reference or create a variable from a string, use array notation 
myVar = "Hello";
part1 = "my";
part2 = "Var";
trace( this[part1+part2] ); // Hello
part3 = "another";
part4 = "Var";
this[part3+part4] = "Goodbye";
trace(anotherVar); // Goodbye
you'll need to change the variable name attached to the text field when a user clicks the button at run time.
TextField.variable = what-you-want-to-show;