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.

un<strong>de</strong>rline = false<br />

url = ""<br />

target = ""<br />

align = "left"<br />

leftMargin = 0<br />

rightMargin = 0<br />

in<strong>de</strong>nt = 0<br />

leading = 0<br />

blockIn<strong>de</strong>nt = 0<br />

bullet = false<br />

display = block<br />

tabStops = [] // (empty array)<br />

Vous pouvez étendre les métho<strong>de</strong>s et les gestionnaires d'événements <strong>de</strong> la classe MovieClip en<br />

créant une sous-classe.<br />

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

Paramètres<br />

instanceName:String - Chaîne qui i<strong>de</strong>ntifie le nom d'occurrence <strong>du</strong> nouveau champ <strong>de</strong><br />

texte.<br />

<strong>de</strong>pth:Number - Entier positif qui spécifie la profon<strong>de</strong>ur <strong>du</strong> nouveau champ <strong>de</strong> texte.<br />

x:Number - Entier qui spécifie la coordonnée x <strong>du</strong> nouveau champ <strong>de</strong> texte.<br />

y:Number - Entier qui spécifie la coordonnée y <strong>du</strong> nouveau champ <strong>de</strong> texte.<br />

width:Number - Entier positif qui spécifie la largeur <strong>du</strong> nouveau champ <strong>de</strong> texte.<br />

height:Number - Entier positif qui spécifie la hauteur <strong>du</strong> nouveau champ <strong>de</strong> texte.<br />

Valeur renvoyée<br />

TextField - Flash Player 8 renvoie une référence à l'objet TextField créé. Les versions<br />

antérieures à Flash Player 8 renvoient void.<br />

Exemple<br />

L'exemple suivant crée un champ <strong>de</strong> texte d'une largeur <strong>de</strong> 300, d'une hauteur <strong>de</strong> 100, une<br />

coordonnée x <strong>de</strong> 100, une coordonnée y <strong>de</strong> 100, pas <strong>de</strong> bor<strong>du</strong>re, texte en rouge et souligné :<br />

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

my_txt.multiline = true;<br />

my_txt.wordWrap = true;<br />

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

my_fmt.color = 0xFF0000;<br />

my_fmt.un<strong>de</strong>rline = true;<br />

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

my_txt.setTextFormat(my_fmt);<br />

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

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

Saved successfully!

Ooh no, something went wrong!