PDA

View Full Version : constructing variable names for dyno text


Autumnnn
11-22-2002, 04:44 AM
Hello,

I have two variables:

text1 = "hello";
text2 = "bye";

(these are going to be taken from a dbase.)

I have a loop that corresponds to the the numbers above (1 and 2).

I have a dynamic text field called "dyno".

I want to insert the values of the text variables above in this field as the script loops.

So if num = 1 insert "Hello" in the dyno text field
if num = 2 insert "bye" in the dyno text field

this is what I've got:


num = 1;
while(num < 3){

dyno = "text"+num

num++;
}


alas instead of grabbing the variable value it just prints "text1" "text2" etc...I hope that all makes sense.

A.

tg
11-22-2002, 02:02 PM
try:

dyno=_root["text"+num];
//or
dyno=this["text"+num];
//or
dyno=theLoadingObjectInsancename["text"+num];

sumthin along those lines.