Passing a function as an argument

Hi everybody,

My question is slightly complicated : I have a global function that does some stuff with a LoadVars in it.
I 90% of the cases, the onLoad reference of the LoadVars is the same, but I sometimes need to do something else when the LoadVars is loaded.

Is there a way to pass a function reference to a function so that I could do something like that :

[AS]
_global.function myFunction(maybeFunction)
{
myLoadVars = new LoadVars();
if (maybeFunction != undefined)
myLoadVars.onLoad = maybeFunction;
else
myLoadVars.onLoad = function(ok)
{
[…]
}

myLoadVars.load("…");
}
[/AS]

If not, any other Idea ?