Not signed in (Sign In)

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

    • CommentAuthorGeoff
    • CommentTimeDec 19th 2006 edited
     
    Q: SWFObject doesn't work! Help!

    A: Here are some general trouble shooting techniques to help you narrow down your issue:

    1. if your swf doesn't show up on your website:
      1. does the test movie show up on the swfobject test page? http://blog.deconcept.com/swfobject/swfobject.html

      2. are you sure you have the required Flash Player version installed to view your page? You can check your installed Flash Player version with this page.

      3. Do you get any Javascript errors? Try fixing those first.


    2. Some people can see my swf, but other people using Internet Explorer only see the alternate content.
      1. They may have a corrupt install of their Flash Player. Have them run the Adobe Flash Player uninstaller, and then reinstall the latest plugin.


    • CommentAuthorphilip
    • CommentTimeJun 23rd 2007 edited
     
    Q: Can I use SWFObject to embed more than one SWF on my page?

    A: Yes! Here's an example:


    <head>

    <!-- It's usually a good idea to put the SWFObject
    link in the head of your document.
    You only need to include it once! -->

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

    </head>

    <body>

    <!-- use any ID you like, just make sure it's unique
    and matches the Javascript below -->
    <div id="swfOne">
    This text is replaced by the first Flash movie.
    </div>

    <script type="text/javascript">
    //The variable name used here ("so") needs to be unique,
    //so let's add "one" to the name.
    //The SWF ID also needs to be unique: "myMovie" becomes
    //"myFirstMovie" -- you can use any name you like!
    var soOne = new SWFObject("movie1.swf", "myFirstMovie", "400", "200", "8", "#336699");
    soOne.write("swfOne");
    </script>

    <!-- use any ID you like, just make sure it's unique
    and matches the Javascript below -->
    <div id="swfTwo">
    This text is replaced by the second Flash movie.
    </div>

    <script type="text/javascript">
    //The variable name used here ("so") needs to be unique,
    //so let's add "two" to the name.
    //The SWF ID also needs to be unique: "myMovie" becomes
    //"mySecondMovie" -- you can use any name you like!
    var soTwo = new SWFObject("movie2.swf", "mySecondMovie", "400", "200", "8", "#336699");
    soTwo.write("swfOne");
    </script>

    </body>


    You can group the Javascript together if you prefer, just make sure it comes AFTER the target DIV.


    <head>

    <!-- It's usually a good idea to put the SWFObject
    link in the head of your document.
    You only need to include it once! -->

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

    </head>

    <body>

    <!-- use any IDs you like, just make sure they're unique
    and match the Javascript below -->

    <div id="swfOne">
    This text is replaced by the first Flash movie.
    </div>

    <div id="swfTwo">
    This text is replaced by the second Flash movie.
    </div>

    <script type="text/javascript">

    //The variable name used here ("so") needs to be unique,
    //so let's add "one" to the name.
    //The SWF ID also needs to be unique: "myMovie" becomes
    //"myFirstMovie" -- you can use any name you like!
    var soOne = new SWFObject("movie1.swf", "myFirstMovie", "400", "200", "8", "#336699");
    soOne.write("swfOne");

    //The variable name used here ("so") needs to be unique,
    //so let's add "two" to the name.
    //The SWF ID also needs to be unique: "myMovie" becomes
    //"mySecondMovie" -- you can use any name you like!
    var soTwo = new SWFObject("movie2.swf", "mySecondMovie", "400", "200", "8", "#336699");
    soTwo.write("swfOne");

    </script>

    </body>


    You can also use an 'onload' handler if you prefer to take the SWFObject code out of your body markup:


    <head>

    <!-- It's usually a good idea to put the SWFObject
    link in the head of your document.
    You only need to include it once! -->

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

    <script type="text/javascript">
    <!--

    //This function contains your SWFObject instructions.
    //It uses the exact same code as the previous examples.
    function addSwfs(){
    //The variable name used here ("so") needs to be unique,
    //so let's add "one" to the name.
    //The SWF ID also needs to be unique: "myMovie" becomes
    //"myFirstMovie" -- you can use any name you like!
    var soOne = new SWFObject("movie1.swf", "myFirstMovie", "400", "200", "8", "#336699");
    soOne.write("swfOne");

    //The variable name used here ("so") needs to be unique,
    //so let's add "two" to the name.
    //The SWF ID also needs to be unique: "myMovie" becomes
    //"mySecondMovie" -- you can use any name you like!
    var soTwo = new SWFObject("movie2.swf", "mySecondMovie", "400", "200", "8", "#336699");
    soTwo.write("swfOne");
    }


    //This function tells the browser to execute the "addSwfs"
    //functions once the rest of the page has loaded
    window.onload = function(){
    addSwfs();
    }

    -->
    </script>

    </head>

    <body>

    <!-- use any IDs you like, just make sure they're
    unique and match the Javascript in addSwf -->

    <div id="swfOne">
    This text is replaced by the first Flash movie.
    </div>

    <div id="swfTwo">
    This text is replaced by the second Flash movie.
    </div>

    </body>