03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

}<br />

}<br />

}<br />

Create a CSS document called styles.css, which has two styles called .heading <strong>and</strong><br />

.mainBody that define properties for font-family, font-size <strong>and</strong> font-weight. Enter the<br />

following code in the CSS document:<br />

.heading {<br />

font-family: Arial, Helvetica, sans-serif;<br />

font-size: 24px;<br />

font-weight: bold;<br />

}<br />

.mainBody {<br />

font-family: Arial, Helvetica, sans-serif;<br />

font-size: 12px;<br />

font-weight: normal;<br />

}<br />

Finally, in a FLA or <strong>ActionScript</strong> file, enter the following <strong>ActionScript</strong> to load the external<br />

style sheet, styles.css:<br />

StyleSheetTracer.displayFromURL("styles.css");<br />

This displays the following in the Output panel:<br />

Style .heading:<br />

fontWeight: bold<br />

fontSize: 24px<br />

fontFamily: Arial, Helvetica, sans-serif<br />

Style .mainBody:<br />

fontWeight: normal<br />

fontSize: 12px<br />

fontFamily: Arial, Helvetica, sans-serif<br />

See also<br />

setStyle (StyleSheet.setStyle method), getStyleNames<br />

(StyleSheet.getStyleNames method)<br />

getStyleNames (StyleSheet.getStyleNames method)<br />

public getStyleNames() : Array<br />

Returns an array that contains the names (as strings) of all of the styles registered in this style<br />

sheet.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 7<br />

1166 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!