1 Reply Latest reply on Nov 30, 2006 2:14 AM by tegnegi

    trying to get a target to a movie stored to a variable

      hope i can make myself undestandable
      i have several movieclips in flash that are being trigged by clicking on them

      i'm using 2 variables to store what movieclip is playing and another to store it's path. in the main timeline i declare them and make the 2nd to evalute as a path, using eval(). this works fine, but when i try to use this when i click on the movieclip, the eval dosen't work, making my 2nd variable evaluting to undefined...


      ### on main time line: ###

      var variavel = a;
      var variavel2 = eval(variavel);
      trace (variavel2); //---> results _level0.a

      ### on a clipmovie ###

      _root.variavel = b;
      _root.variavel2 = eval(variavel);
      trace (_root.variavel2); //---> results undefined

      can anyone explain me why? and any solution to this?

      thanks in advance
        • 1. trying to get a target to a movie stored to a variable
          a lil modification in ur movieclip code ll ve ur code working for u ..As u r using ur code on ur movie clip or clips u ve to b very specific about targeting em...for eg u r using _root.variavel = b; in on(Release) the flash wont understand that...either write
          _root.variavel = _root.b or _root.variavel = this.b...change ur movie clip code to the following code n u r done

          on (release) {
          _root.var1 = _root.b;
          _root.var2 = eval(_root.var1);
          //---> results undefined
          i ve used var1 and var2 instead of variavel and variavel2 respectively..hope wid this ur problem ll get solved