Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i use the scrollbar component?

Status
Not open for further replies.

iostream71

Programmer
Mar 13, 2002
229
US
i tried adding one to a textbox, but it doesn't scroll. can't find any info on how to use it either...
 
give the textbox an instance name (mytext, say) and the scrollbar an instance name (myscroll, say)

then add to frame actions

myscroll.setScrollContent("mytext");
 
i got it to work a different way, but for some reason, i had to resize my text box to a smaller size, even though the text was larger than the box...??
 
the method i gave will always work and is the method you have to use to customise the scrollbar. it may have snapped in once but dont expect it to always to do so.
glad its working anyway.
 
this is what i used

loadText = new loadVars();
loadText.load("test.dat");
loadText.onLoad = function() {
scroller.text = this.readText;
};
 
i would always use something like this

mydata = new LoadVars();
mydata.onLoad = addItems;
function addItems() {
mytext.multiline = true;
mytext.wordWrap = true;
mytext.type = "dynamic";
mytext.border = false;
mytext.html = true;
mytext.htmlText = myData.text;
myscroll.setScrollTarget(mytext);
}
mydata.load("whatever.txt");
formStyleFormat = new FStyleFormat;

formStyleFormat.scrollTrack = "0xffffff";
formStyleFormat.highlight = "0xffffff";
formStyleFormat.highlight3D = "0x000033";
formStyleFormat.arrow = "0xffffff";
formStyleFormat.face = "0x000000";
formStyleFormat.background = "0xffffff";
formStyleFormat.shadow = "0x000099";
formStyleFormat.darkshadow = "0x000033";
formStyleFormat.addListener(myscroll);
formStyleFormat.applyChanges();
stop();
 
to further format the text box you can add to the onload function

mytext.borderColor = "0xfff765";
mytext.background = true;
mytext.backgroundColor = "Ox123321";


and so on
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top