# Text Field on center stage using AS2

**URL:** <https://forum.kirupa.com/t/text-field-on-center-stage-using-as2/284750>\
**Category:** flash\
**Created:** [March 23, 2009, 10:28am UTC](https://forum.kirupa.com/t/text-field-on-center-stage-using-as2/284750 "2009-03-23T10:28:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![humbuged](https://avatars.discourse-cdn.com/v4/letter/h/b38774/32.png) [@humbuged](https://forum.kirupa.com/u/humbuged)\
**Post date:** [March 23, 2009, 10:28am UTC](https://forum.kirupa.com/t/text-field-on-center-stage-using-as2/284750/1 "2009-03-23T10:28:31Z")

</div>

Hello 🙂

I’ve managed to put a text field onto the stage using AS2 but now I’m trying to make it stay in the center of the stage. Here’s the code I used;

```auto
this.createTextField("dynamic_txt",1,(Stage.width/2),(Stage.height/2),1,1);
dynamic_txt.text = "This is just a test to see if this works.";
var textstyle:TextFormat = new TextFormat();
textstyle.size = 18;
textstyle.font = "Arial";
dynamic_txt.setTextFormat(textstyle);
dynamic_txt.autoSize = true;

```

Right now it looks like this;  
 ![](http://img11.imageshack.us/img11/7228/picture4pfy.png)

How do I make it look like this?  
 ![](http://img403.imageshack.us/img403/588/testw.png)

Thanks 🙂
