1148
ActionScript classes
getStyleNames (StyleSheet.getStyleNames method)
public getStyleNames() : Array
Returns an array that contains the names (as strings) of all of the styles registered in this style
sheet.
Availability:
ActionScript 1.0; Flash Player 7
Returns
Array
- An array of style names (as strings).
Example
This example creates a StyleSheet object named
styleSheet
that contains two styles,
heading
and
bodyText
. It then invokes the StyleSheet object's
getStyleNames()
method,
assigns the results to the array
names_array
, and displays the contents of the array in the
Output panel.
import TextField.StyleSheet;
var my_styleSheet:StyleSheet = new StyleSheet();
my_styleSheet.setStyle("heading", {fontsize:'24px'});
my_styleSheet.setStyle("bodyText", {fontsize:'12px'});
var names_array:Array = my_styleSheet.getStyleNames();
trace(names_array.join("\n"));
The following information appears in the Output panel:
bodyText
heading
See also
getStyle (StyleSheet.getStyle method)
load (StyleSheet.load method)
public load(url:String) : Boolean
Starts loading the CSS file into the StyleSheet. The load operation is asynchronous; use the
onLoad()
callback handler to determine when the file has finished loading. The CSS file must
reside in the same domain as the SWF file that is loading it.
Availability:
ActionScript 1.0; Flash Player 7
Parameters
url
:String
- 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.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...