Use flash.system.Capabilities.language property to dynamically load content in the appropriate language : System.Capabilities : Development Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Development » System.Capabilities »

 

Use flash.system.Capabilities.language property to dynamically load content in the appropriate language


 

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(02);
        
        if (greetings[lang== undefined) {
          lang = "en";
        }
        trace(greetings[lang]);
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Development
» System.Capabilities