Results 1 to 4 of 4

Thread: Loading a swf file into a div (photo gallery)

  1. #1
    Join Date
    Aug 2008
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Loading a swf file into a div (photo gallery)

    So, I have a photo gallery with a specific div where i'm loading images. One of the images needs to be animated, so I cannot just link a jpeg, i have to use a swf so the image can scroll. For some reason when i replace the imagexx.jpg with imagexx.swf I get a red x. Is this even possible to do?


    Here's the code for my div:
    Code:
    <div style="overflow:hidden;">
    <div id="motioncontainer" style="width:207px; height:435px; overflow:hidden; position: relative;">
    <div id="motiongallery" style="position:absolute; left:0; top:0;">
    And heres the code I have for my images that are loading into that div:
    Code:
    <a href="images/image.swf" rel="enlargeimage::click"  rev="loadarea::#"><img name="" src="images/new_additions/1.jpg" width="207" height="123" border="0" class="gradualfader"></a><br><br>
    What am I doing wrong? Thanks!!!

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    A swoof file is not an image, it is a flash file. Try using an animated gif.
    Jeremy | jfein.net

  3. #3
    Join Date
    Aug 2008
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i cant. The iamge has to be animated. Im sure there is a way to do it.

  4. #4
    Join Date
    Aug 2008
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I found some code that opens the flash on page load, but i have no idea how to add the function to a link so the flash will only load when the link is clicked. ideas? see code below:


    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Captivate-to-Flash ExternalInterface example</title>
    <script type="text/javascript" src="scripts/swfobject.js"></script>
    <script type="text/javascript">
    	function addFlash(){	
    		var so = new SWFObject("images/series_test.swf", "mov1", "640", "480", "8", "#FFFFFF");
    		so.write("flashContainer");
    	}
    	window.onload=function(){
    		addFlash();
    	}
    </script>
     
    <!-- for Flash-JS communication -->
    <script language="JavaScript">
     
    //Detect Flash container movie
    function getFlashMovie(mov1) {
        if (navigator.appName.indexOf("Microsoft") != -1) {
            return window[mov1];
        }
        else {
            return document[mov1];
        }
    }
     
    //Function to be called by Captivate
    function captivateUnload() {
    	
    	//Calls "unload" method established in ExternalInterface Actionscript code
    	getFlashMovie("simpleSwfLoader").unload();
     
    }
     
     
    </script>
     
    </head>
     
    <body>
    
    <div id="flashContainer">If you see this message, you have Javascript disabled. Please enable Javascript to see the Flash content.</div>
    </body>
     
    </html>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •