[FMX] External Text File problems

I’m sure this is an easy fix but for some reason I cannot get the text field to accept HTML coding when I’m loading the text in. I have the Render Text as HTML (<>) button checked but still nothing happens. Here’s the code I’m using:

var externalData:LoadVars = new LoadVars();
externalData.onLoad = function() {
	news_txt.text = externalData.newsText;
}
externalData.load("News_Text.txt");

I’m thinking I need to add something similar to this??:

news_txt.html = true;
news_txt.htmlText = newsText;

Any help would be greatly appreciated.

From the tutorial:

loadText = new loadVars();
loadText.load("your_txt.txt");
loadText.onLoad = function(success) {
    if (success) {
        // trace(success);
        textBox.html = true;
        textBox.htmlText = this.myNews;
    }
};

Thank you sir :azn:

Okay, now I have a new problem with the external text files. Everything worked fine when I was testing it on my computer but when I uploaded the file to the server and tested it, the only text that loaded was “undefined”. Is there something else I need to do in order to make this work correctly?

Anyone??

theres a really helpful tutorial on flashkit.com about loading external text. go to flashkit and do a search for “textformatter” in the tutorials section.

Thanks for the response. I tried out a few tutorials on FlashKit and still nothing. I thought I just had to maybe change the path to “http://…” instead of “News_Text.txt” but still didn’t work. Any other suggestions??

dude, i have no idea how your file is set up . post your .fla and we’ll see.

I’ll post the .fla when I get home later today. Thanks so much for the help dude.

Hey dudes, easy on the “dude” because not all of us are dudes. :wink:

Uh, yeah, post your file and explain the setup and someone will help ya.

:hr:

I’m trying to upload my fla but the file is too big. I’m on a mac, how can I put it in a zip file? I only have stuff-it.

make sure that everything is named the same in your files and on the server. I had a text file capitalized on the server and not in my AS and that screwed it up.

Oh man, that was exactly it. My AS was saying News_text.txt and my file name was News_Text.txt … still doesn’t make sense why it would work on my hard drive and not the server. Either way, it’s finally fixed. Thanks for the help guys. I know I’m going to have more problems before this site is finished.