EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Removelistener (Ime.removelistener Method)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
IME (System.IME) 665
mc.txt.text = "Click this text to add a listener.";
mc.onPress = function() {
if(System.capabilities.hasIME) {
Selection.setFocus(mc.txt);
System.IME.setCompositionString(mc.txt.text);
}
}
See also
addListener (IME.addListener method), setCompositionString
(IME.setCompositionString method)
removeListener (IME.removeListener method)
public static removeListener(listener:Object) : Boolean
Removes a listener object that was previously registered to an IME instance with
IME.addListener().
Availability: ActionScript 1.0; Flash Player 8
Parameters
listener:Object - The object that no longer receives callback notification from the IME
event handlers.
Returns
Boolean - Returns true if the listener object is removed; otherwise false.
Example
The following example shows how to remove a listener object from
System.IME when a user
sets the composition string by clicking in the text field.
var IMEListener:Object = new Object();
IMEListener.onIMEComposition = function(str:String) {
trace(">> onIMEComposition: " + str);
System.IME.removeListener(this);
trace(System.IME.length); // 0
}
System.IME.addListener(IMEListener);
trace(System.IME.length); // 1
var mc:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc.createTextField("txt", this.getNextHighestDepth(), 0, 0, 0, 0);

Table of Contents

Related product manuals