# Creating textfield on the fly

**URL:** <https://forum.kirupa.com/t/creating-textfield-on-the-fly/113118>\
**Category:** Uncategorized\
**Created:** [June 15, 2004, 5:58am UTC](https://forum.kirupa.com/t/creating-textfield-on-the-fly/113118 "2004-06-15T05:58:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlashBob](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@FlashBob](https://forum.kirupa.com/u/FlashBob)\
**Post date:** [June 15, 2004, 5:58am UTC](https://forum.kirupa.com/t/creating-textfield-on-the-fly/113118/1 "2004-06-15T05:58:05Z")

</div>

Below is text for creating textfield on the fly. I want to create multiple fields, so I have variables for the names. But the code does not work - any ideas as to what is wrong?

loadText = new LoadVars();  
loadText.load(“data.txt”);  
loadText.onLoad = function() {  
myString = new String(this.row);  
myTextField = new TextField();  
myTextField.createTextField(myString,1,33,67,20,16);  
with (myTextField){  
text = this.row;  
border = true;  
myformat = new TextFormat();  
with (myformat){  
font = “Arial”;  
color = 0xff0080;  
size = 10;  
bullet = false;  
underline = true;  
}  
setTextFormat(myformat);  
}  
};

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 16, 2004, 1:49am UTC](https://forum.kirupa.com/t/creating-textfield-on-the-fly/113118/2 "2004-06-16T01:49:50Z")

</div>

It did - THANKS!

> [@Ilyas le Pom](#):
>
> ```auto
> with (_root[myString]) {}
> 
> ```
> 
> should do the job.
