Locale (mx.lang.Locale)
733
Parameters
langCode
:String
- The language code.
path
:String
- The XML path to add.
Example
The following example uses the
setInterval()
method to check whether the language XML
file has successfully loaded.
import mx.lang.Locale;
Locale.setLoadCallback(localeCallback);
Locale.loadLanguageXML("en");
// create interval to check if language XML file is loaded
var locale_int:Number = setInterval(checkLocaleStatus, 10);
function checkLocaleStatus():Void {
if (Locale.checkXMLStatus()) {
clearInterval(locale_int);
trace("clearing interval @ " + getTimer() + " ms");
}
}
// callback function for Locale.setLoadCallback()
function localeCallback(success:Boolean):Void {
greeting_txt.text = Locale.loadString("IDS_GREETING");
}
autoReplace (Locale.autoReplace property)
public static autoReplace : Boolean
Determines whether strings are replaced automatically after loading the XML file. If set to
true
, the text replacement method is equivalent to the Strings panel setting
"automatically
at runtime"
. This means that Flash Player will determine the default language of the host
environment and automatically display the text in that language. If set to
false
, the text
replacement method is equivalent to the Strings panel setting
"via ActionScript at
runtime"
. This means that you are responsible for loading the appropriate XML file to
display the text.
The default value of this property reflects the setting that you select for Replace strings in the
Strings panel dialog box:
true
for
"automatically at runtime"
(the default setting) and
false
for "via ActionScript at runtime".
Availability:
ActionScript 2.0; Flash Player 8
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...