User Guide
440 Client System Environment
Checking if an IME is installed and enabled
Before you call any of the IME methods or properties, you should always check to see if the
user’s computer currently has an IME installed and enabled. The following code illustrates
how to check that the user has an IME both installed and active before you call any methods:
if (Capabilities.hasIME)
{
if (IME.enabled)
{
trace("IME is installed and enabled.");
}
else
{
trace("IME is installed but not enabled. Please enable your IME and try
again.");
}
}
else
{
trace("IME is not installed. Please install an IME and try again.");
}
The previous code first checks to see if the user has an IME installed using the
Capabilities.hasIME property. If this property is set to true, the code then checks
whether the user’s IME is currently enabled, using the
IME.enabled property.
Determining which IME conversion mode is currently
enabled
When building multilingual applications, you may need to determine which conversion mode
the user currently has active. The following code demonstrates how to check whether the user
has an IME installed, and if so, which IME conversion mode is currently active:
if (Capabilities.hasIME)
{
switch (IME.conversionMode)
{
case IMEConversionMode.ALPHANUMERIC_FULL:
tf.text = "Current conversion mode is alphanumeric (full-width).";
break;
case IMEConversionMode.ALPHANUMERIC_HALF:
tf.text = "Current conversion mode is alphanumeric (half-width).";
break;
case IMEConversionMode.CHINESE:
tf.text = "Current conversion mode is Chinese.";
break;
case IMEConversionMode.JAPANESE_HIRAGANA: