# AS2: Adjust text box height (createTextField)

**URL:** https://forum.kirupa.com/t/as2-adjust-text-box-height-createtextfield/266990
**Category:** flash
**Created:** [July 27, 2008, 12:10am UTC](https://forum.kirupa.com/t/as2-adjust-text-box-height-createtextfield/266990 "2008-07-27T00:10:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Holmesc](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@Holmesc](https://forum.kirupa.com/u/Holmesc)
#### Post date: [July 27, 2008, 12:10am UTC](https://forum.kirupa.com/t/as2-adjust-text-box-height-createtextfield/266990/1 "2008-07-27T00:10:20Z")

</div>

I’m trying to dynamically create a static text field on the stage, but I want it to automatically shrink to the smallest height possible, much like a static text box dragged created using the Text Tool. I don’t know how to get it to work, so hopefully there is an easy answer.

Here’s my code at current:

```auto
_root.createTextField("text_box"+i,i,10,10,530,100);
            _root["text_box"+i].type = "static";
            _root["text_box"+i].text = text_arr*;
            _root["text_box"+i].wordWrap = true;
            _root["text_box"+i].multiline = true;

```

Thanks a lot!

---

<div class="post-metadata">

### Author: ![airabove](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@airabove](https://forum.kirupa.com/u/airabove)
#### Post date: [July 27, 2008, 1:37pm UTC](https://forum.kirupa.com/t/as2-adjust-text-box-height-createtextfield/266990/2 "2008-07-27T13:37:47Z")

</div>

[COLOR=#0000FF]Try:

\_root[/COLOR][COLOR=#000000][[/COLOR][COLOR=#FF0000]“text\_box”[/COLOR]+i[COLOR=#000000]][/COLOR]._autoSize = true_;

---

<div class="post-metadata">

### Author: ![Holmesc](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@Holmesc](https://forum.kirupa.com/u/Holmesc)
#### Post date: [July 27, 2008, 7:02pm UTC](https://forum.kirupa.com/t/as2-adjust-text-box-height-createtextfield/266990/3 "2008-07-27T19:02:15Z")

</div>

Great, it works! Thanks guys. I guess I missed that property, because I did read the help file.
