Hi,
I'm looking for a way to obtain the name of method, given a Function object.
For instance, inside a method, I can obtain a reference to the method by
calling
arguments.callee. But how do I then obtain from the Function object the
function's name:
public function testFunction():void {
var f:Function = arguments.callee;
// How do I get f's name (e.g., "testFunction") here?
}
I was thinking of iterating through the object's properties, and finding if a
given property
is the function itself, but this only works for methods dynamically added to
the object:
public function testFunction():void {
var f:Function = arguments.callee;
for (var p:String in this) {
if (f == this[p]) {
// Function name is p
}
}
}
Again, this doesn't work.
Any suggestions would be appreciated.
Thanks,
-- Frank