Clear (Stylesheet.clear Method) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Methods inherited from class Object
addProperty (Object.addProperty
(Object.hasOwnProperty
(Object.isPropertyEnumerable
method),
registerClass (Object.registerClass
(Object.toString
(Object.valueOf
method),

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
object are removed.
my_styleSheet
// 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]);
method),
method),
isPropertyEnumerable
method),
method),
unwatch (Object.unwatch
watch (Object.watch method)
hasOwnProperty
isPrototypeOf (Object.isPrototypeOf
method),
toString
method),
clear_btn
StyleSheet (TextField.StyleSheet)
valueOf
, all styles from the
1145

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF