[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

09/23/2003 at 03:35AM PDT, ID: 20746115
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.6

Flash detection code not working in IE

Asked by Serberus in JavaScript

Tags: ie, mm_flashcanplay, write_flash

I've moved the flash detection script that is generated by Flash MX into a function and then called this function onLoad. I've tested the code with several alert boxes. In Internet Explorer the line "var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;" returns 0, this used to work when not in a function. This works fine in Mozilla 1.4

The code:

<script language="Javascript1.1">
<!--
function write_flash(srcFlash, srcStatic, fshHeight, fshWidth, mapName, loop)
{
      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"\>');
            document.write('on error resume next\n');
            document.write('MM_FlashCanPlay = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))');
            document.write('</scr' + 'ipt\>');
      }

      if (loop == true) {
            loopParam = '<param name="loop" value="true">';
            loopCode = '';
      } else {
            loopParam = '<param name="loop" value="false">';
            loopCode = 'loop="false"';
      }

      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="'+mapName+'" width="'+fshWidth+'" height="'+fshHeight+'">');
            document.write('<param name="movie" value="'+srcFlash+'"><param name="menu" value="false"><param name="quality" value="best">');
            document.write('<param name="scale" value="noscale"><param name="bgcolor" value="#000000">'+loopParam);
            document.write('<embed src="'+srcFlash+'" menu="false" quality="best"'+loopCode+' scale="noscale" bgcolor=#000000 ');
            document.write(' swLiveConnect="false" width="'+fshWidth+'" height="'+fshHeight+'" name="'+mapName+'"');
            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="'+srcStatic+'" width="'+fshWidth+'" height="'+fshHeight+'" usemap="#'+mapName+'" border="0">');
      }
}
//-->
</script>

further down the page I call the function with:

<map name="eyes"></map><script language="JavaScript1.1">document.onLoad = write_flash("_flash/eyes.swf", "_images/kmx_eyes.jpg", "91", "203", "eyes", true)</script><noscript><img src="_images/kmx_eyes.jpg" width="203" height="91" usemap="#eyes" border="0"></noscript>

This is weird as all I did was move it inside a function, first without any modification, and it stopped working. I modified it later thinking I could work the problem out but for some reason the "var plugin =..." is not working now in IE.

Any help appreciated. Sorry about the points on this question I've only just registered, will have to earn a few ;)
 
Keywords: Flash detection code not working in IE
 
Loading Advertisement...
 
[+][-]09/23/03 03:57 AM, ID: 9411847

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/23/03 04:16 AM, ID: 9411942

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/23/03 08:57 AM, ID: 9414049

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/23/03 09:32 AM, ID: 9414337

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/23/03 10:10 AM, ID: 9414634

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/23/03 04:20 PM, ID: 9416987

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/23/03 07:11 PM, ID: 9417647

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/24/03 01:08 AM, ID: 9419035

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/24/03 09:22 AM, ID: 9422030

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: ie, mm_flashcanplay, write_flash
Sign Up Now!
Solution Provided By: jonnal
Participating Experts: 3
Solution Grade: A
 
 
[+][-]02/02/04 12:28 PM, ID: 10255496

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/09/04 01:27 PM, ID: 10314590

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91