# Interactive Image Panning

**URL:** https://forum.kirupa.com/t/interactive-image-panning/287902
**Category:** Uncategorized
**Created:** [May 7, 2009, 4:14pm UTC](https://forum.kirupa.com/t/interactive-image-panning/287902 "2009-05-07T16:14:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rudeando](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@rudeando](https://forum.kirupa.com/u/rudeando)
#### Post date: [May 7, 2009, 4:14pm UTC](https://forum.kirupa.com/t/interactive-image-panning/287902/1 "2009-05-07T16:14:11Z")

</div>

hello people. i hope you can help me with this…

im trying to make a interactive panning with the tutorial **[Interactive Image Panning, Page 1](http://www.kirupa.com/forum/../developer/flash8/interactive_image_pan.htm)** but this swf loads in a main swf… the code i am using for the panning swf is

this.onMouseMove = function() {  
constrainedMove(bg\_mc, 8, 8);  
};  
function constrainedMove(target:MovieClip, speed:Number, dir:Number) {  
var mousePercent:Number = \_xmouse/Stage.width;  
var mSpeed:Number;  
if (dir == 1) {  
mSpeed = 1-mousePercent;  
} else {  
mSpeed = mousePercent;  
}  
target.destX = Math.round(-((target.\_width-Stage.width)_mSpeed));  
target.onEnterFrame = function() {  
if (target.\_x == target.destX) {  
delete target.onEnterFrame;  
} else if (target.\_x\>target.destX) {  
target.\_x -= Math.ceil((target.\_x-target.destX)_(speed/100));  
} else if (target.\_x\<target.destX) {  
target.\_x += Math.ceil((target.destX-target.\_x)\*(speed/100));  
}  
};  
}

the problem im having is that the panning swf is using the with of the main swf that is holding it :S …

can someone please give me a clue of how can i modify it!!

thnx & regards design gurus!
