# Movement Using ActionScript

**URL:** <https://forum.kirupa.com/t/movement-using-actionscript/161178>\
**Category:** Uncategorized\
**Created:** [September 1, 2005, 4:22pm UTC](https://forum.kirupa.com/t/movement-using-actionscript/161178 "2005-09-01T16:22:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![video4hire](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@video4hire](https://forum.kirupa.com/u/video4hire)\
**Post date:** [September 1, 2005, 4:22pm UTC](https://forum.kirupa.com/t/movement-using-actionscript/161178/1 "2005-09-01T16:22:48Z")

</div>

I have a movie clip that I would like to slide to the right or left depending on which button the user clicks. When I test the movie and click on the buttons, the target movie clip only moves one pixel. I want it to slide into place. What am I doing wrong?

leftBtn.onRelease = function() {  
if (\_root.info\_mc.\_x\>490) {  
speed = -5;  
\_root.info\_mc.\_x += speed;  
}  
else {  
\_root.info\_mc.\_x = 490;  
}  
};

rightBtn.onRelease = function() {  
if (\_root.info\_mc.\_x\<590) {  
speed = 5;  
\_root.info\_mc.\_x += speed;  
}  
else {  
\_root.info\_mc\_x = 590;  
}  
};

Thank you in advance for your help.
