766
Chapter 7: ActionScript for Flash
Returns
A reference to a TextField.StyleSheet object.
Description
Constructor; creates a TextField.StyleSheet object.
Example
The following example loads in a style sheet and outputs the styles that load into the document.
Add the following ActionScript to your AS or FLA file:
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();
trace(styles_array.join(newline));
} else {
trace("Error loading CSS");
}
};
my_styleSheet.load("styles.css");
The styles.css file contains two styles called .heading and .mainbody, so the following information
writes to the log file:
Styles loaded:
.heading
.mainBody
The complete code for styles.css is found in the example for
TextField.StyleSheet.getStyle()
.
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.
Summary of Contents for FLEX
Page 1: ...Flex ActionScript Language Reference ...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0 ...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally ...
Page 135: ...case 135 See also break default strict equality switch ...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while ...
Page 808: ...808 Chapter 7 ActionScript for Flash ...
Page 810: ...810 Appendix A Deprecated Flash 4 operators ...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code ...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values ...
Page 822: ...822 Index ...