getDefaultLang (Locale.getDefaultLang method)
public static getDefaultLang() : String
The default language code as set in the Strings panel dialog box or by calling the
method.
setDefaultLang()
Availability: ActionScript 2.0; Flash Player 8
Returns
- Returns the default language code.
String
Example
The following example creates a variable called
default language for the Flash document. You click the Settings button in the Strings panel to
launch the Settings dialog box. Then you add two active languages: English (en) and French
(fr), set the replace strings radio control to
In the Strings panel, you add a string ID of IDS_GREETING, and then add text for each
active language.
import mx.lang.Locale;
var defLang:String = "fr";
Locale.setDefaultLang(defLang);
Locale.setLoadCallback(localeCallback);
Locale.loadLanguageXML(Locale.getDefaultLang());
function localeCallback(success:Boolean) {
if (success) {
trace(Locale.stringIDArray); // IDS_GREETING
trace(Locale.loadString("IDS_GREETING"));
} else {
trace("unable to load XML");
}
}
See also
setDefaultLang (Locale.setDefaultLang method)
initialize (Locale.initialize method)
public static initialize() : Void
Automatically determines the language to use and loads the XML language file. This is
primarily used by Flash when the strings replacement method is
.
runtime"
Availability: ActionScript 2.0; Flash Player 7
, which is used to hold the initial
defLang
"via ActionScript at runtime"
, and click OK.
"automatically at
Locale (mx.lang.Locale)
735
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?