# I can't get this to work, i seek assistance

**URL:** https://forum.kirupa.com/t/i-cant-get-this-to-work-i-seek-assistance/234250
**Category:** Uncategorized
**Created:** [July 31, 2007, 7:28pm UTC](https://forum.kirupa.com/t/i-cant-get-this-to-work-i-seek-assistance/234250 "2007-07-31T19:28:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dtrace](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@dtrace](https://forum.kirupa.com/u/dtrace)
#### Post date: [July 31, 2007, 7:28pm UTC](https://forum.kirupa.com/t/i-cant-get-this-to-work-i-seek-assistance/234250/1 "2007-07-31T19:28:23Z")

</div>

I’m trying to modify this image pan tutorial a bit…but it isn’t working.  
[http://www.kirupa.com/developer/flash8/interactive\_image\_pan.htm](http://www.kirupa.com/developer/flash8/interactive_image_pan.htm)  
there are two things that I need to change. The way it currently is…the function is operating on any mousemove. So in other words, whenever you move around the mouse, the strip moves left and right.  
I want to have it so that it is constrained to when you are rolling over a certain MC of thumbnails.  
The other issue, which is related is that the code is using the width of the stage to calculate the move, but because my strip of thumbnails is an MC that is less than the width of the stage,…how can I modify the code to base it’s absolute left and right settings on the thumbnail MC instead of the whole stage.

If you can help me with this, I will be happy.

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 = 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 {  
target.\_x += Math.ceil((target.destX-target.\_x)_(speed/100));  
}  
};  
}
