03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

mc.onPress = function() {<br />

if(System.capabilities.hasIME) {<br />

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

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

}<br />

}<br />

See also<br />

addListener (IME.addListener method), setCompositionString<br />

(IME.setCompositionString method)<br />

removeListener (IME.removeListener method)<br />

public static removeListener(listener:Object) : Boolean<br />

Removes a listener object that was previously registered to an IME instance with<br />

IME.addListener().<br />

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

Parameters<br />

listener:Object - The object that no longer receives callback notification from the IME<br />

event h<strong>and</strong>lers.<br />

Returns<br />

Boolean - Returns true if the listener object is removed; otherwise false.<br />

Example<br />

The following example shows how to remove a listener object from System.IME when a user<br />

sets the composition string by clicking in the text field.<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 />

IME (System.IME) 675

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

Saved successfully!

Ooh no, something went wrong!