How can I make a Scrollbar load ONLY when it's needed?

Hey guys,

I have checked out Kirupa’s great tutorial on this, but that was based on an input box and then a “result box”.

I would just like to make a simple dynamic text boxt that loads a scrollbar automatically when it is needed , and NOT show when it is not needed.
Could anyone please point me towards any simple code for that?

Thanks in advance.

Here are a couple examples, I think I got them both here? Top one also loads your txt file.

OCP_Content = new LoadVars();
OCP_Content.load("./text/OCP_gettingConnected.txt");
OCP_Content.onLoad = function(success) {
if (success) {
myText.htmlText = OCP_Content.ocp;
//Hide or View the Scroll Bar
myText.maxscroll != 1 ? scrollBar._visible=true : scrollBar._visible=false;
}
};

//Hide or View the Scroll Bar Non Dynamic Text
scrollBar._visible = (myText.maxscroll = 1);
myText.onChanged = function() {
scrollBar._visible = (this.maxscroll > 1);
};

Just what I needed! Thanks garyzero!