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.

Résumé <strong>de</strong> la métho<strong>de</strong><br />

Modificateurs Signature Description<br />

Métho<strong>de</strong>s héritées <strong>de</strong> la classe Object<br />

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

public align : String<br />

getTextExtent(text:S<br />

tring,<br />

[width:Number]) :<br />

Object<br />

Une chaîne indiquant l'alignement <strong>du</strong> paragraphe. Vous pouvez appliquer cette propriété tant<br />

aux champs texte statiques qu'aux champs texte dynamiques. Le tableau ci-<strong>de</strong>ssous donne la<br />

liste <strong>de</strong>s valeurs possibles pour cette propriété.<br />

■ "left"-Le paragraphe est aligné à gauche.<br />

■ "center"-Le paragraphe est centré.<br />

■ "right"-Le paragraphe est aligné à droite.<br />

■ "justify"-Le paragraphe est justifié. (Cette valeur a été ajoutée dans Flash Player 8.)<br />

La valeur par défaut est null, ce qui indique 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 illustre la propriété align définie pour la justification, ce qui entraîne un<br />

espacement <strong>de</strong>s caractères sur chaque ligne qui donne au texte un espacement horizontal d'un<br />

aspect plus régulier.<br />

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

format.align = "justify";<br />

Déconseillé à partir <strong>de</strong> Flash Player 8. Il n'existe pas <strong>de</strong><br />

remplacement.<br />

Renvoie les informations <strong>de</strong> mesure <strong>de</strong> texte pour la<br />

chaîne <strong>de</strong> texte text dans le format spécifié par<br />

my_fmt.<br />

addProperty (métho<strong>de</strong> Object.addProperty), hasOwnProperty (métho<strong>de</strong><br />

Object.hasOwnProperty), isPropertyEnumerable (métho<strong>de</strong><br />

Object.isPropertyEnumerable), isPrototypeOf (métho<strong>de</strong> Object.isPrototypeOf),<br />

registerClass (métho<strong>de</strong> Object.registerClass), toString (métho<strong>de</strong><br />

Object.toString), unwatch (métho<strong>de</strong> Object.unwatch), valueOf (métho<strong>de</strong><br />

Object.valueOf), watch (métho<strong>de</strong> Object.watch)<br />

var txtField:TextField = this.createTextField("txtField",<br />

this.getNextHighestDepth(), 100, 100, 300, 100);<br />

txtField.multiline = true;<br />

TextFormat 1275

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

Saved successfully!

Ooh no, something went wrong!