706 Chapter 12: ActionScript Dictionary
The following is displayed in the Output panel:
bodyText
heading
See also
TextField.StyleSheet.getStyle()
TextField.StyleSheet.load()
Availability
Flash Player 7.
Usage
styleSheet.load(url)
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 “Flash Player security features”
on page 188.
Example
The following example loads the CSS file named styles.css (not shown) 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.
var styleObj = new TextField.StyleSheet();
styleObj.load("styles.css");
styleObj.onLoad = function (success) {
if(success) {
news_txt.styleSheet = styleObj;
}
}
See also
TextField.StyleSheet.onLoad