Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How do I output a default image if there is no Flash plug-in?

Posted on 2007-08-07
8
Medium Priority
?
1,054 Views
Last Modified: 2008-01-09
How do I provide a default image for those who don't have the Flash plugin installed in their browser when they visit a page with a Flash movie?  For example:  I have a page with a Flash movie that transitions block of text on and off the stage.  If a visitor to that page doesn't have Flash, I would like to put a default image of a block of that text in the place whre the movie would have played.  And I want to do that without there even knowing they could have seen a movie if they had the plugin.  Being that this is a home page, I don't want to antogonize visitors with plugin requests when they first come to my site.

I have also posted a similar question for another related instance:  How not to have plugin request or empty movie boxes appear if theydont have Flash installed (and, in that instance, no default image would be displayed either).

I both cases, a non Javascript solution would be preferred so that I dont impose another requirement (JS enabled) but  will certainly take the JS solution if non other exists.

Thanks much!
Peter
0
Comment
Question by:pnowell
  • 3
  • 3
  • 2
8 Comments
 
LVL 11

Accepted Solution

by:
Tom Ray earned 1000 total points
ID: 19650700
swfobject is a great solution.

http://blog.deconcept.com/swfobject/
0
 

Author Comment

by:pnowell
ID: 19650793
Hi Sibqiq,
I will review that site thoroughly.  I know I saw it sometime in the past, but forgot about it.

I'll be back here soon.

Peter
0
 

Author Comment

by:pnowell
ID: 19650800
Oh, do you know if swfoject can work in concert with AC_RunActiveContent.js that Dreamweaver now inludes in Flash objects to keep users from that awful "Press spacebar" to use this plugin as a result of some lawsuit?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 11

Assisted Solution

by:Tom Ray
Tom Ray earned 1000 total points
ID: 19651014
i haven't had a reason to try to do that. swfobject takes care of it all, so i'm not using AC_RunActiveContent.js at all.
0
 
LVL 16

Expert Comment

by:Kiran Paul VJ
ID: 19652042
Good flash detection script here

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


<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 ) {
      window.location.replace("http://www.kirupa.com/flash.htm");
} else{
      window.location.replace("http://www.kirupa.com/noflash.htm");
}
//-->

</SCRIPT>
0
 
LVL 16

Expert Comment

by:Kiran Paul VJ
ID: 19652057
this script from the above link will display flash if flash player is installed else will display a image, just as you need.

<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>



change script.gif to your custom image.

kiranvj
0
 
LVL 16

Expert Comment

by:Kiran Paul VJ
ID: 19657188
hi pnowell,

glad to know you solved the problem.

kiranvj
0
 

Author Comment

by:pnowell
ID: 19657328
Thanks to bothof you for your insights!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question