欢迎来到福编程网,本站提供各种互联网专业知识!

从sohu弄下来的flash中展示图片的代码

发布时间:2007-04-27 作者: 来源:转载
所有文件已打包复制代码代码如下: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")
所有文件已打包




复制代码 代码如下:
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='0){flashNode+='flashvars="'+pairs+'"'}flashNode+='/>'}else{if(this.getAttribute("doExpressInstall"))this.addVariable("MMplayerType","ActiveX");flashNode='';flashNode+='';varparams=this.getParams();for(varkeyinparams){flashNode+=''}varpairs=this.getVariablePairs().join("&");if(pairs.length>0){flashNode+=''}flashNode+=""}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.majorfv.major)returntrue;if(this.minorfv.minor)returntrue;if(this.rev-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

打包下载

相关推荐