Sowmya
Sowmya

Reputation: 26969

Redirect to a html page when site opens in non flash browser

How do I redirect to a html page when my flash site opens in non-flash browser?

Here is the code I am curently using

     <link rel="shortcut icon" href="/77east.ico" type="image/x-icon" />
        <!--[if lte IE 8]> 
          <script type="text/javascript">window.location = 'ebrowser.html'</script> 
        <![endif]--> 
        <script type="text/javascript"> 
       if (swfobject.hasFlashPlayerVersion("7.0.0")) {
        // User has flash
    } else {
        // User does not have flash
        window.location="ame.html";
    }
  </script>   
  <link rel="stylesheet" type="text/css" href="css/style.css" /> 
        </head>        
        <body style="background-color:#4B4C4B">
        <div id="pad"></div>
            <div id="content">
        <div style="height:560px; overflow:hidden; width:1000px; margin:0 auto; ">        
        <div style="width:1000px;"><object type="application/x-shockwave-flash" data="index.swf" width="1000" height="500">  <param name="movie" value="index.swf" />  <param name="BGCOLOR" value="#4B4C4B" />  </object></div>
        </div>
        </div>

Upvotes: 2

Views: 6225

Answers (2)

Developer
Developer

Reputation: 2006

You need swfobject.js in your website: http://code.google.com/p/swfobject/

Once the swfobject.js is included, this block should do the trick, just replace noFlash.php with the page you want to load

if (swfobject.hasFlashPlayerVersion("7.0.0")) {
    // User has flash
} else {
    // User does not have flash
    window.location="noFlash.php";
}

This site explains this a bit: http://rossholdway.com/blog/redirect-if-flash-is-not-installed

Upvotes: 2

filype
filype

Reputation: 8380

I would recommend using the JavaScript Flash Detection Library and redirect users with javascript:

<script type="text/javascript"> 
if(!FlashDetect.installed){
    location.href='http://mysite.com/no_flash.html';        
}
</script>   

Upvotes: 1

Related Questions