# Interactive Image Panning

**URL:** <https://forum.kirupa.com/t/interactive-image-panning/317074>\
**Category:** Uncategorized\
**Created:** [December 9, 2010, 5:06pm UTC](https://forum.kirupa.com/t/interactive-image-panning/317074 "2010-12-09T17:06:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wansell](https://avatars.discourse-cdn.com/v4/letter/w/b4bc9f/32.png) [@wansell](https://forum.kirupa.com/u/wansell)\
**Post date:** [December 9, 2010, 5:06pm UTC](https://forum.kirupa.com/t/interactive-image-panning/317074/1 "2010-12-09T17:06:55Z")

</div>

Hello,

I’ve been using the tutorial: [URL=“[http://www.kirupa.com/forum/../developer/flash8/interactive\_image\_pan.htm](http://www.kirupa.com/forum/../developer/flash8/interactive_image_pan.htm)”]Interactive Image Panning, Page 1  
[http://www.kirupa.com/developer/flash8/interactive\_image\_pan.htm](http://www.kirupa.com/developer/flash8/interactive_image_pan.htm)

Which work great, the problem I have I want to add a second movieclip, like a sign post, that pans with the mouse too but at a slower rate.

can any one help modify the code below:

this.onMouseMove = function() {  
constrainedMove(bg\_mc, 4, 1);  
};

function constrainedMove(target:MovieClip, speed:Number, dir:Number) {  
var mousePercent:Number = \_xmouse/Stage.width;  
var mSpeed:Number;  
if (dir == 1) {  
mSpeed = mousePercent;  
} else {  
mSpeed = 1-mousePercent;  
}

target.destX = Math.round(-((target.\_width-Stage.width)_mSpeed));  
target.onEnterFrame = function() {  
if (target.\_x == target.destX) {  
delete target.onEnterFrame;  
} else {  
target.\_x += Math.ceil((target.destX-target.\_x)_(speed/100));  
}  
};

}

Thanks  
Wayne
