[flexcoders] Get name of function from within the function? Get arguments for any function?

2010-04-05 Thread tntomek
I'm trying to get 2 things: 1) Name of current function 2) Get list of arguments for some arbitrary function Is this possible? Here is an example: someMethod("jack", someCallback); - function someMethod(name:String, callback:Function) { // from here I'd li

Re: [flexcoders] Get name of function from within the function? Get arguments for any function?

2010-04-05 Thread Alex Harui
With a debug SWF, you can get the name but not in production. I don’t know of a way to get the parameters. On 4/5/10 8:10 AM, "tntomek" wrote: I'm trying to get 2 things: 1) Name of current function 2) Get list of arguments for some arbitrary function Is this possible? Here is an examp

Re: [flexcoders] Get name of function from within the function? Get arguments for any function?

2010-04-05 Thread Robert VanCuren Jr
You can use the arguments class to get some of this info. http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/arguments.html#propertySummary for example arguments.callee returns a reference to the cur

Re: [flexcoders] Get name of function from within the function? Get arguments for any function?

2010-04-05 Thread Oleg Sivokon
Just adding to what Alex said: parameters' names don't exist in compiled SWF, they are referenced by indices (when the function starts, the parameters are pushed to the stack and just follow the stack logic). So, no, reflection can only tell you the number of parameters used (you can get it from my