External txt file to scroller

I read the tutorial on loading external text into scrollers located here: http://www.kirupa.com/developer/mx/multiple_dynamictext.htm

I was wondering what AS code would I use if I just wanted to load one txt file into the scroller right from the get go.

Thanks :asian:

–copy and paste from an old project i did—
[AS]
loadUpdateText = new loadVars();
loadUpdateText.load(“updates.txt”);
loadUpdateText.onLoad = function() {
updates.html = true;
updates.wordWrap = true;
updates.htmlText = this.updateText;
};
[/AS]

Thanks a lot,

is there any certain things I have to edit/type in for my dynamic input text field? (var, instance name)

Also, in the tutorial, it says to start off the txt file with “myNews=”…

would i have to do something like that the the txt file im using?

  • Domo

well updates is the instance name, i dont use a variable name,
and if your using my code you should start off your textfile with

updateText=

Thanks a million! I got it to work! :slight_smile:

good i’m glad :slight_smile: and your welcome of course

Hi,

I am trying to do exactly what you have done. I did the dynamic scroller tut, and modified the code from kirupa.txt to update.txt, and changed the kirupatext= to updateText. I tried using your code from above, but it still isn’t working. I have my .swf & .fla files in the same folder as my .txt. I’m not to sure what the problem is? I checked the instance name, and I just can’t get it. I am on a Mac, so I dunno if that is the problem. Thanks for any help or ideas! Cheers!

[AS]loadText = new loadVars();
loadText.load(“textfile.txt”);
loadText.onLoad = function(OK) {
if (OK) {
myText.html = true;
myText.htmlText = this.text;
}
};[/AS]textfile.txt is your txt file;
text is the variable inside your txt file;
myText is the instance name of your textfield;
if your textfield is inside a movie clip, replace the last 2 lines for:
[AS]movieClip.myText.html = true;
movieClip.myText.htmlText = this.text;[/AS]Where movieClip is the instance name of the movie clip with the textfield inside

thanks for your quick response. i am still having troubles though, i’m not to sure what the problem is. i looked on macromedia, and found this tut

http://www.macromedia.com/support/flash/ts/documents/dynamic_text_scrollmx.htm

even that didn’t work, the done loading worked, but nothing else. the scroller does pop up, but none of the text. i dunno?:!:

your textfile should be something like this:

text=here goes your content&

jebas, the tut looked so simple! lol, i uploaded my zip, if you want to have a look at it, otherwise i don’t know whats going on. mind u i am still a newbie. thanks for helping though! :thumb:

–amanda

http://www.haydenhaven.com/scroller.zip

Replace your txt file content for this:

text=blah blah blah&

put the & on the end, and still nothing

Did you erase everything else besides
text=blah blah blah&
?

i’m off to bed now, thanks for helping claudio, i will be back tomorrow, cheers!

yes in the text file, all there is, is text=blah blah blah&

Then i dont know why it isnt working :-\

madness! I am at school right now and just attempted the scroller, and it worked! must be the mac? thanks again!

ahhh found a new problem, 2 actually. the text runs off and dosen’t go down to the next line. and even though there is more text below, the scroller dosen’t scroll up or down? any suggestions?

I know the solution to the first problem - in your .fla select the textbox and in the properties panel, you should see a dropdown menu that currently says “Single Line”. Change that to “Multiline”. The text should now go onto the next line(s) accordingly.