主要代码:
onClipEvent (load)
{
var vx = 0;
var vy = 0;
}
onClipEvent (enterFrame)
{
spring = 3.000000E-001;
damp = 8.000000E-001;
this.vx = this.vx + (_root.tracker._x - this._x) * spring;
this.vy = this.vy + (_root.tracker._y - this._y) * spring;
this.vx = this.vx * damp;
this.vy = this.vy * damp;
this._x = this._x + this.vx;
this._y = this._y + this.vy;
_root.mc3._width = _root.mc3._x - this._x;
_root.mc3._height = _root.mc3._y - this._y;
_root.mc4._width = this._x - _root.mc4._x;
_root.mc4._height = _root.mc4._y - this._y;
_root.mc1._width = this._x - _root.mc1._x;
_root.mc1._height = this._y - _root.mc1._y;
_root.mc2._width = _root.mc2._x - this._x;
_root.mc2._height = this._y - _root.mc2._y;
}