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.
Example
The following example loads a style sheet called styles.css into a SWF file, and displays the styles
that are loaded in the Output panel. When you click
my_styleSheet
// 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("");
};
860
Chapter 2: ActionScript Language Reference
object are removed.
, all styles from the
clear_btn
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?