對於當前的項目,我們使用SwfObject 2.2來嵌入Flash文件,而CRD大師們正在使用SwfAddress 2.3來創建SEO閃存善良。如果你在一個頁面上包含了這兩個庫,那麼在API中使用SwfObject回調的任何嘗試(http://code.google.com/p/swfobject/wiki/api)都會阻止SwfObject的加載。在這個例子中,你可以簡單地通過HTML註釋掉SwfAddress文件來切換。SwfAddress與SwfObject的「回調」參數衝突
對不起,我不能指向這兩個庫在我的代碼下面的絕對URL。
<head>
<title>SWFObject 2.2 dynamic embed with callback</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript" src="swfaddress.js"></script>
<script type="text/javascript">
function outputStatus(e) {
alert("e.success = " + e.success +"\ne.id = "+ e.id +"\ne.ref = "+ e.ref);
}
var params = {};
params.allowscriptaccess = "always";
swfobject.embedSWF("http://www.bobbyvandersluis.com/swfobject/testsuite_2_2/test6.swf", "myContent1", "300", "120", "9.0.0", "expressInstall.swf", null, null);
swfobject.embedSWF("http://www.bobbyvandersluis.com/swfobject/testsuite_2_2/test6.swf", "myContent2", "300", "120", "9.0.0", "expressInstall.swf", null, params, null, outputStatus);
</script>
</head>
<body>
<div id="myContent1">
<h1>Alternative content</h1>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
</div>
<div id="myContent2">
<h1>Alternative content</h1>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
</div>
</body>
任何想法?提前致謝!
對我來說,這解決了一個問題,其中SWFAddress.as externalChange事件沒有觸發(swf仍然正確嵌入) – user531694 2011-05-10 23:58:47