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 was called from an instance of a specific class: Say you have a class A with the method foo. From within method bar of class B you want to determine if it was called from an instance of A. You could test that with if( arguments.caller == A.prototype.foo ). However, it won't help you to find out from which instance of class A it was called. HTH, Mark On 10/7/06, Marc Hoffman <[EMAIL PROTECTED]> wrote:
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, Marc At 09:21 AM 10/7/2006, you wrote: >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: > >>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 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 >> >> >> >>-- >>Dr. Suhas Pharkute, PhD >>Syna Intelligence, LLP >>V. 208 830 8915 (C) >>E. [EMAIL PROTECTED],.com >>W. http://synaintel.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 > >_______________________________________________ >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
_______________________________________________ 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