To set the FLASHMX component appearance using external CSS
Source: Internet
Author: User
Editor's note: We all know that you can easily set the appearance of the Flash MX 2004 component, but if you can use an external CSS file to control, it is better to use it will be more convenient. Here is an example of an online discovery (original URL: http://blogs.flashsupport.com/robert/archive/2004/09/08/209.aspx):
1. Create a CSS file that defines some attributes of the component, such as:/* FILENAME:STYLES.CSS * *
checkbox {
COLOR:0X0000FF;
Embedfonts:false;
fontfamily:arial;
fontsize:24;
}
2. Load the CSS file in Flash to set the related style of the component:
Import Mx.controls.CheckBox;
var ostyle:object;
var CcbTest:mx.controls.CheckBox;
var styles = new Textfield.stylesheet ();
Styles.onload = function (Bsuccess:boolean): Void {
if (bsucess) {
Ostyle = This.getstyle ("checkbox");
for (var i in Ostyle) {
Ccbtest.setstyle (i, ostyle[i]);
}
} else {
Trace ("Error loading CSS file.");
}
};
Styles.load ("Styles.css");
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