AS3 - Can I have access to the object (or function) who call me?

Posted by lk on Stack Overflow See other posts from Stack Overflow or by lk
Published on 2010-03-15T15:04:14Z Indexed on 2010/03/15 15:09 UTC
Read the original article Hit count: 114

Filed under:
|
|
|

I've asked this same question with Python.

Now I like to know if this can be done in AS3.

If I have something like this:

package
{
    public class SomeClass
    {
        private function A():void { C() }
        private function B():void { C() }

        private function C():void
        {
            // who is the caller, A or B ???
        }

        public function SomeClass()
        {
            A()
            B()
        }
    }
}

Despite the design or other issues, this is only a question of an inquiring mind.

Note: This has to be done without changing C signature
Note 2: I like to have an access to an instance of the caller function so I can call that caller function (if I want to)

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about as3