Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / May 2005



Tip: Looking for answers? Try searching our database.

External HTML text display

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
joetheyeti - 18 May 2005 17:21 GMT
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!
adireddy - 23 May 2005 09:27 GMT
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;
}
John Whittington - 29 May 2005 18:53 GMT
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;
}
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.