Flash Redirect - Installation

  1. Copy and paste the following code into the head of the document you want to use the script in (Note: since the redirection occurs almost instantly, don't expect anything else in this document to be visible for long. It is probably best to create a page exclusively for the detection / redirection with no content.):

    <meta http-equiv="expires" content="0" />
    <meta http-equiv="Pragma" content="no-cache" />
    <script type="text/javascript">
    var requiredFlashVersion = 5;
    var hasFlashURL = 'flash.html';
    var upgradeFlashURL  = 'upgradeflash.html';
    var noFlashURL  = 'noflash.html';
    var dontKnowFlashVersionURL = 'dontknowflash.html';
    <script type="text/javascript" src="flash_detect.js">
    function getFlashVersion() { return null; };
    <script type="text/javascript" src="flash_redirect.js">
    location.href = dontKnowFlashVersionURL;
    <meta http-equiv="refresh" content="1; URL=dontknowflash.html">

    The first <script> tag contains the names of the destination HTML pages. The second <script> tells the browser where to find the script file and contains some dummy code to prevent errors in older browsers (Netscape 2 and IE 3). If the flash_redirect.js file is in a different directory than the html document, be sure to include the relative path to the Javascript file in the src attribute value of the second <script> tag.

  2. Change the value of requiredFlashVersion (above, it is set to 5) in the first script. Set this to the minimum Flash version number that you want to support. It should be either 3, 4, 5, or 6. In the above code, visitors with Flash 5 or above will be redirected to the Flash page while visitors with Flash version 3 or 4 will be sent to the upgrade page.

  3. Change the values enclosed in quotes in the first script. These are the urls that visitors will be sent to depending on their plugins. The first line specifies the url for visitors with the required Flash version or higher installed. The second line specifies the url for visitors with a version of Flash below the required version. The third line specifies the page that non-Flash browsers will be sent to. There is the possibility that the detection routine can't detect whether or not Flash is present. The fourth line gives the url that visitors are sent in this case. When changing these values, leave the quotes. All urls must be relative to the containing HTML document.

  4. Change the url that follows URL= in the <meta> tag to the same url as the last line in the first script. This line is for visitors with Javascript turned off.

  5. Have a nice day.

More about this script

Related to this script


This script is released under a Creative Commons License.