Application of HTML and CSS in flash

Time:2022-5-9

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 as follows:
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 (in fact, it is to load XML when html is used -#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 directly. Whether CSS is written in as or loaded with external CSS depends on the situation. The number of requests, file size, cache and, more importantly, maintenance cost should be considered when using the web. However, in web applications, I didn’t expect any more suitable applications. It doesn’t make much sense to load HTML and CSS with flash after using HTML to load flash in the browser, and the support is not generally weak. Take a look at the supported HTML tags and CSS attributes, = Originally intended to solve the problem of Chinese underline, but it still didn’t work. It is said that others used flash to draw underline drops.
Just play with the browser application. Stay in the desktop app.

Recommended Today

Redis related knowledge points

Redis data structure String string Hash Storage object List Microblog follow list and message list Bidirectional linked list, supporting reverse search and traversal Lrange command supports how many elements can be read from a certain element to realize paging query. Redis can realize simple high-performance paging with high performance Set Automatic weight removal, it is […]