Now say I have 5 other separate functions that can all
possibly call updateText(). Is there a simple way to find out at
runtime which function is calling updateText()?
At the moment what I would do is I would put trace statements
in each of the parent functions to see which function is called
just before updateText(). However, this can be cumbersome in a big
program if you then have to trace the parent's parent function, or
even farther up. That would be a lot of trace statements...
Any help would be greatly appreciated.Functions
How about arguments.caller?
Functions
Note that arguments.caller is not available in ActionScript
3. For AS3 you
would need to pass the calling function as an argument to the
function doing
the trace. (Works for AS1 and AS2 though).
''Raymond Basque''
%26lt;nospam-rbasque-at-jednm-dot-com@nospam.com%26gt; wrote in
message news:f22cof$cgf$1@forums.macromedia.com...
%26gt; How about arguments.caller?
%26gt;
%26gt;
Good point Trevor. I'm not in an AS3 frame of mind.
I'm working in AS2 anyway.
I had never heard of arguments.caller. When I trace it out
however, it just traces out :
[type Function]
Is there any way to get more information, like a function
name?
I think I found the answer to my question.
http://nerdabilly.com/blog/index.php/2007/02/06/a-better-way-to-determine-a-func tions-caller/
No comments:
Post a Comment