# \[as1 Flash8\] Movement

**URL:** <https://forum.kirupa.com/t/as1-flash8-movement/290856>\
**Category:** Uncategorized\
**Created:** [June 21, 2009, 3:30am UTC](https://forum.kirupa.com/t/as1-flash8-movement/290856 "2009-06-21T03:30:06Z")\
**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 21, 2009, 3:30am UTC](https://forum.kirupa.com/t/as1-flash8-movement/290856/1 "2009-06-21T03:30:06Z")

</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 coordenates, 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, the 800 x point, minus the movieclip width divided by 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.  
Remember, the movieclip should return to middle and do the exactly same movement when going the right or left limits again.

Thanks 🙂
