Q. How do I detect a Flash plugin?
A. Here is a JavaScript-free way of detecting if the client has a Flash plugin:
Step 1: Create a new Flash movie. Make the size 18px by 18px, this being the smallest possible size.
Step 2: Click on the first frame and click on the âAdd Behaviorâ button. Go to Web -> Go to Web Page.
Step 3: Enter the URL of your Flash-enabled page. Click OK.
Step 4: Publish the movie. Embed it in the body of the page you want to detect Flash on.
Step 5: In the <head> of the same page, add this line of HTML, replacing the given URL with your Flash-free page:
<meta http-equiv=refresh content=4;url=noflashpage.html>
So your page should end up looking somewhat like this:
Code:
<html>
<head>
<title>Detecting Flash</title>
<meta http-equiv=refresh content=0;url=noflashpage.html>
</head>
<body>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
width="18" height="18" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flashdetector.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="flashdetector.swf" quality="high" width="18"
height="18" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>
Hereâs how it works:
When the Flash movie loads, it tries to redirect to the Flash-enabled page. If Flash is not enabled, the Flash movie is never run. The META tag waits 4 seconds (you can change this time to what you think is appropriate) before redirecting to the Flash-less page, giving the Flash movie time to load.
Snib
<><