0 Replies Latest reply on Mar 30, 2010 4:48 AM by gotoAndExplore

    How can I get JavaScript to detect if flash is installed and then load a different URL?

    gotoAndExplore Level 1

      Hi, I've made two versions of the same site, one in flash and one in HTML, but I want the browser to detect what version of flash is installed, if any and then load the appropriate version of my site. I used to have it so that it displays a HTML message within the same window dependant on the whether the user has the right flash version or not and that used to work perfectly, so I think it must be to do with the changes I made to the if and else statements within the checkFlash() function.

       

      Here's how I've made it so far:

       

      <head>

       

           <script language="javascript"> AC_FL_RunContent = 0; </script>

           <script language="javascript"> DetectFlashVer = 0; </script>

           <script src="scripts/AC_RunActiveContent.js" language="javascript"></script>

           <script language="JavaScript" type="text/javascript">

                var requiredMajorVersion = 9;

                var requiredMinorVersion = 0;

                var requiredRevision = 24;

                var flashContent;

       


                function checkFlash() {

                     var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

                          if (hasRightVersion) {

                               window.open("http://www.yahoo.com");

                          }

                          else {

                               window.open("http://www.google.com");

                          }

                     }

           </script>

      </head>


      <body onLoad="checkFlash()">

      </body>

       

       

      but the checkFlash() function isn't working for some reason, please help, much appreciated.