Here's some code to get the name of the currently executing function
dynamically if that's what you're after...

                   var traceTarget:TraceTarget = new TraceTarget();

                   // Log only messages for the classes in the mx.rpc.* and

                   // mx.messaging packages.
                   //traceTarget.filters=["mx.rpc.*","mx.messaging.*"];

                   // Log all log levels.
                   traceTarget.level = LogEventLevel.ALL;

                   // Add date, time, category, and log level to the
output.
                  // This is a bug right now... you can't include both date
and time.
                   traceTarget.includeDate = false;
                   traceTarget.includeTime = true;
                   traceTarget.includeCategory = true;
                   traceTarget.includeLevel = true;
                   traceTarget.filters = ["com.esria.logging"];

                   // Begin logging.

                   var logger:ILogger = Log.getLogger("com.esria.logging");
                   traceTarget.addLogger(logger);

                   Log.addTarget(traceTarget);
                   var d:String =  DateUtil.formatDate(new Date(),
"MM/DD/YYY");
                   var x:XML = describeType(this);
                   var memberName:String = "undefined";
                   var members:XMLList = x.method.(@declaredBy==
this.className);
                   for each(var member:XML in members) {
                       memberName = [EMAIL PROTECTED];
                       if (this[memberName] == arguments.callee)

                        break;
                   }
                   logger.debug("{0}.{1}", this.className, memberName);

Quick note... You should build a hasmap of each classes members that get
returned by (x.method.(@declaredBy==this.className); )  if you plan on using
it more than once to save looping over the classes variable names.

On 12/8/06, Derek Vadneau <[EMAIL PROTECTED]> wrote:

  Funny, I just read that this morning. However, it doesn't really apply
here. I need to pass a function object and the name will probably be
different for each one. So assigning a value to a variable of the class
isn't acceptable, since the value will change for each call.

As I mentioned, I have a workaround, but I really want to know whether the
documentation is correct and I've simply missed something, or Adobe needs to
clean up the docs.



On 12/8/06, Anatole Tartakovsky <[EMAIL PROTECTED] > wrote:
>
>   Please see apply method
> also I posted pre-edited cut from the book here:
> http://flexblog.faratasystems.com/?p=125  - with closure object ala Flex
> 1.5 you can use
>
> Thanks,
> Anatole
>
>
>
>



--

Derek Vadneau

Reply via email to