MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 1147

Actionscript 2.0 language reference
Table of Contents

Advertisement

trace("This is an empty style sheet.");
} else {
for (var i = 0; i<styleNames.length; i++) {
var styleName:String = styleNames[i];
trace("Style "+styleName+":");
var styleObject:Object = my_styleSheet.getStyle(styleName);
for (var propName in styleObject) {
var propValue = styleObject[propName];
trace("\t"+propName+": "+propValue);
}
trace("");
}
}
}
}
Create a CSS document called styles.css, which has two styles called
that define properties for
.mainBody
following code in the CSS document:
/~ In styles.css ~/
.heading {
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;
font-weight: bold;
}
.mainBody {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: normal;
}
Finally, in a FLA or ActionScript file, enter the following ActionScript to load the external
style sheet, styles.css:
StyleSheetTracer.displayFromURL("styles.css");
This displays the following in the Output panel:
Style .heading:
fontWeight: bold
fontSize: 24px
fontFamily: Arial, Helvetica, sans-serif
Style .mainBody:
fontWeight: normal
fontSize: 12px
fontFamily: Arial, Helvetica, sans-serif
See also
,
font-family
font-size
StyleSheet (TextField.StyleSheet)
and
.heading
and
. Enter the
font-weight
1147

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents