检测FlashPlayer版本的代码

var versionString:String = Capabilities.version;
var pattern:RegExp = /^(\w*) (\d*),(\d*),(\d*),(\d*)$/;
var result:Object = pattern.exec(versionString);
if (result != null)
{
    trace("input: " + result.input);
    trace("platform: " + result[1]);
    trace("majorVersion: " + result[2]);
    trace("minorVersion: " + result[3]);    
    trace("buildNumber: " + result[4]);
    trace("internalBuildNumber: " + result[5]);
}
else
{
    trace("Unable to match RegExp.");
}
通过js版本检测:

AC_FL_RunContent的DetectFlashVer和GetSwfVer两个函数可以对swf进行版本检测和对比

if(DetectFlashVer(9,0,0))
{
   AC_FL_RunContent(...)
}
else
{
var flashVerPrompt="请先确认是否安装了 Flash 播放器</br>"
                  +"点击下面链接获取最新的 Flash Player 播放器</br>"
                  +"<a href=http://fpdownload.macromedia.com/get/flashplayer/current/licensing/win/install_flash_player_active_x.exe>下载Flash Player 播放器</a>"
    document.write(flashVerPrompt)
}

你可能感兴趣的:(Flash)