Scaleform Support for Flash IME Class

This section describes implementation of Flash IME class on Scaleform.

IME support on Flash

Event summary

Event Description
onIMEComposition = function([readingString:String]) {} Notified when the IME composition string is being set.
onSwitchLanguage = function([languageString:String]) {} Notified when the input language is changed using the language bar or keyboard shortcuts. This listener is not supported by Flash.

Method summary

|Method Name| Description| |addListener(listener:Object) : Void|Registers an object to receive notification when an IME event handler is invoked by the onIMEComposition event.| |getConversionMode() : String|Indicates the conversion mode of the current IME.| |getEnabled() : Boolean|Indicates whether the system IME is enabled.| |removeListener(listener:Object) : Boolean|Removes a listener object that was previously registered to an IME instance with IME.addListener().| |setCompositionString(composition:String) : Boolean|Sets the IME composition string.| |setConversionMode(mode:String) : Boolean|Sets the conversion mode of the current IME.| |setEnabled(enabled:Boolean) : Boolean|Enables or disables the system IME.|

Properties

The following properties are used with the get/setConversion mode functions:

General Observations

This section describes the language and operating system specific differences between the output of the functions listed above.

get/setEnabled and get/setConversionMode

Japanese

There is also a difference in the language bar user interface between Japanese IME 2002 and 2007. In Japanese IME 2002, turning the IME off sets the conversion mode to “Direct Input”. In Japanese IME 2007, there is no “Direct Input” entry in the conversion mode list and turning IME off sets conversion mode to “Half Width Alphanumeric”. This is indistinguishable from setting the conversion mode to “Half Width Alphanumeric” except in the IME state. When the conversion mode is set to “Half Width Alphanumeric”., the IME state is on, while it’s off when IME is disabled by using setEnabled(false). However, the appearance of the language bar is the same for the two cases.

Also note that if the IME state is off and the user sets the conversion mode to “Half Width Alphanumeric” by using setConversionMode(), querying for IME state using getEnabled() will return true. However, if the conversion mode is set using the language bar, the IME state would be false.

Querying for conversion mode using GetConversionMode returns the last active conversion mode. For example, if current IME mode is HIRAGANA, and the user calls SetEnabled(false) and then obtains the conversion mode using GetConversionMode(), HIRAGANA will be returned.

Korean

Note that on Windows Vista, behaviour of Flash IME is slightly different from Windows XP. On Win XP, getEnabled() returns the IME state as set by using the language bar or setConversionMode(). Using setEnabled() to set IME state has no effect on the return value of getEnabled().

On Windows Vista, getEnabled() responds to setting IME state on/off through setEnabled(), but it doesn’t have any real effect on the language bar display or the output of the IME. For example, if one is in KOREAN mode and turns IME off by calling setEnabled(false), using getEnabled() will return false, but the behaviour of the IME will not change and Korean characters are still produced.

Chinese

OnIMEComposition Listener

This listener is invoked whenever a composition is finalized and returns the finalized string. In Flash IME, the listener is called only for Japanese IME. For Korean and Chinese IME’s the Listener is never invoked.

With our implementation, the listener is invoked for all IME’s.

OnSwitchLanguage Listener

This listener is invoked whenever the input language is changed using the language bar or key board shortcuts. It returns a string indicating the new input language. For languages other than English, Chinese, Korean and Japanese, UNKNOWN is returned. Note that this listener only provides the name of the input language, not the specific IME. This listener is not supported by Flash.

Using disableIME vs. setEnabled()

It’s important to understand the difference between disabling IME on a text field using the disableIME property and setting the IME state using setEnabled() method. disableIME is a property of a text field and applies to all input methods used on the text field while setEnabled() sets the system IME on/off and is not specific to any textfield. For example, if the user sets disableIME to true for a textfield, IME will always be disabled for that textfield regardless of the state of the system IME. On the other hand, if the user turns IME off for a text field using setEnabled(false) and then moves to a different text field and turns IME on, IME will stay turned on when the user transfers focus back to the first text field.

Hence, use disableIME for text fields such as password fields or fields that only take numbers as input and never expect text that need IME. Use setEnabled() when you want to disable IME temporarily.