あるムービークリップの座標(x,y)をターゲットとなる座標(target_x,target_y)に問う減速運動で移動させる。
function movetargetFunc(target_x,target_y){
this.onEnterFrame = this.moveRoutine;
}
function moveRoutine(){
cons_speed = 5; //ターゲットに向かう速度定数
cons_accep = 3; //終着の許容範囲(ピクセル)
this._x += (target_x -this._x)/cons_speed;
this._y += (target_y -this._y)/cons_speed;
if (Math.abs(target_x - this._x) <= cons_accep){
delete this.onEnterFrame;
this._x = target_x;
this._y = target_y;
}
}