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.

Returns<br />

Boolean - A Boolean value that indicates whether the text was parsed successfully (true) or<br />

not (false).<br />

Example<br />

The following example parses the CSS in css_str. The script displays information about<br />

whether it parsed the CSS successfully, <strong>and</strong> then displays the parsed CSS in the Output panel.<br />

import TextField.StyleSheet;<br />

var css_str:String = ".heading {font-family: Arial, Helvetica, sans-serif;<br />

font-size: 24px; font-weight: bold; }";<br />

var my_styleSheet:StyleSheet = new StyleSheet();<br />

if (my_styleSheet.parseCSS(css_str)) {<br />

trace("parsed successfully");<br />

dumpStyles(my_styleSheet);<br />

} else {<br />

trace("unable to parse CSS");<br />

}<br />

//<br />

function dumpStyles(styles:StyleSheet):Void {<br />

var styleNames_array:Array = styles.getStyleNames();<br />

for (var i = 0; i

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

Saved successfully!

Ooh no, something went wrong!