Constructor for the TextField.StyleSheet class
Availability
Flash Player 7.
Usage
new TextField.StyleSheet() : TextField.StyleSheet
Returns
A reference to a TextField.StyleSheet object.
Description
Constructor; creates a TextField.StyleSheet object.
Example
The following example loads in a style sheet and outputs the styles that load into the document.
Add the following ActionScript to your AS or FLA file:
var my_styleSheet:TextField.StyleSheet = new TextField.StyleSheet();
my_styleSheet.onLoad = function(success:Boolean) {
if (success) {
trace("Styles loaded:");
var styles_array:Array = my_styleSheet.getStyleNames();
trace(styles_array.join(newline));
} else {
trace("Error loading CSS");
}
};
my_styleSheet.load("styles.css");
The styles.css file contains two styles called .heading and .mainbody, so the following information
is displayed in the Output panel:
Styles loaded:
.heading
.mainBody
The complete code for styles.css is found in the example for TextField.StyleSheet.getStyle().
TextField.StyleSheet class
859
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?