dcsimg
www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Get rid of "Active x control, click to activate"

  1. #1
    Join Date
    Aug 2006
    Posts
    185

    Get rid of "Active x control, click to activate"

    Everyone must have seen it. Anything to do with flash, windows movies, al, on the internet, you have to click to use them first, to deactivate that random box.

    The thing is, i'm going to be using flash on my site, so how do i get rid of this problem, and i know it can be done, as i have found many sites on this, but they seem to be either too confusing or don't work.

    So, can anyone help?

    thanks, Ryan.

  2. #2
    Join Date
    Aug 2006
    Posts
    7
    yes i found this code somewhere.

    First open notpade and write in it:


    /-----------------------------------------------------------
    / ActiveX Object Workaround

    function reActiveX()
    {
    // Test user agent
    var strAgent = navigator.userAgent.toUpperCase();
    var nIEIdx = strAgent.indexOf("MSIE");
    if (nIEIdx == -1)
    {
    // If user agent does not look like IE, return -- this is not needed.
    return;
    }

    // Build arrays of elements to rewrite
    var doaEmbeds = document.getElementsByTagName("embed");
    var doaObjects = document.getElementsByTagName("object");
    var doaApplets = document.getElementsByTagName("applet");

    // Iterate through objects, rewriting as we go
    // EMBED
    for (var raxi = 0; raxi < doaEmbeds.length; raxi++ )
    {
    var doRewriteObj = doaDomObjsToRewrite[raxi];
    var doParentObj = doRewriteObj.parentNode;

    var strHTML = doParentObj.innerHTML;

    doParentObj.removeChild(doRewriteObj);
    doParentObj.innerHTML = strHTML;
    }
    // OBJECT
    for (var raxj = 0; raxj < doaObjects.length; raxj++ )
    {
    var doRewriteObj = doaObjects[raxj];
    var doParentObj = doRewriteObj.parentNode;

    var strHTML = doParentObj.innerHTML;

    doParentObj.removeChild(doRewriteObj);
    doParentObj.innerHTML = strHTML;
    }
    // APPLET
    for (var raxk = 0; raxk < doaApplets.length; raxk++ )
    {
    var doRewriteObj = doaApplets[raxk];
    var doParentObj = doRewriteObj.parentNode;

    var strHTML = doParentObj.innerHTML;

    doParentObj.removeChild(doRewriteObj);
    doParentObj.innerHTML = strHTML;
    }

    return;
    }

    /-----------------------------------------------------------


    Now save that as reactivex.js (save as type: all files)
    then put that file in your website folder and add this little bit of cose to the end of the html in every page:

    <SCRIPT TYPE="text/javascript" SRC="reactivex.js"></SCRIPT>
    <SCRIPT TYPE="text/javascript">
    reActiveX();
    </SCRIPT>


    That should work - sorry to whoever wrote the script, I can't remember where I found it.




    ------------
    Web Design: www.hertfordshire-web-design.co.uk

  3. #3
    Join Date
    Aug 2006
    Posts
    185
    Unfortunately, this isn't working.

    I've done exactly what you have said, but it doesn't work

    Hope you can help!

    thanks, Ryan.

  4. #4
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,972
    Whenever you come along with a question that is a variation on "how do I cut out a browsers security/whatever features for my own convinience", you're not going to come across a great awnser.

    Now then, a plain old flash object isn't going to bring up MSIEs warning. It's going to be the way that it interacts with other scripting on the page or the action script that the flash file uses.

  5. #5
    Join Date
    Aug 2006
    Posts
    7

    re: flash

    The method I showed activates the flash automatically so that the box doesnt appear around it. You can see it working with the flash insert on my website: www.hertfordshire-web-design.co.uk

    The js file is located at :
    http://www.hertfordshire-web-design.co.uk/reactivex.js


    And if you view the source for that page you will see the code I mentioned just before the </html> right at the end, make sure you have put it in the same place on your pages. Give it another go as you can see it works there.





    -------------------------
    Web Design: www.hertfordshire-web-design.co.uk

  6. #6
    Join Date
    Aug 2006
    Posts
    185
    By saying "put the codea t then end of every page", do you mean in between the last body and html tags or what?

    thanks, Ryan.

  7. #7
    Join Date
    Aug 2006
    Posts
    185
    Here's what i'm getting on the page http://www.tophitsradio.co.uk/Tester%20Page.html

    Two strange erors. Hope you can help!

    thanks, Ryan.

  8. #8
    Join Date
    Aug 2006
    Posts
    7
    It took me a long to work that one out. What youve done is missed out the capital letters in reActiveX(); in the html code:

    <SCRIPT src="reactivex.js"
    type=text/javascript></SCRIPT>
    <SCRIPT type=text/javascript>
    reActiveX();
    </SCRIPT>


    Hopefully that will sort it.




    ----------------------------
    Web Design: www.hertfordshire-web-design.co.uk

  9. #9
    Join Date
    Dec 2005
    Posts
    4

    error in trying to implement reActiveX() code

    Hi - I found your solution to ActiveX problems and have tried to implement your solution in my code. However, I receive the error "object expected" on the line "reActiveX();" that's added to the html document. What I am doing wrong? I copied your code verbatim. Thanks,

    Selene

  10. #10
    Join Date
    Aug 2006
    Posts
    7
    upload it and post the link and I'll have a look at it.

  11. #11
    Join Date
    Oct 2006
    Posts
    1

    Got it to work!

    Thanks! Your solution worked perfectly for me....

    For those who still can't get it, make sure you're referencing the right directory (where you have the javascript file saved) in the line:

    ...
    SRC="js/reactivex.js"
    ...

    Also make sure you uploaded the javascript file and given it the correct permissions so it can be accessed.

    Thanks fluidstudios!

    -Jon

  12. #12
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    Note that Internet Explorer is not the only browser that requires such activation. The court ruling in favour of Eolas require that all browsers should require such activation for all embedded objects although Eolas gave Firefox an exemption due to its being open source. All other browsers such as Netscape, Opera, Safari, etc will therefore have the same activation issue (if not with the current version then with the next version once they fall into line with the court ruling).

  13. #13
    Join Date
    Nov 2006
    Location
    Louisville, Ky
    Posts
    1

    Problem with Browsers

    Hi! I tried your code in my website, and it worked perfectly in IE and Firefox, but the website won't open in Netscape with the js. script that gets rid of the Active x control. It previously worked in the Netscape, too.

    Any ideas?

    Thanks, Evie
    new web designer in Kentucky

  14. #14
    Join Date
    Feb 2007
    Posts
    1

    Talking click to activate box

    Thank you much!!! that worked perfect
    www.sandiacasino.com



    Quote Originally Posted by fluidstudios
    The method I showed activates the flash automatically so that the box doesnt appear around it. You can see it working with the flash insert on my website: www.hertfordshire-web-design.co.uk

    The js file is located at :
    http://www.hertfordshire-web-design.co.uk/reactivex.js


    And if you view the source for that page you will see the code I mentioned just before the </html> right at the end, make sure you have put it in the same place on your pages. Give it another go as you can see it works there.





    -------------------------
    Web Design: www.hertfordshire-web-design.co.uk

  15. #15
    Join Date
    Apr 2008
    Posts
    2
    i tried this, it is working but after running of this function

    flash to html communication is not working

    i want this please

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles