Skip to main content
Participant
December 3, 2007
Question

Scrolling Text Box

  • December 3, 2007
  • 1 reply
  • 254 views
Hi, I have been hand coding a dynamic web site and have my TextBoxes that load in their content from external .txt files.

Does anyone know how i waould go about making them into scrolling text boxes?

I can find solutions on how to do this, but none that tell you how to do it purley buy coding it.

Here is the current code for one of the TextBoxes:

_root.createTextField("theTextBox2",10,400,260,375 ,330);
theTextBox2.background = false;
theTextBox2.border = false;
theTextBox2.backgroundColor = 0xFFFFFF;
theTextBox2.borderColor = 0x000000;
theTextBox2.multiline = true;
theTextBox2.wordWrap = true;
theTextBox2.variable = "myText2";
myText2.onLoad = function() {
theTextBox2.html = true;
}
var myCSS = new TextField.StyleSheet();
myCSS.load("Content/styleSheet.css");
myCSS.onLoad = function() {
theTextBox2.styleSheet = myCSS;
}
loadVariables("Content/homeR.txt", "_root");

From what I now know, I will need to create two new buttons; one to scroll down when clicked and one to scroll up.
I can create the buttons but i am qiute stuck when it comes to getting the scrolling working...


Many Thanks for any help can be given.
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 3, 2007
use your buttons to assign the scroll property of your textfield to control its scrolling.
Kiru-sanAuthor
Participant
December 10, 2007
Right, I have tried a few things including this:

upBtn.onRelease=function(){
theTextBox2.scroll -=1;
}

downBtn.onRelease=function(){
theTextBox2.scroll +=1;
}

and can't seem to get things to work?!

Would you be able to clue me in regarding what i'm missing?


Thanks
kglad
Community Expert
Community Expert
December 10, 2007
if that code fails, it's either not on the _root timeline or upBtn is not the instance name of your button.

to debug, use: