ENTER_FRAME's 1 parameter limit

Maybe I’m looking at it the wrong way but I seem to quite often want to have more parameters than just a single function to respond to an event listener… I read this:
http://www.darronschall.com/weblog/archives/000191.cfm
but that seems like a super advanced non-newbie friendly hack for something that seems like it would often be needed.


var myRect = new(rectangle)
stage.addChild(myRect)

moveRect(myRect, 'down', 10) 
/*Here I'd want to make an encapsulated function that, with these parameters at least, would move the rectangle downward 10 times AT THE SPEED OF THE FRAME RATE (1 pixel each time). But once you bring frame rate into the picture, you have to use an ENTER_FRAME listener which only accepts ONE event parameter thus screwing up the parameter structure of the function you're trying to build */

I was able to make a movieclip on the stage move around in the shape of a square, but it is a long way that probably needs encapsulation. If you try to encapsulate though you run into stupid single-parameter-only event problems:


var myRect = new(rectangle);
//udlr stands for up down left or right
var udlr = 'd';
var counter = 0;
stage.addChild(myRect);
stage.addEventListener(Event.ENTER_FRAME, moveRect);
function moveRect(e) {
    if (udlr == 'd') {
        myRect.y +=1;
        if (counter>=10) {
            udlr = 'r';
            counter = 0
        }
    }
    if (udlr == 'r') {
        myRect.x +=1;
        if (counter>=10) {
            udlr = 'u';
            counter = 0
        }
    }
    if (udlr == 'u') {
        myRect.y -=1;
        if (counter>=10) {
            udlr = 'l';
            counter = 0
        }
    }
    if (udlr == 'l') {
        myRect.x -=1;
        if (counter>=10) {
            udlr = 'd';
            counter = 0
        }
    }
    counter++
}