Not signed in (Sign In)

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

  1.  
    Why doesn't this code work?

    <!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=iso-8859-1" />
    <title>cmp website samples</title>

    </head>

    <div id="flashcontent">

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

    <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="850" height="470">
    <param name="movie" value="samples3.swf" />
    <param name="quality" value="high" />
    <embed src="samples3.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="850" height="470"></embed>
    </object>
    </div>
    <body>

    <script type="text/javascript">
    var so = new SWFObject("samples3.swf", "newsamples", "850", "470", "8", #FFFFFF");
    so.write("flashcontent");
    </script>


    </body>
    </html>

    Thanks for the help.
    Best regards,
    Rich Marchione
    • CommentAuthorphilip
    • CommentTimeJul 11th 2007
     
    1. you can't have the swfobject.js link in the targeted container ("flashcontent" div)! the link should be in your document <head>.
    2. <div> tags are meant to be used in the body of your document... you can't have anything between the <head> and the <body> tags. move your <div> inside <body>.
    3. the whole point of swfobject is to remove the object and embed code from your markup, then let swfobject write it dynamically when the page is loaded. you need to delete everything between <object> and </object>.

    if you follow Geoff's example (http://blog.deconcept.com/swfobject/swfobject.html) your code would look like this:

    <!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=iso-8859-1" />
    <title>cmp website samples</title>
    <script type="text/javascript" src="swfobject.js"></script>
    </head>

    <body>

    <div id="flashcontent"></div>

    <script type="text/javascript">
    var so = new SWFObject("samples3.swf", "newsamples", "850", "470", "8", #FFFFFF");
    so.write("flashcontent");
    </script>

    </body>
    </html>

    - philip
  2.  
    OK, I modified the code as shown below. Now it doesn't work at all.

    <!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=iso-8859-1" />
    <title>cmp website samples</title>
    <script type="text/javascript" src="swfobject.js"></script>
    </head>

    <body>
    <div id="flashcontent"></div>

    <script type="text/javascript">
    var so = new SWFObject("samples3.swf", "newsamples", "850", "470", "8", #FFFFFF");
    so.write("flashcontent");
    </script>


    </body>
    </html>

    Thanks for the help.
    Rich Marchione
    • CommentAuthorphilip
    • CommentTimeJul 11th 2007
     
    it's probably your file paths. double-check that the locations are correct (that all files are present and in the same folder).