Load movies based on the language code. : System.Capabilities : Development Flash / Flex / ActionScript examples


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

 

Load movies based on the language code.


 

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(02);
        
        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);

    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Development
» System.Capabilities