all groups > flash data integration > may 2005 >
You're in the

flash data integration

group:

External HTML text display


External HTML text display joetheyeti
5/18/2005 4:21:52 PM
flash data integration:
I am having difficulty getting my dynamic text field to display external
HTML-formatted text. I can get non-HTML formatted text to appear by using the
following method:

Action script calling the external file: loadVariables("ExternalText.txt",
DynamicTextField.text);
In the properties inpector for my dynamic text field: Variable: Var2; Instance
Name: DynamicTextField
In my External.txt file: Var2=This is the text I want to display.

However, when I try to change my external text to HTML, I get a blank text
field. Here are the settings that DON'T work:

Action script calling the external file: loadVariables("ExternalText.txt",
DynamicTextField.htmlText);
Action script calling the external file: loadVariables("ExternalText.txt",
DynamicTextField.text);
In the properties inspector for my dynamic text field: Variable: Var2;
Instance Name: DynamicTextField; Render text as HTML: checked (true)
In my External.txt file: Var2=This is the <b>HTML</b> text I want to display.
In my External.txt file: Var2="This is the <b>HTML</b> text I want to display."

Any suggestions on why my HTML-formatted text does not appear when my
non-HTML-formatted text appears just fine?

Thanks in advance!

Re: External HTML text display adireddy
5/23/2005 12:00:00 AM
You should use DynamicTextField.htmlText

Also try the code attached for better control on loading. Also refer
http://www.devarticles.com/c/a/Flash/The-Power-of-LoadVars-Object/



var txtload:LoadVars = new LoadVars();
txtload.load("ExternalText.txt");
txtload.onLoad = function(){
DynamicTextField.htmlText = txtload.Var2;
}
Re: External HTML text display John Whittington
5/29/2005 5:53:38 PM
I am having the same problem as Joe was (is?), and Adi's solution doesn't work
for me. Like Joe, I am loading an external text file into a dynamic text box.
The text file is formatted as html, though the extension is .txt. Anything
between formatting tags disappears from the text, but the other text shows up
fine. Render text as HTML is checked; I've also tried using code to set
DynamicTextField.html = true.
This is driving me insane. Is there a solution out there? I've attached two
different chunks of code to illustrate my attempts at making this work.
Much thanks to anyone who can help out.

//first try:
loadText = new LoadVars();
loadText.load("homepage.html");
loadText.onLoad = function() {
hometext.html = true;
homeText.htmlText = this.homepage;
};
//second try (Adi's code):
var txtload:LoadVars = new LoadVars();
txtload.load("homepage.txt");
txtload.onLoad = function(){
homeText.html = true;
homeText.htmlText = txtload.home;
}
AddThis Social Bookmark Button