views:

292

answers:

2

I want to pass an optional data parameter to some callbacks, but only to callbacks that support a single parameter; right now, I have a moderately-sized code base of callbacks that cannot accept a parameter at all. How can I check what parameters a Function object supports?

A: 

If your function is declared in a class use the function describeType it will return an XML you can parse and look at your function name with his arguments

Patrick
It is not; this is a lambda function, passed in as a callback. I can't seem to figure out how to get more information out of it.
Chris R
A: 

The arguments array is an array of all the parameters passed into a function. Maybe that is what you are looking for?

function traceArgArray(x:int):void
{
    for (var i:uint = 0; i < arguments.length; i++)
    {
        trace(arguments[i]);
    }
}

Example taken from livedocs.adobe.com

Robusto
That's not really all that helpful. I know what the arguments are from within the function, I'm looking at how to find out what they are from _outside_ the function's scope.
Chris R