I'm having a real nightmare trying to do what should be a very simple task. If I embed a static or independent SWF file, it shows up fine on our ModX powered website. However, when it comes to a dynamic SWF (one that references an XML file and image files etc) I just can't get the thing to show up at all. According to the Flash Menu program that I have I paste the following code in the HEAD part of the page:
我有一个真正的噩梦试图做一个应该是一个非常简单的任务。如果我嵌入一个静态或独立的SWF文件,它在我们的ModX驱动的网站上显示正常。但是,当谈到动态SWF(引用XML文件和图像文件等)时,我根本无法让它显示出来。根据我的Flash菜单程序,我将以下代码粘贴到页面的HEAD部分:
<script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript" src="flying.js"></script>
(with those files placed in the root directory of course) and then in the BODY section I should paste this:
(当然这些文件放在根目录中)然后在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>
That doesn't work. The files are in a folder called icpmenu_es
(a subfolder of flash
), which is where the menu.swf
is referenced. The dependent files (including the XML, PNGs and SWFs) are in a subfolder called menu_data
. There are two XML files: open_menu_data.xml
and menu_data.xml
and I can't edit the latter.
Then I've tried the <EMBED>
route here:
这不起作用。这些文件位于名为icpmenu_es(flash的子文件夹)的文件夹中,该文件夹是menu.swf的引用位置。依赖文件(包括XML,PNG和SWF)位于名为menu_data的子文件夹中。有两个XML文件:open_menu_data.xml和menu_data.xml,我无法编辑后者。然后我在这里尝试了
<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>`
That doesn't work either. If anyone can help point me in the right direction then I would be most grateful. On other Forums I've seen people referring to editing the reference to the XML in the SWF, but I can't see where to do that. Being a newbie programmer doesn't help much either!
这也行不通。如果有人能帮助我指出正确的方向,那么我将非常感激。在其他论坛上,我看到人们指的是在SWF中编辑XML的引用,但我看不出去哪里做。作为一名新手程序员也无济于事!
2 个解决方案
#1
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:
Flash路径可能非常棘手。 Flash路径是相对于调用.swf的html而不是.swf所在的位置。所以,如果你在.html像:
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/
misite.com/news/article.html我从这里使用“/anfolfolderinroot/test.swf”调用.swf你.swf里面的相对路径仍然是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
所以,在.swf中加载没有绝对路径的电影或xml,例如“data.xml”flash将寻找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.
注意使用.html调用中包含的域名的绝对路径,如“http://www.mydomain.com/media/mymovie.swf”,它可以触发Flash安全警告,并且在访问URL时无法加载文件www像“http://misite.com/news/article.html”,尽你所能避免这种情况。
Hope it helps.
希望能帮助到你。
#2
Do you have access to the Apache logs?
您是否可以访问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.
我在过去经历过一些问题,如果modx对文件/文件夹权限不满意(例如,如果它们可以由组写入)那么它将不会显示某些内容,只有Apache日志会对此有所了解。
#1
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:
Flash路径可能非常棘手。 Flash路径是相对于调用.swf的html而不是.swf所在的位置。所以,如果你在.html像:
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/
misite.com/news/article.html我从这里使用“/anfolfolderinroot/test.swf”调用.swf你.swf里面的相对路径仍然是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
所以,在.swf中加载没有绝对路径的电影或xml,例如“data.xml”flash将寻找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.
注意使用.html调用中包含的域名的绝对路径,如“http://www.mydomain.com/media/mymovie.swf”,它可以触发Flash安全警告,并且在访问URL时无法加载文件www像“http://misite.com/news/article.html”,尽你所能避免这种情况。
Hope it helps.
希望能帮助到你。
#2
Do you have access to the Apache logs?
您是否可以访问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.
我在过去经历过一些问题,如果modx对文件/文件夹权限不满意(例如,如果它们可以由组写入)那么它将不会显示某些内容,只有Apache日志会对此有所了解。