Thanks. I wonder how the describeType() function does its work... that seems to have access to some reflective information about a class.
Actually, I have a system that uses BlazeDS for remote calls. What I'd like to do is to be able to automatically proxy server-side classes: given a method name on the local proxy, I want to be able automatically dispatch a remote method with the same name and same arguments to the server. The calls are made asynchronously and dispatch events when they return. Right now I have to refer to the current method name with a String. That's duplicate information, and also doesn't enforce that the local and remote method names are the same. I'd hate to use code generation for this, so if a Function.name property existed, that'd do the trick. Thanks, -- Frank --- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote: > > I bet you are trying to find a nifty way to log your code's processing, > right? This comes up a lot and really, there is no good way to do it. > > > > You might try the archives, in case I missed something, but if I'd ever > heard a good solution I would have used it myself. > > > > Tracy > > > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of frank_sommers > Sent: Thursday, September 25, 2008 12:39 AM > To: [email protected] > Subject: [flexcoders] Obtaining name of method > > > > 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 >

