# \[as1 Flash8\] Movement

**URL:** <https://forum.kirupa.com/t/as1-flash8-movement/290790>\
**Category:** programming\
**Created:** [June 19, 2009, 4:34pm UTC](https://forum.kirupa.com/t/as1-flash8-movement/290790 "2009-06-19T16:34:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcelozep](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@marcelozep](https://forum.kirupa.com/u/marcelozep)\
**Post date:** [June 19, 2009, 4:34pm UTC](https://forum.kirupa.com/t/as1-flash8-movement/290790/1 "2009-06-19T16:34:48Z")

</div>

Hello.  
I have a black square in the middle of the stage named “m”.  
This black square moves right and left, up and down, with a changeable speed, like, increasing speed -\>acceleration, and decreasing speed -\> deceleration.  
The problem is:

How to do this movieclip goes easying when it reachs the right limit -50 (by the Flash cordenates, right more x, left less x), or the left limit + 50?  
I mean, for example:

Imagine if you have a stage size with the properties 800x600, so you have 800 of width.  
If the movieclip (“m”), goes right and it passes the 750 x point, the movieclip should go easying (decreasing) the speed gradually untill speed reachs 0, and the movieclip reachs on the edge of the stage, that is, 800 x point - the movieclip width/2 if the movieclip named “m” are with the registration point exactly in its middle, or just its width if you are using Flash 8 or higher.  
Remeber, the movieclip should return to middle and do the exactly same movement when going the right or left limits.

Thanks 🙂
