Monday, September 3, 2012

Detecting the Operating System

Detecting the Operating System: Use the flash.system.Capabilities.os property

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");
        }

    }
  }
}



ref : -
http://www.java2s.com/Code/Flash-Flex-ActionScript/Development/DetectingtheOperatingSystemUsetheflashsystemCapabilitiesosproperty.htm