Possible variable scope issue?

I have the following code, where rolloverButtons is a 2-dimensional array.

for (i = 0; i < rolloverButtons.length; i++)
{
    rolloverButtons*[0].onRollOut = function()
    {
        rolloverButtons*[1]._something = something;
    }
}

The problem is that within the function called by the onRollOut event, the counter variable i is not recognized, therefore the reference to the movie stored in that element of the array is not recognized. Is there some way to get the value of i into that inner function?

The reason I am using a loop for this is because I have 10 buttons, and don’t want to have to write out 10 different functions to control how they behave. Perhaps there is another way of achieving this goal?

Thanks in advance…