Frame 1
function cancelPlans() {
if (!(this.booingInterval === undefined)) {
clearInterval(this.booingInterval);
this.booingInterval = undefined;
}
if (!(this.booingTimeout === undefined)) {
clearTimeout(this.booingTimeout);
this.booingTimeout = undefined;
}
if (!(this.clappingInterval === undefined)) {
clearInterval(this.clappingInterval);
this.clappingInterval = undefined;
}
if (!(this.clappingTimeout === undefined)) {
clearTimeout(this.clappingTimeout);
this.clappingTimeout = undefined;
}
delete this.onEnterFrame;
}
function returnToTitleScreen() {
this.cancelPlans();
this.tidyUp();
gotoAndStop (4);
}
function tidyUp() {
if (!(this.allChallengesCompletedOverlay === undefined)) {
this.allChallengesCompletedOverlay.removeMovieClip();
}
if (!(this.bonusOptionsUnlockedOverlay === undefined)) {
this.bonusOptionsUnlockedOverlay.removeMovieClip();
}
if (!(this.challengeCompletedOverlay === undefined)) {
this.challengeCompletedOverlay.removeMovieClip();
}
if (!(this.challengeFailedOverlay === undefined)) {
this.challengeFailedOverlay.removeMovieClip();
}
if (!(this.challengeOverlay1 === undefined)) {
this.challengeOverlay1.removeMovieClip();
}
if (!(this.challengeOverlay2 === undefined)) {
this.challengeOverlay2.removeMovieClip();
}
if (!(this.challengeOverlay3 === undefined)) {
this.challengeOverlay3.removeMovieClip();
}
if (!(this.challengeOverlay4 === undefined)) {
this.challengeOverlay4.removeMovieClip();
}
if (!(this.challengeOverlay5 === undefined)) {
this.challengeOverlay5.removeMovieClip();
}
if (!(this.challengeOverlay6 === undefined)) {
this.challengeOverlay6.removeMovieClip();
}
if (!(this.challengeOverlay7 === undefined)) {
this.challengeOverlay7.removeMovieClip();
}
if (!(this.challengeOverlay8 === undefined)) {
this.challengeOverlay8.removeMovieClip();
}
if (!(this.challengeOverlay9 === undefined)) {
this.challengeOverlay9.removeMovieClip();
}
if (!(this.challengeOverlay10 === undefined)) {
this.challengeOverlay10.removeMovieClip();
}
if (!(this.challengeOverlayB1 === undefined)) {
this.challengeOverlayB1.removeMovieClip();
}
if (!(this.challengeOverlayB2 === undefined)) {
this.challengeOverlayB2.removeMovieClip();
}
if (!(this.musicLoop_mc === undefined)) {
this.musicLoop_mc.removeMovieClip();
}
if (!(this.booingSound_mc === undefined)) {
this.booingSound_mc.removeMovieClip();
}
if (!(this.clappingSound_mc === undefined)) {
this.clappingSound_mc.removeMovieClip();
}
}
ApplicationStateUtilities.useCommonCustomContextMenu(this);
stopAllSounds();
Frame 2
stop();
stopAllSounds();
Frame 3
stop();
stopAllSounds();
this.ggSkipButton.onPress = function () {
clearInterval(this._parent.ggBranding.ggBrandingTimeout);
this._parent.play();
};
Frame 4
function hideCredits() {
this.credits.closeButton.enabled = false;
this.credits.onEnterFrame = function () {
if (this._y < 620) {
this._y = this._y + 50;
} else {
delete this.onEnterFrame;
}
};
this.creditsButton.onRelease = function () {
this._parent.hideInstructions();
this._parent.showCredits();
};
}
function hideInstructions() {
this.instructions.closeButton.enabled = false;
this.instructions.onEnterFrame = function () {
if (this._y > -460) {
this._y = this._y - 50;
} else {
delete this.onEnterFrame;
}
};
this.instructionsButton.onRelease = function () {
this._parent.hideCredits();
this._parent.showInstructions();
};
}
function init() {
this.stop();
stopAllSounds();
ApplicationStateUtilities.useCommonCustomContextMenu(this);
this.prepareAudio();
this.prepareButtons();
this.musicLoop.start();
}
function prepareAudio() {
if (this.musicLoop_mc === undefined) {
this.createEmptyMovieClip("musicLoop_mc", this.getNextHighestDepth());
}
musicLoop = new Sound(this.musicLoop_mc);
musicLoop.attachSound("Title Theme");
this.musicLoop.onSoundComplete = function () {
this.start();
};
}
function prepareButtons() {
this.agButton.onRelease = function () {
getURL ("http://www.addictinggames.com/", "_blank");
};
this.creditsButton.onRelease = function () {
this._parent.hideInstructions();
this._parent.showCredits();
};
this.ggButton.onRelease = function () {
getURL ("http://www.gravitasgames.com/", "_blank");
};
this.instructionsButton.onRelease = function () {
this._parent.hideCredits();
this._parent.showInstructions();
};
this.startButton.onRelease = function () {
this._parent.play();
};
}
function showCredits() {
this.credits.onEnterFrame = function () {
if (this._y > 90) {
this._y = this._y - 40;
} else if (this._y < 90) {
this._y = this._y + 5;
} else {
delete this.onEnterFrame;
}
};
this.credits.closeButton.onRelease = function () {
this._parent._parent.hideCredits();
};
this.credits.closeButton.enabled = true;
this.creditsButton.onRelease = function () {
this._parent.hideCredits();
};
}
function showInstructions() {
this.instructions.onEnterFrame = function () {
if (this._y < 90) {
this._y = this._y + 40;
} else if (this._y > 90) {
this._y = this._y - 5;
} else {
delete this.onEnterFrame;
}
};
this.instructions.closeButton.onRelease = function () {
this._parent._parent.hideInstructions();
};
this.instructions.closeButton.enabled = true;
this.instructionsButton.onRelease = function () {
this._parent.hideInstructions();
};
}
var musicLoop;
this.init();
Frame 5
function prepareAudio() {
if (this.musicLoop_mc === undefined) {
this.createEmptyMovieClip("musicLoop_mc", this.getNextHighestDepth());
}
musicLoop = new Sound(this.musicLoop_mc);
musicLoop.attachSound("Character Customization Theme");
this.musicLoop.onSoundComplete = function () {
this.start();
};
}
function prepareCustomizationControls() {
this.characterRandomizeButton.onRelease = function () {
this._parent.character.randomizeAppearance();
};
this.generalMenu.chestLeftButton.onRelease = function () {
this._parent._parent.character.pageBodyLeft();
};
this.generalMenu.chestRightButton.onRelease = function () {
this._parent._parent.character.pageBodyRight();
};
this.headMenu.eyesLeftButton.onRelease = function () {
this._parent._parent.character.pageEyesLeft();
};
this.headMenu.eyesRandomizeButton.onRelease = function () {
this._parent._parent.character.randomizeEyes(true);
};
this.headMenu.eyesRightButton.onRelease = function () {
this._parent._parent.character.pageEyesRight();
};
this.headMenu.hairLeftButton.onRelease = function () {
this._parent._parent.character.pageHairLeft();
};
this.headMenu.hairRandomizeButton.onRelease = function () {
this._parent._parent.character.randomizeHair(true);
};
this.headMenu.hairRightButton.onRelease = function () {
this._parent._parent.character.pageHairRight();
};
this.headMenu.mouthLeftButton.onRelease = function () {
this._parent._parent.character.pageMouthLeft();
};
this.headMenu.mouthRandomizeButton.onRelease = function () {
this._parent._parent.character.randomizeMouth(true);
};
this.headMenu.mouthRightButton.onRelease = function () {
this._parent._parent.character.pageMouthRight();
};
this.headMenu.noseLeftButton.onRelease = function () {
this._parent._parent.character.pageNoseLeft();
};
this.headMenu.noseRandomizeButton.onRelease = function () {
this._parent._parent.character.randomizeNose(true);
};
this.headMenu.noseRightButton.onRelease = function () {
this._parent._parent.character.pageNoseRight();
};
this.clothingMenu.shirtMainBodyLeftButton.onRelease = function () {
this._parent._parent.character.pageShirtMainBodyLeft();
};
this.clothingMenu.shirtMainBodyRandomizeButton.onRelease = function () {
this._parent._parent.character.randomizeShirtMainBody(true);
};
this.clothingMenu.shirtMainBodyRightButton.onRelease = function () {
this._parent._parent.character.pageShirtMainBodyRight();
};
this.clothingMenu.shirtSleevesLeftButton.onRelease = function () {
this._parent._parent.character.pageShirtSleevesLeft();
};
this.clothingMenu.shirtSleevesRandomizeButton.onRelease = function () {
this._parent._parent.character.randomizeShirtSleeves(true);
};
this.clothingMenu.shirtSleevesRightButton.onRelease = function () {
this._parent._parent.character.pageShirtSleevesRight();
};
this.clothingMenu.shoesLeftButton.onRelease = function () {
this._parent._parent.character.pageShoesLeft();
};
this.clothingMenu.shoesRandomizeButton.onRelease = function () {
this._parent._parent.character.randomizeShoes(true);
};
this.clothingMenu.shoesRightButton.onRelease = function () {
this._parent._parent.character.pageShoesRight();
};
this.clothingMenu.shortsLeftButton.onRelease = function () {
this._parent._parent.character.pageShortsLeft();
};
this.clothingMenu.shortsRandomizeButton.onRelease = function () {
this._parent._parent.character.randomizeShorts(true);
};
this.clothingMenu.shortsRightButton.onRelease = function () {
this._parent._parent.character.pageShortsRight();
};
this.generalMenu.skinLeftButton.onRelease = function () {
this._parent._parent.character.pageSkinLeft();
};
this.generalMenu.skinRandomizeButton.onRelease = function () {
this._parent._parent.character.randomizeSkin(true);
};
this.generalMenu.skinRightButton.onRelease = function () {
this._parent._parent.character.pageSkinRight();
};
}
function prepareIOControls() {
if (this.checkForSavedCharacter(1) === false) {
this.loadButton._alpha = 50;
this.loadButton.enabled = false;
}
this.loadButton.onRelease = function () {
this._parent.loadCharacter(1);
};
this.saveButton.onRelease = function () {
this._parent.saveCharacter(1);
if (this._parent.checkForSavedCharacter(1) === true) {
this._parent.loadButton._alpha = 100;
this._parent.loadButton.enabled = true;
} else {
this._parent.loadButton._alpha = 50;
this._parent.loadButton.enabled = false;
}
};
}
function checkForSavedCharacter(index) {
var _local1 = new Object();
var _local2 = SharedObject.getLocal("/dev/savedCharacters");
_local1 = _local2.data["character" + index.toString()];
if (!(_local1 === undefined)) {
return(true);
}
return(false);
}
function loadCharacter(index) {
var _local2 = new Object();
var _local3 = new Object();
var _local4 = SharedObject.getLocal("/dev/savedCharacters");
_local3 = _local4.data["character" + index.toString()];
_local2 = _local3.appearance;
this.character.setChest(_local2.chest);
this.character.setEyes(_local2.eyes);
this.character.setHair(_local2.hair);
this.character.setMouth(_local2.mouth);
this.character.setNose(_local2.nose);
this.character.setSkin(_local2.skin);
this.character.setShirt(_local2.shirtMainBody, _local2.shirtSleeves);
this.character.setShoes(_local2.shoes);
this.character.setShorts(_local2.shorts);
}
function loadHighestBonusOptionsRevealedIndex() {
var _local2 = SharedObject.getLocal("savedAchievements");
this.highestBonusOptionsRevealedIndex = _local2.data.highestBonusOptionsRevealedIndex;
}
function loadHighestChallengeCompletedIndex() {
var _local2 = SharedObject.getLocal("savedAchievements");
this.highestChallengeCompletedIndex = _local2.data.highestChallengeCompletedIndex;
}
function saveCharacter(index) {
var _local2 = new Object();
var _local3 = new Object();
var _local4 = SharedObject.getLocal("/dev/savedCharacters");
_local2.chest = this.character.body._currentframe;
_local2.eyes = this.character.head.eyes._currentframe;
_local2.hair = this.character.head.hairFront._currentframe;
_local2.mouth = this.character.head.mouth._currentframe;
_local2.nose = this.character.head.nose._currentframe;
_local2.skin = this.character.head.face._currentframe;
_local2.shirtMainBody = this.character.body.torso._currentframe;
_local2.shirtSleeves = this.character.frontArm.sleeve._currentframe;
_local2.shoes = this.character.body.frontShoe._currentframe;
_local2.shorts = this.character.body.shorts._currentframe;
_local3.appearance = _local2;
_local3.name = "Unnamed";
_local4.data["character" + index.toString()] = _local3;
_local4.flush();
}
function saveHighestBonusOptionsRevealedIndex(challengeIndex) {
var _local1 = SharedObject.getLocal("savedAchievements");
_local1.data.highestBonusOptionsRevealedIndex = challengeIndex;
_local1.flush();
}
function saveHighestChallengeCompletedIndex(challengeIndex) {
var _local1 = SharedObject.getLocal("savedAchievements");
_local1.data.highestChallengeCompletedIndex = challengeIndex;
_local1.flush();
}
function cacheAppearance() {
this.player1.avatar.appearance.chest = this.character.body._currentframe;
this.player1.avatar.appearance.eyes = this.character.head.eyes._currentframe;
this.player1.avatar.appearance.hair = this.character.head.hairFront._currentframe;
this.player1.avatar.appearance.mouth = this.character.head.mouth._currentframe;
this.player1.avatar.appearance.nose = this.character.head.nose._currentframe;
this.player1.avatar.appearance.shirtMainBody = this.character.body.torso._currentframe;
this.player1.avatar.appearance.shirtSleeves = this.character.frontArm.sleeve._currentframe;
this.player1.avatar.appearance.shoes = this.character.body.frontShoe._currentframe;
this.player1.avatar.appearance.shorts = this.character.body.shorts._currentframe;
this.player1.avatar.appearance.skin = this.character.head.face._currentframe;
}
function indicateBonusOptions() {
var _local2;
var _local5;
var _local4;
var _local3;
trace("[ CCS ] Highest Bonus Options Revealed Index: " + this.highestBonusOptionsRevealedIndex);
trace("[ CCS ] Highest Challenge Completed Index: " + this.highestChallengeCompletedIndex);
if (!(this.highestChallengeCompletedIndex === undefined)) {
if ((this.highestChallengeCompletedIndex >= 0) && (this.highestBonusOptionsRevealedIndex === undefined)) {
_local5 = true;
}
if ((this.highestChallengeCompletedIndex >= 1) && ((this.highestBonusOptionsRevealedIndex === undefined) || (this.highestBonusOptionsRevealedIndex < 1))) {
_local2 = true;
}
if ((this.highestChallengeCompletedIndex >= 2) && ((this.highestBonusOptionsRevealedIndex === undefined) || (this.highestBonusOptionsRevealedIndex < 2))) {
_local3 = true;
}
if ((this.highestChallengeCompletedIndex >= 3) && ((this.highestBonusOptionsRevealedIndex === undefined) || (this.highestBonusOptionsRevealedIndex < 3))) {
_local4 = true;
}
if ((this.highestChallengeCompletedIndex >= 4) && ((this.highestBonusOptionsRevealedIndex === undefined) || (this.highestBonusOptionsRevealedIndex < 4))) {
_local2 = true;
}
if ((this.highestChallengeCompletedIndex >= 6) && ((this.highestBonusOptionsRevealedIndex === undefined) || (this.highestBonusOptionsRevealedIndex < 6))) {
_local2 = true;
_local3 = true;
}
if ((this.highestChallengeCompletedIndex >= 7) && ((this.highestBonusOptionsRevealedIndex === undefined) || (this.highestBonusOptionsRevealedIndex < 7))) {
_local5 = true;
}
if ((this.highestChallengeCompletedIndex >= 8) && ((this.highestBonusOptionsRevealedIndex === undefined) || (this.highestBonusOptionsRevealedIndex < 8))) {
_local4 = true;
}
if ((this.highestChallengeCompletedIndex >= 9) && ((this.highestBonusOptionsRevealedIndex === undefined) || (this.highestBonusOptionsRevealedIndex < 9))) {
_local2 = true;
_local3 = true;
}
if ((this.highestChallengeCompletedIndex >= 10) && ((this.highestBonusOptionsRevealedIndex === undefined) || (this.highestBonusOptionsRevealedIndex < 10))) {
_local2 = true;
_local3 = true;
_local4 = true;
}
}
if (_local2 === true) {
this.eyesBonusStatusIndicator._visible = true;
}
if (_local5 === true) {
this.hairBonusStatusIndicator._visible = true;
}
if (_local3 === true) {
this.mouthBonusStatusIndicator._visible = true;
}
if (_local4 === true) {
this.noseBonusStatusIndicator._visible = true;
}
if ((((_local2 === true) || (_local5 === true)) || (_local3 === true)) || (_local4 === true)) {
this.bonusIndicationKey.gotoAndStop(2);
} else if (this.highestBonusOptionsRevealedIndex >= 10) {
this.bonusIndicationKey.gotoAndStop(3);
} else {
this.bonusIndicationKey.gotoAndStop(1);
}
this.saveHighestBonusOptionsRevealedIndex(this.highestChallengeCompletedIndex);
}
function init() {
this.stop();
stopAllSounds();
ApplicationStateUtilities.useGameContextMenu(this);
this.prepareAudio();
this.prepareIOControls();
this.prepareCustomizationControls();
this.myPlayButton.onRelease = function () {
this._parent.cacheAppearance();
this._parent.play();
};
this.bonusIndicationKey.stop();
this.eyesBonusStatusIndicator.stop();
this.eyesBonusStatusIndicator._visible = false;
this.hairBonusStatusIndicator.stop();
this.hairBonusStatusIndicator._visible = false;
this.mouthBonusStatusIndicator.stop();
this.mouthBonusStatusIndicator._visible = false;
this.noseBonusStatusIndicator.stop();
this.noseBonusStatusIndicator._visible = false;
this.loadHighestBonusOptionsRevealedIndex();
this.loadHighestChallengeCompletedIndex();
this.indicateBonusOptions();
this.initializeCharacterFrameLimits();
this.musicLoop.start();
}
function initializeCharacterFrameLimits() {
if (this.highestChallengeCompletedIndex === 0) {
this.character.maximumEyesFrame = 5;
this.character.maximumHairFrame = 92;
this.character.maximumMouthFrame = 8;
this.character.maximumNoseFrame = 7;
} else if (this.highestChallengeCompletedIndex === 1) {
this.character.maximumEyesFrame = 9;
this.character.maximumHairFrame = 92;
this.character.maximumMouthFrame = 8;
this.character.maximumNoseFrame = 7;
} else if (this.highestChallengeCompletedIndex === 2) {
this.character.maximumEyesFrame = 9;
this.character.maximumHairFrame = 92;
this.character.maximumMouthFrame = 10;
this.character.maximumNoseFrame = 7;
} else if (this.highestChallengeCompletedIndex === 3) {
this.character.maximumEyesFrame = 9;
this.character.maximumHairFrame = 92;
this.character.maximumMouthFrame = 10;
this.character.maximumNoseFrame = 10;
} else if (this.highestChallengeCompletedIndex === 4) {
this.character.maximumEyesFrame = 11;
this.character.maximumHairFrame = 92;
this.character.maximumMouthFrame = 10;
this.character.maximumNoseFrame = 10;
} else if (this.highestChallengeCompletedIndex === 6) {
this.character.maximumEyesFrame = 12;
this.character.maximumHairFrame = 92;
this.character.maximumMouthFrame = 11;
this.character.maximumNoseFrame = 10;
} else if (this.highestChallengeCompletedIndex === 7) {
this.character.maximumEyesFrame = 12;
this.character.maximumHairFrame = 108;
this.character.maximumMouthFrame = 11;
this.character.maximumNoseFrame = 10;
} else if (this.highestChallengeCompletedIndex === 8) {
this.character.maximumEyesFrame = 12;
this.character.maximumHairFrame = 108;
this.character.maximumMouthFrame = 11;
this.character.maximumNoseFrame = 13;
} else if (this.highestChallengeCompletedIndex === 9) {
this.character.maximumEyesFrame = 13;
this.character.maximumHairFrame = 108;
this.character.maximumMouthFrame = 12;
this.character.maximumNoseFrame = 13;
} else if (this.highestChallengeCompletedIndex === 10) {
this.character.maximumEyesFrame = 14;
this.character.maximumHairFrame = 108;
this.character.maximumMouthFrame = 13;
this.character.maximumNoseFrame = 14;
} else {
this.character.maximumEyesFrame = 5;
this.character.maximumHairFrame = 77;
this.character.maximumMouthFrame = 8;
this.character.maximumNoseFrame = 7;
}
this.character.maximumBodyFrame = 2;
this.character.maximumShirtMainBodyFrame = this.character.body.torso._totalframes;
this.character.maximumShirtSleevesFrame = this.character.frontArm.sleeve._totalframes;
this.character.maximumShoesFrame = this.character.body.frontShoe._totalframes;
this.character.maximumShortsFrame = this.character.body.shorts._totalframes;
this.character.maximumSkinFrame = 4;
this.character.minimumBodyFrame = 1;
this.character.minimumEyesFrame = 1;
this.character.minimumHairFrame = 1;
this.character.minimumMouthFrame = 1;
this.character.minimumNoseFrame = 1;
this.character.minimumShirtFrame = 1;
this.character.minimumShirtSleevesFrame = 1;
this.character.minimumShoesFrame = 1;
this.character.minimumShortsFrame = 1;
this.character.minimumSkinFrame = 1;
}
var highestChallengeCompletedIndex;
var musicLoop;
var player1 = new Player();
this.init();
Frame 6
function countBasket() {
var _local2 = this.challenges[this.challengeIndex];
_local2.currentNumberOfBaskets++;
this.statisticsOverlay.baskets.text = _local2.currentNumberOfBaskets.toString();
}
function countThrow() {
var _local2 = this.challenges[this.challengeIndex];
_local2.currentNumberOfThrows++;
this.statisticsOverlay.throws.text = _local2.currentNumberOfThrows.toString();
}
function countThrowCompleted() {
var _local2 = this.challenges[this.challengeIndex];
_local2.currentNumberOfThrowsCompleted++;
this.statisticsOverlay.throwsCompleted.text = _local2.currentNumberOfThrowsCompleted.toString();
}
function dimScreen() {
this.dimmerScreen._y = 0;
this.dimmerScreen._visible = true;
}
function disableChallengeDataOverlays() {
this.statisticsOverlay.disableOverlay();
this.timerOverlay.disableOverlay();
}
function disclaimAccuracy() {
if (!(this.statisticsOverlay.accuracy.text === "-")) {
this.statisticsOverlay.accuracy.text = ("... (Was " + this.statisticsOverlay.accuracy.text) + ")";
} else {
this.statisticsOverlay.accuracy.text = "...";
}
}
function endChallenge() {
var _local2 = this.challenges[this.challengeIndex];
if (!(this.onEnterFrame === undefined)) {
this.onEnterFrame = undefined;
}
_local2.end();
this.playArea.extraCharacter1.removeMovieClip();
this.playArea.extraCharacter2.removeMovieClip();
this.playArea.extraCharacter3.removeMovieClip();
this.playArea.playerCharacter.removeMovieClip();
this.playArea.ball.removeMovieClip();
this.playArea.ballShadow.removeMovieClip();
this.playArea.throwingGuide.removeMovieClip();
this.disableChallengeDataOverlays();
}
function fadeBooing(gameMC) {
var _local1 = gameMC.booingSound.getVolume();
if (_local1 > 0) {
gameMC.booingSound.setVolume(_local1 - 5);
} else {
gameMC.stopBooing();
}
}
function fadeClapping(gameMC) {
var _local1 = gameMC.clappingSound.getVolume();
if (_local1 > 0) {
gameMC.clappingSound.setVolume(_local1 - 5);
} else {
gameMC.stopClapping();
}
}
function getAccuracyBonusPoints(myChallengeIndex) {
var _local3;
if (((((myChallengeIndex === 6) || (myChallengeIndex === 7)) || (myChallengeIndex === 8)) || (myChallengeIndex === 9)) || (myChallengeIndex === 10)) {
_local3 = this.challenges[myChallengeIndex].getAccuracy();
if (!(_local3 === undefined)) {
return((_local3 - (_local3 % 10)) / 10);
}
return(undefined);
}
if (myChallengeIndex === 5) {
_local3 = this.challenges[myChallengeIndex].getAccuracy();
if (_local3 === 100) {
return(25);
}
} else if (myChallengeIndex === 11) {
_local3 = this.challenges[myChallengeIndex].getAccuracy();
if (_local3 === 100) {
return(50);
}
} else {
return(undefined);
}
}
function getTimeBonusPoints(myChallengeIndex) {
var _local2;
if (myChallengeIndex === 6) {
_local2 = this.challenges[myChallengeIndex].getTimeElapsed();
if (_local2 <= 18000) {
return(Math.floor(18 - (_local2 / 1000)));
}
return(0);
}
if ((myChallengeIndex === 7) || (myChallengeIndex === 9)) {
_local2 = this.challenges[myChallengeIndex].getTimeElapsed();
if (_local2 <= 30000) {
return(Math.floor(30 - (_local2 / 1000)));
}
return(0);
}
return(undefined);
}
function handleGoal() {
var _local2 = this.challenges[this.challengeIndex];
this.playArea.extraCharacter1.startCheering();
this.playArea.extraCharacter2.startCheering();
this.playArea.extraCharacter3.startCheering();
this.playArea.playerCharacter.head.nod();
this.stopBooing();
this.stopClapping();
this.clappingSound.setVolume(200);
this.clappingSound.start();
this.clappingInterval = setInterval(this.fadeClapping, 50, this);
this.countBasket();
this.countThrowCompleted();
this.updateAccuracy();
_local2.currentScoringStreak++;
if (_local2.currentScoringStreak > _local2.longestScoringStreak) {
_local2.longestScoringStreak = _local2.currentScoringStreak;
}
}
function handleKeyboardInput() {
var _local2 = this.challenges[this.challengeIndex];
if (Key.isDown(36) === true) {
this.statisticsOverlay.resetPosition();
this.timerOverlay.resetPosition();
}
if (Key.isDown(32) === true) {
_local2.currentNumberOfThrows = _local2.currentNumberOfThrows + 1;
_local2.currentNumberOfThrowsCompleted = _local2.currentNumberOfThrowsCompleted + 1;
_local2.currentNumberOfBaskets = _local2.currentNumberOfBaskets + 1;
_local2.currentScoringStreak = _local2.currentScoringStreak + 1;
this.statisticsOverlay.throws.text = _local2.currentNumberOfThrows.toString();
this.statisticsOverlay.throwsCompleted.text = _local2.currentNumberOfThrowsCompleted.toString();
this.statisticsOverlay.baskets.text = _local2.currentNumberOfBaskets.toString();
this.updateAccuracy();
}
}
function handleMiss() {
var _local2 = this.challenges[this.challengeIndex];
this.playArea.extraCharacter1.startJeering();
this.playArea.extraCharacter2.startJeering();
this.playArea.extraCharacter3.startJeering();
this.playArea.playerCharacter.head.shake();
this.stopBooing();
this.stopClapping();
this.booingSound.setVolume(200);
this.booingSound.start();
this.booingInterval = setInterval(this.fadeBooing, 50, this);
this.countThrowCompleted();
this.updateAccuracy();
_local2.currentScoringStreak = 0;
}
function hideAllChallengesCompletedOverlay() {
this.undimScreen();
this.allChallengesCompletedOverlay.onEnterFrame = function () {
if (this._y > -175) {
this._y = this._y - 40;
} else {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
}
function hideBonusOptionsUnlockedOverlay() {
this.undimScreen();
this.bonusOptionsUnlockedOverlay.onEnterFrame = function () {
if (this._y > -175) {
this._y = this._y - 40;
} else {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
}
function hideChallengeCompletedOverlay() {
this.undimScreen();
this.challengeCompletedOverlay.onEnterFrame = function () {
if (this._y > -175) {
this._y = this._y - 40;
} else {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
}
function hideChallengeFailedOverlay() {
this.undimScreen();
this.challengeFailedOverlay.onEnterFrame = function () {
if (this._y > -175) {
this._y = this._y - 40;
} else {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
}
function init() {
this.dimmerScreen._visible = false;
}
function initializeChallenges() {
this.challenge3.maximumTime = 60000;
this.challenge5.maximumTime = 60000;
this.challenge8.maximumTime = 30000;
this.challenge10.maximumTime = 90000 /* 0x015F90 */;
this.challenge1.setPlayerCharacterCoordinates(299.8, 326.7);
this.challenge2.setPlayerCharacterCoordinates(299.8, 326.7);
this.challenge3.setPlayerCharacterCoordinates(340.8, 436.8);
this.challenge4.setPlayerCharacterCoordinates(299.8, 326.7);
this.challenge5.setPlayerCharacterCoordinates(189.8, 326.7);
this.challenge6.setPlayerCharacterCoordinates(265.4, 411.1);
this.challenge7.setPlayerCharacterCoordinates(257.4, 266.1);
this.challenge8.setPlayerCharacterCoordinates(248.3, 380.1);
this.challenge9.setPlayerCharacterCoordinates(214.9, 326.7);
this.challenge10.setPlayerCharacterCoordinates(299.8, 326.7);
this.challengeB1.setPlayerCharacterCoordinates(408.8, 326.7);
this.challengeB2.setPlayerCharacterCoordinates(408.8, 326.7);
this.challenges[0] = challenge1;
this.challenges[1] = challenge2;
this.challenges[2] = challenge3;
this.challenges[3] = challenge4;
this.challenges[4] = challenge5;
this.challenges[5] = challengeB1;
this.challenges[6] = challenge6;
this.challenges[7] = challenge7;
this.challenges[8] = challenge8;
this.challenges[9] = challenge9;
this.challenges[10] = challenge10;
this.challenges[11] = challengeB2;
}
function issueChallenge() {
this.populatePlayArea();
this.challengeNumberOverlay.gotoAndStop(this.challengeIndex + 1);
if (this.challengeIndex === 0) {
this.attachMovie("Challenge Overlay 1", "challengeOverlay1", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeOverlay1.showChallengeOverlay();
} else if (this.challengeIndex === 1) {
this.attachMovie("Challenge Overlay 2", "challengeOverlay2", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeOverlay2.showChallengeOverlay();
} else if (this.challengeIndex === 2) {
this.attachMovie("Challenge Overlay 3", "challengeOverlay3", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeOverlay3.showChallengeOverlay();
} else if (this.challengeIndex === 3) {
this.attachMovie("Challenge Overlay 4", "challengeOverlay4", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeOverlay4.showChallengeOverlay();
} else if (this.challengeIndex === 4) {
this.attachMovie("Challenge Overlay 5", "challengeOverlay5", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeOverlay5.showChallengeOverlay();
} else if (this.challengeIndex === 5) {
this.attachMovie("Challenge Overlay B1", "challengeOverlayB1", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeOverlayB1.showChallengeOverlay();
} else if (this.challengeIndex === 6) {
this.attachMovie("Challenge Overlay 6", "challengeOverlay6", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeOverlay6.showChallengeOverlay();
} else if (this.challengeIndex === 7) {
this.attachMovie("Challenge Overlay 7", "challengeOverlay7", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeOverlay7.showChallengeOverlay();
} else if (this.challengeIndex === 8) {
this.attachMovie("Challenge Overlay 8", "challengeOverlay8", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeOverlay8.showChallengeOverlay();
} else if (this.challengeIndex === 9) {
this.attachMovie("Challenge Overlay 9", "challengeOverlay9", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeOverlay9.showChallengeOverlay();
} else if (this.challengeIndex === 10) {
this.attachMovie("Challenge Overlay 10", "challengeOverlay10", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeOverlay10.showChallengeOverlay();
} else if (this.challengeIndex === 11) {
this.attachMovie("Challenge Overlay B2", "challengeOverlayB2", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeOverlayB2.showChallengeOverlay();
}
if (this.challengeIndex > 0) {
this.musicPlayer.stopMusic();
this.musicPlayer.soundEffect.start();
}
this.musicPlayer.playRandomTrack();
}
function monitorChallengeState() {
var _local4 = false;
var _local2 = this.challenges[this.challengeIndex];
var _local5 = false;
var _local3 = false;
if (challengeIndex === 0) {
if (_local2.currentNumberOfBaskets >= 5) {
_local3 = true;
if (this.highestChallengeCompletedIndex === undefined) {
_local4 = true;
}
}
} else if (challengeIndex === 1) {
if ((_local2.currentNumberOfThrowsCompleted >= 10) && (_local2.getAccuracy() >= 50)) {
_local3 = true;
if ((this.highestChallengeCompletedIndex === undefined) || (this.challengeIndex > this.highestChallengeCompletedIndex)) {
_local4 = true;
}
} else if ((_local2.currentNumberOfThrowsCompleted >= 10) || (_local2.getThrowsMissed() >= 6)) {
_local5 = true;
}
} else if (challengeIndex === 2) {
if (_local2.getTimeElapsed() >= this.challenge3.maximumTime) {
if (_local2.currentNumberOfBaskets >= 10) {
_local3 = true;
if ((this.highestChallengeCompletedIndex === undefined) || (this.challengeIndex > this.highestChallengeCompletedIndex)) {
_local4 = true;
}
} else {
_local5 = true;
}
}
} else if (challengeIndex === 3) {
if ((_local2.currentNumberOfThrowsCompleted >= 10) && (_local2.getAccuracy() >= 60)) {
_local3 = true;
if ((this.highestChallengeCompletedIndex === undefined) || (this.challengeIndex > this.highestChallengeCompletedIndex)) {
_local4 = true;
}
} else if ((_local2.currentNumberOfThrowsCompleted >= 10) || (_local2.getThrowsMissed() >= 7)) {
_local5 = true;
}
} else if (challengeIndex === 4) {
if (((_local2.getTimeElapsed() >= this.challenge5.maximumTime) && (_local2.currentNumberOfThrowsCompleted >= 10)) && (_local2.getAccuracy() >= 50)) {
_local3 = true;
if ((this.highestChallengeCompletedIndex === undefined) || (this.challengeIndex > this.highestChallengeCompletedIndex)) {
_local4 = true;
}
} else if ((_local2.getTimeElapsed() >= this.challenge5.maximumTime) && ((_local2.currentNumberOfThrowsCompleted < 10) || (_local2.getAccuracy() < 50))) {
_local5 = true;
}
} else if (challengeIndex === 5) {
if (_local2.currentNumberOfThrowsCompleted >= 5) {
_local3 = true;
}
} else if (challengeIndex === 6) {
if (_local2.currentScoringStreak >= 6) {
_local3 = true;
if ((this.highestChallengeCompletedIndex === undefined) || (this.challengeIndex > this.highestChallengeCompletedIndex)) {
_local4 = true;
}
}
} else if (challengeIndex === 7) {
if ((_local2.currentNumberOfThrowsCompleted >= 10) && (_local2.getAccuracy() >= 80)) {
_local3 = true;
if ((this.highestChallengeCompletedIndex === undefined) || (this.challengeIndex > this.highestChallengeCompletedIndex)) {
_local4 = true;
}
} else if ((_local2.currentNumberOfThrowsCompleted >= 10) || (_local2.getThrowsMissed() >= 3)) {
_local5 = true;
}
} else if (challengeIndex === 8) {
if (((_local2.getTimeElapsed() >= this.challenge8.maximumTime) && (_local2.currentNumberOfThrowsCompleted >= 10)) && (_local2.getAccuracy() >= 80)) {
_local3 = true;
if ((this.highestChallengeCompletedIndex === undefined) || (this.challengeIndex > this.highestChallengeCompletedIndex)) {
_local4 = true;
}
} else if ((_local2.getTimeElapsed() >= this.challenge8.maximumTime) && ((_local2.currentNumberOfThrowsCompleted < 10) || (_local2.getAccuracy() < 80))) {
_local5 = true;
}
} else if (challengeIndex === 9) {
if (_local2.currentScoringStreak >= 10) {
_local3 = true;
if ((this.highestChallengeCompletedIndex === undefined) || (this.challengeIndex > this.highestChallengeCompletedIndex)) {
_local4 = true;
}
}
} else if (challengeIndex === 10) {
if (((_local2.getTimeElapsed() >= this.challenge10.maximumTime) && (_local2.currentNumberOfThrowsCompleted >= 20)) && (_local2.getAccuracy() >= 90)) {
_local3 = true;
if ((this.highestChallengeCompletedIndex === undefined) || (this.challengeIndex > this.highestChallengeCompletedIndex)) {
_local4 = true;
}
} else if (((_local2.getTimeElapsed() >= this.challenge10.maximumTime) && ((_local2.currentNumberOfThrowsCompleted < 20) || (_local2.getAccuracy() < 90))) || (_local2.getAccuracy() < 60)) {
_local5 = true;
}
} else if (challengeIndex === 11) {
if (_local2.currentNumberOfThrowsCompleted >= 10) {
_local3 = true;
}
}
if (_local3 === true) {
this.endChallenge();
if (_local4 === true) {
this.showChallengeCompletedOverlay(true);
this.prepareSingleChallengeScoringSummary();
this.saveHighestChallengeCompletedIndex(challengeIndex);
} else {
this.showChallengeCompletedOverlay(false);
this.prepareSingleChallengeScoringSummary();
}
} else if (_local5 === true) {
this.endChallenge();
this.showChallengeFailedOverlay();
}
}
function populatePlayArea() {
var _local2 = this.challenges[this.challengeIndex];
this.playArea.attachMovie("Bobblehead Character", "extraCharacter1", this.playArea.getNextHighestDepth(), {_x:255, _y:170, _xscale:50, _yscale:50});
this.playArea.attachMovie("Bobblehead Character", "extraCharacter2", this.playArea.getNextHighestDepth(), {_x:355, _y:175, _xscale:50, _yscale:50});
this.playArea.attachMovie("Bobblehead Character", "extraCharacter3", this.playArea.getNextHighestDepth(), {_x:455, _y:160, _xscale:50, _yscale:50});
this.playArea.attachMovie("Bobblehead Character", "playerCharacter", this.playArea.getNextHighestDepth(), {_x:_local2.playerCharacterX, _y:_local2.playerCharacterY, _xscale:60, _yscale:60});
this.playArea.extraCharacter1.randomizeAppearance();
this.playArea.extraCharacter2.randomizeAppearance();
this.playArea.extraCharacter3.randomizeAppearance();
this.playArea.playerCharacter.setChest(this.player1.avatar.appearance.chest);
this.playArea.playerCharacter.setEyes(this.player1.avatar.appearance.eyes);
this.playArea.playerCharacter.setHair(this.player1.avatar.appearance.hair);
this.playArea.playerCharacter.setMouth(this.player1.avatar.appearance.mouth);
this.playArea.playerCharacter.setNose(this.player1.avatar.appearance.nose);
this.playArea.playerCharacter.setSkin(this.player1.avatar.appearance.skin);
this.playArea.playerCharacter.setShirt(this.player1.avatar.appearance.shirtMainBody, this.player1.avatar.appearance.shirtSleeves);
this.playArea.playerCharacter.setShoes(this.player1.avatar.appearance.shoes);
this.playArea.playerCharacter.setShorts(this.player1.avatar.appearance.shorts);
}
function positionBallAndThrowingGuide() {
this.playArea.ball.initialX = this.playArea.playerCharacter._x + 50.2;
this.playArea.ball.initialY = this.playArea.playerCharacter._y - 10.4;
this.playArea.ball._x = this.playArea.ball.initialX;
this.playArea.ball._y = this.playArea.ball.initialY;
this.playArea.ball.calculateFloorPointY();
this.playArea.ball.manageShadow();
this.playArea.throwingGuide._x = this.playArea.ball._x;
this.playArea.throwingGuide._y = this.playArea.ball._y;
}
function prepareAudio() {
this.createEmptyMovieClip("clappingSound_mc", this.getNextHighestDepth());
clappingSound = new Sound(this.clappingSound_mc);
clappingSound.attachSound("Clapping");
this.createEmptyMovieClip("booingSound_mc", this.getNextHighestDepth());
booingSound = new Sound(this.booingSound_mc);
booingSound.attachSound("Booing");
}
function prepareButtons() {
this.agButton.onRelease = function () {
getURL ("http://www.addictinggames.com/", "_blank");
};
this.ggButton.onRelease = function () {
getURL ("http://www.gravitasgames.com/", "_blank");
};
}
function prepareChallengeDataOverlays() {
this.statisticsOverlay.accuracy.text = "-";
this.statisticsOverlay.baskets.text = "0";
this.statisticsOverlay.throws.text = "0";
this.statisticsOverlay.throwsCompleted.text = "0";
this.statisticsOverlay.enableOverlay();
this.timerOverlay.timeElapsed.text = "-";
this.timerOverlay.timeRemaining.text = "-";
this.timerOverlay.enableOverlay();
}
function prepareFinalScoringSummary() {
var _local4;
var _local9 = 0;
var _local8 = 0;
var _local3;
var _local6;
var _local7 = 0;
var _local5;
var _local10 = 0;
var _local2 = 0;
while (_local2 < 12) {
_local3 = 0;
_local6 = this.challenges[_local2];
_local4 = this.getAccuracyBonusPoints(_local2);
_local5 = this.getTimeBonusPoints(_local2);
_local8 = _local8 + _local6.currentNumberOfBaskets;
_local3 = _local3 + _local6.currentNumberOfBaskets;
if (!(_local4 === undefined)) {
_local9 = _local9 + _local4;
_local3 = _local3 + _local4;
}
if (!(_local5 === undefined)) {
_local10 = _local10 + _local5;
_local3 = _local3 + _local5;
}
_local7 = _local7 + _local3;
_local2++;
}
if (_local8 === undefined) {
this.scoringSummaryOverlay.baskets.text = "0";
} else {
this.scoringSummaryOverlay.baskets.text = _local8.toString();
}
if (_local9 === undefined) {
this.scoringSummaryOverlay.accuracyBonusPoints.text = "0";
} else {
this.scoringSummaryOverlay.accuracyBonusPoints.text = _local9.toString();
}
if (_local10 === undefined) {
this.scoringSummaryOverlay.timeBonusPoints.text = "0";
} else {
this.scoringSummaryOverlay.timeBonusPoints.text = _local10.toString();
}
if (_local7 === undefined) {
this.scoringSummaryOverlay.grandTotal.text = "0";
} else {
this.scoringSummaryOverlay.grandTotal.text = _local7.toString();
}
}
function preparePlayArea() {
this.playArea.attachMovie("Goal Post", "goalPost", this.playArea.getNextHighestDepth(), {_x:700, _y:190});
this.playArea.attachMovie("Goal Background", "goalBackground", this.playArea.getNextHighestDepth(), {_x:655, _y:235});
this.playArea.attachMovie("Goal Foreground", "goalForeground", this.playArea.getNextHighestDepth(), {_x:655, _y:235});
}
function prepareSingleChallengeScoringSummary() {
var _local3 = this.getAccuracyBonusPoints(this.challengeIndex);
var _local5 = this.challenges[this.challengeIndex];
var _local4 = this.getTimeBonusPoints(this.challengeIndex);
var _local2 = 0;
this.challengeCompletedOverlay.scoringSummaryOverlay.baskets.text = _local5.currentNumberOfBaskets.toString();
_local2 = _local2 + _local5.currentNumberOfBaskets;
if (_local3 === undefined) {
this.challengeCompletedOverlay.scoringSummaryOverlay.accuracyBonus.text = "-";
} else {
this.challengeCompletedOverlay.scoringSummaryOverlay.accuracyBonus.text = _local3.toString();
_local2 = _local2 + _local3;
}
if (_local4 === undefined) {
this.challengeCompletedOverlay.scoringSummaryOverlay.timeBonus.text = "-";
} else {
this.challengeCompletedOverlay.scoringSummaryOverlay.timeBonus.text = _local4.toString();
_local2 = _local2 + _local4;
}
this.challengeCompletedOverlay.scoringSummaryOverlay.total.text = _local2.toString();
}
function proceedToNextChallengeOrEndGame() {
if ((challengeIndex + 1) < this.challenges.length) {
this.challengeIndex++;
this.issueChallenge();
} else {
this.showAllChallengesCompletedOverlay();
}
}
function showAllChallengesCompletedOverlay() {
this.dimScreen();
this.attachMovie("All Challenges Completed Overlay", "allChallengesCompletedOverlay", this.getNextHighestDepth(), {_x:400, _y:-175});
this.allChallengesCompletedOverlay.onEnterFrame = function () {
if (this._y < 300) {
this._y = this._y + 40;
} else if (this._y > 300) {
this._y = this._y - 5;
} else {
delete this.onEnterFrame;
}
};
this.allChallengesCompletedOverlay.arrowButton.onRelease = function () {
this.enabled = false;
this._parent._parent.hideAllChallengesCompletedOverlay();
gotoAndStop (7);
};
}
function showBonusOptionsUnlockedOverlay() {
this.dimScreen();
this.attachMovie("Bonus Options Unlocked Overlay", "bonusOptionsUnlockedOverlay", this.getNextHighestDepth(), {_x:400, _y:-175});
this.bonusOptionsUnlockedOverlay.onEnterFrame = function () {
if (this._y < 300) {
this._y = this._y + 40;
} else if (this._y > 300) {
this._y = this._y - 5;
} else {
delete this.onEnterFrame;
}
};
this.bonusOptionsUnlockedOverlay.arrowButton.onRelease = function () {
this.enabled = false;
this._parent._parent.hideBonusOptionsUnlockedOverlay();
this._parent._parent.proceedToNextChallengeOrEndGame();
};
}
function showChallengeCompletedOverlay(displayBonusUnlockMessage) {
this.dimScreen();
this.attachMovie("Challenge Completed Overlay", "challengeCompletedOverlay", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeCompletedOverlay.onEnterFrame = function () {
if (this._y < 300) {
this._y = this._y + 40;
} else if (this._y > 300) {
this._y = this._y - 5;
} else {
delete this.onEnterFrame;
}
};
if (displayBonusUnlockMessage === true) {
this.challengeCompletedOverlay.arrowButton.onRelease = function () {
this.enabled = false;
this._parent._parent.hideChallengeCompletedOverlay();
this._parent._parent.showBonusOptionsUnlockedOverlay();
};
} else {
this.challengeCompletedOverlay.arrowButton.onRelease = function () {
this.enabled = false;
this._parent._parent.hideChallengeCompletedOverlay();
this._parent._parent.proceedToNextChallengeOrEndGame();
};
}
}
function showChallengeFailedOverlay() {
this.dimScreen();
this.attachMovie("Challenge Failed Overlay", "challengeFailedOverlay", this.getNextHighestDepth(), {_x:400, _y:-175});
this.challengeFailedOverlay.onEnterFrame = function () {
if (this._y < 300) {
this._y = this._y + 40;
} else if (this._y > 300) {
this._y = this._y - 5;
} else {
delete this.onEnterFrame;
}
};
this.challengeFailedOverlay.quitGameButton.onRelease = function () {
this.enabled = false;
this._parent.tryAgainButton.enabled = false;
this._parent._parent.hideChallengeFailedOverlay();
gotoAndStop (4);
};
this.challengeFailedOverlay.tryAgainButton.onRelease = function () {
var _local2 = this._parent._parent.challenges[this._parent._parent.challengeIndex];
this.enabled = false;
this._parent.quitGameButton.enabled = false;
this._parent._parent.hideChallengeFailedOverlay();
_local2.initialize();
this._parent._parent.issueChallenge();
};
}
function startChallenge() {
var _local2 = this.challenges[this.challengeIndex];
this.playArea.attachMovie("Throwing Guide", "throwingGuide", this.playArea.getNextHighestDepth(), {_x:this.playArea.playerCharacter._x + 50.2, _y:this.playArea.playerCharacter._y - 10.4, _alpha:30});
this.playArea.attachMovie("Basketball", "ball", this.playArea.getNextHighestDepth(), {_x:this.playArea.playerCharacter._x + 50.2, _y:this.playArea.playerCharacter._y - 10.4});
this.playArea.attachMovie("Ball Shadow", "ballShadow", this.playArea.getNextHighestDepth(), {_x:this.playArea.ball._x + 3, _y:this.playArea.ball._y + 82});
this.playArea.throwingGuide.swapDepths(this.playArea.goalForeground);
this.playArea.ball.swapDepths(this.playArea.goalForeground);
this.positionBallAndThrowingGuide();
this.onEnterFrame = function () {
this.handleKeyboardInput();
this.updateTimerDisplays();
this.monitorChallengeState();
};
this.prepareChallengeDataOverlays();
_local2.start();
}
function stopBooing() {
if (!(this.booingInterval === undefined)) {
clearInterval(this.booingInterval);
this.booingInterval = undefined;
}
if (!(this.booingTimeout === undefined)) {
clearTimeout(this.booingTimeout);
this.booingTimeout = undefined;
}
this.booingSound.stop();
}
function stopClapping() {
if (!(this.clappingInterval === undefined)) {
clearInterval(this.clappingInterval);
this.clappingInterval = undefined;
}
if (!(this.clappingTimeout === undefined)) {
clearTimeout(this.clappingTimeout);
this.clappingTimeout = undefined;
}
this.clappingSound.stop();
}
function undimScreen() {
this.dimmerScreen._y = -620;
this.dimmerScreen._visible = false;
}
function updateAccuracy() {
var _local3;
var _local2 = this.challenges[this.challengeIndex];
_local3 = (_local2.currentNumberOfBaskets / _local2.currentNumberOfThrows) * 100;
this.statisticsOverlay.accuracy.text = (int(_local3 * 10) / 10).toString() + "%";
}
function updateTimerDisplays() {
var _local5 = this.challenges[this.challengeIndex];
var _local4 = (getTimer() - _local5.timeStarted) / 1000;
var _local6;
var _local3;
var _local2;
_local3 = Math.floor(_local4 / 60);
_local2 = Math.round(_local4 % 60);
if (_local2 > 9) {
this.timerOverlay.timeElapsed.text = (_local3.toString() + ":") + _local2.toString();
} else {
this.timerOverlay.timeElapsed.text = (_local3.toString() + ":0") + _local2.toString();
}
if (!(_local5.maximumTime === undefined)) {
_local6 = (_local5.maximumTime / 1000) - _local4;
_local3 = Math.floor(((_local5.maximumTime / 1000) - _local4) / 60);
_local2 = Math.round(((_local5.maximumTime / 1000) - _local4) % 60);
if (_local2 > 9) {
this.timerOverlay.timeRemaining.text = (_local3.toString() + ":") + _local2.toString();
} else {
this.timerOverlay.timeRemaining.text = (_local3.toString() + ":0") + _local2.toString();
}
} else if (!(this.timerOverlay.timeRemaining.text === "Unlimited")) {
this.timerOverlay.timeRemaining.text = "Unlimited";
}
}
var booingInterval;
var booingSound;
var booingTimeout;
var challenge1 = new Challenge();
var challenge2 = new Challenge();
var challenge3 = new Challenge();
var challenge4 = new Challenge();
var challenge5 = new Challenge();
var challenge6 = new Challenge();
var challenge7 = new Challenge();
var challenge8 = new Challenge();
var challenge9 = new Challenge();
var challenge10 = new Challenge();
var challengeB1 = new Challenge();
var challengeB2 = new Challenge();
var challengeIndex = 0;
var challenges = new Array();
var clappingInterval;
var clappingSound;
var clappingTimeout;
this.stop();
stopAllSounds();
ApplicationStateUtilities.useGameContextMenu(this);
this.init();
this.initializeChallenges();
this.loadHighestChallengeCompletedIndex();
trace("[ Main Game ] Highest Challenge Completed Index: " + this.highestChallengeCompletedIndex);
this.prepareAudio();
this.preparePlayArea();
this.prepareButtons();
this.disableChallengeDataOverlays();
this.issueChallenge();
Frame 7
function init() {
this.stop();
stopAllSounds();
ApplicationStateUtilities.useGameContextMenu(this);
this.prepareAudio();
this.prepareButtons();
this.prepareFinalScoringSummary();
this.musicLoop.start();
}
function prepareAudio() {
if (this.musicLoop_mc === undefined) {
this.createEmptyMovieClip("musicLoop_mc", this.getNextHighestDepth());
}
musicLoop = new Sound(this.musicLoop_mc);
musicLoop.attachSound("Ending Theme");
this.musicLoop.onSoundComplete = function () {
this.start();
};
}
function prepareButtons() {
this.agButton.onRelease = function () {
getURL ("http://www.addictinggames.com/", "_blank");
};
this.ggButton.onRelease = function () {
getURL ("http://www.gravitasgames.com/", "_blank");
};
this.startButton.onRelease = function () {
this._parent.play();
};
this.titleButton.onRelease = function () {
this._parent.returnToTitleScreen();
};
}
var musicLoop;
this.init();
Symbol 9 MovieClip [FPS Display] Frame 1
#initclip 15
Object.registerClass("FPS Display", FPSDisplay);
#endinitclip
Symbol 11 MovieClip [PC Head - Side View] Frame 1
#initclip 13
Object.registerClass("PC Head - Side View", Head);
#endinitclip
Symbol 16 MovieClip [NPC Head - Front-View] Frame 1
#initclip 14
Object.registerClass("NPC Head - Front-View", Head);
#endinitclip
Symbol 27 MovieClip Frame 1
this.stop();
Symbol 29 MovieClip Frame 1
var loadingFinished = false;
this._parent.stop();
this.loadingProgressIndicator.progressBar._xscale = 1;
this.onEnterFrame = function () {
var _local2 = this._parent.getBytesLoaded();
var _local3 = this._parent.getBytesTotal();
if (this.loadingFinished === false) {
if (((_local2 > 0) && (_local3 > 0)) && (_local2 < _local3)) {
this.loadingProgressIndicator.progressBar._xscale = (_local2 / _local3) * 100;
} else if ((_local2 > 0) && (_local3 > 0)) {
this.loadingProgressIndicator.progressBar._xscale = 100;
this.loadingProgressIndicator.statusText.nextFrame();
this.loadingFinished = true;
this.loadingProgressIndicator.fadeToBlack();
}
} else if (this.loadingProgressIndicator._alpha <= 0) {
delete this.onEnterFrame;
this._parent.play();
}
};
this.loadingProgressIndicator.fadeToBlack = function () {
this.onEnterFrame = function () {
this._alpha = this._alpha - 2;
if (this._alpha <= 0) {
delete this.onEnterFrame;
}
};
};
Symbol 692 MovieClip [__Packages.ApplicationStateUtilities] Frame 0
class ApplicationStateUtilities
{
function ApplicationStateUtilities () {
}
static function handleAddictingGamesClick() {
if (!(Stage.displayState === "normal")) {
Stage.displayState = "normal";
}
getURL ("http://www.addictinggames.com/", "_blank");
}
static function handleGravitasGamesClick() {
if (!(Stage.displayState === "normal")) {
Stage.displayState = "normal";
}
getURL ("http://www.gravitasgames.com/", "_blank");
}
static function useCommonCustomContextMenu(movieClip) {
var _local1 = new ContextMenu();
_local1.builtInItems.play = false;
_local1.builtInItems.loop = false;
_local1.builtInItems.rewind = false;
_local1.builtInItems.forward_back = false;
_local1.builtInItems.print = false;
var _local3 = new ContextMenuItem("AddictingGames Web Site", handleAddictingGamesClick);
var _local2 = new ContextMenuItem("Gravitas Games Web Site", handleGravitasGamesClick);
_local1.customItems.push(_local3);
_local1.customItems.push(_local2);
movieClip.menu = _local1;
}
static function useGameContextMenu(movieClip) {
var _local1 = new ContextMenu();
_local1.builtInItems.play = false;
_local1.builtInItems.loop = false;
_local1.builtInItems.rewind = false;
_local1.builtInItems.forward_back = false;
_local1.builtInItems.print = false;
var _local2 = new ContextMenuItem("AddictingGames Web Site", handleAddictingGamesClick);
var _local3 = new ContextMenuItem("Gravitas Games Web Site", handleGravitasGamesClick);
var _local4 = new ContextMenuItem("Return to Title Screen", function () {
movieClip.returnToTitleScreen();
});
_local2.separatorBefore = true;
_local1.customItems.push(_local4);
_local1.customItems.push(_local2);
_local1.customItems.push(_local3);
movieClip.menu = _local1;
}
}
Symbol 693 MovieClip [__Packages.Head] Frame 0
class Head extends MovieClip
{
var initialX, _x, initialY, _y, isNodding, isShaking, xRange, xRestitutionFactor, xVelocityDecayRate, yRange, yRestitutionFactor, yVelocityDecayRate, _parent, maximumY, yVelocity, minimumY, _rotation, onEnterFrame, _xscale, maximumX, xVelocity, minimumX, backdrop, _yscale;
function Head () {
super();
initialX = _x;
initialY = _y;
isNodding = false;
isShaking = false;
xRange = 10;
xRestitutionFactor = 0.9;
xVelocityDecayRate = 0.1;
yRange = 10;
yRestitutionFactor = 0.9;
yVelocityDecayRate = 0.1;
if ((!(_parent.headBackdrop === undefined)) && (typeof(_parent.headBackdrop) === "movieclip")) {
setBackdrop(_parent.headBackdrop);
}
}
function animateNod() {
if (((_y + yVelocity) > maximumY) || ((_y + yVelocity) < minimumY)) {
yVelocity = yVelocity * -1;
_rotation = yVelocity / 2;
_x = initialX + (yVelocity / 2);
}
if (Math.abs(yVelocity) >= 1) {
_y = _y + yVelocity;
yVelocity = yVelocity - (yVelocity * yVelocityDecayRate);
maximumY = initialY + (yRange * yRestitutionFactor);
minimumY = initialY - (yRange * yRestitutionFactor);
} else {
yVelocity = 0;
_rotation = 0;
_x = initialX;
_y = initialY;
isNodding = false;
delete onEnterFrame;
}
synchronizeBackdrop();
}
function animateShake() {
_xscale = _xscale * -1;
if (((_x + xVelocity) > maximumX) || ((_x + xVelocity) < minimumX)) {
xVelocity = xVelocity * -1;
_rotation = xVelocity / 2;
_y = initialY + (xVelocity / 2);
}
if (Math.abs(xVelocity) >= 1) {
_x = _x + xVelocity;
xVelocity = xVelocity - (xVelocity * xVelocityDecayRate);
maximumX = initialX + (xRange * xRestitutionFactor);
minimumX = initialX - (xRange * xRestitutionFactor);
} else {
xVelocity = 0;
_rotation = 0;
_x = initialX;
_y = initialY;
_xscale = 100;
isShaking = false;
delete onEnterFrame;
}
synchronizeBackdrop();
}
function nod() {
isNodding = true;
maximumY = initialY + yRange;
minimumY = initialY - yRange;
yVelocity = 10;
onEnterFrame = animateNod;
}
function setBackdrop(backdrop) {
this.backdrop = backdrop;
}
function shake() {
isShaking = true;
maximumX = initialX + xRange;
minimumX = initialX - xRange;
xVelocity = 10;
onEnterFrame = animateShake;
}
function synchronizeBackdrop() {
if (!(backdrop === undefined)) {
backdrop._rotation = _rotation;
backdrop._x = _x;
backdrop._y = _y;
backdrop._xscale = _xscale;
backdrop._yscale = _yscale;
}
}
}
Symbol 694 MovieClip [__Packages.FPSDisplay] Frame 0
class FPSDisplay extends MovieClip
{
var lastTime, highestFPS, lowestFPS, currentFPSDisplay, highestFPSDisplay, lowestFPSDisplay, onEnterFrame, onPress;
function FPSDisplay () {
super();
init();
}
function determineAndDisplayFPSData() {
var _local2;
var _local3;
var _local4;
_local3 = getTimer();
if (!(lastTime === undefined)) {
_local4 = _local3 - lastTime;
_local2 = 1000 / _local4;
if ((highestFPS === undefined) || (_local2 > highestFPS)) {
highestFPS = _local2;
}
if ((lowestFPS === undefined) || (_local2 < lowestFPS)) {
lowestFPS = _local2;
}
currentFPSDisplay.text = (Math.round(_local2 * 10) / 10).toString();
highestFPSDisplay.text = (Math.round(highestFPS * 10) / 10).toString();
lowestFPSDisplay.text = (Math.round(lowestFPS * 10) / 10).toString();
}
lastTime = _local3;
}
function init() {
delete onEnterFrame;
lastTime = undefined;
highestFPS = undefined;
lowestFPS = undefined;
onEnterFrame = determineAndDisplayFPSData;
onPress = init;
}
}
Symbol 695 MovieClip [__Packages.ChallengeOverlay] Frame 0
class ChallengeOverlay extends MovieClip
{
var _parent, onEnterFrame, arrowButton;
function ChallengeOverlay () {
super();
}
function hideChallengeOverlay() {
_parent.undimScreen();
onEnterFrame = function () {
if (this._y > -175) {
this._y = this._y - 40;
} else {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
}
function showChallengeOverlay() {
_parent.dimScreen();
onEnterFrame = function () {
if (this._y < 300) {
this._y = this._y + 40;
} else if (this._y > 300) {
this._y = this._y - 5;
} else {
delete this.onEnterFrame;
}
};
arrowButton.onRelease = function () {
this.enabled = false;
this._parent.hideChallengeOverlay();
this._parent._parent.startChallenge();
};
}
}
Symbol 696 MovieClip [__Packages.Basketball] Frame 0
class Basketball extends MovieClip
{
var initialX, initialY, _x, floorY, _width, collisionPoints, _y, restitutionFactor, yAtFrameEntry, xAtFrameEntry, scored, _parent, getBounds, missed, maximumDraggingDistance, stopDrag, dragging, _alpha, frictionFactor, _rotation, _xscale, initialXScale, _yscale, initialYScale, minimumDraggingDeltaX, minimumDraggingDeltaY, onEnterFrame, onMouseMove, onPress, onRelease, onReleaseOutside;
function Basketball () {
super();
init();
}
function calculateFloorPointY() {
var _local2 = 575 - initialX;
var _local3 = 345 - (initialY + 82);
var _local5 = Utilities.getDistance(initialX, initialY, _local2, _local3);
var _local4 = (_x - initialX) / _local2;
floorY = (initialY + 82) + (_local3 * _local4);
}
function detectAndHandleCollision() {
var _local5 = _width / 2;
for (var _local6 in collisionPoints) {
var _local3 = collisionPoints[_local6].x;
var _local2 = collisionPoints[_local6].y;
var _local4 = Math.sqrt(Math.pow(_local3 - _x, 2) + Math.pow(_local2 - _y, 2));
if (_local4 <= _local5) {
handlePointBreach(_local3, _local2);
}
}
if (((_x > (backboardX - _local5)) && (_y > backboardTopY)) && (_y < backboardBottomY)) {
var _local7 = _local5 - (backboardX - _x);
var _local8 = _local7 / velocityVectorX;
_x = _x - _local7;
_y = _y - (_local8 * velocityVectorY);
velocityVectorX = velocityVectorX * (-restitutionFactor);
velocityVectorY = velocityVectorY * restitutionFactor;
}
}
function detectAndHandleGoal() {
if ((((((_y > rimY) && (_x > rimLeftX)) && (_x < rimRightX)) && (yAtFrameEntry <= rimY)) && (xAtFrameEntry > rimLeftX)) && (xAtFrameEntry < rimRightX)) {
scored = true;
_parent._parent.handleGoal();
}
}
function detectAndHandleMiss() {
var _local2 = getBounds(_parent);
if (scored === false) {
if ((_y > rimY) && (_y > yAtFrameEntry)) {
missed = true;
_parent._parent.handleMiss();
} else if (_x > backboardX) {
missed = true;
_parent._parent.handleMiss();
} else if ((_local2.xMin > 640) && (_local2.xMax < 0)) {
missed = true;
_parent._parent.handleMiss();
}
}
}
function determineVelocityFromCoordinates() {
var _local3;
var _local4;
var _local2;
_local3 = {deltaX:_x - initialX, deltaY:_y - initialY};
_local4 = Utilities.getDistance(0, 0, _local3.deltaX, _local3.deltaY);
_local2 = _local3;
if (_local4 > maximumDraggingDistance) {
Utilities.scaleVector(_local2, _local4, maximumDraggingDistance);
}
velocityVectorX = _local2.deltaX;
velocityVectorY = _local2.deltaY;
}
function handleDragging() {
var _local2 = Utilities.getDistance(initialX, initialY, _x, _y);
_parent.playerCharacter.animateHoldingArms(this);
if (((_local2 >= maximumDraggingDistance) && (_x > initialX)) && (_y < initialY)) {
stopDrag();
dragging = false;
_alpha = 100;
_parent.playerCharacter.startThrowingAnimation();
determineVelocityFromCoordinates();
startMoving();
_parent._parent.countThrow();
_parent._parent.disclaimAccuracy();
} else if (_local2 >= maximumDraggingDistance) {
stopDrag();
dragging = false;
_alpha = 100 - (3 * _local2);
} else if ((_x < initialX) || (_y > initialY)) {
_alpha = 100 - (2 * _local2);
} else {
_alpha = 100;
}
}
function handleMovement() {
var _local2 = getBounds(_parent);
velocityVectorX = velocityVectorX - (frictionFactor * velocityVectorX);
if (!(velocityVectorX === undefined)) {
_x = _x + velocityVectorX;
_rotation = _rotation + (velocityVectorX * 2);
} else {
_rotation = 0;
}
if (!(velocityVectorY === undefined)) {
if (_local2.yMax < floorY) {
_y = _y + velocityVectorY;
velocityVectorY = velocityVectorY + 0.5;
} else {
_y = floorY - (_local2.yMax - _y);
velocityVectorY = velocityVectorY * -1;
}
}
}
function handlePointBreach(pointX, pointY) {
var _local6 = Utilities.getDistance(0, 0, velocityVectorX, velocityVectorY);
var _local4 = Utilities.estimateCirclePointIncursionVector(_x, _y, _width / 2, velocityVectorX, velocityVectorY, pointX, pointY);
_x = _x + (-_local4.deltaX);
_y = _y + (-_local4.deltaY);
var _local2 = {deltaX:velocityVectorX, deltaY:velocityVectorY};
collisionVectorX = pointX - _x;
collisionVectorY = pointY - _y;
var _local3 = {deltaX:collisionVectorX, deltaY:collisionVectorY};
Utilities.normalizeVector(_local2);
Utilities.normalizeVector(_local3);
var _local5 = Utilities.getDotProduct(_local2, _local3);
_local2.deltaX = _local2.deltaX - ((2 * _local5) * _local3.deltaX);
_local2.deltaY = _local2.deltaY - ((2 * _local5) * _local3.deltaY);
var _local7 = Utilities.getDistance(0, 0, _local2.deltaX, _local2.deltaY);
Utilities.scaleVector(_local2, _local7, _local6 * restitutionFactor);
velocityVectorX = _local2.deltaX;
velocityVectorY = _local2.deltaY;
}
function init() {
_alpha = 100;
_xscale = initialXScale;
_yscale = initialYScale;
missed = false;
scored = false;
collisionPoints = new Array();
collisionPoints[0] = new Object();
collisionPoints[1] = new Object();
collisionPoints[2] = new Object();
collisionPoints[0].x = rimLeftX;
collisionPoints[0].y = rimY;
collisionPoints[1].x = rimRightX;
collisionPoints[1].y = rimY;
collisionPoints[2].x = backboardX;
collisionPoints[2].y = backboardTopY;
dragging = false;
minimumDraggingDeltaX = 0;
minimumDraggingDeltaY = -10;
maximumDraggingDistance = 20;
initialX = _x;
initialY = _y;
calculateFloorPointY();
manageShadow();
frictionFactor = 0.03;
restitutionFactor = 0.6;
initialXScale = _xscale;
initialYScale = _yscale;
velocityVectorX = undefined;
velocityVectorY = undefined;
xAtFrameEntry = undefined;
yAtFrameEntry = undefined;
setDragRelatedEventHandlers();
}
function manageShadow() {
var _local3 = _parent.ballShadow._y - _y;
var _local2 = 100 - (_local3 / 6);
_parent.ballShadow._x = _x + 3;
_parent.ballShadow._y = floorY;
_parent.ballShadow._alpha = _local2;
_parent.ballShadow._xscale = _local2;
_parent.ballShadow._yscale = _local2;
}
function markFloorOnDebugCanvas() {
var _local2;
if (!(_parent.debugCanvas === undefined)) {
_local2 = _parent.debugCanvas;
} else {
_local2 = _parent.createEmptyMovieClip("debugCanvas", _parent.getNextHighestDepth());
}
_local2.clear();
_local2.lineStyle(2, 3355443, 30);
_local2.moveTo(_x - 2, floorY - 2);
_local2.lineTo(_x + 2, floorY + 2);
_local2.moveTo(_x + 2, floorY - 2);
_local2.lineTo(_x - 2, floorY + 2);
}
function markPositionOnDebugCanvas() {
var _local2;
if (!(_parent.debugCanvas === undefined)) {
_local2 = _parent.debugCanvas;
} else {
_local2 = _parent.createEmptyMovieClip("debugCanvas", _parent.getNextHighestDepth());
}
_local2.lineStyle(2, 16750848, 30);
_local2.moveTo(_x - 2, _y - 2);
_local2.lineTo(_x + 2, _y + 2);
_local2.moveTo(_x + 2, _y - 2);
_local2.lineTo(_x - 2, _y + 2);
}
function reset() {
_x = initialX;
_y = initialY;
if (!(onEnterFrame === undefined)) {
delete onEnterFrame;
}
init();
}
function setDragRelatedEventHandlers() {
onMouseMove = function () {
this.manageShadow();
};
onPress = function () {
this.startDrag(false, this._x - this.maximumDraggingDistance, this._y - this.maximumDraggingDistance, this._x + this.maximumDraggingDistance, this._y + this.maximumDraggingDistance);
this.dragging = true;
};
onRelease = function () {
this.stopDrag();
this.dragging = false;
if ((this._x > this.initialX) && (this._y < this.initialY)) {
this._parent.playerCharacter.startThrowingAnimation();
this.determineVelocityFromCoordinates();
this.startMoving();
this._parent._parent.countThrow();
this._parent._parent.disclaimAccuracy();
} else {
this.reset();
}
};
onReleaseOutside = function () {
if (this.dragging === true) {
this.stopDrag();
this.dragging = false;
}
this.reset();
};
onEnterFrame = handleDragging;
}
function startMoving() {
if (!(onPress === undefined)) {
delete onPress;
}
if (!(onRelease === undefined)) {
delete onRelease;
}
if (!(onReleaseOutside === undefined)) {
delete onReleaseOutside;
}
onEnterFrame = function () {
this.xAtFrameEntry = this._x;
this.yAtFrameEntry = this._y;
this.handleMovement();
this.detectAndHandleCollision();
if ((!(this._x === this.initialX)) && (!(this._y === this.initialY))) {
this.calculateFloorPointY();
this.manageShadow();
}
if ((this.scored === false) && (this.missed === false)) {
this.detectAndHandleGoal();
}
if ((this.scored === false) && (this.missed === false)) {
this.detectAndHandleMiss();
}
if ((this.scored === true) || (this.missed === true)) {
this.reset();
}
};
}
function stopMoving() {
if (!(onEnterFrame === undefined)) {
delete onEnterFrame;
}
}
var velocityVectorX = 0;
var velocityVectorY = 0;
var backboardBottomY = 234;
var backboardTopY = 136;
var backboardX = 691.5;
var rimLeftX = 618.5;
var rimRightX = 691.5;
var rimY = 235;
var collisionVectorX = 0;
var collisionVectorY = 0;
}
Symbol 697 MovieClip [__Packages.Utilities] Frame 0
class Utilities
{
function Utilities () {
}
static function estimateCirclePointIncursionVector(circleOriginX, circleOriginY, radius, velocityVectorX, velocityVectorY, pointX, pointY) {
var _local4 = getDistance(circleOriginX, circleOriginY, pointX, pointY);
var _local9;
var _local3 = circleOriginX;
var _local2 = circleOriginY;
var _local1 = {deltaX:-velocityVectorX, deltaY:-velocityVectorY};
var _local11 = getDistance(0, 0, _local1.deltaX, _local1.deltaY);
normalizeVector(_local1);
while (_local4 <= radius) {
_local3 = _local3 + _local1.deltaX;
_local2 = _local2 + _local1.deltaY;
_local4 = getDistance(_local3, _local2, pointX, pointY);
}
_local9 = getDistance(circleOriginX, circleOriginY, _local3, _local2);
scaleVector(_local1, 1, _local9);
return({deltaX:-_local1.deltaX, deltaY:-_local1.deltaY});
}
static function getDistance(x1, y1, x2, y2) {
if ((((((((!(x1 === undefined)) && (typeof(x1) === "number")) && (!(y1 === undefined))) && (typeof(y1) === "number")) && (!(x2 === undefined))) && (typeof(x2) === "number")) && (!(y2 === undefined))) && (typeof(y2) === "number")) {
return(Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2)));
}
return(undefined);
}
static function getDotProduct(vector1, vector2) {
if ((((((((((((!(vector1 === undefined)) && (typeof(vector1) === "object")) && (!(vector1.deltaX === undefined))) && (typeof(vector1.deltaX) === "number")) && (!(vector1.deltaY === undefined))) && (typeof(vector1.deltaY) === "number")) && (!(vector2 === undefined))) && (typeof(vector2) === "object")) && (!(vector2.deltaX === undefined))) && (typeof(vector2.deltaX) === "number")) && (!(vector2.deltaY === undefined))) && (typeof(vector2.deltaY) === "number")) {
return((vector1.deltaX * vector2.deltaX) + (vector1.deltaY * vector2.deltaY));
}
return(undefined);
}
static function normalizeVector(vector) {
if ((((((!(vector === undefined)) && (typeof(vector) === "object")) && (!(vector.deltaX === undefined))) && (typeof(vector.deltaX) === "number")) && (!(vector.deltaY === undefined))) && (typeof(vector.deltaY) === "number")) {
var _local2 = getDistance(0, 0, vector.deltaX, vector.deltaY);
vector.deltaX = vector.deltaX / _local2;
vector.deltaY = vector.deltaY / _local2;
return(true);
}
return(false);
}
static function scaleVector(vector, oldMagnitude, newMagnitude) {
if ((((((((((!(vector === undefined)) && (typeof(vector) === "object")) && (!(vector.deltaX === undefined))) && (typeof(vector.deltaX) === "number")) && (!(vector.deltaY === undefined))) && (typeof(vector.deltaY) === "number")) && (!(oldMagnitude === undefined))) && (typeof(oldMagnitude) === "number")) && (!(newMagnitude === undefined))) && (typeof(newMagnitude) === "number")) {
var _local2 = newMagnitude / oldMagnitude;
vector.deltaX = vector.deltaX * _local2;
vector.deltaY = vector.deltaY * _local2;
return(true);
}
return(false);
}
}
Symbol 698 MovieClip [__Packages.Player] Frame 0
class Player
{
var avatar, playerName;
function Player () {
initialize();
}
function initialize() {
var _local2 = new Object();
avatar = new Object();
_local2.chest = 1;
_local2.eyes = 1;
_local2.hair = 1;
_local2.nose = 1;
_local2.mouth = 1;
_local2.shirtMainBody = 1;
_local2.shirtSleeves = 1;
_local2.shoes = 1;
_local2.shorts = 1;
_local2.skin = 1;
avatar.appearance = _local2;
avatar.name = "Unnamed";
playerName = "Anonymous";
}
}
Symbol 699 MovieClip [__Packages.BobbleheadCharacter] Frame 0
class BobbleheadCharacter extends MovieClip
{
var frontArm, frontArmBackdrop, rearArm, rearArmBackdrop, onEnterFrame, _xmouse, _ymouse, localToGlobal, head, body, minimumBodyFrame, maximumBodyFrame, bodyBackdrops, minimumEyesFrame, maximumEyesFrame, headBackdrop, minimumHairFrame, maximumHairFrame, minimumMouthFrame, maximumMouthFrame, minimumNoseFrame, maximumNoseFrame, minimumShirtMainBodyFrame, maximumShirtMainBodyFrame, minimumShirtSleevesFrame, maximumShirtSleevesFrame, minimumShoesFrame, maximumShoesFrame, minimumShortsFrame, maximumShortsFrame, minimumSkinFrame, maximumSkinFrame;
function BobbleheadCharacter () {
super();
init();
}
function animateCheering() {
if (frontArm._rotation > -180) {
frontArm._rotation = frontArm._rotation - 20;
frontArmBackdrop._rotation = frontArm._rotation;
}
if (rearArm._rotation > -180) {
rearArm._rotation = rearArm._rotation - 20;
rearArmBackdrop._rotation = rearArm._rotation;
}
if ((frontArm._rotation <= -180) && (rearArm._rotation <= -180)) {
onEnterFrame = animateDroppingArms;
}
}
function animateDroppingArms() {
if ((frontArm._rotation >= -180) && (frontArm._rotation < 0)) {
frontArm._rotation = frontArm._rotation - (frontArm._rotation / 10);
if (frontArm._rotation > -0.5) {
frontArm._rotation = 0;
}
frontArmBackdrop._rotation = frontArm._rotation;
} else if ((frontArm._rotation < 180) && (frontArm._rotation > 0)) {
frontArm._rotation = frontArm._rotation - (frontArm._rotation / 10);
if (frontArm._rotation < 0.5) {
frontArm._rotation = 0;
}
frontArmBackdrop._rotation = frontArm._rotation;
}
if ((rearArm._rotation >= -180) && (rearArm._rotation < 0)) {
rearArm._rotation = rearArm._rotation - (rearArm._rotation / 10);
if (rearArm._rotation > -1) {
rearArm._rotation = 0;
}
rearArmBackdrop._rotation = rearArm._rotation;
} else if ((rearArm._rotation < 180) && (rearArm._rotation > 0)) {
rearArm._rotation = rearArm._rotation - (rearArm._rotation / 10);
if (rearArm._rotation < 1) {
rearArm._rotation = 0;
}
rearArmBackdrop._rotation = rearArm._rotation;
}
if ((frontArm._rotation === 0) && (rearArm._rotation === 0)) {
delete onEnterFrame;
}
}
function animateHoldingArms(ball) {
if (!(onEnterFrame === undefined)) {
delete onEnterFrame;
}
var _local4;
var _local2 = new Object();
var _local3 = new Object();
_local2.x = frontArm._x;
_local2.y = frontArm._y;
_local3.x = _xmouse;
_local3.y = _ymouse;
localToGlobal(_local2);
localToGlobal(_local3);
_local4 = (Math.atan2(_local3.y - _local2.y, _local3.x - _local2.x) / Math.PI) * 180;
frontArm._rotation = _local4 - 50;
frontArmBackdrop._rotation = frontArm._rotation;
rearArm._rotation = _local4 - 70;
rearArmBackdrop._rotation = rearArm._rotation;
}
function animateJeering() {
if (frontArm._rotation < 40) {
frontArm._rotation = frontArm._rotation + 8;
frontArmBackdrop._rotation = frontArm._rotation;
}
if (rearArm._rotation < 40) {
rearArm._rotation = rearArm._rotation + 8;
rearArmBackdrop._rotation = rearArm._rotation;
}
if ((frontArm._rotation >= 40) && (rearArm._rotation >= 40)) {
onEnterFrame = animateDroppingArms;
}
}
function animateSpinningArms() {
frontArm._rotation = frontArm._rotation - 18;
frontArmBackdrop._rotation = frontArmBackdrop._rotation - 18;
rearArm._rotation = rearArm._rotation + 18;
rearArmBackdrop._rotation = rearArmBackdrop._rotation + 18;
}
function animateThrowing() {
if (frontArm._rotation > -180) {
frontArm._rotation = frontArm._rotation - 20;
frontArmBackdrop._rotation = frontArm._rotation;
}
if (rearArm._rotation > -180) {
rearArm._rotation = rearArm._rotation - 20;
rearArmBackdrop._rotation = rearArm._rotation;
}
if (((frontArm._rotation < -45) && (frontArm._rotation > -90)) && ((rearArm._rotation < -45) && (rearArm._rotation > -90))) {
onEnterFrame = animateDroppingArms;
}
}
function resetArms() {
frontArm._rotation = 0;
frontArmBackdrop._rotation = 0;
rearArm._rotation = 0;
rearArmBackdrop._rotation = 0;
}
function startCheering() {
resetArms();
head.nod();
onEnterFrame = animateCheering;
}
function startJeering() {
resetArms();
head.shake();
onEnterFrame = animateJeering;
}
function startSpinningArms() {
onEnterFrame = animateSpinningArms;
}
function startThrowingAnimation() {
onEnterFrame = animateThrowing;
}
function stopCheering() {
}
function randomizeAppearance() {
randomizeBody(false);
randomizeEyes(false);
randomizeHair(false);
randomizeMouth(false);
randomizeNose(false);
randomizeShirtMainBody(false);
randomizeShirtSleeves(false);
randomizeShoes(false);
randomizeShorts(false);
randomizeSkin(false);
}
function pageBodyLeft() {
var _local2 = body.torso._currentframe;
MovieClipUtilities.pageLeft(body, minimumBodyFrame, maximumBodyFrame);
body.torso.gotoAndStop(_local2);
bodyBackdrops.gotoAndStop(body._currentframe);
}
function randomizeBody(forceChange) {
var _local2 = body.torso._currentframe;
MovieClipUtilities.randomizeFrame(body, minimumBodyFrame, maximumBodyFrame, forceChange);
body.torso.gotoAndStop(_local2);
bodyBackdrops.gotoAndStop(body._currentframe);
}
function pageBodyRight() {
var _local2 = body.torso._currentframe;
MovieClipUtilities.pageRight(body, minimumBodyFrame, maximumBodyFrame);
body.torso.gotoAndStop(_local2);
bodyBackdrops.gotoAndStop(body._currentframe);
}
function pageEyesLeft() {
MovieClipUtilities.pageLeft(head.eyes, minimumEyesFrame, maximumEyesFrame);
headBackdrop.eyes.gotoAndStop(head.eyes._currentframe);
}
function randomizeEyes(forceChange) {
MovieClipUtilities.randomizeFrame(head.eyes, minimumEyesFrame, maximumEyesFrame, forceChange);
headBackdrop.eyes.gotoAndStop(head.eyes._currentframe);
}
function pageEyesRight() {
MovieClipUtilities.pageRight(head.eyes, minimumEyesFrame, maximumEyesFrame);
headBackdrop.eyes.gotoAndStop(head.eyes._currentframe);
}
function pageHairLeft() {
MovieClipUtilities.pageLeft(head.hairFront, minimumHairFrame, maximumHairFrame);
MovieClipUtilities.pageLeft(head.hairMiddle, minimumHairFrame, maximumHairFrame);
MovieClipUtilities.pageLeft(head.hairRear, minimumHairFrame, maximumHairFrame);
MovieClipUtilities.pageLeft(headBackdrop.hair, minimumHairFrame, maximumHairFrame);
}
function randomizeHair(forceChange) {
MovieClipUtilities.randomizeFrame(head.hairFront, minimumHairFrame, maximumHairFrame, forceChange);
head.hairMiddle.gotoAndStop(head.hairFront._currentframe);
head.hairRear.gotoAndStop(head.hairFront._currentframe);
headBackdrop.hair.gotoAndStop(head.hairFront._currentframe);
}
function pageHairRight() {
MovieClipUtilities.pageRight(head.hairFront, minimumHairFrame, maximumHairFrame);
MovieClipUtilities.pageRight(head.hairMiddle, minimumHairFrame, maximumHairFrame);
MovieClipUtilities.pageRight(head.hairRear, minimumHairFrame, maximumHairFrame);
MovieClipUtilities.pageRight(headBackdrop.hair, minimumHairFrame, maximumHairFrame);
}
function pageMouthLeft() {
MovieClipUtilities.pageLeft(head.mouth, minimumMouthFrame, maximumMouthFrame);
}
function randomizeMouth(forceChange) {
MovieClipUtilities.randomizeFrame(head.mouth, minimumMouthFrame, maximumMouthFrame, forceChange);
}
function pageMouthRight() {
MovieClipUtilities.pageRight(head.mouth, minimumMouthFrame, maximumMouthFrame);
}
function pageNoseLeft() {
MovieClipUtilities.pageLeft(head.nose, minimumNoseFrame, maximumNoseFrame);
if (!(head.nose.fill === undefined)) {
head.nose.fill.gotoAndStop(head.face._currentframe);
}
MovieClipUtilities.pageLeft(headBackdrop.nose, minimumNoseFrame, maximumNoseFrame);
}
function randomizeNose(forceChange) {
MovieClipUtilities.randomizeFrame(head.nose, minimumNoseFrame, maximumNoseFrame, forceChange);
if (!(head.nose.fill === undefined)) {
head.nose.fill.gotoAndStop(head.face._currentframe);
}
headBackdrop.nose.gotoAndStop(head.nose._currentframe);
}
function pageNoseRight() {
MovieClipUtilities.pageRight(head.nose, minimumNoseFrame, maximumNoseFrame);
if (!(head.nose.fill === undefined)) {
head.nose.fill.gotoAndStop(head.face._currentframe);
}
MovieClipUtilities.pageRight(headBackdrop.nose, minimumNoseFrame, maximumNoseFrame);
}
function pageShirtLeft() {
MovieClipUtilities.pageLeft(body.torso, minimumShirtMainBodyFrame, maximumShirtMainBodyFrame);
MovieClipUtilities.pageLeft(frontArm.sleeve, minimumShirtSleevesFrame, maximumShirtSleevesFrame);
MovieClipUtilities.pageLeft(rearArm.sleeve, minimumShirtSleevesFrame, maximumShirtSleevesFrame);
}
function pageShirtMainBodyLeft() {
MovieClipUtilities.pageLeft(body.torso, minimumShirtMainBodyFrame, maximumShirtMainBodyFrame);
}
function pageShirtSleevesLeft() {
MovieClipUtilities.pageLeft(frontArm.sleeve, minimumShirtSleevesFrame, maximumShirtSleevesFrame);
MovieClipUtilities.pageLeft(rearArm.sleeve, minimumShirtSleevesFrame, maximumShirtSleevesFrame);
}
function randomizeShirt(forceChange) {
MovieClipUtilities.randomizeFrame(body.torso, minimumShirtMainBodyFrame, maximumShirtMainBodyFrame, forceChange);
if (!(frontArm.sleeve === undefined)) {
frontArm.sleeve.gotoAndStop(body.torso._currentframe);
}
if (!(rearArm.sleeve === undefined)) {
rearArm.sleeve.gotoAndStop(body.torso._currentframe);
}
}
function randomizeShirtMainBody(forceChange) {
MovieClipUtilities.randomizeFrame(body.torso, minimumShirtMainBodyFrame, maximumShirtMainBodyFrame, forceChange);
}
function randomizeShirtSleeves(forceChange) {
MovieClipUtilities.randomizeFrame(frontArm.sleeve, minimumShirtSleevesFrame, maximumShirtSleevesFrame, forceChange);
rearArm.sleeve.gotoAndStop(frontArm.sleeve._currentframe);
}
function pageShirtRight() {
MovieClipUtilities.pageRight(body.torso, minimumShirtMainBodyFrame, maximumShirtMainBodyFrame);
MovieClipUtilities.pageRight(frontArm.sleeve, minimumShirtSleevesFrame, maximumShirtSleevesFrame);
MovieClipUtilities.pageRight(rearArm.sleeve, minimumShirtSleevesFrame, maximumShirtSleevesFrame);
}
function pageShirtMainBodyRight() {
MovieClipUtilities.pageRight(body.torso, minimumShirtMainBodyFrame, maximumShirtMainBodyFrame);
}
function pageShirtSleevesRight() {
MovieClipUtilities.pageRight(frontArm.sleeve, minimumShirtSleevesFrame, maximumShirtSleevesFrame);
MovieClipUtilities.pageRight(rearArm.sleeve, minimumShirtSleevesFrame, maximumShirtSleevesFrame);
}
function pageShoesLeft() {
MovieClipUtilities.pageLeft(body.frontShoe, minimumShoesFrame, maximumShoesFrame);
MovieClipUtilities.pageLeft(body.rearShoe, minimumShoesFrame, maximumShoesFrame);
}
function randomizeShoes(forceChange) {
MovieClipUtilities.randomizeFrame(body.frontShoe, minimumShoesFrame, maximumShoesFrame, forceChange);
body.rearShoe.gotoAndStop(body.frontShoe._currentframe);
}
function pageShoesRight() {
MovieClipUtilities.pageRight(body.frontShoe, minimumShoesFrame, maximumShoesFrame);
MovieClipUtilities.pageRight(body.rearShoe, minimumShoesFrame, maximumShoesFrame);
}
function pageShortsLeft() {
MovieClipUtilities.pageLeft(body.shorts, minimumShortsFrame, maximumShortsFrame);
}
function randomizeShorts(forceChange) {
MovieClipUtilities.randomizeFrame(body.shorts, minimumShortsFrame, maximumShortsFrame, forceChange);
}
function pageShortsRight() {
MovieClipUtilities.pageRight(body.shorts, minimumShortsFrame, maximumShortsFrame);
}
function pageSkinLeft() {
MovieClipUtilities.pageLeft(frontArm.arm, minimumSkinFrame, maximumSkinFrame);
MovieClipUtilities.pageLeft(body.frontLeg, minimumSkinFrame, maximumSkinFrame);
MovieClipUtilities.pageLeft(head.ear, minimumSkinFrame, maximumSkinFrame);
MovieClipUtilities.pageLeft(head.face, minimumSkinFrame, maximumSkinFrame);
if (!(head.nose.fill === undefined)) {
MovieClipUtilities.pageLeft(head.nose.fill, minimumSkinFrame, maximumSkinFrame);
}
MovieClipUtilities.pageLeft(rearArm.arm, minimumSkinFrame, maximumSkinFrame);
MovieClipUtilities.pageLeft(body.rearLeg, minimumSkinFrame, maximumSkinFrame);
}
function randomizeSkin(forceChange) {
MovieClipUtilities.randomizeFrame(frontArm.arm, minimumSkinFrame, maximumSkinFrame, forceChange);
body.frontLeg.gotoAndStop(frontArm.arm._currentframe);
head.ear.gotoAndStop(frontArm.arm._currentframe);
head.face.gotoAndStop(frontArm.arm._currentframe);
if (!(head.nose.fill === undefined)) {
head.nose.fill.gotoAndStop(head.face._currentframe);
}
rearArm.arm.gotoAndStop(frontArm.arm._currentframe);
body.rearLeg.gotoAndStop(frontArm.arm._currentframe);
}
function pageSkinRight() {
MovieClipUtilities.pageRight(frontArm.arm, minimumSkinFrame, maximumSkinFrame);
MovieClipUtilities.pageRight(body.frontLeg, minimumSkinFrame, maximumSkinFrame);
MovieClipUtilities.pageRight(head.ear, minimumSkinFrame, maximumSkinFrame);
MovieClipUtilities.pageRight(head.face, minimumSkinFrame, maximumSkinFrame);
if (!(head.nose.fill === undefined)) {
MovieClipUtilities.pageRight(head.nose.fill, minimumSkinFrame, maximumSkinFrame);
}
MovieClipUtilities.pageRight(rearArm.arm, minimumSkinFrame, maximumSkinFrame);
MovieClipUtilities.pageRight(body.rearLeg, minimumSkinFrame, maximumSkinFrame);
}
function setChest(frameNumber) {
body.gotoAndStop(frameNumber);
bodyBackdrops.gotoAndStop(frameNumber);
}
function setEyes(frameNumber) {
head.eyes.gotoAndStop(frameNumber);
headBackdrop.eyes.gotoAndStop(frameNumber);
}
function setHair(frameNumber) {
head.hairFront.gotoAndStop(frameNumber);
head.hairMiddle.gotoAndStop(frameNumber);
head.hairRear.gotoAndStop(frameNumber);
headBackdrop.hair.gotoAndStop(frameNumber);
}
function setMouth(frameNumber) {
head.mouth.gotoAndStop(frameNumber);
}
function setNose(frameNumber) {
head.nose.gotoAndStop(frameNumber);
headBackdrop.nose.gotoAndStop(frameNumber);
}
function setShirt(mainBodyFrameNumber, sleevesFrameNumber) {
body.torso.gotoAndStop(mainBodyFrameNumber);
frontArm.sleeve.gotoAndStop(sleevesFrameNumber);
rearArm.sleeve.gotoAndStop(sleevesFrameNumber);
}
function setShoes(frameNumber) {
body.frontShoe.gotoAndStop(frameNumber);
body.rearShoe.gotoAndStop(frameNumber);
}
function setShorts(frameNumber) {
body.shorts.gotoAndStop(frameNumber);
}
function setSkin(frameNumber) {
head.ear.gotoAndStop(frameNumber);
head.face.gotoAndStop(frameNumber);
if (!(head.nose.fill === undefined)) {
head.nose.fill.gotoAndStop(frameNumber);
}
frontArm.arm.gotoAndStop(frameNumber);
rearArm.arm.gotoAndStop(frameNumber);
body.frontLeg.gotoAndStop(frameNumber);
body.rearLeg.gotoAndStop(frameNumber);
}
function init() {
body.stop();
bodyBackdrops.stop();
body.frontLeg.stop();
body.frontShoe.stop();
body.rearLeg.stop();
body.rearShoe.stop();
body.torso.stop();
body.shorts.stop();
frontArm.arm.stop();
frontArm.sleeve.stop();
head.ear.stop();
head.eyes.stop();
head.face.stop();
head.hairFront.stop();
head.hairMiddle.stop();
head.hairRear.stop();
head.mouth.stop();
head.nose.stop();
if (!(head.nose.fill === undefined)) {
head.nose.fill.stop();
}
headBackdrop.stop();
headBackdrop.ear.stop();
headBackdrop.eyes.stop();
headBackdrop.face.stop();
headBackdrop.hair.stop();
headBackdrop.nose.stop();
maximumBodyFrame = body._totalframes;
maximumEyesFrame = head.eyes._totalframes;
maximumHairFrame = head.hairFront._totalframes;
maximumMouthFrame = head.mouth._totalframes;
maximumNoseFrame = head.nose._totalframes;
maximumShirtMainBodyFrame = body.torso._totalframes;
maximumShirtSleevesFrame = frontArm.sleeve._totalframes;
maximumShoesFrame = body.frontShoe._totalframes;
maximumShortsFrame = body.shorts._totalframes;
maximumSkinFrame = body.face._totalframes;
minimumBodyFrame = 1;
minimumEyesFrame = 1;
minimumHairFrame = 1;
minimumMouthFrame = 1;
minimumNoseFrame = 1;
minimumShirtMainBodyFrame = 1;
minimumShirtSleevesFrame = 1;
minimumShoesFrame = 1;
minimumShortsFrame = 1;
minimumSkinFrame = 1;
rearArm.arm.stop();
rearArm.sleeve.stop();
}
}
Symbol 700 MovieClip [__Packages.MovieClipUtilities] Frame 0
class MovieClipUtilities
{
function MovieClipUtilities () {
}
static function pageLeft(movieClip, lowFrame, highFrame) {
if ((lowFrame === null) || (lowFrame === undefined)) {
lowFrame = 1;
}
if ((highFrame === null) || (highFrame === undefined)) {
highFrame = movieClip._totalframes;
}
if ((movieClip._currentframe <= highFrame) && (movieClip._currentframe > lowFrame)) {
movieClip.prevFrame();
} else {
movieClip.gotoAndStop(highFrame);
}
}
static function pageRight(movieClip, lowFrame, highFrame) {
if ((lowFrame === null) || (lowFrame === undefined)) {
lowFrame = 1;
}
if ((highFrame === null) || (highFrame === undefined)) {
highFrame = movieClip._totalframes;
}
if ((movieClip._currentframe >= lowFrame) && (movieClip._currentframe < highFrame)) {
movieClip.nextFrame();
} else {
movieClip.gotoAndStop(lowFrame);
}
}
static function randomizeFrame(movieClip, lowFrame, highFrame, forceChange) {
var _local1;
if ((lowFrame === null) || (lowFrame === undefined)) {
lowFrame = 1;
}
if ((highFrame === null) || (highFrame === undefined)) {
highFrame = movieClip._totalframes;
}
do {
_local1 = Math.floor(Math.random() * highFrame) + lowFrame;
} while ((_local1 === movieClip._currentframe) && (forceChange === true));
movieClip.gotoAndStop(_local1);
}
}
Symbol 701 MovieClip [__Packages.Challenge] Frame 0
class Challenge
{
var timeEnded, currentNumberOfThrowsCompleted, currentNumberOfBaskets, timeStarted, currentNumberOfThrows, currentScoringStreak, longestScoringStreak, playerCharacterX, playerCharacterY;
function Challenge () {
initialize();
}
function end() {
timeEnded = getTimer();
}
function getAccuracy() {
if (currentNumberOfThrowsCompleted > 0) {
return((currentNumberOfBaskets / currentNumberOfThrowsCompleted) * 100);
}
return(undefined);
}
function getThrowsMissed() {
return(currentNumberOfThrowsCompleted - currentNumberOfBaskets);
}
function getTimeElapsed() {
if (timeEnded === undefined) {
return(getTimer() - timeStarted);
}
return(timeEnded - timeStarted);
}
function initialize() {
currentNumberOfBaskets = 0;
currentNumberOfThrows = 0;
currentNumberOfThrowsCompleted = 0;
currentScoringStreak = 0;
longestScoringStreak = 0;
timeEnded = undefined;
timeStarted = undefined;
}
function setPlayerCharacterCoordinates(x, y) {
playerCharacterX = x;
playerCharacterY = y;
}
function start() {
timeStarted = getTimer();
}
}
Symbol 702 MovieClip [__Packages.ChallengeDataOverlay] Frame 0
class ChallengeDataOverlay extends MovieClip
{
var onPress, onRelease, onReleaseOutside, stopDrag, _visible, startDrag, initialX, _x, initialY, _y;
function ChallengeDataOverlay () {
super();
initialize();
}
function disableOverlay() {
onPress = undefined;
onRelease = undefined;
onReleaseOutside = undefined;
stopDrag();
_visible = false;
}
function enableOverlay() {
onPress = startDrag;
onRelease = stopDrag;
onReleaseOutside = function () {
this.stopDrag();
this.resetPosition();
};
_visible = true;
}
function initialize() {
initialX = _x;
initialY = _y;
enableOverlay();
}
function resetPosition() {
_x = initialX;
_y = initialY;
}
}
Symbol 703 MovieClip [__Packages.MusicPlayer] Frame 0
class MusicPlayer extends MovieClip
{
var trackIndicator, currentTrack, createEmptyMovieClip, getNextHighestDepth, soundEffect, soundEffect_mc, musicLoop1, musicLoop1_mc, musicLoop2, musicLoop2_mc, musicLoop3, musicLoop3_mc, musicLoop4, musicLoop4_mc, playButton1, playButton2, playButton3, playButton4, randomizerButton, stopButton, _parent;
function MusicPlayer () {
super();
prepareAudio();
prepareButtons();
trackIndicator._visible = false;
}
function playRandomTrack() {
var _local2;
do {
_local2 = Math.floor(Math.random() * 4) + 1;
} while (_local2 === currentTrack);
playTrack(_local2);
}
function playTrack(number) {
this["musicLoop" + number.toString()].start();
currentTrack = number;
trackIndicator._x = (25 * number) + 10;
trackIndicator._visible = true;
this["musicLoop" + number.toString()].onSoundComplete = function () {
this.start();
};
}
function prepareAudio() {
createEmptyMovieClip("soundEffect_mc", getNextHighestDepth());
soundEffect = new Sound(soundEffect_mc);
soundEffect.attachSound("Scratch - Single");
createEmptyMovieClip("musicLoop1_mc", getNextHighestDepth());
musicLoop1 = new Sound(musicLoop1_mc);
musicLoop1.attachSound("Music Loop 1");
createEmptyMovieClip("musicLoop2_mc", getNextHighestDepth());
musicLoop2 = new Sound(musicLoop2_mc);
musicLoop2.attachSound("Music Loop 2");
createEmptyMovieClip("musicLoop3_mc", getNextHighestDepth());
musicLoop3 = new Sound(musicLoop3_mc);
musicLoop3.attachSound("Music Loop 3");
createEmptyMovieClip("musicLoop4_mc", getNextHighestDepth());
musicLoop4 = new Sound(musicLoop4_mc);
musicLoop4.attachSound("Music Loop 4");
}
function prepareButtons() {
playButton1.onRelease = function () {
this._parent.stopMusic();
this._parent.soundEffect.start();
this._parent.playTrack(1);
};
playButton2.onRelease = function () {
this._parent.stopMusic();
this._parent.soundEffect.start();
this._parent.playTrack(2);
};
playButton3.onRelease = function () {
this._parent.stopMusic();
this._parent.soundEffect.start();
this._parent.playTrack(3);
};
playButton4.onRelease = function () {
this._parent.stopMusic();
this._parent.soundEffect.start();
this._parent.playTrack(4);
};
randomizerButton.onRelease = function () {
this._parent.stopMusic();
this._parent.soundEffect.start();
this._parent.playRandomTrack();
};
stopButton.onRelease = function () {
this._parent.stopMusic();
this._parent.soundEffect.start();
this._parent.trackIndicator._visible = false;
};
}
function stopMusic() {
musicLoop1.stop();
musicLoop2.stop();
musicLoop3.stop();
musicLoop4.stop();
if (!(musicLoop1.onSoundComplete === undefined)) {
delete musicLoop1.onSoundComplete;
}
if (!(musicLoop2.onSoundComplete === undefined)) {
delete musicLoop2.onSoundComplete;
}
if (!(musicLoop3.onSoundComplete === undefined)) {
delete musicLoop3.onSoundComplete;
}
if (!(musicLoop4.onSoundComplete === undefined)) {
delete musicLoop4.onSoundComplete;
}
_parent.currentTrack = undefined;
}
}
Symbol 37 Button
on (release) {
_parent.play();
}
Symbol 51 Button
on (release) {
getURL ("http://www.addictinggames.com", _blank);
}
Symbol 52 MovieClip Frame 49
_parent.play();
Symbol 57 MovieClip Frame 1
function proceed() {
this._parent.play();
}
this.logo.onPress = function () {
getURL ("http://www.gravitasgames.com/", "_blank");
};
var ggBrandingTimeout = setTimeout(this, "proceed", 2000);
Symbol 77 MovieClip [Basketball] Frame 1
#initclip 28
Object.registerClass("Basketball", Basketball);
#endinitclip
Symbol 82 MovieClip Frame 1
this.stop();
Symbol 93 MovieClip Frame 1
this.stop();
Symbol 104 MovieClip [Challenge Overlay 1] Frame 1
#initclip 16
Object.registerClass("Challenge Overlay 1", ChallengeOverlay);
#endinitclip
Symbol 108 MovieClip [Challenge Overlay 2] Frame 1
#initclip 17
Object.registerClass("Challenge Overlay 2", ChallengeOverlay);
#endinitclip
Symbol 112 MovieClip [Challenge Overlay 3] Frame 1
#initclip 18
Object.registerClass("Challenge Overlay 3", ChallengeOverlay);
#endinitclip
Symbol 116 MovieClip [Challenge Overlay 4] Frame 1
#initclip 19
Object.registerClass("Challenge Overlay 4", ChallengeOverlay);
#endinitclip
Symbol 120 MovieClip [Challenge Overlay 5] Frame 1
#initclip 20
Object.registerClass("Challenge Overlay 5", ChallengeOverlay);
#endinitclip
Symbol 124 MovieClip [Challenge Overlay B1] Frame 1
#initclip 21
Object.registerClass("Challenge Overlay B1", ChallengeOverlay);
#endinitclip
Symbol 128 MovieClip [Challenge Overlay 6] Frame 1
#initclip 22
Object.registerClass("Challenge Overlay 6", ChallengeOverlay);
#endinitclip
Symbol 132 MovieClip [Challenge Overlay 7] Frame 1
#initclip 23
Object.registerClass("Challenge Overlay 7", ChallengeOverlay);
#endinitclip
Symbol 136 MovieClip [Challenge Overlay 8] Frame 1
#initclip 24
Object.registerClass("Challenge Overlay 8", ChallengeOverlay);
#endinitclip
Symbol 140 MovieClip [Challenge Overlay 9] Frame 1
#initclip 25
Object.registerClass("Challenge Overlay 9", ChallengeOverlay);
#endinitclip
Symbol 144 MovieClip [Challenge Overlay 10] Frame 1
#initclip 26
Object.registerClass("Challenge Overlay 10", ChallengeOverlay);
#endinitclip
Symbol 148 MovieClip [Challenge Overlay B2] Frame 1
#initclip 27
Object.registerClass("Challenge Overlay B2", ChallengeOverlay);
#endinitclip
Symbol 149 MovieClip Frame 1
this.stop();
Symbol 194 MovieClip Frame 1
this.stop();
Symbol 199 MovieClip Frame 1
this.stop();
Symbol 584 MovieClip [Head] Frame 1
#initclip 30
Object.registerClass("Head", Head);
#endinitclip
Symbol 586 MovieClip [Bobblehead Character] Frame 1
#initclip 29
Object.registerClass("Bobblehead Character", BobbleheadCharacter);
#endinitclip
Symbol 639 MovieClip [Music Player] Frame 1
#initclip 33
Object.registerClass("Music Player", MusicPlayer);
#endinitclip
Symbol 648 MovieClip [Statistics Overlay] Frame 1
#initclip 31
Object.registerClass("Statistics Overlay", ChallengeDataOverlay);
#endinitclip
Symbol 654 MovieClip [Timer Overlay] Frame 1
#initclip 32
Object.registerClass("Timer Overlay", ChallengeDataOverlay);
#endinitclip