2 Replies Latest reply on Mar 21, 2007 8:49 AM by essaeyu

    Cant duplicate movies in loop

    essaeyu
      Hi,

      I want to duplicate movieclips in a loop. Once a movie clip is created, I cant access it to assign properties. I have tried many ways but couldn’t go through. The code is as follows:

      First code:

      var newMovie;
      for (i = 1; i < 5; i++)
      {
      newMovie = "mc_answer_" + i;
      duplicateMovieClip("original_movie",newMovie,i);
      newMovie._x = 300 + (i*2);
      }

      Second code:

      for (i = 1; i < 5; i++)
      {
      duplicateMovieClip("original_movie","mc_answer_" + i, i);
      ["mc_answer_" + i]._x = 300 + (i*2); // gives syntax error
      }



      I know its trivial and there is a syntax mistake that I am making. Can anyone help?

      Thanks,

      Essaeyu