MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 705

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

The following code loads the styles from the CSS file, and then displays each property name and
its value in the Output panel.
var styleSheet = new TextField.styleSheet();
styleSheet.load("styles.css");
var sectionStyle = styleSheet.getStyle("heading");
for(property in sectionStyle) {
var propName = property;
var propValue = sectionStyle[property];
trace(propName + " : " + propValue);
}
This would display the following in the Output panel:
fontfamily : Arial
fontsize : 24px
fontweight : bold
See also
TextField.StyleSheet.setStyle()
TextField.StyleSheet.getStyleNames()
Availability
Flash Player 7.
Usage
styleSheet.getStyleNames()
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 styleSheet= new TextField.StyleSheet();
styleSheet.setStyle("heading", {
fontsize: '24px'
});
styleSheet.setStyle("bodyText", {
fontsize: '12px'
});
var names_array = styleSheet.getStyleNames();
trace(names.join("\n"));
, and displays the contents of the array in the Output panel.
names_array
that contains two styles,
styleSheet
getStyleNames()
TextField.StyleSheet.getStyleNames()
heading
method, assigns the
705

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Questions and answers

Table of Contents