Hi folks! Im in dire need of some help on this one.
I have a movie that i load external swf's into at run time into a target mc. This works fine....
HOWEVER!!....
In the external swf's, i have mc's on the main timeline that act as pages. Inside these mc's i have a dynamic txt field. On the first frame of each mc i have
The txt field has the same variable name as the variable inside "external.txt"
This works perfectly if i leave it as a plain text chunk (done in notepad), but i need to format the text in the external file as html and have that display properly inside the dynamic txt field...
Ive browsed through a few tutes but have had no luck and was hoping some old hands could help out a bumbling newbie!!
There are a number of things that could be the problem. First off, flash doesn't support but the most basic html tags for formatting, so don't get to crazy there. Of course, yourTextField.html = true needs to be set. Fonts need to be embedded. Does it matter that it's in a loaded swf, not the main. I mean does it work ok when you run the loaded swf on it's own and not inside your root movie. It's hard to know if the problem is there or in your text formatting.
you have too many (and unsupported) formatting HTML tags. you need to strip it down to the basics.... none of your mc's have instance names either.. if you give them instance names, you can use loadVars() to load your text like this:
Code:
var my_lv = new LoadVars();
my_lv.onLoad = function() {
salsa_txt.html = true;
salsa_txt.htmlText = this.salsa;
//trace(this.salsa);
};
my_lv.load("http://www.vaticanbar.com/test/wednesdays.txt");
//
//this.loadVariables("http://www.vaticanbar.com/test/wednesdays.txt");
strip down your txt files more like this:
Code:
&salsa=<font color="#CC0000">Melbourne's hottest and sexiest night,where you can leave your inhibitions at the door and let the atmosphere and poeple of the night bring out the best of you with sounds of smooth sexy salsa in addition of funky RnB, Reggaeton and House beats.</font>Attractive shows and 5 star customer service to patrons to this exclusive night have indeed contributed to the name of this night, and for patrons that wish to learn this unforgetable exotic dance can participate in our early dance lessons performed by Melbourne's most biggest and well known dance schools.
<font color="#FFCC66"><a href="http://www.cubandanceacademy.com.au">www.cubandanceacademy.com.au</a></font>
<font color="#CCCCCC">Melbourne's hottest and sexiest night,where you can leave your inhibitions at the door and let the atmosphere and poeple of the night bring out the best of you with sounds of smooth sexy salsa in addition of funky RnB, Reggaeton and House beats. Attractive shows and 5 star customer service to patrons to this exclusive night have indeed contributed to the name of this night, and for patrons that wish to learn this unforgetable exotic dance can participate in our early dance lessons performed by Melbourne's most biggest and well known dance schools.</font>
<font color="#CC0000"><a href="http://www.cubandanceacademy.com.au">www.cubandanceacademy.com.au</a></font>
&
hope that helps....
Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
OS X 10.3.9 || Flash MX04 Pro
| del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |
notice in madz example that the onLoad function refers to this.salsa. Inside a loadvars command, this refers to the loadvars object itself which now has html data tied to a variable called salsa.
Also FK adds extra hard returns in code posts so ignore the extra hard returns.
it's your .txt file that you need to change..... i used the first file you posted, created a new text file starting &salsa=blah bah blah. and then using loadVars() exactly as i have it posted above, loaded the text no problem. Strip out all of your HTML tags except for <font size="XX" color="#XXXXXX"></font> | <br /> | <b> </b>|<a href =""></a> Flash doesn't support a whole lot more than those consistently. If you are embedding fonts and intend to use BOLD type at all.. make sure you embed the bold chars as well...
Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
OS X 10.3.9 || Flash MX04 Pro
| del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |
Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
OS X 10.3.9 || Flash MX04 Pro
| del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |
or you could load an actual HTML file instead of a text file into your dynamic text boxes, I've just done it with the following info:
actionscript for text box frame:
Code:
var ss:TextField.StyleSheet = new TextField.StyleSheet();
ss.load("html_files/dcgsa.css");
text_a.styleSheet = ss;
text_a.multiline= true;
text_a.wordWrap = true;
text_a.html = true;
story = new XML();
story.ignoreWhite = true;
story.load("html_files/a.html");
story.onLoad = function () {
text_a.htmlText = story;
}
where 'text_a' is the instance name for the text box and 'html_files/a.html' is the location and file name. I've got 7 or 8 of these on my flash projector file and they are all named with different instances, text_a, text_b, etc. One CSS sheet controls all the looks for all the HTML files. And yes, all the HTML code is stripped to the bare minimum. Oh yea, and this way you don't have to worry about the VARS in the text file.
thankyou all sooo much!!! it seems to be working fine. Thanks Madzigian for doing that...i owe you one! Looks like i'll be getting that cheque pre xmas after all
Looks like i'll be getting that cheque pre xmas after all
--- my cut is 10%!!!
no problem though.. happy to help.
GL
Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
OS X 10.3.9 || Flash MX04 Pro
| del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |