Re: [Flashcoders] Which object called the function

2006-10-08 Thread Dan Rogers
Not sure if this is a solution in your case, but you could identify the calling function this way... class Main { function Main() { runHello._id = "Main told me to do it..."; runHello(); } function runHello() {

Re: [Flashcoders] Which object called the function

2006-10-08 Thread Hans Wichman
Hi, i reread my own post and saw it was a bit short:). In general though this was one of the reasons i wrote xflas2. Since its still in alpha (the alpha part is referring to the documentation or lack of it though, not the state of the code, that is pretty solid now), the easiest is to download it

Re: [Flashcoders] Which object called the function

2006-10-08 Thread Hans Wichman
Hi, use xflas2, from osflash/xflas2 :) And check the examples, there is a Logger.markEntry call which will print: ClassA.methodA called from ClassB.methodB. greetz Hans ps i will put more info up soon On 10/8/06, Troy Rollins <[EMAIL PROTECTED]> wrote: On Oct 8, 2006, at 1:47 AM, Ramon Mig

Re: [Flashcoders] Which object called the function

2006-10-07 Thread Troy Rollins
On Oct 8, 2006, at 1:47 AM, Ramon Miguel M. Tayag wrote: Yes, that would work, but is there a way to do it automatically and elegantly? Remember to always do it until it becomes second nature? ;-) This is the way I always do it at least. I don't know of any other reliable way. -- Troy

Re: [Flashcoders] Which object called the function

2006-10-07 Thread Ramon Miguel M. Tayag
Yes, that would work, but is there a way to do it automatically and elegantly? On 10/8/06, Victor Gaudioso <[EMAIL PROTECTED]> wrote: when you call the function have it pass itself in as a parameter: someFunc(this) function someFunc(caller:Object):Void{ trace(caller) } Therefore who eve

Re: [Flashcoders] Which object called the function

2006-10-07 Thread Victor Gaudioso
iguel M. Tayag" <[EMAIL PROTECTED]> To: "FlashCoders Programming" Sent: Saturday, October 07, 2006 11:10 AM Subject: [Flashcoders] Which object called the function Hi everyone, How do you find out which object calls a particular function? Is it even possible? Let&#

Re: [Flashcoders] Which object called the function

2006-10-07 Thread Mark Winterhalder
I then call the function from another timeline. How would I use arguments.caller to return the ID of the object making the call? You can't, at least not directly. arguments.caller will give you a reference to the function from within which your method is called. You can use it to determine if it

Re: [Flashcoders] Which object called the function

2006-10-07 Thread Marc Hoffman
Mischa, Can you give a code example of this? Let's say I have this function on the main timeline: someFunction = function(){ // do something; } I then call the function from another timeline. How would I use arguments.caller to return the ID of the object making the call? Thanks, M

Re: [Flashcoders] Which object called the function

2006-10-07 Thread Marc Hoffman
Yes, Suhas -- but the function is scoped to the timeline in which it was created, not the object doing the calling. So how do you return the ID of the calling object? - Marc At 09:02 AM 10/7/2006, you wrote: Initialise objects with unique ID's which will help you later to determine which ob

Re: [Flashcoders] Which object called the function

2006-10-07 Thread Mischa Williamson
arguments.caller Will give you a reference to the calling function. From the help: Property; refers to the calling function. The value of this property is null if the current function was not called by another function. Cheers, Mischa On 7 Oct 2006, at 17:02, Dr. Suhas Pharkute wrote: Ini

Re: [Flashcoders] Which object called the function

2006-10-07 Thread Dr. Suhas Pharkute
Initialise objects with unique ID's which will help you later to determine which object is calling the function. Suhas On 10/7/06, Ramon Miguel M. Tayag <[EMAIL PROTECTED]> wrote: Hi everyone, How do you find out which object calls a particular function? Is it even possible? Let's say there

Re: [Flashcoders] Which object called the function

2006-10-07 Thread Marc Hoffman
I'd love to know of a solution to this, too. My hack is to give the function an argument "me": // declaration: traceCaller = function(me){ trace (me); } // function call traces full path of calling object.: traceCaller(this); - Marc Hoffman At 08:10 AM 10/7/2006, you wrote: Hi everyo

[Flashcoders] Which object called the function

2006-10-07 Thread Ramon Miguel M. Tayag
Hi everyone, How do you find out which object calls a particular function? Is it even possible? Let's say there are two classes: class A { function A(){} function hello() { trace ("hello"); //I want to know who called me, here