ActionScript 3.0 Language and Components Reference | All Packages | All Classes | Language Elements | Index | Appendixes | Conventions | Frames No Frames |
IME

Package | flash.system
Class | public final class IME
Inheritance | IME EventDispatcher Object

Language Version : | ActionScript 3.0

Player Version : | Flash Player 9

The IME class lets you directly manipulate the operating system's input method editor (IME) in the Flash Player application that is running on a client computer. You can determine whether an IME is installed, whether or not the IME is currently enabled, and which IME is enabled. You can disable or enable the IME in the Flash Player application, and you can perform other limited functions, depending on the operating system.

IMEs let users type non-ASCII text characters in multibyte languages such as Chinese, Japanese, and Korean. For more information on working with IMEs, see the documentation for the operating system for which you are developing applications. For additional resources, see the following websites:

- http://www.microsoft.com/globaldev/default.mspx
- http://developer.apple.com/documentation/
- http://java.sun.com

If an IME is not active on the user's computer, calls to IME methods or properties, other than `Capabilities.hasIME`, will fail. Once you manually activate an IME, subsequent ActionScript calls to IME methods and properties will work as expected. For example, if you are using a Japanese IME, it must be activated before any IME method or property is called.

The following table shows the platform coverage of this class:

Capability | Windows | Mac OSX
--- | --- | ---
Determine whether the IME is installed: `Capabilities.hasIME` | Yes | Yes
Set IME on or off: `IME.enabled` | Yes | Yes
Find out whether IME is on or off: `IME.enabled` | Yes | Yes
Get or set IME conversion mode: `IME.conversionMode` | Yes | Yes **
Send IME the string to be converted: `IME.setCompositionString()` | Yes * | No
Get from IME the original string before conversion: `System.ime.addEventListener()` | Yes * | No
Send request to convert to IME: `IME.doConversion()` | Yes * | No

* Not all Windows IMEs support all of these operations. The only IME that supports them all is the Japanese IME.

** On the Macintosh, only the Japanese IME supports these methods, and third-party IMEs do not support them.

The ActionScript 3.0 version of this class does not support Macintosh Classic.

See also

Using the IME class

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | conversionMode : String [static] The conversion mode of the current IME. | IME
|  | enabled : Boolean [static] Indicates whether the system IME is enabled (true) or disabled (false). | IME
|  | prototype : Object [static] A reference to the prototype object of a class or function object. | Object

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event. | EventDispatcher
|  | dispatchEvent(event:Event):Boolean Dispatches an event into the event flow. | EventDispatcher
|  | doConversion():void [static] Instructs the IME to select the first candidate for the current composition string. | IME
|  | hasEventListener(type:String):Boolean Checks whether the EventDispatcher object has any listeners registered for a specific type of event. | EventDispatcher
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void Removes a listener from the EventDispatcher object. | EventDispatcher
|  | setCompositionString(composition:String):void [static] Sets the IME composition string. | IME
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object
|  | willTrigger(type:String):Boolean Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. | EventDispatcher

Events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | activate | Dispatched when Flash Player gains operating system focus and becomes active. | EventDispatcher
|  | deactivate | Dispatched when Flash Player loses operating system focus and is becoming inactive. | EventDispatcher
|  | imeComposition | Dispatched when a user has completed an input method editor (IME) composition and the reading string is available. | IME

Property Detail

conversionMode | property

`conversionMode:String` [read-write]

Language Version : | ActionScript 3.0

Player Version : | Flash Player 9

The conversion mode of the current IME. Possible values are IME mode string constants that indicate the conversion mode:

- `ALPHANUMERIC_FULL`
- `ALPHANUMERIC_HALF`
- `CHINESE`
- `JAPANESE_HIRAGANA`
- `JAPANESE_KATAKANA_FULL`
- `JAPANESE_KATAKANA_HALF`
- `KOREAN`
- `UNKNOWN` (read-only value; this value cannot be set)

Implementation
`public static function get conversionMode():String`
`public function set conversionMode(value:String):void`
Throws

| `Error` — A set attempt was not successful.

See also

flash.system.IMEConversionMode.ALPHANUMERIC_FULL
flash.system.IMEConversionMode.ALPHANUMERIC_HALF
flash.system.IMEConversionMode.CHINESE
flash.system.IMEConversionMode.JAPANESE_HIRAGANA
flash.system.IMEConversionMode.JAPANESE_KATAKANA_FULL
flash.system.IMEConversionMode.JAPANESE_KATAKANA_HALF
flash.system.IMEConversionMode.KOREAN
flash.system.IMEConversionMode.UNKNOWN
Using the IME class

enabled | property |

`enabled:Boolean` [read-write]

Language Version : | ActionScript 3.0

Player Version : | Flash Player 9

Indicates whether the system IME is enabled (`true`) or disabled (`false`). An enabled IME performs multibyte input; a disabled IME performs alphanumeric input.

Implementation
`public static function get enabled():Boolean`
`public function set enabled(value:Boolean):void`
Throws

| `Error` — A set attempt was not successful.

See also

Using the IME class
Method Detail

doConversion | () | method

`public static function doConversion():void`

Language Version : | ActionScript 3.0

Player Version : | Flash Player 9

Instructs the IME to select the first candidate for the current composition string.

Throws

| `Error` — The call was not successful.

setCompositionString | () | method |

`public static function setCompositionString(composition:String):void`

Language Version : | ActionScript 3.0

Player Version : | Flash Player 9

Sets the IME composition string. When this string is set, the user can select IME candidates before committing the result to the text field that currently has focus.

If no text field has focus, this method fails and throws an error.

Parameters

| `composition:String` — The string to send to the IME.

Throws

| `Error` — The call is not successful.

Event Detail

imeComposition | Event

Event Object Type: `flash.events.IMEEvent`
IMEEvent.type property = `flash.events.IMEEvent.IME_COMPOSITION`

Language Version : | ActionScript 3.0

Player Version : | Flash Player 9

Dispatched when a user has completed an input method editor (IME) composition and the reading string is available. IMEs are generally used to enter text from languages that have ideographs instead of letters, such as Japanese, Chinese and Korean.

Defines the value of the `type` property of an `imeComposition` event object.

This event has the following properties:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`target` | The IME object.

See also

Using the IME class

Submit Feedback on LiveDocs
© 2004-2008 Adobe Systems Incorporated. All rights reserved.
Tue May 20 2008, 04:02 AM -07:00