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> suivant définit la propriété _alpha d'un champ texte appelé my_txt sur 20%. Créez<br />

un symbole <strong>de</strong> police dans la bibliothèque en sélectionnant Nouvelle police dans le menu<br />

d'options <strong>de</strong> la bibliothèque. Définit ensuite la liaison <strong>de</strong> la police sur my font. Définit la<br />

liaison pour un symbole <strong>de</strong> police sur my font. Ajoutez le co<strong>de</strong> <strong>ActionScript</strong> suivant à votre<br />

fichier FLA ou AS :<br />

var my_fmt:TextFormat = new TextFormat();<br />

my_fmt.font = "my font";<br />

// where 'my font' is the linkage name of a font in the Library<br />

this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 100,<br />

22);<br />

my_txt.bor<strong>de</strong>r = true;<br />

my_txt.embedFonts = true;<br />

my_txt.text = "Hello World";<br />

my_txt.setTextFormat(my_fmt);<br />

my_txt._alpha = 20;<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 />

_alpha (propriété Button._alpha), _alpha (propriété MovieClip._alpha)<br />

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

public antiAliasType : String<br />

Le type d'anti-aliasing appliqué à cette instance <strong>de</strong> TextField. L'anti-aliasing avancé est<br />

disponible uniquement à partir <strong>de</strong> Flash Player 8. Vous ne pouvez contrôler cette définition<br />

que si la police est intégrée (avec la propriété embedFonts définie sur true). Pour Flash Player<br />

8, le paramètre par défaut est "advanced".<br />

TextField 1211

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

Saved successfully!

Ooh no, something went wrong!