onClipEvent (load) {
vx = Math.random()*780;
vy = Math.random()*422;
px = int(Math.random()*5+3);
py = int(Math.random()*5+3);
this._x = Math.random()*780;
this._y = Math.random()*422;
}
onClipEvent (enterFrame) {
dx = vx-this._x;
dy = vy-this._y;
dx = dx*dx;
dy = dy*dy;
c = Math.sqrt(dx+dy);
if (c >60 and c<70) {
play();
}
if (c < 1) {
w = 3.5-random(7);
if (w<0){
vx = 100-Math.random()*200+this._x;
vy = 100-Math.random()*200+this._y;
}else{
vx = 100-Math.random()*200+_root._xmouse;
vy = 100-Math.random()*200+_root._ymouse;
}
if (vx > 780 or vx < 0) {
vx=_root._xmouse;
}
if (vy > 422 or vy < 0) {
vy=_root._ymouse;
}
px = int(Math.random()*5+3);
py = int(Math.random()*5+3);
} else {
setProperty(this, _x, this._x+((vx-this._x)/px));
setProperty(this, _y, this._y+((vy-this._y)/py));
}
}