Package | flash.system |
Class | public final class IME |
Inheritance | IME EventDispatcher Object |
Language version: | ActionScript 3.0 |
Runtime version: |
AIR profile support: This feature is supported
on desktop operating systems, but it is not supported on all mobile devices. It is also not supported on
AIR for TV devices. You can test for support at run time using the IME.isSupported
property. See
AIR Profile Support for more information regarding API support across multiple profiles.
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:
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 | Linux |
---|---|---|---|
Determine whether the IME is installed: Capabilities.hasIME |
Yes | Yes | Yes |
Set IME on or off: IME.enabled |
Yes | Yes | Yes |
Find out whether IME is on or off: IME.enabled |
Yes | Yes | Yes |
Get or set IME conversion mode: IME.conversionMode |
Yes | Yes ** | No |
Send IME the string to be converted: IME.setCompositionString() |
Yes * | No | No |
Get from IME the original string before conversion: System.ime.addEventListener() |
Yes * | No | No |
Send request to convert to IME: IME.doConversion() |
Yes * | No | 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.
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 | ||
isSupported : Boolean
[static][read-only]
The
isSupported property is set to true if the IME class is
available on the current platform, otherwise it is set to false . | IME | ||
prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object |
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 | ||
[static]
Causes the runtime to abandon any composition that is in progress.
| IME | ||
[static]
Call this method when the selection within the composition has been updated, either interactively or
programmatically.
| IME | ||
Dispatches an event into the event flow.
| EventDispatcher | ||
[static]
Instructs the IME to select the first candidate for the current composition string.
| IME | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event.
| EventDispatcher | ||
Indicates whether an object has a specified property defined.
| Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter.
| Object | ||
Indicates whether the specified property exists and is enumerable.
| Object | ||
Removes a listener from the EventDispatcher object.
| EventDispatcher | ||
[static]
Sets the IME composition string.
| IME | ||
Sets the availability of a dynamic property for loop operations.
| Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions.
| Object | ||
Returns the string representation of the specified object.
| Object | ||
Returns the primitive value of the specified object.
| Object | ||
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type.
| EventDispatcher |
Event | Summary | Defined by | ||
---|---|---|---|---|
[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | |||
[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | |||
Dispatched when a user has completed an input method editor (IME) composition and the reading string is available. | IME |
conversionMode | property |
conversionMode:String
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: |
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) public static function get conversionMode():String
public function set conversionMode(value:String):void
Error — A set attempt was not successful.
|
See also
enabled | property |
enabled:Boolean
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: |
Indicates whether the system IME is enabled (true
) or disabled (false
).
An enabled IME performs multibyte input; a disabled IME performs alphanumeric input.
public static function get enabled():Boolean
public function set enabled(value:Boolean):void
Error — A set attempt was not successful.
|
isSupported | property |
isSupported:Boolean
[read-only]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 2 |
The isSupported
property is set to true
if the IME class is
available on the current platform, otherwise it is set to false
.
public static function get isSupported():Boolean
compositionAbandoned | () | method |
public static function compositionAbandoned():void
Language version: | ActionScript 3.0 |
Runtime version: | AIR 2 |
Causes the runtime to abandon any composition that is in progress. Call this method when the user clicks
outside of the composition area or when the interactive object that has focus is being destroyed or reset.
The runtime confirms the composition by calling confirmComposition()
in the client. The
runtime also resets the IME to inform the operating system that the composition has been abandoned.
compositionSelectionChanged | () | method |
public static function compositionSelectionChanged(start:int, end:int):void
Language version: | ActionScript 3.0 |
Runtime version: | AIR 2 |
Call this method when the selection within the composition has been updated, either interactively or programmatically.
Parametersstart:int — Specifies the offset in bytes of the start of the selection.
|
|
end:int — Specifies the offset in bytes of the end of the selection.
|
doConversion | () | method |
public static function doConversion():void
Language version: | ActionScript 3.0 |
Runtime version: |
Instructs the IME to select the first candidate for the current composition string.
Error — The call was not successful.
|
setCompositionString | () | method |
public static function setCompositionString(composition:String):void
Language version: | ActionScript 3.0 |
Runtime version: |
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.
Parameterscomposition:String — The string to send to the IME.
|
Error — The call is not successful.
|
imeComposition | event |
flash.events.IMEEvent
flash.events.IMEEvent.IME_COMPOSITION
Language version: | ActionScript 3.0 |
Runtime version: |
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.
To handle IME text input, the receiver must set the imeClient
field of the event to an object
that implements the IIMEClient interface. If imeClient
is unset, the runtime uses out-of-line
IME composition instead, and sends the final composition as a TEXT_INPUT event.
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. |