# \[Flash8\] mouse triggers animation

**URL:** <https://forum.kirupa.com/t/flash8-mouse-triggers-animation/252436>\
**Category:** flash\
**Created:** [February 20, 2008, 4:29am UTC](https://forum.kirupa.com/t/flash8-mouse-triggers-animation/252436 "2008-02-20T04:29:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![trippel](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/trippel/32/3119_2.png) [@trippel](https://forum.kirupa.com/u/trippel)\
**Post date:** [February 20, 2008, 4:29am UTC](https://forum.kirupa.com/t/flash8-mouse-triggers-animation/252436/1 "2008-02-20T04:29:17Z")

</div>

Hello gurus, (or is it guri?)

Basically I want to have something pop-up, and stay up on when the mouse moves to a side of the swf, but it re-animates the pop-up motion when the mouse is moved even after it is on one side. Here is the script I wrote for it: (left\_motion is the mc that has the animation.)

onMouseMove = function() {  
if (\_xmouse \<= 300) {  
left\_motion.gotoAndPlay(“up”);  
trace(“mouse is on the left”);  
}  
if (\_xmouse \>= 301) {  
left\_motion.gotoAndPlay(“down”);  
trace(“mouse is on the right”);  
}  
};

So what I’m wondering is, how do I have the pop-up animation happen only when the mouse has changed from the right to the left, and vice versa (sides determined by the x position of the mouse). I know there must be a way. I appreciate your help!

Thanks,  
trippel
