对于当前的项目,我们使用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