Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Anita Thagaard Kristensen 33 posts 53 karma points
    Aug 19, 2010 @ 16:23
    Anita Thagaard Kristensen
    0

    How to redirect to a new page if no flashplayer

    Hi

    I need help to redirect people that use my homepage and don't have Flashplayer installed. My idea is that they should be redirected to a page with no flash on.

    my code look like this :

    <script type="text/javascript" src="swfobject.js"></script>
    <!--Checking for flashplayer-->
    <div>
     <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="myFlashContent">
     <param name="movie" value="untitled.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="untitled.swf" width="800" height="600">
      <!--<![endif]-->
      <a href="/en/industry-division.aspx">
      <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
      </a>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
     </object>
    </div>

    But instead of link to get the flashplayer I want them to atomatic get to the page without flash.

    Can anyone help me with the code for that??

    Anita

  • Donald St. Martin 83 posts 128 karma points
    Aug 19, 2010 @ 16:50
    Donald St. Martin
    0

    Anita,

    I haven't tested it but something like this should work: (Note: This uses swfobject 2)

    <div id="myContent">
         
    <p>Alternative content</p>
    </div>

    <script type="text/javascript">

    var flashvars = {};
    var params = {};
    var attributes = {};

    if(swfobject.hasFlashPlayerVersion("8.0.0")){
        swfobject.embedSWF("untitled.swf", "myContent", "800", "600", "9.0.0","expressInstall.swf", flashvars, params, attributes);
    }
    else {
        window.location = "http://umbraco.org";
    }

    </script>

    swfobject documentation: http://code.google.com/p/swfobject/wiki/documentation

    Hope this helps,

    --
    Donald

  • Anita Thagaard Kristensen 33 posts 53 karma points
    Aug 19, 2010 @ 17:30
    Anita Thagaard Kristensen
    0

    Hi Donald

    Thanks for your quick reply.

    It was excatly what I was looking for. Now I just have to figure out, how to put it into a macro running the menu bar. :-)

    Anita

  • Sascha Wolter 615 posts 1101 karma points
    Aug 21, 2010 @ 01:52
    Sascha Wolter
    0

    Hi Anita,

    alternatively you can use the noscript> tags to output content that doesn't need JS/Flash, this way you can have both content on one page.

    Just thought I might post an alternative, Donald's solution will work fine though.

    Cheers,
    Sascha

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies