# Dynamic text field

**URL:** <https://forum.kirupa.com/t/dynamic-text-field/115576>\
**Category:** Uncategorized\
**Created:** [July 9, 2004, 6:19pm UTC](https://forum.kirupa.com/t/dynamic-text-field/115576 "2004-07-09T18:19:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![markP](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@markP](https://forum.kirupa.com/u/markP)\
**Post date:** [July 9, 2004, 6:19pm UTC](https://forum.kirupa.com/t/dynamic-text-field/115576/1 "2004-07-09T18:19:09Z")

</div>

The first piece of code creates a textField and the second piece is on a button on the root level of my movie trying to write to it. It doesn’t seem to work, any ideas why?

```auto
createTextField("my_txt", 1, 150, textDepth, 0, 0);
with (my_txt) {
	_width = 150;
	autoSize = "left";
	multiline = true;
	wordWrap = true;
	selectable = false;
}
// 
// 
myformat = new TextFormat();
myformat.variable = "my_txt";
myformat.type = dynamic;
myformat.color = 0xffffff;
myformat.size = 14;
myformat.font = "Arial";
myformat.bold = true;
myformat.leading = 4;
myformat.wordWrap = true;
my_txt.setTextFormat(myformat);

```

```auto
textButtons.my_txt.text = "hello2";

```
