obj为目标坐标
ball为运动物
1.弹簧式运动:
xspeed = 0;
yspeed = 0;
onEnterFrame = function () {
xspeed = (ball._x-obj._x)*.4+xspeed*.7;
yspeed = (ball._y-obj._y)*.4+yspeed*.7;
ball._x -= xspeed;
ball._y -= yspeed;
};
2.缓冲运动:
onEnterFrame = function () {
ball._x-=(ball._x-obj._x)*.4
ball._y-=(ball._y-obj._y)*.4
}