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.

Exemple<br />

L'exemple suivant crée <strong>de</strong>ux champs texte : username_txt et password_txt. Du texte est<br />

placé dans les <strong>de</strong>ux champs texte ; toutefois, password_txt a la propriété password définie<br />

sur true. Par conséquent, les caractères s'affichent sous forme d'astérisques dans le champ<br />

password_txt.<br />

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

100, 22);<br />

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

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

username_txt.maxChars = 16;<br />

username_txt.text = "hello";<br />

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

100, 22);<br />

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

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

password_txt.maxChars = 16;<br />

password_txt.password = true;<br />

password_txt.text = "world";<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 />

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

public _url : String [lecture seule]<br />

Récupère l'URL <strong>du</strong> fichier SWF qui a créé le champ texte.<br />

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

Exemple<br />

L'exemple suivant extrait l'URL <strong>du</strong> fichier SWF qui a créé le champ texte et un fichier SWF<br />

qui se charge dans ce <strong>de</strong>rnier.<br />

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

trace(my_txt._url);<br />

var mclListener:Object = new Object();<br />

mclListener.onLoadInit = function(target_mc:MovieClip) {<br />

trace(target_mc._url);<br />

};<br />

var hol<strong>de</strong>r_mcl:MovieClipLoa<strong>de</strong>r = new MovieClipLoa<strong>de</strong>r();<br />

hol<strong>de</strong>r_mcl.addListener(mclListener);<br />

TextField 1265

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

Saved successfully!

Ooh no, something went wrong!