Application of HTML and CSS in Flash:
I accidentally saw my colleague Den making a little thing: using HTML and CSS in Flash, the code is like this:
The code is as follows: |
Copy code |
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, XML is loaded when HTML is used-_-B. Later Den wrote two ways to write styles in:
The code is as follows: |
Copy code |
= ". 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, and strings can be spelled directly. It depends on whether CSS is written in AS or loaded with external CSS. The number of requests, file size, cache, and maintenance cost must be considered on the Web. However, in Web applications, I did not expect any suitable applications. Loading HTML and CSS with Flash in a browser is of little significance, and the support is not generally weak, let's take a look at the supported HTML tags and CSS attributes, =. = I used it to solve the problem of Chinese underline, but the result is still not good. It is said that others use flash to draw underscores.
Just play with the browser application. Stay in the desktop application.