![MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference Download Page 1145](http://html.mh-extra.com/html/macromedia/flash-8-actionscript-2-0-language/flash-8-actionscript-2-0-language_reference_6875371145.webp)
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)
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...