//函数定义
function go(a:Number, b:Number):Number {
this.$a = a;
this.$b = b;
if (this.$a>this.$b) {
return this.$a-this.$b;
} else if (this.$a<this.$b) {
return this.$a-this.$b;
} else {
return 0;
}
}
//缓动系数
var i = 2;
onMouseDown = function () {
this.onEnterFrame = function() {
my_mc._x += go(200, my_mc._x)/i;
my_mc._y += go(300, my_mc._y)/i;
if (Math.floor(go(200, my_mc._x)) == 0) {
delete this.onEnterFrame;
}
};
};