1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Flash Activation Fix for Internet Explorer

Discussion in 'Tech Tips and Reviews' started by deepdiver01, Feb 2, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. deepdiver01

    deepdiver01 Thread Starter

    Joined:
    Dec 22, 2004
    Messages:
    721
    The following code is used to override the necessity to click on a flash object in Internet Explorer to activate it.

    This code is compliments of another help site that specialises in javascript.

    First, create a file and name it fixFlash.js.
    This file can be placed in the public area of your site or, preferrably in a separate folder for your javascript files.

    Paste the following code into the fixFlash.js file:

    Code:
    window.onload = function() {
      fixFlash(); }
        function fixFlash() {
         objects = document.getElementsByTagName("object");
         for (var i = 0; i < objects.length; i++)
       {
      objects[i].outerHTML = objects[i].outerHTML;
    }
    }
    Now place the following code into the HEAD section of your HTML or PHP document.
    You may need to change the path of the file, depending on the name of the folder for your javascripts.

    Code:
    <!-- fixes the Internet Explorer ActiveX update 912812 which prevents third party plugins
     from running automatically -->
    <!--[if IE]>
    <script type="text/javascript" src="js/fixFlash.js"></script>
    <![endif]-->
    I am sure that a lot of you will already have this fix, but for those that do not, I hope this helps.

    I have also posted this tip in the Web Development section of the forums. If this is considered double posting, please feel free to slap my hand and remove the offending post(s). :p

    Cheers.
    Deep.
     
  2. gurutech

    gurutech

    Joined:
    Apr 23, 2004
    Messages:
    2,960
    Is this just a one-time deal, or does this have to be run every time IE is opened, or every time a page is loaded?
     
  3. ferrija1

    ferrija1

    Joined:
    Apr 11, 2006
    Messages:
    7,954
    It is put on the web page, so it is used every time you go to a site with the fix.
     
  4. deepdiver01

    deepdiver01 Thread Starter

    Joined:
    Dec 22, 2004
    Messages:
    721
    Sorry gurutech for not making it clearer.

    As ferrijal mentioned this bit of code is used on your website if you have a flash object on that site.

    The code is added to all pages that have flash on it, and it will over-ride the rubbish that appears on your visitors browser if he/she is using IE. It does give a quick reload of the flash object as the page is opening, but is nothing compared to your visitor having to click on the flash area just to activate it.
     
  5. gurutech

    gurutech

    Joined:
    Apr 23, 2004
    Messages:
    2,960
    Is there anything that a user can do on their end to disable it?
     
  6. ferrija1

    ferrija1

    Joined:
    Apr 11, 2006
    Messages:
    7,954
    Disable the fix? No.

    Fix the IE Flash problem without requiring the web page to have that code on it? Probably no.
     
  7. Jeroen Haan

    Jeroen Haan

    Joined:
    May 3, 2007
    Messages:
    0
    I took me days to find this solution.
    First I had to identify the cause of the problem, trying all kind of complex solutions which only caused more problems.
    I wrote many scripts out of frustration with the existing solutions.

    The original script can be found here:
    http://www.haan.net/test/flash_fix1.php
    and here:
    http://javascript.internet.com/snippets/explorer-object-starter.html

    Again, please maintain the credits.
    Code:
    /* -----------------------------------------------
       Explorer Object Starter - v.1.1
       (c) 2007 www.haan.net
       contact: [email protected]
       You may use this script but please leave the credits on top intact.
       Please inform us of any improvements made.
       When usefull we will add your credits.
      ------------------------------------------------ */
    
    // fixes the Internet Explorer ActiveX update 912812 which prevents third party plugins from running automatically
    
    
    window.onload = function()
    {
    	fixFlash();
    }
    function fixFlash()
    {
    	objects = document.getElementsByTagName("object");
    	for (var i = 0; i < objects.length; i++)
    	{
    		objects[i].outerHTML = objects[i].outerHTML;
    	}
    
    	embed = document.getElementsByTagName("embed");
    	for (var i = 0; i < embed.length; i++)
    	{
    		embed[i].outerHTML = embed[i].outerHTML;
    	}
    }
    
    
     
  8. Jeroen Haan

    Jeroen Haan

    Joined:
    May 3, 2007
    Messages:
    0
    By the way,
    it's better to call the script like this:
    Code:
    <!--[if IE 7]>
    <script language="JavaScript" src="/js/fixFlash.js" type="text/JavaScript"></script>
    <![endif]-->
    
     
  9. deepdiver01

    deepdiver01 Thread Starter

    Joined:
    Dec 22, 2004
    Messages:
    721
    Jeroen.

    My apologies for not including the credits.

    I got the code from the newsletter and there must not have been the credits there. I don't have a copy of the newsletter any more so I cannot double check this.

    Again my apologies for not including your credits.

    If they were, I would have most certainly included them.
     
  10. Jeroen Haan

    Jeroen Haan

    Joined:
    May 3, 2007
    Messages:
    0
    it's okay :)

    I love simple solutions.

    please check out my other scripts on
    www.haan.net/test/

    I will add new ones soon.

    Of course I hope I will get some orders from customers as well.
     
  11. Jeroen Haan

    Jeroen Haan

    Joined:
    May 3, 2007
    Messages:
    0
  12. deepdiver01

    deepdiver01 Thread Starter

    Joined:
    Dec 22, 2004
    Messages:
    721
    Thanks Jeroen.

    Have replied to your PM.
     
  13. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/540592

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice