dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Move on if no Flash installed

  1. #1
    Junior Member
    Join Date
    May 2003
    Posts
    27

    Move on if no Flash installed

    Hi,

    I have a problem regarding Flash detection: I have a Flash introduction which often can not be viewed in offices where Flash and Shockwave are dissabled. How can I make a browser move on to another page (HTML), if Flash is not detected.

    I suppose I need an HTML code for this? Any idea?

    Thanks in advance!

  2. #2
    Senior Member
    Join Date
    Sep 2001
    Location
    Top Shelf
    Posts
    757
    javaScript solution from here

    detection page:
    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">

    <
    html xmlns="http://www/w3/org/TR/xhtml1">
    <
    head>
        <
    title>Dithered Javascript Library Flash Redirect</title>
        <
    meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
        <
    meta name="robots" content="noindex" />
        
        <!-- 
    Start Example Code -->
        
        <
    meta http-equiv="expires" content="0" />
        <
    meta http-equiv="Pragma" content="no-cache" />
        
        <
    script language="javascript" type="text/javascript">
        <!--
        var 
    requiredFlashVersion 4;
        var 
    hasFlashURL 'example_flash.html';
        var 
    upgradeFlashURL 'example_upgrade.html';
        var 
    noFlashURL 'example_noflash.html';
        var 
    dontKnowFlashVersionURL 'example_dontknow.html';
        
    //-->
        
    </script>
        
        <
    script language="javascript" type="text/javascript" src="flash_detect.js">
        <!--
        function 
    getFlashVersion() { return null; };
        
    //-->
        
    </script>
        
        <
    script language="javascript" type="text/javascript" src="flash_redirect.js">
        <!--
        
    location.href dontKnowFlashVersionURL;
        
    //-->
        
    </script>
        
        <
    noscript>
        <
    meta http-equiv="refresh" content="1; URL=example_dontknow.html">
        </
    noscript>
        
        <!-- 
    End Example Code -->

    </
    head>

    <
    body>

    </
    body>
    </
    html
    and "flash_detect.js"

    PHP Code:
    // Flash Version Detector  v1.1.5
    // [url]http://www.dithered.com/javascript/flash_detect/index.html[/url]
    // code by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM)
    // with VBScript code from Alastair Hamilton

    var flashVersion 0;
    function 
    getFlashVersion() {
        var 
    agent navigator.userAgent.toLowerCase(); 
        
       
    // NS3 needs flashVersion to be a local variable
       
    if (agent.indexOf("mozilla/3") != -&& agent.indexOf("msie") == -1) {
          
    flashVersion 0;
       }
       
        
    // NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
        
    if (navigator.plugins != null && navigator.plugins.length 0) {
            var 
    flashPlugin navigator.plugins['Shockwave Flash'];
            if (
    typeof flashPlugin == 'object') { 
                if (
    flashPlugin.description.indexOf('7.') != -1flashVersion 7;
                else if (
    flashPlugin.description.indexOf('6.') != -1flashVersion 6;
                else if (
    flashPlugin.description.indexOf('5.') != -1flashVersion 5;
                else if (
    flashPlugin.description.indexOf('4.') != -1flashVersion 4;
                else if (
    flashPlugin.description.indexOf('3.') != -1flashVersion 3;
            }
        }

        
    // IE4+ Win32:  attempt to create an ActiveX object using VBScript
        
    else if (agent.indexOf("msie") != -&& parseInt(navigator.appVersion) >= && agent.indexOf("win")!=-&& agent.indexOf("16bit")==-1) {
           
    document.write('<scr' 'ipt language="VBScript"\> \n');
            
    document.write('on error resume next \n');
            
    document.write('dim obFlash \n');
            
    document.write('set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.7") \n');
            
    document.write('if IsObject(obFlash) then \n');
            
    document.write('flashVersion = 7 \n');
            
    document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.6") end if \n');
            
    document.write('if flashVersion < 7 and IsObject(obFlash) then \n');
            
    document.write('flashVersion = 6 \n');
            
    document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.5") end if \n');
            
    document.write('if flashVersion < 6 and IsObject(obFlash) then \n');
            
    document.write('flashVersion = 5 \n');
            
    document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.4") end if \n');
            
    document.write('if flashVersion < 5 and IsObject(obFlash) then \n');
            
    document.write('flashVersion = 4 \n');
            
    document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.3") end if \n');
            
    document.write('if flashVersion < 4 and IsObject(obFlash) then \n');
            
    document.write('flashVersion = 3 \n');
            
    document.write('end if');
            
    document.write('</scr' 'ipt\> \n');
      }
            
        
    // WebTV 2.5 supports flash 3
        
    else if (agent.indexOf("webtv/2.5") != -1flashVersion 3;

        
    // older WebTV supports flash 2
        
    else if (agent.indexOf("webtv") != -1flashVersion 2;

        
    // Can't detect in all other cases
        
    else {
            
    flashVersion flashVersion_DONTKNOW;
        }

        return 
    flashVersion;
    }

    flashVersion_DONTKNOW = -1

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397

  4. #4
    Senior Member
    Join Date
    Sep 2001
    Location
    Top Shelf
    Posts
    757
    ahh ja, forgot about that one

  5. #5
    Senior Member
    Join Date
    Nov 2002
    Location
    Maryland, USA
    Posts
    428
    There's also a way to do it through DreamWeaver.

    In DreamWeaver you can have it check if the there is Flash and if it's updated enough for you project.

    If it doesn't meet those requirments it goes to a different URL of you site that you define.

    http://www.macromedia.com/devnet/log...ectionkit.html

  6. #6
    Junior Member
    Join Date
    May 2003
    Posts
    27
    Phantastic!

    The detection kit works wonders

    Thank you all!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center