Get the text from an "input text field"

Hello.

I’m trying to refer to the text in an input text field. The name of the fields are attr1, attr2, attr3… This works fine when I type;
my_mc.var1.text,
my_mc.var2.text…

In order not to type the name of all the fields,
I want to do it in a loop, and put the results into an array;

[AS]
for(i; i<(number_of_attr+1); i++) {
var nr = new LoadVars();
var attr_nr = new LoadVars();
var suggestion = new LoadVars();

attr_nr = i.toString();
nr = “attr” + attr_nr;

suggestion = main.nr.text;
suggestion* = suggestion;
}
[/AS]

nr = “attr” + attr_nr;
list attr1, attr2… as intended
but I cant use this to refer to the textfield;
main.nr.text; (get undefined when using this)

It only works when I type attr1, attr2 …

Please help. I’m new to this…