Now go ahead and try that on a movieclip named “assembled”.
Here is my question…
How can I make the easing start fast then go slow? Right now it starts slow and speeds up. Well not really, because it speeds up and then slows down once it gets closer to the mouse position. But becuase the mouse position is greater than that of the movement, it seems like it speeds up then just stops!
Easing…what to say about easing… Let me try to explain it (I’m not a very good teacher but I will try)
if you look at easing code, you will se that it first finds the distance between the points:
_x += tx-_x; //tx is the target
if you applied this formula you would move to the point.
Make sense right?
Now thats all fine and dandy but wheres the fun in moving to the point in one frame? Theres none. At all. So if we divide that distance by a value greater than one then it wouldn’t move the whole way in one frame. It might move half the distance, or a fifth of the distance, depending on what we divided it by:
_x += (tx-_x)/2; //moves half the distance every frame
_x += (tx-_x)/5; //moves a fifth of the distance every frame
So if you think about it, if it moves a fifth of the distance every frame (and the distance is updated every frame) then the second frame it would be dividing four/fifths of the original distance by five and moving that much. So as it gets closer to the target the distance gets smaller and therefore the amount it moves gets smaller. I hope that makes sense. Maybe…