# Problem creating dynamic text boxes that only display a scrollbar in needed

**URL:** <https://forum.kirupa.com/t/problem-creating-dynamic-text-boxes-that-only-display-a-scrollbar-in-needed/121079>\
**Category:** Uncategorized\
**Created:** [August 30, 2004, 6:20pm UTC](https://forum.kirupa.com/t/problem-creating-dynamic-text-boxes-that-only-display-a-scrollbar-in-needed/121079 "2004-08-30T18:20:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pivotal76](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@pivotal76](https://forum.kirupa.com/u/pivotal76)\
**Post date:** [August 30, 2004, 6:20pm UTC](https://forum.kirupa.com/t/problem-creating-dynamic-text-boxes-that-only-display-a-scrollbar-in-needed/121079/1 "2004-08-30T18:20:05Z")

</div>

Hey all. I know there are are a couple posts regarding this, but they still didn’t answer my question, so I apologize up front for posting another. Bear with me. Thanks!

I have a number of different frames, let’s say 15 for example, that all have a dynamic text box with the instance name “caption” inside of a movie clip (caption\_mc). Now, some of the text that will be dynamically loaded from a captions folder in these text boxes will only be a couple lines of text and some will be longer. Currently what I have is a scrollbar that always appears regardless of the length of the text. Having a scrollbar display when it isn’t needed looks unprofessional, not to mention confusing to the user.

So, my question is, how do I create one dynamic text box movie clip that will only display the scollbar if the dynamically loaded text calls for one?

Let me know if I can be any more clearer.

Here is the code I have in an actions layer for each frame that displays dynamic text:

loadText = new loadVars();  
loadText.load(“captions/1.txt”); [color=red](subsequent frames have 2.txt, 3.txt, etc…)  
[/color]loadText.onLoad = function()  
{  
title.text = this.title;  
caption.text = this.caption;  
};

Thanks everyone. I really appreciate all your help!
