return false;
}
} else {
trace("Please install an IME and try again.");
return false;
}
}
The preceding code is separated into five sections. The first section calls the
method, which displays a message in the Output panel if the system has an IME installed
or active. The second section defines a custom text-format object, which sets the font to
. The third section creates an input text field and applies the custom text format.
_sans
The fourth section creates some event handlers for the
instances created in an earlier step. The fifth, and final, section of code defines the custom
function, which checks whether the current system has an IME installed and
checkIME()
if so, whether or not the IME is active.
4.
Save the FLA file and select Control > Test Movie to test the document.
This example requires that you have an IME installed on your system. For information
on installing an IME, see the links that precede this example.
Type some text into the input text field on the Stage. Switch your IME to a different
language and type in the input text field again. Flash Player inputs characters by using the
new IME. If you click the
previous language and ignores the current IME settings.
For information on
System.capabilities.hasIME
in the ActionScript 2.0 Language Reference.
property)
About the String class
A string is also a class and data type in the core ActionScript language. The String data type
represents a sequence of 16-bit characters that might include letters, numbers, and
punctuation marks. Strings are stored as Unicode characters, using the UTF-16 format. An
operation on a String value returns a new instance of the string. The default value for a
variable declared with the String data type is
For more information on strings, data, and values, see
The String class contains methods that let you work with text strings. Strings are important in
working with many objects, and the methods described in this chapter are useful in working
with strings used in many objects, such as TextField, XML, ContextMenu, and FileReference
instances.
button on the Stage, Flash reverts to using the
disable_btn
.
null
and
enable_btn
, see
hasIME (capabilities.hasIME
Chapter 4, "Data and Data Types."
About strings and the String class
checkIME()
disable_btn
457
Need help?
Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?