# Interactive Image Panning within a Mask

**URL:** <https://forum.kirupa.com/t/interactive-image-panning-within-a-mask/245462>\
**Category:** flash\
**Created:** [November 29, 2007, 10:55pm UTC](https://forum.kirupa.com/t/interactive-image-panning-within-a-mask/245462 "2007-11-29T22:55:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AK\_Luv](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@AK\_Luv](https://forum.kirupa.com/u/AK_Luv)\
**Post date:** [November 29, 2007, 10:55pm UTC](https://forum.kirupa.com/t/interactive-image-panning-within-a-mask/245462/1 "2007-11-29T22:55:25Z")

</div>

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 this site 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)
