正在用AS3.0开发?那客户端FlashPlayer的更新是个问题。如果让每个用户到Adobe站更新,太麻烦。
有办法么?有的!且看下面的代码:
HTML:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script>
var jsReady = false;
function isReady() {
return jsReady;
}
function pageInit() {
jsReady = true;
}
function autoInstall() {
run_exe="<OBJECT ID=\"RUNIT\" WIDTH=0 HEIGHT=0 TYPE=\"application/x-oleobject\""
run_exe+="CODEBASE=\" http://10.0.199.5:81/FPDetect/swflash.cab#version=9,0,45,0\">"
//这里的**.exe就是我们要运行的程序的网上路径
run_exe+="<PARAM NAME=\"_Version\" value=\"65536\">"
run_exe+="</OBJECT>"
document.open();
document.clear();
document.writeln(run_exe);
document.close();
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>upLoad</title>
</head>
<body onload="pageInit();">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://10.0.199.5:81/FPDetect/swflash.cab#version=9.0.45.0" width="320" height="312" id="upLoad" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="/FPDetect/FPDetect.swf" /><param name="quality" value="high"
/><param name="bgcolor" value="#ffffff" /><embed src="/FPDetect/FPDetect.swf"
quality="high" bgcolor="#ffffff" width="320" height="312" name="upLoad" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>
FLA:
import flash.external.*;
System.useCodepage = true;
currentVer = System.capabilities.version;
trace(currentVer);
myVer1 = currentVer.split(" ")[1].split(",")[0];
myVer2 = currentVer.split(" ")[1].split(",")[1];
myVer3 = currentVer.split(" ")[1].split(",")[2];
myVer4 = currentVer.split(" ")[1].split(",")[3];
var lv:LoadVars = new LoadVars();
lv.onData = function(src:String) {
trace(src);
ExternalInterface.call(src);
mess.text = "已载入";
};
if (Number(myVer1)<9) {
mess.text = "您的Flash插件版本太低,准备安装Flash插件(9.0.45.0)!\n温馨提示:安装完毕后关闭所有IE窗口重新打开即可!";
//getURL("/FPDetect/autoInstall.html", "_self");
lv.load("autoInstall.js");
ExternalInterface.call("autoInstall");
} else if (myVer3<45) {
mess.text = "您的Flash插件版本太低,请安装Flash插件(9.0.45.0)!\n温馨提示:安装完毕后关闭所有IE窗口重新打开即可!";
//getURL("/FPDetect/autoInstall.html", "_self");
lv.load("autoInstall.js");
ExternalInterface.call("autoInstall");
} else {
//lv.load("autoInstall.html");
mess.text = "您的Flash插件正常,正在调入FLV播放器...";
//ExternalInterface.call("autoInstall");
loadMovie("../flvPlayer/flvPlayer.swf", _root);
}
未整理。。。
回复Comments
作者:
{commentrecontent}