Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to make SWF work in all Browsers?

    I would like for my flash content to be viewable on all browsers. All files on the server are in the right paths and locally everything works fine so it must be a browser issue. Here is the file...any help would be great...thanks!

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Susan Brewer's Art Gallery</title>


    </head>
    <body bgcolor="#000000">
    <div id="flashcontent"><strong><strong>This content requires Flash Player 9 (or a more recent version).</strong></strong><noscript>Make sure JavaScript is turned on.</noscript><strong>You need to <a href="http://www.adobe.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash" target="_blank"> <span style="text-decoration: underline;">upgrade your Flash Player</span></a></strong></div>
    <table height="100%" width="100%">
    <tbody>
    <tr>
    <td align="center" valign="middle"><!-- normal object code in here - make sure to set a width and height -->
    <div id="DivChainGalleryFX" align="justify"></div>
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">// <![CDATA[
    var flashvars = {};
    var params = {};
    params.base = "";
    params.scale = "noscale";
    params.salign = "tl";
    params.wmode = "transparent";
    params.allowFullScreen = "true";
    params.allowScriptAccess = "always";
    swfobject.embedSWF("ChainGalleryFX.swf", "DivChainGalleryFX", "1000", "800", "9.0.0", false, flashvars, params);
    // ]]></script>
    </td>
    </tr>
    </tbody>
    </table>
    </body>
    </html>

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,603
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Flash will never work in all browsers because not everyone installs Flash in their browser plus some of those who do have it set to not run except when they tell it to so that it will only run on the few pages that they have decided to specifically allow it to run on.

    Then there are those who don't have JavaScript or who have it turned off - although most of these will not have Flash either.

    A single object tag is sufficient to attach Flash to web pages so that it will work in all browsers that have it available - with no JavaScript required. All the messing about was required for IE6 running old versions of Flash.

    Just specify all the required parameters in param tags.

    Code:
    <object data="ChainGalleryFX.swf"
     width="1000" height="800" type="application/x-shockwave-flash">
     <param name="src" value="ChainGalleryFX.swf">
     <param name="quality" value="high">
     <param name="bgcolor" value="#FFFFFF">
     <param name="wmode" value="transparent">
     <param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">
     content for browsers that don't support flash go here
     </object>
    You only need to use swfobject.js if you want to make sure that those without JavaScript cannot see the Flash even if they do have Flash installed.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thank you but one more question :)

    what do you mean in line six of your code by "content goes here for browsers that don't support flash? Sorry...I am new to .js so I am a bit confused...should I replace the code you provided with mine in my html file? Thanks again...I appreciate the help.

    Sarah

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,603
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Quote Originally Posted by soudin View Post
    what do you mean in line six of your code by "content goes here for browsers that don't support flash?
    Sarah
    Not everyone has flash installed in their browser - those that have the object tag execute while those that don't have whatever HTML that you put in place of that text appear instead.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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