4 Replies Latest reply on Sep 25, 2008 5:29 AM by Newsgroup_User

    Cannot call functions with this[]

    Level 7

      I'm in trouble because I need to call functions from MCs with a variable

      I tried to use this[] that should do the trick, but it doesn't.

      Here's what I did in code to try to debug :

      - trace what's inside the this[]
      - the actual this[]
      - a cut and paste of the above trace() with the function call

      Of course, both "hardcoded" calls work..; what am I doing wrong ?

      Here's the code :

      trace(_parent + "." + buttonName);
      trace("_parent." + buttonName);
      this[_parent + "." + buttonName].setBtnState("test1");
      this["_parent." + buttonName].setBtnState("test2");

      What am I supposed to feed this[] with ? Path as a string ?

      Thanks in advance.