3 Replies Latest reply on Oct 18, 2006 9:29 AM by kglad

    problems creating movie clips

    DZ-015 Level 1
      here's my code:

      for(var i:Number = 1; i <= nTotalPaintings; i++) {
      mcPaintings.createEmptyMovieClip("mcPainting" + i, mcPainting.getNextHighestDepth());
      trace("for loop # " + i);
      mcPaintings.attachMovie("idLoader", "mcLoader" + i, mcPainting.getNextHighestDepth());
      mcPaintings["mcPainting" + i]._y = 0;
      mcPaintings["mcPainting" + i]._x = (i - 1) * 700;
      mcPaintings["mcLoader" + i]._y = 0;
      mcPaintings["mcLoader" + i]._x = (i - 1) * 700;
      trace("mcLoader" + i + " has an _x of " + mcPaintings["mcLoader" + i]._x);
      }

      Going through it line by line in debug mode, the createEmptyMovieClip() and the attachMovie() methods are doing their job... but as each movie clip is replaced by the next. In the end, instead of having 26 movie clips, i only have 1. I have replaced one movie clip with another 25 times!

      what am I doing wrong?

      Thanks!