We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29525
    • 388 Posts
    This is my first attempt to integrate an existing flash file into a modx page (or any page for that matter).

    I want to use this nifty slide show/stack in a modx site. http://www.mustardlab.com/developer/test/new/
    More info about the slide show is here. http://twelvestone.com/forum_thread/view/15182?offset=0

    I will of course use different images, but I can’t seem to get this to work. I downloaded the files for the slideshow http://www.mustardlab.com/developer/test/new/gallery.zip

    Here’s what I did.

    I copied all the files from the download into a folder in assets called "stack". This includes the
    index.php file which points to the gallery.swf file which uses a gallery.xml file for the list of images in the slideshow/stack.

    I created very simple new template and pasted in the code from the downloaded index.php file.
    Added added <base href="[(site_url)]" > to the head
    Changed the path to the swf file to assets/stack/gallery.swf.
    Changed the path to the images in the xml file to assets/stack/image.jpg
    Changed the background color to gray (so I could see where the flash file should be)

    Result:
    The flash file is not running. If I change the size to 50% I can see the white box where it should be with the gray background around it, but flash is not running.

    I’m thinking this is a path problem of some sort. Perhaps it can’t see the xml file or the images? I can’t seem to resolve this.

    If copy the code from my modx template into standalone html page, it works fine.

    Here’s my modx template
    <html>
    <head>
    	<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
    	<title>Flash Photo Stack</title>
    <base href="[(site_url)]" >
    
    <style>
    body {background: gray;}
    </style>
    </head>
    <body style="margin:0px">
    
    	<object id="flashmovie" type="application/x-shockwave-flash" data="assets/stack/gallery.swf" width="100%" height="100%">
    		<param name="movie" value="assets/stack/gallery.swf" />
    		<param name="FlashVars" value="<? if(isset($_GET['image'])) echo "topimage=".$_GET['image'] ?>" />
    	</object>
    
    </body>
    </html>
    
    


    Here’s the xml file
    <?xml version=\"1.0\" ?>
    <img src="assets/stack/animal.jpg" width="466" height="548" />
    <img src="assets/stack/just_married.jpg" width="389" height="578" />
    <img src="assets/stack/richard_mackson.jpg" width="473" height="316" />
    <img src="assets/stack/sinister.jpg" width="480" height="360" />
    <img src="assets/stack/superdog.jpg" width="500" height="339" />
    <img src="assets/stack/st_helens.jpg" width="479" height="480" />


    Here’s the original html code from the download
    <html>
    <head>
    	<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
    	<title>Flash Photo Stack</title>
    </head>
    <body style="margin:0px">
    	<object id="flashmovie" type="application/x-shockwave-flash" data="gallery.swf" width="100%" height="100%">
    		<param name="movie" value="gallery.swf" />
    		<param name="FlashVars" value="<? if(isset($_GET['image'])) echo "topimage=".$_GET['image'] ?>" />
    	</object>
    </body>
    </html>
    
    


    I did try to use SWFObject and had similar results. However, since I’d never used this before either, I may not have used it correctly.

    I have noticed this code is much simpler than other flash integration examples I found by googling around, yet it works in a stand alone file.

    Any thoughts or ideas are greatly appreciated.
      www.terrybarthdesign.com
      • 36416
      • 589 Posts
      Quote from: Terry at Sep 02, 2008, 08:38 PM

      If copy the code from my modx template into standalone html page, it works fine.
      Here’s my modx template (snip)

      You can’t writee PHP source in MODx template - use custom snippet or embed Flash variables with SWFobject...
        • 29525
        • 388 Posts
        Eol

        Thanks for responding.

        I actually tried this at first, but don’t really know what parts go where. I tried putting the <object>. . . </object> in a snippet, then calling that from the template to no avail.

        Can you tell me more? What part should go into the snippet? What about the xml file? How does that fit in? Is the path correct?

        You can tell, I’m a little lost

        Terry
          www.terrybarthdesign.com
          • 36416
          • 589 Posts
          Quote from: Terry at Sep 03, 2008, 12:29 PM

          Can you tell me more? What part should go into the snippet? What about the xml file? How does that fit in? Is the path correct?

          Fastest way to make it work if you’re not familiar with MODx basics (snippets etc.) would be to install PHx plugin and change the Flash parameters line in the template to:

          <param name="FlashVars" value="topimage=[+phx:get=`image`+]" />
          
            • 8841
            • 42 Posts
            Hi, I am new to modx, I was able to install it and get a content management set up on the html in my site

            The only issue now, is the flash, .swf galleries are not working, they work fine when tested outside modx

            Anyone have any ideas?
              • 8841
              • 42 Posts
              I also installed smallFlash snippet to help, but when I try to execute this, I get this error

              getimagesize failed to open stream; no such file or directory.....

              This may be what the problem is huh?