I wonder if anyone can help here ? I know this is a pretty simple thing - but Im just getting into actionscript and Im stuck on one part of something I am trying to do.
Basically and exmaple of what I am trying to do is - I have three text boxes, txt1,txt2,txt3. I then have another layer with some actionscript on, where I have a loop, and in that loop I have a string with the value 'txt'. I am trying to tag the value of the loop counter on the end of that string, and then use the concatenated result as a reference to populate the relevant txt box.
I cant seem to get it to work though, it does not recognise the number on the end of the string ?
Expand|Select|Wrap|Line Numbers
- var str1 = "txt";
- var i:Number = 4;
- while (i <5) {
- var str2 = str1 + i;
- eval(str2).text = "hello";
- i++;
- }
Thanks