手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >从sohu弄下来的flash中展示图片的代码
从sohu弄下来的flash中展示图片的代码
摘要:所有文件已打包复制代码代码如下:if(typeofsas=="undefined")varsas=newObject();if(typeof...

所有文件已打包

<DIVid=sasFlashFocus60></DIV>

<SCRIPTtype=text/javascript>

<>

</SCRIPT>

复制代码 代码如下:

if(typeofsas=="undefined")varsas=newObject();if(typeofsas.ued=="undefined")sas.ued=newObject();if(typeofsas.ued.util=="undefined")sas.ued.util=newObject();if(typeofsas.ued.FlashObjectUtil=="undefined")sas.ued.FlashObjectUtil=newObject();sas.ued.FlashObject=function(swf,id,w,h,ver,c,useExpressInstall,quality,xiRedirectUrl,redirectUrl,detectKey){if(!document.createElement||!document.getElementById)return;this.DETECT_KEY=detectKey?detectKey:'detectflash';this.skipDetect=sas.ued.util.getRequestParameter(this.DETECT_KEY);this.params=newObject();this.variables=newObject();this.attributes=newArray();this.useExpressInstall=useExpressInstall;if(swf)this.setAttribute('swf',swf);if(id)this.setAttribute('id',id);if(w)this.setAttribute('width',w);if(h)this.setAttribute('height',h);if(ver)this.setAttribute('version',newsas.ued.PlayerVersion(ver.toString().split(".")));this.installedVer=sas.ued.FlashObjectUtil.getPlayerVersion(this.getAttribute('version'),useExpressInstall);if(c)this.addParam('bgcolor',c);varq=quality?quality:'high';this.addParam('quality',q);varxir=(xiRedirectUrl)?xiRedirectUrl:window.location;this.setAttribute('xiRedirectUrl',xir);this.setAttribute('redirectUrl','');if(redirectUrl)this.setAttribute('redirectUrl',redirectUrl)};sas.ued.FlashObject.prototype={setAttribute:function(name,value){this.attributes[name]=value},getAttribute:function(name){returnthis.attributes[name]},addParam:function(name,value){this.params[name]=value},getParams:function(){returnthis.params},addVariable:function(name,value){this.variables[name]=value},getVariable:function(name){returnthis.variables[name]},getVariables:function(){returnthis.variables},createParamTag:function(n,v){varp=document.createElement('param');p.setAttribute('name',n);p.setAttribute('value',v);returnp},getVariablePairs:function(){varvariablePairs=newArray();varkey;varvariables=this.getVariables();for(keyinvariables){variablePairs.push(key+"="+variables[key])}returnvariablePairs},getFlashHTML:function(){varflashNode="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall"))this.addVariable("MMplayerType","PlugIn");flashNode='<embedtype="application/x-shockwave-flash"src="'+this.getAttribute('swf')+'"width="'+this.getAttribute('width')+'"height="'+this.getAttribute('height')+'"';flashNode+='id="'+this.getAttribute('id')+'"name="'+this.getAttribute('id')+'"';varparams=this.getParams();for(varkeyinparams){flashNode+=[key]+'="'+params[key]+'"'}varpairs=this.getVariablePairs().join("&");if(pairs.length>0){flashNode+='flashvars="'+pairs+'"'}flashNode+='/>'}else{if(this.getAttribute("doExpressInstall"))this.addVariable("MMplayerType","ActiveX");flashNode='<objectid="'+this.getAttribute('id')+'"classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"width="'+this.getAttribute('width')+'"height="'+this.getAttribute('height')+'">';flashNode+='<paramname="movie"value="'+this.getAttribute('swf')+'"/>';varparams=this.getParams();for(varkeyinparams){flashNode+='<paramname="'+key+'"value="'+params[key]+'"/>'}varpairs=this.getVariablePairs().join("&");if(pairs.length>0){flashNode+='<paramname="flashvars"value="'+pairs+'"/>'}flashNode+="</object>"}returnflashNode},write:function(elementId){if(this.useExpressInstall){varexpressInstallReqVer=newsas.ued.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(expressInstallReqVer)&&!this.installedVer.versionIsValid(this.getAttribute('version'))){this.setAttribute('doExpressInstall',true);this.addVariable("MMredirectURL",escape(this.getAttribute('xiRedirectUrl')));document.title=document.title.slice(0,47)+"-FlashPlayerInstallation";this.addVariable("MMdoctitle",document.title)}}else{this.setAttribute('doExpressInstall',false)}if(this.skipDetect||this.getAttribute('doExpressInstall')||this.installedVer.versionIsValid(this.getAttribute('version'))){varn=(typeofelementId=='string')?document.getElementById(elementId):elementId;n.innerHTML=this.getFlashHTML()}else{if(this.getAttribute('redirectUrl')!=""){document.location.replace(this.getAttribute('redirectUrl'))}}}};sas.ued.FlashObjectUtil.getPlayerVersion=function(reqVer,xiInstall){varPlayerVersion=newsas.ued.PlayerVersion(0,0,0);if(navigator.plugins&&navigator.mimeTypes.length){varx=navigator.plugins["ShockwaveFlash"];if(x&&x.description){PlayerVersion=newsas.ued.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|s)+/,"").replace(/(s+r|s+b[0-9]+)/,".").split("."))}}else{try{varaxo=newActiveXObject("ShockwaveFlash.ShockwaveFlash");for(vari=3;axo!=null;i++){axo=newActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);PlayerVersion=newsas.ued.PlayerVersion([i,0,0])}}catch(e){}if(reqVer&&PlayerVersion.major>reqVer.major)returnPlayerVersion;if(!reqVer||((reqVer.minor!=0||reqVer.rev!=0)&&PlayerVersion.major==reqVer.major)||PlayerVersion.major!=6||xiInstall){try{PlayerVersion=newsas.ued.PlayerVersion(axo.GetVariable("$version").split("")[1].split(","))}catch(e){}}}returnPlayerVersion};sas.ued.PlayerVersion=function(arrVersion){this.major=parseInt(arrVersion[0])||0;this.minor=parseInt(arrVersion[1])||0;this.rev=parseInt(arrVersion[2])||0};sas.ued.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major)returnfalse;if(this.major>fv.major)returntrue;if(this.minor<fv.minor)returnfalse;if(this.minor>fv.minor)returntrue;if(this.rev<fv.rev)returnfalse;returntrue};sas.ued.util={getRequestParameter:function(param){varq=document.location.search||document.location.href.hash;if(q){varstartIndex=q.indexOf(param+"=");varendIndex=(q.indexOf("&",startIndex)>-1)?q.indexOf("&",startIndex):q.length;if(q.length>1&&startIndex>-1){returnq.substring(q.indexOf("=",startIndex)+1,endIndex)}}return""}};if(Array.prototype.push==null){Array.prototype.push=function(item){this[this.length]=item;returnthis.length}}vargetQueryParamValue=sas.ued.util.getRequestParameter;varsohuFlash=sas.ued.FlashObject;

