Question

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:

<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:

<!-- 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:

<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!

Was it helpful?

Solution

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.

OTHER TIPS

Do you have access to the Apache logs?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top