I'm trying to generate a menu dynamically based on an XML file. To do this I have several textboxes which I have enumerated as button0caption, button1caption, etc. My question is in two parts:
1. Can I make an array of textboxes somehow so that I can refer to them as buttoncaption[0], buttoncaption[1]? Does naming two textboxes "buttoncaption" accomplish this?
2. If option 1 is infeasible, can I use the eval command to loop through the textboxes? I'm a veteran Javascript programmer and in Javascript eval seems to behave differently than in ActionScript.
For example, in Javascript I would use:
to accomplish:
In ActionScript this does not seem to work.
Thanks very much for your help.
1. Can I make an array of textboxes somehow so that I can refer to them as buttoncaption[0], buttoncaption[1]? Does naming two textboxes "buttoncaption" accomplish this?
2. If option 1 is infeasible, can I use the eval command to loop through the textboxes? I'm a veteran Javascript programmer and in Javascript eval seems to behave differently than in ActionScript.
For example, in Javascript I would use:
Code:
eval("button" + 0 + "caption = 'something'");
Code:
button0caption = 'something';
In ActionScript this does not seem to work.
Thanks very much for your help.