package{
import flash.display.Sprite;
import flash.system.Capabilities;
public class Main extends Sprite{
public function Main(){
var greetings:Array = new Array( );
greetings["en"] = "Hello";
greetings["es"] = "Hola";
greetings["fr"] = "Bonjour";
var lang:String = flash.system.Capabilities.language.substr(0, 2);
if (greetings[lang] == undefined) {
lang = "en";
}
trace(greetings[lang]);
}
}
}
|