MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 767

Actionscript language reference
Table of Contents

Advertisement

Example
The following example loads a style sheet called styles.css into a SWF file, and writes the styles
that are loaded to the log file. When you click
object are removed.
// Create a new style sheet object
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();
for (var i = 0; i<styles_array.length; i++) {
trace("\t"+styles_array[i]);
}
trace("");
} else {
trace("Error loading CSS");
}
};
// Start the loading operation
my_styleSheet.load("styles.css");
clear_btn.onRelease = function() {
my_styleSheet.clear();
trace("Styles cleared.");
var styles_array:Array = my_styleSheet.getStyleNames();
for (var i = 0; i<styles_array.length; i++) {
trace("\t"+styles_array[i]);
}
trace("");
};
TextField.StyleSheet.getStyle()
Availability
Flash Player 7.
Usage
styleSheet.getStyle(styleName:String) : Object
Parameters
A string that specifies the name of the style to retrieve.
styleName
Returns
An object.
Description
Method; returns a copy of the style object associated with the style named
no style object associated with
clear_btn
,
is returned.
styleName
null
, all styles from the
my_styleSheet
styleName
TextField.StyleSheet.getStyle()
. If there is
767

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