03.07.2013 Views

Guide de reference du langage ActionScript 2.0 - PowWeb

Guide de reference du langage ActionScript 2.0 - PowWeb

Guide de reference du langage ActionScript 2.0 - PowWeb

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Valeur renvoyée<br />

Boolean - Valeur booléenne indiquant si le texte a été analysé avec succès (true) ou pas<br />

(false).<br />

Exemple<br />

L'exemple suivant analyse la CSS dans css_str Le script affiche le résultat <strong>de</strong> son analyse <strong>de</strong><br />

la CSS, puis affiche la CSS analysée dans le panneau <strong>de</strong> sortie.<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 />

<strong>du</strong>mpStyles(my_styleSheet);<br />

} else {<br />

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

}<br />

//<br />

function <strong>du</strong>mpStyles(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!