PDA

View Full Version : Importing txt as HTML AND using the Scroller Component


Desmo
02-27-2003, 04:23 PM
OK... I've been beating myself silly trying to get a .txt file to import as HTML (need to use links) AND use the scroller component. I've tried the LoadVar, and a script from a friend that consists of:

loadVarsText = new loadVars();
loadVarsText.load("copy.txt");

loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");

scroller.text = this.textField;
} else {
trace("not loaded");
}
};

I can get the scroller component to work with this script, but it will not load the txt file as HTML.

I also tried to use the hyperField.html=true; at the beginning, and that doesn't import the .txt file as HTML.

Merely clicking on the HTML activation property button doesn't solve the issue either... Any ideas??? THANKS!!!

hamzaf
02-27-2003, 04:42 PM
hi,
you have to use .htmlText, instead of .text:


myTextField.html = true;
myTextField.htmlText = "<B>some bold text</B>";


Regards,
Hamza.

Desmo
02-27-2003, 04:59 PM
hasmaf -

Thanks, I'll try it out. I'm curious if it will work with my script though, as it's the only one I can find that will allow me to both import AND use a scroller...

Des

Desmo
02-27-2003, 05:49 PM
Hummm... I couldn't get it to work with my script.

FYI...
I CAN get the .txt file to import as HTML and can use various tags or linking, bold etc, but the scroll bar will not work. (using the loadVariablesNum("some.txt", 0);

Seems like they have limited the use of the scroll bar component to either .txt import just as type, (no HTML) and HTML imbedded text within the movie itself... Kinda frustrating...

hamzaf
02-27-2003, 06:49 PM
hi,
i made for you a sample zip file. check the attachment.

Cheers.
Hamza.

Desmo
02-27-2003, 07:54 PM
THANKS! I'll check it out and get back to you.

Desmo
02-27-2003, 07:59 PM
VERY COOL. I obviously wasn't inputing the script in the right location. Thanks! I owe you one. (or two)