SWFObject2.0两种调用方式

 SWFObject是简单易用的Flash嵌入和检测JS代码,个人觉得比Adobe官方提供要更为方便,也更为易用的。这次版本更新改动非常大。
SWFObject2.0现提供两个主要调用方法。
1.swfobject.registerObject(flashContentId, flashVersion,expressInstallUrl );
flashContentId为Flash的ID;
flashVersion为播放SWF的Player版本;
expressInstallUrl为Flash Player更新安装的swf调用地址;如果当前版本低于flashVersion将自动更新。

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>SWFObject v2.0 sample page</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <mce:script type="text/javascript" src="swfobject.js" mce_src="swfobject.js"></mce:script> <mce:script type="text/javascript"><!-- swfobject.registerObject("myId", "9.0.0", "expressInstall.swf"); // --></mce:script> </head> <body> <div> <object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="120"> <param name="movie" value="test.swf" /> <div> <h1>Alternative content</h1> <p> <a href="http://www.adobe.com/go/getflashplayer" mce_href="http://www.adobe.com/go/getflashplayer"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" mce_src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> </a></p> </div> </object> </div> </body> </html>

 

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>demo</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <mce:script type="text/javascript" src="swfobject.js" mce_src="swfobject.js"></mce:script> <mce:script type="text/javascript"><!-- var flashvars = {}; flashvars.sn = "a00001"; var params = {}; params.menu = "false"; params.quality = "autohigh"; params.wmode = "opaque"; params.allowfullscreen = "true"; params.allowscriptaccess = "always"; params.allownetworking = "all"; var attributes = {}; swfobject.embedSWF("test.swf", "flashcontent", "300", "120", "9.0.0", "expressInstall.swf", flashvars, params, attributes); // --></mce:script> </head> <body> <div id="flashcontent"> <a href="http://www.adobe.com/go/getflashplayer" mce_href="http://www.adobe.com/go/getflashplayer"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" mce_src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" border="0" /> </a></div></body> </html>



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";


你可能感兴趣的:(html,Flash,div,Adobe,border,attributes)