# How can I make a button only appear when text is larger thhan text field?

**URL:** <https://forum.kirupa.com/t/how-can-i-make-a-button-only-appear-when-text-is-larger-thhan-text-field/24421>\
**Category:** flash\
**Created:** [June 30, 2003, 6:03pm UTC](https://forum.kirupa.com/t/how-can-i-make-a-button-only-appear-when-text-is-larger-thhan-text-field/24421 "2003-06-30T18:03:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlashDeano](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@FlashDeano](https://forum.kirupa.com/u/FlashDeano)\
**Post date:** [June 30, 2003, 6:03pm UTC](https://forum.kirupa.com/t/how-can-i-make-a-button-only-appear-when-text-is-larger-thhan-text-field/24421/1 "2003-06-30T18:03:01Z")

</div>

I have a dynamic text box that acquires text from a txt file.

Sometimes the text is greater than the text field so I want to be able to show a page up and page down button. However I do not want these displayed if the text does not exceed the field.

Currently the buttons are always displayed.

I understand how to get the text field info, I do not understand the “easy” bit of only loading the buttons if the text field size is exceeded.

Please could someone provide a few pointers to what must be a simple problem !!!

Regards  
Dean

---

<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:** [June 30, 2003, 6:11pm UTC](https://forum.kirupa.com/t/how-can-i-make-a-button-only-appear-when-text-is-larger-thhan-text-field/24421/2 "2003-06-30T18:11:28Z")

</div>

Count roughly how many characters will fit in your text field.

[AS]if (theTextField.text.length \> thechars){  
theButton.\_visible = true;  
}else{  
theButton.\_visible = false;  
};  
[/AS]

Replace _theTextField_ with the name of your textfield, thechars with the number of characters which will fit into your textfield and theButton with the name of the button which you want to make visible

---

<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:** [July 1, 2003, 10:17am UTC](https://forum.kirupa.com/t/how-can-i-make-a-button-only-appear-when-text-is-larger-thhan-text-field/24421/3 "2003-07-01T10:17:21Z")

</div>

Thank you for your time and assistance. I knew it had to be quite simple.

Problem solved.
