User Guide
444 Client System Environment
outputTxt.text = "Unable to change IME.";
}
System.ime.addEventListener(IMEEvent.IME_COMPOSITION,
imeCompositionHandler);
}
else
{
outputTxt.text = "Please install IME and try again.";
}
function imeCompositionHandler(event:IMEEvent):void
{
outputTxt.text = "you typed: " + event.text;
}
The previous code creates two text fields and adds them to the display list. The first text field,
inputTxt, is an input text field that allows the user to enter Japanese text. The second text
field,
outputTxt, is a dynamic text field that displays error messages to the user, or echos the
Japanese string that the user types into the
inputTxt text field.
Example: Detecting system capabilities
The CapabilitiesExplorer example demonstrates how you can use the flash.system.Capabilities
class to determine which features the user’s Flash Player supports. This example teaches the
following techniques:
■ Detecting which capabilities the user’s Flash Player supports using the Capabilities class
■ Using the ExternalInterface class to detect which browser settings the user’s browser
supports
The CapabilitiesExplorer application files can be found in the folder Samples/
CapabilitiesExplorer. This application consists of the following files:
File Description
CapabilitiesExplorer.mxml The user interface for the application in MXML
for Flex.
com/example/programmingas3/
capabilities/CapabilitiesGrabber.as
The class that provides the main functionality of
the application, including adding the system
Capabilities to an array, sorting the items, and
using the ExternalInterface class to retrieve
browser capabilities.
capabilities.html An HTML container that contains the necessary
JavaScript to communicate with the External
API.