The application of HTML and CSS in Flash

Source: Internet
Author: User
Tags file size html tags

The application of HTML and CSS in Flash:

I accidentally saw my colleague Den getting a little something: using HTML and CSS in Flash, the code is this:

Example Source 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 loaded with an external CSS with HTML (actually loading XML when HTML is-_-b). Later Den wrote two ways to write the style in as:

Example Source Code

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 inside, directly spelled string on the line. For CSS to write in as or load external CSS will see the situation, with the web to consider the number of requests, file size, caching, more importantly, maintenance costs. But in the Web application I did not think of any more suitable applications, in the browser using HTML to load flash and then loaded with flash HTML and css meaning is not very small, and support is not generally weak, look at the support of HTML tags and css properties, =. = originally want to use to solve the problem of Chinese underline, the result is still not, it is said that others are using flash draw underline drop.

The application of the browser to play and forget it. Still stay on the desktop application bar.

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.