www.webdeveloper.com
Results 1 to 2 of 2

Thread: Flash incorporation for non-flash user

  1. #1
    Join Date
    Nov 2002
    Location
    NJ, USA
    Posts
    785

    Flash incorporation for non-flash user

    Originally posted here: http://forums.webdeveloper.com/showt...hreadid=33299, but that forum is rarely visited lately.

    Please, advise.
    Absence of a result is a result, unless defined otherwise.

  2. #2
    Join Date
    Mar 2004
    Location
    Glasgow, Scotland
    Posts
    613
    I use Javascript to detect whether the user has the flash plugin. If they do then I write the <object....etc to display the flash, and if not they can get a flat image.

    Here's the code which you want to modify:
    Code:
    <SCRIPT LANGUAGE="Javascript">
    <!--
    
    var flashinstalled = 0;
    var flashversion = 0;
    MSDetect = "false";
    if (navigator.plugins && navigator.plugins.length)
    {
    	x = navigator.plugins["Shockwave Flash"];
    	if (x)
    	{
    		flashinstalled = 2;
    		if (x.description)
    		{
    			y = x.description;
    			flashversion = y.charAt(y.indexOf('.')-1);
    		}
    	}
    	else
    		flashinstalled = 1;
    	if (navigator.plugins["Shockwave Flash 2.0"])
    	{
    		flashinstalled = 2;
    		flashversion = 2;
    	}
    }
    else if (navigator.mimeTypes && navigator.mimeTypes.length)
    {
    	x = navigator.mimeTypes['application/x-shockwave-flash'];
    	if (x && x.enabledPlugin)
    		flashinstalled = 2;
    	else
    		flashinstalled = 1;
    }
    else
    	MSDetect = "true";
    
    // -->
    </SCRIPT>
    
    <SCRIPT LANGUAGE="VBScript">
    
    on error resume next
    
    If MSDetect = "true" Then
    	For i = 2 to 6
    		If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then
    
    		Else
    			flashinstalled = 2
    			flashversion = i
    		End If
    	Next
    End If
    
    If flashinstalled = 0 Then
    	flashinstalled = 1
    End If
    
    </SCRIPT>
    
    <script language="Javascript">
    
    function isFlash() {
    
       if (flashinstalled == 2) {
         return true;
       } else {
         return false;
       } 
    }
    
    
    if (isFlash()) {
        document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'); // and all the rest....
    
    
    }
    </script>
    Hope this helps
    zing

    | Web Design and Development in Glasgow - 404i |
    | Blog |

    Code:
    -. .-.   .-. .-.   .-. .-.   .-. .-.   .-. .-.
    ||x|||\ /|||x|||\ /|||x|||\ /|||x|||\ /|||x|||\ 
    |/ \|||x|||/ \|||x|||/ \|||x|||/ \|||x|||/ \|||
    '   '-' '-'   '-' '-'   '-' '-'   '-' '-'   '-'

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles