[FMX] Multiple Dynamic Text -- Loading Problems

Greetings,

After quite a bit of hair-pulling elsewhere on the web, I finally found “Loading Text from External Sources,” which talks about loading multiple text files into a dynamic scrolling field. Yay, Kirupa! =) For reference, it’s here:
http://www.kirupa.com/developer/mx/multiple_dynamictext.htm

Ok, got that to work great; now the problem I’m having is that my text is longer than the example. So when I click on my second text file, it loads scrolled to the same position as I scrolled to on the first text file. In other words, my text files aren’t loading to the top of the dynamic text field…they’re loading into the middle after the first button is clicked. :puzzle:

As I’m still on the steep upward slope of the learning curve with ActionScript, I’d really appreciate some help identifying the code I need to make sure each text document loads to the top.

Thanks so much!
Kats

After a LOT of work, I figured it out. So…for others who have the same problem, here’s the solution:

Take the tutorial at http://www.kirupa.com/developer/mx/multiple_dynamictext.htm.

NOW…

In addition to the actionscript on the scroller buttons (if you’re using any, like I was), the actionscript on your buttons that take you to each dynamic text document (marked as 1 2 3 on the tutorial) reads:

on (release) {
loadText = new loadVars();
loadText.load(“yourTextNameHere.txt”);
loadText.onLoad = function(success) {
if (success) {
// trace(success);
newsBox.html = true;
newsBox.htmlText = this.myNews;
}
};
}

All you have to do is insert one line of code so it NOW reads:

on (release) {
loadText = new loadVars();
loadText.load(“ourTextNameHere.txt”);
newsBox.scroll=1; :bu:
loadText.onLoad = function(success) {
if (success) {
// trace(success);
newsBox.html = true;
newsBox.htmlText = this.myNews;
}
};
}

Kats - despot in search of a dominion