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?
views:
292answers:
2
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
2010-03-03 19:09:35
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
2010-03-03 20:37:05
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
2010-03-03 19:09:38
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
2010-03-03 20:37:39