EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Setdefaultlang (Locale.setdefaultlang Method); Setloadcallback (Locale.setloadcallback Method)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
740 ActionScript classes
See also
loadString (Locale.loadString method)
setDefaultLang (Locale.setDefaultLang method)
public static setDefaultLang(langCode:String) : Void
Sets the default language code.
Availability: ActionScript 2.0; Flash Player 7
Parameters
langCode:String - A string representing a language code.
Example
The following example creates a variable called
defLang, which is used to hold the initial
default language for the Flash document. You click the Settings button in the Strings panel to
open the Settings dialog box. Then you add two active languages: English (en) and French
(fr), set the replace strings radio control to
"via ActionScript at runtime", and click OK.
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
getDefaultLang (Locale.getDefaultLang method)
setLoadCallback (Locale.setLoadCallback method)
public static setLoadCallback(loadCallback:Function) : Void
Sets the callback function that is called after the XML file is loaded.
Availability: ActionScript 2.0; Flash Player 7

Table of Contents

Related product manuals