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

    quimkaos
      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...

      code:

      ### on main time line: ###

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

      ### on a clipmovie ###

      on(release){
      _root.variavel = b;
      _root.variavel2 = eval(variavel);
      trace (_root.variavel2); //---> results undefined
      variavel2.play();
      }

      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
          tegnegi
          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);
          trace(_root.var2);
          //---> results undefined
          _root.var2.play()
          }
          i ve used var1 and var2 instead of variavel and variavel2 respectively..hope wid this ur problem ll get solved