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

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!

the exact same way, just don’t let the user edit the text box…

and yes, it does answer your question.

hmm, I guess I’m confused. There is no outside user input on this. Basically, I have a captions folder that holds the text files. When I change these text files, I want the scrollbars to disappear if they’re not needed, and display if they are based on the length of the text files.

To clarify, I’m using a standard dynamic text box, with the scrollbar component.

loadText = new LoadVars();
loadText.onLoad = function(success){
if(success){
title.text = this.title;
caption.text = this.caption;
my_scrollbar._visible = caption.maxscroll !=1 ? true : false;
}
};
loadText.load("captions/1.txt");

yes dude, you just need to change the input box to a dynamic text box and load the text into it. the process is still exactly the same, as is displayed with
claudio’s code example.

Here’s an example.

wow guys this is great! Thanks so much!

However…the scrollbar doesn’t scroll when the content is longer. They’re greyed out like doesn’t need to scroll. It does however show up only when needed. Very cool though.

nevermind. I got it. I needed to make the text box a little taller. Thanks guys. You’ve been a great help.