# Help on createTextField

**URL:** <https://forum.kirupa.com/t/help-on-createtextfield/295176>\
**Category:** flash\
**Created:** [August 26, 2009, 10:56am UTC](https://forum.kirupa.com/t/help-on-createtextfield/295176 "2009-08-26T10:56:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![raghu\_thejus](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@raghu\_thejus](https://forum.kirupa.com/u/raghu_thejus)\
**Post date:** [August 26, 2009, 10:56am UTC](https://forum.kirupa.com/t/help-on-createtextfield/295176/1 "2009-08-26T10:56:14Z")

</div>

i know as3(4 months exp).but dnt know much of as2.  
I have problem with as2.i have a movieclip chatnplayer\_mc and a button on stage(many other movieclips are also there).when i press button i want a textfield to be added to chatnplayer\_mc.folowing is my code on button:

```auto
on (press) {
    trace(chatnplayer_mc._x+","+chatnplayer_mc._y);
    chatnplayer_mc.createTextField("txtField_txt",chatnplayer_mc.getNextHighestDepth(),chatnplayer_mc._x,chatnplayer_mc._y+200,20,20);
    chatnplayer_mc.txtField_txt.text="HELLO";
    
    var my_fmt:TextFormat = new TextFormat();
    my_fmt.color = 0xFF0000;
    my_fmt.underline = true;
    chatnplayer_mc.txtField_txt.setTextFormat(my_fmt)
    chatnplayer_mc.txtField_txt.selectable = true;
    trace(chatnplayer_mc.txtField_txt._x+","+chatnplayer_mc.txtField_txt._y);
}

```

both traces are printing 800,200(x & y of chatnplayer\_mc).but i cant c the textfield

Since tis is urgent i didnt went search this forum.if this is repitation sorry.  
Thanx in advance…
