ActionScript 2.0 Language Reference |
|
|
|
| ActionScript classes > Locale (mx.lang.Locale) > checkXMLStatus (Locale.checkXMLStatus method) | |||
public static checkXMLStatus() : Boolean
Returns true if the XML file is loaded; false otherwise.
Availability: ActionScript 2.0; Flash Player 7
Boolean - Returns true if the XML file is loaded; false otherwise.
The following example uses an interval to check every 10 milliseconds to see if the language file has successfully loaded. Once the XML file has loaded, the greeting_txt text field instance on the Stage is populated with the IDS_GREETING string from the language XML file.
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");
}
|
|
|
|