1

我正在做一个真正的噩梦,试图做一件应该是非常简单的任务。如果我嵌入一个静态或独立的 SWF 文件,它会在我们的 ModX 支持的网站上正常显示。但是,当涉及到动态 SWF(引用 XML 文件和图像文件等的)时,我根本无法显示它。根据我拥有的 Flash 菜单程序,我将以下代码粘贴到页面的 HEAD 部分:

<script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript" src="flying.js"></script>  

(当然这些文件放在根目录中)然后在 BODY 部分我应该粘贴这个:

<!-- Flash Menu Labs – www.flashmenulabs.com -->
<div id="FlashMenuLabs" style="position:absolute; top:0px; padding-left:0px; z-index:0;">
    You need to upgrade your Flash Player or to allow javascript to enable Website menu. </br>
    <a href="http://www.adobe.com/go/getflashplayer">Get Flash Player</a>            
</div>
< script type="text/javascript">
// <![CDATA[
    var so = new SWFObject("menu.swf", "menu", "185", "440", "8", "#000000");
    so.addVariable("page _ code", "a _ b _ c");

    so.addParam("wmode", "transparent");
    so.addParam("scale", "noscale");
    so.addParam("salign", "TL");
    so.write("FlashMenuLabs");
// ]]>
</script>  

那是行不通的。这些文件位于一个名为icpmenu_es( 的子文件夹flash)的文件夹中,这menu.swf是引用 的位置。相关文件(包括 XML、PNG 和 SWF)位于名为menu_data. 有两个 XML 文件:open_menu_data.xml并且menu_data.xml我无法编辑后者。
然后我在<EMBED>这里尝试了路线:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="185" height="440">  <param name="base" value="http://www.ideal-country-property.com/">  <param name="movie" value="/flash/icpmenu_es/menu.swf">  <param name="id" value="ICPmenuES">  <param name="menu" value="false">  <param name="slalign" value="tl">  <param name="quality" value="high">  <param name="wmode" value="transparent">  <param name="scale" value="noscale">  <embed src="/flash/icpmenu_es/menu.swf" menu="false" quality="high" wmode="transparent" scale="noscale" width=185 height=440 type="application/x-shockwave-flash" id="ICPmenuES" salign="tl" base="http://www.ideal-country-property.com/"  pluginspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">  </embed>  </object>`  

那也行不通。如果有人可以帮助我指出正确的方向,那么我将不胜感激。在其他论坛上,我看到有人提到在 SWF 中编辑对 XML 的引用,但我看不到在哪里这样做。作为一个新手程序员也没有多大帮助!

4

2 回答 2

0

您有权访问 Apache 日志吗?

I experienced problems in the past whereby if modx isn't happy with the file/folder permissions (if they are writable by group for example) then it won't show certain content and only the Apache logs give insight into this.

于 2009-07-29T09:05:07.583 回答
0

Flash paths can get very tricky. Flash paths are relative to the html where the .swf is called, not where .swf is located. So, if you are in a .html like:

misite.com/news/article.html and i call a .swf from here using "/anotherfolderinroot/test.swf" your relative path inside the .swf is still misite.com/news/

so, loading a movie or xml without absolute paths inside the .swf, for example "data.xml" flash will be looking for misite.com/news/data.xml

Watch out using absolute path with domain names included in the .html call like "http://www.mydomain.com/media/mymovie.swf" that can trigger Flash Security warnings and not be able to load files when accesing the url without www like "http://misite.com/news/article.html" avoid this while you can.

Hope it helps.

于 2011-09-20T17:54:12.353 回答