Frame 1
Turn = 1;
Rehit = 0;
fault = 0;
CheckTurn = 0;
FirstHit = 0;
FirstContact = 0;
que.y = 150;
Allstop = 0;
messages = 0;
Highlight = Turn;
Roquet_Button._visible = false;
Roquet_Button.onRelease = function () {
this._visible = false;
Cont_Button._visible = false;
messages = 0;
ballsArray[Turn].Croquet = 1;
ballsArray[Turn].WicketBonus = 0;
Rehit = 1;
};
Cont_Button._visible = false;
Cont_Button.onRelease = function () {
this._visible = false;
Roquet_Button._visible = false;
messages = 0;
ballsArray[Turn].WicketBonus = 1;
ballsArray[Turn].Croquet = 0;
Rehit = 1;
Highlight = Turn;
ballsArray[Turn].d1 = 0;
ballsArray[Turn].d2 = 0;
ballsArray[Turn].d3 = 0;
ballsArray[Turn].d4 = 0;
};
Wicket_Turn._x = 25;
Wicket_Turn._y = 205;
HitSound = new Sound();
HitSound.attachSound("SoundHit");
ballsArray = [];
polesArray = [];
clipsArray = [];
court.x = court._x;
court.y = court._y;
X = (court._x = 150);
Y = (court._y = 50);
replay.x = (replay._x = 50);
replay.y = (replay._y = 5);
var n = 1;
while (n < 5) {
var ball = _root["b" + n];
ball.id = n;
ball.dx = (ball.dy = 0);
ball.frictionX = (ball.frictionY = 0);
ball.moving = false;
ball.x = ball._x;
ball.y = ball._y;
ballsArray[n] = ball;
ball.d1 = 0;
ball.d2 = 0;
ball.d3 = 0;
ball.d4 = 0;
ball.score = 0;
ball.wicket = 1;
ball.WicketBonus = 0;
ball.Croquet = 0;
ball.Continuation = 0;
ball.rover = eval("False");
n++;
}
b1.cId = "ball_blue";
b1.team = 1;
b1.x = (X + 25) + 540;
b1.y = ((Y + 25) + 180) - 30;
b1._x = (X + 25) + 540;
b1._y = ((Y + 25) + 180) - 30;
b2.cId = "ball_red";
b2.team = 2;
b2.x = (X + 500) + 25;
b2.y = Y - 20;
b2._x = (X + 500) + 25;
b2._y = Y - 20;
b3.cId = "ball_black";
b3.team = 1;
b3.x = (X + 500) + 50;
b3.y = Y - 20;
b3._x = (X + 500) + 50;
b3._y = Y - 20;
b4.cId = "ball_yellow";
b4.team = 2;
b4.x = (X + 500) + 75;
b4.y = Y - 20;
b4._x = (X + 500) + 75;
b4._y = Y - 20;
var n = 1;
while (n < 14) {
var pole = _root["p" + n];
pole.id = n;
pole.dx = (pole.dy = 0);
pole.frictionX = (pole.frictionY = 0);
pole.moving = false;
pole.x = pole._x;
pole.y = pole._y;
polesArray[n] = pole;
n++;
}
p1.x = (p1._x = ((X + 25) + 540) - 12);
p1.y = (p1._y = (Y + 25) + 180);
p8.x = (p8._x = ((X + 25) + 540) + 12);
p8.y = (p8._y = (Y + 25) + 180);
p2.x = (p2._x = ((X + 25) + 540) - 12);
p2.y = (p2._y = (Y + 25) + 720);
p7.x = (p7._x = ((X + 25) + 540) + 12);
p7.y = (p7._y = (Y + 25) + 720);
p3.x = (p3._x = ((X + 25) + 180) - 12);
p3.y = (p3._y = (Y + 25) + 720);
p10.x = (p10._x = ((X + 25) + 180) + 12);
p10.y = (p10._y = (Y + 25) + 720);
p4.x = (p4._x = ((X + 25) + 180) - 12);
p4.y = (p4._y = (Y + 25) + 180);
p9.x = (p9._x = ((X + 25) + 180) + 12);
p9.y = (p9._y = (Y + 25) + 180);
p5.x = (p5._x = ((X + 25) + 360) - 12);
p5.y = (p5._y = (Y + 25) + 270);
p12.x = (p12._x = ((X + 25) + 360) + 12);
p12.y = (p12._y = (Y + 25) + 270);
p6.x = (p6._x = ((X + 25) + 360) - 12);
p6.y = (p6._y = (Y + 25) + 630);
p11.x = (p11._x = ((X + 25) + 360) + 12);
p11.y = (p11._y = (Y + 25) + 630);
p13.x = (p13._x = (X + 25) + 360);
p13.y = (p13._y = (Y + 25) + 450);
var n = 1;
while (n < 5) {
var clip = _root["c" + n];
clip.id = n;
clip.dx = (clip.dy = 0);
clip.frictionX = (clip.frictionY = 0);
clip.moving = false;
clip.x = (clip._x = p1.x - 15);
clip.y = (clip._y = (p1.y - 15) + (n * 6));
clipsArray[n] = clip;
n++;
}
b1b2.x = (b1b2._x = 40);
b2b3.x = (b2b3._x = 40);
b3b4.x = (b3b4._x = 40);
b4b1.x = (b4b1._x = 40);
b1b3.x = (b1b3._x = 60);
b2b4.x = (b2b4._x = 60);
b3b1.x = (b3b1._x = 60);
b4b2.x = (b4b2._x = 60);
b1b4.x = (b1b4._x = 80);
b2b1.x = (b2b1._x = 80);
b3b2.x = (b3b2._x = 80);
b4b3.x = (b4b3._x = 80);
b1b2.y = (b1b2._y = 67.5);
b1b3.y = (b1b3._y = 67.5);
b1b4.y = (b1b4._y = 67.5);
b2b3.y = (b2b3._y = 87.5);
b2b4.y = (b2b4._y = 87.5);
b2b1.y = (b2b1._y = 87.5);
b3b4.y = (b3b4._y = 107.5);
b3b1.y = (b3b1._y = 107.5);
b3b2.y = (b3b2._y = 107.5);
b4b1.y = (b4b1._y = 127.5);
b4b2.y = (b4b2._y = 127.5);
b4b3.y = (b4b3._y = 127.5);
diameter = 15;
this.onMouseDown = function () {
var _local1 = _root;
if (messages == 1) {
} else {
for (var _local3 in ballsArray) {
if (ballsArray[_local3].moving) {
return;
}
}
for (var _local2 in ballsArray) {
if (ballsArray[_local2].hitTest(_local1._xmouse, _local1._ymouse, true)) {
if (Turn != _local2) {
return;
}
hitball_x = _local1["b" + _local2]._x;
hitball_y = _local1["b" + _local2]._y;
que = _local1["b" + _local2];
attachMovie("hitter", "hitter1", 100);
hitter1._x = hitball_x;
hitter1._y = hitball_y;
}
}
}
};
this.onEnterFrame = function () {
if ((Highlight == Turn) && (ballsArray[Turn].Croquet > 0)) {
Highlight = ballsArray[Turn].Croquet;
Yshift(ballsArray, polesArray, court, que, clipsArray, Highlight);
} else {
if ((((Allstop == 1) && (CheckTurn == 1)) && (messages == 0)) && (shift == 0)) {
if (fault == 1) {
Rehit = 0;
ballsArray[Turn].wicketBonus = 0;
ballsArray[Turn].Croquet = 0;
fault = 0;
}
if (ballsArray[Turn].WicketBonus == 1) {
if (ballsArray[Turn].Croquet == 0) {
ballsArray[Turn].WicketBonus = 0;
Rehit = 1;
Highlight = Turn;
}
if (ballsArray[Turn].Croquet > 0) {
messages = 1;
Roquet_Button._visible = true;
Cont_Button._visible = true;
return;
}
}
OutofBounds(ballsArray);
DeadnessUpdate(ballsArray);
CheckTurn = 0;
if (ballsArray[Turn].Croquet > 0) {
ballsArray[Turn].visible = false;
CroquetSet(ballsArray, Turn);
Rehit = 1;
Highlight = Turn;
}
if (Rehit == 0) {
Turn = Turn + 1;
if (Turn == 5) {
Turn = 1;
}
Highlight = Turn;
if (Turn == 1) {
Wicket_Turn._y = 205;
}
if (Turn == 2) {
Wicket_Turn._y = 305;
}
if (Turn == 3) {
Wicket_Turn._y = 405;
}
if (Turn == 4) {
Wicket_Turn._y = 505;
}
if (FirstHit == 0) {
StartPos();
}
ballsArray[Turn].WicketBonus = 0;
ballsArray[Turn].Croquet = 0;
ballsArray[Turn].Continuation = 0;
}
score1.text = ballsArray[1].wicket - 1;
score2.text = ballsArray[2].wicket - 1;
score3.text = ballsArray[3].wicket - 1;
score4.text = ballsArray[4].wicket - 1;
Rehit = 0;
}
Allstop = 1;
var k = 1;
while (k < ballsArray.length) {
var ball = ballsArray[k];
if ((!ball) || (!ball.moving)) {
} else {
CheckTurn = 1;
AllStop = 0;
if (CheckWicket(ball)) {
ball.d1 = 0;
ball.d2 = 0;
ball.d3 = 0;
ball.d4 = 0;
}
var _local2 = 1;
while (_local2 < ballsArray.length) {
var _local3 = ballsArray[_local2];
if ((((!ball) || (!_local3)) || (_local3.bounced)) || ((_local2 <= k) && (_local3.moving))) {
} else {
checkBounce(ball, _local3, ballsArray);
var _local1 = 1;
while (_local1 < polesArray.length) {
var pole = polesArray[_local1];
checkPole(ball, pole);
_local1++;
}
}
_local2++;
}
}
k++;
}
for (var k in ballsArray) {
var ball = ballsArray[k];
if (ball) {
ball.bounced = false;
checkEdges(ball, court);
updateBall(ball);
}
}
Yshift(ballsArray, polesArray, court, que, clipsArray, Highlight);
}
};
startBall = function (stickRotation, force) {
stickRotation = stickRotation * (Math.PI/180);
with (que) {
QueHit = 0;
dx = (force * 0.6) * Math.cos(stickRotation);
dy = (force * 0.6) * Math.sin(stickRotation);
frictionX = dx / 220;
frictionY = dy / 220;
moving = true;
FirstContact = 0;
}
};
checkBounce = function (ball1, ball2) {
var _local1 = ball1;
var _local2 = ball2;
var distx = (_local1.x - _local2.x);
var _local3 = _local1.y - _local2.y;
var hy1 = ((distx * distx) + (_local3 * _local3));
if (hy1 > 225) {
return(false);
}
var hy = Math.sqrt(hy1);
var cos = (distx / hy);
var sin = (_local3 / hy);
var dVector = (((_local1.dx - _local2.dx) * cos) + ((_local1.dy - _local2.dy) * sin));
if (dVector >= 0) {
} else {
var dvx = (dVector * cos);
var dvy = (dVector * sin);
_local1.dx = _local1.dx - dvx;
_local1.dy = _local1.dy - dvy;
_local2.dx = _local2.dx + dvx;
_local2.dy = _local2.dy + dvy;
if (_local1.dx == 0) {
_local1.dx = -1E-7;
}
if (_local1.dy == 0) {
_local1.dy = -1E-7;
}
if (_local2.dx == 0) {
_local2.dx = -1E-7;
}
if (_local2.dy == 0) {
_local2.dy = -1E-7;
}
_root.HitSound.start();
var h1 = Math.sqrt((_local1.dx * _local1.dx) + (_local1.dy * _local1.dy));
_local1.frictionX = _local1.dx / (20 * h1);
_local1.frictionY = _local1.dy / (20 * h1);
var h2 = Math.sqrt((_local2.dx * _local2.dx) + (_local2.dy * _local2.dy));
_local2.frictionX = _local2.dx / (20 * h2);
_local2.frictionY = _local2.dy / (20 * h2);
_local1.moving = (_local1.bounced = true);
_local2.moving = (_local2.bounced = true);
if (_local2.id == que.id) {
trace("Ball2que");
}
if (_local1.id == que.id) {
if (_local1.Croquet == _local2.id) {
_local1.Croquet = 0;
ballsArray[Turn].visible = true;
Highlight = Turn;
Rehit = 1;
return(true);
}
if (FirstContact == 0) {
_local1.Croquet = _local2.id;
if (_local2.id == 1) {
if (_local1.d1 == 1) {
fault = 1;
}
_local1.d1 = 1;
}
if (_local2.id == 2) {
if (_local1.d2 == 1) {
fault = 1;
}
_local1.d2 = 1;
}
if (_local2.id == 3) {
if (_local1.d3 == 1) {
fault = 1;
}
_local1.d3 = 1;
}
if (_local2.id == 4) {
if (_local1.d4 == 1) {
fault = 1;
}
_local1.d4 = 1;
}
FirstContact = 1;
}
}
return(true);
}
return(undefined);
};
checkEdges = function (ball, court) {
if (!ball) {
return(undefined);
}
with (ball) {
if (x < (court._x + 17.5)) {
((dx > 0) ? null : (eval ((dx = dx / 10))((dy = dy / 10))));
} else if (x > ((720 + court._x) + 32.5)) {
((dx < 0) ? null : (eval ((dx = dx / 10))((dy = dy / 10))));
}
if (y < (court._y + 17.5)) {
((dy > 0) ? null : (eval ((dy = dy / 10))((dx = dx / 10))));
} else if (y > ((court._y + 900) + 32.5)) {
((dy < 0) ? null : (eval ((dy = dy / 10))((dx = dx / 10))));
}
}
};
updateBall = function (ball) {
if (!ball) {
return(undefined);
}
with (ball) {
dx = dx - frictionX;
dy = dy - frictionY;
if (((dx * dx) + (dy * dy)) < 0.003) {
dx = (dy = (frictionX = (frictionY = 0)));
moving = false;
return(undefined);
}
if ((dx != 0) || (odx != 0)) {
_x = x;
}
if ((dy != 0) || (ody != 0)) {
_y = y;
}
x = x + dx;
y = y + dy;
ball.odx = dx;
ball.ody = dy;
}
};
Yshift = function (ballsArray, polesArray, court, que, clipsArray, Highlight) {
var _local1 = clipsArray;
shift = 0;
bside = ballsArray[Highlight].y - court.y;
cside = _local1[Highlight].y - court.y;
if (((bside < 550) && (cside > 550)) && (ballsArray[Highlight].y > 80)) {
shift = -4;
shifts.text = bside;
}
if ((bside > 550) && (cside > 550)) {
shift = -4;
shifts.text = bside;
}
if (((bside > 550) && (cside < 550)) && (ballsArray[Highlight].y < 540)) {
shift = 4;
shifts.text = bside;
}
if ((bside < 550) && (cside < 550)) {
shift = 4;
shifts.text = bside;
}
if (ballsArray[Highlight].y > 580) {
shift = -math.abs(que.dy);
if (ballsArray[Highlight].dy == 0) {
shift = -4;
shifts.text = bside;
}
}
if (ballsArray[Highlight].y < 30) {
shift = math.abs(que.dy);
if (ballsArray[Highlight].dy == 0) {
shift = 4;
shifts.text = bside;
}
}
if ((shift < 0) && (court.y < -500)) {
shift = 0;
}
if ((shift > 0) && (court.y > 15)) {
shift = 0;
}
court.y = court.y + shift;
court._y = court._y + shift;
Y = court._y;
p1.y = (p1._y = (Y + 25) + 180);
p8.y = (p8._y = (Y + 25) + 180);
p2.y = (p2._y = (Y + 25) + 720);
p7.y = (p7._y = (Y + 25) + 720);
p3.y = (p3._y = (Y + 25) + 720);
p10.y = (p10._y = (Y + 25) + 720);
p4.y = (p4._y = (Y + 25) + 180);
p9.y = (p9._y = (Y + 25) + 180);
p5.y = (p5._y = (Y + 25) + 270);
p12.y = (p12._y = (Y + 25) + 270);
p6.y = (p6._y = (Y + 25) + 630);
p11.y = (p11._y = (Y + 25) + 630);
p13.y = (p13._y = (Y + 25) + 450);
for (var k in ballsArray) {
var _local2 = ballsArray[k];
_local2._y = _local2._y + shift;
_local2.y = _local2.y + shift;
var _local3 = _local2.wicket;
_local1[k].x = (_local1[k]._x = _root["p" + _local3].x - 15);
if (_local2.wicket > 6) {
_local1[k].x = (_local1[k]._x = _root["p" + _local3].x + 15);
}
_local1[k].y = (_local1[k]._y = (_root["p" + _local3].y - 15) + (k * 6));
}
};
StartPos = function () {
var _local1 = _root;
_local1["b" + Turn].x = (X + 25) + 540;
_local1["b" + Turn].y = ((Y + 25) + 180) - 25.7;
_local1["b" + Turn]._x = (X + 25) + 540;
_local1["b" + Turn]._y = ((Y + 25) + 180) - 25.7;
if (Turn == 4) {
FirstHit = 1;
}
};
checkPole = function (ball1, ball2) {
var _local1 = ball1;
var _local2 = ball2;
var distx = (_local1.x - _local2.x);
var _local3 = _local1.y - _local2.y;
var hy1 = ((distx * distx) + (_local3 * _local3));
if (hy1 > 156) {
return(false);
}
var hy = Math.sqrt(hy1);
var cos = (distx / hy);
var sin = (_local3 / hy);
var dVector = (((_local1.dx - _local2.dx) * cos) + ((_local1.dy - _local2.dy) * sin));
if (dVector >= 0) {
} else {
var dvx = ((1.2 * dVector) * cos);
var dvy = ((1.2 * dVector) * sin);
_local1.dx = _local1.dx - dvx;
_local1.dy = _local1.dy - dvy;
_local2.dx = 0;
_local2.dy = 0;
if (_local1.dx == 0) {
_local1.dx = -1E-7;
}
if (_local1.dy == 0) {
_local1.dy = -1E-7;
}
var h1 = Math.sqrt((_local1.dx * _local1.dx) + (_local1.dy * _local1.dy));
_local1.frictionX = _local1.dx / (20 * h1);
_local1.frictionY = _local1.dy / (20 * h1);
_local1.moving = (_local1.bounced = true);
return(true);
}
return(undefined);
};
DeadnessUpdate = function (ballsArray) {
var _local2 = _root;
var _local3 = ballsArray;
b1b2.x = (b1b2._x = 40);
b2b3.x = (b2b3._x = 40);
b3b4.x = (b3b4._x = 40);
b4b1.x = (b4b1._x = 40);
b1b3.x = (b1b3._x = 60);
b2b4.x = (b2b4._x = 60);
b3b1.x = (b3b1._x = 60);
b4b2.x = (b4b2._x = 60);
b1b4.x = (b1b4._x = 80);
b2b1.x = (b2b1._x = 80);
b3b2.x = (b3b2._x = 80);
b4b3.x = (b4b3._x = 80);
for (var k in _local3) {
var _local1 = _local3[k];
if (_local1.d1 == 1) {
_local2[(("b" + k) + "b") + 1]._x = _local2[(("b" + k) + "b") + 1]._x - 300;
}
if (_local1.d2 == 1) {
_local2[(("b" + k) + "b") + 2]._x = _local2[(("b" + k) + "b") + 2]._x - 300;
}
if (_local1.d3 == 1) {
_local2[(("b" + k) + "b") + 3]._x = _local2[(("b" + k) + "b") + 3]._x - 300;
}
if (_local1.d4 == 1) {
_local2[(("b" + k) + "b") + 4]._x = _local2[(("b" + k) + "b") + 4]._x - 300;
}
}
};
CheckWicket = function (ball) {
var _local2 = ball;
var _local3 = _root;
var _local1 = _local2.wicket;
if (((((((_local1 == 1) || (_local1 == 2)) || (_local1 == 10)) || (_local1 == 9)) || (_local1 == 5)) || (_local1 == 12)) || (_local1 == 6)) {
if ((_local3["p" + _local1].y < _local2.y) && (_local2.y < (_local3["p" + _local1].y + 10))) {
if (_local2.dy > 0.5) {
if (_local1 < 7) {
if ((_local3["p" + _local1].x < _local2.x) && (_local2.x < (_local3["p" + _local1].x + 24))) {
_local2.wicket = _local2.wicket + 1;
_local2.WicketBonus = 1;
return(true);
}
}
if (_local1 > 6) {
if ((_local3["p" + _local1].x > _local2.x) && (_local2.x > (_local3["p" + _local1].x - 24))) {
_local2.wicket = _local2.wicket + 1;
_local2.WicketBonus = 1;
return(true);
}
}
}
}
}
if (((((_local1 == 8) || (_local1 == 7)) || (_local1 == 3)) || (_local1 == 4)) || (_local1 == 11)) {
if ((_local3["p" + _local1].y > _local2.y) && (_local2.y > (_local3["p" + _local1].y - 10))) {
if (_local2.dy < 0.5) {
if (_local1 < 7) {
if ((_local3["p" + _local1].x < _local2.x) && (_local2.x < (_local3["p" + _local1].x + 24))) {
_local2.wicket = _local2.wicket + 1;
_local2.WicketBonus = 1;
return(true);
}
}
if (_local1 > 6) {
if ((_local3["p" + _local1].x > _local2.x) && (_local2.x > (_local3["p" + _local1].x - 24))) {
_local2.wicket = _local2.wicket + 1;
_local2.WicketBonus = 1;
return(true);
}
}
}
}
}
return(false);
};
OutofBounds = function (ballsArray) {
var _local1 = ballsArray;
for (var k in _local1) {
var _local2 = _local1[k];
if (_local2._x < (court._x + 17.5)) {
_local2._x = _local2._x + 50;
_local2.x = _local2._x;
for (var _local3 in _local1) {
if (_local1[k].hitTest(_local1[_local3])) {
if (_local1[_local3].id != _local1[k].id) {
_local1[k]._y = _local1[_local3]._y + 20;
_local1[k].y = _local1[k]._y;
}
}
}
}
if (_local2._x > ((720 + court._x) + 32.5)) {
_local2._x = _local2._x - 50;
_local2.x = _local2._x;
for (var _local3 in _local1) {
if (_local1[k].hitTest(_local1[_local3])) {
if (_local1[_local3] != _local1[k]) {
_local1[k]._y = _local1[_local3]._y + 20;
_local1[k].y = _local1[k]._y;
}
}
}
}
if (((court._y + 5) < _local2._y) && (_local2._y < (court._y + 17.5))) {
_local2._y = _local2._y + 50;
_local2.y = _local2._y;
for (var _local3 in _local1) {
if (_local1[k].hitTest(_local1[_local3])) {
if (_local1[_local3] != _local1[k]) {
_local1[k]._x = _local1[_local3]._x + 20;
_local1[k].x = _local1[k]._x;
}
}
}
}
if (_local2._y > ((court._y + 900) + 32.5)) {
_local2._y = _local2._y - 50;
_local2.y = _local2._y;
for (var _local3 in _local1) {
if (_local1[k].hitTest(_local1[_local3])) {
if (_local1[_local3] != _local1[k]) {
_local1[k]._x = _local1[_local3]._x + 20;
_local1[k].x = _local1[k]._x;
}
}
}
}
}
};
CroquetSet = function (ballsArray, Turn) {
var _local1 = ballsArray;
var _local2 = Turn;
if (!hemicir) {
attachMovie("hemicircle", "hemicir", 107);
hemicir._x = _local1[_local1[_local2].Croquet]._x;
hemicir._y = _local1[_local1[_local2].Croquet]._y;
}
if (hemicir.hitTest(_local1[_local2]._x, _local1[_local2]._y, true)) {
return(false);
}
return(true);
};
Symbol 13 MovieClip [hemicircle] Frame 1
function checkHitOthers() {
var _local2 = _root;
var _local1 = 1;
while (_local1 < _local2.ballsArray.length) {
_local1++;
}
return(false);
}
if (_root.Turn == 1) {
bTurn = 1;
virtualball = vb1;
}
if (_root.Turn == 2) {
bTurn = 2;
virtualball = vb2;
}
if (_root.Turn == 3) {
bTurn = 3;
virtualball = vb3;
}
if (_root.Turn == 4) {
bTurn = 4;
virtualball = vb4;
}
virtualball._x = field._x;
virtualball._y = field._y;
placing = true;
while (placing) {
virtualball._x = virtualball._x + 0.9;
virtualball._y = virtualball._y + 0.9;
placing = checkHitOthers();
}
this.onEnterFrame = function () {
if (field.hitTest(_root._xmouse, _root._ymouse, true)) {
oldx = virtualball._x;
oldy = virtualball._y;
Xrotation = Math.atan2(_ymouse - field._y, _xmouse - field._x);
virtualball._y = field._y + (16 * Math.sin(Xrotation));
virtualball._x = field._y + (16 * Math.cos(Xrotation));
if (checkHitOthers()) {
virtualball._x = oldx;
virtualball._y = oldy;
}
}
};
this.onMouseUp = function () {
var _local1 = _root;
pt = {x:virtualball._x, y:virtualball._y};
this.localToGlobal(pt);
_local1.attachMovie("ball_white", "b0", 105);
_local1.ballsArray[bTurn]._x = (_local1.ballsArray[bTurn].x = pt.x);
_local1.ballsArray[bTurn]._y = (_local1.ballsArray[bTurn].y = pt.y);
_local1.initb0();
this.removeMovieClip();
};
Symbol 20 MovieClip [hitter] Frame 1
this.onMouseUp = function () {
var _local1 = _root;
HitCancel = ((_local1._ymouse - _y) * (_local1._ymouse - _y)) + ((_local1._xmouse - _x) * (_local1._xmouse - _x));
if (HitCancel <= 30) {
this.removeMovieClip();
} else {
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.2957795130823 * 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 29 Button
on (release) {
loadMovieNum (this._url, 0);
}