2 Replies Latest reply on Sep 15, 2006 1:30 PM by andymorris

    limit the movement of movieclip

    andymorris
      Can anyone help? I have a movie clip that moves along the y axis at increments of 435 pixels controlled by up and down buttons , this works fine, but I need to somehow limit the maximum distance it can travel in either direction.
      at the moment it moves off the stage in either direction.

      I hope thats clear, here's the code it may explain what I am trying to achieve better

      pixels = 435;
      up_bt.onRelease = function() {
      tweenmc();
      };
      function tweenmc() {
      easeType = mx.transitions.easing.Regular.easeInOut;
      var begin = thumbs._y;
      var end = thumbs._y-pixels;
      var time = .9;
      var mc = thumbs;
      Tween = new mx.transitions.Tween(mc, "_y", easeType, begin, end, time, true);
      }
      down_bt.onRelease = function() {
      tweenmcreverse();
      };
      function tweenmcreverse() {
      easeType = mx.transitions.easing.Regular.easeInOut;
      var begin = thumbs._y;
      var end = thumbs._y+pixels;
      var time = .9;
      var mc = thumbs;
      Tween = new mx.transitions.Tween(mc, "_y", easeType, begin, end, time, true);
      }

      any help would be appreciated.