# How to control direction of a movieclip

**URL:** <https://forum.kirupa.com/t/how-to-control-direction-of-a-movieclip/255769>\
**Category:** flash\
**Created:** [March 26, 2008, 8:18pm UTC](https://forum.kirupa.com/t/how-to-control-direction-of-a-movieclip/255769 "2008-03-26T20:18:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bifurd](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@bifurd](https://forum.kirupa.com/u/bifurd)\
**Post date:** [March 26, 2008, 8:18pm UTC](https://forum.kirupa.com/t/how-to-control-direction-of-a-movieclip/255769/1 "2008-03-26T20:18:05Z")

</div>

How can I control the x and y direction of this movieclip by rolling over a separate button or movieclip to change the direction?

on(RollOver){  
this.stopped = true  
}  
on(RollOut){  
this.stopped = false  
}  
onClipEvent(enterFrame) {  
if(!this.stopped){  
speed = 2;  
this.\_x -= speed;  
}  
}
