Detecting Flash

This is a discussion on "Detecting Flash" within the Flash & Multimedia Forum section. This forum, and the thread "Detecting Flash are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Aug 18th, 2003, 16:31
New Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Detecting Flash

<font face="Tahoma">
<font size="2">
<font color="blue">
I've used various techniques for detecting flash and showing different content depending upon whether their browser handles flash or not.

I found one which is flash was installed showed the flash movie, if not then show an image - I have been unable to locate the code - can anyone help me out?

I need it to de done on the same page - no redirect - just if flash then show flash movie else show this image.

Muchos Grassiasos for anyone who can help me out
</font id="blue">
</font id="size2">
</font id="Tahoma">
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Aug 18th, 2003, 19:21
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
This very code is available in the Flash application itself!

Open your movie in flash and go to File > Publish Settings.
Click on the HTML tab and under "Template" select, "Detect for Flash X" where X is the version of flash you want to detect for. If you click on "Info" you will read:
"Uses browser scripting to detect the presence of the Macromedia Flash Player.
If Flash player 6 or above does not exist an image alternative will be loaded."

Ensure you also tell flash to publish either a GIF or JPEG image (your preference) so that the code links to the image flash also produces.

The code produced is the following:

Code: Select all
<SCRIPT LANGUAGE=JavaScript1.1>
<!--
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash]) 
? navigator.mimeTypes["application/x-shockwave-flash].enabledPlugin 
: 0;
if ( plugin ) {
var words = navigator.plugins["Shockwave Flash].description.split(" 
");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i]; 
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 

&& (navigator.appVersion.indexOf("Win") != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from 
IE4.5 Mac by splitting the tag
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." 
& MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}
if ( MM_FlashCanPlay ) {
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" 
');
document.write(' ID="test" WIDTH="550" HEIGHT="400" 
ALIGN="">');
document.write(' <PARAM NAME=movie VALUE="test.swf"> <PARAM 
NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> '); 
document.write(' <EMBED src="test.swf" quality=high bgcolor=#FFFFFF 
');
document.write(' swLiveConnect=FALSE WIDTH="550" HEIGHT="400" 
NAME="test" ALIGN=""');
document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write(' </EMBED>');
document.write(' </OBJECT>');
} else{
document.write('[img]test.jpg[/img]');
}
//-->
</SCRIPT><NOSCRIPT>[img]test.jpg[/img]</NOSCRIPT>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Aug 19th, 2003, 08:38
New Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
<font face="Tahoma">
<font size="2">
<font color="blue">
You da man Sirkent!

Nice one geez
</font id="blue">
</font id="size2">
</font id="Tahoma">
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
detecting, flash

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
wrapper not detecting content saltedm8 Web Page Design 4 Apr 6th, 2008 22:31
Detecting characters between < and > ? Kerosene JavaScript Forum 5 Jan 16th, 2008 16:32
Detecting form navigation amits JavaScript Forum 4 Aug 24th, 2007 16:26
Detecting Browsers and un-registered globals Steve Mellor PHP Forum 4 Apr 18th, 2007 17:26
Detecting JRE version using javascript Nagendra JavaScript Forum 0 Sep 18th, 2006 05:08


All times are GMT. The time now is 22:24.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42