2 Replies Latest reply on Nov 14, 2008 12:57 PM by garydg

    duplicate mc problem

    garydg
      Hello

      I am creating a flash file that duplicates a mc (jclip_mc) every few seconds or so on random places on the screen. This works.
      I would also like to scale the mc depending on where on the screen it appears. If it appears on the upper half, it should scale 50%. On the lower half, no scale. This I can't make to work. The code is below.


      mycount = 0;
      function createjclip_mc() {
      if (mycount<50) {
      _root.jclip_mc.duplicateMovieClip("jclip_mc"+mycount,_root.getNextHighestDepth());
      randomX = 500*Math.random() + 100;
      randomY = 300*Math.random() + 100;
      eval("jclip_mc"+mycount)._x = randomX;
      eval("jclip_mc"+mycount)._y = randomY;
      mycount++;

      newmcname = ("jclip_mc"+mycount);
      if (randomY < 250) {
      _root.newmcname._yscale=50;
      _root.newmcname._xscale=50;

      } else {
      _root.newmcname._yscale=100;
      _root.newmcname._xscale=100;
      }
      } else {
      clearInterval(ID);
      for(var i = 0;i<50;i++){
      removeMovieClip(eval("jclip_mc"+i));
      }
      }
      }
      ID = setInterval(createjclip_mc,4000);


      I figured if I do this; newmcname = ("jclip_mc"+mycount);
      to refer to the new mc name in the conditional if/else, it would work, but it doesn't.

      Any help would be greatly appreciated.