Application of HTML and CSS in Flash:
I accidentally saw my colleague Den making a small thing: using HTML and CSS in Flash, the code is like this:
var myStyle:TextField.StyleSheet = new TextField.StyleSheet();
myStyle.load(sample.css);
content_txt.styleSheet = myStyle;
content_txt.multiline= true;
content_txt.wordWrap = true;
content_txt.html = true;
var story:XML = new XML();
story.ignoreWhite = true;
story.load(sample.html);
story.onLoad = function () {
content_txt.htmlText = story;
}
This is to load external CSS and HTML (actually, to load XML as HTML uses -_-b). Later, Den wrote two ways to write styles in AS:
var css_str:String = .aoao{color:#010101;font-weight:bold;} .aoao:hover{color:#ff0000};
myStyle.parseCSS(css_str)myStyle.setStyle(.aoao, {color:'#010101', fontWeight:'bold'});
myStyle.setStyle(.aoao:hover, {color:#ff0000});
In fact, HTML can also be written in AS, just spell string. Whether CSS is written in AS or loading external CSS depends on the situation. When using the Web, you also need to consider the number of requests, file size, cache, and more importantly, the maintenance cost. However, in web applications, I didn't expect any suitable application. It is not very meaningful to use HTML to load Flash in the browser and then load HTML and CSS with Flash. Moreover, the support is not ordinary. Look at the supported HTML tags and CSS properties, =. = I originally wanted to solve the problem of Chinese underscore, but it still didn't work. It is said that others used flash to underscore.
Just play with the browser application. Just leave it on the desktop application.