对于当前的项目,我们使用 SwfObject 2.2 来嵌入 flash 文件,而 CRD 专家正在使用 SwfAddress 2.3 来创建 SEO flash goodness。
事实证明,如果您将两个库都包含在页面上,那么在 API ( http://code.google.com/p/swfobject/wiki/api ) 中使用 SwfObject 回调的任何尝试都会阻止 SwfObject 加载。在示例中,您可以简单地通过 HTML 注释掉 SwfAddress 文件来切换它。
抱歉,我无法在下面的代码中指向这两个库的绝对 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>
有任何想法吗?提前致谢!