Detecting the Operating System : System.Capabilities : Development Flash / Flex / ActionScript examples


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

 

Detecting the Operating System


 
 
package{
  import flash.display.Sprite;
  import flash.system.Capabilities;
  
  public class Main extends Sprite{
    public function Main(){

        var os:String = flash.system.Capabilities.os.substr(03);
        if (os == "Win") {
          trace("Windows-specific code goes here");
        else if (os == "Mac") {
          trace("Mac-specific code goes here");
        else {
          trace("Must be Unix or Linux");
        }

    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Development
» System.Capabilities