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.

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

myformat.rightMargin = 20;<br />

mytext.text = "this is my first test field object text";<br />

mytext.setTextFormat(myformat);<br />

size (propriété TextFormat.size)<br />

public size : Number<br />

Taille en points <strong>du</strong> texte dans ce format <strong>de</strong> texte. La valeur par défaut est null, ce qui indique<br />

que la propriété n'est pas définie.<br />

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

Exemple<br />

L'exemple suivant crée un champ texte et définit la taille <strong>du</strong> texte sur 20 points.<br />

this.createTextField("mytext",1,100,100,100,100);<br />

mytext.multiline = true;<br />

mytext.wordWrap = true;<br />

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

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

myformat.size = 20;<br />

mytext.text = "This is my first text field object text";<br />

mytext.setTextFormat(myformat);<br />

tabStops (propriété TextFormat.tabStops)<br />

public tabStops : Array<br />

Spécifie <strong>de</strong>s taquets <strong>de</strong> tabulation personnalisés, sous forme d'un tableau d'entiers non<br />

négatifs. Chaque taquet <strong>de</strong> tabulation est spécifié en pixels. Si <strong>de</strong>s taquets <strong>de</strong> tabulation<br />

personnalisés ne sont pas spécifiés (null), le taquet <strong>de</strong> tabulation par défaut est 4 (largeur<br />

moyenne <strong>de</strong> caractère).<br />

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

Exemple<br />

L'exemple suivant crée <strong>de</strong>ux champs texte, dont l'un contient <strong>de</strong>s taquets <strong>de</strong> tabulation tous<br />

les 40 pixels et l'autre tous les 75 pixels.<br />

this.createTextField("mytext",1,100,100,400,100);<br />

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

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

myformat.tabStops = [40,80,120,160];<br />

1286 Chapitre 2: Classes <strong>ActionScript</strong>

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

Saved successfully!

Ooh no, something went wrong!