catreya
May 30th, 2003, 05:20 PM
This is regarding the tutorial at Kirupa.
http://www.kirupa.com/developer/mx/dynamic_scroller.htm
For loading the text from a txt document i am using the following code (which is the same as Kirupa's code - except for the names)
/* Load Welcome Message */
loadText = new LoadVars();
loadText.load("welcome.txt");
//creating the loadVarsText function
loadText.onLoad = function() {
scrollableText.text = this.welcometext;
};
/* End of Welcome Messge */
However, only the first three words of the txt doc file is displayed.
I am not using the component scroller but using my own buttons and codes for scrolling vertically. Those codes are:
on (press, release, keyPress "<Up>") {
currentScroll = scrollableText.scroll;
if (Number(currentScroll)>1) {
scrollableText.scroll = currentScroll-1;
}
}
on (press, release, keyPress "<Down>") {
currentScroll = scrollableText.scroll;
if (Number(currentScroll)<Number(scrollableText.maxscroll)) {
scrollableText.scroll = Number(currentScroll)+1;
}
}
If i declare the value of the variable "scrollableText" within the actions panel then it works.
http://www.kirupa.com/developer/mx/dynamic_scroller.htm
For loading the text from a txt document i am using the following code (which is the same as Kirupa's code - except for the names)
/* Load Welcome Message */
loadText = new LoadVars();
loadText.load("welcome.txt");
//creating the loadVarsText function
loadText.onLoad = function() {
scrollableText.text = this.welcometext;
};
/* End of Welcome Messge */
However, only the first three words of the txt doc file is displayed.
I am not using the component scroller but using my own buttons and codes for scrolling vertically. Those codes are:
on (press, release, keyPress "<Up>") {
currentScroll = scrollableText.scroll;
if (Number(currentScroll)>1) {
scrollableText.scroll = currentScroll-1;
}
}
on (press, release, keyPress "<Down>") {
currentScroll = scrollableText.scroll;
if (Number(currentScroll)<Number(scrollableText.maxscroll)) {
scrollableText.scroll = Number(currentScroll)+1;
}
}
If i declare the value of the variable "scrollableText" within the actions panel then it works.