Frame 1
loadMovie ("http://www.makaimedia.com/games/actionscript/tennis_preloader.swf", "preloader");
_root.gameID = 58;
loadVariables ("/scripts/getMemberInfo.aspx", "", "POST");
_quality = "Medium";
Frame 2
_quality = "best";
ifFrameLoaded (6) {
gotoAndStop (4);
}
Frame 3
gotoAndPlay (2);
Frame 4
_root.gameID = 58;
_root.rootWidth = 527;
_root.rootHeight = 400;
best = 0;
loadMovie ("http://www.makaimedia.com/games/actionscript/tennis_channel_scores.swf", "scores");
stop();
Instance of Symbol 34 MovieClip "scores" in Frame 4
/* no clip actions */
Frame 6
Instance of Symbol 148 MovieClip "game" in Frame 6
/* no clip actions */
Symbol 11 MovieClip Frame 1
stop();
Symbol 12 MovieClip Frame 1
Symbol 12 MovieClip Frame 42
_parent._parent.battle.gotoAndPlay(2);
stop();
Symbol 16 MovieClip Frame 1
stop();
Symbol 23 MovieClip Frame 1
Symbol 23 MovieClip Frame 20
stop();
Symbol 23 MovieClip Frame 25
stop();
Symbol 26 Button
on (release) {
player = "riggs";
gotoAndStop (6);
}
on (rollOver) {
title.riggsLabel.name.gotoAndStop(2);
}
on (rollOut, releaseOutside) {
title.riggsLabel.name.gotoAndStop(1);
}
Symbol 27 Button
on (release) {
player = "king";
gotoAndStop (6);
}
on (rollOver) {
title.kingLabel.name.gotoAndStop(2);
}
on (rollOut, releaseOutside) {
title.kingLabel.name.gotoAndStop(1);
}
Symbol 31 Button
on (release) {
getURL ("http://www.thetennischannel.com", "_blank");
}
Symbol 45 MovieClip Frame 1
stop();
Symbol 45 MovieClip Frame 70
_parent.title.riggsLabel.play();
stop();
Symbol 49 MovieClip Frame 1
stop();
Symbol 51 Button
on (release) {
if (goal == 100) {
goal = 0;
} else {
goal = 100;
}
}
Symbol 57 MovieClip Frame 1
s = new Sound(this);
goal = 100;
volume = 70;
adjustment = 10;
stop();
onEnterFrame = function () {
if (goal < volume) {
volume = volume - adjustment;
} else if (goal > volume) {
volume = volume + adjustment;
}
if (Math.abs(goal - volume) < adjustment) {
volume - goal;
}
s.setVolume(volume);
frame = int(volume / 10) + 1;
speaker.gotoAndStop(frame);
};
Symbol 57 MovieClip Frame 7
r = random(3) + 1;
gotoAndStop("whack" + r);
Symbol 57 MovieClip Frame 15
stop();
Symbol 57 MovieClip Frame 22
stop();
Symbol 57 MovieClip Frame 30
stop();
Symbol 57 MovieClip Frame 37
stop();
Symbol 57 MovieClip Frame 79
stop();
Symbol 57 MovieClip Frame 85
stop();
Symbol 57 MovieClip Frame 98
play();
Symbol 57 MovieClip Frame 99
gotoAndStop (1);
Symbol 63 MovieClip Frame 1
stop();
Symbol 68 MovieClip Frame 1
if (_parent.goal == _parent.position.x) {
stop();
}
Symbol 68 MovieClip Frame 5
if (_parent.goal == _parent.position.x) {
gotoAndStop (1);
}
Symbol 104 MovieClip Frame 1
onEnterFrame = function () {
if (goal != position.x) {
legs.play();
}
if (_currentframe >= 37) {
head.gotoAndStop(2);
} else {
head.gotoAndStop(1);
}
};
if (_parent.player == "riggs") {
gotoAndStop (37);
} else {
stop();
}
Symbol 104 MovieClip Frame 17
stop();
Symbol 104 MovieClip Frame 32
stop();
Symbol 104 MovieClip Frame 38
head.gotoAndStop(2);
Symbol 104 MovieClip Frame 52
stop();
Symbol 104 MovieClip Frame 66
stop();
Symbol 109 Button
on (release, releaseOutside) {
ball.gravity = true;
playing = true;
ball.speed.z = 14;
ball.speed.x = random(131) - 65;
ball.speed.y = 100;
op.goal = findGoal();
_root.sounds.gotoAndPlay("whack");
myButton._visible = false;
ball.nextFrame();
}
Symbol 113 MovieClip Frame 1
stop();
Symbol 115 MovieClip Frame 1
Symbol 127 Button
on (release) {
playing = true;
newGame();
}
Symbol 141 Button
on (release) {
_parent.best = best;
_parent.gotoAndStop(5);
}
Symbol 145 MovieClip Frame 11
stop();
Symbol 146 MovieClip Frame 22
stop();
Symbol 147 MovieClip Frame 34
stop();
Symbol 148 MovieClip Frame 1
function positionRacket() {
racket._x = _xmouse;
racket._y = _ymouse;
catcher._x = _xmouse;
catcher._y = _ymouse;
racket._rotation = ((-racket._y) / 20) - ((-racket._x) / 30);
catcher._rotation = ((-racket._y) / 20) - ((-racket._x) / 30);
}
function placeOnRacket() {
pastz = 30 - ball.position.z;
ratio = pastz / ball.speed.z;
safex = ball.position.x;
safey = ball.position.y;
safez = ball.position.z;
ball.position.z = ball.position.z + (ratio * ball.speed.z);
ball.position.y = ball.position.y + (ratio * ball.speed.y);
ball.position.x = ball.position.x + (ratio * ball.speed.x);
trace(ball.position.z);
}
function getRandom(y, type) {
where = (-y) + 325;
if (type == 0) {
start = 25 + (where * 0.0857142857142857);
spread = 57 - (where * 0.0371428571428571);
r = start + random(spread);
} else {
start = 116 - (where * 0.0857142857142857);
r = start + random(25);
}
return(r);
}
function convert(pos) {
mytrans = new Object();
where = (1 / pos.z) * dim;
mytrans.yscale = where * size;
mytrans.xscale = where * size;
distx = (pos.x - vanx) * (where / (dim / inc));
disty = (-(pos.y - vany)) * (where / (dim / inc));
mytrans.x = vanx + distx;
mytrans.y = vany + disty;
return(mytrans);
}
function redraw(object) {
if (object.shadow != "") {
shad = eval (object.shadow);
shad.position.x = object.position.x + ((object.position.y - floor) * 0.2);
shad.position.y = floor;
shad.position.z = object.position.z + ((object.position.y - floor) * 0.01);
mytrans = convert(shad.position);
shad._x = mytrans.x;
shad._y = mytrans.y;
shad._xscale = mytrans.xscale;
shad._yscale = mytrans.yscale;
}
mytrans = convert(object.position);
object._x = mytrans.x;
object._y = mytrans.y;
object._xscale = mytrans.xscale;
object._yscale = mytrans.yscale;
if (object.position.z > 140) {
blocker._visible = true;
net._visible = false;
} else {
blocker._visible = false;
net._visible = true;
}
op.position.x = moveOp(op.position.x, op.goal);
mytrans = convert(op.position);
op._x = mytrans.x;
}
function translate(object) {
if (object.gravity) {
object.speed.y = object.speed.y - gravity;
}
object.position.x = object.position.x + object.speed.x;
object.position.y = object.position.y + object.speed.y;
object.position.z = object.position.z + object.speed.z;
if (object.position.y < floor) {
_root.sounds.gotoAndPlay("bounce");
object.position.y = floor;
object.speed.x = object.speed.x * object.slide;
object.speed.y = object.speed.y * (-object.bounce);
object.speed.z = object.speed.z * object.slide;
if (object.position.z > 40) {
}
}
if (object.position.z > wall) {
_root.sounds.gotoAndPlay("whack");
object.position.z = wall;
r = random(5);
if (r < 3) {
object.speed.z = -8.5 - (random(10) / 10);
object.speed.y = 70;
object.speed.x = (((-object.position.x) * 0.07) + random(41)) - 20;
} else {
object.speed.z = -10.5 - (random(10) / 10);
object.speed.y = 108 + random(10);
object.speed.x = (((-object.position.x) * 0.07) + random(41)) - 20;
}
op.goal = 0;
runSpeed = 50;
}
if (((object.position.z < 30) and (object.speed.z < 0)) and (!passed)) {
placeOnRacket();
if (catcher.hitTest(object._x + _x, object._y + _y, true)) {
_root.sounds.gotoAndPlay("whack");
score++;
if (score > best) {
best = score;
}
mult = Math.min((score / 120) + 0.4, 1);
object.speed.x = ((object._x - _xmouse) * mult) * 2;
type = 0;
if (random(5) == 0) {
type = 1;
}
object.speed.z = 14;
object.speed.y = 140;
op.goal = findGoal();
} else {
ball.position.x = safex;
ball.position.y = safey;
ball.position.z = safez;
passed = true;
_root.sounds.gotoAndPlay("crowd");
}
}
if (object.position.z < 14) {
ball.gravity = false;
_root.sounds.gotoAndPlay("past");
racket._visible = false;
Mouse.show();
object._visible = false;
eval (object.shadow)._visible = false;
object.position.z = 100;
object.speed.z = 0;
object.speed.y = 0;
object.speed.z = 0;
playing = false;
_parent.scores.scripting.test(score);
}
}
function reset() {
resetButton._visible = true;
newPlayerButton._visible = true;
}
function moveOp(current, goal) {
if (goal < current) {
current = current - runSpeed;
} else if (goal > current) {
current = current + runSpeed;
}
if (Math.abs(goal - current) < runSpeed) {
current = goal;
}
return(current);
}
function findGoal() {
goal = ball.position.x + (ball.speed.x * 13);
if (goal <= op.position.x) {
goal = goal + 700;
hand = "forehand" + player;
} else {
goal = goal - 700;
hand = "backhand" + player;
}
runSpeed = 100;
op.gotoAndPlay(hand);
return(goal);
}
function newGame() {
_root.sounds.gotoAndPlay("crowd");
myButton._visible = true;
wall = 180;
blocker._visible = false;
racket._visible = true;
resetButton._visible = false;
newPlayerButton._visible = false;
ball.shadow = "shadow";
ball.bounce = 0.8;
ball.slide = 0.9;
ball.gravity = false;
ball.location = new Object();
ball.position = new Object();
ball.speed = new Object();
ball.position.x = 0;
ball.position.y = 80;
ball.position.z = 30;
ball.speed.x = 0;
ball.speed.y = 0;
ball.speed.z = 0;
op.goal = 550;
op.gravity = false;
op.position = new Object();
op.speed = new Object();
op.position.x = 550;
op.position.y = 0;
op.position.z = wall;
op.speed.x = 0;
op.speed.y = 0;
op.speed.z = 0;
shadow._visible = true;
Mouse.hide();
tennisball = ball;
floor = -525;
runSpeed = 100;
inc = 20;
vanx = 0;
vany = 0;
dim = 6000;
gravity = 18;
size = 0.4;
ball._visible = true;
translate(tennisball);
redraw(tennisball);
score = 0;
player = _root.player;
passed = false;
ball.gotoAndStop(1);
}
onEnterFrame = function () {
if (((_root._xmouse > 530) or ((_root._xmouse < 80) and (_root._ymouse > 330))) or (!playing)) {
Mouse.show();
} else {
Mouse.hide();
}
positionRacket();
translate(tennisball);
redraw(tennisball);
};
score = 0;
best = _parent.best;
newGame();
Instance of Symbol 113 MovieClip "ball" in Symbol 148 MovieClip Frame 1
onClipEvent (load) {
}
Instance of Symbol 115 MovieClip "shadow" in Symbol 148 MovieClip Frame 1
onClipEvent (load) {
location = new Object();
position = new Object();
}
Instance of Symbol 145 MovieClip in Symbol 148 MovieClip Frame 1
onClipEvent (load) {
spread = 70;
wide = spread / 2;
initx = _x;
inity = _y;
}
onClipEvent (enterFrame) {
if (!playing) {
r = random(_parent.flash_frequency);
if (r == 1) {
_x = ((initx + random(spread)) - wide);
s = random(spread) - wide;
_y = (inity + s);
_xscale = (100 + s);
_yscale = (100 + s);
play();
}
}
}
Instance of Symbol 146 MovieClip in Symbol 148 MovieClip Frame 1
onClipEvent (load) {
spread = 70;
wide = spread / 2;
initx = _x;
inity = _y;
}
onClipEvent (enterFrame) {
if (!playing) {
r = random(_parent.flash_frequency);
if (r == 1) {
_x = ((initx + random(spread)) - wide);
s = random(spread) - wide;
_y = (inity + s);
_xscale = (100 + s);
_yscale = (100 + s);
play();
}
}
}
Instance of Symbol 147 MovieClip in Symbol 148 MovieClip Frame 1
onClipEvent (load) {
spread = 70;
wide = spread / 2;
initx = _x;
inity = _y;
}
onClipEvent (enterFrame) {
if (!playing) {
r = random(_parent.flash_frequency);
if (r == 1) {
_x = ((initx + random(spread)) - wide);
s = random(spread) - wide;
_y = (inity + s);
_xscale = (100 + s);
_yscale = (100 + s);
play();
}
}
}