Flash Actionscript Animation简明教程(12) //起始点与目标地点的距离 dx = targetx-my_mc._x; dy = targety-my_mc._y; //加速度 vx += dx*.3; vy += dy*.3; //加入摩擦 vx *= fraction; vy *= fraction; my_mc._x += vx; my_mc._y += vy; } }; my_mc.onPress = function() { this.startDrag(); dragging = true; }; my_mc.onRelease=function() { this.stopDrag(); dragging = false; };
演示:a0012.swf