Application of HTML and CSS in Flash

Application of HTML and CSS in Flash
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

Recommend

How to enable slow query log in MySQL

1.1 Introduction By enabling the slow query log, ...

Nginx operation and maintenance domain name verification method example

When configuring the interface domain name, each ...

WeChat Mini Programs Implement Star Rating

This article shares the specific code for WeChat ...

Getting Started Tutorial for Beginners ⑨: How to Build a Portal Website

Moreover, an article website built with a blog pro...

Detailed explanation of the 14 common HTTP status codes returned by the server

HTTP Status Codes The status code is composed of ...

MySql Sql optimization tips sharing

One day I found that the execution speed of a SQL...

The basic principles and detailed usage of viewport

1. Overview of viewport Mobile browsers usually r...

A detailed introduction to the CSS naming specification BEM from QQtabBar

BEM from QQtabBar First of all, what does BEM mea...

How to quickly delete all tables in MySQL without deleting the database

This article uses an example to describe how to q...

Velocity.js implements page scrolling switching effect

Today I will introduce a small Javascript animati...

Javascript to achieve the drag effect of the login box

This article shares the specific code of Javascri...

Vue3 (III) Website Homepage Layout Development

Table of contents 1. Introduction 2. Actual Cases...

JavaScript offsetParent case study

1. Definition of offsetParent: offsetParent is th...