Application of HTML and CSS in Flash

Source: Internet
Author: User
Tags file size html tags

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.