Not signed in (Sign In)

Vanilla 1.0.3 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  
    I have a html file which I want to run several banners on.

    I am useing the swfobject.js file with the below code in the html page:

    <body>
    <td rowspan="2">

    <script type="text/javascript" src="swfobject.js"></script>
    <div id="flashcontent">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60">
    <param name="movie" value="banners_cdweb/italychiltons_468x60.swf" />
    <param name="quality" value="high" />
    <embed src="banners_cdweb/italychiltons_468x60.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"></embed>
    </object>
    </div>
    <script type="text/javascript">
    var so = new SWFObject("banners_cdweb/italychiltons_468x60.swf", "mymovie", "468", "60", "8", "");
    so.write("flashcontent");
    </script>

    </td>
    </body

    With one banner in the body this works fine, however when I had another swf banner a problem occures?

    It repeats showing one banner twice not showing two different banners.

    I'm no expert, however I think that somthing in the swfobject.fs file needs changing.

    Can any one help me with this problem?

    Thanks
    Gary
    • CommentAuthorphilip
    • CommentTimeAug 8th 2007 edited
     
    your code has a few problems:

    you can't do a 'td' before declaring a 'table' (make sure it's properly terminated)

    <body>
    <td rowspan="2">
    ...
    </td>
    </body>


    should be

    <body>
    <table>
    <td rowspan="2">
    ...
    </td>
    </table>
    </body>


    your swfobject link should be in the 'head' section:

    <head>
    [... title and stuff ...]
    <script type="text/javascript" src="swfobject.js"></script>
    </head>
    <body>


    you shouldn't have the 'object' or 'embed' tags on your page. the whole point of swfobject is to delete them and let swfobject dynamically create them for you.


    <div id="flashcontent"></div>
    <script type="text/javascript">
    var so = new SWFObject("banners_cdweb/italychiltons_468x60.swf", "mymovie", "468", "60", "8", "");
    so.write("flashcontent");
    </script>


    if you want to use more than one swf on a page with SWFObject, you can read up on it in the FAQ:
    http://blog.deconcept.com/swfobject/forum/discussion/2/swfobject-faq/#Item_2

    - philip
  2.  
    Philip

    Thanks for your reply, however I havve read the link http://blog.deconcept.com/swfobject/forum/discussion/2/swfobject-faq/#Item_2
    and added the following code but I still am not seing two different swf banners still only one?
    <
    head>
    <script type="text/javascript" src="swfobject.js"></script>
    </head>

    <body>
    <table>

    <td rowspan="2">
    <div id="swfOne"><script type="text/javascript" src="swfobject.js"></script></div>
    <div id="flashcontent"><script type="text/javascript">var so = new SWFObject("banners_cdweb/italychiltons_468x60.swf", "myonemovie", "468", "60", "8", "");so.write("flashcontent");</script></div></td>

    <td rowspan="2">
    <div id="swftwo"><script type="text/javascript" src="swfobject.js"></script></div>
    <div id="flashcontent"><script type="text/javascript">var so = new SWFObject("banners_cdweb/sunnydaytravel_468x60.swf", "mytwomovie", "468", "60", "8", "");so.write("flashcontent");</script></div></td>

    </table>
    </body>

    Where am I going wrong?

    Gary
    • CommentAuthorphilip
    • CommentTimeAug 8th 2007
     
    please follow the examples more closely... you've added code that shouldn't be there and haven't edited parts that need editing.

    look at your so.writes
    look at your <div id="">... you've added <div id="flashcontent"> twice... neither of them should be there if you're following the example(s).
    swfobject.js should only be linked once in the document, in the head

    you're almost there... :)
  3.  
    Philip

    You got me sweating, but hey thanks a lot for your help

    Regards
    Gary

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

    <body>
    <table>

    <td rowspan="2">
    <div id="swfOne"><script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">var soOne = new
    SWFObject ("banners_cdweb/italychiltons_468x60.swf", "myOnemovie", "468", "60", "8", "");
    soOne.write("swfOne");</script></div></td>

    <td rowspan="2">
    <div id="swfTwo"><script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">var soTwo = new
    SWFObject ("banners_cdweb/sunnydaytravel_468x60.swf", "myTwomovie", "468", "60", "8", "");
    soTwo.write("swfTwo");</script></div></td>

    </table>
    </body>
    • CommentAuthorphilip
    • CommentTimeAug 8th 2007
     
    you still need a little clean-up.

    again, the swfobject.js file should ONLY be in the head of your document. it's also a good idea to keep the swfobject code out of the target divs.

    this

    <div id="swfOne">
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
    var soOne = new SWFObject ("banners_cdweb/italychiltons_468x60.swf", "myOnemovie", "468", "60", "8", "");
    soOne.write("swfOne");
    </script>
    </div>


    should be this

    <div id="swfOne"></div>

    <script type="text/javascript">
    var soOne = new SWFObject ("banners_cdweb/italychiltons_468x60.swf", "myOnemovie", "468", "60", "8", "");
    soOne.write("swfOne");
    </script>


    same goes for the second one.
  4.  
    Philip

    There are some realy good and helpful people in this world and you are one of then.

    Thanks for all your help and if your interested?

    http://cdwebdesigns.50webs.com/link_up.html

    Regards
    Gary
    • CommentAuthorphilip
    • CommentTimeAug 8th 2007
     
    thx, glad it worked out for you. :)
    • CommentAuthorzhangsisi
    • CommentTimeOct 1st 2007
     
    find love best www.ConnectAsia.info/en/lang104082about_sisi11 welcome you