Parameters
- The language code.
langCode:String
- The XML path to add.
path:String
Example
The following example uses the
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
, the text replacement method is equivalent to the Strings panel setting
true
. This means that Flash Player will determine the default language of the host
at runtime"
environment and automatically display the text in that language. If set to
replacement method is equivalent to the Strings panel setting
. This means that you are responsible for loading the appropriate XML file to
runtime"
display the text.
The default value of this property reflects the setting that you select for Replace strings in the
Strings panel dialog box:
for "via ActionScript at runtime".
false
Availability: ActionScript 2.0; Flash Player 8
setInterval()
for
true
"automatically at runtime"
method to check whether the language XML
"via ActionScript at
(the default setting) and
Locale (mx.lang.Locale)
"automatically
, the text
false
733
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?