Frame 1
function getdistance(x, y, x1, y1) {
var run;
var rise;
run = x1 - x;
rise = y1 - y;
return(hyp(run, rise));
}
function hyp(a, b) {
return(Math.sqrt((a * a) + (b * b)));
}
MovieClip.prototype.reset = function () {
var dist;
var norm;
var movie_height;
var movie_width;
movie_height = 500;
movie_width = 425;
speed = (Math.random() * 4) + 2;
targx = Math.random() * (movie_width - _width);
targy = Math.random() * (movie_height - _height);
dist = _root.getdistance(_x, _y, targx, targy);
norm = speed / dist;
diffx = (targx - _x) * norm;
diffy = (targy - _y) * norm;
};
MovieClip.prototype.move = function () {
var cycle;
cycle = 100;
if (speed < _root.getdistance(_x, _y, targx, targy)) {
x = x + diffx;
y = y + diffy;
} else {
x = targx;
y = targy;
if (!this.t) {
t = getTimer();
}
if (cycle < (getTimer() - t)) {
reset();
t = 0;
}
}
_x = x;
_y = y;
};
Instance of Symbol 3 MovieClip in Frame 1
onClipEvent (enterFrame) {
move();
}
Instance of Symbol 3 MovieClip in Frame 1
onClipEvent (enterFrame) {
move();
}
Instance of Symbol 3 MovieClip in Frame 1
onClipEvent (enterFrame) {
move();
}
Instance of Symbol 3 MovieClip in Frame 1
onClipEvent (enterFrame) {
move();
}
Instance of Symbol 3 MovieClip in Frame 1
onClipEvent (enterFrame) {
move();
}
Instance of Symbol 3 MovieClip in Frame 1
onClipEvent (enterFrame) {
move();
}
Instance of Symbol 3 MovieClip in Frame 1
onClipEvent (enterFrame) {
move();
}
Instance of Symbol 3 MovieClip in Frame 1
onClipEvent (enterFrame) {
move();
}
Instance of Symbol 3 MovieClip in Frame 1
onClipEvent (enterFrame) {
move();
}
Instance of Symbol 3 MovieClip in Frame 1
onClipEvent (enterFrame) {
move();
}