Thread: ActionScript
View Single Post
Old 01-03-2006, 06:02   #2 (permalink)
d*d
Moderator
 
d*d's Avatar
 
Join Date: Oct 2004
Location: Bristol
Posts: 3,393
Stick this in a setInterval function or in an onClipEvent(enterFrame) handler

mx= xFinal
//xFinal=final _x position
if (mx<_x) {
dx=_x-mx;
}
else {
dx=mx-_x;
}
moveSpeedx=dx/10;
if (mx<_x) {
_x=_x-moveSpeedx;
}
else {
_x=_x+moveSpeedx;
}
}
  Reply With Quote