3 Replies Latest reply on Feb 22, 2011 5:29 AM by Ned Murphy

    Flash tween class, more than one tween for a movieclip?

    prodigalmaster Level 2

      EDIT:

      for (i=0; i<humans; i++) {
              ranDistX = Math.floor(Math.random()*(20-(-20+1)))+-20;
           ranDistY = Math.floor(Math.random()*(20-(-20+1)))+-20;
           var humansMoving = new Tween(_root["human"+i], "_x", Linear, _root["human"+i]._x, _root["human"+i]._x+ranDistX, 2, true);
           var humansMoving = new Tween(_root["human"+i], "_y", Linear, _root["human"+i]._y, _root["human"+i]._y+ranDistY, 2, true);
      
           humansMoving.onMotionFinished = function() {
                humansMoving.start();
                ranDistX = Math.floor(Math.random()*(20-(-20+1)))+-20;
                ranDistY = Math.floor(Math.random()*(20-(-20+1)))+-20;
           };
      }
      
      

       

      The tween works only once. I need it so when the tween is finished, it does the same tween(with a different random number(different position)), however after the first two tweens (x and y) have finished the movieclips just sit there. Anyone know how to do this?