发新话题
打印

[讨论] 现在的网页打开有FLASH的地方总要双击

现在的网页打开有FLASH的地方总要双击

现在的网页打开有FLASH的地方总要双击,总是有提示要点激活.听说可以在FLASH里加上什么代码就不会显示那个东西了!!!!!是真的吗?是些什么代码呀,诚望各位朋友能指导一下.
http://wwm.oot.cn

TOP

这个脚本存成swfobject.js文件
=====================================================
复制内容到剪贴板
代码:
/**
* SWFObject v1.4.2: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
*
* SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
*   legal reasons.
*/
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=key+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";
}else{if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}
_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{
try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);
axo.AllowScriptAccess="always";}
catch(e){
if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}
if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}
return true;
};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){
var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){
_2d[i].style.display="none";
for(var x in _2d[i]){if(typeof _2d[i][x]=="function"){_2d[i][x]=null;}}}};
if(typeof window.onunload=="function"){
var oldunload=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();
oldunload();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}
if(Array.prototype.push==null){
Array.prototype.push=function(_30){
this[this.length]=_30;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject; // for legacy support
var SWFObject=deconcept.SWFObject;
==============================================

flash的调用代码如下:
复制内容到剪贴板
代码:
<div id="tt1"><script type="text/javascript">
var so = new SWFObject("images/tt1.swf", "tt1", "77", "75", "7", "#ffffff"); /*77为宽,75为高*/
so.addParam("quality", "high");
so.addParam("wmode", "transparent");
so.addParam("menu", "0");
so.write("tt1"); /*div的id是什么就写什么*/
</script></div>
[ 本帖最后由 billycool 于 2007-7-20 00:53 编辑 ]

TOP

天哪这么放那里呀!!!
感谢你的回复!!!!!!!!!!!!
http://wwm.oot.cn

TOP

懂SA的朋友帮个忙,我把这个代加到了帧上,可是输出时确提示出错了.如何正确应用以上代码?
http://wwm.oot.cn

TOP

不是加在帧上的
FLASH Everyday

TOP

TNND网上找的都是转的  没一个写的明白
FLASH Everyday

TOP

终于找到个完整的  写的也够清楚

附件

去IE中的Flash激活框.rar (2.73 KB)

2007-7-21 11:01, 下载次数: 108

FLASH Everyday

TOP

kamanco
十分感谢了!!!!
http://wwm.oot.cn

TOP

不错最近正研究js
天行健,君子以自强不息

TOP

呵呵,原来楼主没明白是要在网页中改flash的加载方式。居然把上面的代码放到as里面,那哪能通过啊,一段javascript代码一段html代码。

TOP

双击是因为你装了FLASH插件

TOP

其实是xp系统,最近升级了一个补丁,把哪个补丁去掉即可!
考虑到大都数人都升了补丁,比较好的方法,
用js 写出来,很短的呀。不用楼上这么复杂吧!
document.write("");

TOP

楼上的可否写出来让大家学习下!!

TOP

是啊。关注中。

TOP

网站开发人员的应对办法:

一、下载后将压缩包内的“FLASH.js”文件放入站点任意文件夹中

二、在网页<head></head>之间插入以下代码

<!--修正FLASH正确显示代码开始-->
<script language="javascript" type="text/javascript" src="flash.js的相对路径"></script>
<!--修正FLASH正确显示代码结束-->

三、用下面java语句完全替换网页中“<object> ……〈/object>"(包括首尾标记)
<script language="javascript" type="text/javascript">
writeflashhtml("_swf=你的FLASH文件地址", "_width=你的FLASH文件宽度", "_height=你的FLASH文件高度" ,"_wmode=transparent");
</script>
js文件可以到:http://www.rocsky.net/blog/read.php/250.htm 下载
如果我能让一个人不再痛苦,不再受折磨,或让一只迷途的知更鸟能再回巢,那麼就不枉我走人生一遭。

TOP

本机解决办法:
  在控制面板的"添加删除程序"中删除编号为"KB912945"的更新,如果列表中没有显示,需要在"添加删除程序"窗口右上角的“显示更新”前打√,即可解决!

附:网站开发人员的应对办法

function LoadFlash(url,wmode,width,Height)

{

document.write("<embed src='" + url + "' wmode=" + wmode + " quality='high' pluginspage=http://www.macromedia.com/go/getflashplayer type='application/x-shockwave-flash' width='" + width + "' height='" + Height + "'></embed>");

}

然后在需要的地方调用这个函数就行了

//是不是很短呀~其实就这么长够了!


补丁下载地址:http://www.microsoft.com/downloa ... E-903E-3400ABF1D731

注:资料收集于网络!

[ 本帖最后由 morosefrog 于 2007-11-8 10:06 编辑 ]

TOP

JS很重要。。 学习学习。
我没有天份。。但有后天的自信、顽固、拼搏、坚持。。。。。。FLASH技术交流群:56785596

TOP

学习一下  正好用上。

TOP

发新话题