# How to create new textfields?

**URL:** <https://forum.kirupa.com/t/how-to-create-new-textfields/112592>\
**Category:** Uncategorized\
**Created:** [June 9, 2004, 1:35pm UTC](https://forum.kirupa.com/t/how-to-create-new-textfields/112592 "2004-06-09T13:35:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trunkz](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@Trunkz](https://forum.kirupa.com/u/Trunkz)\
**Post date:** [June 9, 2004, 1:35pm UTC](https://forum.kirupa.com/t/how-to-create-new-textfields/112592/1 "2004-06-09T13:35:42Z")

</div>

Hello,

Im trying to create loop which will creat 4 new textfields and will put text into each field. The variables are already definned. But i doens’t seem to work. Could someone please help me?

```auto

detail2 = "test2";
detail3 = "test3";
detail4 = "test4";
detail5 = "test5";

for (var i=1; i<=5; i++) {
	this.createTextField("mytext"+i,2,-218,-47,200,16);	
	this.["mytext"+i].multiline = true;
	this.["mytext"+i].wordWrap = true;
	this.["mytext"+i].border = false;
	myformat = new TextFormat();
	myformat.font = "Verdana"
	myformat.color = 0xFFFFFF;
	myformat.bullet = false;
	myformat.size = 10;
	myformat.align = "right";
	this.["mytext"+i].text = detail+i;
	this.["mytext"+i].setTextFormat(myformat);
}

```
