MX acceleration/deceleration of a movie clip?

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

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

pom :tie:

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 :stuck_out_tongue:

Regards
John

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
:-\

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

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

pom :+)

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

http://www.kirupaforum.com/showthread.php?s=&threadid=15603

:scream: :skull:

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.

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 :slight_smile: