0

I am so stuck with this I have a full flash site and a HTML5 site (made in Hype) All I want is the index file to detect if Flash is installed, if yes go to the flashsite and if not, then it should, load the html website. Here is my index file. Where do I put the redirect code? Thanks in advance.

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table style="width:766px;height:750px" align="center">
<tr>
<td>
<object classid="00000000000000000000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
    width="766" height="750">
    <param name="movie" value="flash/main_v7.swf"> 
    <param name="quality" value="high">
    <param name="menu" value="false">
    <!--[if !IE]> <-->
    <object data="flash/main_v7.swf"
    width="766" height="750" type="application/xshockwave-flash">
    <param name="quality" value="high">
    <param name="menu" value="false">
    <param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">
    <!--FAIL (the browser should render some flash content, not this).--!>
    </object>
    <!--> <![endif]-->
    </object>
   </td>
   </tr>
  </table>
  </body>
</html>`
Roksalt
  • 481
  • 6
  • 19

2 Answers2

0

You can use Javascript to detect flash on page load and redirect if no flash was detected.

Community
  • 1
  • 1
Vlad
  • 9,526
  • 2
  • 30
  • 37
0

You might want to use SWFObject to load and display flash files. You get a ton of possibilities to control your swf.

Additionally, it will provide you with a hook to detect a missing flash-plugin. You can place an anchor-tag or your redirect code in there and you're good to go.

First, you need a container for your swf. If flash is installed, the content of this container will be overriden. If no flash is detected, the container will remain as defined.

<div id="swfContainer">
   <!-- no flash installed... -->
   <script>
     document.location.href = "somewhereelse.html";
   </script>
</div>

And then insert your SWF using Javascript:

<script type="text/javascript" src="swfobject.js"></script> 
<script type="text/javascript"> 
  // no need to get fancy here...
  var flashvars = {}; 
  var params = {}; 
  var attributes = {}; 

  swfobject.embedSWF("test.swf", "swfContainer", "300", "120", "9.0.0", false,  
                      flashvars, params, attributes); 
 </script>
EinLama
  • 2,226
  • 1
  • 13
  • 10