Frame 1
fscommand ("showmenu", false);
_root.best = 0;
_root.sunet = 1;
stop();
logo.onEnterFrame = function () {
var _local1 = _root;
if (_local1.getBytesLoaded() == _local1.getBytesTotal()) {
this.play();
} else {
tgFrame = Math.round((_local1.getBytesLoaded() / _local1.getBytesTotal()) * 100);
this.progress.gotoAndStop(tgFrame);
}
};
Frame 2
stop();
_root.paused = 0;
son = new Sound();
son.attachSound("shot1");
son2 = new Sound();
son2.attachSound("shot2");
son3 = new Sound();
son3.attachSound("shot3");
Frame 3
this.onMouseDown = function () {
if (_root.b10.moving == false) {
_root.power.gotoAndPlay(1);
}
};
this.onMouseUp = function () {
_root.power.stop();
};
bestTXT.text = _root.best;
_root.score = 0;
scoreTXT.text = _root.score;
i = 0;
while (i <= 9) {
_root["b" + i].timpIni = getTimer() + 120000;
i++;
}
_root.b4.timpIni = getTimer() + 60000;
Instance of Symbol 49 MovieClip "power" in Frame 3
onClipEvent (load) {
this.gotoAndStop(1);
}
Frame 4
stop();
ballsIn = 0;
Instance of Symbol 64 MovieClip "controller" in Frame 4
onClipEvent (load) {
function getDistanceSquare(clip, clip2) {
var _local2 = clip._x - clip2._x;
var _local1 = clip._y - clip2._y;
return((_local2 * _local2) + (_local1 * _local1));
}
ballsArray = [];
var n = 0;
while (n < 11) {
ballsArray[n] = _root["b" + n];
n++;
}
holesArray = [];
var n = 1;
while (n < 7) {
holesArray[n - 1] = _root["h" + n];
n++;
}
var k = 0;
while (k < ballsArray.length) {
ballsArray[k].dx = 0;
ballsArray[k].dy = 0;
ballsArray[k].moving = false;
ballsArray[k].disabled = false;
k++;
}
diameter = _root.b10._width;
diameterSquare = diameter * diameter;
bgLeft = 48 + (diameter / 2);
bgRight = 515 - (diameter / 2);
bgTop = 55 + (diameter / 2);
bgBottom = 345 - (diameter / 2);
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (fsec > 70) {
return(undefined);
}
var k = 0;
while (k < ballsArray.length) {
clip = ballsArray[k];
if (clip.moving == false) {
} else if (clip.disabled) {
} else if (clip.bounced) {
} else {
var m = 0;
while (m < ballsArray.length) {
clip2 = ballsArray[m];
if ((m <= k) && (clip2.moving)) {
} else if (clip2.disabled) {
} else {
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
clip.moving = true;
clip2.moving = true;
_root.bouncer.bounce(clip, clip2);
}
}
m++;
}
var m = 0;
while (m < holesArray.length) {
clip2 = holesArray[m];
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
fireN++;
duplicateMovieClip (_root.fire, "fire" + fireN, fireN);
_root["fire" + fireN].ball = clip;
_root["fire" + fireN].hole = clip2;
}
m++;
}
}
k++;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
t1 = getTimer();
fsec = t1 - t2;
t2 = t1;
var p = 0;
while (p < ballsArray.length) {
clip3 = ballsArray[p];
if (clip3.disabled) {
} else if (clip3.moving == false) {
} else {
clip3.dx = clip3.dx - clip3.frictionX;
clip3.dy = clip3.dy - clip3.frictionY;
clip3._x = clip3._x + clip3.dx;
clip3._y = clip3._y + clip3.dy;
dx = clip3.dx;
dy = clip3.dy;
if (clip3._x < bgLeft) {
clip3.dx = Math.abs(dx);
clip3.frictionX = Math.abs(clip3.frictionX);
} else if (clip3._x > bgRight) {
clip3.dx = -Math.abs(dx);
clip3.frictionX = -Math.abs(clip3.frictionX);
}
if (clip3._y < bgTop) {
clip3.dy = Math.abs(dy);
clip3.frictionY = Math.abs(clip3.frictionY);
} else if (clip3._y > bgBottom) {
clip3.dy = -Math.abs(dy);
clip3.frictionY = -Math.abs(clip3.frictionY);
}
if (((dx * dx) + (dy * dy)) < 0.003) {
clip3.dx = 0;
clip3.dy = 0;
clip3.frictionX = 0;
clip3.frictionY = 0;
clip3.moving = false;
}
}
p++;
}
}
}
Instance of Symbol 65 MovieClip "bouncer" in Frame 4
onClipEvent (load) {
function bounce(clip, clip2) {
var _local1 = clip;
var _local2 = clip2;
var angle = Math.atan2(_local1._y - _local2._y, _local1._x - _local2._x);
this._rotation = (angle * 180) / 3.141593;
var _local3 = {x:_local2.dx * 10, y:_local2.dy * 10};
this.globalToLocal(_local3);
var subVector2 = {x:_local3.x, y:0};
this.localToGlobal(subVector2);
var pt = {x:_local1.dx * 10, y:_local1.dy * 10};
this.globalToLocal(pt);
var subVector = {x:pt.x, y:0};
this.localToGlobal(subVector);
if ((_local3.x <= 0) && (pt.x >= 0)) {
} else {
var xSub = ((subVector2.x - subVector.x) / 10);
var ySub = ((subVector2.y - subVector.y) / 10);
_local1.dx = _local1.dx + xSub;
_local1.dy = _local1.dy + ySub;
_local2.dx = _local2.dx - xSub;
_local2.dy = _local2.dy - ySub;
var ang = Math.atan2(_local1.dy, _local1.dx);
_local1.frictionX = Math.cos(ang) / 20;
_local1.frictionY = Math.sin(ang) / 20;
var ang2 = Math.atan2(_local2.dy, _local2.dx);
_local2.frictionX = Math.cos(ang2) / 20;
_local2.frictionY = Math.sin(ang2) / 20;
}
}
}
Instance of Symbol 64 MovieClip "fire" in Frame 4
onClipEvent (load) {
function startGoHole(clip, clip2) {
ball.disabled = true;
animate = true;
framesNeed = int(_root.b10._width / Math.sqrt((ball.dx * ball.dx) + (ball.dy * ball.dy)));
dx = (hole._x - ball._x) / framesNeed;
dy = (hole._y - ball._y) / framesNeed;
count = 0;
}
function conclude() {
var _local2 = _root;
animate = false;
ball.moving = false;
ball._y = -300;
if (ball == _local2.b10) {
hole.gotoAndPlay(20);
} else {
_local2.ballsIn++;
_local2.score = _local2.score + ball.timpul;
_local2.scoreTXT.text = _local2.score;
if (_local2.score > _local2.best) {
_local2.best = _local2.score;
}
if (ball == _local2.b4) {
hole.gotoAndPlay(38);
} else {
hole.play();
}
ball._visible = false;
var balolInHole = -1;
var _local1 = 0;
while (_local1 < ballsArray.length) {
if (ballsArray[_local1] == ball) {
ballInHole = _local1;
break;
}
_local1++;
}
if (_local2.ballsIn >= 11) {
_local2.play();
}
if (ballInHole > -1) {
ballsArray.splice(ballInHole, 1);
}
}
removeMovieClip(this);
}
startGoHole();
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
ball._x = ball._x + dx;
ball._y = ball._y + dy;
count++;
if (count >= framesNeed) {
conclude();
}
}
}
Instance of Symbol 68 MovieClip in Frame 4
onClipEvent (load) {
function conclude() {
var _local1 = _root;
if (_local1.sunet == 1) {
_local1.son.start(0, 1);
}
animate = false;
rod._x = -(30 + (_local1.b10._width / 2));
_rotation = 0;
count = 0;
_y = -100;
}
ballsArray = _root.controller.ballsArray;
orgX = _root.b10._x;
orgY = _root.b10._y;
animate = false;
conclude();
}
onClipEvent (mouseDown) {
if (_root.paused == 0) {
if (_root.b10.disabled) {
_root.b10.disabled = false;
_root.b10._x = orgX;
_root.b10._y = orgY;
OK = false;
while (!OK) {
hit = false;
var h = 0;
while (h < (ballsArray.length - 1)) {
tempClip = ballsArray[h];
if ((Math.abs(tempClip._x - _root.b10._x) < _root.b10._width) && (Math.abs(tempClip._y - _root.b10._y) < _root.b10._width)) {
hit = true;
break;
}
h++;
}
if (hit) {
_root.b10._x = _root.b10._x + 5;
}
OK = true;
}
_root.b10.dx = 0;
_root.b10.dy = 0;
_root.b10.moving = false;
return(undefined);
}
if (_root.b10.moving) {
return(undefined);
}
_x = _root.b10._x;
_y = _root.b10._y;
dragging = true;
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
onClipEvent (mouseMove) {
if (_root.paused == 0) {
if (dragging) {
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
}
onClipEvent (mouseUp) {
if (_root.paused == 0) {
if (dragging) {
dragging = false;
animate = true;
count = 0;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
count++;
if (count > 12) {
conclude();
}
if (count == 6) {
_root.b10.dx = (10 * Math.cos(angle)) * (_root.power._currentframe / 20);
_root.b10.dy = (10 * Math.sin(angle)) * (_root.power._currentframe / 20);
_root.b10.frictionX = _root.b10.dx / 200;
_root.b10.frictionY = _root.b10.dy / 200;
_root.b10.moving = true;
}
if (count < 6) {
rod._x = rod._x + 5;
} else {
rod._x = rod._x - 5;
}
}
}
Frame 5
stop();
stop();
Frame 6
i = 0;
while (i <= 9) {
_root["b" + i].timpIni = getTimer() + 100000;
i++;
}
_root.b4.timpIni = getTimer() + 50000;
Frame 7
stop();
ballsIn = 0;
Instance of Symbol 64 MovieClip "controller" in Frame 7
onClipEvent (load) {
function getDistanceSquare(clip, clip2) {
var _local2 = clip._x - clip2._x;
var _local1 = clip._y - clip2._y;
return((_local2 * _local2) + (_local1 * _local1));
}
ballsArray = [];
var n = 0;
while (n < 11) {
ballsArray[n] = _root["b" + n];
n++;
}
holesArray = [];
var n = 1;
while (n < 7) {
holesArray[n - 1] = _root["h" + n];
n++;
}
var k = 0;
while (k < ballsArray.length) {
ballsArray[k].dx = 0;
ballsArray[k].dy = 0;
ballsArray[k].moving = false;
ballsArray[k].disabled = false;
k++;
}
diameter = _root.b10._width;
diameterSquare = diameter * diameter;
bgLeft = 48 + (diameter / 2);
bgRight = 515 - (diameter / 2);
bgTop = 55 + (diameter / 2);
bgBottom = 345 - (diameter / 2);
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (fsec > 70) {
return(undefined);
}
var k = 0;
while (k < ballsArray.length) {
clip = ballsArray[k];
if (clip.moving == false) {
} else if (clip.disabled) {
} else if (clip.bounced) {
} else {
var m = 0;
while (m < ballsArray.length) {
clip2 = ballsArray[m];
if ((m <= k) && (clip2.moving)) {
} else if (clip2.disabled) {
} else {
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
clip.moving = true;
clip2.moving = true;
_root.bouncer.bounce(clip, clip2);
}
}
m++;
}
var m = 0;
while (m < holesArray.length) {
clip2 = holesArray[m];
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
fireN++;
duplicateMovieClip (_root.fire, "fire" + fireN, fireN);
_root["fire" + fireN].ball = clip;
_root["fire" + fireN].hole = clip2;
}
m++;
}
}
k++;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
t1 = getTimer();
fsec = t1 - t2;
t2 = t1;
var p = 0;
while (p < ballsArray.length) {
clip3 = ballsArray[p];
if (clip3.disabled) {
} else if (clip3.moving == false) {
} else {
clip3.dx = clip3.dx - clip3.frictionX;
clip3.dy = clip3.dy - clip3.frictionY;
clip3._x = clip3._x + clip3.dx;
clip3._y = clip3._y + clip3.dy;
dx = clip3.dx;
dy = clip3.dy;
if (clip3._x < bgLeft) {
clip3.dx = Math.abs(dx);
clip3.frictionX = Math.abs(clip3.frictionX);
} else if (clip3._x > bgRight) {
clip3.dx = -Math.abs(dx);
clip3.frictionX = -Math.abs(clip3.frictionX);
}
if (clip3._y < bgTop) {
clip3.dy = Math.abs(dy);
clip3.frictionY = Math.abs(clip3.frictionY);
} else if (clip3._y > bgBottom) {
clip3.dy = -Math.abs(dy);
clip3.frictionY = -Math.abs(clip3.frictionY);
}
if (((dx * dx) + (dy * dy)) < 0.003) {
clip3.dx = 0;
clip3.dy = 0;
clip3.frictionX = 0;
clip3.frictionY = 0;
clip3.moving = false;
}
}
p++;
}
}
}
Instance of Symbol 65 MovieClip "bouncer" in Frame 7
onClipEvent (load) {
function bounce(clip, clip2) {
var _local1 = clip;
var _local2 = clip2;
var angle = Math.atan2(_local1._y - _local2._y, _local1._x - _local2._x);
this._rotation = (angle * 180) / 3.141593;
var _local3 = {x:_local2.dx * 10, y:_local2.dy * 10};
this.globalToLocal(_local3);
var subVector2 = {x:_local3.x, y:0};
this.localToGlobal(subVector2);
var pt = {x:_local1.dx * 10, y:_local1.dy * 10};
this.globalToLocal(pt);
var subVector = {x:pt.x, y:0};
this.localToGlobal(subVector);
if ((_local3.x <= 0) && (pt.x >= 0)) {
} else {
var xSub = ((subVector2.x - subVector.x) / 10);
var ySub = ((subVector2.y - subVector.y) / 10);
_local1.dx = _local1.dx + xSub;
_local1.dy = _local1.dy + ySub;
_local2.dx = _local2.dx - xSub;
_local2.dy = _local2.dy - ySub;
var ang = Math.atan2(_local1.dy, _local1.dx);
_local1.frictionX = Math.cos(ang) / 20;
_local1.frictionY = Math.sin(ang) / 20;
var ang2 = Math.atan2(_local2.dy, _local2.dx);
_local2.frictionX = Math.cos(ang2) / 20;
_local2.frictionY = Math.sin(ang2) / 20;
}
}
}
Instance of Symbol 64 MovieClip "fire" in Frame 7
onClipEvent (load) {
function startGoHole(clip, clip2) {
ball.disabled = true;
animate = true;
framesNeed = int(_root.b10._width / Math.sqrt((ball.dx * ball.dx) + (ball.dy * ball.dy)));
dx = (hole._x - ball._x) / framesNeed;
dy = (hole._y - ball._y) / framesNeed;
count = 0;
}
function conclude() {
var _local2 = _root;
animate = false;
ball.moving = false;
ball._y = -300;
if (ball == _local2.b10) {
hole.gotoAndPlay(20);
} else {
_local2.ballsIn++;
_local2.score = _local2.score + ball.timpul;
_local2.scoreTXT.text = _local2.score;
if (_local2.score > _local2.best) {
_local2.best = _local2.score;
}
if (ball == _local2.b4) {
hole.gotoAndPlay(38);
} else {
hole.play();
}
ball._visible = false;
var balolInHole = -1;
var _local1 = 0;
while (_local1 < ballsArray.length) {
if (ballsArray[_local1] == ball) {
ballInHole = _local1;
break;
}
_local1++;
}
if (_local2.ballsIn >= 11) {
_local2.play();
}
if (ballInHole > -1) {
ballsArray.splice(ballInHole, 1);
}
}
removeMovieClip(this);
}
startGoHole();
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
ball._x = ball._x + dx;
ball._y = ball._y + dy;
count++;
if (count >= framesNeed) {
conclude();
}
}
}
Instance of Symbol 68 MovieClip in Frame 7
onClipEvent (load) {
function conclude() {
var _local1 = _root;
if (_local1.sunet == 1) {
_local1.son.start(0, 1);
}
animate = false;
rod._x = -(30 + (_local1.b10._width / 2));
_rotation = 0;
count = 0;
_y = -100;
}
ballsArray = _root.controller.ballsArray;
orgX = _root.b10._x;
orgY = _root.b10._y;
animate = false;
conclude();
}
onClipEvent (mouseDown) {
if (_root.paused == 0) {
if (_root.b10.disabled) {
_root.b10.disabled = false;
_root.b10._x = orgX;
_root.b10._y = orgY;
OK = false;
while (!OK) {
hit = false;
var h = 0;
while (h < (ballsArray.length - 1)) {
tempClip = ballsArray[h];
if ((Math.abs(tempClip._x - _root.b10._x) < _root.b10._width) && (Math.abs(tempClip._y - _root.b10._y) < _root.b10._width)) {
hit = true;
break;
}
h++;
}
if (hit) {
_root.b10._x = _root.b10._x + 5;
}
OK = true;
}
_root.b10.dx = 0;
_root.b10.dy = 0;
_root.b10.moving = false;
return(undefined);
}
if (_root.b10.moving) {
return(undefined);
}
_x = _root.b10._x;
_y = _root.b10._y;
dragging = true;
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
onClipEvent (mouseMove) {
if (_root.paused == 0) {
if (dragging) {
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
}
onClipEvent (mouseUp) {
if (_root.paused == 0) {
if (dragging) {
dragging = false;
animate = true;
count = 0;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
count++;
if (count > 12) {
conclude();
}
if (count == 6) {
_root.b10.dx = (10 * Math.cos(angle)) * (_root.power._currentframe / 20);
_root.b10.dy = (10 * Math.sin(angle)) * (_root.power._currentframe / 20);
_root.b10.frictionX = _root.b10.dx / 200;
_root.b10.frictionY = _root.b10.dy / 200;
_root.b10.moving = true;
}
if (count < 6) {
rod._x = rod._x + 5;
} else {
rod._x = rod._x - 5;
}
}
}
Frame 8
stop();
stop();
Frame 9
i = 0;
while (i <= 9) {
_root["b" + i].timpIni = getTimer() + 90000;
i++;
}
_root.b4.timpIni = getTimer() + 50000;
Frame 10
stop();
ballsIn = 0;
Instance of Symbol 64 MovieClip "controller" in Frame 10
onClipEvent (load) {
function getDistanceSquare(clip, clip2) {
var _local2 = clip._x - clip2._x;
var _local1 = clip._y - clip2._y;
return((_local2 * _local2) + (_local1 * _local1));
}
ballsArray = [];
var n = 0;
while (n < 11) {
ballsArray[n] = _root["b" + n];
n++;
}
holesArray = [];
var n = 1;
while (n < 7) {
holesArray[n - 1] = _root["h" + n];
n++;
}
var k = 0;
while (k < ballsArray.length) {
ballsArray[k].dx = 0;
ballsArray[k].dy = 0;
ballsArray[k].moving = false;
ballsArray[k].disabled = false;
k++;
}
diameter = _root.b10._width;
diameterSquare = diameter * diameter;
bgLeft = 48 + (diameter / 2);
bgRight = 515 - (diameter / 2);
bgTop = 55 + (diameter / 2);
bgBottom = 345 - (diameter / 2);
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (fsec > 70) {
return(undefined);
}
var k = 0;
while (k < ballsArray.length) {
clip = ballsArray[k];
if (clip.moving == false) {
} else if (clip.disabled) {
} else if (clip.bounced) {
} else {
var m = 0;
while (m < ballsArray.length) {
clip2 = ballsArray[m];
if ((m <= k) && (clip2.moving)) {
} else if (clip2.disabled) {
} else {
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
clip.moving = true;
clip2.moving = true;
_root.bouncer.bounce(clip, clip2);
}
}
m++;
}
var m = 0;
while (m < holesArray.length) {
clip2 = holesArray[m];
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
fireN++;
duplicateMovieClip (_root.fire, "fire" + fireN, fireN);
_root["fire" + fireN].ball = clip;
_root["fire" + fireN].hole = clip2;
}
m++;
}
}
k++;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
t1 = getTimer();
fsec = t1 - t2;
t2 = t1;
var p = 0;
while (p < ballsArray.length) {
clip3 = ballsArray[p];
if (clip3.disabled) {
} else if (clip3.moving == false) {
} else {
clip3.dx = clip3.dx - clip3.frictionX;
clip3.dy = clip3.dy - clip3.frictionY;
clip3._x = clip3._x + clip3.dx;
clip3._y = clip3._y + clip3.dy;
dx = clip3.dx;
dy = clip3.dy;
if (clip3._x < bgLeft) {
clip3.dx = Math.abs(dx);
clip3.frictionX = Math.abs(clip3.frictionX);
} else if (clip3._x > bgRight) {
clip3.dx = -Math.abs(dx);
clip3.frictionX = -Math.abs(clip3.frictionX);
}
if (clip3._y < bgTop) {
clip3.dy = Math.abs(dy);
clip3.frictionY = Math.abs(clip3.frictionY);
} else if (clip3._y > bgBottom) {
clip3.dy = -Math.abs(dy);
clip3.frictionY = -Math.abs(clip3.frictionY);
}
if (((dx * dx) + (dy * dy)) < 0.003) {
clip3.dx = 0;
clip3.dy = 0;
clip3.frictionX = 0;
clip3.frictionY = 0;
clip3.moving = false;
}
}
p++;
}
}
}
Instance of Symbol 65 MovieClip "bouncer" in Frame 10
onClipEvent (load) {
function bounce(clip, clip2) {
var _local1 = clip;
var _local2 = clip2;
var angle = Math.atan2(_local1._y - _local2._y, _local1._x - _local2._x);
this._rotation = (angle * 180) / 3.141593;
var _local3 = {x:_local2.dx * 10, y:_local2.dy * 10};
this.globalToLocal(_local3);
var subVector2 = {x:_local3.x, y:0};
this.localToGlobal(subVector2);
var pt = {x:_local1.dx * 10, y:_local1.dy * 10};
this.globalToLocal(pt);
var subVector = {x:pt.x, y:0};
this.localToGlobal(subVector);
if ((_local3.x <= 0) && (pt.x >= 0)) {
} else {
var xSub = ((subVector2.x - subVector.x) / 10);
var ySub = ((subVector2.y - subVector.y) / 10);
_local1.dx = _local1.dx + xSub;
_local1.dy = _local1.dy + ySub;
_local2.dx = _local2.dx - xSub;
_local2.dy = _local2.dy - ySub;
var ang = Math.atan2(_local1.dy, _local1.dx);
_local1.frictionX = Math.cos(ang) / 20;
_local1.frictionY = Math.sin(ang) / 20;
var ang2 = Math.atan2(_local2.dy, _local2.dx);
_local2.frictionX = Math.cos(ang2) / 20;
_local2.frictionY = Math.sin(ang2) / 20;
}
}
}
Instance of Symbol 64 MovieClip "fire" in Frame 10
onClipEvent (load) {
function startGoHole(clip, clip2) {
ball.disabled = true;
animate = true;
framesNeed = int(_root.b10._width / Math.sqrt((ball.dx * ball.dx) + (ball.dy * ball.dy)));
dx = (hole._x - ball._x) / framesNeed;
dy = (hole._y - ball._y) / framesNeed;
count = 0;
}
function conclude() {
var _local2 = _root;
animate = false;
ball.moving = false;
ball._y = -300;
if (ball == _local2.b10) {
hole.gotoAndPlay(20);
} else {
_local2.ballsIn++;
_local2.score = _local2.score + ball.timpul;
_local2.scoreTXT.text = _local2.score;
if (_local2.score > _local2.best) {
_local2.best = _local2.score;
}
if (ball == _local2.b4) {
hole.gotoAndPlay(38);
} else {
hole.play();
}
ball._visible = false;
var balolInHole = -1;
var _local1 = 0;
while (_local1 < ballsArray.length) {
if (ballsArray[_local1] == ball) {
ballInHole = _local1;
break;
}
_local1++;
}
if (_local2.ballsIn >= 11) {
_local2.play();
}
if (ballInHole > -1) {
ballsArray.splice(ballInHole, 1);
}
}
removeMovieClip(this);
}
startGoHole();
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
ball._x = ball._x + dx;
ball._y = ball._y + dy;
count++;
if (count >= framesNeed) {
conclude();
}
}
}
Instance of Symbol 68 MovieClip in Frame 10
onClipEvent (load) {
function conclude() {
var _local1 = _root;
if (_local1.sunet == 1) {
_local1.son.start(0, 1);
}
animate = false;
rod._x = -(30 + (_local1.b10._width / 2));
_rotation = 0;
count = 0;
_y = -100;
}
ballsArray = _root.controller.ballsArray;
orgX = _root.b10._x;
orgY = _root.b10._y;
animate = false;
conclude();
}
onClipEvent (mouseDown) {
if (_root.paused == 0) {
if (_root.b10.disabled) {
_root.b10.disabled = false;
_root.b10._x = orgX;
_root.b10._y = orgY;
OK = false;
while (!OK) {
hit = false;
var h = 0;
while (h < (ballsArray.length - 1)) {
tempClip = ballsArray[h];
if ((Math.abs(tempClip._x - _root.b10._x) < _root.b10._width) && (Math.abs(tempClip._y - _root.b10._y) < _root.b10._width)) {
hit = true;
break;
}
h++;
}
if (hit) {
_root.b10._x = _root.b10._x + 5;
}
OK = true;
}
_root.b10.dx = 0;
_root.b10.dy = 0;
_root.b10.moving = false;
return(undefined);
}
if (_root.b10.moving) {
return(undefined);
}
_x = _root.b10._x;
_y = _root.b10._y;
dragging = true;
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
onClipEvent (mouseMove) {
if (_root.paused == 0) {
if (dragging) {
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
}
onClipEvent (mouseUp) {
if (_root.paused == 0) {
if (dragging) {
dragging = false;
animate = true;
count = 0;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
count++;
if (count > 12) {
conclude();
}
if (count == 6) {
_root.b10.dx = (10 * Math.cos(angle)) * (_root.power._currentframe / 20);
_root.b10.dy = (10 * Math.sin(angle)) * (_root.power._currentframe / 20);
_root.b10.frictionX = _root.b10.dx / 200;
_root.b10.frictionY = _root.b10.dy / 200;
_root.b10.moving = true;
}
if (count < 6) {
rod._x = rod._x + 5;
} else {
rod._x = rod._x - 5;
}
}
}
Frame 11
stop();
stop();
Frame 12
i = 0;
while (i <= 9) {
_root["b" + i].timpIni = getTimer() + 80000;
i++;
}
_root.b4.timpIni = getTimer() + 10000;
Frame 13
stop();
ballsIn = 0;
Instance of Symbol 64 MovieClip "controller" in Frame 13
onClipEvent (load) {
function getDistanceSquare(clip, clip2) {
var _local2 = clip._x - clip2._x;
var _local1 = clip._y - clip2._y;
return((_local2 * _local2) + (_local1 * _local1));
}
ballsArray = [];
var n = 0;
while (n < 11) {
ballsArray[n] = _root["b" + n];
n++;
}
holesArray = [];
var n = 1;
while (n < 7) {
holesArray[n - 1] = _root["h" + n];
n++;
}
var k = 0;
while (k < ballsArray.length) {
ballsArray[k].dx = 0;
ballsArray[k].dy = 0;
ballsArray[k].moving = false;
ballsArray[k].disabled = false;
k++;
}
diameter = _root.b10._width;
diameterSquare = diameter * diameter;
bgLeft = 48 + (diameter / 2);
bgRight = 515 - (diameter / 2);
bgTop = 55 + (diameter / 2);
bgBottom = 345 - (diameter / 2);
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (fsec > 70) {
return(undefined);
}
var k = 0;
while (k < ballsArray.length) {
clip = ballsArray[k];
if (clip.moving == false) {
} else if (clip.disabled) {
} else if (clip.bounced) {
} else {
var m = 0;
while (m < ballsArray.length) {
clip2 = ballsArray[m];
if ((m <= k) && (clip2.moving)) {
} else if (clip2.disabled) {
} else {
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
clip.moving = true;
clip2.moving = true;
_root.bouncer.bounce(clip, clip2);
}
}
m++;
}
var m = 0;
while (m < holesArray.length) {
clip2 = holesArray[m];
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
fireN++;
duplicateMovieClip (_root.fire, "fire" + fireN, fireN);
_root["fire" + fireN].ball = clip;
_root["fire" + fireN].hole = clip2;
}
m++;
}
}
k++;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
t1 = getTimer();
fsec = t1 - t2;
t2 = t1;
var p = 0;
while (p < ballsArray.length) {
clip3 = ballsArray[p];
if (clip3.disabled) {
} else if (clip3.moving == false) {
} else {
clip3.dx = clip3.dx - clip3.frictionX;
clip3.dy = clip3.dy - clip3.frictionY;
clip3._x = clip3._x + clip3.dx;
clip3._y = clip3._y + clip3.dy;
dx = clip3.dx;
dy = clip3.dy;
if (clip3._x < bgLeft) {
clip3.dx = Math.abs(dx);
clip3.frictionX = Math.abs(clip3.frictionX);
} else if (clip3._x > bgRight) {
clip3.dx = -Math.abs(dx);
clip3.frictionX = -Math.abs(clip3.frictionX);
}
if (clip3._y < bgTop) {
clip3.dy = Math.abs(dy);
clip3.frictionY = Math.abs(clip3.frictionY);
} else if (clip3._y > bgBottom) {
clip3.dy = -Math.abs(dy);
clip3.frictionY = -Math.abs(clip3.frictionY);
}
if (((dx * dx) + (dy * dy)) < 0.003) {
clip3.dx = 0;
clip3.dy = 0;
clip3.frictionX = 0;
clip3.frictionY = 0;
clip3.moving = false;
}
}
p++;
}
}
}
Instance of Symbol 65 MovieClip "bouncer" in Frame 13
onClipEvent (load) {
function bounce(clip, clip2) {
var _local1 = clip;
var _local2 = clip2;
var angle = Math.atan2(_local1._y - _local2._y, _local1._x - _local2._x);
this._rotation = (angle * 180) / 3.141593;
var _local3 = {x:_local2.dx * 10, y:_local2.dy * 10};
this.globalToLocal(_local3);
var subVector2 = {x:_local3.x, y:0};
this.localToGlobal(subVector2);
var pt = {x:_local1.dx * 10, y:_local1.dy * 10};
this.globalToLocal(pt);
var subVector = {x:pt.x, y:0};
this.localToGlobal(subVector);
if ((_local3.x <= 0) && (pt.x >= 0)) {
} else {
var xSub = ((subVector2.x - subVector.x) / 10);
var ySub = ((subVector2.y - subVector.y) / 10);
_local1.dx = _local1.dx + xSub;
_local1.dy = _local1.dy + ySub;
_local2.dx = _local2.dx - xSub;
_local2.dy = _local2.dy - ySub;
var ang = Math.atan2(_local1.dy, _local1.dx);
_local1.frictionX = Math.cos(ang) / 20;
_local1.frictionY = Math.sin(ang) / 20;
var ang2 = Math.atan2(_local2.dy, _local2.dx);
_local2.frictionX = Math.cos(ang2) / 20;
_local2.frictionY = Math.sin(ang2) / 20;
}
}
}
Instance of Symbol 64 MovieClip "fire" in Frame 13
onClipEvent (load) {
function startGoHole(clip, clip2) {
ball.disabled = true;
animate = true;
framesNeed = int(_root.b10._width / Math.sqrt((ball.dx * ball.dx) + (ball.dy * ball.dy)));
dx = (hole._x - ball._x) / framesNeed;
dy = (hole._y - ball._y) / framesNeed;
count = 0;
}
function conclude() {
var _local2 = _root;
animate = false;
ball.moving = false;
ball._y = -300;
if (ball == _local2.b10) {
hole.gotoAndPlay(20);
} else {
_local2.ballsIn++;
_local2.score = _local2.score + ball.timpul;
_local2.scoreTXT.text = _local2.score;
if (_local2.score > _local2.best) {
_local2.best = _local2.score;
}
if (ball == _local2.b4) {
hole.gotoAndPlay(38);
} else {
hole.play();
}
ball._visible = false;
var balolInHole = -1;
var _local1 = 0;
while (_local1 < ballsArray.length) {
if (ballsArray[_local1] == ball) {
ballInHole = _local1;
break;
}
_local1++;
}
if (_local2.ballsIn >= 11) {
_local2.play();
}
if (ballInHole > -1) {
ballsArray.splice(ballInHole, 1);
}
}
removeMovieClip(this);
}
startGoHole();
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
ball._x = ball._x + dx;
ball._y = ball._y + dy;
count++;
if (count >= framesNeed) {
conclude();
}
}
}
Instance of Symbol 68 MovieClip in Frame 13
onClipEvent (load) {
function conclude() {
var _local1 = _root;
if (_local1.sunet == 1) {
_local1.son.start(0, 1);
}
animate = false;
rod._x = -(30 + (_local1.b10._width / 2));
_rotation = 0;
count = 0;
_y = -100;
}
ballsArray = _root.controller.ballsArray;
orgX = _root.b10._x;
orgY = _root.b10._y;
animate = false;
conclude();
}
onClipEvent (mouseDown) {
if (_root.paused == 0) {
if (_root.b10.disabled) {
_root.b10.disabled = false;
_root.b10._x = orgX;
_root.b10._y = orgY;
OK = false;
while (!OK) {
hit = false;
var h = 0;
while (h < (ballsArray.length - 1)) {
tempClip = ballsArray[h];
if ((Math.abs(tempClip._x - _root.b10._x) < _root.b10._width) && (Math.abs(tempClip._y - _root.b10._y) < _root.b10._width)) {
hit = true;
break;
}
h++;
}
if (hit) {
_root.b10._x = _root.b10._x + 5;
}
OK = true;
}
_root.b10.dx = 0;
_root.b10.dy = 0;
_root.b10.moving = false;
return(undefined);
}
if (_root.b10.moving) {
return(undefined);
}
_x = _root.b10._x;
_y = _root.b10._y;
dragging = true;
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
onClipEvent (mouseMove) {
if (_root.paused == 0) {
if (dragging) {
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
}
onClipEvent (mouseUp) {
if (_root.paused == 0) {
if (dragging) {
dragging = false;
animate = true;
count = 0;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
count++;
if (count > 12) {
conclude();
}
if (count == 6) {
_root.b10.dx = (10 * Math.cos(angle)) * (_root.power._currentframe / 20);
_root.b10.dy = (10 * Math.sin(angle)) * (_root.power._currentframe / 20);
_root.b10.frictionX = _root.b10.dx / 200;
_root.b10.frictionY = _root.b10.dy / 200;
_root.b10.moving = true;
}
if (count < 6) {
rod._x = rod._x + 5;
} else {
rod._x = rod._x - 5;
}
}
}
Frame 14
stop();
stop();
Frame 15
i = 0;
while (i <= 8) {
_root["b" + i].timpIni = getTimer() + 70000;
i++;
}
_root.b9.timpIni = getTimer() + 40000;
Frame 16
stop();
ballsIn = 0;
Instance of Symbol 64 MovieClip "controller" in Frame 16
onClipEvent (load) {
function getDistanceSquare(clip, clip2) {
var _local2 = clip._x - clip2._x;
var _local1 = clip._y - clip2._y;
return((_local2 * _local2) + (_local1 * _local1));
}
ballsArray = [];
var n = 0;
while (n < 11) {
ballsArray[n] = _root["b" + n];
n++;
}
holesArray = [];
var n = 1;
while (n < 7) {
holesArray[n - 1] = _root["h" + n];
n++;
}
var k = 0;
while (k < ballsArray.length) {
ballsArray[k].dx = 0;
ballsArray[k].dy = 0;
ballsArray[k].moving = false;
ballsArray[k].disabled = false;
k++;
}
diameter = _root.b10._width;
diameterSquare = diameter * diameter;
bgLeft = 48 + (diameter / 2);
bgRight = 515 - (diameter / 2);
bgTop = 55 + (diameter / 2);
bgBottom = 345 - (diameter / 2);
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (fsec > 70) {
return(undefined);
}
var k = 0;
while (k < ballsArray.length) {
clip = ballsArray[k];
if (clip.moving == false) {
} else if (clip.disabled) {
} else if (clip.bounced) {
} else {
var m = 0;
while (m < ballsArray.length) {
clip2 = ballsArray[m];
if ((m <= k) && (clip2.moving)) {
} else if (clip2.disabled) {
} else {
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
clip.moving = true;
clip2.moving = true;
_root.bouncer.bounce(clip, clip2);
}
}
m++;
}
var m = 0;
while (m < holesArray.length) {
clip2 = holesArray[m];
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
fireN++;
duplicateMovieClip (_root.fire, "fire" + fireN, fireN);
_root["fire" + fireN].ball = clip;
_root["fire" + fireN].hole = clip2;
}
m++;
}
}
k++;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
t1 = getTimer();
fsec = t1 - t2;
t2 = t1;
var p = 0;
while (p < ballsArray.length) {
clip3 = ballsArray[p];
if (clip3.disabled) {
} else if (clip3.moving == false) {
} else {
clip3.dx = clip3.dx - clip3.frictionX;
clip3.dy = clip3.dy - clip3.frictionY;
clip3._x = clip3._x + clip3.dx;
clip3._y = clip3._y + clip3.dy;
dx = clip3.dx;
dy = clip3.dy;
if (clip3._x < bgLeft) {
clip3.dx = Math.abs(dx);
clip3.frictionX = Math.abs(clip3.frictionX);
} else if (clip3._x > bgRight) {
clip3.dx = -Math.abs(dx);
clip3.frictionX = -Math.abs(clip3.frictionX);
}
if (clip3._y < bgTop) {
clip3.dy = Math.abs(dy);
clip3.frictionY = Math.abs(clip3.frictionY);
} else if (clip3._y > bgBottom) {
clip3.dy = -Math.abs(dy);
clip3.frictionY = -Math.abs(clip3.frictionY);
}
if (((dx * dx) + (dy * dy)) < 0.003) {
clip3.dx = 0;
clip3.dy = 0;
clip3.frictionX = 0;
clip3.frictionY = 0;
clip3.moving = false;
}
}
p++;
}
}
}
Instance of Symbol 65 MovieClip "bouncer" in Frame 16
onClipEvent (load) {
function bounce(clip, clip2) {
var _local1 = clip;
var _local2 = clip2;
var angle = Math.atan2(_local1._y - _local2._y, _local1._x - _local2._x);
this._rotation = (angle * 180) / 3.141593;
var _local3 = {x:_local2.dx * 10, y:_local2.dy * 10};
this.globalToLocal(_local3);
var subVector2 = {x:_local3.x, y:0};
this.localToGlobal(subVector2);
var pt = {x:_local1.dx * 10, y:_local1.dy * 10};
this.globalToLocal(pt);
var subVector = {x:pt.x, y:0};
this.localToGlobal(subVector);
if ((_local3.x <= 0) && (pt.x >= 0)) {
} else {
var xSub = ((subVector2.x - subVector.x) / 10);
var ySub = ((subVector2.y - subVector.y) / 10);
_local1.dx = _local1.dx + xSub;
_local1.dy = _local1.dy + ySub;
_local2.dx = _local2.dx - xSub;
_local2.dy = _local2.dy - ySub;
var ang = Math.atan2(_local1.dy, _local1.dx);
_local1.frictionX = Math.cos(ang) / 20;
_local1.frictionY = Math.sin(ang) / 20;
var ang2 = Math.atan2(_local2.dy, _local2.dx);
_local2.frictionX = Math.cos(ang2) / 20;
_local2.frictionY = Math.sin(ang2) / 20;
}
}
}
Instance of Symbol 64 MovieClip "fire" in Frame 16
onClipEvent (load) {
function startGoHole(clip, clip2) {
ball.disabled = true;
animate = true;
framesNeed = int(_root.b10._width / Math.sqrt((ball.dx * ball.dx) + (ball.dy * ball.dy)));
dx = (hole._x - ball._x) / framesNeed;
dy = (hole._y - ball._y) / framesNeed;
count = 0;
}
function conclude() {
var _local2 = _root;
animate = false;
ball.moving = false;
ball._y = -300;
if (ball == _local2.b10) {
hole.gotoAndPlay(20);
} else {
_local2.ballsIn++;
_local2.score = _local2.score + ball.timpul;
_local2.scoreTXT.text = _local2.score;
if (_local2.score > _local2.best) {
_local2.best = _local2.score;
}
if (ball == _local2.b9) {
hole.gotoAndPlay(38);
} else {
hole.play();
}
ball._visible = false;
var balolInHole = -1;
var _local1 = 0;
while (_local1 < ballsArray.length) {
if (ballsArray[_local1] == ball) {
ballInHole = _local1;
break;
}
_local1++;
}
if (_local2.ballsIn >= 11) {
_local2.play();
}
if (ballInHole > -1) {
ballsArray.splice(ballInHole, 1);
}
}
removeMovieClip(this);
}
startGoHole();
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
ball._x = ball._x + dx;
ball._y = ball._y + dy;
count++;
if (count >= framesNeed) {
conclude();
}
}
}
Instance of Symbol 68 MovieClip in Frame 16
onClipEvent (load) {
function conclude() {
var _local1 = _root;
if (_local1.sunet == 1) {
_local1.son.start(0, 1);
}
animate = false;
rod._x = -(30 + (_local1.b10._width / 2));
_rotation = 0;
count = 0;
_y = -100;
}
ballsArray = _root.controller.ballsArray;
orgX = _root.b10._x;
orgY = _root.b10._y;
animate = false;
conclude();
}
onClipEvent (mouseDown) {
if (_root.paused == 0) {
if (_root.b10.disabled) {
_root.b10.disabled = false;
_root.b10._x = orgX;
_root.b10._y = orgY;
OK = false;
while (!OK) {
hit = false;
var h = 0;
while (h < (ballsArray.length - 1)) {
tempClip = ballsArray[h];
if ((Math.abs(tempClip._x - _root.b10._x) < _root.b10._width) && (Math.abs(tempClip._y - _root.b10._y) < _root.b10._width)) {
hit = true;
break;
}
h++;
}
if (hit) {
_root.b10._x = _root.b10._x + 5;
}
OK = true;
}
_root.b10.dx = 0;
_root.b10.dy = 0;
_root.b10.moving = false;
return(undefined);
}
if (_root.b10.moving) {
return(undefined);
}
_x = _root.b10._x;
_y = _root.b10._y;
dragging = true;
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
onClipEvent (mouseMove) {
if (_root.paused == 0) {
if (dragging) {
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
}
onClipEvent (mouseUp) {
if (_root.paused == 0) {
if (dragging) {
dragging = false;
animate = true;
count = 0;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
count++;
if (count > 12) {
conclude();
}
if (count == 6) {
_root.b10.dx = (10 * Math.cos(angle)) * (_root.power._currentframe / 20);
_root.b10.dy = (10 * Math.sin(angle)) * (_root.power._currentframe / 20);
_root.b10.frictionX = _root.b10.dx / 200;
_root.b10.frictionY = _root.b10.dy / 200;
_root.b10.moving = true;
}
if (count < 6) {
rod._x = rod._x + 5;
} else {
rod._x = rod._x - 5;
}
}
}
Frame 17
stop();
stop();
Frame 18
i = 0;
while (i <= 8) {
_root["b" + i].timpIni = (getTimer() + 40000) + ((8 - i) * 10000);
i++;
}
_root.b9.timpIni = getTimer() + 30000;
Frame 19
stop();
ballsIn = 0;
Instance of Symbol 64 MovieClip "controller" in Frame 19
onClipEvent (load) {
function getDistanceSquare(clip, clip2) {
var _local2 = clip._x - clip2._x;
var _local1 = clip._y - clip2._y;
return((_local2 * _local2) + (_local1 * _local1));
}
ballsArray = [];
var n = 0;
while (n < 11) {
ballsArray[n] = _root["b" + n];
n++;
}
holesArray = [];
var n = 1;
while (n < 7) {
holesArray[n - 1] = _root["h" + n];
n++;
}
var k = 0;
while (k < ballsArray.length) {
ballsArray[k].dx = 0;
ballsArray[k].dy = 0;
ballsArray[k].moving = false;
ballsArray[k].disabled = false;
k++;
}
diameter = _root.b10._width;
diameterSquare = diameter * diameter;
bgLeft = 48 + (diameter / 2);
bgRight = 515 - (diameter / 2);
bgTop = 55 + (diameter / 2);
bgBottom = 345 - (diameter / 2);
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (fsec > 70) {
return(undefined);
}
var k = 0;
while (k < ballsArray.length) {
clip = ballsArray[k];
if (clip.moving == false) {
} else if (clip.disabled) {
} else if (clip.bounced) {
} else {
var m = 0;
while (m < ballsArray.length) {
clip2 = ballsArray[m];
if ((m <= k) && (clip2.moving)) {
} else if (clip2.disabled) {
} else {
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
clip.moving = true;
clip2.moving = true;
_root.bouncer.bounce(clip, clip2);
}
}
m++;
}
var m = 0;
while (m < holesArray.length) {
clip2 = holesArray[m];
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
fireN++;
duplicateMovieClip (_root.fire, "fire" + fireN, fireN);
_root["fire" + fireN].ball = clip;
_root["fire" + fireN].hole = clip2;
}
m++;
}
}
k++;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
t1 = getTimer();
fsec = t1 - t2;
t2 = t1;
var p = 0;
while (p < ballsArray.length) {
clip3 = ballsArray[p];
if (clip3.disabled) {
} else if (clip3.moving == false) {
} else {
clip3.dx = clip3.dx - clip3.frictionX;
clip3.dy = clip3.dy - clip3.frictionY;
clip3._x = clip3._x + clip3.dx;
clip3._y = clip3._y + clip3.dy;
dx = clip3.dx;
dy = clip3.dy;
if (clip3._x < bgLeft) {
clip3.dx = Math.abs(dx);
clip3.frictionX = Math.abs(clip3.frictionX);
} else if (clip3._x > bgRight) {
clip3.dx = -Math.abs(dx);
clip3.frictionX = -Math.abs(clip3.frictionX);
}
if (clip3._y < bgTop) {
clip3.dy = Math.abs(dy);
clip3.frictionY = Math.abs(clip3.frictionY);
} else if (clip3._y > bgBottom) {
clip3.dy = -Math.abs(dy);
clip3.frictionY = -Math.abs(clip3.frictionY);
}
if (((dx * dx) + (dy * dy)) < 0.003) {
clip3.dx = 0;
clip3.dy = 0;
clip3.frictionX = 0;
clip3.frictionY = 0;
clip3.moving = false;
}
}
p++;
}
}
}
Instance of Symbol 65 MovieClip "bouncer" in Frame 19
onClipEvent (load) {
function bounce(clip, clip2) {
var _local1 = clip;
var _local2 = clip2;
var angle = Math.atan2(_local1._y - _local2._y, _local1._x - _local2._x);
this._rotation = (angle * 180) / 3.141593;
var _local3 = {x:_local2.dx * 10, y:_local2.dy * 10};
this.globalToLocal(_local3);
var subVector2 = {x:_local3.x, y:0};
this.localToGlobal(subVector2);
var pt = {x:_local1.dx * 10, y:_local1.dy * 10};
this.globalToLocal(pt);
var subVector = {x:pt.x, y:0};
this.localToGlobal(subVector);
if ((_local3.x <= 0) && (pt.x >= 0)) {
} else {
var xSub = ((subVector2.x - subVector.x) / 10);
var ySub = ((subVector2.y - subVector.y) / 10);
_local1.dx = _local1.dx + xSub;
_local1.dy = _local1.dy + ySub;
_local2.dx = _local2.dx - xSub;
_local2.dy = _local2.dy - ySub;
var ang = Math.atan2(_local1.dy, _local1.dx);
_local1.frictionX = Math.cos(ang) / 20;
_local1.frictionY = Math.sin(ang) / 20;
var ang2 = Math.atan2(_local2.dy, _local2.dx);
_local2.frictionX = Math.cos(ang2) / 20;
_local2.frictionY = Math.sin(ang2) / 20;
}
}
}
Instance of Symbol 64 MovieClip "fire" in Frame 19
onClipEvent (load) {
function startGoHole(clip, clip2) {
ball.disabled = true;
animate = true;
framesNeed = int(_root.b10._width / Math.sqrt((ball.dx * ball.dx) + (ball.dy * ball.dy)));
dx = (hole._x - ball._x) / framesNeed;
dy = (hole._y - ball._y) / framesNeed;
count = 0;
}
function conclude() {
var _local2 = _root;
animate = false;
ball.moving = false;
ball._y = -300;
if (ball == _local2.b10) {
hole.gotoAndPlay(20);
} else {
_local2.ballsIn++;
_local2.score = _local2.score + ball.timpul;
_local2.scoreTXT.text = _local2.score;
if (_local2.score > _local2.best) {
_local2.best = _local2.score;
}
if (ball == _local2.b9) {
hole.gotoAndPlay(38);
} else {
hole.play();
}
ball._visible = false;
var balolInHole = -1;
var _local1 = 0;
while (_local1 < ballsArray.length) {
if (ballsArray[_local1] == ball) {
ballInHole = _local1;
break;
}
_local1++;
}
if (_local2.ballsIn >= 11) {
_local2.play();
}
if (ballInHole > -1) {
ballsArray.splice(ballInHole, 1);
}
}
removeMovieClip(this);
}
startGoHole();
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
ball._x = ball._x + dx;
ball._y = ball._y + dy;
count++;
if (count >= framesNeed) {
conclude();
}
}
}
Instance of Symbol 68 MovieClip in Frame 19
onClipEvent (load) {
function conclude() {
var _local1 = _root;
if (_local1.sunet == 1) {
_local1.son.start(0, 1);
}
animate = false;
rod._x = -(30 + (_local1.b10._width / 2));
_rotation = 0;
count = 0;
_y = -100;
}
ballsArray = _root.controller.ballsArray;
orgX = _root.b10._x;
orgY = _root.b10._y;
animate = false;
conclude();
}
onClipEvent (mouseDown) {
if (_root.paused == 0) {
if (_root.b10.disabled) {
_root.b10.disabled = false;
_root.b10._x = orgX;
_root.b10._y = orgY;
OK = false;
while (!OK) {
hit = false;
var h = 0;
while (h < (ballsArray.length - 1)) {
tempClip = ballsArray[h];
if ((Math.abs(tempClip._x - _root.b10._x) < _root.b10._width) && (Math.abs(tempClip._y - _root.b10._y) < _root.b10._width)) {
hit = true;
break;
}
h++;
}
if (hit) {
_root.b10._x = _root.b10._x + 5;
}
OK = true;
}
_root.b10.dx = 0;
_root.b10.dy = 0;
_root.b10.moving = false;
return(undefined);
}
if (_root.b10.moving) {
return(undefined);
}
_x = _root.b10._x;
_y = _root.b10._y;
dragging = true;
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
onClipEvent (mouseMove) {
if (_root.paused == 0) {
if (dragging) {
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
}
onClipEvent (mouseUp) {
if (_root.paused == 0) {
if (dragging) {
dragging = false;
animate = true;
count = 0;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
count++;
if (count > 12) {
conclude();
}
if (count == 6) {
_root.b10.dx = (10 * Math.cos(angle)) * (_root.power._currentframe / 20);
_root.b10.dy = (10 * Math.sin(angle)) * (_root.power._currentframe / 20);
_root.b10.frictionX = _root.b10.dx / 200;
_root.b10.frictionY = _root.b10.dy / 200;
_root.b10.moving = true;
}
if (count < 6) {
rod._x = rod._x + 5;
} else {
rod._x = rod._x - 5;
}
}
}
Frame 20
stop();
stop();
Frame 21
i = 0;
while (i <= 5) {
_root["b" + i].timpIni = getTimer() + 30000;
i++;
}
i = 6;
while (i <= 8) {
_root["b" + i].timpIni = getTimer() + 40000;
i++;
}
_root.b9.timpIni = getTimer() + 50000;
Frame 22
stop();
ballsIn = 0;
Instance of Symbol 64 MovieClip "controller" in Frame 22
onClipEvent (load) {
function getDistanceSquare(clip, clip2) {
var _local2 = clip._x - clip2._x;
var _local1 = clip._y - clip2._y;
return((_local2 * _local2) + (_local1 * _local1));
}
ballsArray = [];
var n = 0;
while (n < 11) {
ballsArray[n] = _root["b" + n];
n++;
}
holesArray = [];
var n = 1;
while (n < 7) {
holesArray[n - 1] = _root["h" + n];
n++;
}
var k = 0;
while (k < ballsArray.length) {
ballsArray[k].dx = 0;
ballsArray[k].dy = 0;
ballsArray[k].moving = false;
ballsArray[k].disabled = false;
k++;
}
diameter = _root.b10._width;
diameterSquare = diameter * diameter;
bgLeft = 48 + (diameter / 2);
bgRight = 515 - (diameter / 2);
bgTop = 55 + (diameter / 2);
bgBottom = 345 - (diameter / 2);
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (fsec > 70) {
return(undefined);
}
var k = 0;
while (k < ballsArray.length) {
clip = ballsArray[k];
if (clip.moving == false) {
} else if (clip.disabled) {
} else if (clip.bounced) {
} else {
var m = 0;
while (m < ballsArray.length) {
clip2 = ballsArray[m];
if ((m <= k) && (clip2.moving)) {
} else if (clip2.disabled) {
} else {
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
clip.moving = true;
clip2.moving = true;
_root.bouncer.bounce(clip, clip2);
}
}
m++;
}
var m = 0;
while (m < holesArray.length) {
clip2 = holesArray[m];
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
fireN++;
duplicateMovieClip (_root.fire, "fire" + fireN, fireN);
_root["fire" + fireN].ball = clip;
_root["fire" + fireN].hole = clip2;
}
m++;
}
}
k++;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
t1 = getTimer();
fsec = t1 - t2;
t2 = t1;
var p = 0;
while (p < ballsArray.length) {
clip3 = ballsArray[p];
if (clip3.disabled) {
} else if (clip3.moving == false) {
} else {
clip3.dx = clip3.dx - clip3.frictionX;
clip3.dy = clip3.dy - clip3.frictionY;
clip3._x = clip3._x + clip3.dx;
clip3._y = clip3._y + clip3.dy;
dx = clip3.dx;
dy = clip3.dy;
if (clip3._x < bgLeft) {
clip3.dx = Math.abs(dx);
clip3.frictionX = Math.abs(clip3.frictionX);
} else if (clip3._x > bgRight) {
clip3.dx = -Math.abs(dx);
clip3.frictionX = -Math.abs(clip3.frictionX);
}
if (clip3._y < bgTop) {
clip3.dy = Math.abs(dy);
clip3.frictionY = Math.abs(clip3.frictionY);
} else if (clip3._y > bgBottom) {
clip3.dy = -Math.abs(dy);
clip3.frictionY = -Math.abs(clip3.frictionY);
}
if (((dx * dx) + (dy * dy)) < 0.003) {
clip3.dx = 0;
clip3.dy = 0;
clip3.frictionX = 0;
clip3.frictionY = 0;
clip3.moving = false;
}
}
p++;
}
}
}
Instance of Symbol 65 MovieClip "bouncer" in Frame 22
onClipEvent (load) {
function bounce(clip, clip2) {
var _local1 = clip;
var _local2 = clip2;
var angle = Math.atan2(_local1._y - _local2._y, _local1._x - _local2._x);
this._rotation = (angle * 180) / 3.141593;
var _local3 = {x:_local2.dx * 10, y:_local2.dy * 10};
this.globalToLocal(_local3);
var subVector2 = {x:_local3.x, y:0};
this.localToGlobal(subVector2);
var pt = {x:_local1.dx * 10, y:_local1.dy * 10};
this.globalToLocal(pt);
var subVector = {x:pt.x, y:0};
this.localToGlobal(subVector);
if ((_local3.x <= 0) && (pt.x >= 0)) {
} else {
var xSub = ((subVector2.x - subVector.x) / 10);
var ySub = ((subVector2.y - subVector.y) / 10);
_local1.dx = _local1.dx + xSub;
_local1.dy = _local1.dy + ySub;
_local2.dx = _local2.dx - xSub;
_local2.dy = _local2.dy - ySub;
var ang = Math.atan2(_local1.dy, _local1.dx);
_local1.frictionX = Math.cos(ang) / 20;
_local1.frictionY = Math.sin(ang) / 20;
var ang2 = Math.atan2(_local2.dy, _local2.dx);
_local2.frictionX = Math.cos(ang2) / 20;
_local2.frictionY = Math.sin(ang2) / 20;
}
}
}
Instance of Symbol 64 MovieClip "fire" in Frame 22
onClipEvent (load) {
function startGoHole(clip, clip2) {
ball.disabled = true;
animate = true;
framesNeed = int(_root.b10._width / Math.sqrt((ball.dx * ball.dx) + (ball.dy * ball.dy)));
dx = (hole._x - ball._x) / framesNeed;
dy = (hole._y - ball._y) / framesNeed;
count = 0;
}
function conclude() {
var _local2 = _root;
animate = false;
ball.moving = false;
ball._y = -300;
if (ball == _local2.b10) {
hole.gotoAndPlay(20);
} else {
_local2.ballsIn++;
_local2.score = _local2.score + ball.timpul;
_local2.scoreTXT.text = _local2.score;
if (_local2.score > _local2.best) {
_local2.best = _local2.score;
}
if (ball == _local2.b9) {
hole.gotoAndPlay(38);
} else {
hole.play();
}
ball._visible = false;
var balolInHole = -1;
var _local1 = 0;
while (_local1 < ballsArray.length) {
if (ballsArray[_local1] == ball) {
ballInHole = _local1;
break;
}
_local1++;
}
if (_local2.ballsIn >= 11) {
_local2.play();
}
if (ballInHole > -1) {
ballsArray.splice(ballInHole, 1);
}
}
removeMovieClip(this);
}
startGoHole();
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
ball._x = ball._x + dx;
ball._y = ball._y + dy;
count++;
if (count >= framesNeed) {
conclude();
}
}
}
Instance of Symbol 68 MovieClip in Frame 22
onClipEvent (load) {
function conclude() {
var _local1 = _root;
if (_local1.sunet == 1) {
_local1.son.start(0, 1);
}
animate = false;
rod._x = -(30 + (_local1.b10._width / 2));
_rotation = 0;
count = 0;
_y = -100;
}
ballsArray = _root.controller.ballsArray;
orgX = _root.b10._x;
orgY = _root.b10._y;
animate = false;
conclude();
}
onClipEvent (mouseDown) {
if (_root.paused == 0) {
if (_root.b10.disabled) {
_root.b10.disabled = false;
_root.b10._x = orgX;
_root.b10._y = orgY;
OK = false;
while (!OK) {
hit = false;
var h = 0;
while (h < (ballsArray.length - 1)) {
tempClip = ballsArray[h];
if ((Math.abs(tempClip._x - _root.b10._x) < _root.b10._width) && (Math.abs(tempClip._y - _root.b10._y) < _root.b10._width)) {
hit = true;
break;
}
h++;
}
if (hit) {
_root.b10._x = _root.b10._x + 5;
}
OK = true;
}
_root.b10.dx = 0;
_root.b10.dy = 0;
_root.b10.moving = false;
return(undefined);
}
if (_root.b10.moving) {
return(undefined);
}
_x = _root.b10._x;
_y = _root.b10._y;
dragging = true;
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
onClipEvent (mouseMove) {
if (_root.paused == 0) {
if (dragging) {
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
}
onClipEvent (mouseUp) {
if (_root.paused == 0) {
if (dragging) {
dragging = false;
animate = true;
count = 0;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
count++;
if (count > 12) {
conclude();
}
if (count == 6) {
_root.b10.dx = (10 * Math.cos(angle)) * (_root.power._currentframe / 20);
_root.b10.dy = (10 * Math.sin(angle)) * (_root.power._currentframe / 20);
_root.b10.frictionX = _root.b10.dx / 200;
_root.b10.frictionY = _root.b10.dy / 200;
_root.b10.moving = true;
}
if (count < 6) {
rod._x = rod._x + 5;
} else {
rod._x = rod._x - 5;
}
}
}
Frame 23
stop();
stop();
Frame 24
i = 0;
while (i <= 9) {
_root["b" + i].timpIni = (getTimer() + 20000) + ((9 - i) * 10000);
i++;
}
Frame 25
stop();
ballsIn = 0;
Instance of Symbol 64 MovieClip "controller" in Frame 25
onClipEvent (load) {
function getDistanceSquare(clip, clip2) {
var _local2 = clip._x - clip2._x;
var _local1 = clip._y - clip2._y;
return((_local2 * _local2) + (_local1 * _local1));
}
ballsArray = [];
var n = 0;
while (n < 11) {
ballsArray[n] = _root["b" + n];
n++;
}
holesArray = [];
var n = 1;
while (n < 7) {
holesArray[n - 1] = _root["h" + n];
n++;
}
var k = 0;
while (k < ballsArray.length) {
ballsArray[k].dx = 0;
ballsArray[k].dy = 0;
ballsArray[k].moving = false;
ballsArray[k].disabled = false;
k++;
}
diameter = _root.b10._width;
diameterSquare = diameter * diameter;
bgLeft = 48 + (diameter / 2);
bgRight = 515 - (diameter / 2);
bgTop = 55 + (diameter / 2);
bgBottom = 345 - (diameter / 2);
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (fsec > 70) {
return(undefined);
}
var k = 0;
while (k < ballsArray.length) {
clip = ballsArray[k];
if (clip.moving == false) {
} else if (clip.disabled) {
} else if (clip.bounced) {
} else {
var m = 0;
while (m < ballsArray.length) {
clip2 = ballsArray[m];
if ((m <= k) && (clip2.moving)) {
} else if (clip2.disabled) {
} else {
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
clip.moving = true;
clip2.moving = true;
_root.bouncer.bounce(clip, clip2);
}
}
m++;
}
var m = 0;
while (m < holesArray.length) {
clip2 = holesArray[m];
xoff = clip2._x - clip._x;
yoff = clip2._y - clip._y;
if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) {
} else {
fireN++;
duplicateMovieClip (_root.fire, "fire" + fireN, fireN);
_root["fire" + fireN].ball = clip;
_root["fire" + fireN].hole = clip2;
}
m++;
}
}
k++;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
t1 = getTimer();
fsec = t1 - t2;
t2 = t1;
var p = 0;
while (p < ballsArray.length) {
clip3 = ballsArray[p];
if (clip3.disabled) {
} else if (clip3.moving == false) {
} else {
clip3.dx = clip3.dx - clip3.frictionX;
clip3.dy = clip3.dy - clip3.frictionY;
clip3._x = clip3._x + clip3.dx;
clip3._y = clip3._y + clip3.dy;
dx = clip3.dx;
dy = clip3.dy;
if (clip3._x < bgLeft) {
clip3.dx = Math.abs(dx);
clip3.frictionX = Math.abs(clip3.frictionX);
} else if (clip3._x > bgRight) {
clip3.dx = -Math.abs(dx);
clip3.frictionX = -Math.abs(clip3.frictionX);
}
if (clip3._y < bgTop) {
clip3.dy = Math.abs(dy);
clip3.frictionY = Math.abs(clip3.frictionY);
} else if (clip3._y > bgBottom) {
clip3.dy = -Math.abs(dy);
clip3.frictionY = -Math.abs(clip3.frictionY);
}
if (((dx * dx) + (dy * dy)) < 0.003) {
clip3.dx = 0;
clip3.dy = 0;
clip3.frictionX = 0;
clip3.frictionY = 0;
clip3.moving = false;
}
}
p++;
}
}
}
Instance of Symbol 65 MovieClip "bouncer" in Frame 25
onClipEvent (load) {
function bounce(clip, clip2) {
var _local1 = clip;
var _local2 = clip2;
var angle = Math.atan2(_local1._y - _local2._y, _local1._x - _local2._x);
this._rotation = (angle * 180) / 3.141593;
var _local3 = {x:_local2.dx * 10, y:_local2.dy * 10};
this.globalToLocal(_local3);
var subVector2 = {x:_local3.x, y:0};
this.localToGlobal(subVector2);
var pt = {x:_local1.dx * 10, y:_local1.dy * 10};
this.globalToLocal(pt);
var subVector = {x:pt.x, y:0};
this.localToGlobal(subVector);
if ((_local3.x <= 0) && (pt.x >= 0)) {
} else {
var xSub = ((subVector2.x - subVector.x) / 10);
var ySub = ((subVector2.y - subVector.y) / 10);
_local1.dx = _local1.dx + xSub;
_local1.dy = _local1.dy + ySub;
_local2.dx = _local2.dx - xSub;
_local2.dy = _local2.dy - ySub;
var ang = Math.atan2(_local1.dy, _local1.dx);
_local1.frictionX = Math.cos(ang) / 20;
_local1.frictionY = Math.sin(ang) / 20;
var ang2 = Math.atan2(_local2.dy, _local2.dx);
_local2.frictionX = Math.cos(ang2) / 20;
_local2.frictionY = Math.sin(ang2) / 20;
}
}
}
Instance of Symbol 64 MovieClip "fire" in Frame 25
onClipEvent (load) {
function startGoHole(clip, clip2) {
ball.disabled = true;
animate = true;
framesNeed = int(_root.b10._width / Math.sqrt((ball.dx * ball.dx) + (ball.dy * ball.dy)));
dx = (hole._x - ball._x) / framesNeed;
dy = (hole._y - ball._y) / framesNeed;
count = 0;
}
function conclude() {
var _local2 = _root;
animate = false;
ball.moving = false;
ball._y = -300;
if (ball == _local2.b10) {
hole.gotoAndPlay(20);
} else {
_local2.ballsIn++;
_local2.score = _local2.score + ball.timpul;
_local2.scoreTXT.text = _local2.score;
if (_local2.score > _local2.best) {
_local2.best = _local2.score;
}
if (ball == _local2.b9) {
hole.gotoAndPlay(38);
} else {
hole.play();
}
ball._visible = false;
var balolInHole = -1;
var _local1 = 0;
while (_local1 < ballsArray.length) {
if (ballsArray[_local1] == ball) {
ballInHole = _local1;
break;
}
_local1++;
}
if (_local2.ballsIn >= 11) {
_local2.play();
}
if (ballInHole > -1) {
ballsArray.splice(ballInHole, 1);
}
}
removeMovieClip(this);
}
startGoHole();
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
ball._x = ball._x + dx;
ball._y = ball._y + dy;
count++;
if (count >= framesNeed) {
conclude();
}
}
}
Instance of Symbol 68 MovieClip in Frame 25
onClipEvent (load) {
function conclude() {
var _local1 = _root;
if (_local1.sunet == 1) {
_local1.son.start(0, 1);
}
animate = false;
rod._x = -(30 + (_local1.b10._width / 2));
_rotation = 0;
count = 0;
_y = -100;
}
ballsArray = _root.controller.ballsArray;
orgX = _root.b10._x;
orgY = _root.b10._y;
animate = false;
conclude();
}
onClipEvent (mouseDown) {
if (_root.paused == 0) {
if (_root.b10.disabled) {
_root.b10.disabled = false;
_root.b10._x = orgX;
_root.b10._y = orgY;
OK = false;
while (!OK) {
hit = false;
var h = 0;
while (h < (ballsArray.length - 1)) {
tempClip = ballsArray[h];
if ((Math.abs(tempClip._x - _root.b10._x) < _root.b10._width) && (Math.abs(tempClip._y - _root.b10._y) < _root.b10._width)) {
hit = true;
break;
}
h++;
}
if (hit) {
_root.b10._x = _root.b10._x + 5;
}
OK = true;
}
_root.b10.dx = 0;
_root.b10.dy = 0;
_root.b10.moving = false;
return(undefined);
}
if (_root.b10.moving) {
return(undefined);
}
_x = _root.b10._x;
_y = _root.b10._y;
dragging = true;
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
onClipEvent (mouseMove) {
if (_root.paused == 0) {
if (dragging) {
angle = Math.atan2(_root._ymouse - _y, _root._xmouse - _x);
_rotation = ((angle * 180) / 3.141593);
}
}
}
onClipEvent (mouseUp) {
if (_root.paused == 0) {
if (dragging) {
dragging = false;
animate = true;
count = 0;
}
}
}
onClipEvent (enterFrame) {
if (_root.paused == 0) {
if (!animate) {
return(undefined);
}
count++;
if (count > 12) {
conclude();
}
if (count == 6) {
_root.b10.dx = (10 * Math.cos(angle)) * (_root.power._currentframe / 20);
_root.b10.dy = (10 * Math.sin(angle)) * (_root.power._currentframe / 20);
_root.b10.frictionX = _root.b10.dx / 200;
_root.b10.frictionY = _root.b10.dy / 200;
_root.b10.moving = true;
}
if (count < 6) {
rod._x = rod._x + 5;
} else {
rod._x = rod._x - 5;
}
}
}
Frame 26
stop();
fScore.text = _root.score;
stop();
Frame 27
stop();
fScore.text = _root.score;
Symbol 6 MovieClip [hitter] Frame 1
this.onMouseUp = function () {
startAnimate = true;
};
dp = 2;
this.onEnterFrame = function () {
var _local1 = this;
var _local2 = _root;
if (startAnimate) {
pos2 = int(pos / 6) + 1;
_local1.rod._x = _local1.rod._x + _local1.dx;
count++;
if (count == 8) {
_local2.startBall(_rotation, pos2);
_local1.dx = 0;
return;
}
if (count > 16) {
_local1.removeMovieClip();
}
} else {
_local1._rotation = 57.29578 * Math.atan2(_local2._ymouse - _y, _local2._xmouse - _x);
pos = pos + dp;
((pos > 60) ? ((dp = -2)) : null);
((pos < 1) ? ((dp = 2)) : null);
rod._x = -20 - pos;
_local1.dx = pos / 8;
}
};
Symbol 14 MovieClip Frame 1
stop();
Symbol 21 MovieClip Frame 63
stop();
Symbol 21 MovieClip Frame 272
_root.gotoAndStop(2);
Symbol 32 MovieClip Frame 1
stop();
Symbol 32 MovieClip Frame 2
if (_root.sunet == 1) {
_root.son3.start(0.7, 1);
}
Symbol 32 MovieClip Frame 12
gotoAndStop (1);
Symbol 32 MovieClip Frame 20
if (_root.sunet == 1) {
_root.son3.start(0.7, 1);
if (_root.score > 50) {
_root.score = _root.score - 50;
_root.scoreTXT.text = _root.score;
}
}
Symbol 32 MovieClip Frame 30
gotoAndStop (1);
Symbol 32 MovieClip Frame 38
if (_root.sunet == 1) {
_root.son2.start(5, 1);
}
Symbol 32 MovieClip Frame 48
gotoAndStop (1);
Symbol 40 Button
on (release) {
_root.gotoAndPlay("l1");
}
Symbol 49 MovieClip Frame 1
if (kxx == null) {
this.stop();
kxx = 1;
}
Symbol 51 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.paused == 0) {
timpul = Math.round((timpIni - getTimer()) / 1000);
timpTXT = Math.round(timpul / 10);
timp.text = timpTXT;
if ((timp.text == "0") && (this._visible == 1)) {
_root.gotoAndStop("gameOver");
}
}
};
Symbol 53 MovieClip Frame 1
this.onEnterFrame = function () {
if (_root.paused == 0) {
timpul = Math.round((timpIni - getTimer()) / 1000);
timpTXT = Math.round(timpul / 10);
timp.text = timpTXT;
if ((timp.text == "0") && (this._visible == 1)) {
_root.gotoAndStop("gameOver");
}
}
};
Symbol 60 Button
on (release) {
_root.gotoAndStop(2);
}
Symbol 62 Button
on (release) {
if (_root.paused == 0) {
oldTimp = getTimer();
_root.paused = 1;
} else {
timpInter = getTimer() - oldTimp;
i = 0;
while (i <= 9) {
_root["b" + i].timpIni = _root["b" + i].timpIni + timpInter;
i++;
}
_root.paused = 0;
}
}
Symbol 73 Button
on (release) {
_root.play();
}
Symbol 82 Button
on (release) {
_root.gotoAndStop(2);
}