# Dynamic Text Box Resize

**URL:** https://forum.kirupa.com/t/dynamic-text-box-resize/50442
**Category:** flash
**Created:** [May 3, 2004, 4:42am UTC](https://forum.kirupa.com/t/dynamic-text-box-resize/50442 "2004-05-03T04:42:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![fubarshibby](https://avatars.discourse-cdn.com/v4/letter/f/97f17d/32.png) [@fubarshibby](https://forum.kirupa.com/u/fubarshibby)
#### Post date: [May 3, 2004, 4:42am UTC](https://forum.kirupa.com/t/dynamic-text-box-resize/50442/1 "2004-05-03T04:42:56Z")

</div>

Alright, this question has been sort of asked, but my case is a tad bit different, as I have searched the forum and haven’t found the right answer.

I need to resize a dynamic text box to its contents. I know about the TextField.autoSize property, but what I need is only a vertical resize, not horizontal. I tried just doing autosize and then setting the width back to the original width, but it didn’t work, and in any case it will most likely make the text malformed. If anybody knows how I can do this it would be great.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 4, 2004, 6:02am UTC](https://forum.kirupa.com/t/dynamic-text-box-resize/50442/2 "2004-05-04T06:02:10Z")

</div>

Use the object of TextFormat  
then use its function getTextExtent  
then create the dynamic textfield by using createTextField function and passing the appropriate parameters.

cheers

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 4, 2004, 7:32am UTC](https://forum.kirupa.com/t/dynamic-text-box-resize/50442/3 "2004-05-04T07:32:09Z")

</div>

In the properties panel, set “single line” to “multiline” 😉

scotty(-:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 4, 2004, 1:38pm UTC](https://forum.kirupa.com/t/dynamic-text-box-resize/50442/4 "2004-05-04T13:38:14Z")

</div>

Hey, I’m not that dumb. I was talking about using the autoSize property, where it resizes both ways 😃

Anyway, thanks Harpreet, I’ll try it in a bit.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 4, 2004, 1:50pm UTC](https://forum.kirupa.com/t/dynamic-text-box-resize/50442/5 "2004-05-04T13:50:56Z")

</div>

I didn’t say you’re thumb.  
And I was talking about the autoSize property, but if you don’t want advice, leave it.

scotty(-:
