font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: normal;
}
And finally, in a FLA or AS file, enter the following ActionScript to load the external style sheet,
styles.css.
StyleSheetTracer.displayFromURL("styles.css");
This writes the following information to the log file:
Style .heading:
fontWeight: bold
fontSize: 24px
fontFamily: Arial, Helvetica, sans-serif
Style .mainBody:
fontWeight: normal
fontSize: 12px
fontFamily: Arial, Helvetica, sans-serif
See also
TextField.StyleSheet.setStyle()
TextField.StyleSheet.getStyleNames()
Availability
Flash Player 7.
Usage
styleSheet.getStyleNames() : Array
Parameters
None.
Returns
An array.
Description
Method; returns an array that contains the names (as strings) of all of the styles registered in this
style sheet.
Example
This example creates a style sheet object named
and
. It then invokes the style sheet object's
bodyText
results to the array
var my_styleSheet:TextField.StyleSheet = new TextField.StyleSheet();
my_styleSheet.setStyle("heading", {fontsize:'24px'});
my_styleSheet.setStyle("bodyText", {fontsize:'12px'});
, and writes the contents of the array to the log file.
names_array
that contains two styles,
styleSheet
getStyleNames()
TextField.StyleSheet.getStyleNames()
heading
method, assigns the
769
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?