PDA

View Full Version : load custom scrollbar when needed


adroitemedia
09-17-2003, 03:41 PM
I am attempting to attach a scrollbar that i have created to a dynamic textfield. There are multiple different sizes of text files that will be loaded and not all will need the scroll bar. So my question is, how can i only load the scrollbar when it is required.

Some Info :

on (release) {
createTextField("myTextBox", 0, 175, 80, 420, 325);
myTextBox.html = true;
myTextBox.textColor = "0x000000";
myTextBox.selectable = false;
myTextBox.wordWrap = true;
articleData = new LoadVars();
articleData.onData = function(myText) {
myTextBox.htmlText = myText;
};
articleData.load("htmlfile/"+somevariable+".txt")
}

this script is on different buttons calling different "somevariable" thus the different size text bar. my thought was this:
if myTextBox.maxscroll > 1) {
loadMovie("textScroller.swf", _root.textScroller);
}

this doesnt work unless the number one is changed to zero.
Any thoughts?
thanks

Billy T
09-23-2003, 05:54 AM
maybe

if (myTextBox.scroll != myTextBox.maxscroll) {
loadMovie("textScroller.swf", _root.textScroller);
}