Dynamic text field

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?

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);
textButtons.my_txt.text = "hello2";

on the frame:


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);

on the button:


on  (release){
 my_txt.text = "hello2";
}

i put that in and it worked fine.

Thank you very much… that did it.