Advertisement
Free Mambo Templates - Free Joomla Templates
Joomla Hut HomeContact UsJoomla LinksMambo Forum - Joomla ForumJoomla Downloads
Home
News
Articles
Gallery
Downloads
Tutorials
Site Reviews
Flash Tutorials
Templates Demo
Joomla Links
FAQ
Advertise Here
Search
Advertisement
Seek Your Host
New York Web Design
Joomla Templates
Login Form





Lost Password?
No account yet? Register
Joomla Extensions
Joomla Templates
TemplatePlazza
 
Joomla Website

Flash detection script for Mambo Print E-mail
Written by MamboHut   
Thursday, 01 April 2004

ImageI was working on a template conversion recently and the client ask me if it's possible to differentiate between people who has Flash plug-in installed on their systems and others who don’t, basically to load a static image in place of the flash object used in the template when user doesn't have flash installed. which is perfect for sites that use flash heavily.

So I tested out a few scripts but I found this one to be small, quick and sweet so I decided to share my experience with you. please note that this script only works with major browsers and NOT 100% compatible with all browsers out there. use at your own risk.

click on "Read more" to continue

Add this script where you want flash to appear:

<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="script" WIDTH="300" HEIGHT="200" ALIGN="">');
 document.write(' <PARAM NAME=movie VALUE="script.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  ');
 document.write(' <EMBED src="script.swf" quality=high bgcolor=#FFFFFF  ');
 document.write(' swLiveConnect=FALSE WIDTH="300" HEIGHT="200" NAME="script" 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 SRC="script.gif" WIDTH="300" HEIGHT="200" usemap="#script" BORDER=0>');
}
//-->
</script><NOSCRIPT><IMG SRC="script.gif" WIDTH="300" HEIGHT="200" usemap="#script" BORDER=0></noscript>

Replace script.swf with the (templates/template_name/images/your_flash.swf) and script.gif with (templates/template_name/images/your_image.gif) which will be displayed if the user does not have Flash installed.

Also change the dimension of flash and the image (width and height)

Credits:
http://www.kirupa.com/developer/mx/detection.htm

Please note that The author or Mambohut shall not be held liable for any damages or losses caused by the code listed here.

Comments
Written by visualdensity on 2004-04-02 07:43:21
Great stuff MO! Thanks!
Written by Guest on 2004-06-02 03:51:28
8)
Written by Guest on 2004-06-02 03:51:52
8)
Written by Guest on 2004-07-07 10:48:48
:grin
Written by Guest on 2005-08-09 03:37:26
:grin
Written by Guest on 2005-08-12 13:10:02
8)

Only registered users can write comments.
Please login or register.

Powered by AkoComment 2.0!

 
< Prev   Next >
 
 
Joomla Jobs
 
 
Joomla Flash Tutorials
   
     
Home   |   Contact   |   Links   |   Forum   |   Downloads  |  Media Kit
 

© Copyright 2003 - 2006 by BUYHTTP, LLC. All rights reserved.
None of the text or images in this public website may be copied without the expressed written consent of the authors.
Powered By Joomla!

Joomla Top Sites - Your Primary Source of Joomla Traffic