# Create multiple text fields using for()

**URL:** <https://forum.kirupa.com/t/create-multiple-text-fields-using-for/205663>\
**Category:** Uncategorized\
**Created:** [October 31, 2006, 7:36pm UTC](https://forum.kirupa.com/t/create-multiple-text-fields-using-for/205663 "2006-10-31T19:36:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![h4x0r](https://avatars.discourse-cdn.com/v4/letter/h/b9e5f3/32.png) [@h4x0r](https://forum.kirupa.com/u/h4x0r)\
**Post date:** [October 31, 2006, 7:36pm UTC](https://forum.kirupa.com/t/create-multiple-text-fields-using-for/205663/1 "2006-10-31T19:36:58Z")

</div>

I’m using php (my native language) to populate content in my mc, and being new to AS I’m having trouble creating a script that will, essentially, create a text field for every record displayed via php/mysql. The basic idea of what I was thinking was something along the lines of

```auto

for(i = 0; i < phpRows; i++) {
this.createTextField("myPHPText"+i, 1, x, y, 10,10);
this.myPHPText_txt+i.text = phpVar+i;
}

```

I’ve used LoadVars() plenty of times to load static/specific variables into text fields in places where I’m only calling one row of data, but in this instance where I’m pulling multiple rows from a db and my php output would look something like…

phpVar1=somethignsomethingsomething  
phpVar2=somethingsoemthingsomething  
phpVar3=somethingsomethingsomething  
…

then I’m not sure how to create the appropriate code in AS to handle a text field for every php variable. Thanks for looking!
