AS3中flash.system.Capabilities类提供诸多静态的只读属性来描述应用程序当前所运行在的系统和运行时信息,如Flash Player,Adobe AIR,Flash Lite。通过Capabilities可以确定运行应用程序的客户端的诸多信息,并依此来为用户提供程序本身定制化的内容。本篇只就获取浏览器中嵌入的Flash Player运行时,来列举一些获取其几个常见信息所涉及到的属性和释义。

运行时类型

Capabilities.playerType属性描述了当前应用程序的运行时类型。

可以是以下几种类型:

  • "ActiveX"

    用于 Microsoft Internet Explorer 使用的 Flash Player ActiveX 控件

  • “Desktop”

    代表 Adobe AIR 运行时(通过 HTML 页加载的 SWF 内容除外,该内容将 Capabilities.playerType 设置为“PlugIn”)

  • “External”

    用于外部 Flash Player 或处于测试模式下

  • “PlugIn”

    代表 Flash Player 浏览器插件(和通过 AIR 应用程序中的 HTML 页加载的 SWF 内容)

  • "StandAlone"

    用于独立的 Flash Player

在以插件形式嵌入到浏览器中的Flash Player运行时上,Capablities.playerType返回的"PlugIn"。如,

var playerType:String = Capablities.playerType ;
trace("playerType : "+playerType); // playerType : Plugin

运行时是否是调试版

Capabilities.isDebugger属性描述运行时是否为调试版本。ture说明当前运行时是否是调试版,false说明当前运行时为正式版。如

var isDebuggerVersion:Boolean = Capabilities.isDebugger;
trace("Debugger Version : "+isDebuggerVersion); // Debugger Version : true

Adobe的运行时包括两种类型,正式发布版(release version)和调试版(debug version),对于开发人员来说,为了在开发过程便于程序调试,我们往往使用的是调试版的的运行时版本。对于普通的用户来说,他们使用的大多是正式发行版,对于Flash Player可以去Adobe Flash Support Center来查看最新版的FLash Player下载信息。

操作系统类型

Capabilities.os属性指定了当期操作系统的名称,常见的系统和对应值有

