Application of HTML and CSS in Flash: I accidentally saw my colleague Den making something: 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 for loading external CSS and HTML (actually loading XML as HTML using -_-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 the string directly. Whether to write CSS in AS or load external CSS depends on the situation. When using it on the Web, you also need to consider the number of requests, file size, cache, and more importantly, maintenance costs. However, I can't think of any suitable application in Web applications. It doesn't make much sense to use HTML to load Flash in the browser and then use Flash to load HTML and CSS. Moreover, the support is very weak. Take a look at the supported HTML tags and CSS attributes. = I originally wanted to use it to solve the problem of Chinese underline, but it didn't work. I heard that others use flash to draw underline. Just play around with the browser app. Stay with the desktop app. |
<<: Summary of common docker commands
>>: MySQL DATE_ADD and ADDDATE functions add a specified time interval to a date
After the docker installation is completed on the...
1. Best left prefix principle - If multiple colum...
Table of contents 1. Prototype chain inheritance ...
1. Download nginx [root@localhost my.Shells]# doc...
Table of contents 1. Check whether MySQL has been...
Scenario: The interaction methods between parent ...
Recently, the business side reported that some us...
Preface: In the daily use of the database, it is ...
Preface Not long ago, I saw an interesting proble...
This article briefly introduces how to install My...
Write a SQL first SELECT DISTINCT from_id FROM co...
This blog is a work note environment: nginx versi...
MySQL 8.0.18 stable version (GA) was officially r...
Basic knowledge of responsive layout development ...
Here are some points to note when registering Tom...