I am trying to port some javascript to actionscript 3. I am new to javascript, and whereas much of js is familiar, I am having a devil of a time deciphering some js code. A global variable, "action", seems to be defined in a function prototype call, which is then apparently referenced later as a function parameter in the body of the script:

Variable "action" Definition:

```
function SteppedAction(proUpdater, unbrInterval, slInterval) {
}

SteppedAction.prototype.getResult = function 
    SteppedAction_getResult(recipient)
    {
    this.subactions.push({
        action: function(action)
        {
            // function body
        },
        prop: 0
    });
    return this;
};

```

In the body of the script, this same "action" seems to be referenced again in other functions, even though it appears to be defined as a function parameter itself in other anonymous functions and as an argument in the generatePl() function:

```
function generate () {
    activeAction = new SteppedAction(updateProgressUI)
        .executeSubaction(function(action) { ui.progressPanel.show(); }, 0)
        .executeSubaction(function(action) { generatePl(subdivs, 
        dist, count, rate, level, action); });
}

```

I am using Sublime Text to help decipher the javascript, and when I hover over any of the "action" named variables anywhere in the script, whether as function parameters or function call arguments, it references the original "action" in the definition given above. I simply do not understand this. How does a function parameter "know" it is referring to the original variable definition, unless function parameters in anonymous functions can somehow obtain global scope? I do not use anonymous functions normally.

The code for the SteppedAction.executeSubaction() is:

```
SteppedAction.prototype.executeSubaction = function 
    SteppedAction_executeSubaction(subaction, proportion, name) {
    proportion = (typeof(proportion) === "number" && proportion >= 0) ? 
    proportion : 1;
    this.subactions.push({ action: subaction, proportion: proportion, 
    name: name });
    return this;
};

```

Any help would be greatly appreciated.