# Mouse out hittest prob

**URL:** <https://forum.kirupa.com/t/mouse-out-hittest-prob/178292>\
**Category:** Uncategorized\
**Created:** [February 9, 2006, 6:09am UTC](https://forum.kirupa.com/t/mouse-out-hittest-prob/178292 "2006-02-09T06:09:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TonyGrgurevic](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@TonyGrgurevic](https://forum.kirupa.com/u/TonyGrgurevic)\
**Post date:** [February 9, 2006, 6:09am UTC](https://forum.kirupa.com/t/mouse-out-hittest-prob/178292/1 "2006-02-09T06:09:19Z")

</div>

I have a movie clip that scrolls side to side when you rollover it but when the mouse is off it continues to scroll - I need the movieclip to slow to a stop when the mouse rolls of the movieclip. I’ve have been playing arounds with the hitest code (red) but this does not fix it…

Its prolly a simple problem - I am not much of a coder…

Can anyone help??

onClipEvent (load)  
{  
xcenter=Stage.width/2;  
speed=3/100;

}

onClipEvent (enterFrame){  
var distance=\_root.\_xmouse-xcenter;  
\_x+=(distance\*speed);  
if (\_x \> 0) \_x=-1640;  
if (\_x \< -1640) \_x=0;

[COLOR=Red] if(hitTest(this.\_xmouse, this.\_ymouse, false))  
{  
speed=1/100;  
}  
else if(hitTest(this.\_xmouse, this.\_ymouse, true))  
{  
speed=31/100;  
}  
[/COLOR]

}
