Frame 11
ifFrameLoaded (206) {
gotoAndPlay (13);
}
Frame 12
gotoAndPlay (1);
Frame 125
stop();
Frame 206
stop();
function init() {
_focusrect = false;
frames = 0;
startTime = 0;
sound_off = false;
tmp = 2;
while (num_of_balls >= tmp) {
duplicateMovieClip ("b1", "b" + tmp, tmp);
this["b" + tmp]._x = this.b1._x + (32 * (tmp - 1));
tmp++;
}
cradle.swapDepths(20);
coll_sound = new Sound();
coll_sound.attachSound("coll");
}
function centreBalls() {
tmp = 1;
while (num_of_balls >= tmp) {
this["b" + tmp]._x = (316 + ((tmp - 1) * 32)) - (num_of_balls * 16);
tmp++;
}
startTime = 0;
frames = 0;
}
function calc_fps() {
if (startTime < getTimer()) {
if (frames == 0) {
fps = "fps: -";
} else {
fps = "fps: " + (frames / 10);
frames = 0;
}
startTime = getTimer() + 10000;
}
frames++;
}
Instance of Symbol 58 MovieClip in Frame 206
onClipEvent (load) {
_parent.init();
}
onClipEvent (enterFrame) {
_parent.calc_fps();
}
Symbol 16 Button
on (release) {
gotoAndPlay (126);
}
Symbol 29 Button
on (release) {
if (1 < Number(num_of_balls)) {
removeMovieClip("b" + num_of_balls);
num_of_balls--;
centreBalls();
}
}
Symbol 35 Button
on (release) {
if (Number(num_of_balls) < 7) {
num_of_balls++;
duplicateMovieClip ("b" + (num_of_balls - 1), "b" + num_of_balls, num_of_balls);
if (this["b" + (num_of_balls - 1)].rotation < 0) {
this["b" + num_of_balls].rotation = this["b" + (num_of_balls - 1)].rotation;
}
centreBalls();
}
}
Symbol 40 Button
on (release, keyPress "s") {
gotoAndStop (2);
Set("/:sound_off", true);
}
Symbol 41 Button
on (release, keyPress "s") {
gotoAndStop (1);
Set("/:sound_off", false);
}
Symbol 42 MovieClip Frame 1
stop();
Symbol 47 Button
on (release, keyPress "<Space>") {
tmp = 1;
while (num_of_balls >= tmp) {
this["b" + tmp].rotation = 0;
this["b" + tmp].rot_vel = 0;
tmp++;
}
}
Symbol 54 Button
on (press) {
_parent._parent.move = true;
}
on (release, releaseOutside) {
_parent._parent.move = false;
}
Symbol 57 MovieClip Frame 1
ball._rotation = rotation;
my_name = this._name;
my_num = parseInt(my_name.substring(1, 2));
left_buddy = "b" + (my_num - 1);
right_buddy = "b" + (my_num + 1);
to_rad = (Math.PI/180);
Symbol 57 MovieClip Frame 2
if (move == true) {
x = Math.max(Math.min(_xmouse, 124), -124);
if (x < 0) {
left = 1;
} else {
left = 0;
}
rotation = (Math.asin((-x) / 128) / Math.PI) * 180;
rot_vel = (rotation - old_rotation) / 6;
temp = my_num;
if (left) {
while (1 < temp) {
if (_parent["b" + (temp - 1)].rotation < _parent["b" + temp].rotation) {
_parent["b" + (temp - 1)].rotation = rotation;
_parent["b" + (temp - 1)].rot_vel = rot_vel;
}
temp--;
}
} else {
while (temp < _parent.num_of_balls) {
if (_parent["b" + temp].rotation < _parent["b" + (temp + 1)].rotation) {
_parent["b" + (temp + 1)].rotation = rotation;
_parent["b" + (temp + 1)].rot_vel = rot_vel;
}
temp++;
}
}
} else {
rotation = rotation + rot_vel;
if (90 < rotation) {
rotation = 90;
rot_vel = 0;
} else if (rotation < -90) {
rotation = -90;
rot_vel = 0;
}
rot_vel = rot_vel - (rotation / 90);
if ((rot_vel < 0) and (my_num < _parent.num_of_balls)) {
if (rotation < _parent[right_buddy].rotation) {
rot_diff = Math.abs(ball._rotation - _parent[right_buddy].ball._rotation);
if ((_parent.sound_off == false) and (0.5 < rot_diff)) {
_parent.coll_sound.setVolume(rot_diff * 5);
_parent.coll_sound.setPan((-rotation) * 2);
_parent.coll_sound.start();
}
right_vel = _parent[right_buddy].rot_vel;
_parent[right_buddy].rot_vel = rot_vel;
rotation = _parent[right_buddy].rotation;
rot_vel = right_vel;
}
} else if ((0 < rot_vel) and (1 < my_num)) {
if (_parent[left_buddy].rotation < rotation) {
rot_diff = Math.abs(ball._rotation - _parent[left_buddy].ball._rotation);
if ((_parent.sound_off == false) and (0.5 < rot_diff)) {
_parent.coll_sound.setVolume(rot_diff * 5);
_parent.coll_sound.setPan((-rotation) * 2);
_parent.coll_sound.start();
}
left_vel = _parent[left_buddy].rot_vel;
_parent[left_buddy].rot_vel = rot_vel;
rotation = _parent[left_buddy].rotation;
rot_vel = left_vel;
}
}
}
if (old_rotation != rotation) {
ball._rotation = rotation;
sin_value = Math.sin(rotation * to_rad);
shadow._x = -160 * sin_value;
if ((rotation < (last_rotation - 5)) or ((last_rotation + 5) < rotation)) {
ball.button._rotation = (-rotation) * 0.75;
scale = 100 + (Math.abs(sin_value) * 100);
shadow._xscale = scale;
shadow._yscale = scale;
last_rotation = rotation;
}
old_rotation = rotation;
}
Symbol 57 MovieClip Frame 3
call("loop");
gotoAndPlay (2);
Symbol 63 Button
on (release) {
getURL ("http://www.thewebshite.co.uk", "_blank");
}