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.

}<br />

}<br />

Selection.setFocus(mc.txt);<br />

System.IME.setCompositionString(mc.txt.text);<br />

Voir également<br />

addListener (métho<strong>de</strong> IME.addListener), setCompositionString (métho<strong>de</strong><br />

IME.setCompositionString)<br />

removeListener (métho<strong>de</strong> IME.removeListener)<br />

statique publique removeListener(listener:Object) : Boolean<br />

Supprime un objet écouteur qui était auparavant enregistré dans une occurrence IME auprès<br />

<strong>de</strong> IME.addListener().<br />

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

Paramètres<br />

listener:Object - L'objet qui ne recevra plus <strong>de</strong> notification <strong>de</strong> rappel émanant <strong>de</strong>s<br />

gestionnaires d'événements IME.<br />

Renvoie<br />

Boolean - Renvoie true si l'objet écouteur est supprimé, sinon false.<br />

Exemple<br />

L'exemple suivant indique comment supprimer un objet écouteur <strong>de</strong> System.IME lorsqu'un<br />

utilisateur définit la chaîne <strong>de</strong> composition en cliquant dans le champ <strong>de</strong> texte.<br />

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

IMEListener.onIMEComposition = function(str:String) {<br />

trace(">> onIMEComposition: " + str);<br />

System.IME.removeListener(this);<br />

trace(System.IME.length); // 0<br />

}<br />

System.IME.addListener(IMEListener);<br />

trace(System.IME.length); // 1<br />

var mc:MovieClip = this.createEmptyMovieClip("mc",<br />

this.getNextHighestDepth());<br />

mc.createTextField("txt", this.getNextHighestDepth(), 0, 0, 0, 0);<br />

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

mc.txt.background = true;<br />

mc.txt.autoSize = "left";<br />

mc.txt.text = "Click this text to add and remove a listener.";<br />

IME (System.IME) 687

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

Saved successfully!

Ooh no, something went wrong!