Scrolling Dynamically Loaded Text - Help

I followed the Scrolling Dynamically Loaded Text tutorial & it worked great. The only problem I am running into is I have a huge space after each line. I can’t seem to figure out what code to use so I can add <BR> from html at the end of each line.

Test site http://www.rbvll.org/final.html Choose Standings, majors & the file will load but there are spaces.

Properties:
Dynamic Text
Instance Name - scroller
Selectable Text Button

Action Script:

loadText = new loadVars();
loadText.load(“majorstandings.txt”);
// creating the loadVarsText function
loadText.onLoad = function() {
scroller.text = this.majorstandingstext;
};

Any help would be greatly appreciated.

Thanks

Deb

Yeah, this is a common problem unfortunately. See Flash interprets your carriage returns (when you press enter to get to a new line) and puts that as a huge space. The way around this is to HTML enable your textbox like this…

loadText = new loadVars();
loadText.load(“majorstandings.txt”);
// creating the loadVarsText function
loadText.onLoad = function() {
<B>scroller.html = true;
scroller.htmlText = this.majorstandingstext;</B>
};

What we did there was added the scroller.html code which registers that your textbox will be able to accept HTML. Then we changed scroller.text to scroller.htmlText, this tells flash to interpret any HTML (well, only Font Formatting tags and such are accepted) in the file being loaded.

Alright, after doing that you have to remove all of your carriage returns and replace them with the break tag in HTML. If you don’t know what that is, it goes like this…

<BR>

Unfortunately this makes for one long string of text, but it works :-\ Besides, you can always use the word wrap feature in most any text program (including notepad).

It worked perfectly.

Awesome! No problem :slight_smile: