Setstring (Locale.setstring Method) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Parameters
loadCallback:Function
Example
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
instance on the Stage is populated with the
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");
}

setString (Locale.setString method)

public static setString(stringID:String, languageCode:String,
stringValue:String) : Void
Sets the new string value of a given string ID and language code.
Availability: ActionScript 2.0; Flash Player 8
Parameters
- The identification (ID) number of the string to set.
stringID:String
languageCode:String
stringValue:String
Example
The following example uses the
English (en) and French (fr).
import mx.lang.Locale;
Locale.setString("IDS_WELCOME", "en", "hello");
Locale.setString("IDS_WELCOME", "fr", "bonjour");
trace(Locale.loadStringEx("IDS_WELCOME", "en")); // hello
- The function to call when the XML language file loads.
IDS_GREETING
- The language code.
- A string value.
setString()
greeting_txt
string from the XML language file.
method to set the
IDS_WELCOME
Locale (mx.lang.Locale)
text field
string for both
741

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF