get object from a method in as3
Is there a way to know fr开发者_如何转开发om which object a method (a Function object) came from? tx
The keyword "this" will give you the object the method ("function") is located (unless you are using delegates.)
You can use arguments.callee to get a reference to the current function, but there's no arguments.caller to get the object calling your function. You'll have to pass that object as an argument.
http://livedocs.adobe.com/flex/2/langref/arguments.html#callee
Not altogether orthodox, nor efficient, but you could play around with this overflow user's original post:
StackTrace in Flash / ActionScript 3.0
精彩评论