Question

  • Creator
    Topic
  • #2171111

    Will a Javascript programmer please decipher the following?

    Locked

    by tink! ·

    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document; if((p=n.indexOf(“?”))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i

All Answers

  • Author
    Replies
    • #2887278

      Clarifications

      by tink! ·

      In reply to Will a Javascript programmer please decipher the following?

      Clarifications

    • #2887275

      in fifty words or less

      by robo_dev ·

      In reply to Will a Javascript programmer please decipher the following?

      This is a Macromedia DreamWeaver JavaScript script that specifies the Swap Image behavior for rollovers (and hides the Swap Image function from browsers that don’t support JavaScript).

      adobe DOT com/support/dreamweaver/programs/navbar_overview/navbar_overview04.html

      • #2887272

        Reponse To Answer

        by tink! ·

        In reply to in fifty words or less

        Well then, here I thought the original creators of this webpage were brilliant programmers – only to find out that they were probably using a software that assisted them in creating the scripts. lol.

        What I need to know, since I am reverse engineering this code, is what part does the above code play in the Swap Image process? I already have the other parts that actually do the swapping, I want to know what “object” is this findObj function actually looking for?

        Or – in simpler terms – how does the Rollover script tell which image it needs to swap?

      • #2887263

        Reponse To Answer

        by tink! ·

        In reply to in fifty words or less

        I figured out how to get the rollover script to single out each different rollover…and it has nothing to do with the above script.

        Can you explain the commands that are used in this script?

    • #2887245

      More power to you if you’re reverse engineering JavaScript code

      by robo_dev ·

      In reply to Will a Javascript programmer please decipher the following?

      Most people cannot even forward-engineer it properly 🙂

      Not sure if you’re reverse engineering the function or an app that uses the function?

      I could be 100% making all this up but…..

      At a high level, of course, this a a Macromedia function.

      Not sure if this helps, but, first of all here is the code:
      lab DOT artlung DOT com/mm_validateform/

      justskins DOT com/forums/what-is-function-mm_findobj-69683.html

      Not sure if this is the question you’re asking, but I believe the purpose of this function is to
      create an array with image values so the other functions swap the button images in the toolbar when you rollover them.

      adobe DOT com/support/dreamweaver/programs/navbar_overview/navbar_overview04.html

      • #2887791

        Reponse To Answer

        by tink! ·

        In reply to More power to you if you’re reverse engineering JavaScript code

        Yea, I realized that this was a code created by Adobe, but of course, they do not explain each line. At least not on the pages I visited.

        What I am trying to figure out is: Why this snippet of code is even necessary for the image swap function.

        I was using some reverse engineered functions based on the Image swap code to change text rather than images, and at first could not get it to do more than one line on a page. I thought it might have to do with the FindObj function which the Image Swap functions call, (and my Text functions do not call). But then I figured out that adding unique IDs to my lines allowed them to do the style swapping just fine.

        Sooo, I want to know why does the Image Swap function call for this FindObj function and what is FindObj looking for? 😀

    • #2887228

      Find an Object named ‘[i]n[/i]’ in Document ‘[i]d[/i]’

      by jfdawes ·

      In reply to Will a Javascript programmer please decipher the following?

      It’s not really image related. Short story is It’s trying to find a DOM object that is called whatever is given as the first argument. This is quite similar to the function of getElementById but it provides support for IE4 and will look through a framed document’s parent (under the right conditions) and also recurses through layers.

      You haven’t really said why you need it, but you can perhaps get by with just using getElementById

    • #2887794

      Reponse To Answer

      by tink! ·

      In reply to Will a Javascript programmer please decipher the following?

      Trust me, I usually do google before I come to TR 😀

      I was just trying to go a little quicker by perhaps bypassing some reading. ;D

Viewing 4 reply threads