# Referencing a dynamic textfield from a class

**URL:** <https://forum.kirupa.com/t/referencing-a-dynamic-textfield-from-a-class/309814>\
**Category:** flash\
**Created:** [May 25, 2010, 12:33pm UTC](https://forum.kirupa.com/t/referencing-a-dynamic-textfield-from-a-class/309814 "2010-05-25T12:33:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashrocket](https://avatars.discourse-cdn.com/v4/letter/f/3ab097/32.png) [@flashrocket](https://forum.kirupa.com/u/flashrocket)\
**Post date:** [May 25, 2010, 12:33pm UTC](https://forum.kirupa.com/t/referencing-a-dynamic-textfield-from-a-class/309814/1 "2010-05-25T12:33:01Z")

</div>

Hi, I guess this is simple to do, but I’m new to flash and have been stuck on this issue for days.

Bascially, how do I reference a dynamic text field in my fla file from a class which isn’t the document class?

For example:

I have an fla file called main.fla which contains no actionscript and has a single dynamic textfield called “text\_txt” on the main timeline.

My class file is called aClass.as and is the following:

* * *

package  
{  
public class aClass extends MovieClip  
{  
public function aClass  
{  
about\_tab.text = “Text dynamically added from a class file”;  
}  
}  
}

* * *

Any help greatly appreciated ![](http://forum.kirupa.com/uploads/kirupa/5541/fb5b90eb3225b77d.gif)
