About strings and the String class 455
For more information, see Locale (mx.lang.Locale) in the ActionScript 2.0 Language
Reference.
Using an input method editor
An input method editor (IME) lets users type non-ASCII text characters in Asian languages
such as Chinese, Japanese, and Korean. The IME class in ActionScript lets you directly
manipulate the operating system’s IME in the Flash Player application that is running on a
client computer.
Using ActionScript, you can determine the following:
■ Whether an IME is installed on the user’s computer.
■ Whether the IME is enabled or disabled on the user’s computer.
■ Which conversion mode the current IME is using.
The IME class can determine which conversion mode the current IME is using: for example,
if the Japanese IME is active, you can determine if the conversion mode is Hiragana,
Katakana (and so on) using the
System.IME.getConversionMode() method. You can set it
with the
System.IME.setConversionMode() method.
You can also disable or enable the IME by using your application at runtime, and perform
other functions, depending on the user’s operating system. You can check whether a system
has an IME by using the
System.capabilities.hasIME property. The next example shows
how to determine whether the user has an IME installed and active.
To determine whether the user has an IME installed and active:
1. Create a new Flash document and save it as ime.fla.
2. Add the following ActionScript to Frame 1 of the main Timeline:
if (System.capabilities.hasIME) {
if (System.IME.getEnabled()) {
trace("You have an IME installed and enabled.");
} else {
trace("You have an IME installed but not enabled.");
}
} else {
trace("Please install an IME and try again.");
}
The preceding code first checks whether the current system has an IME installed. If an
IME is installed, Flash checks whether it is currently enabled.
NOTE
Curently, you cannot tell which IME is active (if any), or change from one IME to another
(for instance, English to Japanese or Korean to Chinese)