我有几个 SWF 对象(一个时钟和一个日期)要在实时站点上显示,现在我试图在 localhost 上设置站点,但是 swf 对象消失了。我试图将站点放在子域上,一切正常,但我尝试并搜索了如何使这些 swf 在本地工作但没有成功。
有人可以分享一下这些 swfObjects 是如何只在 localhost/wampv 上消失的吗?
index.php 上的 SWF 对象
<div id="time">
<?php embed_flash("swf/clock.swf", CLOCK_WIDTH, CLOCK_HEIGHT, "8", '', "flashcontent");?>
<?php embed_flash("swf/date.swf", DATE_WIDTH, DATE_HEIGHT, "8", '', "flashcontent_date");?>
</div>
这是 Flash_function.php 的代码
<?php
function embed_flash($name, $w, $h, $version, $bgcolor, $id)
{
$cacheBuster = rand();
$padTop = $h/3;
?>
<style>
a.noflash:link, a.noflash:visited, a.noflash:active {color: #1860C2; text-decoration: none; background:#FFFFFF;}
a.noflash:hover {color:#000; text-decoration:none; background:#EEEEEE;}
.message { width: <?=$w;?>px; font-size:12px; font-weight:normal; margin-bottom: 10px; padding: 5px; color: #EEE; background: orange;"}
</style>
<div id="<?=$id;?>" align="center">
<noscript>
<div class="message">
Please enable <a href="https://www.google.com/support/adsense/bin/answer.py?answer=12654" target="_blank" class="noflash"> JavaScript </a> to view this page properly.
</div>
</noscript>
<div class="message">
You need to update your Flash plugin. Click <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW" target="_blank" class="noflash"> here </a> if you want to continue.
</div>
</div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("<?=$name;?>", "<?=$w;?>", "<?=$h;?>", "<?=$version;?>", "<?=$bgcolor;?>","<?=$id;?>" );
so.addParam("quality", "high");
so.addParam("allowScriptAccess", "sameDomain");
so.addParam("scale", "showall");
so.addParam("loop", "false");
so.addParam("wmode", "transparent");
so.write("<?=$id;?>");
// ]]>
</script>
我检查了该站点的 Firebug,因此在实时站点上,代码显示为
<div id="flashcontent_date" align="center">
<embed id="undefined" width="240" height="50" wmode="transparent" loop="false" scale="showall" allowscriptaccess="sameDomain" quality="high" name="undefined" src="swf/date.swf" type="application/x-shockwave-flash">
</div>
但在本地主机上它显示为
<div id="<?=$id;?>" align="center">
<embed id="<?=$w;?>" width="<?=$h;?>" height="<?=$version;?>" wmode="transparent" loop="false" scale="showall" allowscriptaccess="sameDomain" quality="high" bgcolor="<?=$id;?>" name="<?=$w;?>" src="<?=$name;?>" type="application/x-shockwave-flash">
</div>
任何我做错了,任何帮助表示赞赏。