loadStringEx (Locale.loadStringEx method)

public static loadStringEx(stringID:String, languageCode:String) : String

Returns the string value associated with the given string ID and language code. To avoid unexpected XML file loading, loadStringEx() does not load the XML language file if the XML file is not already loaded. You should decide on the right time to call the loadLanguageXML() method if you want to load a XML language file.

Availability: ActionScript 2.0; Flash Player 8

Parameters

stringID:String - The identification (ID) number of the string to load.

languageCode:String - The language code.

Returns

String - The string value associated with the given string ID in the language specified by the languageCode parameter.

Example

The following example uses the loadStringEx() method to trace the value of the IDS_GREETING string for the currently loaded French language XML file.

import mx.lang.Locale;
Locale.setLoadCallback(localeCallback);
Locale.loadLanguageXML("fr");
function localeCallback(success:Boolean) {
    trace(success);
    trace(Locale.stringIDArray); // IDS_GREETING
    trace(Locale.loadStringEx("IDS_GREETING", "fr")); // bonjour
}

See also

loadString (Locale.loadString method)