MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 766

Actionscript language reference
Table of Contents

Advertisement

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
writes to the log file:
Styles loaded:
.heading
.mainBody
The complete code for styles.css is found in the example for
TextField.StyleSheet.getStyle()
TextField.StyleSheet.clear()
Availability
Flash Player 7.
Usage
styleSheet.clear() : Void
Parameters
None.
Returns
Nothing.
Description
Method; removes all styles from the specified style sheet object.
766
Chapter 7: ActionScript for Flash
.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flex

Table of Contents