functionCookie(document,name,hours,path,domain,secure){this.$document=document;this.$name=name;this.$expiration=hours?newDate((newDate()).getTime()+hours*3600000):null;this.$path=path?path:null;this.$domain=domain?domain:null;this.$secure=secure;};Cookie.prototype.store=function(){varcookieval="";for(varpropinthis){if((prop.charAt(0)=='$')||((typeofthis[prop])=='function'))continue;if(cookieval!="")cookieval+='&';cookieval+=prop+':'+escape(this[prop]);}varcookie=this.$name+'='+cookieval;if(this.$expiration)cookie+=';expires='+this.$expiration.toGMTString();if(this.$path)cookie+=';path='+this.$path;if(this.$domain)cookie+=';domain='+this.$domain;if(this.$secure)cookie+=';secure';this.$document.cookie=cookie;};Cookie.prototype.load=function(){varallcookies=this.$document.cookie;if(allcookies=="")returnfalse;varstart=allcookies.indexOf(this.$name+'=');if(start==-1)returnfalse;start+=this.$name.length+1;varend=allcookies.indexOf(';',start);if(end==-1)end=allcookies.length;varcookieval=allcookies.substring(start,end);vara=cookieval.split('&');for(vari=0;i<a.length;i++)a[i]=a[i].split(':');for(vari=0;i<a.length;i++)this[a[i][0]]=unescape(a[i][1]);returntrue;};Cookie.prototype.remove=function(){varcookie;cookie=this.$name+'=';if(this.$path)cookie+=';path='+this.$path;if(this.$domain)cookie+=';domain='+this.$domain;cookie+=';expires=Fri,02-Jan-197000:00:00GMT';this.$document.cookie=cookie;};

打包下载

【从sohu弄下来的flash中展示图片的代码】相关文章:

设为首页 加入收藏的js代码

介绍JavaScript中Math.abs()方法的使用

获取阴历(农历)和当前日期的js代码

一些有关检查数据的JS代码

解析Node.js基于模块和包的代码部署方式

Javascript通过overflow控制列表闭合与展开的方法

在JavaScript中使用开平方根的sqrt()方法

鼠标图片振动代码

jQuery处理图片加载失败的常用方法

js兼容火狐显示上传图片预览效果的方法

精品推荐
分类导航