Autor Zpráva
modrosyr
Profil *
ahoj vsem, nezkousel nekdo z vas priklad ext. CSS, kterej je uvedenej v helpu k FLASH8? me se zda, ze to nefunguje (???)
FLASH8 > HELP > Learning AS 2.0 in Flash > Working with Text and Strings > Formatting text with Cascading Style Sheet styles > An example of using styles with HTML ... pokud to presne krok po kroku udelam, tak se mi furt objevuje "undefined" v tom textovym poli ... (???)

tohle je kod, co tam je uvedenej:

this.createTextField("news_txt", 99, 50, 50, 450, 300);
news_txt.border = true;
news_txt.html = true;
news_txt.multiline = true;
news_txt.wordWrap = true;
// Create a new style sheet and LoadVars object.
var myVars_lv:LoadVars = new LoadVars();
var styles:TextField.StyleSheet = new TextField.StyleSheet();
// Location of CSS and text files to load.
var txt_url:String = "myText.htm";
var css_url:String = "html_styles.css";
// 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);

// 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);

a k tomu jsou dva ext. soubory: "myText.htm" - naky nastylovany texty a vlastni CSS - "html_styles.css" ...
Toto téma je uzamčeno. Odpověď nelze zaslat.

0