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 />

L'exemple suivant crée <strong>de</strong>ux champs texte pendant l'exécution, appelés first_txt et<br />

second_txt. L'espace blanc est supprimé <strong>du</strong> <strong>de</strong>uxième champ texte. Ajoutez le co<strong>de</strong><br />

<strong>ActionScript</strong> suivant à votre fichier FLA ou AS :<br />

var my_str:String = "Hello\tWorld\nHow are you?\t\t\tEnd";<br />

this.createTextField("first_txt", this.getNextHighestDepth(), 10, 10, 160,<br />

120);<br />

first_txt.html = true;<br />

first_txt.multiline = true;<br />

first_txt.wordWrap = true;<br />

first_txt.con<strong>de</strong>nseWhite = false;<br />

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

first_txt.htmlText = my_str;<br />

this.createTextField("second_txt", this.getNextHighestDepth(), 180, 10,<br />

160, 120);<br />

second_txt.html = true;<br />

second_txt.multiline = true;<br />

second_txt.wordWrap = true;<br />

second_txt.con<strong>de</strong>nseWhite = true;<br />

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

second_txt.htmlText = my_str;<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 />

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

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

public embedFonts : Boolean<br />

Spécifie si le ren<strong>du</strong> doit utiliser <strong>de</strong>s polices vectorielles incorporées. Valeur booléenne qui,<br />

lorsqu'elle est définie sur true, effectue le ren<strong>du</strong> <strong>du</strong> champ texte à l'ai<strong>de</strong> <strong>de</strong>s polices<br />

vectorielles intégrées. Si false, elle restitue le champ texte à l'ai<strong>de</strong> <strong>de</strong> polices <strong>de</strong> périphérique.<br />

Si vous définissez embedFonts sur true pour un champ texte, vous <strong>de</strong>vez spécifier la police <strong>du</strong><br />

texte par l'intermédiaire <strong>de</strong> la propriété font d'un objet TextFormat appliqué au champ<br />

texte. Si la police spécifiée n'existe pas dans la bibliothèque (avec le nom d'occurrence <strong>de</strong><br />

liaison correspondant), le texte ne s'affiche pas.<br />

Disponibilité : <strong>ActionScript</strong> 1.0 ; Flash Player 6<br />

TextField 1219

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

Saved successfully!

Ooh no, something went wrong!