# Stopping graphic movement in actionscript (flash MX)

**URL:** <https://forum.kirupa.com/t/stopping-graphic-movement-in-actionscript-flash-mx/226547>\
**Category:** Uncategorized\
**Created:** [May 22, 2007, 7:54am UTC](https://forum.kirupa.com/t/stopping-graphic-movement-in-actionscript-flash-mx/226547 "2007-05-22T07:54:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![becdizzle](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@becdizzle](https://forum.kirupa.com/u/becdizzle)\
**Post date:** [May 22, 2007, 7:54am UTC](https://forum.kirupa.com/t/stopping-graphic-movement-in-actionscript-flash-mx/226547/1 "2007-05-22T07:54:55Z")

</div>

Hi,

I’m having trouble making a scrolling “portfolio” for a website.

Basically, when the mouse is over the left arrow, it moves right & visa versa. The problem i’m having is that I can’t stop it when the mouse leaves the arrow, and it just continues moving.

It’s a graphic thats moving left & right with a mask over the top.

Hopefully that made sense - my code is below.

## Thanks!

//identitiy is the image moving  
function left(){  
movement=10;  
position = 10+movement;  
identity.\_x = identity.\_x + movement;  
}  
function right(){  
movement=10;  
position = 10+movement;  
identity.\_x = identity.\_x-movement;  
}

function goleft(){  
identity.onEnterFrame = left;

}  
function goright(){  
identity.onEnterFrame= right;  
}  
//this is where i’d put the method for it to stop moving…  
function s(){  
identity.stop();  
}

movement\_mc.onRollOver= s;  
left\_mc.onRollOver = goleft;  
left\_mc.onRollOut = s;  
right\_mc.onRollOut = s;  
right\_mc.onRollOver = goright;
