all groups > flash actionscript > january 2006 >
You're in the

flash actionscript

group:

CSS in FLASH8


CSS in FLASH8 gringojuan NO[at]SPAM gmail.com
1/23/2006 11:14:30 PM
flash actionscript:
hi everybody, did anyone try a CSS example which is a part of flash8? I did but
it seems it does not work (???)
FLASH8 > HELP > Learning AS 2.0 in Flash > An example of using styles with
HTML ... there is a step by step tutorial. I did it, I have checked it three
times but it is not working ... i just see "undefined" in the box ...

here is the AS code:

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


Re: CSS in FLASH8 kglad
1/24/2006 4:51:15 AM
Re: CSS in FLASH8 gringojuan NO[at]SPAM gmail.com
1/24/2006 8:27:05 AM
no, same thing with .txt file - it does not work ....
Re: CSS in FLASH8 kglad
1/25/2006 2:54:43 AM
what appears in the output panel if you use the following:

myVars_lv.onData = function(src:String):Void {
if (src != undefined) {
news_txt.htmlText = src;
trace(src);
} else {
trace("Unable to load HTML file");
}
};

Re: CSS in FLASH8 NSurveyor
1/25/2006 3:42:51 AM
AddThis Social Bookmark Button