Flash 8 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Locale (mx.lang.Locale) | |||
Object
|
+-mx.lang.Locale
public class Locale
extends Object
The mx.lang.Locale class allows you to control how multilanguage text is displayed in a SWF file. The Flash Strings panel allows you to use string IDs instead of string literals in dynamic text fields. This allows you to create a SWF file that displays text loaded from a language-specific XML file. The XML file must use the XML Localization Interchange File Format(XLIFF). There are three ways to display the language-specific strings contained in the XLIFF files:
"automatically at runtime"--Flash Player replaces string IDs with strings from the XML file matching the default system language code returned by System.capabilities.language."manually using stage language"--String IDs are replaced by strings at compile time and cannot be changed by Flash Player."via ActionScript at runtime"--String ID replacement is controlled using ActionScript at runtime. This option gives you control over both the timing and language of string ID replacement.You can use the properties and methods of this class when you want to replace the string IDs "via ActionScript at runtime."
All of the properties and methods available are static, which means that they are accessed through the mx.lang.Locale class itself rather than through an instance of the class.
Note: The Locale class is different from the other classes in the ActionScript 2.0 Language Reference, since it is not part of the Flash Player. Since this class installed in the Flash Authoring classpath it is automatically compiled into your SWF files. Using the Locale class increases the SWF size slightly since the class is compiled into the SWF.
Availability: ActionScript 2.0; Flash Player 7
|
Modifiers |
Property |
Description |
|---|---|---|
|
|
autoReplace |
Determines whether strings are replaced automatically after loading the XML file. |
|
|
languageCodeArray |
An array containing language codes for the languages that have been specified or loaded into the FLA file. |
|
|
stringIDArray |
An array containing all the string IDs in the FLA file. |
Properties inherited from class Object
|
Modifiers |
Signature |
Description |
|---|---|---|
|
|
addDelayedInstance |
Adds the {instance, string ID} pair into the internal array for later use. |
|
|
addXMLPath |
Adds the {languageCode and languagePath} pair into the internal array for later use. |
|
|
checkXMLStatus |
Returns |
|
|
getDefaultLang |
The default language code as set in the Strings panel dialog box or by calling the |
|
|
initialize |
Automatically determines the language to use and loads the XML language file. |
|
|
loadLanguageXML |
Loads the specified XML language file. |
|
|
loadString |
Returns the string value associated with the given string ID in the current language. |
|
|
loadStringEx |
Returns the string value associated with the given string ID and language code. |
|
|
setDefaultLang |
Sets the default language code. |
|
|
setLoadCallback |
Sets the callback function that is called after the XML file is loaded. |
|
|
setString |
Sets the new string value of a given string ID and language code. |
Methods inherited from class Object addProperty, hasOwnProperty, isPropertyEnumerable, isPrototypeOf, registerClass, toString, unwatch, valueOf, watch
Version 8
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00002347.html