# Dynamic textbox automatic resize?

**URL:** https://forum.kirupa.com/t/dynamic-textbox-automatic-resize/6275
**Category:** flash
**Created:** [October 3, 2002, 6:11am UTC](https://forum.kirupa.com/t/dynamic-textbox-automatic-resize/6275 "2002-10-03T06:11:01Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Danneman](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@Danneman](https://forum.kirupa.com/u/Danneman)
#### Post date: [October 3, 2002, 6:11am UTC](https://forum.kirupa.com/t/dynamic-textbox-automatic-resize/6275/1 "2002-10-03T06:11:01Z")

</div>

Hi!

Im wondering if there is a way to make the dynamic textboxes automatically resize themselves to the size of the text that it finds in a textfile?

The way it seems to work now is that the rest of the text get hidden in the bottom…

---

<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: [October 3, 2002, 6:23am UTC](https://forum.kirupa.com/t/dynamic-textbox-automatic-resize/6275/2 "2002-10-03T06:23:35Z")

</div>

You can use the scrollbar componant. It would be easier and cleaner.

---

<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: [October 3, 2002, 6:35am UTC](https://forum.kirupa.com/t/dynamic-textbox-automatic-resize/6275/3 "2002-10-03T06:35:51Z")

</div>

Yes, I guess that would look better.

Still, Id like to get rid of those scrollbars.

---

<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: [October 3, 2002, 6:37am UTC](https://forum.kirupa.com/t/dynamic-textbox-automatic-resize/6275/4 "2002-10-03T06:37:17Z")

</div>

You can change the colors of scrollbars if that is what you are worried about.

---

<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: [October 3, 2002, 6:44am UTC](https://forum.kirupa.com/t/dynamic-textbox-automatic-resize/6275/5 "2002-10-03T06:44:17Z")

</div>

If not, then try this…

```auto
_root.createTextField("myBox", 1, 275, 200, 100, 100);
myformat = new TextFormat();
myformat.font = "Verdana";
myformat.size = 10;
myformat.color = 0x000000;
_root.myBox.selectable = false;
_root.myBox.autoSize = "left";
_root.myBox.border = true;
_root.myBox.text = "This is in Line 1 
 This is in Line 2";
_root.myBox.setTextFormat(myformat);

```

Change the text in \_root.myBox.text to see it resize.

**EDIT:** Another way to add lines…

```auto
_root.createTextField("myBox", 1, 275, 200, 100, 100);
myformat = new TextFormat();
myformat.font = "Verdana";
myformat.size = 10;
myformat.color = 0x000000;
_root.myBox.selectable = false;
_root.myBox.autoSize = "left";
_root.myBox.border = true;
_root.myBox.text += "This is in Line 1 
 This is in Line 2 
";
_root.myBox.text += "This is in Line 1 
 This is in Line 2 
";
_root.myBox.text += "This is in Line 1 
 This is in Line 2 
";
_root.myBox.text += "This is in Line 1 
 This is in Line 2 
";
_root.myBox.setTextFormat(myformat);

```

---

<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: [October 3, 2002, 6:49am UTC](https://forum.kirupa.com/t/dynamic-textbox-automatic-resize/6275/6 "2002-10-03T06:49:58Z")

</div>

Hey, thats great 🙂 Thanx alot!

---

<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: [October 3, 2002, 6:51am UTC](https://forum.kirupa.com/t/dynamic-textbox-automatic-resize/6275/7 "2002-10-03T06:51:43Z")

</div>

No problem:)

If you have any questions, just post 'em

---

<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: [October 3, 2002, 7:09am UTC](https://forum.kirupa.com/t/dynamic-textbox-automatic-resize/6275/8 "2002-10-03T07:09:10Z")

</div>

I sure will 🙂

Best flasher-forum Ive been to so far, thats why Im hogging it 😉

---

<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: [October 3, 2002, 7:13am UTC](https://forum.kirupa.com/t/dynamic-textbox-automatic-resize/6275/9 "2002-10-03T07:13:28Z")

</div>

We try:)
