简体   繁体   中英

get object from a method in as3

Is there a way to know from 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM