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.

Voir également<br />

getDepth (métho<strong>de</strong> TextField.getDepth)<br />

public getDepth() : Number<br />

Renvoie la profon<strong>de</strong>ur d'un champ texte.<br />

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

Valeur renvoyée<br />

Number - Entier qui représente la profon<strong>de</strong>ur <strong>du</strong> champ texte.<br />

Exemple<br />

L'exemple suivant porte sur les champs texte résidant à différentes profon<strong>de</strong>urs. Créez un<br />

champ texte dynamique sur la Scène et ajoutez le co<strong>de</strong> <strong>ActionScript</strong> suivant à votre fichier<br />

FLA ou AS. Le co<strong>de</strong> crée <strong>de</strong> façon dynamique <strong>de</strong>ux champs texte lors <strong>de</strong> l'exécution et renvoie<br />

leur profon<strong>de</strong>ur.<br />

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

22);<br />

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

22);<br />

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

if (this[prop] instanceof TextField) {<br />

var this_txt:TextField = this[prop];<br />

trace(this_txt._name+" is a TextField at <strong>de</strong>pth: "+this_txt.getDepth());<br />

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

getFontList (métho<strong>de</strong> TextField.getFontList)<br />

public static getFontList() : Array<br />

Renvoie les noms <strong>de</strong>s polices sur le système hôte <strong>du</strong> lecteur sous forme <strong>de</strong> tableau. (Cette<br />

métho<strong>de</strong> ne renvoie pas les noms <strong>de</strong> toutes les polices dans les fichiers SWF chargés.) Les<br />

noms sont <strong>du</strong> type String. Il s'agit d'une métho<strong>de</strong> statique <strong>de</strong> la classe globale TextField.<br />

Vous ne pouvez pas spécifier d'occurrence <strong>de</strong> champ texte lorsque vous appelez cette métho<strong>de</strong>.<br />

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

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

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

Saved successfully!

Ooh no, something went wrong!