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
1.1 Introduction By enabling the slow query log, ...
When configuring the interface domain name, each ...
Note: Since .NET FrameWork cannot be run in core ...
This article shares the specific code for WeChat ...
Moreover, an article website built with a blog pro...
HTTP Status Codes The status code is composed of ...
One day I found that the execution speed of a SQL...
1. Overview of viewport Mobile browsers usually r...
BEM from QQtabBar First of all, what does BEM mea...
Preface The Windows system that can be activated ...
This article uses an example to describe how to q...
Today I will introduce a small Javascript animati...
This article shares the specific code of Javascri...
Table of contents 1. Introduction 2. Actual Cases...
1. Definition of offsetParent: offsetParent is th...