ActionScript 2.0 Language Reference |
|
|
|
| ActionScript classes > StyleSheet (TextField.StyleSheet) > 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
Array - An array of style names (as strings).
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
getStyle (StyleSheet.getStyle method)
|
|
|
|