操作系统
Windows 8 "Windows 8"
Windows 7 "Windows 7"
Windows Server 2003 "Windows Server 2003"
Windows XP 64 "Windows Server XP 64"
Windows XP "Windows XP"
Windows Mobile "Windows Mobile"
Mac OS "Mac OS X.Y.Z"(其中 X.Y.Z 为版本号,例如 "Mac OS 10.5.2"
Linux "Linux"(Flash Player 连接 Linux 版本,如 "Linux 2.6.15-1.2054_FC5smp"
iPhone OS 4.1 "iPhone3,1"

如,

var os:String = Capabilities.os;
trace("Current OS : "+os); // Current OS : Mac OS 10.8.5

系统语言

Capabilities.language属性说明,当前运行时所在系统的语言代码

语言代码是指由英文和数字组成的,用来描述语言类型的短字符串。语言指定为ISO 639-1中小写双字母语言代码,如中文zh,对于中文,使用ISO 3166中的大写双字母国家/地区代码,以区分简体中文(zh-CN)和繁体中文(zh-TW) 。

英文系统上,此属性返回语言代码,而不返回国家/地区编码。如,

var language:String = Capabilities.language;
trace("System language : "+language); // System language : zh_CN

版本信息

Capabilities.version属性描述当前运行时的版本信息。

版本号的格式为:平台(platform),主版本号(majorVersion),次版本号(minorVersion),生成版本号(buildNumber),内部生成版本号(internalBuildNumber)。其中platform的可选值为"WIN","MAC","LNX","AND",如

var versionReg:RegExp = /^(\w*) (\d*),(\d*),(\d*),(\d*)$/;

var version:String = Capabilities.version ;
trace("version : "+version); //version : MAC 11,9,900,170
var v:Object = versionReg.exec(version) ; var platform:String = v[1] ,
majorVersion:String = v[2] ,
minorVersion:String = v[3] ,
buildNumber:String = v[4] ,
internalBuildNumber:String = v[5]; trace("platform : "+platform); //platform: MAC
trace("majorVersion : "+platform); //majorVersion: 11
trace("minorVersion : "+platform); //minorVersion: 9
trace("buildNumber : "+platform); //buildNumber: 900
trace("internalBuildNumber : "+platform); //internalBuildNumber: 170

AS3 os与version 区别 使用Capabilities类获取Flash Player的信息的更多相关文章

  1. 利用php获取图片完整Exif信息类 获取图片详细完整信息类

    <?php /** * @Author: TonyLevid * @Copyright: TonyLevid.com * @Name: Image Exif Class * @Version: ...

  2. Actionscript,AS3,MXML,Flex,Flex Builder,Flash Builder,Flash,AIR,Flash Player之关系

    转自zrong's blog:http://zengrong.net/post/1295.htm ActionScript ActionScript通常简称为AS,它是Flash平台的语言.AS编写的 ...

  3. 获取 Android APP 版本信息工具类(转载)

    获取 Android APP 版本信息工具类 获取手机APP版本信息工具类 1.获取版本名称 2.获取版本号 3.获取App的名称 package com.mingyue.nanshuibeidiao ...

  4. as3 object与dictionary区别

    AS3中的Dictionary类(flash.utils.Dictionary)是一个新的AS类.Dictionary类和Object唯一的区别在于:Dictionary对象可以使用非字符串作为键值对 ...

  5. appium初学者,使用之检查appium环境报错Could not detect Mac OS X Version from sw_vers output: '10.12.1’,

    这个问题存在的原因就是appium不兼容最新的mac10.12版本. 由于10.12是最新mac版本,appium1.5.3并未提供支持,所以: 在终端输入grep -rl "Could n ...

  6. android手机状态解释,比方android.os.Build.VERSION.SDK

    //BOARD 主板 String phoneInfo = "BOARD: " + android.os.Build.BOARD; phoneInfo += ", BOO ...

  7. mac下执行 appium-doctor 出现 “Could not detect Mac OS X Version from sw_vers output: '10.12 '” 解决方法

      You can config file by this command: grep -rl "Could not detect Mac OS X Version from sw_vers ...

  8. 【Android】Field requires API level 4 (current min is 1): android.os.Build.VERSION#SDK_INT

    刚遇到了这个问题: Field requires API level 4 (current min is 1): android.os.Build.VERSION#SDK_INT 解决方法: 修改 A ...

  9. php中函数 isset(), empty(), is_null() 的区别,boolean类型和string类型的false判断

    php中函数 isset(), empty(), is_null() 的区别,boolean类型和string类型的false判断 实际需求:把sphinx返回的结果放到ssdb缓存里,要考虑到sph ...

随机推荐

  1. ImportTsv-HBase数据导入工具

    一.概述 HBase官方提供了基于Mapreduce的批量数据导入工具:Bulk load和ImportTsv.关于Bulk load大家可以看下我另一篇博文. 通常HBase用户会使用HBase A ...

  2. TensorFlow笔记-05-反向传播,搭建神经网络的八股

    TensorFlow笔记-05-反向传播,搭建神经网络的八股 反向传播 反向传播: 训练模型参数,在所有参数上用梯度下降,使用神经网络模型在训练数据上的损失函数最小 损失函数:(loss) 计算得到的 ...

  3. MSMQ-发送消息到远程专用队列path格式

    在工作组模式下,远程访问专用队列.在网上找到一篇文章,翻译了一下. 最后结论,直接使用多元素格式名方式,利用IP地址直接对单个或多个目标发送消息      MessageQueue rmQ = new ...

  4. c#问题(按F1或F2键时触发事件)

    this.KeyPreview = true;...private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArg ...

  5. CentOS6.5 搭建在线yum源

    CentOS6.5 搭建在线yum源 发布时间:  2017-04-21 浏览次数:  611 下载次数:  1  问题描述 尽管有很多的免费镜像提供yum源服务,但是还是有必要建立自己的yum服务器 ...

  6. Android自动化框架 模拟操作 模拟测试

    转自:http://bbs2.c114.net/home.php?mod=space&uid=1025779&do=blog&id=5322 几种常见的Android自动化测试 ...

  7. Java学习——Eclipse下载,java配置,新建,输入输出

    Eclipse下载,java配置:  基本的软件是JDK,它可以编译.运行Java程序,下载地址是:https://www.oracle.com/technetwork/java/javase/dow ...

  8. [转]NSIS:常量大全

    原文链接 http://www.flighty.cn/html/bushu/20140915_251.html ;轻狂志www.flighty.cn ;运行后会在桌面生成NSIS常量大全.txt文件 ...

  9. [转]嵌入字体到程序 Winform C#

    http://www.cnblogs.com/top5/archive/2011/06/20/2084942.html 程序安装字体或直接调用非注册字体[c#] .安装字体 //程序直接将字体文件安装 ...

  10. Mysql 於lampp xampp LinuxUbuntu下的配置

    默认执行Lampp/Xampp 於Ubuntu下完成后,需要对mysql进行一系列的配置,方可进行更好的操作 lampp下的mysql配置文件路径: /opt/lampp/etc/my.cnf 1 配 ...