# Moving objects code

**URL:** <https://forum.kirupa.com/t/moving-objects-code/163498>\
**Category:** flash\
**Created:** [September 22, 2005, 8:21pm UTC](https://forum.kirupa.com/t/moving-objects-code/163498 "2005-09-22T20:21:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CayoHueso](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@CayoHueso](https://forum.kirupa.com/u/CayoHueso)\
**Post date:** [September 22, 2005, 8:21pm UTC](https://forum.kirupa.com/t/moving-objects-code/163498/1 "2005-09-22T20:21:16Z")

</div>

Hi everybody, I am trying to find out a formula to move an object, from on point to another, in a variable speed (fast at first, slowing down at the end).  
This is what I have came out with. Can anyone suggest a better way?

Thanks a lot for your help

```auto

speed=5;
 	this.onEnterFrame = function() {
 		my_mc._x += (desiredXcoordinate - my_mc._x) / speed;
 	};

```
