SWFObject 2.0 中文文档 感谢 译者的分享http://farthinker.cn/documents/swfobject-2-documentation/在对SWFObject2.0 的几种嵌入方法进行测试之后,发现使用 js动态嵌入的方法,虽然代码精简,但是在需要在与页面js 脚本通讯(As 通过 ExternalInterface 定义页面脚本接口)的 场合不适用,可能是SWFObject 2.0 的bug,所以,如果在不需要定义ExternalInterface 情况下使用 SWFObject2 的动态嵌入方法是做理想的做法,反之如果需要,还是建议大家使用SWFObject2 的静态嵌入方法。 关于flashVars,以前记过个笔记,一并总结下,Google Chrome 浏览器在使用 SWFObject 2.0 的动态嵌入flash时,flashvar 不能很好的工作。IE fireFox没有问题。
SWFObject 2.0版本
SWFObject 2.0,已经在code.google.com上建立了开源文档[http://code.google.com/p/swfobject/]。
SWFObject2.0现提供两个主要调用方法。
1.swfobject.registerObject(flashContentId, flashVersion,expressInstallUrl );
flashContentId为Flash的ID;
flashVersion为播放SWF的Player版本;
expressInstallUrl为Flash Player更新安装的swf调用地址;如果当前版本低于flashVersion将自动更新。
2.swfobject.embedSWF(swfUrl, replaceElementId, swfWidth, swfHeight, flashVersion,expressInstallUrl, flashvars, params, attributes);
swfUrl为调用swf的地址;
replaceElementId为要用于替换成flash的可显示容器的ID;
swfWidth为swf的宽度;
swfHeight为swf的高度;
flashVersion为播放SWF的Player版本;
expressInstallUrl为Flash Player更新安装的swf调用地址;如果当前版本低于flashVersion将自动更新。
flashvars为flashvars传递的变量值;
params为flash player控件的参数设置;如menu=”false” ;
attributes为flash player控件的属性值设置;如class=”flashstyle”;
SWFObject下载包:http://swfobject.googlecode.com/files/swfobject_2_0.zip
SWFObject的html生成器:http://swfobject.googlecode.com/files/swfobject_2_0_generator_1_1_html.zip
SWFObject的官方Blog:http://blog.deconcept.com/swfobject/