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() {
var a = new A();
a.hello();
}
}
class A {
function A() {}
function hello() {
trace("hello");
trace(arguments.caller._id);
}
}
-Danro
On Oct 7, 2006, at 8:10 AM, Ramon Miguel M. Tayag wrote:
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
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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