Hi -
In the 2nd panel (Cuisines and Menus) of a site I'm trying to build at:
http://www.thymetoeatpcs.com/index2.html
there's a dynamic TextField that brings in Text and CSS.
It works fine locally but when I upload it and view it, the CSS doesn't get
loaded.
To make this more confusing...sometimes it does and sometimes it doesnt.
I've attached the code but I really have no idea what's wrong.
How can I make sure the text and CSS load in time to appear correctly when the
user gets to that page?
TIA your expertise.
JL
this.createTextField("news_txt", 99, 130, 230, 260, 160);
news_txt.html = true;
news_txt.multiline = true;
news_txt.wordWrap = true;
news_txt.border = true;
news_txt.borderColor = 0x524D16;
// Location of CSS and text files to load.
var txt_url:String = "CuisineList.html";
var css_url:String = "thyme.css";
// Define onLoad handler and Load CSS file.
styles.onLoad = function(success:Boolean):Void {
if (success) {
/* If the style sheet loaded without error,
then assign it to the text object,
and assign the HTML text to the text field. */
news_txt.styleSheet = styles;
//news_txt.text = storyText;
} else {
trace("Unable to load CSS file.");
}
};
styles.load(css_url);
// Define onData handler and load text to display.
myVars_lv.onData = function(src:String):Void {
if (src != undefined) {
news_txt.htmlText = src;
} else {
trace("Unable to load HTML file");
}
};
myVars_lv.load(txt_url);
aniebel - 30 Jan 2007 11:41 GMT
Maybe this is way off but have you embedded your font?
jlucchesi - 30 Jan 2007 14:14 GMT
Amy - Thanks for the suggestion but
I have not embedded a font because the CSS lists a few as in:
font-family: Verdana,Arial,Helvetica,sans-serif;
JL
jlucchesi - 31 Jan 2007 14:21 GMT
Do I need to embed fonts to use CSS and HTML? The CSS is calling for common fonts.
Shouldn't that be OK?