Frame 1
total_circles = "5";
movie_width = "550";
movie_height = "400";
speed = "3";
Symbol 4 MovieClip Frame 1
stop();
Symbol 4 MovieClip Frame 2
stop();
Symbol 4 MovieClip Frame 3
stop();
Symbol 4 MovieClip Frame 4
stop();
Symbol 4 MovieClip Frame 5
stop();
Symbol 5 MovieClip Frame 1
tellTarget ("color") {
gotoAndStop(getProperty("../", _name));
};
Symbol 5 MovieClip Frame 2
my_radius = _width / "2";
my_x = _x;
my_y = _y;
my_n = _name;
if (ymov == "") {
ymov = random(/:speed) + "1";
xmov = random(/:speed) + "1";
ysign = random("2") - "1";
if (ysign == "0") {
ysign = "1";
}
xsign = random("2") - "1";
if (xsign == "0") {
xsign = "1";
}
xmov = xmov * xsign;
ymov = ymov * ysign;
}
if ((my_radius + /:speed) >= my_x) {
xmov = xmov * "-1";
my_x = my_radius + /:speed;
}
if ((my_radius + /:speed) >= my_y) {
ymov = ymov * "-1";
my_y = my_radius + /:speed;
}
if (my_x >= ((/:movie_width - my_radius) - /:speed)) {
xmov = xmov * "-1";
my_x = (/:movie_width - my_radius) - /:speed;
}
if (my_y >= ((/:movie_height - my_radius) - /:speed)) {
ymov = ymov * "-1";
my_y = (/:movie_height - my_radius) - /:speed;
}
n = "1";
while (/:total_circles >= n) {
if (n ne my_n) {
n_x = getProperty("../" add n, _x);
n_y = getProperty("../" add n, _y);
n_radius = getProperty("../" add n, _width) / "2";
delta_x = (my_x + xmov) - n_x;
delta_y = (my_y + ymov) - n_y;
if (((delta_x * delta_x) + (delta_y * delta_y)) < ((my_radius + n_radius) * (my_radius + n_radius))) {
nx = eval (("../" add n) add ":xmov");
ny = eval (("../" add n) add ":ymov");
tempx = xmov;
xmov = nx;
Set(("../" add n) add ":xmov", tempx);
tempy = ymov;
ymov = ny;
Set(("../" add n) add ":ymov", tempy);
Set(("../" add n) add ":collision", my_n);
}
}
n = n + "1";
}
_x = (my_x + xmov);
_y = (my_y + ymov);
Symbol 5 MovieClip Frame 3
gotoAndPlay(_currentframe - "1");