Frame 1
stop();
onEnterFrame = function () {
var _local1 = _root.getBytesLoaded() / _root.getBytesTotal();
preloader_mc.value = _local1;
if (_local1 == 1) {
delete onEnterFrame;
play();
}
};
Frame 2
function reqBorderChange() {
Timer.play();
}
function calcReactionTime(clickTime) {
reactionTime = (clickTime - startTime) / 1000;
reactionTime = Math.round(reactionTime * 100) / 100;
setMessage(reactionTime);
reactionTime = reactionTime + " sec";
return(undefined);
}
function setMessage(rt) {
var _local1 = rt;
if (_local1 == 0) {
gotoAndStop ("homer");
} else if ((_local1 <= 0.1) && (_local1 > 0)) {
gotoAndStop ("homer");
} else if ((_local1 <= 0.18) && (_local1 > 0.1)) {
gotoAndStop ("homer");
} else if ((_local1 <= 0.22) && (_local1 > 0.18)) {
gotoAndStop ("hit");
} else if ((_local1 <= 0.26) && (_local1 > 0.22)) {
gotoAndStop ("hit");
} else if ((_local1 <= 1) && (_local1 > 0.26)) {
gotoAndStop ("miss");
} else if ((_local1 <= 10) && (_local1 > 1)) {
gotoAndStop ("miss");
} else {
gotoAndStop ("miss");
}
}
b5Sound = new Sound(this);
b5Sound.attachSound("click");
b6Sound = new Sound(this);
b6Sound.attachSound("hotdog");
b7Sound = new Sound(this);
b7Sound.attachSound("charge");
b7Sound.stop();
b7Sound.start(0, 99);
stop();
Instance of Symbol 15 MovieClip in Frame 2
on (release) {
_root.reqBorderChange();
_root.gotoAndStop("begin");
_root.b5Sound.start(0, 1);
}
Instance of Symbol 27 MovieClip in Frame 2
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (press) {
_root.play();
_root.b5Sound.start(0, 1);
}
Frame 5
stop();
Frame 8
stop();
Frame 10
stop();
Frame 14
b1Sound = new Sound(this);
b1Sound.attachSound("crowd");
b1Sound.stop();
b1Sound.start(0, 99);
b2Sound = new Sound(this);
b2Sound.attachSound("batter");
b2Sound.start(0, 1);
b4Sound = new Sound(this);
b4Sound.attachSound("strike");
b3Sound = new Sound(this);
b3Sound.attachSound("hit");
Frame 25
startTime = getTimer();
stop();
Frame 36
b4Sound.start(0, 1);
Instance of Symbol 45 MovieClip in Frame 36
on (release) {
_root.reqBorderChange();
_root.gotoAndStop("begin");
_root.b5Sound.start(0, 1);
}
Frame 41
b3Sound.start(0, 1);
Frame 45
b3Sound.start(0, 1);
Frame 52
b6Sound.start(0, 1);
Frame 63
startTime = getTimer();
stop();
Instance of Symbol 45 MovieClip in Frame 63
on (release) {
_root.reqBorderChange();
_root.gotoAndStop("begin");
}
Symbol 11 MovieClip Frame 1
var value = 0;
var radius = 50;
var startAngle = -1.5707963267949;
var fillColor = 16777215;
var lineColor = 0;
this.createEmptyMovieClip("pie_mc", 0);
pie_mc.onEnterFrame = function () {
var _local1 = this;
_local1.clear();
var _local2 = startAngle + ((Math.PI*2) * (1 - value));
_local1.lineStyle(2, lineColor, 100);
_local1.beginFill(fillColor, 100);
_local1.lineTo(Math.cos(startAngle) * radius, 0);
_local1.circleSegmentTo(0, 0, startAngle, _local2, radius, -1);
_local1.lineTo(0, 0);
_local1.endFill();
};
pie_mc.circleSegmentTo = function (x, y, a1, a2, r, dir) {
var _local1 = a1;
var _local2 = a2;
var diff = Math.abs(_local2 - _local1);
var divs = (Math.floor(diff / (Math.PI/4)) + 1);
var span = ((dir * diff) / (2 * divs));
var rc = (r / Math.cos(span));
this.moveTo(x + (Math.cos(_local1) * r), y + (Math.sin(_local1) * r));
var _local3 = 0;
while (_local3 < divs) {
_local2 = _local1 + span;
_local1 = _local2 + span;
this.curveTo(x + (Math.cos(_local2) * rc), y + (Math.sin(_local2) * rc), x + (Math.cos(_local1) * r), y + (Math.sin(_local1) * r));
_local3++;
}
return(this);
};
nextFrame();
onEnterFrame();
Symbol 16 MovieClip Frame 1
stop();
Symbol 16 MovieClip Frame 2
if (!init) {
startDelay = getTimer();
init = true;
delay = Math.floor(Math.random() * 1200) + 1000;
}
if ((getTimer() - startDelay) > delay) {
init = false;
_parent.play();
this.gotoAndStop("hang");
}
Symbol 16 MovieClip Frame 6
gotoAndPlay ("begin");
Symbol 27 MovieClip Frame 1
stop();
Symbol 39 Button
on (press) {
_root.gotoAndStop("early");
}
Symbol 42 Button
on (press) {
calcReactionTime(getTimer());
}