前些天打开ie碰到有关flash的时候就莫名其妙的出现“单击以激活并使用此控件”,四周还有个框框,烦死了
后来终于找到了原因。由于4月份安装了更新系统编号为kb912945的补丁,微软为了避免与eolas公司和加利福尼亚大学之间的专利侵权纠纷,而发布的一个ie非安全更新,这不是什么bug(http://support.microsoft.com/kb/912945)安装这个补丁以后,ie对activex控件和java程序的处理方式将有所改变,默认情况下不会主动激活,因此用户在访问flash广告等网络内容时需要多点击一次鼠标,但非交互式控件不会改变,微软已经通知网站开发人员最好对他们的网页作出相应修改!
解决办法:
1.(推荐)安装kb917425 ie兼容性修补程序,它恢复了4月安全更新 (kb912812) 中包含的 ie active x 更新行为。遇到兼容性问题的客户以及受ie activex更新影响的网站和程序的客户应该使用此修补程序。此修补程序是临时的,并且仅适用于 kb912812.此 ie 兼容性修补程序不可用于将来的安全更新.安装该项之后,您可能需要重新启动计算机.
文件名: windowsxp-kb917425-x86-chs.exe
版本: 917425
知识库 (kb) 文章: kb917425
发布日期: 2006/4/11
语言: 简体中文
下载大小: 2.0 mb
本地下载windows-kb917425-x86-chs.exe.rar
2.在控制面板的"添加删除程序"中删除编号为“kb912945”或者“kb912812”或者KB916281的更新补丁,如果列表中没有显示,需要在"添加删除程序"窗口右上角的“显示更新”前打钩。
3.网页设计者可以使用以下代码解决:
<script src="plus/ac_runactivecontent.js" type=text/javascript></script>
<script type=text/javascript>ac_fl_runcontent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0','width','468','height','60','src','flash','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','../images/small_ad' ); </script>
4.flash插入html的方法
写个js脚本文件flash.js
程序代码
{
var parm = []
var _default_version = "8,0,24,0";
var _default_quality = "high";
var _default_align = "middle";
var _default_menu = "false";
for(i = 0; i < arguments.length; i ++)
{
parm[i] = arguments[i].split(' ').join('').split('=')
for (var j = parm[i].length-1; j > 1; j --){
parm[i][j-1]+="="+parm[i].pop();
}
switch (parm[i][0])
{
case '_version' : var _version = parm[i][1] ; break ;
case '_swf' : var _swf = parm[i][1] ; break ;
case '_base' : var _base = parm[i][1] ; break ;
case '_quality' : var _quality = parm[i][1] ; break ;
case '_loop' : var _loop = parm[i][1] ; break ;
case '_bgcolor' : var _bgcolor = parm[i][1] ; break ;
case '_wmode' : var _wmode = parm[i][1] ; break ;
case '_play' : var _play = parm[i][1] ; break ;
case '_menu' : var _menu = parm[i][1] ; break ;
case '_scale' : var _scale = parm[i][1] ; break ;
case '_salign' : var _salign = parm[i][1] ; break ;
case '_height' : var _height = parm[i][1] ; break ;
case '_width' : var _width = parm[i][1] ; break ;
case '_hspace' : var _hspace = parm[i][1] ; break ;
case '_vspace' : var _vspace = parm[i][1] ; break ;
case '_align' : var _align = parm[i][1] ; break ;
case '_class' : var _class = parm[i][1] ; break ;
case '_id' : var _id = parm[i][1] ; break ;
case '_name' : var _name = parm[i][1] ; break ;
case '_style' : var _style = parm[i][1] ; break ;
case '_declare' : var _declare = parm[i][1] ; break ;
case '_flashvars' : var _flashvars = parm[i][1] ; break ;
default :;
}
}
var thtml = ""
thtml += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + ((_version)?_version:_default_version) + "'"
if(_width) thtml += " width='" + _width + "'"
if(_height) thtml += " height='" + _height + "'"
if(_hspace) thtml += " hspace='" + _hspace + "'"
if(_vspace) thtml += " vspace='" + _vspace + "'"
if(_align) thtml += " align='" + _align + "'"
else thtml += " align='" + _default_align + "'"
if(_class) thtml += " class='" + _class + "'"
if(_id) thtml += " id='" + _id + "'"
if(_name) thtml += " name='" + _name + "'"
if(_style) thtml += " style='" + _style + "'"
if(_declare) thtml += " " + _declare
thtml += ">"
if(_swf) thtml += "<param name='movie' value='" + _swf + "'>"
if(_quality) thtml += "<param name='quality' value='" + _quality + "'>"
else thtml += "<param name='quality' value ='" + _default_quality + "'>"
if(_loop) thtml += "<param name='loop' value='" + _loop + "'>"
if(_bgcolor) thtml += "<param name='bgcolor' value='" + _bgcolor + "'>"
if(_play) thtml += "<param name='play' value='" + _play + "'>"
if(_menu) thtml += "<param name='menu' value='" + _menu + "'>"
else thtml += "<param name='menu' value='" + _default_menu + "'>"
if(_scale) thtml += "<param name='scale' value='" + _scale + "'>"
if(_salign) thtml += "<param name='salign' value='" + _salign + "'>"
if(_wmode) thtml += "<param name='wmode' value='" + _wmode + "'>"
if(_base) thtml += "<param name='base' value='" + _base + "'>"
if(_flashvars) thtml += "<param name='flashvars' value='" + _flashvars + "'>"
thtml += "<embed pluginspage='http://www.macromedia.com/go/getflashplayer'"
if(_width) thtml += " width='" + _width + "'"
if(_height) thtml += " height='" + _height + "'"
if(_hspace) thtml += " hspace='" + _hspace + "'"
if(_vspace) thtml += " vspace='" + _vspace + "'"
if(_align) thtml += " align='" + _align + "'"
else thtml += " align='" + _default_align + "'"
if(_class) thtml += " class='" + _class + "'"
if(_id) thtml += " id='" + _id + "'"
if(_name) thtml += " name='" + _name + "'"
if(_style) thtml += " style='" + _style + "'"
thtml += " type='application/x-shockwave-flash'"
if(_declare) thtml += " " + _declare
if(_swf) thtml += " src='" + _swf + "'"
if(_quality) thtml += " quality='" + _quality + "'"
else thtml += " quality='" + _default_quality + "'"
if(_loop) thtml += " loop='" + _loop + "'"
if(_bgcolor) thtml += " bgcolor='" + _bgcolor + "'"
if(_play) thtml += " play='" + _play + "'"
if(_menu) thtml += " menu='" + _menu + "'"
else thtml += " menu='" + _default_menu + "'"
if(_scale) thtml += " scale='" + _scale + "'"
if(_salign) thtml += " salign='" + _salign + "'"
if(_wmode) thtml += " wmode='" + _wmode + "'"
if(_base) thtml += " base='" + _base + "'"
if(_flashvars) thtml += " flashvars='" + _flashvars + "'"
thtml += "></embed>"
thtml += "</object>"
document.write(thtml)
}
把此js应用到html:
程序代码
<script language="javascript" type="text/javascript" src="flash.js"></script>
插入flash时,只需:
<script language="javascript" type="text/javascript">
writeflashhtml("_swf=index.swf", "_width=100%", "_height=100%" ,"_wmode=transparent");
</script>