《2022年让flash自适应浏览器分辨率 .pdf》由会员分享,可在线阅读,更多相关《2022年让flash自适应浏览器分辨率 .pdf(5页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、 1 让 flash自适应浏览器分辨率(网页flash 全屏代码)首先新建 html 文件,将下面的代码考入: 2 function che(a) w=screen.availWidth-22; h=w*620/1000; if(a = 1) return h; else return w; AC_FL_RunContent( codebase,http:/ ); /end AC code 解释下: embed src=2.swf 为 flash 的路径和文件名字,这个大家自己改下就可以了。宽度和高度看下自己制作 flash 是多少照填就行。接下来在 html 所在路目录下新建文件夹命名“Sc
2、ripts ”在该文件夹下新建js 文件 “AC_RunActiveContent” 考入下面的代码并保存。名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 5 页 - - - - - - - - - 2 /v1.0 /Copyright 2006 Adobe Systems, Inc. All rights reserved. function AC_AddExtension(src, ext) if (src.indexOf(?) != -1) return src.r
3、eplace(/?/, ext+?); else return src + ext; function AC_Generateobj(objAttrs, params, embedAttrs) var str = ; for (var i in params) str += ; str += ; document.write(str); function AC_FL_RunContent() var ret = AC_GetArgs ( arguments, .swf, movie, clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 , applicatio
4、n/x-shockwave-flash ); AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs); function AC_SW_RunContent() var ret = AC_GetArgs ( arguments, .dcr, src, clsid:166B1BCA-3F9C-11CF-8075-444553540000 , null ); AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs); 名师资料总结 - - -精品资料欢迎下载 - - - - - - -
5、- - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 5 页 - - - - - - - - - 3 function AC_GetArgs(args, ext, srcParamName, classid, mimeType) var ret = new Object(); ret.embedAttrs = new Object(); ret.params = new Object(); ret.objAttrs = new Object(); for (var i=0; i args.length; i=i+2) var currArg =
6、argsi.toLowerCase(); switch (currArg) case classid: break; case pluginspage: ret.embedAttrsargsi = argsi+1; break; case src: case movie: argsi+1 = AC_AddExtension(argsi+1, ext); ret.embedAttrssrc = argsi+1; ret.paramssrcParamName = argsi+1; break; case onafterupdate: case onbeforeupdate: case onblur
7、: case oncellchange: case onclick: case ondblClick: case ondrag: case ondragend: case ondragenter: case ondragleave: case ondragover: case ondrop: case onfinish: case onfocus: case onhelp: case onmousedown: case onmouseup: case onmouseover: case onmousemove: 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - -
8、- - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 5 页 - - - - - - - - - 4 case onmouseout: case onkeypress: case onkeydown: case onkeyup: case onload: case onlosecapture: case onpropertychange: case onreadystatechange: case onrowsdelete: case onrowenter: case onrowexit: case onrowsinserted: case onstart:
9、 case onscroll: case onbeforeeditfocus: case onactivate: case onbeforedeactivate: case ondeactivate: case type: case codebase: ret.objAttrsargsi = argsi+1; break; case width: case height: case align: case vspace: case hspace: case class: case title: case accesskey: case name: case id: case tabindex:
10、 ret.embedAttrsargsi = ret.objAttrsargsi = argsi+1; break; default: ret.embedAttrsargsi = ret.paramsargsi = argsi+1; ret.objAttrsclassid = classid; 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 5 页 - - - - - - - - - 5 if (mimeType) ret.embedAttrstype = mimeType; return ret; 还有最后一步喽,吧你的flash 考入根目录,运行html 文件预览下效果吧!名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 5 页 - - - - - - - - -