when you call the function have it pass itself in as a parameter:

someFunc(this)


function someFunc(caller:Object):Void{
    trace(caller)
}

Therefore who ever calls the function will pass itself into the function. That should work. Victor

----- Original Message ----- From: "Ramon Miguel M. Tayag" <[EMAIL PROTECTED]>
To: "FlashCoders Programming" <[email protected]>
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's say there are two classes:

class A
{
function A(){}

function hello()
{
trace ("hello");
               //I want to know who called me, here
}
}

class Main
{ var a = new A();

function Main()
{
a.hello();
}
}

=========

How will A know that Main called the function?

Thank you,
--
Ramon Miguel M. Tayag
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to