# Hide/show scrollbar with dynamically loaded text from a .txt file

**URL:** <https://forum.kirupa.com/t/hide-show-scrollbar-with-dynamically-loaded-text-from-a-txt-file/188675>\
**Category:** Uncategorized\
**Created:** [May 9, 2006, 11:16pm UTC](https://forum.kirupa.com/t/hide-show-scrollbar-with-dynamically-loaded-text-from-a-txt-file/188675 "2006-05-09T23:16:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scrabble](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@scrabble](https://forum.kirupa.com/u/scrabble)\
**Post date:** [May 9, 2006, 11:16pm UTC](https://forum.kirupa.com/t/hide-show-scrollbar-with-dynamically-loaded-text-from-a-txt-file/188675/1 "2006-05-09T23:16:47Z")

</div>

hi,

i’ve been trying to figure out how to hide and show the scrollbar component with dynamically loaded text depending on whether the text overflows or not.

the problem i am having is that TextField.maxscroll keeps returning 1 because it is being performed before the text is loaded into the textfield. here is the code i am working with:

loadVariables(“copy.txt”, this);  
scrollbar.\_visible = (text.maxscroll \> 1);

how can i solve this?
