4 Replies Latest reply on Dec 30, 2006 8:01 AM by kglad

    Create a matrix from MovieClips with a for statement

    Swirlsky
      Hello,
      I try to create a matrix from MovieClips with a for statement but it does not work.
      The code is the following:

      var PicLoader:MovieClipLoader = new MovieClipLoader();

      function createMovieClips() {
      var c:Number = 1;
      var Pic1:MovieClip = new MovieClip;
      var Pic2:MovieClip = new MovieClip;
      var Pic3:MovieClip = new MovieClip;
      var Pic4:MovieClip = new MovieClip;
      var Pic5:MovieClip = new MovieClip;
      var Pic6:MovieClip = new MovieClip;
      var Pic7:MovieClip = new MovieClip;
      var Pic8:MovieClip = new MovieClip;
      var Pic9:MovieClip = new MovieClip;
      var Pic10:MovieClip = new MovieClip;
      var Pic11:MovieClip = new MovieClip;
      var Pic12:MovieClip = new MovieClip;
      var Pic13:MovieClip = new MovieClip;
      var Pic14:MovieClip = new MovieClip;
      var Pic15:MovieClip = new MovieClip;
      var Pic16:MovieClip = new MovieClip;
      for(var i:Number = 1; i <= 4; i++) {
      for(var j:Number = 1; j <= 4; j++) {
      _root.createEmptyMovieClip(eval("Pic" + c), _root.getNextHighestDepth()); eval("Pic" + c)._x = i*100; eval("Pic" + c)._y = j*100;
      _root.PicLoader.loadClip(" http://www.sages.hu/galeria/kepek/kep1.jpg", eval("_root." + eval("Pic" + c)));
      c++;
      }
      }
      }


      createMovieClips();

      What do I wrong?