addXMLPath (Locale.addXMLPath method)

public static addXMLPath(langCode:String, path:String) : Void

Adds the {languageCode and languagePath} pair into the internal array for later use. This is primarily used by Flash when the strings replacement method is "automatically at runtime" or "via ActionScript at runtime".

Availability: ActionScript 2.0; Flash Player 7

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");
}