Menu

get the name of the function currently assign

Help
cilohaidem
2005-11-05
2013-04-17
  • cilohaidem

    cilohaidem - 2005-11-05

    hi,
    im not sure does the as2lib solution can help here  but ,,,
    say, i have this two methods in my class which extends MovieClip,  and i want to be able to set and GET the onRelease handler on runt time. Most important i wont to set it, based on the current function Name assigend to the onRelease, so i need tho know/get the name of the function witch is currently assigned to the onrelease.

    Can ReflectionUtil help?

    public function setOnRelease(func:Function):Void {
            this.onRelease = func;
        }
        public function getOnRelease():Function {
    //HOW To GET THE NAME OF THE FUNCTION CURRENTLY ASSIGNED TO onRelease
            trace(this.onRelease._name);
            return this.onRelease;
        }

     
    • cilohaidem

      cilohaidem - 2005-11-05

      sorry i found the  solution :)

      trace(ReflectUtil.getMethodName(this.onRelease, this));

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.