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

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

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

Exemple<br />

Le co<strong>de</strong> <strong>ActionScript</strong> suivant suit l'ensemble <strong>de</strong>s informations <strong>de</strong> formatage d'un champ texte<br />

qui est créé pendant l'exécution.<br />

this.createTextField("dyn_txt", this.getNextHighestDepth(), 0, 0, 100,<br />

200);<br />

dyn_txt.text = "Frank";<br />

dyn_txt.setTextFormat(new TextFormat());<br />

var my_fmt:TextFormat = dyn_txt.getTextFormat();<br />

for (var prop in my_fmt) {<br />

trace(prop+": "+my_fmt[prop]);<br />

}<br />

La métho<strong>de</strong> MovieClip.getNextHighestDepth() utilisée dans cet exemple requiert Flash<br />

Player 7 ou version ultérieure. Si votre fichier SWF comporte un composant <strong>de</strong> la version 2,<br />

utilisez la classe DepthManager <strong>de</strong>s composants <strong>de</strong> la version 2 au lieu <strong>de</strong> la métho<strong>de</strong><br />

MovieClip.getNextHighestDepth().<br />

Voir également<br />

getNewTextFormat (métho<strong>de</strong> TextField.getNewTextFormat), setNewTextFormat<br />

(métho<strong>de</strong> TextField.setNewTextFormat), setTextFormat (métho<strong>de</strong><br />

TextField.setTextFormat)<br />

gridFitType (propriété TextField.gridFitType)<br />

public gridFitType : String<br />

Le type d'adaptation à la grille appliqué à cette occurrence <strong>de</strong> TextField. Cette propriété ne<br />

s'applique que si la propriété antiAliasType <strong>du</strong> champ texte est définie sur "advanced".<br />

Pour la propriété gridFitType, vous pouvez utiliser les valeurs <strong>de</strong> chaînes suivantes :<br />

Valeur <strong>de</strong> chaîne Description<br />

"none" Ne spécifie pas d'adaptation à la grille. Les lignes<br />

horizontales et verticales <strong>de</strong>s glyphes ne sont pas<br />

alignées sur la grille <strong>de</strong> pixels. Ce paramètre est<br />

généralement retenu pour les animations ou les<br />

gran<strong>de</strong>s polices.<br />

TextField 1225

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

Saved successfully!

Ooh no, something went wrong!