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.

visible_btn.onRelease = function() {<br />

my_txt._visible = !my_txt._visible;<br />

};<br />

Voir également<br />

_visible (propriété Button._visible), _visible (propriété<br />

MovieClip._visible)<br />

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

public _width : Number<br />

Largeur <strong>du</strong> champ texte, en pixels.<br />

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

Exemple<br />

L'exemple suivant crée <strong>de</strong>ux fichiers texte que vous pouvez utiliser pour modifier la largeur et<br />

la hauteur d'un troisième champ texte sur la Scène. Ajoutez le co<strong>de</strong> <strong>ActionScript</strong> suivant à un<br />

fichier FLA ou AS.<br />

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

120);<br />

my_txt.background = true;<br />

my_txt.backgroundColor = 0xFF0000;<br />

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

my_txt.multiline = true;<br />

my_txt.type = "input";<br />

my_txt.wordWrap = true;<br />

this.createTextField("width_txt", this.getNextHighestDepth(), 10, 10, 30,<br />

20);<br />

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

width_txt.maxChars = 3;<br />

width_txt.restrict = "0-9";<br />

width_txt.type = "input";<br />

width_txt.text = my_txt._width;<br />

width_txt.onChanged = function() {<br />

my_txt._width = this.text;<br />

}<br />

this.createTextField("height_txt", this.getNextHighestDepth(), 70, 10, 30,<br />

20);<br />

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

height_txt.maxChars = 3;<br />

height_txt.restrict = "0-9";<br />

height_txt.type = "input";<br />

TextField 1267

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

Saved successfully!

Ooh no, something went wrong!