Heim > Web-Frontend > js-Tutorial > 另类调用flash无须激活的方法_广告代码

另类调用flash无须激活的方法_广告代码

WBOY
Freigeben: 2016-05-16 19:22:18
Original
1119 Leute haben es durchsucht
复制代码 代码如下:
<script> <BR>/** <BR> * SWFObject v1.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ <BR> * <BR> * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License: <BR> * http://www.opensource.org/licenses/mit-license.php <BR> * <BR> * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for <BR> * legal reasons. <BR> */ <BR>if(typeof deconcept=="undefined"){var deconcept=new Object();} <BR>if(typeof deconcept.util=="undefined"){deconcept.util=new Object();} <BR>if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();} <BR>deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){ <BR>if(!document.createElement||!document.getElementById){return;} <BR>this.DETECT_KEY=_b?_b:"detectflash"; <BR>this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY); <BR>this.params=new Object(); <BR>this.variables=new Object(); <BR>this.attributes=new Array(); <BR>if(_1){this.setAttribute("swf",_1);} <BR>if(id){this.setAttribute("id",id);} <BR>if(w){this.setAttribute("width",w);} <BR>if(h){this.setAttribute("height",h);} <BR>if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));} <BR>this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7); <BR>if(c){this.addParam("bgcolor",c);} <BR>var q=_8?_8:"high"; <BR>this.addParam("quality",q); <BR>this.setAttribute("useExpressInstall",_7); <BR>this.setAttribute("doExpressInstall",false); <BR>var _d=(_9)?_9:window.location; <BR>this.setAttribute("xiRedirectUrl",_d); <BR>this.setAttribute("redirectUrl",""); <BR>if(_a){this.setAttribute("redirectUrl",_a);}}; <BR>deconcept.SWFObject.prototype={setAttribute:function(_e,_f){ <BR>this.attributes[_e]=_f; <BR>},getAttribute:function(_10){ <BR>return this.attributes[_10]; <BR>},addParam:function(_11,_12){ <BR>this.params[_11]=_12; <BR>},getParams:function(){ <BR>return this.params; <BR>},addVariable:function(_13,_14){ <BR>this.variables[_13]=_14; <BR>},getVariable:function(_15){ <BR>return this.variables[_15]; <BR>},getVariables:function(){ <BR>return this.variables; <BR>},getVariablePairs:function(){ <BR>var _16=new Array(); <BR>var key; <BR>var _18=this.getVariables(); <BR>for(key in _18){ <BR>_16.push(key+"="+_18[key]);} <BR>return _16; <BR>},getSWFHTML:function(){ <BR>var _19=""; <BR>if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){ <BR>if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");} <BR>_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\""; <BR>_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" "; <BR>var _1a=this.getParams(); <BR>for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";} <BR>var _1c=this.getVariablePairs().join("&"); <BR>if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";} <BR>_19+="/>"; <BR>}else{ <BR>if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");} <BR>_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">"; <BR>_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />"; <BR>var _1d=this.getParams(); <BR>for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";} <BR>var _1f=this.getVariablePairs().join("&"); <BR>if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";} <BR>_19+="";} <BR>return _19; <BR>},write:function(_20){ <BR>if(this.getAttribute("useExpressInstall")){ <BR>var _21=new deconcept.PlayerVersion([6,0,65]); <BR>if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){ <BR>this.setAttribute("doExpressInstall",true); <BR>this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl"))); <BR>document.title=document.title.slice(0,47)+" - Flash Player Installation"; <BR>this.addVariable("MMdoctitle",document.title);}} <BR>if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){ <BR>var n=(typeof _20=="string")?document.getElementById(_20):_20; <BR>n.innerHTML=this.getSWFHTML(); <BR>return true; <BR>}else{ <BR>if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}} <BR>return false;}}; <BR>deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){ <BR>var _25=new deconcept.PlayerVersion([0,0,0]); <BR>if(navigator.plugins&&navigator.mimeTypes.length){ <BR>var x=navigator.plugins["Shockwave Flash"]; <BR>if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));} <BR>}else{try{ <BR>var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); <BR>for(var i=3;axo!=null;i++){ <BR>axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i); <BR>_25=new deconcept.PlayerVersion([i,0,0]);}} <BR>catch(e){} <BR>if(_23&&_25.major>_23.major){return _25;} <BR>if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){ <BR>try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));} <BR>catch(e){}}} <BR>return _25;}; <BR>deconcept.PlayerVersion=function(_29){ <BR>this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0; <BR>this.minor=parseInt(_29[1])||0; <BR>this.rev=parseInt(_29[2])||0;}; <BR>deconcept.PlayerVersion.prototype.versionIsValid=function(fv){ <BR>if(this.major<fv.major){return false;} <BR>if(this.major>fv.major){return true;} <BR>if(this.minor<fv.minor){return false;} <BR>if(this.minor>fv.minor){return true;} <BR>if(this.rev<fv.rev){return false;}return true;}; <BR>deconcept.util={getRequestParameter:function(_2b){ <BR>var q=document.location.search||document.location.hash; <BR>if(q){ <BR>var _2d=q.indexOf(_2b+"="); <BR>var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length; <BR>if(q.length>1&&_2d>-1){ <BR>return q.substring(q.indexOf("=",_2d)+1,_2e); <BR>}}return "";}}; <BR>if(Array.prototype.push==null){ <BR>Array.prototype.push=function(_2f){ <BR>this[this.length]=_2f; <BR>return this.length;};} <BR>var getQueryParamValue=deconcept.util.getRequestParameter; <BR>var FlashObject=deconcept.SWFObject; // for backwards compatibility <BR>var SWFObject=deconcept.SWFObject; <br><br><BR></script> 

使用方法:
复制代码 代码如下:


  
    
  

    <script> <BR> var fo = new SWFObject("yanyuan.swf", "mymyy", "580", "386", "7", ""); <BR> fo.addParam("quality", "best"); <BR> fo.addParam("salign", "t"); <BR> fo.addParam("scale", "noscale"); <BR> fo.addParam("loop", "true"); <BR> fo.write("flashmovyy"); <BR> </script>
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage