# Strange text box and for loop problem

**URL:** <https://forum.kirupa.com/t/strange-text-box-and-for-loop-problem/208798>\
**Category:** Uncategorized\
**Created:** [December 2, 2006, 8:11pm UTC](https://forum.kirupa.com/t/strange-text-box-and-for-loop-problem/208798 "2006-12-02T20:11:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ad0ac](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@ad0ac](https://forum.kirupa.com/u/ad0ac)\
**Post date:** [December 2, 2006, 8:11pm UTC](https://forum.kirupa.com/t/strange-text-box-and-for-loop-problem/208798/1 "2006-12-02T20:11:02Z")

</div>

i’m trying to write some actionscript that takes data from a series of consecutively numbered textboxes (texb1, textb2, etc in this example) and writes them to a string array, using a for loop.

I have two pieces of code that work, but putting them together does not so any help would be greatly appreciated!

These two work:

1

[COLOR=SeaGreen] [/COLOR][COLOR=SeaGreen]var Val = new Array();  
Val[0] = textb0.text;  
Val[1] = textb1.text;  
Val[2] = textb2.text;  
Val[3] = textb3.text;  
Val[4] = textb4.text;  
Val[5] = textb5.text;  
[/COLOR]

2  
[COLOR=SeaGreen]  
for (var i=0; i\<5; i++)  
{  
this[“text”+i].text = Val\*;  
}

[COLOR=Blue]with predefined text in the Val array

[COLOR=Black]but when I try to combine the two, like this, nothing gets entered into the array:  
[/COLOR][/COLOR][/COLOR][COLOR=SeaGreen]  
for (var i=0; i\<5; i++)  
{  
Val\* = this[“text”+i].text;  
}[/COLOR]  
[COLOR=SeaGreen][COLOR=Blue][COLOR=Black]  
Any help would be greatly appreciated, I can’t understand it!

Thanks  
[/COLOR][/COLOR][/COLOR]
