百度空间 | 百度首页 
 
查看文章
 
防止flash网页播放器没有安装的另类方法
2009-06-28 16:33
<div id="flashbanner">
This banner of UCH images requires Adobe Flash, Version 8 or above, to view.
</div>
<script type="text/javascript">
var so = new SWFObject("banner/banner_all.swf", "banner", "536", "150", "5", "#ffffff");
so.useExpressInstall('expressinstall.swf');
so.write("flashbanner");
</script>
关键就在红色的部分,查看代码:
第一帧:
// Action script...

// [Action in Frame 1]
Stage.scaleMode = "noscale";
com.deconcept.expressinstall.ExpressInstall.getInstance().loadUpdater();
// Action script...

// [Initial MovieClip Action of sprite 10]
#initclip 1
class com.deconcept.expressinstall.ExpressInstall
{
var updater, hold, onEnterFrame;
static var instance;
function ExpressInstall()
{
} // End of the function
static function getInstance()
{
if (com.deconcept.expressinstall.ExpressInstall.instance == undefined)
{
instance = new com.deconcept.expressinstall.ExpressInstall();
} // end if
return (com.deconcept.expressinstall.ExpressInstall.instance);
} // End of the function
function loadUpdater()
{
System.security.allowDomain("fpdownload.macromedia.com");
var _self = this;
updater = _root.createEmptyMovieClip("deconcept_expressInstallHolder", 10000007);
updater.installStatus = _self.onInstallStatus;
hold = updater.createEmptyMovieClip("hold", 1);
updater.onEnterFrame = function ()
{
if (typeof(hold.startUpdate) == "function")
{
_self.initUpdater();
onEnterFrame = null;
} // end if
};
var _loc3 = Math.random();
hold.loadMovie("http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?" + _loc3);
} // End of the function
function initUpdater()
{
hold.redirectURL = _root.MMredirectURL;
hold.MMplayerType = _root.MMplayerType;
hold.MMdoctitle = _root.MMdoctitle;
hold.startUpdate();
} // End of the function
function onInstallStatus(msg)
{
if (msg == "Download.Complete")
{
}
else if (msg == "Download.Cancelled")
{
getURL("javascript:alert(\'This content requires a more recent version of the Adobe Flash Player.\')");
}
else if (msg == "Download.Failed")
{
getURL("javascript:alert(\'There was an error downloading the Flash Player update. Please try again later, or visit adobe.com/go/getflashplayer/ to download the latest version of the Flash plugin.\')");
} // end else if
} // End of the function
} // End of Class
#endinitclip
很显然,这个代码的意思是直接提示网页没有安装flash文件,从而弹出js提示!
有兴趣看:http://www.uch.ie/首页

类别:Web | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu