770
Chapter 7: ActionScript for Flash
var names_array:Array = my_styleSheet.getStyleNames();
trace(names_array.join("\n"));
The following information is written to the log file:
bodyText
heading
See also
TextField.StyleSheet.getStyle()
TextField.StyleSheet.load()
Availability
Flash Player 7.
Usage
styleSheet
.load(
url:String
)
: Void
Parameters
url
The URL of a CSS file to load. The URL must be in the same domain as the URL where
the SWF file currently resides.
Returns
Nothing.
Description
Method; starts loading the CSS file into
styleSheet
. The load operation is asynchronous; use
the
TextField.StyleSheet.onLoad
callback handler to determine when the file has finished
loading.
The CSS file must reside in exactly the same domain as the SWF file that is loading it. For more
information about restrictions on loading data across domains, see “Applying Flex Security” in
Developing Flex Applications
.
Example
For an example of asynchronously loading style sheets using ActionScript 2.0, see the entry for
TextField.StyleSheet.getStyle()
.
The following example loads the CSS file named styles.css into the style sheet object
styleObj
.
When the file has finished loading successfully, the style sheet object is applied to a TextField
object named
news_txt
.
this.createTextField("news_txt", 999, 10, 10, 320, 240);
news_txt.multiline = true;
news_txt.wordWrap = true;
news_txt.html = true;
var my_styleSheet:TextField.StyleSheet = new TextField.StyleSheet();
my_styleSheet.onLoad = function(success:Boolean) {
if (success) {
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
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...