1 Reply Latest reply on Jan 29, 2007 8:26 AM by Newsgroup_User

    AS 1.0 conversion to work in Flash8

      Hi all,

      i was doing a tutorial for AS, however it was from 2001 so its all the old AS.
      I was trying to get it workin in flash 8 but it gives me this error message :

      **Error** Scene=Scene 1, layer=Action, frame=1:Line 4: Left side of assignment operator must be variable or property.
      eval(eval("mc"+i)+".d") = i*15;

      Total ActionScript Errors: 1 Reported Errors: 1



      The code is:

      mcPos = new Array();
      for (i=0; i<24; i++) {
      duplicateMovieClip("mc", "mc"+i, i);
      eval(eval("mc"+i)+".d") = i*15;
      }
      mc._visible = false;
      fscommand("allowscale", "false");


      does anybody have an idea why it gives me this error ?
      thanks for the help :-D
        • 1. Re: AS 1.0 conversion to work in Flash8
          Level 7
          Kaneon,

          > i was doing a tutorial for AS, however it was from 2001
          > so its all the old AS. I was trying to get it workin in flash
          > 8 but it gives me this error message :
          >
          > **Error** Scene=Scene 1, layer=Action, frame=1:Line 4: Left side of
          > assignment
          > operator must be variable or property.
          > eval(eval("mc"+i)+".d") = i*15;
          >
          > Total ActionScript Errors: 1 Reported Errors: 1

          Aha.

          > does anybody have an idea why it gives me this error ?

          Well ... it's the fact that the left side of your assignment operator
          isn't a variable or property, but it needs to be! ;) It's the particular
          use of eval() here that is the culprit. Consider the array access operator
          instead.

          http://www.quip.net/blog/2006/flash/actionscript-20/reference-objects-dynamically

          These sorts of things can be hard to track down, for sure. The
          replacement for ...

          eval(eval("mc"+i)+".d")

          ... is probably going to be ...

          this["mc" + i].d


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."