# Stop animation

**URL:** https://forum.kirupa.com/t/stop-animation/216700
**Category:** Uncategorized
**Created:** [February 19, 2007, 7:53pm UTC](https://forum.kirupa.com/t/stop-animation/216700 "2007-02-19T19:53:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Terry\_elekes](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@Terry\_elekes](https://forum.kirupa.com/u/Terry_elekes)
#### Post date: [February 19, 2007, 7:53pm UTC](https://forum.kirupa.com/t/stop-animation/216700/1 "2007-02-19T19:53:03Z")

</div>

In this code I was playing around with my movieclip. It animates but I am trying to get it to stop when the mouse is on the movieclip. It stops but it jumps back to the start position where I just want it to stop with out jumping back.

onClipEvent (load) {  
move = true;  
}  
onClipEvent (enterFrame) {  
if (\_root.\_xmouse\<286) {  
this.\_x += 5;  
move = true;  
}  
if (\_root.\_xmouse\>287) {  
this.\_x -= 5;  
move = true;  
}  
if (\_root.\_ymouse\>125 & \_root.\_ymouse\<204) {  
this.\_x = move;  
move = false;  
}  
}
