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

1 comment:

  1. Flex Developer in India- Get the cheap and best flex developer, flex designer, flex application developer, flex application development, flex application design and much more at flexdeveloper.in. We also outsource flex work to freelancers.

    ReplyDelete