# Using the createTextBox function in a loop

**URL:** <https://forum.kirupa.com/t/using-the-createtextbox-function-in-a-loop/125163>\
**Category:** Uncategorized\
**Created:** [October 11, 2004, 3:47am UTC](https://forum.kirupa.com/t/using-the-createtextbox-function-in-a-loop/125163 "2004-10-11T03:47:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sochira](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@sochira](https://forum.kirupa.com/u/sochira)\
**Post date:** [October 11, 2004, 3:47am UTC](https://forum.kirupa.com/t/using-the-createtextbox-function-in-a-loop/125163/1 "2004-10-11T03:47:16Z")

</div>

hey I have a question…

I’m creating a sort of psuedo DBMS in flash and I’m having trouble populating my tables… I’m creating input textboxes for each of the input values.

My problem is this. The textboxes are being created in a for loop like this…

for(var i=0; i\<recordsPerPage; i++){

var yellow = String(“servId”+i);

this.createTextField(yellow, (i+13), 3.4, (23+17\*i), 40, 24);  
yellow.background = 0x000000  
yellow.textColor = 0xcccccc;  
… etc.  
}

The problem is that everytime the loop runs, it negates or overwrites that yellow in the yellow.background and other properties. But I need it to increment so that I can have multiple textboxes for a column. I’ve tried arrays too… Plz help!
