actionscript获取用户系统信息

 

在ActionScript中,提供了一些系统的方法,可以捕捉系统的信息,包括操作系统的信息,屏幕的分辨率和Flash Player的版本等信息

1.Capabilies类,这个类包含一些丰富的信息,可以轻松获得系统的信息

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
color="#FF0000"
fontSize="18"
creationComplete="init();">

<mx:Script>
   <![CDATA[
  
   function init():void{
      var os:String = Capabilities.os;  
    var ver:String = Capabilities.version;  
    var screenWidth = Capabilities.screenResolutionX;  
    var screenHeight = Capabilities.screenResolutionY  
    systemID.text = "操作系统为" + os;
    versionID.text = "Flash player的版本为" + ver;
    screenID.text = "屏幕的分辨为" + screenWidth + "*" + screenHeight;
   }
  
   ]]>
</mx:Script>

<mx:Label id="systemID"/>
<mx:Label id="versionID"/>
<mx:Label id="screenID"/>

</mx:Application>
 通过这个类,我们就可以获得一些有关系统的信息,从而为我们程序的运行服务

你可能感兴趣的:(xml,OS,Flash,Adobe,actionscript)