-
ForLoop string
I want to put multiple inputtext values into an array, but code below wont work.
This is the inputTextFields:
output1.text
output2.text
Simply dont know how to write it, tried:
output +i+ "." +text;
output +i+ ".text";
Code:
for (var i = 1; i<3; i++) {
tempArray[i] = output +i+.text //<Problem here
}
-
Here ya go--
Code:
for (var i = 1; i<3; i++) {
tempArray[i]=this['output'+i].text;
}
-
Thank you, works beautifully
-
If I were to put the textfields into a movieclip called menu, how would I call it then?
This didnt seem to work
Code:
tempArray[i]= menu.this['output'+i].text;
-
Since 'this' refers to the object you are typing into (probably the timeline in this case?), it is unnecessary. Just menu['output'...
Remember too that arrays are 0-index, so they start at 0 not 1.
-
Thanks again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|