# How do I stop Pan effect?

**URL:** <https://forum.kirupa.com/t/how-do-i-stop-pan-effect/233143>\
**Category:** flash\
**Created:** [July 20, 2007, 2:38pm UTC](https://forum.kirupa.com/t/how-do-i-stop-pan-effect/233143 "2007-07-20T14:38:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spacezupe](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@spacezupe](https://forum.kirupa.com/u/spacezupe)\
**Post date:** [July 20, 2007, 2:38pm UTC](https://forum.kirupa.com/t/how-do-i-stop-pan-effect/233143/1 "2007-07-20T14:38:03Z")

</div>

Basically, I’m having this huge image that moves around depending on where your mouse is. Awesome, however, I wanted to make some clickable areas that would load in movie clips. **Problem** , the background image still moves around even though you just loaded in a new MC in a new layer.

Here is the code (which I stole from [kirupa.com](http://kirupa.com) tutorials, sorry to the author, I can’t remember your name, but you rawk!)

function imagePan(target:MovieClip, velocity:Number):Void {  
dHori = \_root.\_xmouse / Stage.width, dVert = \_root.\_ymouse / Stage.height;  
hPoint = Math.round(-(rHori \* dHori)), vPoint = Math.round(-(rVert \* dVert));  
rHori = target.\_width - Stage.width, rVert = target.\_height - Stage.height;  
onEnterFrame = function ():Void {  
target.\_x += Math.ceil((hPoint - target.\_x) \* (velocity / 100));  
target.\_y += Math.ceil((vPoint - target.\_y) \* (velocity / 100));  
};  
}  
onMouseMove = function ():Void {  
imagePan(MY\_MC, 5);  
};

\*\*And this is what I put in the button:

\*\*on (release) {  
loadMovie(“pix/design\_popup.swf”,\_root.container);  
imagePan(this.\_parent.MY\_MC, 0);  
}_Any help much appreciated, and hopefully I get to keep my job!_
