0 Replies Latest reply on Nov 29, 2007 3:03 PM by MutualFriend.tv

    Interactive Image Panning within a Mask

    MutualFriend.tv
      Hey guys thanks for the help so far. The last piece to the puzzle for me is figuring out how to scroll a movie clip within a mask. I'm currently working with the script taken from the Interactive Image Panning tutorial on kirupa.com as a base. Right now the script references the entire Stage area for scrolling the image whereas I want this to happen just within a mask. How do I set this up. Here is where I have the script right now:


      this.onMouseMove = function() {

      constrainedMove(Work_placeholder, 4, 1);

      };
      function constrainedMove(target:MovieClip, speed:Number, dir:Number) {

      var mousePercent:Number = _xmouse/Stage.height;
      var mSpeed:Number;
      if (dir == 1) {

      mSpeed = 1-mousePercent;

      } else {

      mSpeed = mousePercent;

      }
      target.destY = Math.round(-((target._height-Stage.height)*mSpeed));
      target.onEnterFrame = function() {

      if (target._y == target.destY) {

      delete target.onEnterFrame;

      } else {

      target._y += Math.ceil((target.destY-target._y)*(speed/100));

      }

      };

      }


      ps. the instance name of my mask is Work_mask (movie clip)