package{ import flash.display.Sprite; import flash.system.Capabilities; public class Main extends Sprite{ public function Main(){ var lang:String = flash.system.Capabilities.language.substr(0, 2);
var supportedLanguages:Array = ["en", "es", "fr"];
var useLang:String = "en";
for (var i:int = 0; i < supportedLanguages.length; i++) { if (supportedLanguages[i] == lang) { useLang = lang; break; } }
var movieURL:String = "myMovie_" + useLang + ".swf";
trace(movieURL);
} } }
Related Scripts with Example Source Code in same category :