User Guide
StyleSheet (TextField.StyleSheet) 1145
Methods inherited from class Object
clear (StyleSheet.clear method)
public clear() : Void
Removes all styles from the specified StyleSheet object.
Availability: ActionScript 1.0; Flash Player 7
Example
The following example loads a StyleSheet called styles.css into a SWF file, and displays the
styles that are loaded in the Output panel. When you click
clear_btn, all styles from the
my_styleSheet object are removed.
// Create a new StyleSheet object
import TextField.StyleSheet;
var my_styleSheet:StyleSheet = new 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]);
addProperty (Object.addProperty method), hasOwnProperty
(Object.hasOwnProperty method), isPropertyEnumerable
(Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf
method), registerClass (Object.registerClass method), toString
(Object.toString method), unwatch (Object.unwatch method), valueOf
(Object.valueOf method), watch (Object.watch method)