Frame 1
Stage.scaleMode = "noScale";
fscommand ("fullscreen", true);
competitionUrl = "http://www.priceyourmeal.com/mealornomeal/entry.php";
System.security.allowDomain("*");
_global.displayDebug = function (msg) {
iDebug_txt.text = iDebug_txt.text + (msg + newline);
iDebug_txt.scroll = iDebug_txt.maxscroll;
};
Frame 3
var scale = iTitle._xscale;
new mx.transitions.Tween(iTitle, "_xscale", mx.transitions.easing.Elastic.easeInOut, scale, 100, 1, true);
new mx.transitions.Tween(iTitle, "_yscale", mx.transitions.easing.Elastic.easeInOut, scale, 100, 0.8, true);
new mx.transitions.Tween(iTitle, "_alpha", mx.transitions.easing.Regular.easeIn, 0, 100, 0.6, true);
new mx.transitions.Tween(iBack, "_y", mx.transitions.easing.Regular.easeInOut, iBack._y, 392, 1, true);
var loadedPercent = 0;
var loaded_str = "00";
var animOnTween = null;
if (_framesloaded < _totalframes) {
animOnTween = new mx.transitions.Tween(iLoaderSign, "_x", mx.transitions.easing.Strong.easeOut, 19, 155, 0.6, true);
}
Frame 5
loadedPercent = Math.floor((100 * getBytesLoaded()) / getBytesTotal());
loaded_str = ((loadedPercent < 10) ? "0" : "") + loadedPercent;
if (_framesloaded < _totalframes) {
gotoAndPlay ("loading");
}
Frame 6
if (animOnTween != null) {
var animOffTween = (new mx.transitions.Tween(iLoaderSign, "_x", mx.transitions.easing.Strong.easeOut, iLoaderSign._x, 19, 0.6, true));
animOffTween.onMotionFinished = function () {
play();
};
stop();
}
Frame 7
var oGame = new Game(this);
oGame.main();
stop();
Symbol 8 Button
on (release) {
getURL ("http://www.priceyourmeal.com", "_blank");
Game.pGame.trackEvent("clickThru");
}
Symbol 10 MovieClip Frame 1
gotoAndPlay ("on");
Symbol 10 MovieClip Frame 5
stop();
Symbol 10 MovieClip Frame 13
stop();
Symbol 14 MovieClip Frame 1
stop();
Symbol 22 MovieClip Frame 1
stop();
Symbol 295 MovieClip [__Packages.Game] Frame 0
class Game
{
static var pGame, mGame, mPanel, mPeople, mSigns, mFlvPlayer, mTitles, mHeadshot, mCutaway, mSkip_btn, mCompetition_btn, mPlayAgain_btn, mProgressBox, mLogo, mBoardMini, mBoard, mLoaderSign, mFrame, pPreloader, oSounds, OFFER_TEXT, mTracking;
var pTracking, pPicksThisRound, pPreviousOfferID, pOfferID, pWrongNumbers, pLastPickID, pRevealMealID, pOfferIndex, pState;
function Game (game_mc) {
pGame = this;
mGame = game_mc;
mPanel = mGame.iPanel;
mPeople = mPanel.iPeople;
mSigns = mPanel.iSigns;
mFlvPlayer = mPanel.iFlvPlayer;
mTitles = mPanel.iTitles;
mHeadshot = mPanel.iHeadshot;
mCutaway = mPanel.iCutaway;
mSkip_btn = mPanel.iSkip_btn;
mCompetition_btn = mPanel.iCompetition_btn;
mPlayAgain_btn = mPanel.iPlayAgain_btn;
mProgressBox = mPanel.iProgressBox;
mLogo = mGame.iLogo;
mBoardMini = mPanel.iBoardMini;
mBoard = mGame.iBoard;
mLoaderSign = mGame.iLoaderSign;
mFrame = mPanel.iFrame;
pPreloader = new FlvPreloader();
oSounds = new Sounds(game_mc, true);
oSounds.addSound("sIntro", 40, 0);
oSounds.addSound("sRoll", 30, 0);
oSounds.addSound("sClick", 70, 0);
oSounds.addSound("sTension", 60, 0);
oSounds.addSound("sTensionEnd", 60, 0);
oSounds.loopSound("sIntro", 999);
mCutaway.iFlvPlayer.setAllowSkip(false);
mCutaway.iFlvPlayer.setAllowProgress(false);
mCutaway.iFlvPlayer.setLoadedCallback(mCutaway);
OFFER_TEXT = [];
OFFER_TEXT[0] = ["a hard boiled egg", "a slice of cheese", "a Jelly Baby"];
OFFER_TEXT[1] = ["a ripe banana", "a cucumber", "a clove of garlic"];
OFFER_TEXT[2] = ["a packet of crisps", "a deep fried Mars Bar", "a Pop Tart"];
OFFER_TEXT[3] = ["beans on toast", "a rasher of bacon", "a jam doughnut"];
OFFER_TEXT[4] = ["a chocolate-chip muffin", "a bowl of custard", "a buttered roll"];
OFFER_TEXT[5] = ["a sausage roll", "a chicken pastie", "a bowl of onion soup"];
OFFER_TEXT[6] = ["a plate of tofu", "a plate of couscous", "a peanut-butter sandwich "];
OFFER_TEXT[7] = ["a haggis pakora", "a black pudding", "garlic mushrooms"];
OFFER_TEXT[8] = ["a caesar salad", "a bruschetta", "barbeque chicken wings"];
OFFER_TEXT[9] = ["pasta and chips", "a cheeseburger", "a vegetable curry"];
OFFER_TEXT[10] = ["chicken chow mein", "sushi", "tandoori pineapple"];
OFFER_TEXT[11] = ["a lamb shank", "calves\u2019 liver", "a fillet of cod"];
OFFER_TEXT[12] = ["a grilled lobster", "roast pork belly", "pan fried squid"];
if (_root.tracking == null) {
_root.tracking = "1";
}
pTracking = com.tobyfreeman.flava.FlavaUtils.stringToBoolean(_root.tracking);
if (pTracking) {
_root.gvTrackCode = TRACKING_CODE;
System.security.allowDomain(TRACKING_DOMAIN);
mTracking = _root.createEmptyMovieClip("iTracking", _root.getNextHighestDepth());
mTracking.loadMovie(TRACKING_URL);
if (_global.displayDebug != null) {
_global.displayDebug(((("TRACKER: '" + TRACKING_CODE) + "' '") + TRACKING_URL) + "'");
}
}
}
function trackEvent(eventName) {
if (pTracking) {
mTracking.trackEvent(eventName);
if (_global.displayDebug != null) {
_global.displayDebug(("TRACK CALL: '" + eventName) + "'");
}
}
}
function main() {
reset();
mSigns.showSign("iFast", true, 0);
mSigns.showSign("iSlow", true, 0.5);
mLogo.gotoAndPlay("off");
}
function startPreloading(fastConnection) {
pPreloader.preloadFiles("http://www.priceyourmeal.com/mealornomeal/flvList.xml", fastConnection);
waitForFlvPreload();
}
function reset() {
setState(STATE_INTRO);
pPicksThisRound = 0;
pPreviousOfferID = AVERAGE_OFFER_ID;
pOfferID = AVERAGE_OFFER_ID;
pWrongNumbers = 0;
mPeople.reset();
mBoardMini.reset();
mBoard.reset();
mTitles.reset();
mCompetition_btn._visible = false;
}
function waitForFlvPreload() {
function pollFlvPreload() {
var _local1 = oPreloaderLocal.getGroupsBuffered(true);
if (_local1 > Game.PRELOAD_GROUPS) {
new mx.transitions.Tween(Game.mLoaderSign, "_x", mx.transitions.easing.Strong.easeOut, Game.mLoaderSign._x, 19, 0.6, true);
oPreloaderLocal.setProgressCallback(null);
Game.mProgressBox._visible = false;
clearInterval(intervalID);
Game.pGame.startGame();
} else {
Game.mGame.loaded_str = (_local1 + "/") + Game.PRELOAD_GROUPS;
}
}
mGame.loaded_str = "0/" + PRELOAD_GROUPS;
mLoaderSign.gotoAndStop("fileCount");
new mx.transitions.Tween(mLoaderSign, "_x", mx.transitions.easing.Strong.easeOut, mLoaderSign._x, 155, 0.6, true);
notifyPreloadProgress(0);
pPreloader.setProgressCallback(this);
mProgressBox._visible = true;
var oPreloaderLocal = pPreloader;
var intervalID = setInterval(pollFlvPreload, 100);
}
function notifyPreloadProgress(percent) {
mProgressBox.loadedPercent_str = String(percent);
}
function startGame() {
mGame.gotoAndStop("main");
mPanel.changeBackground("blank");
mPanel.showHeader(true);
mFlvPlayer.playPreloadedVideo("letsPlay");
mSigns.showSign("iPlay", true, 3);
oSounds.adjustSound("sIntro", 5);
}
function skipVideo() {
mFlvPlayer.skipVideo();
}
function notifyEndLoadedVideo(filename) {
var _local2 = String(filename.split("_").shift());
switch (_local2) {
case "openPlatter" :
mFlvPlayer.playVideo(("person_" + (pLastPickID + 1)) + ".flv");
break;
case "person" :
doReveal(false);
}
}
function notifyEndPreloadedVideo(groupID) {
switch (groupID) {
case "intro" :
mFlvPlayer.playPreloadedVideo("welcome");
oSounds.stopSound("sTension");
oSounds.startSound("sTensionEnd", 20);
break;
case "welcome" :
animateLayout(LAYOUT_DOUBLE);
break;
case "instructions" :
mFlvPlayer.playPreloadedVideo("pickThree");
break;
case "pickThree" :
setState(STATE_PICKING);
case "pickAnother" :
mFlvPlayer.showVideo(false);
mPanel.changeBackground("studioWide");
animateLayout(LAYOUT_WIDE);
oSounds.adjustSound("sTension", 35);
oSounds.loopSound("sTension", 999);
break;
case "cutaway" :
mCutaway.reset();
break;
case "reveal" :
revealComplete();
break;
case "roundBad" :
case "roundOk" :
case "roundGood" :
if (Math.random() < (CHANCE_WRONG_NUMBER / 100)) {
if (pWrongNumbers < pPreloader.getGroupFileCount("wrongNumber")) {
pWrongNumbers++;
mFlvPlayer.playPreloadedVideo("wrongNumber");
break;
}
}
case "wrongNumber" :
mFlvPlayer.playPreloadedVideo("chefsCall");
break;
case "chefsCall" :
mFlvPlayer.playPreloadedVideo("offer");
oSounds.adjustSound("sTension", 25);
oSounds.loopSound("sTension", 999);
break;
case "offer" :
makeOffer();
break;
case "noMeal" :
if (Math.random() < (CHANCE_OFF_CAMERA / 100)) {
mFlvPlayer.playPreloadedVideo("offCamera");
} else {
notifyEndPreloadedVideo("pickThree");
break;
animateLayout(LAYOUT_NARROW);
mSigns.showSign("iFinalOffer", false, 0);
break;
mFlvPlayer.playPreloadedVideo("swapOffer");
mSigns.showSign("iSwap", true, 20);
mSigns.showSign("iNoSwap", true, 20.5);
break;
oSounds.adjustSound("sTension", 25);
oSounds.loopSound("sTension", 999);
break;
continueRevealAll();
break;
mFlvPlayer.mute(true);
doReveal(false);
oSounds.adjustSound("sTension", 15);
oSounds.loopSound("sTension", 999);
break;
mTitles.rollTitles();
mFlvPlayer.playPreloadedVideo("closingMessage");
break;
reset();
startGame();
}
case "offCamera" :
notifyEndPreloadedVideo("pickThree");
break;
case "badMeal" :
case "goodMeal" :
animateLayout(LAYOUT_NARROW);
mSigns.showSign("iFinalOffer", false, 0);
break;
case "noMealFinal" :
mFlvPlayer.playPreloadedVideo("swapOffer");
mSigns.showSign("iSwap", true, 20);
mSigns.showSign("iNoSwap", true, 20.5);
break;
case "swapOffer" :
oSounds.adjustSound("sTension", 25);
oSounds.loopSound("sTension", 999);
break;
case "revealAll" :
continueRevealAll();
break;
case "openFinal" :
mFlvPlayer.mute(true);
doReveal(false);
oSounds.adjustSound("sTension", 15);
oSounds.loopSound("sTension", 999);
break;
case "closingSponsor" :
mTitles.rollTitles();
mFlvPlayer.playPreloadedVideo("closingMessage");
break;
case "closingMessage" :
reset();
startGame();
}
}
function notifyAnimComplete(animID) {
switch (animID) {
case "LAYOUT_DOUBLE" :
if (inState(STATE_INTRO)) {
mFlvPlayer.playPreloadedVideo("instructions");
mBoard.showAllMeals();
} else {
mPeople.updateAfterPick();
mPanel.changeBackground("blank");
mFlvPlayer.playVideo(("openPlatter_" + (pLastPickID + 1)) + ".flv");
}
break;
case "LAYOUT_WIDE" :
mSigns.displayPicksThisRound(pPicksThisRound);
mSigns.showSign("iPickPlatter", true);
mSigns.showSign("iPickCount", true, 1, true);
mCutaway.notifyPicking(true);
mPeople.fadePeopleInOut(true);
break;
case "LAST_MEAL_YOYO" :
animateLayout(LAYOUT_NARROW);
break;
case "LAYOUT_NARROW" :
mFlvPlayer.playPreloadedVideo("closingSponsor");
}
}
function notifySignArrived(signName) {
switch (signName) {
case "iFast_off" :
mLogo.gotoAndPlay("on");
startPreloading(true);
break;
case "iSlow_off" :
mLogo.gotoAndPlay("on");
startPreloading(false);
break;
case "iPlay_off" :
mFlvPlayer.playPreloadedVideo("intro");
if ((++pPlays) > 1) {
trackEvent("playAgain");
}
break;
case "iPickCount_off" :
animateLayout(LAYOUT_DOUBLE);
break;
case "iNoMeal_on" :
mFlvPlayer.playPreloadedVideo("mealOrNoMeal");
break;
case "iNoMeal_off" :
var _local2 = mBoard.getMealsInGame() <= 2;
var _local3 = (_local2 ? "noMealFinal" : "noMeal");
mFlvPlayer.playPreloadedVideo(_local3);
if (_local2) {
displayFinalOffer(false);
}
break;
case "iMeal_off" :
mealTaken();
break;
case "iSwap_off" :
case "iNoSwap_off" :
setState(STATE_OPEN_FINAL);
mFlvPlayer.playPreloadedVideo("openFinal");
break;
case "iCompetition_on" :
if (inState(STATE_INTRO)) {
break;
}
mCompetition_btn._visible = true;
}
}
function notifyPlatterPicked(platterID) {
oSounds.stopSound("sTension");
oSounds.startSound("sTensionEnd", 10);
oSounds.startSound("sClick", null, 0);
pLastPickID = platterID;
pPicksThisRound++;
mSigns.showSign("iPickPlatter", false, 3);
mSigns.showSign("iPickCount", false, 3.5, true);
mCutaway.notifyPicking(false);
}
function doReveal(showHeadshot) {
mFlvPlayer.playPreloadedVideo("reveal");
var _local4 = mFlvPlayer.getLastFilePath();
var _local3 = _local4.split("reveal_");
pRevealMealID = parseInt(com.tobyfreeman.flava.FlavaString.replaceSubString(_local3[1], ".flv", ""));
if (showHeadshot) {
var _local2 = (inState(STATE_PICKING) ? (pLastPickID) : (mPeople.findPersonInGame()));
mPeople.markPersonOutOfGame(_local2);
mHeadshot.gotoAndStop(_local2 + 2);
}
}
function revealComplete() {
mHeadshot.gotoAndStop("off");
mFlvPlayer.mute(false);
var _local2 = pRevealMealID;
if (inState(STATE_OPEN_FINAL)) {
_local2 = mBoard.getOtherMealID(pRevealMealID);
mBoard.setHeading("WHAT WAS IN YOUR PLATTER?");
}
mBoard.eliminateMeal(_local2);
mBoardMini.eliminateMeal(_local2);
if (inState(STATE_PICKING)) {
checkIfRoundComplete();
} else {
continueRevealAll();
}
}
function checkIfRoundComplete() {
if (pPicksThisRound < PICKS_PER_ROUND) {
mFlvPlayer.playPreloadedVideo("pickAnother");
} else {
pPicksThisRound = 0;
var _local2 = getRoundRating();
var _local3 = RESPONSE_LOOKUP[_local2];
mFlvPlayer.playPreloadedVideo(_local3);
}
}
function getRoundRating() {
pPreviousOfferID = pOfferID;
pOfferID = mBoard.calculateOffer();
var _local2 = RATING_OK;
if (pOfferID < pPreviousOfferID) {
_local2 = RATING_BAD;
} else if (pOfferID > pPreviousOfferID) {
_local2 = RATING_GOOD;
}
if (mBoard.checkEliminatedBestItem()) {
_local2 = RATING_BAD;
}
return(_local2);
}
function makeOffer() {
var _local2 = OFFER_TEXT[pOfferID];
var _local3 = _local2.length;
pOfferIndex = com.tobyfreeman.flava.FlavaMath.randomInt(0, _local3 - 1);
var _local4 = _local2[pOfferIndex];
mSigns.setOfferText(_local4);
mSigns.showSign("iChefsOffer", true, 0);
mSigns.showSign("iMeal", true, 1);
mSigns.showSign("iNoMeal", true, 1.5, true);
}
function mealTaken() {
pPreloader.jumpToGroup("revealAll");
setState(STATE_MEAL_TAKEN);
displayFinalOffer(true);
mBoard.setHeading("WHAT WAS IN YOUR PLATTER?");
mFlvPlayer.playPreloadedVideo("revealAll");
}
function displayFinalOffer(takenFlag) {
var _local2 = (takenFlag ? "YOU ACCEPTED THE OFFER" : "YOU REJECTED THE OFFER");
var _local3 = OFFER_TEXT[pOfferID][pOfferIndex];
mSigns.setFinalOfferText((_local2 + ":<br>") + _local3);
mSigns.showSign("iFinalOffer", true, 0);
}
function playResultMovie(goodMealFlag) {
if (goodMealFlag) {
mFlvPlayer.playPreloadedVideo("goodMeal");
} else {
mFlvPlayer.playPreloadedVideo("badMeal");
}
}
function continueRevealAll() {
if (mBoard.getMealsInGame() > 1) {
doReveal(true);
} else {
var _local2 = mBoard.animateLastMeal(false);
var _local3;
if (inState(STATE_OPEN_FINAL)) {
_local3 = _local2 >= pOfferID;
trackEvent("platter_" + _local2);
} else {
_local3 = pOfferID >= _local2;
trackEvent("offer_" + pOfferID);
}
playResultMovie(_local3);
oSounds.stopSound("sTension");
oSounds.startSound("sTensionEnd", 15);
}
}
function enterCompetition() {
var _local2 = _root.competitionUrl;
if (_local2 == null) {
_local2 = "http://www.priceyourmeal.com";
}
mFrame.code = "caviar";
mFrame.getURL(_local2, "_self", "POST");
}
function setState(newState) {
pState = newState;
}
function inState(theState) {
return(pState == theState);
}
function animateLayout(layoutID) {
mPanel.animateLayout(layoutID);
mBoard.animateLayout(layoutID);
}
static var TRACKING_CODE = "2810";
static var TRACKING_DOMAIN = "*";
static var TRACKING_URL = "http://www.chunk.co.uk/reporting/chunkTrack.swf";
static var STATE_INTRO = 0;
static var STATE_PICKING = 1;
static var STATE_MEAL_TAKEN = 2;
static var STATE_OPEN_FINAL = 3;
static var LAYOUT_NAME = ["LAYOUT_NARROW", "LAYOUT_WIDE", "LAYOUT_DOUBLE"];
static var LAYOUT_NARROW = 0;
static var LAYOUT_WIDE = 1;
static var LAYOUT_DOUBLE = 2;
static var PRELOAD_GROUPS = 4;
static var PICKS_PER_ROUND = 3;
static var RATING_BAD = 0;
static var RATING_OK = 1;
static var RATING_GOOD = 2;
static var RESPONSE_LOOKUP = ["roundBad", "roundOk", "roundGood"];
static var CHANCE_WRONG_NUMBER = 0;
static var CHANCE_OFF_CAMERA = 0;
static var AVERAGE_OFFER_ID = 6;
var pPlays = 0;
}
Symbol 296 MovieClip [__Packages.FlvPreloader] Frame 0
class FlvPreloader
{
var pGroups_num, pGroup_array, pProgress_mc, pConnection_nc, pStream_ns, FAST_CONNECTION, pBuffered_array, pGroupsLoaded, pLastPlayGroup_num, pGroupsNoBuffer, pPath_str, pIDToIndex_array, pCurGroup_num, pLastFilename, pProgressCallback;
function FlvPreloader (xmlUrl, fastConnection) {
initProgressBar();
initStream();
if (xmlUrl != null) {
preloadFiles(xmlUrl, fastConnection);
}
}
function reset() {
var _local2 = 0;
while (_local2 < pGroups_num) {
pGroup_array[_local2].reset();
_local2++;
}
}
function initProgressBar() {
pProgress_mc = Game.mGame.createEmptyMovieClip("progress_mc", Game.mGame.getNextHighestDepth());
pProgress_mc._visible = SHOW_PROGRESS_BAR;
if (SHOW_PROGRESS_BAR) {
with (pProgress_mc) {
lineStyle(0, 0);
moveTo(2, 2);
lineTo(102, 2);
lineTo(102, 10);
lineTo(2, 10);
lineTo(2, 2);
}
pProgress_mc.createEmptyMovieClip("bar_mc", pProgress_mc.getNextHighestDepth());
with (pProgress_mc.bar_mc) {
beginFill(16711680);
moveTo(3, 3);
lineTo(102, 3);
lineTo(102, 10);
lineTo(3, 10);
lineTo(3, 3);
endFill();
_xscale = 0;
}
}
}
function initStream() {
var oFlvPreloader = this;
pConnection_nc = new NetConnection();
pConnection_nc.connect(null);
pStream_ns = new NetStream(pConnection_nc);
pStream_ns.setBufferTime(BUFFER_OVERSIZE);
pProgress_mc.attachAudio(pStream_ns);
var _local2 = new Sound(pProgress_mc);
_local2.setVolume(0);
pStream_ns.onStatus = function (oInfo) {
oFlvPreloader.streamOnStatusCallback(oInfo);
};
}
function preloadFiles(xmlUrl, fastConnection) {
FAST_CONNECTION = fastConnection == true;
pBuffered_array = [];
pGroupsLoaded = 0;
pLastPlayGroup_num = 0;
pGroupsNoBuffer = 0;
var oFlvPreloader = this;
var _local2 = new XML();
_local2.ignoreWhite = true;
_local2.onLoad = function (success) {
if (success) {
oFlvPreloader.parseXmlFileList(this);
oFlvPreloader.preloadNextFile();
}
};
_local2.load(xmlUrl);
}
function parseXmlFileList(files_xml) {
var _local10 = com.tobyfreeman.flava.FlavaXml.findChildNode(files_xml, "preload");
var _local11 = (FAST_CONNECTION ? "fastConnection" : "slowConnection");
var _local9 = com.tobyfreeman.flava.FlavaXml.getChildValue(_local10, _local11);
pPath_str = ((_local9.length > 0) ? (_local9) : "");
var _local12 = com.tobyfreeman.flava.FlavaXml.findChildNode(_local10, "files");
var _local8 = com.tobyfreeman.flava.FlavaXml.getChildList(_local12, "group");
pGroups_num = _local8.length;
pGroup_array = [];
pIDToIndex_array = [];
var _local6;
var _local2;
var _local3;
var _local5;
_local2 = 0;
while (_local2 < pGroups_num) {
_local6 = _local8[_local2];
_local3 = new FlvPreloadGroup(this, _local2, _local6);
pGroup_array[_local2] = _local3;
_local5 = _local3.getID();
pIDToIndex_array[_local5] = _local2;
_local2++;
}
var _local4;
var _local7;
_local2 = 0;
while (_local2 < pGroups_num) {
_local3 = pGroup_array[_local2];
_local4 = _local3.getLoopID();
if (_local4 != null) {
_local7 = pIDToIndex_array[_local4];
_local3.setLoopIndex(_local7);
}
_local2++;
}
pCurGroup_num = ((pGroups_num > 0) ? (pGroups_num - 1) : null);
}
function preloadNextFile() {
pLastFilename = getNextFileToPreload();
if (pLastFilename != null) {
startPreloadFile(pLastFilename);
}
}
function startPreloadFile(filename_str) {
if (pProgress_interval != null) {
clearInterval(pProgress_interval);
}
pProgress_interval = setInterval(this, "updateProgress", PROGRESS_BAR_INTERVAL);
pStream_ns.play(pPath_str + filename_str);
}
function updateProgress() {
var _local2 = Math.floor((100 * pStream_ns.bytesLoaded) / pStream_ns.bytesTotal);
if (_local2 >= 100) {
clearInterval(pProgress_interval);
pProgress_interval = null;
_local2 = 0;
endPreloadFile();
}
if (SHOW_PROGRESS_BAR) {
pProgress_mc.bar_mc._xscale = _local2;
}
if (pProgressCallback != null) {
pProgressCallback.notifyPreloadProgress(_local2);
}
}
function streamOnStatusCallback(oInfo) {
if (oInfo.level == "status") {
var _local1 = oInfo.code;
if (_local1.indexOf("Buffer.Flush") != -1) {
}
}
}
function endPreloadFile() {
pStream_ns.close();
preloadNextFile();
}
function getNextFileToPreload() {
pCurGroup_num = findNextGroupToPreload(pCurGroup_num);
if (pCurGroup_num == null) {
return(null);
}
var _local2 = pGroup_array[pCurGroup_num].takeNextFilePreloaded();
return(_local2);
}
function findNextGroupToPreload(group_num) {
if ((group_num == null) || (allGroupsLoaded())) {
return(null);
}
var _local3;
do {
group_num = findNextGroupNumber(group_num);
_local3 = pGroup_array[group_num].checkNeedsPreloading();
} while (!_local3);
return(group_num);
}
function findNextGroupNumber(group_num) {
var _local2 = pGroup_array[group_num].tryDoLoop();
if (_local2 != null) {
if (checkGroupsBuffered(_local2, pCurGroup_num)) {
_local2 = null;
}
}
if (_local2 != null) {
group_num = _local2;
} else {
group_num++;
if (group_num >= pGroups_num) {
group_num = 0;
}
}
return(group_num);
}
function notifyPlaybackCaughtUp() {
var _local2 = findNextGroupToPreload(pLastPlayGroup_num);
if (_local2 != null) {
jumpToGroup(pGroup_array[_local2].getID());
}
}
function getFileToPlay(groupID) {
var _local2 = pIDToIndex_array[groupID];
pLastPlayGroup_num = _local2;
var _local3 = pGroup_array[_local2].getFileToPlay();
return(pPath_str + _local3);
}
function jumpToGroup(groupID) {
if (((pCurGroup_num == null) || (allGroupsLoaded())) || (groupID == null)) {
return(undefined);
}
pCurGroup_num = pIDToIndex_array[groupID];
}
function allGroupsBuffered() {
return(pBuffered_array.length == pGroups_num);
}
function getGroupsBuffered(ignoreNoBuffer) {
var _local2 = pBuffered_array.length;
if (ignoreNoBuffer == true) {
_local2 = _local2 - pGroupsNoBuffer;
}
return(_local2);
}
function checkGroupsBuffered(startGroup, endGroup) {
var _local3 = true;
var _local2 = startGroup;
while (_local2 <= endGroup) {
if (!pGroup_array[_local2].checkFullyBuffered()) {
_local3 = false;
break;
}
_local2++;
}
return(_local3);
}
function notifyGroupBuffered(group_num, isBuffered) {
if (isBuffered) {
com.tobyfreeman.flava.FlavaArray.addItemOnce(pBuffered_array, group_num);
} else {
com.tobyfreeman.flava.FlavaArray.deleteItem(pBuffered_array, group_num);
}
}
function notifyGroupNoBuffer(group_num) {
pGroupsNoBuffer++;
com.tobyfreeman.flava.FlavaArray.addItemOnce(pBuffered_array, group_num);
}
function allGroupsLoaded() {
return(pGroupsLoaded == pGroups_num);
}
function notifyGroupLoaded() {
pGroupsLoaded++;
}
function getGroupWithID(groupID) {
var _local2 = pIDToIndex_array[groupID];
return(pGroup_array[_local2]);
}
function getLastPlayGroupID() {
return(pGroup_array[pLastPlayGroup_num].getID());
}
function getPlayAfterGroupID(groupID) {
if (groupID == null) {
groupID = getLastPlayGroupID();
}
return(getGroupWithID(groupID).pPlayAfterGroupID);
}
function getPlayLoopFlag(groupID) {
if (groupID == null) {
groupID = getLastPlayGroupID();
}
return(getGroupWithID(groupID).pPlayLoopFlag);
}
function getGroupFileCount(groupID) {
return(getGroupWithID(groupID).getFileCount());
}
function getBasePath() {
return(pPath_str);
}
function setProgressCallback(oCallback) {
pProgressCallback = oCallback;
}
var BUFFER_OVERSIZE = 500;
var PROGRESS_BAR_INTERVAL = 200;
var SHOW_PROGRESS_BAR = false;
var pProgress_interval = null;
}
Symbol 297 MovieClip [__Packages.com.tobyfreeman.flava.FlavaXml] Frame 0
class com.tobyfreeman.flava.FlavaXml
{
function FlavaXml () {
trace("FlavaXml is a static function library. It is not intended to be instantiated.");
}
static function findChildNode(parent_xmlnode, childName_str) {
var _local1 = parent_xmlnode.firstChild;
while (_local1 != null) {
if (_local1.nodeName == childName_str) {
break;
}
_local1 = _local1.nextSibling;
}
if (_local1 == 0) {
_local1 = null;
}
return(_local1);
}
static function getChildList(parent_xmlnode, childName_str) {
var _local4 = childName_str == null;
var _local2;
var _local3 = [];
var _local1 = parent_xmlnode.firstChild;
while (_local1 != null) {
_local2 = _local1.nodeName == childName_str;
if (_local4 or _local2) {
_local3.push(_local1);
}
_local1 = _local1.nextSibling;
}
return(_local3);
}
static function getChildListByNodeType(parent_xmlnode, childType_num) {
var _local4 = childType_num == null;
var _local2;
var _local3 = [];
var _local1 = parent_xmlnode.firstChild;
while (_local1 != null) {
_local2 = _local1.nodeType == childType_num;
if (_local4 or _local2) {
_local3.push(_local1);
}
_local1 = _local1.nextSibling;
}
return(_local3);
}
static function getChildValue(parent_xmlnode, childName_str) {
var _local1 = null;
var _local2 = findChildNode(parent_xmlnode, childName_str);
if (_local2 != null) {
_local1 = _local2.firstChild.nodeValue;
}
return(_local1);
}
static function getChildValueList(parent_xmlnode, childName_str, resultType_str) {
var _local2;
var _local3;
var _local5 = [];
var _local1 = parent_xmlnode.firstChild;
while (_local1 != null) {
if (_local1.nodeName == childName_str) {
_local2 = _local1.firstChild.nodeValue;
_local3 = _local2;
if (resultType_str == "FLOAT") {
_local3 = parseFloat(_local2);
} else if (resultType_str == "INTEGER") {
_local3 = parseInt(_local2);
} else if (resultType_str == "BOOLEAN") {
_local3 = com.tobyfreeman.flava.FlavaUtils.stringToBoolean(_local2);
}
_local5.push(_local3);
}
_local1 = _local1.nextSibling;
}
return(_local5);
}
static function getChildAttributeList(parent_xmlnode, childName_str, attribName_str, resultType_str) {
var _local5 = [];
var _local3;
var _local2;
var _local1 = parent_xmlnode.firstChild;
while (_local1 != null) {
if (_local1.nodeName == childName_str) {
_local3 = _local1.attributes[attribName_str];
_local2 = _local3;
if (resultType_str == "FLOAT") {
_local2 = parseFloat(_local3);
} else if (resultType_str == "INTEGER") {
_local2 = parseInt(_local3);
} else if (resultType_str == "BOOLEAN") {
_local2 = com.tobyfreeman.flava.FlavaUtils.stringToBoolean(_local3);
}
_local5.push(_local2);
}
_local1 = _local1.nextSibling;
}
return(_local5);
}
static function separateNode(the_xmlnode) {
var _local1 = null;
if (the_xmlnode != null) {
_local1 = new XML();
_local1.appendChild(the_xmlnode);
}
return(_local1);
}
static function addChildNode(doc_xml, parent_xmlnode, nodeName_str, content_str) {
var _local1 = addElement(doc_xml, parent_xmlnode, nodeName_str);
if (content_str != null) {
addTextNode(doc_xml, _local1, String(content_str));
}
return(_local1);
}
static function addElement(doc_xml, parent_xmlnode, newNodeName) {
var _local1 = doc_xml.createElement(newNodeName);
parent_xmlnode.appendChild(_local1);
return(_local1);
}
static function addTextNode(doc_xml, parent_xmlnode, contentText) {
var _local1 = doc_xml.createTextNode(contentText);
parent_xmlnode.appendChild(_local1);
return(_local1);
}
}
Symbol 298 MovieClip [__Packages.com.tobyfreeman.flava.FlavaUtils] Frame 0
class com.tobyfreeman.flava.FlavaUtils
{
function FlavaUtils () {
trace("FlavaUtils is a static function library. It is not intended to be instantiated.");
}
static function traceObject(title_str, obj, indent) {
if (indent == null) {
indent = 0;
}
var _local6 = com.tobyfreeman.flava.FlavaString.stringPadTrimEnd("", " ", indent);
trace((_local6 + title_str) + "[object]");
var _local1;
var _local2;
for (var _local7 in obj) {
_local1 = obj[_local7];
_local2 = typeof(_local1);
switch (_local2) {
case "object" :
traceObject((title_str + ".") + _local7, _local1, indent + 2);
break;
case "function" :
break;
default :
trace(((((((((_local6 + " ") + title_str) + ".") + _local7) + "=") + _local1) + "[") + _local2) + "]");
}
}
}
static function propsToString(obj, recurseFlag, indent) {
if (indent == null) {
indent = 0;
}
var _local4 = com.tobyfreeman.flava.FlavaString.stringPadTrimEnd("", " ", indent);
var _local1 = "";
var _local2;
var _local3;
for (var _local8 in obj) {
_local2 = obj[_local8];
_local3 = typeof(_local2);
switch (_local3) {
case "function" :
break;
case "object" :
if (_local1.length > 0) {
_local1 = _local1 + newline;
}
_local1 = _local1 + ((_local4 + _local8) + "[object]");
if (recurseFlag == true) {
_local1 = _local1 + (newline + propsToString(_local2, recurseFlag, indent + 2));
}
break;
default :
if (_local1.length > 0) {
_local1 = _local1 + newline;
}
_local1 = _local1 + ((((((_local4 + _local8) + "=") + _local2) + "[") + _local3) + "]");
}
}
return(_local1);
}
static function stringToBoolean(the_str) {
var _local1 = the_str.toLowerCase();
if (((_local1 == "no") || (_local1 == "false")) || (the_str == "0")) {
return(false);
}
if (com.tobyfreeman.flava.FlavaString.isWhiteSpace(the_str)) {
return(false);
}
return(Boolean(the_str));
}
static function setIfDefined(obj, propName, propValue, propType) {
if ((propValue != null) && (propValue != "")) {
var _local2 = String(propValue);
switch (propType) {
case "BOOLEAN" :
propValue = stringToBoolean(_local2);
break;
case "INTEGER" :
propValue = parseInt(_local2);
break;
case "FLOAT" :
propValue = parseFloat(_local2);
break;
case "STRING" :
propValue = _local2;
}
obj[propName] = propValue;
}
}
static function roundDecimalPlaces(the_num, places) {
if (places <= 0) {
return(String(Math.round(the_num)));
}
var _local2 = 0;
if (the_num != 0) {
_local2 = the_num * Math.pow(10, places);
_local2 = Math.round(_local2) * Math.pow(10, -places);
}
var _local1 = String(_local2);
var _local3 = _local1.indexOf(".");
if (_local3 == -1) {
_local3 = _local1.length;
_local1 = _local1 + ".";
}
return(com.tobyfreeman.flava.FlavaString.stringPadTrimEnd(_local1, "0", (_local3 + places) + 1));
}
static function clipDecimalPlaces(the_num, places) {
var _local1 = String(the_num);
var _local2 = _local1.indexOf(".");
if (places <= 0) {
return(_local1.substring(0, _local2));
}
if (_local2 == -1) {
_local2 = _local1.length;
_local1 = _local1 + ".";
}
return(com.tobyfreeman.flava.FlavaString.stringPadTrimEnd(_local1, "0", (_local2 + places) + 1));
}
static function formatCashValue(value_num, keepZeroPence) {
var _local1 = String(roundDecimalPlaces(value_num, 2));
if (keepZeroPence == false) {
if (com.tobyfreeman.flava.FlavaString.endsWith(_local1, ".00")) {
_local1 = _local1.substr(0, _local1.length - 3);
}
}
return(_local1);
}
}
Symbol 299 MovieClip [__Packages.com.tobyfreeman.flava.FlavaString] Frame 0
class com.tobyfreeman.flava.FlavaString
{
function FlavaString () {
trace("FlavaString is a static function library - not intended to be instantiated.");
}
static function beginsWith(the_str, begin_str) {
return(the_str.indexOf(begin_str) == 0);
}
static function endsWith(the_str, ending_str) {
var _local1 = the_str.lastIndexOf(ending_str);
var _local2 = the_str.length - ending_str.length;
return((_local1 == _local2) and (_local1 >= 0));
}
static function stringPadTrimStart(the_str, pad_str, length_num) {
while (the_str.length < length_num) {
the_str = pad_str + the_str;
}
return(the_str.substring(0, length_num));
}
static function stringPadTrimEnd(the_str, pad_str, length_num) {
while (the_str.length < length_num) {
the_str = the_str + pad_str;
}
return(the_str.substring(0, length_num));
}
static function isWhiteSpace(the_str) {
return(findWhiteStart(the_str) == -1);
}
static function findWhiteStart(the_str) {
if (the_str == null) {
return(-1);
}
var _local3 = 0;
var _local1;
var _local2;
do {
_local1 = the_str.charCodeAt(_local3);
_local2 = ((_local1 == 32) || (_local1 == 10)) || (_local1 == 13);
if (_local2) {
_local3++;
}
} while (_local2);
return(((_local3 == the_str.length) ? -1 : (_local3)));
}
static function findWhiteEnd(the_str) {
if (the_str == null) {
return(-1);
}
var _local3 = the_str.length - 1;
var _local1;
var _local2;
do {
_local1 = the_str.charCodeAt(_local3);
_local2 = ((_local1 == 32) || (_local1 == 10)) || (_local1 == 13);
if (_local2) {
_local3--;
}
} while (_local2);
return(_local3);
}
static function trimWhiteSpace(the_str) {
var _local1 = findWhiteStart(the_str);
var _local2 = findWhiteEnd(the_str);
return(((_local1 == -1) ? "" : (the_str.slice(_local1, _local2 + 1))));
}
static function replaceSubString(the_str, from_str, to_str) {
var _local1 = 0;
var _local4 = from_str.length;
var _local3;
var _local2 = new String(the_str);
do {
_local1 = _local2.indexOf(from_str, _local1);
_local3 = _local1 != -1;
if (_local3) {
_local2 = (_local2.slice(0, _local1) + to_str) + _local2.slice(_local1 + _local4);
}
} while (_local3);
return(_local2);
}
static function copyLines(the_str, startLine, endLine) {
var _local1 = findLine(the_str, startLine);
var _local4 = findLine(the_str, endLine + 1);
var _local2 = the_str.substring(_local1, _local4);
return(_local2);
}
static function findLine(the_str, line_num) {
var _local3 = 0;
var _local2 = line_num <= 1;
var _local1 = -1;
var _local4 = 1;
while (!_local2) {
_local4 = _local4 + 1;
_local1 = the_str.indexOf(newline, _local1 + 1);
if (_local1 == -1) {
_local3 = the_str.length;
_local2 = true;
} else if (_local4 == line_num) {
_local3 = _local1 + 1;
_local2 = true;
}
}
return(_local3);
}
static function capitalise(the_str) {
var _local8 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var _local9 = "abcdefghijklmnopqrstuvwxyz";
var _local4 = "";
var _local5 = true;
var _local1;
var _local3;
var _local6;
var _local7 = the_str.length;
var _local2 = 0;
while (_local2 < _local7) {
_local1 = the_str.charAt(_local2);
_local3 = _local9.indexOf(_local1) != -1;
if (_local3 && (_local5)) {
_local4 = _local4 + _local1.toUpperCase();
} else {
_local4 = _local4 + _local1;
}
_local6 = _local8.indexOf(_local1) != -1;
_local5 = (!_local3) && (!_local6);
_local2++;
}
return(_local4);
}
static function letterSpace(the_str, spaceChar) {
if ((spaceChar == null) or (spaceChar == "")) {
spaceChar = " ";
}
var _local3 = the_str.charAt(0);
var _local4 = the_str.length;
var _local1 = 1;
while (_local1 < _local4) {
_local3 = _local3 + (spaceChar + the_str.charAt(_local1));
_local1++;
}
return(_local3);
}
static function isValidEmail(the_str, isRequired) {
if (isWhiteSpace(the_str)) {
return(!isRequired);
}
var _local2 = the_str.indexOf("@");
var _local1 = the_str.substring(_local2 + 1);
var _local3 = _local1.indexOf(".");
return(((_local2 > 0) && (_local3 > 0)) && (_local3 < (_local1.length - 1)));
}
}
Symbol 300 MovieClip [__Packages.FlvPreloadGroup] Frame 0
class FlvPreloadGroup
{
var pPreloader, pIndex, pFilename_array, pFiles_num, pID, pBuffer, pLoopID, pLoops, pPlayAfterGroupID, pPlayLoopFlag, pResetFlag, pAllLoaded, pLoopsDone, pNextToPlay_num, pNextToLoad_num, pLoopIndex;
function FlvPreloadGroup (preloader, index, group_xmlnode) {
pPreloader = preloader;
pIndex = index;
pFilename_array = com.tobyfreeman.flava.FlavaXml.getChildValueList(group_xmlnode, "file");
pFiles_num = pFilename_array.length;
if (RANDOMISE_FILES) {
com.tobyfreeman.flava.FlavaArray.randomiseOrder(pFilename_array);
}
pID = group_xmlnode.attributes.ID;
var _local5 = parseInt(group_xmlnode.attributes.buffer);
pBuffer = (isNaN(_local5) ? 1 : (Math.min(pFiles_num, _local5)));
var _local3 = group_xmlnode.attributes.loopID;
pLoopID = (((_local3 == null) || (_local3.length <= 0)) ? null : (_local3));
var _local4 = parseInt(group_xmlnode.attributes.loops);
pLoops = ((isNaN(_local4) || (pLoopID == null)) ? 1 : (_local4));
pPlayAfterGroupID = group_xmlnode.attributes.playAfter;
pPlayLoopFlag = com.tobyfreeman.flava.FlavaUtils.stringToBoolean(group_xmlnode.attributes.playLoop);
pResetFlag = com.tobyfreeman.flava.FlavaUtils.stringToBoolean(group_xmlnode.attributes.reset);
pAllLoaded = false;
pLoopsDone = 0;
pNextToPlay_num = 0;
pAllLoaded = pFiles_num <= 0;
pNextToLoad_num = (pAllLoaded ? null : 0);
if (pAllLoaded) {
pPreloader.notifyGroupBuffered(pIndex, true);
pPreloader.notifyGroupLoaded();
} else if (pBuffer == 0) {
pPreloader.notifyGroupNoBuffer(pIndex);
}
}
function reset() {
if (pResetFlag) {
if (RANDOMISE_FILES) {
com.tobyfreeman.flava.FlavaArray.randomiseOrder(pFilename_array);
}
pNextToPlay_num = 0;
}
}
function checkNeedsPreloading() {
if (pNextToLoad_num == null) {
return(false);
}
if (pPreloader.allGroupsBuffered()) {
return(true);
}
return(!checkFullyBuffered());
}
function checkFullyBuffered() {
if (pAllLoaded || (pBuffer == 0)) {
return(true);
}
var _local2 = pNextToLoad_num - pNextToPlay_num;
return(_local2 >= pBuffer);
}
function takeNextFilePreloaded() {
if ((pNextToLoad_num == null) || (pAllLoaded)) {
_global.displayDebug(("group[" + pID) + "].takeNextFilePreloaded() when all loaded");
return(null);
}
var _local3 = pFilename_array[pNextToLoad_num];
pNextToLoad_num++;
pAllLoaded = pNextToLoad_num >= pFiles_num;
if (pAllLoaded) {
pNextToLoad_num = null;
pPreloader.notifyGroupLoaded();
}
if (checkFullyBuffered()) {
pPreloader.notifyGroupBuffered(pIndex, true);
}
return(_local3);
}
function tryDoLoop() {
pLoopsDone++;
if (pLoopsDone >= pLoops) {
pLoopsDone = 0;
return(null);
}
return(pLoopIndex);
}
function getFileToPlay() {
var _local2 = pFilename_array[pNextToPlay_num];
pNextToPlay_num++;
if (pNextToPlay_num >= pFiles_num) {
pNextToPlay_num = 0;
}
if (pNextToPlay_num > pNextToLoad_num) {
pNextToLoad_num = pNextToPlay_num;
pPreloader.notifyPlaybackCaughtUp();
}
if (!checkFullyBuffered()) {
pPreloader.notifyGroupBuffered(pIndex, false);
}
return(_local2);
}
function getID() {
return(pID);
}
function getLoopID() {
return(pLoopID);
}
function setLoopIndex(i) {
pLoopIndex = i;
}
function getFileCount() {
return(pFiles_num);
}
static var RANDOMISE_FILES = true;
}
Symbol 301 MovieClip [__Packages.com.tobyfreeman.flava.FlavaArray] Frame 0
class com.tobyfreeman.flava.FlavaArray
{
function FlavaArray () {
trace("FlavaArray is a static function library - not intended to be instantiated.");
}
static function getPos(the_array, theValue) {
var _local2 = false;
var _local3 = the_array.length;
var _local1 = 0;
while (_local1 < _local3) {
if (theValue == the_array[_local1]) {
_local2 = true;
break;
}
_local1++;
}
return((_local2 ? (_local1) : null));
}
static function getPosPropValue(the_array, propName, propValue) {
var _local2 = false;
var _local3 = the_array.length;
var _local1 = 0;
while (_local1 < _local3) {
if (the_array[_local1][propName] === propValue) {
_local2 = true;
break;
}
_local1++;
}
return((_local2 ? (_local1) : null));
}
static function getItemWithPropValue(the_array, propName, propValue) {
var _local1 = getPosPropValue(the_array, propName, propValue);
return(((_local1 == null) ? null : (the_array[_local1])));
}
static function deleteAt(the_array, theIndex) {
the_array.splice(theIndex, 1);
return(the_array.length);
}
static function deleteItem(the_array, theItem) {
var _local3 = the_array.length;
var _local1 = 0;
while (_local1 < _local3) {
if (theItem == the_array[_local1]) {
the_array.splice(_local1, 1);
break;
}
_local1++;
}
return(the_array.length);
}
static function addItemOnce(the_array, theItem) {
var _local1 = getPos(the_array, theItem) == null;
if (_local1) {
the_array.push(theItem);
}
return(_local1);
}
static function subtractArray(the_array, remove_array) {
var _local2 = the_array.slice();
var _local3 = remove_array.length;
var _local1 = 0;
while (_local1 < _local3) {
deleteItem(_local2, remove_array[_local1]);
_local1++;
}
return(_local2);
}
static function intersectArray(array1, array2) {
var _local3 = [];
var _local4 = array1.length;
var _local2;
var _local1 = 0;
while (_local1 < _local4) {
_local2 = array1[_local1];
if (getPos(array2, _local2) != null) {
_local3.push(_local2);
}
_local1++;
}
return(_local3);
}
static function randomiseOrder(the_array) {
var _local1 = the_array.slice();
the_array.length = 0;
while (_local1.length > 0) {
var _local2 = Math.floor(Math.random() * _local1.length);
the_array.push(_local1[_local2]);
deleteAt(_local1, _local2);
}
return(the_array);
}
static function stringToArray(the_str, delimiter, itemType) {
var _local5 = new Array();
var _local4 = the_str.split(delimiter);
var _local6 = ((the_str == "") ? 0 : (_local4.length));
var _local1;
var _local2;
var _local3 = 0;
while (_local3 < _local6) {
_local1 = _local4[_local3];
_local2 = _local1;
switch (itemType) {
case "FLOAT" :
_local2 = parseFloat(_local1);
break;
case "INTEGER" :
_local2 = parseInt(_local1);
break;
case "BOOLEAN" :
_local2 = com.tobyfreeman.flava.FlavaUtils.stringToBoolean(_local1);
}
_local5.push(_local2);
_local3++;
}
return(_local5);
}
}
Symbol 302 MovieClip [__Packages.Sounds] Frame 0
class Sounds
{
var mMaster, sMasterVolume, pSoundOn, pMasterVolume, pVolume;
function Sounds (master_mc, onFlag) {
mMaster = master_mc;
sMasterVolume = new Sound(master_mc);
pSoundOn = onFlag;
initialise();
}
function initialise() {
setMasterVolume(VOLUME_STARTUP);
}
function setMasterOnOff(onFlag) {
pSoundOn = onFlag;
updateMasterVolume();
}
function setMasterVolume(vol) {
pMasterVolume = vol;
updateMasterVolume();
}
function getCurrentVolume() {
return(pVolume);
}
function startSound(soundName, vol, pan) {
var _local2 = getSound(soundName);
if (vol != null) {
_local2.setVolume(vol);
}
if (pan != null) {
_local2.setPan(pan);
}
_local2.start();
}
function loopSound(soundName, loopCount) {
getSound(soundName).start(0, loopCount);
}
function adjustSound(soundName, vol, pan) {
var _local2 = getSound(soundName);
if (vol != null) {
_local2.setVolume(vol);
}
if (pan != null) {
_local2.setPan(pan);
}
}
function stopSound(soundName) {
getSound(soundName).stop();
}
function getSound(soundName) {
return(this[soundName]);
}
function addSound(soundName, vol, pan) {
var _local2 = getSound(soundName);
if (_local2 == null) {
var _local3 = mMaster.createEmptyMovieClip(soundName, mMaster.getNextHighestDepth());
_local3.stop();
_local3._visible = false;
_local2 = new Sound(_local3);
_local2.attachSound(soundName);
if (vol != null) {
_local2.setVolume(vol);
}
if (pan != null) {
_local2.setPan(pan);
}
this[soundName] = _local2;
}
return(_local2);
}
function updateMasterVolume() {
pVolume = (pSoundOn ? (pMasterVolume) : 0);
sMasterVolume.setVolume(pVolume);
}
static var VOLUME_STARTUP = 100;
}
Symbol 303 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 304 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 305 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 306 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 307 MovieClip [__Packages.com.tobyfreeman.flava.FlavaMath] Frame 0
class com.tobyfreeman.flava.FlavaMath
{
function FlavaMath () {
trace("FlavaMath is a static function library. It is not intended to be instantiated.");
}
static function degToRad(degrees_num) {
return(degrees_num * DEG_TO_RAD);
}
static function radToDeg(radians_num) {
return(radians_num * RAD_TO_DEG);
}
static function cartesianToPolar(the_point) {
var _local1 = the_point.x;
var _local2 = the_point.y;
var _local4 = Math.atan2(_local2, _local1);
var _local5 = Math.sqrt((_local1 * _local1) + (_local2 * _local2));
return({angle:_local4, radius:_local5});
}
static function aTanDegrees(x_num, y_num) {
return(RAD_TO_DEG * Math.atan2(y_num, x_num));
}
static function randomInt(min_num, max_num) {
var _local1 = (max_num - min_num) + 1;
return(min_num + Math.floor(Math.random() * _local1));
}
static function wrapInt(the_num, min_num, max_num) {
while (the_num < min_num) {
the_num = (the_num - min_num) + (max_num + 1);
}
while (the_num > max_num) {
the_num = (the_num - max_num) + (min_num - 1);
}
return(the_num);
}
static function mapToRange(in_num, inMin, inMax, outMin, outMax) {
var _local1;
var _local4 = inMax - inMin;
var _local5 = outMax - outMin;
var _local2 = (in_num - inMin) / _local4;
if (_local2 <= 0) {
_local1 = outMin;
} else if (_local2 >= 1) {
_local1 = outMax;
} else {
_local1 = outMin + (_local2 * _local5);
}
return(_local1);
}
static function limitToRange(the_num, min_num, max_num) {
if (min_num > max_num) {
var _local4 = min_num;
max_num = min_num;
min_num = _local4;
}
if (the_num < min_num) {
the_num = min_num;
} else if (the_num > max_num) {
the_num = max_num;
}
return(the_num);
}
static function shiftDecimalPoint(the_num, places) {
return(the_num * Math.pow(10, places));
}
static var RAD_TO_DEG = 57.2957795130823;
static var DEG_TO_RAD = (Math.PI/180);
static var RIGHT_ANGLE_RADIANS = (Math.PI/2);
}
Symbol 308 MovieClip [__Packages.mx.transitions.easing.Elastic] Frame 0
class mx.transitions.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static var version = "1.1.0.52";
}
Symbol 309 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 310 MovieClip [__Packages.BoardMini] Frame 0
class BoardMini extends MovieClip
{
var _visible, pMeal_array;
function BoardMini () {
super();
_visible = false;
pMeal_array = [];
var _local4;
var _local3 = 0;
while (_local3 < MEALS) {
_local4 = this["iMeal" + _local3];
pMeal_array[_local3] = _local4;
_local3++;
}
}
function reset() {
var _local2 = 0;
while (_local2 < MEALS) {
pMeal_array[_local2]._visible = true;
_local2++;
}
}
function eliminateMeal(mealID) {
pMeal_array[mealID]._visible = false;
}
static var MEALS = 14;
}
Symbol 311 MovieClip [__Packages.People] Frame 0
class People extends MovieClip
{
var _visible, mPointer, iPointer, pPeople_array, pPlatter_array, pInGame_array, pInGame_num, pPickedPersonID;
function People () {
super();
_visible = false;
mPointer = iPointer;
mPointer._visible = false;
initialisePeople();
reset();
}
function initialisePeople() {
var oPeopleLocal = this;
var mPointerLocal = mPointer;
pPeople_array = [];
pPlatter_array = [];
pInGame_array = [];
var _local2;
var _local5;
var i = 0;
while (i < PEOPLE) {
_local2 = this["iPerson" + i];
pPeople_array[i] = _local2;
_local2.personID = i;
_local2.gotoAndStop("ready");
_local2.iChoice.gotoAndStop(i + 1);
if (i >= 6) {
_local2.iButton._x = 0;
}
var _local7 = this["iPlatter" + i];
pPlatter_array[i] = _local7;
_local2.mPlatter = _local7;
_local5 = _local2.iButton;
_local5.onRollOver = function () {
Game.oSounds.startSound("sRoll", null, (i * 12) - 60);
this._parent.gotoAndPlay("rolledOver");
this._parent.mPlatter.gotoAndStop("on");
mPointerLocal._visible = true;
var _local2 = mPointerLocal._x;
var _local3 = this._parent.mPlatter._x + 14;
var _local4 = _local3 > People.MID_POINT;
mPointerLocal._xscale = (_local4 ? 100 : -100);
if (((People.MID_POINT - _local2) * (People.MID_POINT - _local3)) < 0) {
var _local5 = (_local4 ? 100 : -100);
_local2 = People.MID_POINT + _local5;
}
new mx.transitions.Tween(mPointerLocal, "_x", mx.transitions.easing.Regular.easeOut, _local2, _local3, 0.2, true);
};
_local5.onRollOut = function () {
this._parent.gotoAndStop("rolledOut");
this._parent.mPlatter.gotoAndStop("off");
mPointerLocal._visible = false;
};
_local5.onRelease = function () {
oPeopleLocal.personClickHandler(this._parent.personID);
};
i++;
}
}
function reset() {
pInGame_num = PEOPLE;
var _local3;
var _local4;
var _local2 = 0;
while (_local2 < PEOPLE) {
pInGame_array[_local2] = true;
_local3 = pPeople_array[_local2];
_local3.eliminated = false;
_local3.iButton.enabled = false;
_local3.iButton._visible = false;
_local4 = pPlatter_array[_local2];
_local4._visible = true;
_local4.gotoAndStop("off");
_local2++;
}
}
function personClickHandler(personID) {
markPersonOutOfGame(personID);
pPickedPersonID = personID;
var _local3 = pPeople_array[personID];
_local3.gotoAndPlay("picked");
_local3.iButton.enabled = false;
_local3.iButton._visible = false;
fadePeopleInOut(false, personID);
mPointer.gotoAndPlay("moving");
Game.pGame.notifyPlatterPicked(personID);
}
function markPersonOutOfGame(personID) {
if (pInGame_array[personID]) {
pInGame_array[personID] = false;
pInGame_num--;
}
}
function updateAfterPick() {
resetPointer();
var _local3 = pPeople_array[pPickedPersonID];
_local3.eliminated = true;
_local3.gotoAndStop("off");
var _local2 = pPlatter_array[pPickedPersonID];
_local2._visible = false;
_local2.gotoAndStop("off");
}
function findPersonInGame() {
var _local3 = null;
var _local2 = 0;
while (_local2 < PEOPLE) {
if (pInGame_array[_local2]) {
_local3 = _local2;
break;
}
_local2++;
}
return(_local3);
}
function fadePeopleInOut(fadeInFlag, pickedPersonID) {
var _local3;
var _local8 = (fadeInFlag ? 1 : (FADE_OUT_FRAME));
var _local4;
var _local5;
var _local2 = 0;
while (_local2 < PEOPLE) {
_local5 = !pInGame_array[_local2];
if ((fadeInFlag && (_local5)) || (_local2 == pickedPersonID)) {
} else {
_local3 = pPeople_array[_local2];
_local4 = (fadeInFlag ? (com.tobyfreeman.flava.FlavaMath.randomInt(0, 12)) : (2 * Math.abs(_local2 - pickedPersonID)));
if (_local5) {
_local4 = _local4 + FLASH_FRAME_OFFSET;
}
_local3.gotoAndPlay(_local8 + _local4);
_local3.iButton.enabled = false;
_local3.iButton._visible = false;
}
_local2++;
}
}
function resetPointer() {
mPointer.gotoAndStop("static");
mPointer._visible = false;
mPointer._x = MID_POINT;
}
function getInGameCount() {
return(pInGame_num);
}
static var PEOPLE = 13;
static var HALF_WIDTH = 22;
static var MID_POINT = 330;
static var FADE_OUT_FRAME = 54;
static var FLASH_FRAME_OFFSET = 93 - FADE_OUT_FRAME;
}
Symbol 312 MovieClip [__Packages.FlvPlayer] Frame 0
class FlvPlayer extends MovieClip
{
var mVideo, iVideo, pSound_mc, createEmptyMovieClip, getNextHighestDepth, pAllowSkip, pAllowProgress, pConnection_nc, pStream_ns, pSound, pWasPreloaded;
function FlvPlayer () {
super();
mVideo = iVideo;
pSound_mc = createEmptyMovieClip("iSound_mc", getNextHighestDepth());
pAllowSkip = true;
pAllowProgress = true;
initStream();
showVideo(false);
showSkipButton(false);
}
function initStream() {
pConnection_nc = new NetConnection();
pConnection_nc.connect(null);
pStream_ns = new NetStream(pConnection_nc);
mVideo.attachVideo(pStream_ns);
pStream_ns.setBufferTime(BUFFER_TIME);
pSound_mc.attachAudio(pStream_ns);
pSound = new Sound(pSound_mc);
pSound.setVolume(100);
var oFlvPlayer = this;
pStream_ns.onStatus = function (oInfo) {
oFlvPlayer.streamOnStatusCallback(oInfo);
};
}
function playVideo(filename) {
pWasPreloaded = false;
var _local2 = Game.pPreloader.getBasePath();
pLastFilePath = _local2 + filename;
pStream_ns.play(pLastFilePath);
showProgress(true);
}
function playPreloadedVideo(groupID) {
pWasPreloaded = true;
pLastFilePath = Game.pPreloader.getFileToPlay(groupID);
pStream_ns.play(pLastFilePath);
showProgress(true);
}
function showProgress(showFlag) {
clearProgressInterval();
if (showFlag) {
pProgress_interval = setInterval(this, "updateProgress", PROGRESS_BOX_INTERVAL);
showSkipButton((!pWasPreloaded) || (!Game.pPreloader.getPlayLoopFlag()));
} else {
Game.mProgressBox._visible = false;
}
}
function updateProgress() {
var _local2 = Math.floor((100 * pStream_ns.bytesLoaded) / pStream_ns.bytesTotal);
Game.mProgressBox.loadedPercent_str = String(_local2);
if (_local2 >= 100) {
showProgress(false);
showVideo(true);
if (pLoadedCallback != null) {
pLoadedCallback.notifyFlvLoaded();
}
} else {
Game.mProgressBox._visible = pAllowProgress;
}
}
function streamOnStatusCallback(oInfo) {
if (oInfo.level == "status") {
var _local3 = oInfo.code;
if (!(_local3 === "NetStream.Play.Stop")) {
} else {
endPlayVideo(true);
}
} else if (oInfo.level == "error") {
}
}
function skipVideo() {
showProgress(false);
pStream_ns.pause();
endPlayVideo(false);
}
function endPlayVideo(allowLoop) {
showSkipButton(false);
if (!pWasPreloaded) {
var _local3 = String(pLastFilePath.split("/").pop());
Game.pGame.notifyEndLoadedVideo(_local3);
return(undefined);
}
if (allowLoop && (Game.pPreloader.getPlayLoopFlag())) {
showVideo(true);
pStream_ns.seek(0);
return(undefined);
}
var _local2 = Game.pPreloader.getPlayAfterGroupID();
if (_local2 != null) {
playPreloadedVideo(_local2);
} else {
var _local4 = Game.pPreloader.getLastPlayGroupID();
Game.pGame.notifyEndPreloadedVideo(_local4);
}
}
function stopVideo() {
showVideo(false);
showSkipButton(false);
pStream_ns.close();
}
function mute(muteFlag) {
pSound.setVolume((muteFlag ? 0 : 100));
}
function getLastFilePath() {
return(pLastFilePath);
}
function showVideo(showFlag) {
mVideo._visible = showFlag;
if (!showFlag) {
mVideo.clear();
}
}
function showSkipButton(showFlag) {
if (pAllowSkip) {
if (pLastFilePath.indexOf("swap") != -1) {
showFlag = false;
}
if (pLastFilePath.indexOf("closingMessage") != -1) {
Game.mPlayAgain_btn._visible = showFlag;
Game.mSkip_btn._visible = false;
} else {
Game.mSkip_btn._visible = showFlag;
Game.mPlayAgain_btn._visible = false;
}
}
}
function setAllowSkip(allowFlag) {
pAllowSkip = allowFlag;
}
function setAllowProgress(allowFlag) {
pAllowProgress = allowFlag;
}
function clearProgressInterval() {
if (pProgress_interval != null) {
clearInterval(pProgress_interval);
pProgress_interval = null;
}
}
function setLoadedCallback(oCallback) {
pLoadedCallback = oCallback;
}
static var BUFFER_TIME = 500;
var PROGRESS_BOX_INTERVAL = 200;
var pLastFilePath = null;
var pProgress_interval = null;
var pLoadedCallback = null;
}
Symbol 313 MovieClip [__Packages.Titles] Frame 0
class Titles extends MovieClip
{
static var TITLES_TEXT, pSpeed;
var iTitles_txt, iShadow_txt, _y, _visible, onEnterFrame, _height;
function Titles () {
super();
TITLES_TEXT = "Presenter<br>JOEL REDMOND<br><br>Joel\u2019s Assistant<br>CHI SPURGER<br><br>Camera 1<br>MAY O\u2019NAYS<br><br>Camera 2<br>SAL AMI<br><br>Camera 3<br>CHRIS P. NUGGET<br><br>Editor<br>PEPPY RONI<br><br>Script Writer<br>SOL T. PENUZ<br><br>Make-Up Artist<br>LYNN GUINI<br><br>Wardrobe Assistant<br>D. LISHUS<br><br>Catering Assistant<br>SUE SHI<br><br>Sound Engineer<br>ZOLTAN PEPPER<br><br>Producer<br>PETE ZARIA<br><br>Production Assistant<br>KAY KEN COFFEE<br><br>Assistant Director<br>FRANK FURTER<br><br>Director<br>HAMMOND EGGS<br>";
pTitles_txt = iTitles_txt;
pShadow_txt = iShadow_txt;
pTitles_txt.autoSize = true;
pTitles_txt.wordWrap = true;
pShadow_txt.autoSize = true;
pShadow_txt.wordWrap = true;
reset();
}
function reset() {
setText("");
_y = Y_OFF_SCREEN;
_visible = false;
delete onEnterFrame;
clearDelayInterval();
Game.mSigns.showSign("iCompetition", false);
}
function rollTitles() {
clearDelayInterval();
pDelay_interval = setInterval(this, "startRollTitles", TITLES_DELAY * 1000);
Game.mSigns.showSign("iCompetition", true, 0, true);
}
function startRollTitles() {
Game.oSounds.adjustSound("sIntro", 15);
Game.oSounds.loopSound("sIntro", 999);
clearDelayInterval();
setText(TITLES_TEXT);
_visible = true;
Game.mTitles.onEnterFrame = function () {
this.enterFrameUpdate();
};
}
function enterFrameUpdate() {
_y = _y - pSpeed;
if ((_y + _height) < 0) {
reset();
}
}
function clearDelayInterval() {
if (pDelay_interval != null) {
clearInterval(pDelay_interval);
}
}
function setText(text_str) {
text_str = ("<p align='center'>" + text_str) + "</p>";
pTitles_txt.htmlText = text_str;
pShadow_txt.htmlText = text_str;
pSpeed = pTitles_txt.textHeight / 225;
}
static var TITLES_DELAY = 15;
static var Y_OFF_SCREEN = 310;
var pDelay_interval = null;
var pTitles_txt = null;
var pShadow_txt = null;
}
Symbol 314 MovieClip [__Packages.Signs] Frame 0
class Signs extends MovieClip
{
var pInterval_array, pSignName_array, pIsOnLeft_array, pSign_array, pSigns, iPickCount, iChefsOffer, iFinalOffer;
function Signs () {
super();
pInterval_array = [];
pSignName_array = ["iFast", "iSlow", "iPlay", "iPickPlatter", "iPickCount", "iChefsOffer", "iMeal", "iNoMeal", "iSwap", "iNoSwap", "iCompetition", "iFinalOffer"];
pIsOnLeft_array = [true, false, true, true, true, true, true, false, true, false, true, true];
pSign_array = [];
pSigns = pSignName_array.length;
var _local4;
var _local3 = 0;
while (_local3 < pSigns) {
_local4 = this[pSignName_array[_local3]];
pSign_array[_local3] = _local4;
_local4._visible = false;
_local3++;
}
}
function showSign(signName, showFlag, delay, callback) {
var _local2 = com.tobyfreeman.flava.FlavaArray.getPos(pSignName_array, signName);
var _local4 = pInterval_array[_local2];
if (_local4 != null) {
clearInterval(_local4);
}
if ((delay != null) && (delay > 0)) {
pInterval_array[_local2] = setInterval(this, "showSign", delay * 1000, signName, showFlag, null, callback);
return(undefined);
}
var sign_mc = pSign_array[_local2];
var _local5 = pIsOnLeft_array[_local2];
var _local6;
var _local7;
var _local3;
if (showFlag) {
_local7 = EASING_ON;
_local3 = DURATION_ON;
sign_mc._visible = true;
_local6 = (_local5 ? 0 : (PANEL_RIGHT - sign_mc._width));
} else {
_local7 = EASING_OFF;
_local3 = DURATION_OFF;
_local6 = (_local5 ? (-sign_mc._width) : (PANEL_RIGHT));
}
var _local10;
var _local8 = sign_mc._x;
_local10 = new mx.transitions.Tween(sign_mc, "_x", _local7, _local8, _local6, _local3, true);
_local10.onMotionFinished = function () {
if (!showFlag) {
sign_mc._visible = false;
}
if (callback) {
var _local1 = (showFlag ? "_on" : "_off");
Game.pGame.notifySignArrived(signName + _local1);
}
};
}
function displayPicksThisRound(pickCount) {
iPickCount.gotoAndStop(pickCount + 1);
}
function setOfferText(offer_str) {
iChefsOffer.iOffer_txt.text = offer_str.toUpperCase();
}
function setFinalOfferText(offer_str) {
iFinalOffer.vFinalOfferText = offer_str.toUpperCase();
}
static var EASING_ON = mx.transitions.easing.Strong.easeOut;
static var EASING_OFF = mx.transitions.easing.Strong.easeInOut;
static var DURATION_ON = 0.6;
static var DURATION_OFF = 0.5;
static var PANEL_RIGHT = 367;
}
Symbol 315 MovieClip [__Packages.Cutaway] Frame 0
class Cutaway extends MovieClip
{
var iFlvPlayer, _visible;
function Cutaway () {
super();
pFlvPlayer = iFlvPlayer;
reset();
}
function reset() {
_visible = false;
clearDelayInterval();
pFlvPlayer.stopVideo();
pPicking = false;
}
function notifyPicking(startFlag) {
pPicking = startFlag;
if (startFlag) {
clearDelayInterval();
pDelay_interval = setInterval(this, "showCutaway", CUTAWAY_DELAY * 1000);
} else {
reset();
}
}
function showCutaway() {
if (pPicking) {
clearDelayInterval();
pFlvPlayer.playPreloadedVideo("cutaway");
}
}
function notifyFlvLoaded() {
if (pPicking) {
_visible = true;
}
}
function clearDelayInterval() {
if (pDelay_interval != null) {
clearInterval(pDelay_interval);
pDelay_interval = null;
}
}
static var CUTAWAY_DELAY = 10;
var pDelay_interval = null;
var pFlvPlayer = null;
var pPicking = false;
}
Symbol 316 MovieClip [__Packages.PanelFrame] Frame 0
class PanelFrame extends MovieClip
{
var _width, _height, scale9Grid;
function PanelFrame () {
super();
var _local5 = _width - (2 * SCALE9_W);
var _local4 = _height - (2 * SCALE9_H);
var _local3 = new flash.geom.Rectangle(SCALE9_W, SCALE9_H, _local5, _local4);
scale9Grid = _local3;
}
function animateLayout(layoutID) {
switch (layoutID) {
case Game.LAYOUT_NARROW :
case Game.LAYOUT_DOUBLE :
new mx.transitions.Tween(this, "_width", Panel.LAYOUT_EASING, _width, 400, Panel.LAYOUT_DURATION, true);
break;
case Game.LAYOUT_WIDE :
new mx.transitions.Tween(this, "_width", Panel.LAYOUT_EASING, _width, 693, Panel.LAYOUT_DURATION, true);
}
}
static var SCALE9_W = 32;
static var SCALE9_H = 32;
}
Symbol 317 MovieClip [__Packages.Panel] Frame 0
class Panel extends MovieClip
{
var mFrame, iFrame, mFrameMask, iMask, mHeader, iHeader, mBack, iBack, mPeople, iPeople, mBoardMini, iBoardMini, _x;
function Panel () {
super();
mFrame = iFrame;
mFrameMask = iMask;
mHeader = iHeader;
mBack = iBack;
mPeople = iPeople;
mBoardMini = iBoardMini;
mHeader._visible = false;
}
function animateLayout(layoutID) {
mFrame.animateLayout(layoutID);
var _local2 = null;
var _local3 = mFrameMask._width;
switch (layoutID) {
case Game.LAYOUT_NARROW :
_local2 = new mx.transitions.Tween(this, "_x", LAYOUT_EASING, _x, 150, LAYOUT_DURATION, true);
new mx.transitions.Tween(mFrameMask, "_width", LAYOUT_EASING, _local3, 367, LAYOUT_DURATION, true);
break;
case Game.LAYOUT_WIDE :
_local2 = new mx.transitions.Tween(this, "_x", LAYOUT_EASING, _x, 4, LAYOUT_DURATION, true);
new mx.transitions.Tween(mFrameMask, "_width", LAYOUT_EASING, _local3, 660, LAYOUT_DURATION, true);
break;
case Game.LAYOUT_DOUBLE :
_local2 = new mx.transitions.Tween(this, "_x", LAYOUT_EASING, _x, 4, LAYOUT_DURATION, true);
new mx.transitions.Tween(mFrameMask, "_width", LAYOUT_EASING, _local3, 367, LAYOUT_DURATION, true);
}
_local2.onMotionFinished = function () {
Game.pGame.notifyAnimComplete(Game.LAYOUT_NAME[layoutID]);
};
}
function showHeader(showFlag) {
var mHeaderLocal = mHeader;
if (showFlag) {
mHeader._visible = true;
}
var _local2 = (showFlag ? -80 : 5);
var _local3 = new mx.transitions.Tween(mHeader, "_y", HEADER_EASING, mHeader._y, _local2, 1, true);
_local3.onMotionFinished = function () {
if (showFlag) {
Game.pGame.notifyAnimComplete("HEADER_ON");
} else {
mHeaderLocal._visible = false;
}
};
}
function changeBackground(frameLabel) {
mBack.gotoAndStop(frameLabel);
var _local2 = frameLabel == "studioWide";
mPeople._visible = _local2;
mBoardMini._visible = _local2;
}
static var LAYOUT_EASING = mx.transitions.easing.Elastic.easeInOut;
static var LAYOUT_DURATION = 1;
static var HEADER_EASING = mx.transitions.easing.Strong.easeInOut;
}
Symbol 318 MovieClip [__Packages.Board] Frame 0
class Board extends MovieClip
{
var _visible, pInterval_array, pInGame_array, pMeal_array, pInGame_num, pEliminated_array, pBestMealID, _x, iHeading_txt;
function Board () {
super();
_visible = false;
pInterval_array = [];
pInGame_array = [];
pMeal_array = [];
var _local4;
var _local3 = 0;
while (_local3 < MEALS) {
_local4 = this["iMeal" + _local3];
pMeal_array[_local3] = _local4;
_local3++;
}
reset();
}
function reset() {
pInGame_num = MEALS;
pEliminated_array = [];
pBestMealID = MEALS - 1;
setHeading("REMAINING PLATTERS");
var _local3;
var _local4;
var _local2 = 0;
while (_local2 < MEALS) {
_local3 = pMeal_array[_local2];
_local4 = _local2 < (MEALS / 2);
_local3._x = (_local4 ? (X_LEFT_OFF) : (X_RIGHT_OFF));
_local3._visible = false;
pInGame_array[_local2] = true;
_local2++;
}
}
function animateLayout(layoutID) {
var mBoardLocal = this;
var _local2 = null;
switch (layoutID) {
case Game.LAYOUT_NARROW :
_local2 = new mx.transitions.Tween(this, "_x", LAYOUT_EASING, _x, 208, LAYOUT_DURATION, true);
break;
case Game.LAYOUT_WIDE :
_local2 = new mx.transitions.Tween(this, "_x", LAYOUT_EASING, _x, 70, LAYOUT_DURATION, true);
break;
case Game.LAYOUT_DOUBLE :
_visible = true;
_local2 = new mx.transitions.Tween(this, "_x", LAYOUT_EASING, _x, 407, LAYOUT_DURATION, true);
}
_local2.onMotionFinished = function () {
switch (layoutID) {
case Game.LAYOUT_NARROW :
case Game.LAYOUT_WIDE :
mBoardLocal._visible = false;
}
};
}
function showAllMeals() {
var _local6;
var _local5;
var _local4;
var _local3 = Math.floor(MEALS / 2);
var _local7 = MEALS - 1;
var _local2 = 0;
while (_local2 < MEALS) {
_local6 = _local2 < _local3;
_local5 = (_local6 ? (_local2) : ((_local2 - _local3) + 0.5));
_local4 = _local2 == _local7;
showMeal(_local2, true, 5 + (0.5 * _local5), _local4);
_local2++;
}
}
function showMeal(mealID, showFlag, delay, callback) {
var _local5 = pInterval_array[mealID];
if (_local5 != null) {
clearInterval(_local5);
}
if ((delay != null) && (delay > 0)) {
pInterval_array[mealID] = setInterval(this, "showMeal", delay * 1000, mealID, showFlag, null, callback);
return(undefined);
}
var meal_mc = pMeal_array[mealID];
var _local3 = mealID < (MEALS / 2);
var _local4;
if (showFlag) {
meal_mc._visible = true;
_local4 = (_local3 ? (X_LEFT_ON) : (X_RIGHT_ON));
} else {
_local4 = (_local3 ? (X_LEFT_OFF) : (X_RIGHT_OFF));
}
var _local6;
var _local7 = meal_mc._x;
_local6 = new mx.transitions.Tween(meal_mc, "_x", MEAL_EASING, _local7, _local4, MEAL_DURATION, true);
_local6.onMotionFinished = function () {
if (!showFlag) {
meal_mc._visible = false;
}
if (callback) {
var _local1 = (showFlag ? "_ON" : "_OFF");
Game.pGame.notifyAnimComplete("BOARD_MEAL" + _local1);
}
};
}
function eliminateMeal(mealID) {
pInGame_array[mealID] = false;
pInGame_num--;
pEliminated_array.push(mealID);
showMeal(mealID, false);
}
function calculateOffer() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < MEALS) {
if (pInGame_array[_local2]) {
_local3 = _local3 + _local2;
}
_local2++;
}
var _local4 = Math.floor(_local3 / pInGame_num);
return(_local4);
}
function checkEliminatedBestItem() {
var _local2 = com.tobyfreeman.flava.FlavaArray.getPos(pEliminated_array, pBestMealID) != null;
pEliminated_array = [];
updateBestMealID();
return(_local2);
}
function updateBestMealID() {
while (!pInGame_array[pBestMealID]) {
pBestMealID--;
}
return(pBestMealID);
}
function animateLastMeal(callbackFlag) {
var _local2 = updateBestMealID();
var _local4 = pMeal_array[_local2];
var yoyoCount = YOYO_COUNT;
var _local3 = _local4._x;
var _local5 = ((_local2 < (MEALS / 2)) ? -5 : 4);
var mealTween = (new mx.transitions.Tween(_local4, "_x", YOYO_EASING, _local3, _local3 + _local5, YOYO_DURATION, true));
mealTween.onMotionFinished = function () {
if ((--yoyoCount) > 0) {
mealTween.yoyo();
} else if (callbackFlag) {
Game.pGame.notifyAnimComplete("LAST_MEAL_YOYO");
}
};
return(_local2);
}
function setHeading(heading_str) {
iHeading_txt.text = heading_str;
}
function getMealsInGame() {
return(pInGame_num);
}
function getOtherMealID(mealID) {
var _local2 = 0;
while (_local2 < MEALS) {
if (pInGame_array[_local2] && (_local2 != mealID)) {
break;
}
_local2++;
}
return(_local2);
}
static var LAYOUT_EASING = mx.transitions.easing.Elastic.easeInOut;
static var MEAL_EASING = mx.transitions.easing.Strong.easeInOut;
static var YOYO_EASING = mx.transitions.easing.Regular.easeInOut;
static var LAYOUT_DURATION = 1;
static var MEAL_DURATION = 1;
static var YOYO_DURATION = 0.3;
static var YOYO_COUNT = 25;
static var X_LEFT_OFF = -113;
static var X_LEFT_ON = 16;
static var X_RIGHT_ON = 146;
static var X_RIGHT_OFF = 273;
static var MEALS = 14;
}
Symbol 27 MovieClip Frame 1
stop();
Symbol 32 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 1
stop();
Symbol 38 MovieClip Frame 1
stop();
Symbol 41 MovieClip Frame 1
stop();
Symbol 44 MovieClip Frame 1
stop();
Symbol 47 MovieClip Frame 1
stop();
Symbol 50 MovieClip Frame 1
stop();
Symbol 55 MovieClip Frame 1
stop();
Symbol 58 MovieClip Frame 1
stop();
Symbol 61 MovieClip Frame 1
stop();
Symbol 64 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 1
stop();
Symbol 70 MovieClip Frame 1
stop();
Symbol 73 MovieClip Frame 1
stop();
Symbol 77 MovieClip [_board mc] Frame 1
#initclip 34
Object.registerClass("_board mc", Board);
#endinitclip
stop();
Symbol 80 MovieClip Frame 1
stop();
Symbol 85 MovieClip Frame 1
stop();
Symbol 86 MovieClip [_boardMini mc] Frame 1
#initclip 25
Object.registerClass("_boardMini mc", BoardMini);
#endinitclip
stop();
Symbol 115 MovieClip Frame 33
iButton.enabled = true;
iButton._visible = true;
Symbol 115 MovieClip Frame 34
stop();
Symbol 115 MovieClip Frame 40
stop();
Symbol 115 MovieClip Frame 53
if (!eliminated) {
gotoAndPlay ("picked");
} else {
gotoAndStop ("off");
}
Symbol 115 MovieClip Frame 92
stop();
Symbol 115 MovieClip Frame 131
stop();
Symbol 120 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 1
stop();
Symbol 130 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 1
stop();
Symbol 140 MovieClip Frame 1
stop();
Symbol 145 MovieClip Frame 1
stop();
Symbol 150 MovieClip Frame 1
stop();
Symbol 155 MovieClip Frame 1
stop();
Symbol 160 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 1
stop();
Symbol 170 MovieClip Frame 1
stop();
Symbol 175 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 1
stop();
Symbol 182 MovieClip Frame 1
stop();
Symbol 183 MovieClip Frame 1
stop();
Symbol 183 MovieClip Frame 14
gotoAndPlay ("moving");
Symbol 184 MovieClip [_people mc] Frame 1
#initclip 26
Object.registerClass("_people mc", People);
#endinitclip
stop();
Symbol 186 MovieClip [_flvPlayer mc] Frame 1
#initclip 27
Object.registerClass("_flvPlayer mc", FlvPlayer);
#endinitclip
stop();
Symbol 189 MovieClip [_titles mc] Frame 1
#initclip 28
Object.registerClass("_titles mc", Titles);
#endinitclip
stop();
Symbol 194 MovieClip Frame 1
stop();
Symbol 199 Button
on (rollOver) {
gotoAndStop ("over");
Game.oSounds.startSound("sRoll", null, 70);
}
on (rollOut, dragOut) {
gotoAndStop ("out");
}
on (press) {
gotoAndStop ("press");
}
on (release) {
gotoAndStop ("out");
_parent.showSign("iNoSwap", false, null, true);
_parent.showSign("iSwap", false);
Game.oSounds.stopSound("sTension");
Game.oSounds.startSound("sTensionEnd", 30);
Game.oSounds.startSound("sClick", null, 70);
}
Symbol 200 MovieClip Frame 1
stop();
Symbol 203 Button
on (rollOver) {
gotoAndStop ("over");
Game.oSounds.startSound("sRoll", null, -70);
}
on (rollOut, dragOut) {
gotoAndStop ("out");
}
on (press) {
gotoAndStop ("press");
}
on (release) {
gotoAndStop ("out");
_parent.showSign("iSwap", false, null, true);
_parent.showSign("iNoSwap", false);
Game.oSounds.stopSound("sTension");
Game.oSounds.startSound("sTensionEnd", 30);
Game.oSounds.startSound("sClick", null, -70);
}
Symbol 204 MovieClip Frame 1
stop();
Symbol 207 Button
on (rollOver) {
gotoAndStop ("over");
Game.oSounds.startSound("sRoll", null, 70);
}
on (rollOut, dragOut) {
gotoAndStop ("out");
}
on (press) {
gotoAndStop ("press");
}
on (release) {
gotoAndStop ("out");
_parent.showSign("iNoMeal", false, null, true);
_parent.showSign("iMeal", false);
_parent.showSign("iChefsOffer", false);
Game.oSounds.stopSound("sTension");
Game.oSounds.startSound("sTensionEnd", 30);
Game.oSounds.startSound("sClick", null, 70);
}
Symbol 208 MovieClip Frame 1
stop();
Symbol 211 Button
on (rollOver) {
gotoAndStop ("over");
Game.oSounds.startSound("sRoll", null, -70);
}
on (rollOut, dragOut) {
gotoAndStop ("out");
}
on (press) {
gotoAndStop ("press");
}
on (release) {
gotoAndStop ("out");
_parent.showSign("iMeal", false, null, true);
_parent.showSign("iNoMeal", false);
_parent.showSign("iChefsOffer", false);
Game.oSounds.adjustSound("sTension", 20);
Game.oSounds.startSound("sClick", null, -70);
}
Symbol 212 MovieClip Frame 1
stop();
Symbol 216 MovieClip Frame 1
stop();
Symbol 223 MovieClip Frame 1
stop();
Symbol 226 MovieClip Frame 1
stop();
Symbol 229 MovieClip Frame 1
stop();
Symbol 232 Button
on (rollOver) {
gotoAndStop ("over");
Game.oSounds.startSound("sRoll", null, 0);
}
on (rollOut, dragOut) {
gotoAndStop ("out");
}
on (press) {
gotoAndStop ("press");
}
on (release) {
gotoAndStop ("out");
_parent.showSign("iPlay", false, null, true);
Game.oSounds.stopSound("sIntro");
Game.oSounds.adjustSound("sTension", 20);
Game.oSounds.loopSound("sTension", 2);
Game.oSounds.startSound("sClick", null, 0);
}
Symbol 233 MovieClip Frame 1
stop();
Symbol 236 Button
on (rollOver) {
gotoAndStop ("over");
Game.oSounds.startSound("sRoll", null, -70);
}
on (rollOut, dragOut) {
gotoAndStop ("out");
}
on (press) {
gotoAndStop ("press");
}
on (release) {
gotoAndStop ("out");
_parent.showSign("iSlow", false, null, true);
_parent.showSign("iFast", false);
Game.oSounds.adjustSound("sIntro", 20);
Game.oSounds.startSound("sClick", null, 70);
}
Symbol 237 MovieClip Frame 1
stop();
Symbol 240 Button
on (rollOver) {
gotoAndStop ("over");
Game.oSounds.startSound("sRoll", null, -70);
}
on (rollOut, dragOut) {
gotoAndStop ("out");
}
on (press) {
gotoAndStop ("press");
}
on (release) {
gotoAndStop ("out");
_parent.showSign("iFast", false, null, true);
_parent.showSign("iSlow", false);
Game.oSounds.adjustSound("sIntro", 20);
Game.oSounds.startSound("sClick", null, -70);
}
Symbol 241 MovieClip Frame 1
stop();
Symbol 242 MovieClip [__signs mc] Frame 1
#initclip 29
Object.registerClass("__signs mc", Signs);
#endinitclip
stop();
Symbol 245 MovieClip [_cutaway FlvPlayer mc] Frame 1
#initclip 30
Object.registerClass("_cutaway FlvPlayer mc", FlvPlayer);
#endinitclip
Symbol 247 MovieClip Frame 1
stop();
Symbol 248 MovieClip [_cutaway mc] Frame 1
#initclip 31
Object.registerClass("_cutaway mc", Cutaway);
#endinitclip
stop();
Symbol 275 MovieClip Frame 1
stop();
Symbol 276 MovieClip [_frame mc] Frame 1
#initclip 32
Object.registerClass("_frame mc", PanelFrame);
#endinitclip
stop();
Symbol 279 Button
on (rollOver) {
Game.oSounds.startSound("sRoll", null, 50);
}
on (release) {
Game.pGame.enterCompetition();
Game.oSounds.startSound("sClick", null, 50);
}
Symbol 282 Button
on (rollOver) {
Game.oSounds.startSound("sRoll", null, 50);
}
on (release) {
Game.pGame.skipVideo();
Game.oSounds.startSound("sClick", null, 50);
}
Symbol 285 Button
on (rollOver) {
Game.oSounds.startSound("sRoll", null, 50);
}
on (release) {
Game.pGame.skipVideo();
Game.oSounds.startSound("sClick", null, 50);
}
Symbol 291 MovieClip Frame 1
stop();
Symbol 292 MovieClip [_panel mc] Frame 1
#initclip 33
Object.registerClass("_panel mc", Panel);
#endinitclip
iProgressBox._visible = false;
iSkip_btn._visible = false;
iPlayAgain_btn._visible = false;
stop();