Frame 1
function Grab_decode(toDecode) {
if ((toDecode == undefined) || (toDecode == "")) {
return("");
}
_root.Grab_equalSign = false;
var _local1 = new Array();
_local1 = Base64toBinary(toDecode);
var _local2 = "decode";
var _local3 = XOR_decode(_local2, _local1, _root.secWord);
return(_local3);
}
function Grab_encode(toEncode) {
var _local2 = toEncode;
if ((_local2 == undefined) || (_local2 == "")) {
return("");
}
var _local3 = "encode";
var _local1 = new Array();
_local1 = XOR_encode(_local3, _local2, _root.secWord);
var out = intToBin_enc(_local1);
return(out);
}
function encodeBase64(n) {
var _local1 = base64.charAt(n);
return(_local1);
}
function XOR_encode(code, myString, secWord) {
var len = (myString.length - 1);
var secLen = (secWord.length - 1);
var _local2 = -1;
var _local3;
var charString;
var foo;
var xor_enc_array = new Array();
var _local1 = 0;
while (_local1 <= len) {
_local2++;
if (_local2 > secLen) {
_local2 = 0;
}
_local3 = secWord.charCodeAt(_local2);
charString = myString.charCodeAt(_local1);
foo = _local3 ^ charString;
xor_enc_array[_local1] = foo;
_local1++;
}
return(xor_enc_array);
}
function XOR_decode(code, myArray, secWord) {
var len = (myArray.length - 1);
var secLen = (secWord.length - 1);
var _local2 = -1;
var _local3;
var charString;
var foo;
var encoded = "";
var xor_enc_array = new Array();
var _local1 = 0;
while (_local1 <= len) {
_local2++;
if (_local2 > secLen) {
_local2 = 0;
}
_local3 = secWord.charCodeAt(_local2);
charString = myArray[_local1];
foo = _local3 ^ charString;
encoded = encoded + String.fromCharCode(foo);
_local1++;
}
if (_root.Grab_equalSign) {
encoded = encoded.substring(0, len);
}
return(encoded);
}
function toBinary(val) {
var _local1 = val;
var _local3 = "";
var _local2;
var p;
var bit = 0;
while (bit < 8) {
_local2 = _local1 % 2;
_local2 = _local2.toString();
p = _local2.indexOf(".");
if (p != -1) {
_local2 = _local2.substring(0, p);
}
_local2 = Number(_local2);
if (_local2 == 0) {
_local3 = _local3 + "0";
} else {
_local3 = _local3 + "1";
}
_local1 = _local1 / 2;
_local1 = _local1.toString();
p = _local1.indexOf(".");
if (p != -1) {
_local1 = _local1.substring(0, p);
}
_local1 = Number(_local1);
bit++;
}
var tmp = _local3;
_local3 = "";
var i = 7;
while (i >= 0) {
_local3 = _local3 + tmp.slice(i, i + 1);
i--;
}
return(_local3);
}
function intToBin_enc(codedArray) {
var len = (codedArray.length - 1);
var _local2;
var _local3;
var binString = "";
var _local1 = 0;
while (_local1 <= len) {
_local2 = codedArray[_local1];
_local3 = toBinary(_local2);
binString = binString + _local3;
_local1++;
}
var out = binToBase64(binString);
return(out);
}
function binToBase64(bin) {
var len = bin.length;
var j = 0;
var _local2 = new Array();
var z = 0;
var Base64OutString;
var i = 0;
while (i <= (len - 1)) {
if (j < 6) {
j++;
} else {
j = 1;
z++;
}
if (_local2[z] == undefined) {
_local2[z] = "";
}
_local2[z] = _local2[z] + bin.charAt(i);
i++;
}
if (j == 2) {
needed = 2;
}
if (j == 6) {
needed = 0;
}
if (j == 4) {
needed = 1;
}
var binLen = _local2.length;
var _local1 = 0;
while (_local1 <= (binLen - 1)) {
var elemLen = (_local2[_local1].length - 1);
if (elemLen < 5) {
var addN = (4 - elemLen);
var _local3 = 0;
while (_local3 <= addN) {
if (_local2[_local1] == undefined) {
_local2[_local1] = "";
}
_local2[_local1] = _local2[_local1] + "0";
_local3++;
}
}
_local1++;
}
var out = bin6ToInt(_local2, needed);
return(out);
}
function bin6ToInt(myArray, needed) {
var len = myArray.length;
var n;
var _local2;
var outArray = new Array();
var t = 0;
var digit;
var binLen;
var Base64OutString = "";
var _local1 = 0;
while (_local1 <= (len - 1)) {
n = myArray[_local1];
outArray[_local1] = 0;
digitVal = 1;
binLen = n.length;
var _local3 = binLen - 1;
while (_local3 >= 0) {
_local2 = n.charAt(_local3);
_local2 = Number(_local2);
_local2 = _local2 * digitVal;
if (outArray[_local1] == undefined) {
outArray[_local1] = "";
}
outArray[_local1] = outArray[_local1] + _local2;
digitVal = digitVal * 2;
_local3--;
}
Base64OutString = Base64OutString + encodeBase64(outArray[_local1]);
_local1++;
}
var kk = needed;
while (kk >= 1) {
Base64OutString = Base64OutString + "-";
kk--;
}
return(Base64OutString);
}
function Base64toBinary(sentText) {
var _local3;
var _local2 = new Array();
var binString = "";
var _local1 = 0;
while (_local1 <= (sentText.length - 1)) {
_local3 = sentText.charAt(_local1);
if (_local3 != "-") {
_local2[_local1] = decodeBase64(_local3);
_local2[_local1] = toBinary(_local2[_local1]);
_local2[_local1] = _local2[_local1].substring(2);
binString = binString + _local2[_local1];
} else {
_root.Grab_equalSign = true;
}
_local1++;
}
var decodedArray = new Array();
decodedArray = sixToEightBit(binString);
return(decodedArray);
}
function sixToEightBit(binString) {
var j = 0;
var _local2 = 0;
var _local3 = new Array();
var len = (binString.length - 1);
var _local1 = 0;
while (_local1 <= len) {
if (j < 8) {
j++;
} else {
j = 1;
_local2++;
}
var char = binString.charAt(_local1);
if (_local3[_local2] == undefined) {
_local3[_local2] = "";
}
_local3[_local2] = _local3[_local2] + char;
_local1++;
}
var decodedArray = new Array();
decodedArray = binToInt8(_local3, 0);
return(decodedArray);
}
function binToInt8(myArray, needed) {
var len = myArray.length;
var n;
var _local1;
var outArray = new Array();
var k;
var digit;
var binLen;
var decoded;
var digitVal;
var _local2 = 0;
while (_local2 <= (len - 1)) {
n = myArray[_local2];
digitVal = 1;
binLen = n.length;
var _local3 = binLen - 1;
while (_local3 >= 0) {
_local1 = n.charAt(_local3);
_local1 = Number(_local1);
_local1 = _local1 * digitVal;
if (outArray[_local2] == undefined) {
outArray[_local2] = 0;
}
outArray[_local2] = outArray[_local2] + _local1;
digitVal = digitVal * 2;
_local3--;
}
_local2++;
}
return(outArray);
}
function intToText(decodedArray) {
var len = (decodedArray.length - 1);
var _local3 = "";
var _local2;
var _local1 = 0;
while (_local1 <= len) {
_local2 = decodedArray[_local1];
_local3 = _local3 + String.fromCharCode(_local2);
_local1++;
}
return(_local3);
}
function decodeBase64(c) {
var _local1 = base64.indexOf(c);
return(_local1);
}
base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._";
secWord = "5b374c65114dddbbb6ace41679100107932a";
gameID = "112D4986-83BD-4406-BF4B-0C794E68FEC9";
gameIDencoded = Grab_encode(gameID);
trialURLdecoded = Grab_decode(grab_trialURL);
buyURLdecoded = Grab_decode(grab_buyURL);
if (grab_ccode == undefined) {
grab_ccode = "";
}
function loadingComplete() {
rootMain.gotoAndPlay("startgame");
}
function getGameSettings() {
var fileNumber;
var _local1 = new XML();
_local1.onLoad = loadGameSettingsXML;
_local1.ignoreWhite = true;
_local1.load(gameFilesFolder + "/FW_Settings.xml");
}
function loadGameSettingsXML() {
var _local1 = this.firstChild;
setGameSettingsVariable(_local1.childNodes[0].nodeName, _local1.childNodes[0].childNodes[0].nodeValue);
setGameSettingsVariable(_local1.childNodes[1].nodeName, _local1.childNodes[1].childNodes[0].nodeValue);
setGameSettingsVariable(_local1.childNodes[2].nodeName, _local1.childNodes[2].childNodes[0].nodeValue);
setGameSettingsVariable(_local1.childNodes[3].nodeName, _local1.childNodes[3].childNodes[0].nodeValue);
fscommand ("showmenu", "false");
scoreBroadcastTime_int = 0;
}
function setGameSettingsVariable(nodeName, nodeValue) {
var _local1 = nodeValue;
switch (nodeName) {
case "ZoneAPI" :
rootMain.isZoneAPI_bool = Boolean(_local1);
return;
case "SetCheat" :
rootMain.isCheatsEnabled_bool = Boolean(_local1);
return;
case "ScoreBroadcastTime" :
rootMain.scoreBroadcastTime_int = Number(_local1);
return;
case "DownloadURL" :
rootMain.fullVersionURL_string = String(_local1);
}
}
function downloadPhrases() {
var fileNumber;
var _local1 = new XML();
_local1.onLoad = loadXMLPhrases;
_local1.ignoreWhite = true;
_local1.load(gameFilesFolder + "/phrases.xml");
}
function loadXMLPhrases() {
var _local1;
var _local3 = this.firstChild;
if (_local3.childNodes.length < maxPhrases_int) {
maxPhrases_int = _local3.childNodes.length;
}
phrases_string = new Array(maxPhrases_int);
categories_string = new Array(maxPhrases_int);
var _local2;
_local1 = 0;
while (_local1 < maxPhrases_int) {
_local2 = _local3.childNodes[_local1];
phrases_string[_local1] = _local2.childNodes[0].childNodes[0].nodeValue;
categories_string[_local1] = _local2.childNodes[1].childNodes[0].nodeValue;
_local1++;
}
randomise();
}
function randomise() {
var tempPhrase;
var _local3;
var iterations = 1;
var _local1;
var j;
var _local2;
j = 0;
while (j < iterations) {
_local1 = 0;
while (_local1 < maxPhrases_int) {
_local2 = Math.floor(Math.random() * maxPhrases_int);
tempPhrase = phrases_string[_local1];
_local3 = categories_string[_local1];
phrases_string[_local1] = phrases_string[_local2];
categories_string[_local1] = categories_string[_local2];
phrases_string[_local2] = tempPhrase;
categories_string[_local2] = _local3;
_local1++;
}
j++;
}
this.isLoaded_bool = true;
}
function getPhrase(roundNumber) {
return(phrases_string[(rootMain.gameSessionPhraseIndex_int + roundNumber) - 1]);
}
function getCategory(roundNumber) {
return(categories_string[(rootMain.gameSessionPhraseIndex_int + roundNumber) - 1]);
}
function odd(num) {
var _local1 = num;
_local1 = parseInt(_local1);
if ((_local1 % 2) == 0) {
return(false);
}
return(true);
}
_global.rootMain = this;
Stage.scaleMode = "noScale";
var gameFilesFolder = assetURL;
var isSound_bool = true;
var game_object = null;
var isPaused_bool = false;
var curDepth_int = 0;
var gameText_string = new Array();
var phraseInput_string;
var soundToPlay;
var isShowPopups_bool = true;
var gameSessionPhraseIndex_int = 0;
var alwaysCorrectGuess_bool = false;
var createSomeWords_bool = false;
var createdWord_string = "TABLESAQESTIONREADERNBANDAIDBOTTOMIEPARROTSZAPSAME";
var mustSetPowerups_bool = false;
var wordScoreForAll = "";
rootMain._focusrect = false;
var isGameBreakSupport_bool = true;
var fullVersionURL_string = "";
var isZoneAPI_bool = false;
var isCheatsEnabled_bool = false;
var isGameReady_bool = false;
var scoreBroadcastTime_int;
var maxPhrases_int = 250;
var isLoaded_bool = false;
var phrases_string;
var categories_string;
rootMain.coLogo_mc.loadMovie(gameFilesFolder + "/CoLogo2.jpg", "GET");
rootMain.createEmptyMovieClip("dict_mc", ++curDepth_int);
rootMain.dict_mc.loadMovie(gameFilesFolder + "/FW_Dictionary.swf", "GET");
downloadPhrases();
getGameSettings();
Frame 2
function playSound(soundID, loopNumber) {
var _local1 = loopNumber;
if (rootMain.isSound_bool) {
rootMain.soundToPlay = new Sound();
rootMain.soundToPlay.attachSound(soundID);
if ((_local1 != undefined) || (_local1 != null)) {
rootMain.soundToPlay.start(0.04, _local1);
} else {
rootMain.soundToPlay.start();
}
}
}
function stopLastSound() {
rootMain.soundToPlay.stop();
}
function downloadFullVersion() {
if (((rootMain.fullVersionURL_string == undefined) || (rootMain.fullVersionURL_string == null)) || (rootMain.fullVersionURL_string == "")) {
getURL (FULLVERSION_URL);
} else {
getURL (rootMain.fullVersionURL_string);
}
}
function showMessageDialog(messageType_string) {
rootMain.gameScreen_mc.messages_mc.gotoAndStop(messageType_string);
}
function getCharFromNumber(letter_int) {
return(String.fromCharCode(letter_int + 64));
}
function updateWordScore(word_string, score_int) {
var _local1 = word_string;
if (_local1 == undefined) {
_local1 = "";
}
rootMain.gameScreen_mc.currentWord_mc.update(_local1, score_int);
}
function updateCounters(turns_int, score_int, rounds_int) {
var _local1 = turns_int;
var _local2 = score_int;
var _local3 = rounds_int;
if ((_local1 != undefined) && (_local1 != null)) {
rootMain.gameScreen_mc.turnCounter_mc.flipNumbers(_local1);
}
if ((_local2 != undefined) && (_local2 != null)) {
rootMain.gameScreen_mc.scoreCounter_mc.flipNumbers(_local2);
}
if ((_local3 != undefined) && (_local3 != null)) {
rootMain.gameScreen_mc.roundCounter_mc.flipNumbers(_local3);
}
}
function isRandomChance(percent_int) {
return(Math.ceil(Math.random() * 100) < percent_int);
}
function getRandomIndexedArray(len) {
var _local3 = len;
var _local1 = new Array();
i = 0;
while (i < _local3) {
_local1.push(i);
i++;
}
var n = 3;
var i;
var j;
var temp;
var _local2;
j = 0;
while (j < n) {
i = 0;
while (i < _local3) {
_local2 = Math.floor(Math.random() * _local3);
temp = _local1[i];
_local1[i] = _local1[_local2];
_local1[_local2] = temp;
i++;
}
j++;
}
return(_local1);
}
function showHelp() {
if (!rootMain.isPaused_bool) {
rootMain.gameScreen_mc.messages_mc.gotoAndStop("help");
}
}
function keyPressed() {
if ((!rootMain.isPaused_bool) && (!rootMain.game_object.isShuffling_bool)) {
var _local1 = Key.getCode();
switch (_local1) {
case 32 :
rootMain.game_object.removeChainLetter(0, true);
return;
case 8 :
rootMain.game_object.removeChainLetter(rootMain.game_object.letterChain_object.getLastLetter().chainIndex_int - 1);
}
}
}
function getText(line_int) {
return(rootMain.gameText_string[line_int]);
}
function flipCheatWords() {
rootMain.createdWord_string = rootMain.createdWord_string.toUpperCase();
var _local2 = rootMain.createdWord_string.length;
var _local1 = 0;
xIndex = 0;
while (xIndex < GRID_SIZE) {
yIndex = 0;
while (yIndex < GRID_SIZE) {
if (_local1 < _local2) {
letter_string = rootMain.createdWord_string.charAt(_local1);
} else {
letter_string = rootMain.game_object.letterUtils_object.getRandomLetter(xIndex, yIndex);
}
if ((letter_string.charCodeAt(0) >= 65) && (letter_string.charCodeAt(0) <= 90)) {
rootMain.game_object.grid_object[xIndex][yIndex].flipLetter(letter_string.charCodeAt(0) - 64);
} else {
rootMain.game_object.grid_object[xIndex][yIndex].flipLetter(rootMain.game_object.letterUtils_object.getRandomLetter(xIndex, yIndex));
}
_local1++;
yIndex++;
}
xIndex++;
}
}
function GameObject(theGameGrid_mc, theDict_mc, thePhrases_mc) {
this.grid_mc = theGameGrid_mc;
this.dict_mc = theDict_mc;
this.phrases_mc = thePhrases_mc;
this.letterUtils_object = new LetterUtilsObject(this);
this.letterChain_object = new LetterChainObject();
this.grid_object = new Array();
this.firstTimeGamePlayed = true;
this.initStartVariables();
var _local3;
var _local2;
var letterCount_int = 1;
var _local1;
this.letterHighlighter_mc = this.grid_mc.attachMovie("LetterHighlighter", "letterHighlighter_mc", HIGHLIGHTER_DEPTH);
this.letterHighlighter_mc._visible = false;
this.letterHighlighter_mc._alpha = 23;
this.letterRing_mc = this.grid_mc.attachMovie("LetterRing", "letterRing_mc", LETTERRING_DEPTH);
this.letterRing_mc._visible = false;
rootMain.curDepth_int = FLIPLETTER_DEPTH;
_local3 = 0;
while (_local3 < GRID_SIZE) {
this.grid_object.push(new Array());
_local2 = 0;
while (_local2 < GRID_SIZE) {
_local1 = new LetterObject(this.grid_mc.attachMovie("FlipLetter", "flipLetter_" + (letterCount_int++), rootMain.curDepth_int++));
_local1.xPos_int = _local3;
_local1.yPos_int = _local2;
_local1.clip_mc._x = _local3 * LETTER_X_SPACING;
_local1.clip_mc._y = _local2 * LETTER_Y_SPACING;
_local1.clip_mc.tabEnabled = false;
_local1.clip_mc.x_int = _local3;
_local1.clip_mc.y_int = _local2;
this.grid_object[_local3][_local2] = _local1;
_local2++;
}
_local3++;
}
}
function LetterObject(letterClip_mc) {
var _local1 = this;
_local1.letter_int = 0;
_local1.letter_string = "";
_local1.status_int = LETTER_AVAILABLE;
_local1.chainIndex_int = -1;
_local1.clip_mc = letterClip_mc;
_local1.powerupClip_mc = null;
_local1.powerupType_int = LETTER_POWERUP_NONE;
_local1.xPos_int = -1;
_local1.yPos_int = -1;
}
function LetterChainObject() {
var _local1 = this;
_local1.letters_object = new Array();
_local1.word_string = "";
_local1.isWord_bool = false;
_local1.score_int = 0;
_local1.isPowerup_bool = false;
_local1.chainSize_int = 0;
_local1.connectors_mc = new Array();
_local1.scoreMultiplier_int = 0;
}
function LetterUtilsObject(game_object) {
var _local1 = this;
_local1.game_object = game_object;
_local1.aLetters = new Array(4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 5, 4, 5, 4, 4, 1, 5, 5, 5, 4, 2, 2, 1, 3, 1);
_local1.aValues = new Array(0, 1, 3, 3, 2, 1, 4, 2, 4, 1, 7, 5, 1, 2, 1, 1, 3, 8, 1, 1, 1, 2, 4, 4, 9, 5, 9);
_local1.aMaxes = new Array(0, 9, 5, 5, 6, 9, 6, 5, 5, 9, 2, 3, 7, 7, 8, 9, 4, 1, 8, 8, 8, 9, 2, 4, 1, 4, 1);
_local1.aDists = new Array(0, 3, 5, 5, 4, 5, 4, 5, 1, 1, 1, 1, 6, 6, 6, 5, 5, 0, 6, 6, 6, 2, 1, 2, 0, 1, 0);
_local1.randomLetters_int = new Array(256);
_local1.randomLettersCount_int = 0;
_local1.randomConsonantLetters_int = new Array(256);
_local1.randomConsonantLettersCount_int = 0;
_local1.firstTimeSet_bool = false;
_local1.nLastLetter = 0;
_local1.lastConsonantLetter = 0;
_local1.nLastVowel = 0;
_local1.nPhraseCounter = 7;
}
function PhraseObject(phrase, category) {
var _local1 = this;
_local1.phrase_string = _local1.decrypt(phrase);
_local1.phrase_string = _local1.phrase_string.toUpperCase();
_local1.category_string = _local1.decrypt(category);
_local1.phraseLetters_object = new Array();
_local1.randomPhraseLetterIndices_int;
_local1.numberOfLetters_int;
_local1.hiddenLetters_int;
_local1.sLine;
_local1.phaseDisplayFull = false;
_local1.phaseOverflow = false;
_local1.phraseRevealed_bool = false;
_local1.isFlipping_bool = false;
_local1.tracker_object = new TrackerObject();
_local1.setupPhraseLetters();
_local1.revealIntervalID;
_local1.flyLetterIndex = -1;
_local1.flyIntervalID = 0;
_local1.leven_object = new LevenshteinDistanceObject();
}
function PhraseLetterObject(letter_int) {
var _local1 = this;
_local1.isDisplayed_bool = false;
_local1.letter_int = letter_int;
_local1.letter_string = String.fromCharCode(64 + _local1.letter_int);
_local1.clip_mc = null;
}
function loadText() {
rootMain.gameText_string[0] = "FLIP WORDS";
rootMain.gameText_string[1] = "The web version of FlipWords does not support words with more than six letters in them. Get the full version now to make bigger words and use the larger dictionary.";
rootMain.gameText_string[2] = "Click on the red letters to link them into words. The first letter of valid words will be used to reveal letters in the hidden phrase. If you can't find any words click the shuffle button.";
}
function TrackerObject() {
this.clear();
}
function ProjectileObject() {
this.m_bInitialized = false;
}
function LevenshteinDistanceObject() {
}
String.prototype.setCharAt = function (index, charToAdd) {
var _local2 = this;
var _local3 = index;
var _local1 = new String();
i = 0;
while (i < _local2.length) {
if (i == _local3) {
_local1 = _local1 + charToAdd;
} else {
_local1 = _local1 + _local2.charAt(i);
}
i++;
}
return(_local1);
};
String.prototype.setLength = function (length_int) {
var _local2 = length_int;
var _local3 = this;
var _local1 = new String();
i = 0;
while (i < _local2) {
_local1 = _local1 + _local3.charAt(i);
i++;
}
return(_local1);
};
_global.TURNS_START = 20;
_global.ENGLISH = 1;
_global.WORDLENGTH_LIMIT = 6;
_global.FULLVERSION_URL = "http://download.hipsoft.com/hip/FlipWordsSetup.exe";
_global.NUM_LETTERS = 26;
_global.GRID_SIZE = 7;
_global.LETTER_WIDTH = 37;
_global.LETTER_X_SPACING = 35.8;
_global.LETTER_Y_SPACING = 36.5;
_global.GRID_X_END = 250.6;
_global.GRID_Y_END = 255.5;
_global.LETTERRING_DEPTH = 99;
_global.FLIPLETTER_DEPTH = 100;
_global.HIGHLIGHTER_DEPTH = 30005;
_global.DELAYFLIP_DEPTH = 30011;
_global.DELAYFLY_DEPTH = 30012;
_global.DELAYGUESSMETER_DEPTH = 30013;
_global.CONNECTOR_DEPTH = 30100;
_global.FLYINGCHAR_DEPTH = 31100;
_global.LETTER_AVAILABLE = 1;
_global.LETTER_SELECTED = 2;
_global.MOUSE_PRESSED = 1;
_global.MOUSE_DRAGGED = 2;
_global.LETTER_BLANK = 0;
_global.LETTER_A = 1;
_global.LETTER_Z = 26;
_global.MAX_POWERUPS = 8;
_global.NO_POWERUP = 0;
_global.LETTER_POWERUP_NONE = 0;
_global.LETTER_POWERUP_VOWEL_A = 1;
_global.LETTER_POWERUP_VOWEL_E = 2;
_global.LETTER_POWERUP_VOWEL_I = 3;
_global.LETTER_POWERUP_VOWEL_O = 4;
_global.LETTER_POWERUP_VOWEL_U = 5;
_global.LETTER_POWERUP_VOWEL_Y = 6;
_global.LETTER_POWERUP_POINTS_2X = 7;
_global.LETTER_POWERUP_POINTS_3X = 8;
_global.MAX_SPIN_FRAMES = 52;
_global.GAME_HEIGHT = 384;
_global.FLYIN_STAGGER_TIME = 65;
_global.FLYOUT_STAGGER_TIME = 50;
_global.START_FLIPPHRASELETTER_X = -182;
_global.START_FLIPPHRASELETTER_Y = 20;
_global.FINISH_FLIPPHRASELETTER_X = 355;
_global.FINISH_FLIPPHRASELETTER_Y = 10;
_global.MAX_ROUNDS = 10;
_global.TOTAL_ROUNDS = 250;
GameObject.prototype.initStartVariables = function () {
var _local1 = this;
_local1.currentScore_int = 0;
_local1.currentTurns_int = TURNS_START;
_local1.currentRound_int = 1;
_local1.currentPowerupsOnGrid_int = 0;
_local1.currentPlayingTime_int = 0;
_local1.gameStartTime_int = 0;
_local1.bestWordScore_int = 0;
_local1.bestWord_string = "";
_local1.guessMeterTotal_int;
_local1.flyingCharDepth_int = FLYINGCHAR_DEPTH;
_local1.isShuffling_bool = false;
_local1.isGameOver_bool = false;
_local1.scoreBroadcastIntervalID = 0;
_local1.phrase_object = null;
_local1.oldPhrase_object = null;
_local1.isMouseDragged_bool = false;
_local1.powerupsUsed_int = null;
_local1.powerupVowelsToCheck = null;
_local1.firstLetterFoundPopup_bool = false;
_local1.firstLetterNotFoundPopup_bool = false;
_local1.guessPhrasePopup_bool = false;
_local1.spin1IntervalID = 0;
_local1.spin2IntervalID = 0;
_local1.spin3IntervalID = 0;
_local1.spinLetterSet1Count_int = 0;
_local1.spinLetterSet2Count_int = 0;
_local1.spinLetterSet3Count_int = 0;
_local1.spinLetterSet1_object = null;
_local1.spinLetterSet2_object = null;
_local1.spinLetterSet3_object = null;
_local1.isSpinning_bool = false;
_local1.gridLetterCount_int = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
};
GameObject.prototype.startNewGame = function () {
var _local1 = this;
if (!_local1.firstTimeGamePlayed) {
rootMain.gameSessionPhraseIndex_int = rootMain.gameSessionPhraseIndex_int + MAX_ROUNDS;
if (rootMain.gameSessionPhraseIndex_int >= TOTAL_ROUNDS) {
rootMain.gameSessionPhraseIndex_int = 0;
_local1.phrases_mc.randomise();
}
_local1.removePrevGameMovieClips();
}
_local1.initStartVariables();
_local1.gameStartTime_int = getTimer();
if (rootMain.scoreBroadcastTime_int > 0) {
_local1.scoreBroadcastIntervalID = setInterval(rootMain.game_object, "broadcastScore", rootMain.scoreBroadcastTime_int);
}
_local1.playNextRound();
_local1.firstTimeGamePlayed = false;
};
GameObject.prototype.removePrevGameMovieClips = function () {
if (this.phrase_object != null) {
this.phrase_object.removePhraseLetterClips();
}
};
GameObject.prototype.removePrevRoundMovieClips = function () {
var _local2 = this;
var _local1;
xIndex = 0;
while (xIndex < GRID_SIZE) {
yIndex = 0;
while (yIndex < GRID_SIZE) {
_local1 = _local2.grid_object[xIndex][yIndex].powerupClip_mc;
if (_local1 != null) {
removeMovieClip(_local1);
}
_local2.grid_object[xIndex][yIndex].powerupType_int = 0;
_local2.grid_object[xIndex][yIndex].powerupClip_mc = null;
yIndex++;
}
xIndex++;
}
};
GameObject.prototype.broadcastScore = function () {
var _local1 = this;
_local1.currentPlayingTime_int = Math.round((getTimer() - _local1.gameStartTime_int) / 1000);
var _local2 = ((("<game><score>" + _local1.currentScore_int) + "</score><time>") + _local1.currentPlayingTime_int) + "</time></game>";
fscommand ("ScoreBroadcast", _local2);
};
GameObject.prototype.submitScore = function () {
var _local1 = ((("<game><score>" + this.currentScore_int) + "</score><time>") + this.currentPlayingTime_int) + "</time></game>";
fscommand ("ScoreSubmit", _local1);
};
GameObject.prototype.showGuessPhrase = function () {
if (!this.isActionPossible()) {
return(false);
}
if (this.currentTurns_int >= 0) {
rootMain.gameScreen_mc.messages_mc.gotoAndStop("guessphrase");
}
};
GameObject.prototype.isActionPossible = function () {
var _local1 = this;
if ((((_local1.isShuffling_bool || (rootMain.isPaused_bool)) || (_local1.phrase_object.phraseRevealed_bool)) || (_local1.isGameOver_bool)) || (_local1.isSpinning_bool)) {
return(false);
}
return(true);
};
GameObject.prototype.guessPhrase = function (phraseToCheck_string) {
var _local1 = this;
if (_local1.phrase_object.isPhraseSimilar(phraseToCheck_string)) {
_local1.phrase_object.phraseRevealed_bool = true;
rootMain.playSound("GuessPhraseGood");
_local1.phrase_object.revealIntervalID = setInterval(rootMain.game_object.phrase_object, "revealAllLetters", 1000);
} else {
rootMain.playSound("BadClick");
if (_local1.currentTurns_int == 0) {
_local1.setGameOver();
} else {
rootMain.updateCounters(--_local1.currentTurns_int);
}
}
};
GameObject.prototype.setGameOver = function (isLastRound_bool) {
var _local1 = this;
rootMain.isPaused_bool = true;
_local1.isGameOver_bool = true;
if (_local1.scoreBroadcastIntervalID != 0) {
}
clearInterval(_local1.scoreBroadcastIntervalID);
_local1.currentPlayingTime_int = Math.round((getTimer() - _local1.gameStartTime_int) / 1000);
if (rootMain.isZoneAPI_bool) {
_local1.submitScore();
}
if (isLastRound_bool) {
rootMain.gameScreen_mc.gameOverEnd_mc.gotoAndPlay("show");
} else {
rootMain.gameScreen_mc.gameOver_mc.gotoAndPlay("show");
}
};
GameObject.prototype.awardRoundBonus = function (scoreToAdd_int) {
if (scoreToAdd_int > 0) {
this.currentScore_int = this.currentScore_int + scoreToAdd_int;
rootMain.playSound("BonusPointsAwarded");
rootMain.updateCounters(null, this.currentScore_int);
}
};
GameObject.prototype.awardPhraseCompleteBonus = function () {
this.currentScore_int = this.currentScore_int + 10000;
rootMain.updateCounters(null, this.currentScore_int);
};
GameObject.prototype.startNextRound = function () {
var _local1 = this;
_local1.currentRound_int++;
if (_local1.currentRound_int > MAX_ROUNDS) {
_local1.setGameOver(true);
} else {
_local1.currentTurns_int = _local1.getNumTurnsForRound(_local1.currentRound_int);
_local1.oldPhrase_object = _local1.phrase_object;
_local1.oldPhrase_object.flyLetterIndex = 0;
_local1.oldPhrase_object.flyIntervalID = setInterval(rootMain.game_object.oldPhrase_object, "startFlyOut", FLYOUT_STAGGER_TIME);
}
};
GameObject.prototype.startFlyInPhraseLetters = function () {
this.phrase_object.flyIntervalID = setInterval(rootMain.game_object.phrase_object, "startFlyIn", FLYIN_STAGGER_TIME);
};
GameObject.prototype.getNextPhraseForRound = function () {
var _local1 = this;
_local1.phrase_object = new PhraseObject(_local1.phrases_mc.getPhrase(_local1.currentRound_int), _local1.phrases_mc.getCategory(_local1.currentRound_int));
};
GameObject.prototype.hideAllMessageWindows = function () {
rootMain.gameScreen_mc.messages_mc.gotoAndStop("hide");
rootMain.gameScreen_mc.popups_mc.hidePopup();
};
GameObject.prototype.flipPhraseLetterComplete = function (letter_int) {
var _local1 = this;
var _local2 = letter_int;
if (!_local1.phrase_object.flipNextPhraseLetter(_local2)) {
if (_local1.phrase_object.phraseRevealed_bool) {
_local1.phrase_object.isFlipping_bool = false;
if (_local1.isGameOver_bool) {
rootMain.gameScreen_mc.gameOver_mc.update();
} else {
_local1.hideAllMessageWindows();
rootMain.gameScreen_mc.roundComplete_mc.gotoAndPlay("show");
}
} else if (_local1.phrase_object.isPhraseComplete()) {
_local1.hideAllMessageWindows();
_local1.phrase_object.isFlipping_bool = false;
rootMain.isPaused_bool = true;
rootMain.gameScreen_mc.phraseComplete_mc.gotoAndPlay("show");
} else if (_local1.powerupVowelsToCheck.length > 0) {
var _local3 = _local1.getLetterFromVowelPowerup(_local1.powerupVowelsToCheck.shift());
_local2 = _local1.letterUtils_object.charToLetter(_local3);
_local1.phrase_object.tracker_object.setLetterTracked(_local2);
if (!_local1.phrase_object.flipNextPhraseLetter(_local2)) {
_local1.phrase_object.isFlipping_bool = false;
}
} else {
_local1.phrase_object.isFlipping_bool = false;
}
}
};
GameObject.prototype.shuffleStartLetters = function () {
var _local1 = this;
var xIndex;
var _local3;
_local1.letterRing_mc._visible = false;
_local1.letterHighlighter_mc._visible = false;
_local1.isShuffling_bool = true;
_local1.isSpinning_bool = true;
rootMain.isPaused_bool = false;
_local1.spinLetterSet1Count_int = 0;
_local1.spinLetterSet2Count_int = 0;
_local1.spinLetterSet3Count_int = 0;
_local1.spinLetterSet1_object = new Array();
_local1.spinLetterSet2_object = new Array();
_local1.spinLetterSet3_object = new Array();
var _local2;
xIndex = 0;
while (xIndex < GRID_SIZE) {
_local3 = 0;
while (_local3 < GRID_SIZE) {
_local2 = _local1.grid_object[xIndex][_local3];
_local2.clip_mc.isSpinning_bool = true;
_local2.setLetter(_local1.letterUtils_object.getRandomLetter(xIndex, _local3));
if (rootMain.isRandomChance(77)) {
_local1.spinLetterSet1_object.push(_local2);
} else if (rootMain.isRandomChance(77)) {
_local1.spinLetterSet2_object.push(_local2);
} else {
_local1.spinLetterSet3_object.push(_local2);
}
_local3++;
}
xIndex++;
}
rootMain.playSound("LettersSpinning", 20);
_local1.spin1IntervalID = setInterval(rootMain.game_object, "spinLetterSet1", 62.5);
_local1.spin2IntervalID = setInterval(rootMain.game_object, "spinLetterSet2", 66.5);
_local1.spin3IntervalID = setInterval(rootMain.game_object, "spinLetterSet3", 52.5);
};
GameObject.prototype.spinLetterSet1 = function () {
var _local1 = this;
if (_local1.spinLetterSet1Count_int > MAX_SPIN_FRAMES) {
clearInterval(_local1.spin1IntervalID);
}
index = 0;
while (index < _local1.spinLetterSet1_object.length) {
letter_mc = _local1.spinLetterSet1_object[index].clip_mc;
if (_local1.spinLetterSet1Count_int > MAX_SPIN_FRAMES) {
letter_mc.gotoAndStop("show");
} else if ((letter_mc._currentframe < 3) || (letter_mc._currentframe >= 20)) {
letter_mc.gotoAndStop(3);
} else {
letter_mc.nextFrame();
}
index++;
}
_local1.spinLetterSet1Count_int++;
};
GameObject.prototype.spinLetterSet2 = function () {
var _local1 = this;
if (_local1.spinLetterSet2Count_int > MAX_SPIN_FRAMES) {
clearInterval(_local1.spin2IntervalID);
rootMain.stopLastSound();
_local1.isSpinning_bool = false;
_local1.isShuffling_bool = false;
}
index = 0;
while (index < _local1.spinLetterSet2_object.length) {
letter_mc = _local1.spinLetterSet2_object[index].clip_mc;
if (_local1.spinLetterSet2Count_int > MAX_SPIN_FRAMES) {
letter_mc.gotoAndStop("show");
} else if ((letter_mc._currentframe < 3) || (letter_mc._currentframe >= 20)) {
letter_mc.gotoAndStop(3);
} else {
letter_mc.nextFrame();
}
index++;
}
_local1.spinLetterSet2Count_int++;
};
GameObject.prototype.spinLetterSet3 = function () {
var _local1 = this;
if (_local1.spinLetterSet3Count_int > MAX_SPIN_FRAMES) {
clearInterval(_local1.spin3IntervalID);
}
index = 0;
while (index < _local1.spinLetterSet3_object.length) {
letter_mc = _local1.spinLetterSet3_object[index].clip_mc;
if (_local1.spinLetterSet3Count_int > MAX_SPIN_FRAMES) {
letter_mc.gotoAndStop("show");
} else if ((letter_mc._currentframe < 3) || (letter_mc._currentframe >= 20)) {
letter_mc.gotoAndStop(3);
} else {
letter_mc.nextFrame();
}
index++;
}
_local1.spinLetterSet3Count_int++;
};
GameObject.prototype.showLetterHighlighter = function (letterClip_mc) {
var _local1 = this;
if (!_local1.isActionPossible()) {
return(false);
}
_local1.letterHighlighter_mc._visible = true;
_local1.letterHighlighter_mc._x = letterClip_mc._x + 1;
_local1.letterHighlighter_mc._y = letterClip_mc._y + 1;
return(undefined);
};
GameObject.prototype.hideLetterHighlighter = function () {
this.letterHighlighter_mc._visible = false;
};
GameObject.prototype.resetGridLetters = function () {
var _local3 = this;
var _local2;
var _local1;
_local3.powerupsUsed_int = new Array(0, 0, 0, 0, 0, 0, 0);
_local3.gridLetterCount_int = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
_local2 = 0;
while (_local2 < GRID_SIZE) {
_local1 = 0;
while (_local1 < GRID_SIZE) {
_local3.grid_object[_local2][_local1].resetLetter();
_local1++;
}
_local2++;
}
};
GameObject.prototype.shuffleLetters = function () {
var _local3 = this;
var _local2;
var _local1;
if (!_local3.isActionPossible()) {
return(false);
}
_local3.isShuffling_bool = true;
_local3.letterRing_mc._visible = false;
_local3.letterHighlighter_mc._visible = false;
rootMain.updateWordScore();
_local3.letterChain_object.removeAllLetters();
_local3.resetGridLetters();
if (rootMain.createSomeWords_bool) {
rootMain.flipCheatWords();
rootMain.createSomeWords_bool = false;
} else {
_local2 = 0;
while (_local2 < GRID_SIZE) {
_local1 = 0;
while (_local1 < GRID_SIZE) {
_local3.grid_object[_local2][_local1].flipLetter(_local3.letterUtils_object.getRandomLetter(_local2, _local1));
_local1++;
}
_local2++;
}
}
_local3.currentTurns_int--;
rootMain.updateCounters(_local3.currentTurns_int);
rootMain.playSound("ShuffleLetters");
return(undefined);
};
GameObject.prototype.checkDragLetterSelect = function (xmouse_int, ymouse_int) {
var _local2 = this;
var _local3 = ymouse_int;
if (_local2.isMouseDragged_bool) {
if (((xmouse_int >= 0) && (xmouse_int <= GRID_X_END)) && ((_local3 >= 0) && (_local3 <= GRID_Y_END))) {
xPos_int = Math.floor(xmouse_int / LETTER_X_SPACING);
yPos_int = Math.floor(_local3 / LETTER_Y_SPACING);
var _local1 = _local2.letterChain_object.getLastLetter();
if ((_local1.xPos_int == xPos_int) && (_local1.yPos_int == yPos_int)) {
} else if (_local2.grid_object[xPos_int][yPos_int].checkHit(xmouse_int, _local3)) {
_local2.checkSelectLetter(xPos_int, yPos_int);
}
}
}
};
GameObject.prototype.playNextRound = function () {
var _local1 = this;
if (!_local1.firstTimeGamePlayed) {
rootMain.isShowPopups_bool = false;
_local1.removePrevRoundMovieClips();
_local1.bestWordScore_int = 0;
_local1.bestWord_string = "";
rootMain.updateWordScore("", 0);
rootMain.gameScreen_mc.guessMeter_mc.resetMeter();
_local1.letterChain_object.removeAllLetters();
}
_local1.powerupsUsed_int = new Array(0, 0, 0, 0, 0, 0, 0);
_local1.calculateGuessMeterTotal();
_local1.getNextPhraseForRound();
_local1.phrase_object.setupPhraseString();
_local1.shuffleStartLetters();
_local1.phrase_object.flyLetterIndex = 0;
_local1.phrase_object.randomPhraseLetterIndices_int = rootMain.getRandomIndexedArray(_local1.phrase_object.numberOfLetters_int);
rootMain.attachMovie("DelayFly", "DelayFly_" + _local1.currentRound_int, DELAYFLY_DEPTH);
rootMain.updateCounters(_local1.currentTurns_int, _local1.currentScore_int, _local1.currentRound_int);
};
GameObject.prototype.calculateGuessMeterTotal = function () {
var _local1 = this;
if (_local1.currentRound_int <= 1) {
_local1.guessMeterTotal_int = 2000;
} else if (_local1.currentRound_int >= MAX_ROUNDS) {
_local1.guessMeterTotal_int = 2750;
} else {
var _local3 = MAX_ROUNDS - 1;
var nToRange = 750;
var _local2 = (((_local1.currentRound_int - 1) * nToRange) / _local3) + 200;
_local1.guessMeterTotal_int = Math.round(_local2 * 10);
}
};
GameObject.prototype.awardExtraTurn = function () {
rootMain.updateCounters(++this.currentTurns_int);
rootMain.playSound("BonusPointsAwarded");
};
GameObject.prototype.checkForPowerup = function (x, y) {
var _local1 = this;
if (_local1.currentPowerupsOnGrid_int > 0) {
if (_local1.grid_object[x][y].powerupType_int != LETTER_POWERUP_NONE) {
_local1.grid_object[x][y].displayPowerup();
}
}
};
GameObject.prototype.displayFlyingScore = function (word_string, scoreMultiplier_int, score_int, xStart_int, yStart_int) {
var _local3 = this;
var xDest = 485;
var yDest = 365;
if (scoreMultiplier_int <= 0) {
scoreMultiplier_int = 1;
}
yStart_int = yStart_int - 15;
if (scoreMultiplier_int > 1) {
yStart_int = yStart_int - 22;
}
var yAdd = 0;
var nLen = word_string.length;
var nPixelLength = 0;
var nFirstAdj = 0;
var nLastAdj = 0;
var _local1;
var _local2;
var letters_mc = new Array();
rootMain.gameScreen_mc.guessMeter_mc.isRising_bool = true;
var delayGuessMeter_mc = rootMain.attachMovie("DelayGuessMeterRise", "DelayGuessMeterRise_" + _local3.flyingCharDepth_int, DELAYGUESSMETER_DEPTH);
delayGuessMeter_mc.totalScore_int = scoreMultiplier_int * score_int;
_local2 = 0;
while (_local2 < nLen) {
var flyingLetterName_string = (word_string.charAt(_local2) + "_FL");
var nLetter = _local3.letterUtils_object.charToLetter(word_string.charAt(_local2));
var nWidth = 18;
_local3.flyingCharDepth_int++;
_local1 = rootMain.attachMovie(flyingLetterName_string, (flyingLetterName_string + "_") + _local3.flyingCharDepth_int, _local3.flyingCharDepth_int);
letters_mc.push(_local1);
nWidth = _local1._width;
if (_local2 == 0) {
nFirstAdj = nWidth / 2;
}
if (_local2 == (nLen - 1)) {
nLastAdj = nWidth / 2;
}
nPixelLength = nPixelLength + (nWidth + 1);
_local2++;
}
nPixelLength = nPixelLength + nFirstAdj;
nPixelLength = nPixelLength + nLastAdj;
var nMaxHeight = (yStart_int - 50);
var xSpace = 11;
var xDigit = (xStart_int - (nPixelLength / 2));
var yDigit = (yStart_int + yAdd);
xDigit = xStart_int - ((nLen * xSpace) / 2);
_local2 = 0;
while (_local2 < nLen) {
xSpace = 9;
var nLetter = _local3.letterUtils_object.charToLetter(word_string.charAt(_local2));
var nWidth = 9;
_local1 = letters_mc[_local2];
nWidth = _local1._width;
xSpace = nWidth + 1;
xDigit = xDigit + (nWidth / 2);
_local1._x = xDigit;
_local1._y = yDigit;
_local1.xEnd = xDest;
_local1.yEnd = yDest;
_local1.maxHeight_int = nMaxHeight;
xDigit = xDigit + ((nWidth / 2) + 1);
_local2++;
}
yAdd = yAdd + 16;
if (scoreMultiplier_int > 1) {
var sNum = new String("X" + scoreMultiplier_int);
var nLen = sNum.length;
var xSpace = 11;
var xDigit = ((xStart_int - ((nLen * xSpace) / 2)) + (xSpace / 2));
var yDigit = (yStart_int + yAdd);
_local2 = 0;
while (_local2 < nLen) {
var nDigit = sNum.charAt(_local2);
var nMaxHeight = (yStart_int - 50);
_local3.flyingCharDepth_int++;
if (_local2 == 0) {
_local1 = rootMain.attachMovie("Multi_FL", "Multi_FL" + _local3.flyingCharDepth_int, _local3.flyingCharDepth_int);
} else {
_local1 = rootMain.attachMovie(nDigit + "_FL", (nDigit + "_FL") + _local3.flyingCharDepth_int, _local3.flyingCharDepth_int);
}
_local1._x = xDigit;
_local1._y = yDigit;
_local1.xEnd = xDest;
_local1.yEnd = yDest;
_local1.maxHeight_int = nMaxHeight;
xDigit = xDigit + xSpace;
_local2++;
}
yAdd = yAdd + 16;
}
var sNum = new String(score_int);
var nLen = sNum.length;
var xSpace = 9;
var xSpace = 11;
var xDigit = ((xStart_int - ((nLen * xSpace) / 2)) + (xSpace / 2));
var yDigit = (yStart_int + yAdd);
_local2 = 0;
while (_local2 < nLen) {
var nDigit = sNum.charAt(_local2);
var nMaxHeight = (yStart_int - 50);
_local3.flyingCharDepth_int++;
_local1 = rootMain.attachMovie(nDigit + "_FL", (nDigit + "_FL") + _local3.flyingCharDepth_int, _local3.flyingCharDepth_int);
_local1._x = xDigit;
_local1._y = yDigit;
_local1.xEnd = xDest;
_local1.yEnd = yDest;
_local1.maxHeight_int = nMaxHeight;
xDigit = xDigit + xSpace;
_local2++;
}
};
GameObject.prototype.checkAndSubmitWord = function () {
var _local1 = this;
if (!_local1.isActionPossible()) {
return(false);
}
if (_local1.letterChain_object.isWord_bool && (_local1.currentTurns_int > 0)) {
var firstLetter_object = _local1.letterChain_object.getFirstLetter();
var lastLetter_object = _local1.letterChain_object.getLastLetter();
var firstLetter_int = firstLetter_object.letter_int;
var _local3 = new Object();
var _local2 = new Object();
_local3.x = firstLetter_object.clip_mc._x;
_local3.y = firstLetter_object.clip_mc._y;
_local2.x = lastLetter_object.clip_mc._x;
_local2.y = lastLetter_object.clip_mc._y;
_local1.grid_mc.localToGlobal(_local3);
_local1.grid_mc.localToGlobal(_local2);
var word_string = _local1.letterChain_object.word_string;
_local1.letterRing_mc._visible = false;
_local1.letterHighlighter_mc._visible = false;
rootMain.playSound("SubmitWordSpecial");
_local1.displayFlyingScore(word_string, _local1.letterChain_object.scoreMultiplier_int, _local1.letterChain_object.score_int, _local2.x + 18, _local2.y);
if (_local1.letterChain_object.score_int > _local1.bestWordScore_int) {
_local1.bestWordScore_int = _local1.letterChain_object.score_int;
_local1.bestWord_string = word_string;
}
if (_local1.letterChain_object.scoreMultiplier_int > 0) {
_local1.letterChain_object.score_int = _local1.letterChain_object.scoreMultiplier_int * _local1.letterChain_object.score_int;
}
_local1.currentScore_int = _local1.currentScore_int + _local1.letterChain_object.score_int;
_local1.letterChain_object.flipLetters();
_local1.currentTurns_int--;
rootMain.updateCounters(_local1.currentTurns_int, _local1.currentScore_int);
var numRevealedLetters_int = _local1.phrase_object.getNumRevealedLetters();
var firstLetterRevealed_bool = false;
if (!_local1.phrase_object.checkLetterInPhrase(firstLetter_int, _local3.x, _local3.y)) {
if (_local1.powerupVowelsToCheck.length > 0) {
var letter_string = _local1.getLetterFromVowelPowerup(_local1.powerupVowelsToCheck.shift());
var letter_int = _local1.letterUtils_object.charToLetter(letter_string);
_local1.phrase_object.tracker_object.setLetterTracked(letter_int);
var delayFlip_mc = rootMain.attachMovie("DelayFlip", "DelayFlip_" + _local1.currentTurns_int, DELAYFLIP_DEPTH);
delayFlip_mc.letter_int = letter_int;
}
} else {
firstLetterRevealed_bool = true;
}
var firstLetterFound_bool = (firstLetterRevealed_bool && (numRevealedLetters_int == 0));
var firstLetterNotFound_bool = ((!firstLetterRevealed_bool) && (numRevealedLetters_int == 0));
if (rootMain.isShowPopups_bool) {
if ((!_local1.firstLetterFoundPopup_bool) && (firstLetterFound_bool)) {
_local1.firstLetterFoundPopup_bool = true;
rootMain.gameScreen_mc.popups_mc.showPopup(1);
} else if ((!_local1.firstLetterNotFoundPopup_bool) && (firstLetterNotFound_bool)) {
_local1.firstLetterNotFoundPopup_bool = true;
rootMain.gameScreen_mc.popups_mc.showPopup(2);
} else if (((!_local1.guessPhrasePopup_bool) && (_local1.currentTurns_int >= 10)) && (_local1.currentTurns_int <= 14)) {
_local1.guessPhrasePopup_bool = true;
rootMain.gameScreen_mc.popups_mc.showPopup(3);
}
}
} else {
rootMain.playSound("BadClick");
}
return(undefined);
};
GameObject.prototype.removeChainLetter = function (chainIndex_int, isRemoveAll_bool) {
var _local2 = this;
if (!_local2.isActionPossible()) {
return(false);
}
if (!isRemoveAll_bool) {
rootMain.playSound("SelectLetter");
}
if (chainIndex_int >= 0) {
var _local1;
var _local3 = _local2.letterChain_object.chainSize_int;
_local1 = chainIndex_int + 1;
while (_local1 < _local3) {
_local2.letterChain_object.letters_object[_local1].deselectLetter();
_local2.letterChain_object.removeLetter(_local1);
_local1++;
}
}
if (isRemoveAll_bool || (chainIndex_int == -1)) {
_local2.letterChain_object.letters_object[0].deselectLetter();
_local2.letterChain_object.removeLetter(0);
_local2.setFirstLetterRing();
}
_local2.letterChain_object.calculateWordScore();
return(undefined);
};
GameObject.prototype.checkSelectLetter = function (xPos_int, yPos_int) {
var _local1 = this;
if (!_local1.isActionPossible()) {
return(false);
}
var _local2 = _local1.grid_object[xPos_int][yPos_int];
if (_local2.clip_mc.isFlipping_bool) {
return(false);
}
var letterID_string = _local2.clip_mc._name;
var _local3 = _local1.letterChain_object.getLastLetter();
if (_local2.status_int == LETTER_SELECTED) {
if ((_local3.clip_mc._name == letterID_string) && (_local1.letterChain_object.chainSize_int > 1)) {
_local1.checkAndSubmitWord();
} else if (_local1.letterChain_object.chainSize_int == 1) {
_local1.removeChainLetter(-1);
} else {
_local1.removeChainLetter(_local2.chainIndex_int);
}
} else if (_local2.status_int == LETTER_AVAILABLE) {
if ((_local1.letterChain_object.chainSize_int > 0) && ((Math.abs(_local2.xPos_int - _local3.xPos_int) <= 1) && (Math.abs(_local2.yPos_int - _local3.yPos_int) <= 1))) {
if ((_local1.letterChain_object.chainSize_int + 1) > WORDLENGTH_LIMIT) {
rootMain.playSound("BadClick");
rootMain.showMessageDialog("upsell");
} else {
_local1.letterChain_object.addLetter(_local2);
_local2.selectLetter(_local3.chainIndex_int + 1);
}
} else {
_local1.letterChain_object.removeAllLetters();
_local1.letterChain_object.addLetter(_local2);
_local2.selectLetter(0);
_local1.setFirstLetterRing(_local2);
}
}
return(undefined);
};
GameObject.prototype.setFirstLetterRing = function (letter_object) {
var _local1 = this;
var _local2 = letter_object;
if (_local2 == undefined) {
_local1.letterRing_mc._visible = false;
} else if (!_local1.isShuffling_bool) {
_local1.letterRing_mc._x = _local2.clip_mc._x - 2;
_local1.letterRing_mc._y = _local2.clip_mc._y - 2;
_local1.letterRing_mc._visible = true;
}
};
GameObject.prototype.guessMeterIncreaseStart = function (score_int) {
var _local1 = this.getGuessMeterPercent(score_int);
rootMain.gameScreen_mc.guessMeter_mc.increaseMeter(_local1);
};
GameObject.prototype.getGuessMeterPercent = function (score_int) {
return((score_int / this.guessMeterTotal_int) * 100);
};
GameObject.prototype.getNumCellsWithLetter = function (nLetter) {
return(this.gridLetterCount_int[nLetter]);
};
GameObject.prototype.getGridLetterObject = function (x, y) {
var _local1 = y;
var _local2 = x;
if ((_local2 < 0) || (_local2 >= GRID_SIZE)) {
return(null);
}
if ((_local1 < 0) || (_local1 >= GRID_SIZE)) {
return(null);
}
return(this.grid_object[_local2][_local1]);
};
GameObject.prototype.getNumNeighborCells = function (x, y) {
var _local3 = this;
var _local2 = 0;
var _local1 = null;
_local1 = _local3.getGridLetterObject(x - 1, y + 1);
if (_local1 != null) {
_local2++;
}
_local1 = _local3.getGridLetterObject(x, y + 1);
if (_local1 != null) {
_local2++;
}
_local1 = _local3.getGridLetterObject(x + 1, y + 1);
if (_local1 != null) {
_local2++;
}
_local1 = _local3.getGridLetterObject(x - 1, y);
if (_local1 != null) {
_local2++;
}
_local1 = _local3.getGridLetterObject(x, y);
if (_local1 != null) {
_local2++;
}
_local1 = _local3.getGridLetterObject(x + 1, y);
if (_local1 != null) {
_local2++;
}
_local1 = _local3.getGridLetterObject(x - 1, y - 1);
if (_local1 != null) {
_local2++;
}
_local1 = _local3.getGridLetterObject(x, y - 1);
if (_local1 != null) {
_local2++;
}
_local1 = _local3.getGridLetterObject(x + 1, y - 1);
if (_local1 != null) {
_local2++;
}
return(_local2);
};
GameObject.prototype.getNumNeighborCellsWithLetter = function (x, y, nLetter) {
var _local2 = nLetter;
var _local3 = this;
var _local1 = 0;
letter_object = null;
letter_object = _local3.getGridLetterObject(x - 1, y + 1);
if ((letter_object != null) && (letter_object.letter_int == _local2)) {
_local1++;
}
letter_object = _local3.getGridLetterObject(x, y + 1);
if ((letter_object != null) && (letter_object.letter_int == _local2)) {
_local1++;
}
letter_object = _local3.getGridLetterObject(x + 1, y + 1);
if ((letter_object != null) && (letter_object.letter_int == _local2)) {
_local1++;
}
letter_object = _local3.getGridLetterObject(x - 1, y);
if ((letter_object != null) && (letter_object.letter_int == _local2)) {
_local1++;
}
letter_object = _local3.getGridLetterObject(x, y);
if ((letter_object != null) && (letter_object.letter_int == _local2)) {
_local1++;
}
letter_object = _local3.getGridLetterObject(x + 1, y);
if ((letter_object != null) && (letter_object.letter_int == _local2)) {
_local1++;
}
letter_object = _local3.getGridLetterObject(x - 1, y - 1);
if ((letter_object != null) && (letter_object.letter_int == _local2)) {
_local1++;
}
letter_object = _local3.getGridLetterObject(x, y - 1);
if ((letter_object != null) && (letter_object.letter_int == _local2)) {
_local1++;
}
letter_object = _local3.getGridLetterObject(x + 1, y - 1);
if ((letter_object != null) && (letter_object.letter_int == _local2)) {
_local1++;
}
return(_local1);
};
GameObject.prototype.getNumNeighborCellsWithVowel = function (x, y) {
var _local2 = this;
var _local3 = 0;
var _local1 = null;
_local1 = _local2.getGridLetterObject(x - 1, y + 1);
if ((_local1 != null) && (_local2.letterUtils_object.isVowel(_local1.letter_int))) {
_local3++;
}
_local1 = _local2.getGridLetterObject(x, y + 1);
if ((_local1 != null) && (_local2.letterUtils_object.isVowel(_local1.letter_int))) {
_local3++;
}
_local1 = _local2.getGridLetterObject(x + 1, y + 1);
if ((_local1 != null) && (_local2.letterUtils_object.isVowel(_local1.letter_int))) {
_local3++;
}
_local1 = _local2.getGridLetterObject(x - 1, y);
if ((_local1 != null) && (_local2.letterUtils_object.isVowel(_local1.letter_int))) {
_local3++;
}
_local1 = _local2.getGridLetterObject(x, y);
if ((_local1 != null) && (_local2.letterUtils_object.isVowel(_local1.letter_int))) {
_local3++;
}
_local1 = _local2.getGridLetterObject(x + 1, y);
if ((_local1 != null) && (_local2.letterUtils_object.isVowel(_local1.letter_int))) {
_local3++;
}
_local1 = _local2.getGridLetterObject(x - 1, y - 1);
if ((_local1 != null) && (_local2.letterUtils_object.isVowel(_local1.letter_int))) {
_local3++;
}
_local1 = _local2.getGridLetterObject(x, y - 1);
if ((_local1 != null) && (_local2.letterUtils_object.isVowel(_local1.letter_int))) {
_local3++;
}
_local1 = _local2.getGridLetterObject(x + 1, y - 1);
if ((_local1 != null) && (_local2.letterUtils_object.isVowel(_local1.letter_int))) {
_local3++;
}
return(_local3);
};
GameObject.prototype.isPowerupAlreadyUsedForVowel = function (nVowel) {
var _local2 = rootMain.getCharFromNumber(nVowel);
var _local1 = LETTER_POWERUP_NONE;
if (_local2 == "A") {
_local1 = LETTER_POWERUP_VOWEL_A;
}
if (_local2 == "E") {
_local1 = LETTER_POWERUP_VOWEL_E;
}
if (_local2 == "I") {
_local1 = LETTER_POWERUP_VOWEL_I;
}
if (_local2 == "O") {
_local1 = LETTER_POWERUP_VOWEL_O;
}
if (_local2 == "U") {
_local1 = LETTER_POWERUP_VOWEL_U;
}
if (_local2 == "Y") {
_local1 = LETTER_POWERUP_VOWEL_Y;
}
return(this.powerupsUsed_int[_local1] > 0);
};
GameObject.prototype.getVowelPowerupFromLetter = function (nLetter) {
var _local1 = LETTER_POWERUP_NONE;
var _local2 = rootMain.getCharFromNumber(nLetter);
if (_local2 == "A") {
_local1 = LETTER_POWERUP_VOWEL_A;
}
if (_local2 == "E") {
_local1 = LETTER_POWERUP_VOWEL_E;
}
if (_local2 == "I") {
_local1 = LETTER_POWERUP_VOWEL_I;
}
if (_local2 == "O") {
_local1 = LETTER_POWERUP_VOWEL_O;
}
if (_local2 == "U") {
_local1 = LETTER_POWERUP_VOWEL_U;
}
if (_local2 == "Y") {
_local1 = LETTER_POWERUP_VOWEL_Y;
}
return(_local1);
};
GameObject.prototype.getLetterFromVowelPowerup = function (nPowerup) {
var _local2 = nPowerup;
var _local1 = rootMain.getCharFromNumber(nLetter);
if (_local2 == LETTER_POWERUP_VOWEL_A) {
_local1 = "A";
}
if (_local2 == LETTER_POWERUP_VOWEL_E) {
_local1 = "E";
}
if (_local2 == LETTER_POWERUP_VOWEL_I) {
_local1 = "I";
}
if (_local2 == LETTER_POWERUP_VOWEL_O) {
_local1 = "O";
}
if (_local2 == LETTER_POWERUP_VOWEL_U) {
_local1 = "U";
}
if (_local2 == LETTER_POWERUP_VOWEL_Y) {
_local1 = "Y";
}
return(_local1);
};
GameObject.prototype.isPowerupExist = function (nPowerup) {
var _local1 = this;
var _local2 = nPowerup;
if (_local1.currentPowerupsOnGrid_int > 0) {
x = 0;
while (x < GRID_SIZE) {
y = 0;
while (y < GRID_SIZE) {
if (_local1.grid_object[x][y].powerupType_int == _local2) {
return(true);
}
y++;
}
x++;
}
}
return(false);
};
GameObject.prototype.getNumTurnsForRound = function (nRound) {
var _local1 = nRound;
if (_local1 >= 50) {
return(5);
}
if (_local1 >= 40) {
return(6);
}
if (_local1 >= 30) {
return(7);
}
if (_local1 >= 20) {
return(8);
}
if (_local1 >= 15) {
return(9);
}
if (_local1 >= 11) {
return(10);
}
if (_local1 >= 11) {
return(10);
}
if (_local1 == 10) {
return(6);
}
if (_local1 == 9) {
return(7);
}
if (_local1 == 8) {
return(8);
}
if (_local1 == 7) {
return(9);
}
if (_local1 == 6) {
return(10);
}
if (_local1 == 5) {
return(12);
}
if (_local1 == 4) {
return(14);
}
if (_local1 == 3) {
return(16);
}
if (_local1 == 2) {
return(18);
}
return(20);
};
LetterObject.prototype.displayPowerup = function () {
var _local1 = this;
var _local2;
if (_local1.powerupType_int == LETTER_POWERUP_POINTS_2X) {
_local2 = "DoublePowerup";
} else if (_local1.powerupType_int == LETTER_POWERUP_POINTS_3X) {
_local2 = "TriplePowerup";
} else if ((_local1.powerupType_int >= LETTER_POWERUP_VOWEL_A) && (_local1.powerupType_int <= LETTER_POWERUP_VOWEL_Y)) {
_local2 = "FreePowerup";
} else {
return;
}
rootMain.curDepth_int++;
_local1.powerupClip_mc = rootMain.game_object.grid_mc.attachMovie(_local2, _local2 + rootMain.curDepth_int, rootMain.curDepth_int);
_local1.powerupClip_mc._x = Math.ceil(_local1.clip_mc._x + 19);
_local1.powerupClip_mc._y = Math.ceil(_local1.clip_mc._y + 34);
};
LetterObject.prototype.setRandomPowerup = function () {
if (rootMain.game_object.currentPowerupsOnGrid_int >= MAX_POWERUPS) {
return(NO_POWERUP);
}
var _local2 = (rootMain.isRandomChance(77) ? 1 : 2);
this.powerupType_int = LETTER_POWERUP_NONE;
var _local1 = LETTER_POWERUP_NONE;
switch (_local2) {
case 1 :
var _local3 = rootMain.game_object.letterUtils_object.getRandomPowerupVowel();
_local1 = rootMain.game_object.getVowelPowerupFromLetter(_local3);
break;
case 2 :
if (rootMain.isRandomChance(25)) {
_local1 = LETTER_POWERUP_POINTS_3X;
} else {
_local1 = LETTER_POWERUP_POINTS_2X;
}
}
if (_local1 == LETTER_POWERUP_NONE) {
return(LETTER_POWERUP_NONE);
}
if (_local2 == 1) {
if ((_local3 != LETTER_BLANK) && (rootMain.game_object.isPowerupExist(_local1))) {
return(LETTER_POWERUP_NONE);
}
}
this.powerupType_int = _local1;
rootMain.game_object.currentPowerupsOnGrid_int++;
return(this.powerupType_int);
};
LetterObject.prototype.removePowerup = function () {
var _local1 = this;
if (_local1.powerupType_int != 0) {
removeMovieClip(_local1.powerupClip_mc);
_local1.powerupType_int = 0;
return(true);
}
return(false);
};
LetterObject.prototype.setLetter = function (letter_int) {
var _local1 = this;
var _local2 = letter_int;
_local1.letter_int = _local2;
rootMain.game_object.gridLetterCount_int[_local2]++;
if (_local2 == LETTER_BLANK) {
_local1.letter_string = "";
_local1.clip_mc.curLetter_string = "Blank";
} else {
_local1.letter_string = String.fromCharCode(64 + _local1.letter_int);
_local1.clip_mc.curLetter_string = _local1.letter_string;
}
};
LetterObject.prototype.deselectLetter = function () {
var _local1 = this;
_local1.chainIndex_int = -1;
_local1.status_int = LETTER_AVAILABLE;
_local1.clip_mc.deselect();
};
LetterObject.prototype.selectLetter = function (chainIndex_int) {
var _local1 = this;
_local1.chainIndex_int = chainIndex_int;
_local1.status_int = LETTER_SELECTED;
_local1.clip_mc.select();
};
LetterObject.prototype.flipLetter = function (letter_int) {
this.setLetter(letter_int);
this.clip_mc.flip();
};
LetterObject.prototype.resetLetter = function () {
var _local1 = this;
_local1.letter_int = 0;
_local1.letter_string = "";
_local1.status_int = LETTER_AVAILABLE;
_local1.chainIndex_int = -1;
_local1.removePowerup();
};
LetterObject.prototype.checkHit = function (xPoint_int, yPoint_int) {
var _local1 = Math.abs(this.getCenterXPoint() - xPoint_int);
var _local2 = Math.abs(this.getCenterYPoint() - yPoint_int);
return((_local1 <= 12) || (_local2 <= 12));
};
LetterObject.prototype.getCenterXPoint = function () {
return(this.clip_mc._x + (LETTER_WIDTH / 2));
};
LetterObject.prototype.getCenterYPoint = function () {
return(this.clip_mc._y + (LETTER_WIDTH / 2));
};
LetterChainObject.prototype.addLetter = function (letter_object) {
var _local2 = this;
_local2.letters_object[_local2.chainSize_int] = letter_object;
rootMain.playSound("SelectLetter");
if (_local2.chainSize_int > 0) {
_global.CONNECTOR_X_OFFSET = 0;
_global.CONNECTOR_Y_OFFSET = 0;
var _local1;
var _local3;
var lastLetter_object = _local2.letters_object[_local2.chainSize_int - 1];
var lL_x = lastLetter_object.xPos_int;
var lL_y = lastLetter_object.yPos_int;
var l_x = letter_object.xPos_int;
var l_y = letter_object.yPos_int;
if (l_x > lL_x) {
if (l_y > lL_y) {
_local3 = "SouthEast";
_local1 = rootMain.game_object.grid_mc.attachMovie(_local3, _local3 + _local2.chainSize_int, CONNECTOR_DEPTH + _local2.chainSize_int);
_local1._x = letter_object.clip_mc._x - CONNECTOR_X_OFFSET;
_local1._y = letter_object.clip_mc._y - CONNECTOR_Y_OFFSET;
} else if (l_y < lL_y) {
_local3 = "NorthEast";
_local1 = rootMain.game_object.grid_mc.attachMovie(_local3, _local3 + _local2.chainSize_int, CONNECTOR_DEPTH + _local2.chainSize_int);
_local1._x = letter_object.clip_mc._x - CONNECTOR_X_OFFSET;
_local1._y = (letter_object.clip_mc._y + CONNECTOR_Y_OFFSET) + LETTER_WIDTH;
} else {
_local3 = "East";
_local1 = rootMain.game_object.grid_mc.attachMovie(_local3, _local3 + _local2.chainSize_int, CONNECTOR_DEPTH + _local2.chainSize_int);
_local1._x = letter_object.clip_mc._x - CONNECTOR_X_OFFSET;
_local1._y = letter_object.clip_mc._y + (LETTER_WIDTH / 2);
}
} else if (l_x < lL_x) {
if (l_y > lL_y) {
_local3 = "SouthWest";
_local1 = rootMain.game_object.grid_mc.attachMovie(_local3, _local3 + _local2.chainSize_int, CONNECTOR_DEPTH + _local2.chainSize_int);
_local1._x = (letter_object.clip_mc._x + CONNECTOR_X_OFFSET) + LETTER_WIDTH;
_local1._y = letter_object.clip_mc._y - CONNECTOR_Y_OFFSET;
} else if (l_y < lL_y) {
_local3 = "NorthWest";
_local1 = rootMain.game_object.grid_mc.attachMovie(_local3, _local3 + _local2.chainSize_int, CONNECTOR_DEPTH + _local2.chainSize_int);
_local1._x = (letter_object.clip_mc._x + CONNECTOR_X_OFFSET) + LETTER_WIDTH;
_local1._y = (letter_object.clip_mc._y + CONNECTOR_Y_OFFSET) + LETTER_WIDTH;
} else {
_local3 = "West";
_local1 = rootMain.game_object.grid_mc.attachMovie(_local3, _local3 + _local2.chainSize_int, CONNECTOR_DEPTH + _local2.chainSize_int);
_local1._x = (letter_object.clip_mc._x + CONNECTOR_X_OFFSET) + LETTER_WIDTH;
_local1._y = letter_object.clip_mc._y + (LETTER_WIDTH / 2);
}
} else if (l_y > lL_y) {
_local3 = "South";
_local1 = rootMain.game_object.grid_mc.attachMovie(_local3, _local3 + _local2.chainSize_int, CONNECTOR_DEPTH + _local2.chainSize_int);
_local1._x = letter_object.clip_mc._x + (LETTER_WIDTH / 2);
_local1._y = letter_object.clip_mc._y - CONNECTOR_Y_OFFSET;
} else if (l_y < lL_y) {
_local3 = "North";
_local1 = rootMain.game_object.grid_mc.attachMovie(_local3, _local3 + _local2.chainSize_int, CONNECTOR_DEPTH + _local2.chainSize_int);
_local1._x = letter_object.clip_mc._x + (LETTER_WIDTH / 2);
_local1._y = (letter_object.clip_mc._y + CONNECTOR_Y_OFFSET) + LETTER_WIDTH;
}
_local2.connectors_mc[_local2.chainSize_int - 1] = _local1;
}
_local2.chainSize_int++;
_local2.calculateWordScore();
};
LetterChainObject.prototype.removeLetter = function (index) {
var _local1 = this;
_local1.letters_object[index] = null;
_local1.chainSize_int--;
removeMovieClip(_local1.connectors_mc[index - 1]);
};
LetterChainObject.prototype.removeAllLetters = function () {
var _local2 = this;
var _local1;
_local1 = 0;
while (_local1 < _local2.chainSize_int) {
_local2.letters_object[_local1].deselectLetter();
_local2.letters_object[_local1] = null;
removeMovieClip(_local2.connectors_mc[_local1]);
_local1++;
}
_local2.isWord_bool = false;
_local2.chainSize_int = 0;
};
LetterChainObject.prototype.flipLetters = function () {
var _local3 = this;
var _local2;
var _local1;
var letter_int;
var randomPercent_int = 45;
if (rootMain.mustSetPowerups_bool) {
randomPercent_int = 100;
_local3.isPowerup_bool = false;
MAX_POWERUPS = 49;
}
_local2 = 0;
while (_local2 < _local3.chainSize_int) {
_local1 = _local3.letters_object[_local2];
rootMain.game_object.gridLetterCount_int[_local1.letter_int]--;
_local1.deselectLetter();
if (_local1.powerupType_int != 0) {
rootMain.game_object.powerupsUsed_int[_local1.powerupType_int]++;
}
if (_local1.removePowerup()) {
rootMain.game_object.currentPowerupsOnGrid_int--;
}
removeMovieClip(_local3.connectors_mc[_local2]);
_local2++;
}
_local2 = 0;
while (_local2 < _local3.chainSize_int) {
_local1 = _local3.letters_object[_local2];
letter_int = rootMain.game_object.letterUtils_object.getRandomLetter(_local1.xPos_int, _local1.yPos_int);
if ((!_local3.isPowerup_bool) && (rootMain.isRandomChance(randomPercent_int))) {
powerupType_int = _local1.setRandomPowerup();
if ((powerupType_int >= LETTER_POWERUP_VOWEL_A) && (powerupType_int <= LETTER_POWERUP_VOWEL_Y)) {
letter_int = rootMain.game_object.letterUtils_object.charToLetter(rootMain.game_object.getLetterFromVowelPowerup(powerupType_int));
} else if (powerupType_int >= LETTER_POWERUP_POINTS_2X) {
if (rootMain.game_object.letterUtils_object.isVowel(letter_int)) {
letter_int = rootMain.game_object.letterUtils_object.getRandomConsonant();
}
}
}
_local1.flipLetter(letter_int);
_local2++;
}
_local3.isWord_bool = false;
_local3.isPowerup_bool = false;
_local3.chainSize_int = 0;
};
LetterChainObject.prototype.getLastLetter = function () {
return(this.letters_object[this.chainSize_int - 1]);
};
LetterChainObject.prototype.getFirstLetter = function () {
return(this.letters_object[0]);
};
LetterChainObject.prototype.calculateWordScore = function () {
var _local1 = this;
_local1.word_string = "";
_local1.score_int = 0;
_local1.scoreMultiplier_int = 0;
var wordLength_int = 0;
var _local2;
var vowelPowerupCount_int = 0;
rootMain.game_object.powerupVowelsToCheck = new Array();
_local1.isPowerup_bool = false;
index = 0;
while (index < _local1.chainSize_int) {
_local2 = _local1.letters_object[index];
if (_local2.letter_string == "Q") {
wordLength_int = wordLength_int + 2;
_local1.word_string = _local1.word_string + "QU";
} else {
wordLength_int++;
_local1.word_string = _local1.word_string + _local2.letter_string;
}
if (_local2.powerupType_int != LETTER_POWERUP_NONE) {
_local1.isPowerup_bool = true;
}
if ((_local2.powerupType_int >= LETTER_POWERUP_VOWEL_A) && (_local2.powerupType_int <= LETTER_POWERUP_VOWEL_Y)) {
rootMain.game_object.powerupVowelsToCheck[vowelPowerupCount_int++] = _local2.powerupType_int;
} else if (_local2.powerupType_int == LETTER_POWERUP_POINTS_2X) {
_local1.scoreMultiplier_int = _local1.scoreMultiplier_int + 2;
} else if (_local2.powerupType_int == LETTER_POWERUP_POINTS_3X) {
_local1.scoreMultiplier_int = _local1.scoreMultiplier_int + 3;
}
index++;
}
_local1.isWord_bool = false;
if (_local1.chainSize_int >= 3) {
_local1.isWord_bool = rootMain.game_object.dict_mc.isWordExist(_local1.word_string);
}
if (_local1.isWord_bool) {
_local1.score_int = 0;
_local1.score_int = _local1.score_int + ((wordLength_int - 2) * ((wordLength_int - 2) * 50));
var _local3;
var nValue;
_local3 = 0;
while (_local3 < wordLength_int) {
nValue = rootMain.game_object.letterUtils_object.getLetterValue(_local1.word_string.charCodeAt(_local3) - 64);
_local1.score_int = _local1.score_int + (nValue * 25);
_local3++;
}
if (rootMain.wordScoreForAll != "") {
_local1.score_int = Number(rootMain.wordScoreForAll);
}
}
rootMain.updateWordScore(_local1.word_string, _local1.score_int);
};
LetterUtilsObject.prototype.getLetterValue = function (letter_int) {
return(this.aValues[letter_int]);
};
LetterUtilsObject.prototype.getRandomLetterFromPopulationArray = function (lastLetter) {
return(getRandomLetterFromPopulationArray(lastLetter, 0));
};
LetterUtilsObject.prototype.getRandomLetterFromPopulationArray = function (lastLetter, lastLetter2) {
var _local1 = this;
var _local2;
if (!_local1.firstTimeSet_bool) {
_local1.firstTimeSet_bool = true;
i = 0;
while (i < 26) {
j = 0;
while (j < _local1.aLetters[i]) {
_local2 = i + 1;
_local1.randomLetters_int[_local1.randomLettersCount_int++] = _local2;
if (!_local1.isVowel(nLetter)) {
_local1.randomConsonantLetters_int[_local1.randomConsonantLettersCount_int++] = _local2;
}
j++;
}
i++;
}
}
var _local3 = Math.floor(Math.random() * _local1.randomLettersCount_int);
var nLetter = _local1.randomLetters_int[_local3];
var nRep = 99;
while (((nLetter == lastLetter) || (nLetter == lastLetter2)) && (nRep > 0)) {
nRep--;
_local3 = Math.floor(Math.random() * _local1.randomLettersCount_int);
nLetter = _local1.randomLetters_int[_local3];
}
return(nLetter);
};
LetterUtilsObject.prototype.getRandomLetter = function (x, y) {
var _local1 = this;
var _local2 = _local1.getRandomLetterFromPopulationArray(_local1.nLastLetter);
var phraseLetter_bool = false;
if ((_local1.nPhraseCounter == 0) && (rootMain.isRandomChance(10))) {
var phraseLetter_int = _local1.game_object.phrase_object.getRandomHiddenLetter();
if (phraseLetter_int != LETTER_BLANK) {
_local2 = phraseLetter_int;
}
phraseLetter_bool = true;
_local1.nPhraseCounter = 7;
} else if (_local1.nPhraseCounter > 0) {
_local1.nPhraseCounter--;
}
var nNumNeighborCells = _local1.game_object.getNumNeighborCells(x, y);
var nNumGridLetters = _local1.game_object.getNumCellsWithLetter(_local2);
var nMaxGridLetters = _local1.aMaxes[_local2];
if (phraseLetter_bool) {
nMaxGridLetters++;
}
if (nNumGridLetters >= nMaxGridLetters) {
_local2 = _local1.getRandomLetterFromPopulationArray(_local1.nLastLetter, _local2);
}
var nNumNeighborVowels = _local1.game_object.getNumNeighborCellsWithVowel(x, y);
if (nNumNeighborVowels == 0) {
_local2 = _local1.getRandomVowel2(_local1.nLastVowel);
}
var nNumGridNeighbors = _local1.game_object.getNumNeighborCellsWithLetter(x, y, _local2);
var nPercent = (_local1.aDists[_local2] * 10);
if ((nNumGridNeighbors > 1) && (nPercent < 85)) {
nPercent = 85;
}
if ((nNumGridNeighbors > 2) && (nPercent < 85)) {
nPercent = 100;
}
if (nNumGridNeighbors > 0) {
if (!rootMain.isRandomChance(nPercent)) {
_local2 = _local1.getRandomLetterFromPopulationArray(_local1.nLastLetter, _local2);
}
}
var nNumNeighborConsonants = (nNumNeighborCells - nNumNeighborVowels);
var nPercentVowels = ((nNumNeighborVowels * 100) / nNumNeighborCells);
if (nPercentVowels >= 50) {
var _local3 = 32;
while (_local3 > 0) {
_local3--;
_local2 = _local1.getRandomLetterFromPopulationArray(_local1.nLastLetter, _local2);
if (!_local1.isVowel(_local2)) {
_local3 = 0;
}
}
}
_local1.nLastLetter = _local2;
if (_local1.isVowel(_local2)) {
_local1.nLastVowel = _local2;
}
return(_local2);
};
LetterUtilsObject.prototype.getRandomConsonant = function () {
var _local2 = this;
var _local3 = Math.floor(Math.random() * _local2.randomConsonantLettersCount_int);
var _local1 = _local2.randomConsonantLetters_int[_local3];
var nRep = 99;
while ((_local1 == _local2.lastConsonantLetter) && (nRep > 0)) {
nRep--;
_local3 = Math.floor(Math.random() * _local2.randomConsonantLettersCount_int);
_local1 = _local2.randomConsonantLetters_int[_local3];
}
_local2.lastConsonantLetter = _local1;
return(_local1);
};
LetterUtilsObject.prototype.isVowel = function (nLetter) {
var _local1 = String.fromCharCode(64 + nLetter);
if (_local1 == "A") {
return(true);
}
if (_local1 == "E") {
return(true);
}
if (_local1 == "I") {
return(true);
}
if (_local1 == "O") {
return(true);
}
if (_local1 == "U") {
return(true);
}
if (_local1 == "Y") {
return(true);
}
return(false);
};
LetterUtilsObject.prototype.charToLetter = function (nChar) {
return(nChar.charCodeAt(0) - 64);
};
LetterUtilsObject.prototype.getRandomVowel = function () {
var _local1 = this;
var _local2 = Math.ceil(Math.random() * 14);
switch (_local2) {
case 1 :
return(_local1.charToLetter("A"));
case 2 :
return(_local1.charToLetter("A"));
case 3 :
return(_local1.charToLetter("E"));
case 4 :
return(_local1.charToLetter("E"));
case 5 :
return(_local1.charToLetter("I"));
case 6 :
return(_local1.charToLetter("I"));
case 7 :
return(_local1.charToLetter("O"));
case 8 :
return(_local1.charToLetter("O"));
case 9 :
return(_local1.charToLetter("O"));
case 10 :
return(_local1.charToLetter("U"));
case 11 :
return(_local1.charToLetter("U"));
case 12 :
return(_local1.charToLetter("U"));
case 13 :
return(_local1.charToLetter("Y"));
case 14 :
return(_local1.charToLetter("Y"));
}
return(_local1.charToLetter("E"));
};
LetterUtilsObject.prototype.getRandomVowel2 = function (nLastVowel) {
var _local3 = this;
var _local1 = 20;
var _local2 = _local3.charToLetter("E");
while (_local1 > 0) {
_local1--;
_local2 = _local3.getRandomVowel();
if (_local2 != nLastVowel) {
_local1 = 0;
}
}
return(_local2);
};
LetterUtilsObject.prototype.getRandomPowerupVowel = function () {
var _local2 = this;
var _local3 = 32;
while (_local3 > 0) {
var _local1 = _local2.getRandomVowel();
bDontUse = false;
if (_local2.game_object.phrase_object.isLetterAlreadyRevealed(_local1)) {
bDontUse = true;
}
if (_local2.game_object.isPowerupAlreadyUsedForVowel(_local1)) {
bDontUse = true;
}
if (!bDontUse) {
return(_local1);
}
_local3--;
}
return(LETTER_BLANK);
};
PhraseObject.prototype.decrypt = function (sstring) {
var _local2 = sstring;
var _local1 = "PROFANITY";
_local2 = unescape(_local2);
news = "";
if (odd(ord(_local1.charAt(0)))) {
odd = true;
counter = 0;
} else {
odd = false;
counter = _local1.length - 1;
}
i = 0;
while (i < _local2.length) {
tord = ord(_local1.charAt(counter));
news = news + chr(ord(_local2.charAt(i)) - tord);
if (odd) {
counter++;
if (counter == _local1.length) {
counter = 0;
}
} else {
counter--;
if (counter == -1) {
counter = _local1.length - 1;
}
}
i++;
}
return(news);
};
PhraseObject.prototype.revealAllLetters = function () {
var _local1 = this;
clearInterval(_local1.revealIntervalID);
_local1.phraseRevealed_bool = true;
_local1.flipNextPhraseLetter();
};
PhraseObject.prototype.isPhraseSimilar = function (phraseToCheck_string) {
var _local1 = this;
if (_local1.phrase_string == phraseToCheck_string) {
return(true);
}
if (_local1.leven_object.dist(_local1.phrase_string, phraseToCheck_string) <= 3) {
return(true);
}
if (rootMain.alwaysCorrectGuess_bool) {
return(true);
}
return(false);
};
PhraseObject.prototype.checkLetterInPhrase = function (letter_int, letterX, letterY) {
var _local2 = this;
if (_local2.tracker_object.isLetterTracked(letter_int)) {
return(false);
}
_local2.tracker_object.setLetterTracked(letter_int);
var _local3 = null;
var _local1;
i = 0;
while (i < _local2.numberOfLetters_int) {
_local1 = _local2.phraseLetters_object[i];
if (letter_int == _local1.letter_int) {
_local3 = _local1.clip_mc;
break;
}
i++;
}
if (_local3 != null) {
_local2.isFlipping_bool = true;
var star_mc = rootMain.attachMovie("Star", "Star_" + letter_int, ++rootMain.curDepth_int);
star_mc.letter_int = letter_int;
star_mc._x = letterX + 18.5;
star_mc._y = letterY;
var point = new Object();
point.x = _local3._x;
point.y = _local3._y;
rootMain.gameScreen_mc.phraseDisplay_mc.localToGlobal(point);
star_mc.xEnd = point.x + 8.5;
star_mc.yEnd = point.y;
return(true);
}
return(false);
};
PhraseObject.prototype.flipNextPhraseLetter = function (letter_int) {
var _local1 = this;
var _local2 = letter_int;
var firstPhraseLetter_mc = null;
i = 0;
while (i < _local1.numberOfLetters_int) {
phraseLetter_object = _local1.phraseLetters_object[i];
if (!phraseLetter_object.isDisplayed_bool) {
if ((_local2 == phraseLetter_object.letter_int) || (_local1.phraseRevealed_bool)) {
phraseLetter_object.isDisplayed_bool = true;
phraseLetter_object.clip_mc.curLetter_string = phraseLetter_object.letter_string;
phraseLetter_object.clip_mc.letter_int = phraseLetter_object.letter_int;
phraseLetter_object.clip_mc.phraseRevealed_bool = _local1.phraseRevealed_bool;
_local1.hiddenLetters_int--;
phraseLetter_object.clip_mc.flip();
rootMain.playSound("RevealPhraseLetter");
return(true);
}
}
i++;
}
return(false);
};
PhraseObject.prototype.isPhraseComplete = function () {
return(this.hiddenLetters_int <= 0);
};
PhraseObject.prototype.setupPhraseLetters = function () {
var _local2 = this;
var _local1 = 0;
var _local3 = 0;
while (_local1 < _local2.phrase_string.length) {
if ((_local2.phrase_string.charCodeAt(_local1) >= 65) && (_local2.phrase_string.charCodeAt(_local1) <= 90)) {
_local2.phraseLetters_object[_local3] = new PhraseLetterObject(_local2.phrase_string.charCodeAt(_local1) - 64);
_local3++;
}
_local1++;
}
_local2.numberOfLetters_int = _local3;
_local2.hiddenLetters_int = _local3;
};
PhraseObject.prototype.getRandomHiddenLetter = function () {
var _local1 = this;
if (_local1.phrase_string == "") {
return(LETTER_BLANK);
}
if (_local1.hiddenLetters_int == 0) {
return(LETTER_BLANK);
}
index = Math.floor(Math.random() * (_local1.numberOfLetters_int - 1));
var _local2 = _local1.numberOfLetters_int;
while (_local2 > 0) {
if (!_local1.phraseLetters_object[index].isDisplayed_bool) {
return(_local1.phraseLetters_object[index].letter_int);
}
index++;
if (index >= _local1.numberOfLetters_int) {
index = 0;
}
_local2--;
}
return(LETTER_BLANK);
};
PhraseObject.prototype.addPhraseLetterClip = function (xDraw, yDraw, letterIndex) {
this.phraseLetters_object[letterIndex].clip_mc = rootMain.gameScreen_mc.phraseDisplay_mc.attachMovie("FlipPhraseLetter", "flipPhraseLetter_" + letterIndex, ++rootMain.curDepth_int);
with (this.phraseLetters_object[letterIndex].clip_mc) {
this.phraseLetters_object[letterIndex].clip_mc._x = START_FLIPPHRASELETTER_X;
this.phraseLetters_object[letterIndex].clip_mc._y = START_FLIPPHRASELETTER_Y;
this.phraseLetters_object[letterIndex].clip_mc.xEnd = xDraw;
this.phraseLetters_object[letterIndex].clip_mc.yEnd = yDraw;
}
};
PhraseObject.prototype.startFlyIn = function () {
var _local1 = this;
if (_local1.flyLetterIndex < _local1.numberOfLetters_int) {
_local1.phraseLetters_object[_local1.randomPhraseLetterIndices_int[_local1.flyLetterIndex]].clip_mc.startFly();
_local1.flyLetterIndex++;
} else {
clearInterval(_local1.flyIntervalID);
}
};
PhraseObject.prototype.startFlyOut = function () {
var _local1 = this;
if (_local1.flyLetterIndex < _local1.numberOfLetters_int) {
var _local2 = _local1.phraseLetters_object[_local1.randomPhraseLetterIndices_int[_local1.flyLetterIndex]].clip_mc;
_local2.xEnd = FINISH_FLIPPHRASELETTER_X;
_local2.yEnd = FINISH_FLIPPHRASELETTER_Y;
_local2.startFly();
_local1.flyLetterIndex++;
} else {
var _local2 = _local1.phraseLetters_object[_local1.randomPhraseLetterIndices_int[_local1.flyLetterIndex - 1]].clip_mc;
if ((_local2._x >= 360) || (_local2._x == undefined)) {
clearInterval(_local1.flyIntervalID);
rootMain.game_object.playNextRound();
}
}
};
PhraseObject.prototype.removePhraseLetterClips = function () {
var _local1 = this;
index = 0;
while (index < _local1.numberOfLetters_int) {
removeMovieClip(_local1.phraseLetters_object[index].clip_mc);
index++;
}
};
PhraseObject.prototype.setupPhraseString = function () {
var _local2 = this;
var nLen = _local2.phrase_string.length;
var nNumLines = 1;
_local2.sLine = new Array(3);
_local2.sLine[0] = new String();
var nLineIndex2 = _local2.getSubLine(0, 20, 0);
if (nLineIndex2 > 0) {
nNumLines = 2;
_local2.sLine[1] = new String();
var nLineIndex3 = _local2.getSubLine(nLineIndex2, 20, 1);
if (nLineIndex3 > 0) {
nNumLines = 3;
_local2.sLine[2] = new String();
_local2.getSubLine(nLineIndex3, 20, 2);
}
}
var xStart = 0;
var yStart = 0;
var xSpace = 16;
var ySpace = 17;
var xDraw = xStart;
var yDraw = yStart;
if (nNumLines == 2) {
yDraw = yDraw + (ySpace / 2);
}
if (nNumLines == 1) {
yDraw = yDraw + ySpace;
}
var nCount = 0;
var _local1 = 0;
var _local3;
var letterIndex = 0;
_local3 = 0;
while (_local3 < nNumLines) {
var nLen2 = _local2.sLine[_local3].length;
var nExtra = (20 - nLen2);
var xAdd = ((nExtra * xSpace) / 2);
xDraw = xDraw + xAdd;
_local1 = 0;
while (_local1 < nLen2) {
if (_local2.sLine[_local3].charAt(_local1) != " ") {
_local2.addPhraseLetterClip(xDraw, yDraw, letterIndex++);
}
xDraw = xDraw + xSpace;
_local1++;
}
xDraw = xStart;
yDraw = yDraw + ySpace;
_local3++;
}
if ((_local3 == 3) && (_local1 == 20)) {
_local2.phaseDisplayFull = true;
if (_local2.sLine[_local3 - 1].length() >= _local1) {
_local2.phraseOverflow = true;
}
}
rootMain.gameScreen_mc.phraseCategoryShown = "CATEGORY: " + _local2.category_string.toUpperCase();
rootMain.gameScreen_mc.phraseCategoryShown2 = rootMain.gameScreen_mc.phraseCategoryShown;
return(true);
};
PhraseObject.prototype.getSubLine = function (nStartIndex, nMaxLength, lineIndex) {
var _local1 = this;
var _local2 = lineIndex;
var _local3 = nStartIndex;
var nTotalLength = _local1.phrase_string.length;
if (_local3 >= nTotalLength) {
return(0);
}
var nLen = (_local1.phrase_string.length - _local3);
var i;
i = 0;
while (i <= nMaxLength) {
_local1.sLine[_local2] = _local1.sLine[_local2] + " ";
i++;
}
if (nLen <= nMaxLength) {
var j = 0;
i = 0;
while (i < nLen) {
if ((i != 0) || (_local1.phrase_string.charAt(_local3 + i) != " ")) {
_local1.sLine[_local2] = _local1.sLine[_local2].setCharAt(j++, _local1.phrase_string.charAt(_local3 + i));
}
i++;
}
if ((j < 1) && (_local1.sLine[_local2].charAt(j - 1) == " ")) {
j--;
}
_local1.sLine[_local2] = _local1.sLine[_local2].setLength(j);
return(0);
}
if (_local1.phrase_string.charAt(_local3 + nMaxLength) == " ") {
var j = 0;
i = 0;
while (i < nMaxLength) {
if ((i != 0) || (_local1.phrase_string.charAt(_local3 + i) != " ")) {
_local1.sLine[_local2] = _local1.sLine[_local2].setCharAt(j++, _local1.phrase_string.charAt(_local3 + i));
}
i++;
}
if ((j > 1) && (_local1.sLine[_local2].charAt(j - 1) == " ")) {
j--;
}
_local1.sLine[_local2] = _local1.sLine[_local2].setLength(j);
return((_local3 + nMaxLength) + 1);
}
var nCount = nMaxLength;
while (nCount > 0) {
if (_local1.phrase_string.charAt(_local3 + nCount) == " ") {
var j = 0;
var i;
i = 0;
while (i < nCount) {
if ((i != 0) || (_local1.phrase_string.charAt(_local3 + i) != " ")) {
_local1.sLine[_local2] = _local1.sLine[_local2].setCharAt(j++, _local1.phrase_string.charAt(_local3 + i));
}
i++;
}
if ((j > 1) && (_local1.sLine[_local2].charAt(j - 1) == " ")) {
j--;
}
_local1.sLine[_local2] = _local1.sLine[_local2].setLength(j);
return((_local3 + i) + 1);
}
nCount--;
}
var i;
i = 0;
while (i < nMaxLength) {
_local1.sLine[_local2] = _local1.sLine[_local2].setCharAt(i, _local1.phrase_string.charAt(_local3 + i));
i++;
}
_local1.sLine[_local2] = _local1.sLine[_local2].setLength(i);
return(_local3 + i);
};
PhraseObject.prototype.isLetterAlreadyRevealed = function (letter_int) {
var _local2 = this;
var _local3 = letter_int;
var _local1;
_local1 = 0;
while (_local1 < _local2.numberOfLetters_int) {
if (_local2.phraseLetters_object[_local1].letter_int == _local3) {
if (_local2.phraseLetters_object[_local1].isDisplayed_bool) {
return(true);
}
}
_local1++;
}
return(false);
};
PhraseObject.prototype.getNumRevealedLetters = function () {
return(this.numberOfLetters_int - this.hiddenLetters_int);
};
TrackerObject.prototype.clear = function () {
var _local1 = this;
_local1.lettersTracked_int = new Array();
i = 1;
while (i <= 26) {
_local1.lettersTracked_int[i] = false;
i++;
}
rootMain.gameScreen_mc.tracker_mc.clear();
};
TrackerObject.prototype.isLetterTracked = function (letter_int) {
return(this.lettersTracked_int[letter_int]);
};
TrackerObject.prototype.setLetterTracked = function (letter_int) {
this.lettersTracked_int[letter_int] = true;
rootMain.gameScreen_mc.tracker_mc.setLetter(letter_int);
};
ProjectileObject.prototype.init_g = function (screenHeight, startTime, X0, Y0, endX, endY, flightDuration, maxY, bDontMoveBeforeTime, bDontMoveAfterTime) {
var _local1 = Y0;
var _local3 = maxY;
var startX = X0;
this.m_screenHeight = screenHeight;
var _local2;
if (_local1 > _local3) {
_local2 = _local1 - _local3;
} else {
_local2 = _local3 - _local1;
}
return(this.init(startTime, X0, m_screenHeight - _local1, endX, m_screenHeight - endY, flightDuration, _local2, startX, bDontMoveBeforeTime, bDontMoveAfterTime));
};
ProjectileObject.prototype.init = function (startTime, X0, Y0, endX, endY, flightDuration, screenHeight, startX, bDontMoveBeforeTime, bDontMoveAfterTime) {
var _local1 = this;
_local1.m_TStart = _local1.convTime(startTime);
_local1.m_X0 = X0;
_local1.m_Y0 = Y0;
_local1.m_endX = endX;
_local1.m_endY = endY;
_local1.m_T = _local1.convTime(flightDuration);
_local1.m_h = screenHeight;
if (_local1.m_h < 0) {
_local1.m_h = -_local1.m_h;
}
_local1.m_R = _local1.m_endX - _local1.m_X0;
_local1.m_bDontMoveBeforeTime = bDontMoveBeforeTime;
_local1.m_bDontMoveAfterTime = bDontMoveAfterTime;
var _local2 = (Y0 + _local1.m_h) - endY;
if (_local2 < 0) {
_local2 = -_local2;
}
var _local3;
if (Y0 == endX) {
_local3 = _local1.m_T / 2;
} else if (_local2 > 0) {
_local3 = _local1.m_T / (Math.sqrt(_local2 / _local1.m_h) + 1);
} else {
_local3 = _local1.m_T;
}
_local1.m_g = (2 * _local1.m_h) / (_local3 * _local3);
_local1.m_V0Y = _local1.m_g * _local3;
_local1.m_V0X = _local1.m_R / _local1.m_T;
if (_local1.m_V0X < 0) {
_local1.m_V0XABS = -_local1.m_V0X;
} else {
_local1.m_V0XABS = _local1.m_V0X;
}
var startViewDistance;
if (startX < endX) {
startViewDistance = startX - _local1.m_X0;
} else {
startViewDistance = _local1.m_X0 - startX;
}
var tStartViewIntercept = (startViewDistance / _local1.m_V0XABS);
_local1.m_viewTime = _local1.m_T - tStartViewIntercept;
_local1.m_T0 = _local1.m_TStart - tStartViewIntercept;
_local1.m_bInitialized = true;
return(true);
};
ProjectileObject.prototype.getPos_g = function (t) {
var _local1 = this;
var _local2 = new Object();
if (!_local1.m_bInitialized) {
return(null);
}
var _local3 = _local1.convTime(t) - _local1.m_T0;
if ((_local3 < 0) && (_local1.m_bDontMoveBeforeTime)) {
_local2.x = _local1.m_X0;
_local2.y = _local1.m_Y0;
return(_local2);
}
if ((_local3 >= _local1.m_T) && (_local1.m_bDontMoveAfterTime)) {
_local2.x = _local1.m_endX;
_local2.y = _local1.m_endY;
return(_local2);
}
xPos = (_local1.m_V0X * _local3) + _local1.m_X0;
yPos = ((_local1.m_V0Y * _local3) - (((_local1.m_g * _local3) * _local3) / 2)) + _local1.m_Y0;
_local2.x = xPos;
_local2.y = yPos;
return(_local2);
};
ProjectileObject.prototype.getPos = function (t) {
var _local1 = this.getPos_g(t);
_local1.y = this.m_screenHeight - _local1.y;
return(_local1);
};
ProjectileObject.prototype.atEnd = function (t) {
var _local1 = this;
return((_local1.convTime(t) - _local1.m_T0) > _local1.m_T);
};
ProjectileObject.prototype.convTime = function (timeMS) {
return(timeMS / 1000);
};
LevenshteinDistanceObject.prototype.min3 = function (a, b, c) {
var _local1;
_local1 = a;
if (b < _local1) {
_local1 = b;
}
if (c < _local1) {
_local1 = c;
}
return(_local1);
};
LevenshteinDistanceObject.prototype.dist = function (s, t) {
var n;
var m;
var _local2;
var _local1;
var s_i;
var t_j;
var cost;
n = s.length;
m = t.length;
if (n == 0) {
return(m);
}
if (m == 0) {
return(n);
}
var _local3 = new Array();
index = 0;
while (index < (n + 1)) {
_local3.push(new Array(m + 1));
index++;
}
_local2 = 0;
while (_local2 <= n) {
_local3[_local2][0] = _local2;
_local2++;
}
_local1 = 0;
while (_local1 <= m) {
_local3[0][_local1] = _local1;
_local1++;
}
_local2 = 1;
while (_local2 <= n) {
s_i = s.charAt(_local2 - 1);
_local1 = 1;
while (_local1 <= m) {
t_j = t.charAt(_local1 - 1);
if (s_i == t_j) {
cost = 0;
} else {
cost = 1;
}
_local3[_local2][_local1] = this.min3(_local3[_local2 - 1][_local1] + 1, _local3[_local2][_local1 - 1] + 1, _local3[_local2 - 1][_local1 - 1] + cost);
_local1++;
}
_local2++;
}
return(_local3[n][m]);
};
rootMain.loadText();
stop();
Frame 5
function continueToStartGame() {
clearInterval(pauseStartIntervalID);
play();
}
var pauseStartIntervalID;
if (rootMain.game_object == null) {
rootMain.game_object = new GameObject(gameScreen_mc.gameGrid_mc, rootMain.dict_mc, rootMain);
rootMain.game_object.isSpinning_bool = true;
stop();
pauseStartIntervalID = setInterval(continueToStartGame, 100);
}
gameScreen_mc.tabEnabled = false;
Frame 6
stop();
rootMain.game_object.startNewGame();
Symbol 21 MovieClip [FlipPhraseLetter] Frame 1
function flip() {
removeMovieClip(smallLetter_mc[this._name + "_letter"]);
if (phraseRevealed_bool) {
gotoAndPlay ("fastflip");
} else {
gotoAndPlay ("flip");
}
}
function showLetter() {
var _local1 = this;
letter_mc = smallLetter_mc.attachMovie(_local1.curLetter_string + "_small", _local1._name + "_letter", ++rootMain.curDepth_int);
if ((letter_int != 0) && (!phraseRevealed_bool)) {
rootMain.game_object.flipPhraseLetterComplete(_local1.letter_int);
}
}
function startFly() {
var _local1 = this;
var _local2 = new Object();
var xStart = _local1._x;
var yStart = _local1._y;
var _local3 = getTimer();
var nFlightTime = 1000;
var nMaxHeight = (yEnd - 32);
_local1.projectile_object = new rootMain.ProjectileObject();
_local1.projectile_object.init_g(GAME_HEIGHT, _local3, xStart, yStart, xEnd, yEnd, nFlightTime, nMaxHeight, true, true);
_local2 = _local1.projectile_object.getPos(_local3);
_local1._x = _local2.x;
_local1._y = _local2.y - GAME_HEIGHT;
gotoAndPlay ("fly");
}
var curLetter_string = "Blank";
var phraseRevealed_bool;
var letter_int = 0;
var x_int;
var y_int;
var letter_mc;
var projectile_object;
var xEnd;
var yEnd;
this.useHandCursor = false;
Symbol 21 MovieClip [FlipPhraseLetter] Frame 2
stop();
this.showLetter();
Symbol 21 MovieClip [FlipPhraseLetter] Frame 3
var currentTime = getTimer();
var point = projectile_object.getPos(currentTime);
this._x = point.x;
this._y = point.y - GAME_HEIGHT;
if (this.projectile_object.atEnd(currentTime)) {
this.projectile_object = null;
stop();
if (this._x == FINISH_FLIPPHRASELETTER_X) {
removeMovieClip(this);
}
}
Symbol 21 MovieClip [FlipPhraseLetter] Frame 4
gotoAndPlay ("fly");
Symbol 21 MovieClip [FlipPhraseLetter] Frame 9
if (phraseRevealed_bool) {
rootMain.game_object.flipPhraseLetterComplete(this.letter_int);
}
Symbol 21 MovieClip [FlipPhraseLetter] Frame 12
gotoAndStop ("show");
Symbol 60 MovieClip [FlipLetter] Frame 1
function flip() {
var _local1 = this;
_local1.isSpinning_bool = false;
_local1.isFlipping_bool = true;
removeMovieClip(bigLetter_mc[_local1._name + "_letter"]);
gotoAndPlay ("flip");
}
function select() {
letter_mc.gotoAndStop("selected");
}
function deselect() {
letter_mc.gotoAndStop("normal");
}
function showLetter() {
var _local1 = this;
_local1.isFlipping_bool = false;
letter_mc = bigLetter_mc.attachMovie(_local1.curLetter_string + "_big", _local1._name + "_letter", ++rootMain.curDepth_int);
rootMain.game_object.checkForPowerup(x_int, y_int);
}
var curLetter_string = "Blank";
var x_int;
var y_int;
var letter_mc;
var isSpinning_bool;
var isFlipping_bool = false;
this.useHandCursor = false;
this.onRollOver = function () {
if (!this.isFlipping_bool) {
rootMain.game_object.showLetterHighlighter(this);
}
};
this.onRollOut = function () {
rootMain.game_object.hideLetterHighlighter();
};
this.onPress = function () {
rootMain.game_object.checkSelectLetter(x_int, y_int);
};
this.onDragOut = function () {
rootMain.game_object.isMouseDragged_bool = true;
};
Symbol 60 MovieClip [FlipLetter] Frame 2
stop();
this.showLetter();
if (!rootMain.game_object.isSpinning_bool) {
rootMain.game_object.isShuffling_bool = false;
}
Symbol 60 MovieClip [FlipLetter] Frame 19
if (!this.isSpinning_bool) {
gotoAndStop ("show");
}
Symbol 63 MovieClip [Star] Frame 1
function startFly() {
var _local1 = this;
var _local3 = new Object();
var xStart = _local1._x;
var yStart = _local1._y;
var dwStartTime = getTimer();
var nFlightTime = 1000;
var nMaxHeight = (yEnd - 32);
_local1.projectile_object = new rootMain.ProjectileObject();
_local1.projectile_object.init_g(GAME_HEIGHT, dwStartTime, xStart, yStart, xEnd, yEnd, nFlightTime, nMaxHeight, true, true);
_local3 = _local1.projectile_object.getPos(dwStartTime);
_local1._x = _local3.x;
_local1._y = _local3.y - GAME_HEIGHT;
_local1.onEnterFrame = function () {
var _local1 = this;
var _local2 = getTimer();
if (_local1.projectile_object.atEnd(_local2)) {
_local1.stopFly();
} else {
var _local3 = projectile_object.getPos(_local2);
_local1._x = _local3.x;
_local1._y = _local3.y - GAME_HEIGHT;
}
};
}
function stopFly() {
var _local1 = this;
delete _local1.onEnterFrame;
_local1.projectile_object = null;
rootMain.game_object.flipPhraseLetterComplete(_local1.letter_int);
removeMovieClip(_local1);
}
var letter_int;
var projectile_object;
var xEnd;
var yEnd;
startFly();
Symbol 64 MovieClip [DelayFly] Frame 10
rootMain.game_object.startFlyInPhraseLetters();
removeMovieClip(this);
Symbol 65 MovieClip [DelayGuessMeterRise] Frame 1
var letter_int;
Symbol 65 MovieClip [DelayGuessMeterRise] Frame 28
rootMain.game_object.guessMeterIncreaseStart(this.totalScore_int);
removeMovieClip(this);
Symbol 66 MovieClip [DelayFlip] Frame 1
var letter_int;
Symbol 66 MovieClip [DelayFlip] Frame 25
rootMain.game_object.phrase_object.isFlipping_bool = !rootMain.game_object.phrase_object.flipNextPhraseLetter(letter_int);
removeMovieClip(this);
Symbol 69 MovieClip [FlyingChar] Frame 1
function startFly() {
var _local1 = this;
var _local2 = _parent;
var point = new Object();
var dwStartTime = getTimer();
var nFlightTime = 750;
_local1.projectile_object = new rootMain.ProjectileObject();
_local1.projectile_object.init_g(GAME_HEIGHT, dwStartTime, _local2._x, _local2._y, _local2.xEnd, _local2.yEnd, nFlightTime, _local2.maxHeight_int, true, true);
point = _local1.projectile_object.getPos(dwStartTime);
_local1._x = point.x;
_local1._y = point.y - GAME_HEIGHT;
_local1.onEnterFrame = function () {
var _local1 = getTimer();
if (this.projectile_object.atEnd(_local1)) {
this.stopFly();
} else {
var _local2 = projectile_object.getPos(_local1);
_parent._x = _local2.x;
_parent._y = _local2.y - GAME_HEIGHT;
}
};
}
function stopFly() {
delete this.onEnterFrame;
this.projectile_object = null;
removeMovieClip(_parent);
}
var letter_int;
var projectile_object;
startFly();
Symbol 70 MovieClip [9_FL] Frame 15
stop();
Symbol 73 MovieClip [8_FL] Frame 15
stop();
Symbol 76 MovieClip [7_FL] Frame 15
stop();
Symbol 79 MovieClip [6_FL] Frame 15
stop();
Symbol 82 MovieClip [5_FL] Frame 15
stop();
Symbol 85 MovieClip [4_FL] Frame 15
stop();
Symbol 88 MovieClip [3_FL] Frame 15
stop();
Symbol 91 MovieClip [2_FL] Frame 15
stop();
Symbol 94 MovieClip [0_FL] Frame 15
stop();
Symbol 97 MovieClip [1_FL] Frame 15
stop();
Symbol 100 MovieClip [Multi_FL] Frame 15
stop();
Symbol 103 MovieClip [V_FL] Frame 15
stop();
Symbol 106 MovieClip [U_FL] Frame 15
stop();
Symbol 109 MovieClip [T_FL] Frame 15
stop();
Symbol 112 MovieClip [S_FL] Frame 15
stop();
Symbol 115 MovieClip [R_FL] Frame 15
stop();
Symbol 118 MovieClip [Q_FL] Frame 15
stop();
Symbol 121 MovieClip [P_FL] Frame 15
stop();
Symbol 124 MovieClip [O_FL] Frame 15
stop();
Symbol 127 MovieClip [N_FL] Frame 15
stop();
Symbol 130 MovieClip [M_FL] Frame 15
stop();
Symbol 133 MovieClip [L_FL] Frame 15
stop();
Symbol 136 MovieClip [K_FL] Frame 15
stop();
Symbol 139 MovieClip [J_FL] Frame 15
stop();
Symbol 142 MovieClip [I_FL] Frame 15
stop();
Symbol 145 MovieClip [H_FL] Frame 15
stop();
Symbol 148 MovieClip [G_FL] Frame 15
stop();
Symbol 151 MovieClip [F_FL] Frame 15
stop();
Symbol 154 MovieClip [E_FL] Frame 15
stop();
Symbol 157 MovieClip [D_FL] Frame 15
stop();
Symbol 160 MovieClip [C_FL] Frame 15
stop();
Symbol 163 MovieClip [B_FL] Frame 15
stop();
Symbol 166 MovieClip [A_FL] Frame 15
stop();
Symbol 169 MovieClip [Z_FL] Frame 15
stop();
Symbol 172 MovieClip [Y_FL] Frame 15
stop();
Symbol 175 MovieClip [X_FL] Frame 15
stop();
Symbol 178 MovieClip [W_FL] Frame 15
stop();
Symbol 198 MovieClip [FlipNumber] Frame 1
function flip() {
removeMovieClip(bigNumber_mc[this._name + "_number"]);
gotoAndPlay ("flip");
}
function showNumber() {
var _local1 = this;
number_mc = bigNumber_mc.attachMovie(_local1.curNumber_string + "_big", _local1._name + "_number", ++rootMain.curDepth_int);
if (_local1._parent._name == "turnCounter_mc") {
rootMain.gameScreen_mc.script_mc.checkLastTurn();
}
}
var curNumber_string = "0";
var number_mc;
this.useHandCursor = false;
Symbol 198 MovieClip [FlipNumber] Frame 2
stop();
this.showNumber();
Symbol 198 MovieClip [FlipNumber] Frame 19
gotoAndStop ("show");
Symbol 221 MovieClip Frame 1
preloader_mc.onEnterFrame = function () {
var _local2 = rootMain.dict_mc.getBytesTotal();
var rootTotal = rootMain.getBytesTotal();
var _local1 = _local2 + rootTotal;
var _local3 = (rootMain.dict_mc.getBytesLoaded() + rootMain.phrases_mc.getBytesLoaded()) + rootMain.getBytesLoaded();
if (((((_local3 >= _local1) && (_local1 > 0)) && (_local2 > 0)) && (rootMain.isLoaded_bool)) && (count > 20)) {
rootMain.loadingComplete();
delete this.onEnterFrame;
} else {
this._xscale = math.round((_local3 / _local1) * 100);
}
count++;
};
Symbol 231 MovieClip Frame 1
stop();
Symbol 249 MovieClip [0_Big] Frame 1
stop();
Symbol 252 MovieClip [1_Big] Frame 1
stop();
Symbol 255 MovieClip [2_Big] Frame 1
stop();
Symbol 258 MovieClip [3_Big] Frame 1
stop();
Symbol 261 MovieClip [4_Big] Frame 1
stop();
Symbol 264 MovieClip [5_Big] Frame 1
stop();
Symbol 267 MovieClip [6_Big] Frame 1
stop();
Symbol 270 MovieClip [7_Big] Frame 1
stop();
Symbol 273 MovieClip [8_Big] Frame 1
stop();
Symbol 276 MovieClip [9_Big] Frame 1
stop();
Symbol 305 MovieClip [A_Big] Frame 1
stop();
Symbol 310 MovieClip [B_Big] Frame 1
stop();
Symbol 315 MovieClip [C_Big] Frame 1
stop();
Symbol 320 MovieClip [D_Big] Frame 1
stop();
Symbol 325 MovieClip [E_Big] Frame 1
stop();
Symbol 330 MovieClip [F_Big] Frame 1
stop();
Symbol 335 MovieClip [G_Big] Frame 1
stop();
Symbol 340 MovieClip [H_Big] Frame 1
stop();
Symbol 345 MovieClip [I_Big] Frame 1
stop();
Symbol 350 MovieClip [J_Big] Frame 1
stop();
Symbol 355 MovieClip [K_Big] Frame 1
stop();
Symbol 360 MovieClip [L_Big] Frame 1
stop();
Symbol 365 MovieClip [M_Big] Frame 1
stop();
Symbol 370 MovieClip [N_Big] Frame 1
stop();
Symbol 375 MovieClip [O_Big] Frame 1
stop();
Symbol 380 MovieClip [P_Big] Frame 1
stop();
Symbol 385 MovieClip [Q_Big] Frame 1
stop();
Symbol 390 MovieClip [R_Big] Frame 1
stop();
Symbol 395 MovieClip [S_Big] Frame 1
stop();
Symbol 400 MovieClip [T_Big] Frame 1
stop();
Symbol 405 MovieClip [U_Big] Frame 1
stop();
Symbol 410 MovieClip [V_Big] Frame 1
stop();
Symbol 415 MovieClip [W_Big] Frame 1
stop();
Symbol 420 MovieClip [X_Big] Frame 1
stop();
Symbol 425 MovieClip [Y_Big] Frame 1
stop();
Symbol 430 MovieClip [Z_Big] Frame 1
stop();
Symbol 513 MovieClip Frame 1
stop();
Symbol 513 MovieClip Frame 23
gotoAndPlay ("show");
Symbol 516 MovieClip Frame 1
continue_btn.onPress = function () {
if (rootMain.isZoneAPI_bool) {
fscommand ("GameReady", rootMain.getZoneXML("GameReady"));
} else {
rootMain.gotoAndPlay("startgame");
}
};
Symbol 516 MovieClip Frame 2
click_mc.gotoAndPlay("show");
stop();
Symbol 559 MovieClip Frame 1
if (rootMain.isSound_bool) {
stop();
} else {
gotoAndStop ("muteon");
}
Symbol 580 MovieClip Frame 1
stop();
Symbol 580 MovieClip Frame 31
gotoAndStop ("hide");
_parent.gotoAndPlay("startincrease");
Symbol 581 MovieClip Frame 1
function increaseMeter(newPercentToIncrease_int) {
maxPercentToIncrease_int = maxPercentToIncrease_int + newPercentToIncrease_int;
this.isRising_bool = true;
gotoAndPlay ("startincrease");
}
function resetMeter() {
isRising_bool = false;
meterPercentDisplayed_int = 0;
meterPercentIncreased_int = 0;
resetMeterDisplay();
}
function resetMeterDisplay() {
meterPercentDisplayed_int = 0;
meterTop_mc._visible = false;
meterBottom_mc._visible = false;
meterMiddle_mc._visible = false;
meterMiddle_mc._yscale = 1;
}
function increaseComplete() {
maxPercentToIncrease_int = 0;
meterPercentIncreased_int = 0;
this.isRising_bool = false;
stop();
}
var isRising_bool;
var maxPercentToIncrease_int;
var meterPercentDisplayed_int;
var meterPercentIncreased_int;
resetMeter();
stop();
Symbol 581 MovieClip Frame 2
if (meterPercentIncreased_int >= maxPercentToIncrease_int) {
increaseComplete();
}
Symbol 581 MovieClip Frame 3
meterPercentDisplayed_int++;
meterPercentIncreased_int++;
meterMiddle_mc._yscale++;
if (meterPercentDisplayed_int >= 1) {
meterBottom_mc._visible = true;
meterMiddle_mc._visible = true;
} else {
meterBottom_mc._visible = false;
}
if (meterPercentDisplayed_int >= 100) {
meterTop_mc._visible = true;
rootMain.game_object.awardExtraTurn();
guessMeterAlert_mc.gotoAndPlay("show");
resetMeterDisplay();
stop();
} else {
meterTop_mc._visible = false;
}
if (meterPercentIncreased_int >= maxPercentToIncrease_int) {
increaseComplete();
}
Symbol 581 MovieClip Frame 4
gotoAndPlay ("increase");
Symbol 582 MovieClip Frame 1
stop();
this.onMouseUp = function () {
rootMain.game_object.isMouseDragged_bool = false;
};
this.onMouseMove = function () {
if (!rootMain.isPaused_bool) {
rootMain.game_object.checkDragLetterSelect(_xmouse, _ymouse);
}
};
Symbol 588 MovieClip Frame 1
function update(word_string, score_int) {
curWordShown1 = word_string;
curWordShown2 = word_string;
if (score_int > 0) {
curScoreShown1 = score_int + " points";
} else {
curScoreShown1 = "";
}
curScoreShown2 = curScoreShown1;
}
stop();
Symbol 589 MovieClip Frame 1
function flipNumbers(newNumber_int) {
var newNumber_string = String(newNumber_int);
var maxIndex = (currentNumber_string.length - newNumber_string.length);
index = 0;
while (index < maxIndex) {
newNumber_string = "0" + newNumber_string;
index++;
}
index = 0;
while (index < maxNumberCount) {
if (newNumber_string.charAt(index) != currentNumber_string.charAt(index)) {
with (this[(("flipNumber" + numberType_string) + (index + 1)) + "_mc"]) {
curNumber_string = newNumber_string.charAt(index);
flip();
}
}
index++;
}
currentNumber_string = newNumber_string;
}
var numberType_string = "Round";
var currentNumber_string = "000";
var maxNumberCount = 3;
Symbol 590 MovieClip Frame 1
function flipNumbers(newNumber_int) {
var newNumber_string = String(newNumber_int);
if (newNumber_string.length < 2) {
newNumber_string = "0" + newNumber_string;
}
index = 0;
while (index < maxNumberCount) {
if (newNumber_string.charAt(index) != currentNumber_string.charAt(index)) {
with (this[(("flipNumber" + numberType_string) + (index + 1)) + "_mc"]) {
curNumber_string = newNumber_string.charAt(index);
flip();
}
}
index++;
}
currentNumber_string = newNumber_string;
}
var numberType_string = "Turn";
var currentNumber_string = "00";
var maxNumberCount = 2;
Symbol 591 MovieClip Frame 1
function flipNumbers(newNumber_int) {
var newNumber_string = String(newNumber_int);
var maxIndex = (currentNumber_string.length - newNumber_string.length);
index = 0;
while (index < maxIndex) {
newNumber_string = "0" + newNumber_string;
index++;
}
index = 0;
while (index < maxNumberCount) {
if (newNumber_string.charAt(index) != currentNumber_string.charAt(index)) {
with (this[(("flipNumber" + numberType_string) + (index + 1)) + "_mc"]) {
curNumber_string = newNumber_string.charAt(index);
flip();
}
}
index++;
}
currentNumber_string = newNumber_string;
}
var numberType_string = "Score";
var currentNumber_string = "0000000";
var maxNumberCount = 7;
Symbol 592 MovieClip Frame 1
function checkLastTurn() {
if (rootMain.game_object.currentTurns_int <= 0) {
this.onEnterFrame = function () {
if (!rootMain.gameScreen_mc.guessMeter_mc.isRising_bool) {
delete this.onEnterFrame;
if (rootMain.game_object.currentTurns_int <= 0) {
rootMain.game_object.showGuessPhrase();
}
}
};
}
}
Symbol 595 MovieClip Frame 1
stop();
Symbol 598 MovieClip Frame 1
stop();
Symbol 601 MovieClip Frame 1
stop();
Symbol 604 MovieClip Frame 1
stop();
Symbol 607 MovieClip Frame 1
stop();
Symbol 610 MovieClip Frame 1
stop();
Symbol 613 MovieClip Frame 1
stop();
Symbol 616 MovieClip Frame 1
stop();
Symbol 619 MovieClip Frame 1
stop();
Symbol 622 MovieClip Frame 1
stop();
Symbol 625 MovieClip Frame 1
stop();
Symbol 628 MovieClip Frame 1
stop();
Symbol 631 MovieClip Frame 1
stop();
Symbol 634 MovieClip Frame 1
stop();
Symbol 637 MovieClip Frame 1
stop();
Symbol 640 MovieClip Frame 1
stop();
Symbol 643 MovieClip Frame 1
stop();
Symbol 646 MovieClip Frame 1
stop();
Symbol 649 MovieClip Frame 1
stop();
Symbol 652 MovieClip Frame 1
stop();
Symbol 655 MovieClip Frame 1
stop();
Symbol 658 MovieClip Frame 1
stop();
Symbol 661 MovieClip Frame 1
stop();
Symbol 664 MovieClip Frame 1
stop();
Symbol 667 MovieClip Frame 1
stop();
Symbol 670 MovieClip Frame 1
stop();
Symbol 671 MovieClip Frame 1
function clear() {
var _local1 = this;
i = 1;
while (i <= 26) {
_local1[String.fromCharCode(64 + i) + "_mc"].gotoAndStop("hide");
i++;
}
}
function setLetter(letter_int) {
this[String.fromCharCode(64 + letter_int) + "_mc"].gotoAndStop("show");
}
Symbol 678 MovieClip Frame 1
function showPopup(popupType_int) {
var _local1 = popupType_int;
if (_local1 == 1) {
clearInterval(intervalID);
gotoAndStop ("firstletterexists");
} else if (_local1 == 2) {
clearInterval(intervalID);
gotoAndStop ("firstletternotexists");
} else if (_local1 == 3) {
clearInterval(intervalID);
gotoAndStop ("guessphrase");
}
intervalID = setInterval(hidePopup, 10000);
}
function hidePopup() {
clearInterval(intervalID);
gotoAndStop ("hide");
}
var intervalID;
stop();
Symbol 683 MovieClip Frame 1
overlay_btn.useHandCursor = false;
Symbol 710 MovieClip Frame 1
stop();
rootMain.isPaused_bool = false;
Symbol 710 MovieClip Frame 2
function ok() {
rootMain.playSound("ButtonClick");
Key.removeListener(keyHandler);
gotoAndStop ("hide");
}
function download() {
rootMain.playSound("ButtonClick");
rootMain.downloadFullVersion();
}
rootMain.isPaused_bool = true;
MessageTitleShown = rootMain.getText(0);
MessageTextShown = rootMain.getText(1);
download_btn.tabIndex = 0;
ok_btn.tabIndex = 1;
var keyHandler = new Object();
keyHandler.onKeyDown = function () {
var _local1 = Key.getCode();
if (_local1 == 13) {
if (String(Selection.getFocus()) == String(ok_btn)) {
ok();
} else if (String(Selection.getFocus()) == String(download_btn)) {
download();
} else {
ok();
}
}
};
ok_btn.onRelease = function () {
ok();
};
download_btn.onRelease = function () {
download();
};
Key.addListener(keyHandler);
Symbol 710 MovieClip Frame 3
function submit() {
rootMain.playSound("ButtonClick");
gotoAndStop ("hide");
Key.removeListener(guessPhraseKeyHandler);
rootMain.game_object.guessPhrase(rootMain.phraseInput_string);
}
Key.removeListener(guessPhraseKeyHandler);
Key.removeListener(keyHandler);
rootMain.isPaused_bool = true;
rootMain.phraseInput_string = "";
phraseInputShown = "_";
ok_btn.tabIndex = 0;
var guessPhraseKeyHandler = new Object();
guessPhraseKeyHandler.onKeyDown = function () {
var _local1 = Key.getCode();
if ((((_local1 >= 65) && (_local1 <= 90)) || ((_local1 >= 97) && (_local1 <= 122))) || (_local1 == 32)) {
key_string = String.fromCharCode(_local1);
rootMain.phraseInput_string = rootMain.phraseInput_string + key_string;
phraseInputShown = rootMain.phraseInput_string + "_";
} else if (_local1 == 8) {
rootMain.phraseInput_string = rootMain.phraseInput_string.slice(0, -1);
phraseInputShown = rootMain.phraseInput_string + "_";
} else if (_local1 == 13) {
submit();
}
};
Key.addListener(guessPhraseKeyHandler);
ok_btn.onRelease = function () {
submit();
};
Symbol 710 MovieClip Frame 4
function ok() {
rootMain.playSound("ButtonClick");
Key.removeListener(keyHandler);
gotoAndStop ("hide");
}
rootMain.isPaused_bool = true;
MessageTitleShown = rootMain.getText(0);
MessageTextShown = rootMain.getText(2);
ok_btn.tabIndex = 0;
var keyHandler = new Object();
keyHandler.onKeyDown = function () {
var _local1 = Key.getCode();
if (_local1 == 13) {
ok();
}
};
ok_btn.onRelease = function () {
ok();
};
Key.addListener(keyHandler);
Symbol 715 MovieClip Frame 1
stop();
Symbol 715 MovieClip Frame 2
rootMain.isPaused_bool = true;
Symbol 715 MovieClip Frame 16
rootMain.game_object.awardPhraseCompleteBonus();
Symbol 715 MovieClip Frame 40
rootMain.gameScreen_mc.roundComplete_mc.gotoAndPlay("show");
Symbol 727 MovieClip Frame 1
stop();
Symbol 727 MovieClip Frame 2
ok_btn.useHandCursor = false;
rootMain.isPaused_bool = true;
Symbol 727 MovieClip Frame 11
function update() {
clearInterval(updateIntervalID);
clickContinue_mc.gotoAndPlay("show");
rootMain.isPaused_bool = false;
rootMain.game_object.awardRoundBonus(totalBonusPoints_int);
}
ok_btn.onPress = function () {
if (!rootMain.isPaused_bool) {
rootMain.isPaused_bool = true;
if ((rootMain.isZoneAPI_bool && (rootMain.isGameBreakSupport_bool)) && (rootMain.game_object.currentRound_int < MAX_ROUNDS)) {
fscommand ("GameBreak", rootMain.getZoneXML("GameBreak"));
} else {
clickContinue_mc.gotoAndStop("hide");
gotoAndPlay ("transition");
}
}
};
stop();
var totalBonusPoints_int = 0;
var updateIntervalID;
roundCompleteWindow_mc.bestWordShown1 = rootMain.game_object.bestWord_string;
roundCompleteWindow_mc.bestWordPointsShown1 = rootMain.game_object.bestWordScore_int;
roundCompleteWindow_mc.turnsLeftShown1 = rootMain.game_object.currentTurns_int;
totalBonusPoints_int = rootMain.game_object.bestWordScore_int * rootMain.game_object.currentTurns_int;
roundCompleteWindow_mc.totalBonusPointsShown1 = totalBonusPoints_int;
roundCompleteWindow_mc.bestWordShown2 = roundCompleteWindow_mc.bestWordShown1;
roundCompleteWindow_mc.bestWordPointsShown2 = roundCompleteWindow_mc.bestWordPointsShown1;
roundCompleteWindow_mc.turnsLeftShown2 = roundCompleteWindow_mc.turnsLeftShown1;
roundCompleteWindow_mc.totalBonusPointsShown2 = roundCompleteWindow_mc.totalBonusPointsShown1;
updateIntervalID = setInterval(update, 1500);
Symbol 727 MovieClip Frame 12
rootMain.game_object.startNextRound();
Symbol 734 Button
on (release) {
rootMain.playSound("ButtonClick");
rootMain.downloadFullVersion();
}
Symbol 741 Button
on (press) {
rootMain.playSound("ButtonClick");
getURL ("javascript:submitChallenge()");
}
Symbol 744 MovieClip Frame 1
stop();
Symbol 744 MovieClip Frame 2
ok_btn.useHandCursor = false;
rootMain.isPaused_bool = true;
Symbol 744 MovieClip Frame 11
stop();
score = _root.gameScreen_mc.scoreCounter_mc.currentNumber_string;
i = 0;
while (score.charAt(i) == "0") {
i++;
}
score = score.substring(i);
if (score.length < 1) {
score = 0;
}
score = score.toString();
scoreEncoded = _root.Grab_encode(score);
getURL (((((("javascript:reportGameScore('" + _root.gameIDencoded) + "', '") + scoreEncoded) + "', '") + _root.grab_ccode) + "')");
function update() {
clickContinue_mc.gotoAndPlay("show");
rootMain.isPaused_bool = false;
}
ok_btn.onPress = function () {
if (!rootMain.isPaused_bool) {
if (rootMain.isZoneAPI_bool) {
gotoAndStop ("hide");
fscommand ("GameEnd", rootMain.getZoneXML("GameEnd"));
} else {
clickContinue_mc.gotoAndStop("hide");
gotoAndPlay ("transition");
}
}
};
stop();
var totalBonusPoints_int = 0;
var updateIntervalID;
rootMain.game_object.phrase_object.revealAllLetters();
Symbol 744 MovieClip Frame 20
rootMain.game_object.startNewGame();
Symbol 753 Button
on (press) {
rootMain.playSound("ButtonClick");
getURL ("javascript:submitChallenge()");
}
Symbol 754 MovieClip Frame 1
stop();
Symbol 754 MovieClip Frame 2
ok_btn.useHandCursor = false;
rootMain.isPaused_bool = true;
Symbol 754 MovieClip Frame 11
stop();
score = _root.gameScreen_mc.scoreCounter_mc.currentNumber_string;
i = 0;
while (score.charAt(i) == "0") {
i++;
}
score = score.substring(i);
if (score.length < 1) {
score = 0;
}
score = score.toString();
scoreEncoded = _root.Grab_encode(score);
getURL (((((("javascript:reportGameScore('" + _root.gameIDencoded) + "', '") + scoreEncoded) + "', '") + _root.grab_ccode) + "')");
ok_btn.onPress = function () {
if (!rootMain.isPaused_bool) {
if (rootMain.isZoneAPI_bool) {
gotoAndStop ("hide");
fscommand ("GameEnd", rootMain.getZoneXML("GameEnd"));
} else {
clickContinue_mc.gotoAndStop("hide");
gotoAndPlay ("transition");
}
}
};
rootMain.isPaused_bool = false;
clickContinue_mc.gotoAndPlay("show");
stop();
Symbol 754 MovieClip Frame 20
rootMain.game_object.startNewGame();
Symbol 772 MovieClip Frame 1
stop();
Symbol 772 MovieClip Frame 2
currentPhraseShown = rootMain.game_object.phrase_object.phrase_string;
wordListShown = rootMain.createdWord_string;
score_txt.text = rootMain.wordScoreForAll;
overlay_btn.useHandCursor = false;
close_btn.onRelease = function () {
if (score_txt.text != "") {
rootMain.wordScoreForAll = score_txt.text;
}
gotoAndStop ("hide");
};
cheat1_btn.onRelease = function () {
rootMain.alwaysCorrectGuess_bool = !rootMain.alwaysCorrectGuess_bool;
gotoAndStop ("hide");
};
cheat2_btn.onRelease = function () {
rootMain.createSomeWords_bool = true;
rootMain.createdWord_string = wordList_txt.text;
rootMain.game_object.shuffleLetters();
gotoAndStop ("hide");
};
cheat3_btn.onRelease = function () {
rootMain.mustSetPowerups_bool = !rootMain.mustSetPowerups_bool;
gotoAndStop ("hide");
};
cheat4_btn.onRelease = function () {
rootMain.game_object.currentRound_int = MAX_ROUNDS - 1;
rootMain.updateCounters(null, null, rootMain.game_object.currentRound_int);
gotoAndStop ("hide");
};
cheat5_btn.onRelease = function () {
rootMain.game_object.currentTurns_int = 1;
rootMain.updateCounters(rootMain.game_object.currentTurns_int);
gotoAndStop ("hide");
};
Symbol 773 MovieClip Frame 1
stop();
shuffle_btn.tabEnabled = false;
guess_btn.tabEnabled = false;
submit_btn.tabEnabled = false;
mute_btn.tabEnabled = false;
mute_mc.tabEnabled = false;
help_btn.tabEnabled = false;
cheat_btn.useHandCursor = false;
cheat_btn.tabEnabled = false;
cancelWord_btn.useHandCursor = false;
shuffle_btn.onRelease = function () {
rootMain.playSound("ButtonClick");
rootMain.game_object.shuffleLetters();
};
guess_btn.onRelease = function () {
rootMain.playSound("ButtonClick");
rootMain.game_object.showGuessPhrase();
};
submit_btn.onRelease = function () {
rootMain.game_object.checkAndSubmitWord();
};
help_btn.onRelease = function () {
rootMain.playSound("ButtonClick");
rootMain.showHelp();
};
mute_btn.onRelease = function () {
if (rootMain.isSound_bool) {
mute_mc.gotoAndStop("muteon");
rootMain.isSound_bool = false;
stopAllSounds();
}
};
mute_mc.onRelease = function () {
if (!rootMain.isSound_bool) {
mute_mc.gotoAndStop("muteoff");
rootMain.isSound_bool = true;
}
};
cancelWord_btn.onPress = function () {
rootMain.game_object.removeChainLetter(0, true);
};
cheat_btn.onPress = function () {
if (rootMain.isCheatsEnabled_bool) {
cheats_mc.gotoAndStop("show");
}
};
Instance of Symbol 582 MovieClip "gameGrid_mc" in Symbol 773 MovieClip Frame 1
onClipEvent (keyDown) {
rootMain.keyPressed();
}