检测Flash构建版本 [英] detect flash build verison

查看:168
本文介绍了检测Flash构建版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人碰巧知道如何检测Flash BUILD版本?



请注意这不是重复的。我不是问玩家的版本,而是关于构建版本。意味着最后3位数字。
也就是说,如果是18.0.0.203 - 那么我想要203。
$ b $ p

谢谢!

解决方案

flash.system.Capabilities.version 为您提供了所需的内容(内部版本号):


指定Flash Player或Adobe®AIR®平台和版本信息。版本号的格式是:platform majorVersion,minorVersion,buildNumber,internalBuildNumber。




  var internal_build_number:int = flash.system.Capabilities.version.split(',')[3]; 
//给出:203,对于Flash Player 18.0.0.203

编辑:为了得到使用JavaScript的Flash Player的确切版本,可以使用 flash.external.ExternalInterface (如何使用它这里)将信息从Flash发送到JS。为此,如果你是一个ActionScript程序员(否则你可以从 here ),所以你可以写这样的东西:



ActionScript 3:

$ $ p $ // fn:获得flash版本的js函数的名称
//这个名字被闪存变量传递
var fn:String = this.loaderInfo.parameters.fn || 'console.log',
// WIN 18,0,0,203 => [18,0,0,203]
version:Array = Capabilities.version.split('')[1] .split(',');

if(ExternalInterface.available){
//调用js函数并传递给它的Flash播放器版本
ExternalInterface.call(fn,version);
}

然后对于HTML部分:

JS:

 函数echo(version){
// for:version = [18,0,0,203]
// give:internal build number:203
console.log('internal build number:'+ version [3]);

HTML: b

 < object classid =clsid:d27cdb6e-ae6d-11cf-96b8-444553540000> 
< param name =movievalue =flash_to_js.swf/>
< param name =flashvarsvalue =fn = echo/>
< object type =application / x-shockwave-flashdata =flash_to_js.swf>
< param name =flashvarsvalue =fn = echo/>
< / object>
< / object>



希望能有所帮助。


Does anybody happen to know how to detect the flash BUILD version?

Please notice it's not a duplicate. I am not asking about the player version, but about the build version. meaning the last 3 digits. That is, if it's 18.0.0.203 - then I want the "203".

Thanks!

解决方案

The flash.system.Capabilities.version gives you what you need ( the internal build number ) :

Specifies the Flash Player or Adobe® AIR® platform and version information. The format of the version number is: platform majorVersion,minorVersion,buildNumber,internalBuildNumber.

var internal_build_number:int = flash.system.Capabilities.version.split(',')[3];
// gives : 203, for flash player 18.0.0.203

EDIT :

To get the exact version of Flash Player using JavaScript, you can use an flash.external.ExternalInterface (how to use it here) to send the information from Flash to JS.

For that, if you are an ActionScript programmer ( otherwise you can download the swf (1.24KB) from here ) so you can write something like this :

ActionScript 3 :

// fn : the name of the js function which will get the flash version
//      this name is passed by flash vars
var fn:String = this.loaderInfo.parameters.fn || 'console.log',
    // WIN 18,0,0,203 => [18,0,0,203]
    version:Array = Capabilities.version.split(' ')[1].split(',');  

if(ExternalInterface.available){
    // call the js function and pass to it the flash player version
    ExternalInterface.call(fn, version);
}

Then for the HTML part :

JS :

function echo(version){  
    // for : version = [18,0,0,203] 
    // gives : internal build number : 203
    console.log('internal build number : ' + version[3]);  
}

HTML :

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
    <param name="movie" value="flash_to_js.swf" />
    <param name="flashvars" value="fn=echo" />
    <object type="application/x-shockwave-flash" data="flash_to_js.swf">
        <param name="flashvars" value="fn=echo" />
    </object>
</object>

Hope that can help.

这篇关于检测Flash构建版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