# How control the textbox in as3 class

**URL:** <https://forum.kirupa.com/t/how-control-the-textbox-in-as3-class/286054>\
**Category:** Uncategorized\
**Created:** [April 9, 2009, 9:53am UTC](https://forum.kirupa.com/t/how-control-the-textbox-in-as3-class/286054 "2009-04-09T09:53:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samyphp](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@samyphp](https://forum.kirupa.com/u/samyphp)\
**Post date:** [April 9, 2009, 9:53am UTC](https://forum.kirupa.com/t/how-control-the-textbox-in-as3-class/286054/1 "2009-04-09T09:53:58Z")

</div>

Hi there,  
am having dynamic text box named username\_txt in stage, i have to display the username dynamically there using as3 class. but if i use usename\_txt inside the class means it throws error…please help me  
this is my class

in main.fla i placed username\_txt in first frame,

in first frame i created object for the class like var first:First = new First();

this is First.as :

package  
{  
public class First  
{  
public function First(){  
username\_txt.text=‘karin’;  
}  
}  
}
