# MX acceleration/deceleration of a movie clip?

**URL:** https://forum.kirupa.com/t/mx-acceleration-deceleration-of-a-movie-clip/13896
**Category:** flash
**Created:** [February 19, 2003, 4:04pm UTC](https://forum.kirupa.com/t/mx-acceleration-deceleration-of-a-movie-clip/13896 "2003-02-19T16:04:06Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![georgia](https://avatars.discourse-cdn.com/v4/letter/g/77aa72/32.png) [@georgia](https://forum.kirupa.com/u/georgia)
#### Post date: [February 19, 2003, 4:04pm UTC](https://forum.kirupa.com/t/mx-acceleration-deceleration-of-a-movie-clip/13896/1 "2003-02-19T16:04:06Z")

</div>

If anyone can help me with this question I would be very grateful.

I have a movie clip (1). When I click on 1, I would like to move a second clip (2) to another position along the x axis. This I know how to do. What I’m not sure of it how to code it to decelerate as it approaches it’s final position.

Thanks

Georgia

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 19, 2003, 4:11pm UTC](https://forum.kirupa.com/t/mx-acceleration-deceleration-of-a-movie-clip/13896/2 "2003-02-19T16:11:38Z")

</div>

Check the easing tutorial, Georgia. Everything’s in there 🙂

pom :tie:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 19, 2003, 4:18pm UTC](https://forum.kirupa.com/t/mx-acceleration-deceleration-of-a-movie-clip/13896/3 "2003-02-19T16:18:28Z")

</div>

Hi there,

Find out the distance from the start position to end position, then you can either:

1. set up a breaking point where speed will starting to decrease according to the scale of distance

e.g:

if(MC2 \> breakPoint) //this is going to the right  
speed = distance/scale;

or many other ways which I leave it to the others helpers 😛

Regards  
John

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 19, 2003, 5:18pm UTC](https://forum.kirupa.com/t/mx-acceleration-deceleration-of-a-movie-clip/13896/4 "2003-02-19T17:18:46Z")

</div>

thanks ilyaslamasse,

In the tutorial, the target for the movement is only itself. I’m having trouble tatgeting a second clip to move.

onClipEvent (mouseDown) {  
[COLOR=darkred](I need to set the \_x of clip2)[/COLOR]  
\_x = 0;  
speed = 5;  
}  
onClipEvent (mouseDown) {  
[COLOR=darkred](I need clip2 to move to a specific \_x value)[/COLOR]  
endX = \_root.\_xmouse;  
}  
onClipEvent (enterFrame) {  
[COLOR=darkred](and decelerate)[/COLOR]  
\_x += (endX-\_x)/speed;  
}

I hope I’m asking the question correctly, I’m a newbie  
georgia  
:-\

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 19, 2003, 11:52pm UTC](https://forum.kirupa.com/t/mx-acceleration-deceleration-of-a-movie-clip/13896/5 "2003-02-19T23:52:35Z")

</div>

You don’t need all the onMouseDown part (except if you want to lauch it on click). Just do something like this:

```auto
onClipEvent(EnterFrame){
  _x += (_root.clip2._x-_x)/speed;
}

```

pom :+)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 12:01am UTC](https://forum.kirupa.com/t/mx-acceleration-deceleration-of-a-movie-clip/13896/6 "2003-02-20T00:01:33Z")

</div>

Man oh man do I \<B\>HATE\</B\> crossposts.

[http://www.kirupaforum.com/showthread.php?s=&threadid=15603](http://www.kirupaforum.com/showthread.php?s=&threadid=15603)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 12:18am UTC](https://forum.kirupa.com/t/mx-acceleration-deceleration-of-a-movie-clip/13896/7 "2003-02-20T00:18:19Z")

</div>

😱 :skull:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 3:06am UTC](https://forum.kirupa.com/t/mx-acceleration-deceleration-of-a-movie-clip/13896/8 "2003-02-20T03:06:43Z")

</div>

By cross posts do you mean puting a question in more than one place? I’m a newbie and I didn’t know that was taboo, sorry for the mistake.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 3:11am UTC](https://forum.kirupa.com/t/mx-acceleration-deceleration-of-a-movie-clip/13896/9 "2003-02-20T03:11:37Z")

</div>

Yeah, when people post the same question in multiple sections it tends to get really confusing when answering them. I saw this thread and got all mixed up because I coulda SWORN I replied to it, but I didn’t see any replies from me in here.

Then I found the other one and noticed it was posted twice.

But now you know 🙂
