Frame 1
_global.debugMode = true;
infoTitle.text = "";
infoText.text = "";
startButton.label.text = "";
warnLabel.text = "";
startButton._visible = false;
if (debugMode) {
warnLabel.text = "Warning: Debug client";
gameData = (((((((((((((((((("<gamedata timelimit=\"300\" seed=\"1188891958\" characters=\"T \u017B L B \u00D3 \u0104 Y D W Y N N \u0118 Y E E K M E \u00D3 B A N M A I E E P Y E R I N \u0118 T I C Z Y S U A F B \u0179 W S Y R A S N A I O P U E B O O W S J \u00D3 E G R O C D T C G P O M \u0179 W \u0141 I F I D W S O N R I T A E A K U Y Y \u0104 B S I R N U E A A Y T N A J K O W \u0143 N W O Y I O D A Y P \u0118 I Y A U L L A O H T C C J M A M L O W Z K \" scores=\"2 1 7 2 2 1 1 1 1 1 2 2 2 1 3 1 5 3 1 2 1 2 10 1 1 8 1 1 1 1 1 1 1 1 1 1 5 1 1 1 1 1 3 3 7 8 1 4 1 4 1 3 2 7 1 1 1 2 7 1 1 4 1 4 1 1 1 1 1 1 5 2 1 1 2 1 7 1 1 1 1 1 4 1 1 1 1 1 2 2 1 2 1 1 2 1 1 1 2 1 2 1 2 1 4 5 2 2 2 1 1 1 2 1 4 1 1 1 1 1 2 1 1 3 4 2 1 2 1 4 5 2 2 2 1 1 1 2 1 4 1 1 1 1 1 2 1 1 3 4 \" bonuscoords=\"0 0 1 0 2 0 3 0 4 0 0 1 1 1 2 1 3 1 4 1 0 2 1 2 2 2 3 2 4 2 0 3 1 3 2 3 3 3 4 3 0 4 1 4 2 4 3 4 4 4 \" relaxMode=\"true\"><text id=\"welcome\">\u00E4Welcome to Keyword</text><text id=\"round\">\u00E4Round</text><text id=\"button_play\">\u00E4Play!</text><text id=\"instuctions1\">\u00E4The aim of this game is to...\n\n\n\njhasdasda\nfdadaskjda\n\n\n\n\n\n\n\njdas</text><text id=\"the_game_will_end_in\">\u00E4The game will end in</text>" + "<text id=\"the_game_will_end\">\u00E4The game will end in {0} seconds</text>") + "<text id=\"game_over\">\u00E4Game over!</text>") + "<text id=\"round1_title\">\u00E4Round 1</text>") + "<text id=\"round2_title\">\u00E4Round 2</text>") + "<text id=\"round3_title\">\u00E4Round 3</text>") + "<text id=\"round4_title\">\u00E4Round 4</text>") + "<text id=\"round5_title\">\u00E4Round 5</text>") + "<text id=\"roundx_title\">\u00E4Bonus round</text>") + "<text id=\"did_not_qualify\">\u00E4You did not qualify for the bonus round</text>") + "<text id=\"total_score\">\u00E4Total score</text>") + "<text id=\"score\">\u00E4Score</text>") + "<text id=\"out_of_time\">\u00E4You ran out of time</text>") + "<text id=\"seconds\">\u00E4seconds</text>") + "<text id=\"time_left\">\u00E4Time Left</text>") + "<text id=\"bonus\">\u00E4Bonus</text>") + "<text id=\"best_word\">\u00E4Best word</text>") + "<text id=\"end_round\">\u00E4End Round</text>") + "<text id=\"end_game\">\u00E4End Game</text>") + "</gamedata>";
}
var inited = false;
onEnterFrame = function () {
if ((!inited) && (gameData != undefined)) {
_root.gameData = gameData;
inited = true;
startButton._visible = true;
board.initGame();
infoTitle.text = _global.textMappings.welcome;
var _local3 = _global.textMappings.instuctions1;
_local3 = _local3.split("\r\n").join(newline);
_local3 = _local3.split("\n\r").join(newline);
_local3 = _local3.split("\r").join(newline);
_local3 = _local3.split(newline).join(newline);
infoText.text = _local3;
endGameLabel.text = _global.textMappings.end_game;
startButton.label.text = _global.textMappings.button_play;
startButton.onPress = function () {
startButton._visible = false;
infoTitle._visible = false;
infoText._visible = false;
board.startGame();
};
}
if (response != undefined) {
board.responseReceived(response);
response = undefined;
}
};
Symbol 180 MovieClip [Letter] Frame 1
#initclip 11
Object.registerClass("Letter", com.midasplayer.wordbattle.Letter);
#endinitclip
Symbol 192 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 7
stop();
Symbol 192 MovieClip Frame 35
stop();
Symbol 193 MovieClip [LetterHolder] Frame 1
#initclip 7
Object.registerClass("LetterHolder", com.midasplayer.wordbattle.LetterHolder);
#endinitclip
Symbol 198 MovieClip [NumberFlipper] Frame 1
#initclip 8
Object.registerClass("NumberFlipper", com.midasplayer.wordbattle.NumberFlipper);
#endinitclip
Symbol 210 Button
on (press) {
_parent.clearClicked();
}
Symbol 217 MovieClip Frame 1
stop();
Symbol 217 MovieClip Frame 2
stop();
Symbol 217 MovieClip Frame 3
stop();
Symbol 219 MovieClip [WordLabel] Frame 1
#initclip 9
Object.registerClass("WordLabel", com.midasplayer.wordbattle.WordLabel);
#endinitclip
Symbol 229 MovieClip Frame 35
stop();
Symbol 229 MovieClip Frame 59
stop();
Symbol 232 MovieClip Frame 45
stop();
Symbol 232 MovieClip Frame 76
stop();
Symbol 261 MovieClip Frame 66
stop();
Symbol 261 MovieClip Frame 104
stop();
Symbol 288 MovieClip Frame 1
stop();
Symbol 288 MovieClip Frame 11
stop();
Symbol 288 MovieClip Frame 20
stop();
Symbol 297 MovieClip Frame 1
stop();
Symbol 297 MovieClip Frame 11
stop();
Symbol 297 MovieClip Frame 20
stop();
Symbol 306 MovieClip Frame 1
stop();
Symbol 306 MovieClip Frame 11
stop();
Symbol 306 MovieClip Frame 20
stop();
Symbol 315 MovieClip Frame 1
stop();
Symbol 315 MovieClip Frame 11
stop();
Symbol 315 MovieClip Frame 20
stop();
Symbol 324 MovieClip Frame 1
stop();
Symbol 324 MovieClip Frame 11
stop();
Symbol 324 MovieClip Frame 20
stop();
Symbol 327 MovieClip Frame 1
stop();
Symbol 327 MovieClip Frame 20
stop();
Symbol 327 MovieClip Frame 60
stop();
Symbol 330 MovieClip Frame 1
stop();
Symbol 330 MovieClip Frame 23
stop();
Symbol 330 MovieClip Frame 60
stop();
Symbol 333 MovieClip Frame 1
stop();
Symbol 333 MovieClip Frame 15
stop();
Symbol 333 MovieClip Frame 60
stop();
Symbol 336 MovieClip Frame 1
stop();
Symbol 336 MovieClip Frame 30
stop();
Symbol 336 MovieClip Frame 60
stop();
Symbol 339 MovieClip Frame 1
stop();
Symbol 339 MovieClip Frame 20
stop();
Symbol 339 MovieClip Frame 60
stop();
Symbol 345 MovieClip [Board] Frame 1
#initclip 10
Object.registerClass("Board", com.midasplayer.wordbattle.Board);
#endinitclip
Symbol 363 Button
on (rollOver) {
_root.endGameLabel.textColor = 16777215 /* 0xFFFFFF */;
}
on (rollOut) {
_root.endGameLabel.textColor = 39321;
}
on (press) {
trace("Game over clicked");
_root.board.endGame();
}
Symbol 365 MovieClip [__Packages.com.midasplayer.wordbattle.LetterHolder] Frame 0
class com.midasplayer.wordbattle.LetterHolder extends MovieClip
{
var letter, tint1, tint2, tintColor1, tintColor2, board, lowerLetter;
function LetterHolder () {
super();
letter._visible = false;
tint1._visible = false;
tint2._visible = false;
tintColor1 = new Color(tint1);
tintColor1.setTransform({ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:0, ab:0});
tintColor2 = new Color(tint2);
tintColor2.setTransform({ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:0, ab:0});
}
function init(board, x, y) {
this.board = board;
lowerLetter.init(x, y);
}
function reveal(charStr, scoreStr, bonusType) {
revealing = true;
letter._visible = true;
letter.copyFrom(lowerLetter);
lowerLetter.setup(charStr, scoreStr, bonusType);
tintColor1.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:0, ab:0});
tintColor2.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:100, ab:0});
tint1._visible = true;
tint2._visible = true;
ya = 1;
}
function onPress() {
board.letterPressed(lowerLetter);
}
function onRollOver() {
if (lowerLetter.occupied != null) {
lowerLetter.occupied.previewMode = true;
}
}
function onRollOut() {
if (lowerLetter.occupied != null) {
lowerLetter.occupied.previewMode = false;
}
}
function onMouseUp() {
lowerLetter.pressed = false;
}
function onDragOut() {
lowerLetter.pressed = false;
}
function onEnterFrame() {
if (revealing) {
letter.y = letter.y - ya;
ya = ya + 1;
lowerLetter.y = (48 + letter.y) / 10;
tint1._y = letter._y / 6;
tint2._y = letter._y + 48;
if (letter._y < -48) {
revealing = false;
letter._visible = false;
letter.y = 0;
letter.clear();
lowerLetter.y = 0;
ya = 0;
tint1._visible = false;
tint2._visible = false;
tintColor1.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:100, ab:0});
tintColor2.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:100, ab:0});
} else {
tintColor1.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:((-letter._y) * 50) / 30, ab:0});
tintColor2.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:50 + ((letter._y * 50) / 48), ab:0});
}
}
}
var t = 0;
var ya = 0;
var revealing = false;
}
Symbol 366 MovieClip [__Packages.com.midasplayer.wordbattle.Letter] Frame 0
class com.midasplayer.wordbattle.Letter extends MovieClip
{
var bg, letterClip, scoreClip, bonusClip, y, h, letter, score, bonus, idString, yPos, xPos, _y;
function Letter () {
super();
bg.stop();
bg.gotoAndStop(13);
letterClip.stop();
scoreClip.stop();
bonusClip.stop();
y = 0;
h = 0;
mode = 4;
col = 0;
}
function clear() {
letterClip.gotoAndStop(0);
scoreClip.gotoAndStop(0);
bonusClip.gotoAndStop(0);
}
function setup(charStr, scoreStr, bonusType) {
letter = charStr;
score = Number(scoreStr);
bonus = bonusType;
letterClipPos = Math.floor(letterPositions.indexOf(charStr) / 2) + 1;
if (letterClipPos <= 0) {
var _local6 = getUnshownLetter(charStr);
letterClipPos = Math.floor(letterPositions.indexOf(_local6) / 2) + 1;
_root.debugText.text = _root.debugText.text + (((charStr + ": ") + letterClipPos) + "\r");
}
scoreClipPos = score + 2;
bonusClipPos = bonus + 1;
if (((scoreStr == "") || (scoreStr == undefined)) || (scoreStr == null)) {
scoreClipPos = 1;
}
letterClip.gotoAndStop(letterClipPos);
scoreClip.gotoAndStop(scoreClipPos);
bonusClip.gotoAndStop(bonusClipPos);
mode = 0;
var _local4 = "N";
if (bonus == BONUS_2X_LETTER) {
_local4 = "2L";
} else if (bonus == BONUS_3X_LETTER) {
_local4 = "3L";
} else if (bonus == BONUS_2X_WORD) {
_local4 = "2W";
}
idString = (((((("" + xPos) + ",") + yPos) + ",") + _local4) + ",") + charStr;
occupied = null;
mode = 0;
if ((bonus == BONUS_2X_LETTER) || (bonus == BONUS_3X_LETTER)) {
mode = 1;
}
if (bonus == BONUS_2X_WORD) {
mode = 3;
}
bg.gotoAndStop(((mode * 3) + 1) + col);
if (((charStr == null) || (charStr == undefined)) || (charStr == "")) {
mode = 4;
col = 0;
bg.gotoAndStop(1);
bg.gotoAndStop(13);
letterClip.gotoAndStop(1);
scoreClip.gotoAndStop(1);
bonusClip.gotoAndStop(1);
}
}
function copyFrom(letter) {
letterClip.gotoAndStop(letter.letterClipPos);
scoreClip.gotoAndStop(letter.scoreClipPos);
bonusClip.gotoAndStop(letter.bonusClipPos);
bg.gotoAndStop(((letter.mode * 3) + 1) + letter.col);
}
function init(xPos, yPos) {
this.xPos = xPos;
this.yPos = yPos;
h = 0;
ha = 0;
}
function setColor(col) {
this.col = col;
bg.gotoAndStop(((mode * 3) + 1) + this.col);
}
function onEnterFrame() {
if (_y != Math.floor(y - h)) {
_y = Math.floor(y - h);
}
h = h + ha;
if (!pressed) {
ha = ha + 0.5;
}
var _local2 = 0;
if (col != 0) {
_local2 = -2;
}
if ((occupied != null) && (occupied.previewMode)) {
}
if (h >= _local2) {
ha = 0;
h = _local2;
}
}
function isNear(x, y) {
return(Math.max(Math.abs(x - xPos), Math.abs(y - yPos)) == 1);
}
function getUnshownLetter(l) {
if (l == String.fromCharCode(260)) {
return("_A");
}
if (l == String.fromCharCode(262)) {
return("_C");
}
if (l == String.fromCharCode(280)) {
return("_E");
}
if (l == String.fromCharCode(321)) {
return("_L");
}
if (l == String.fromCharCode(323)) {
return("_N");
}
if (l == String.fromCharCode(211)) {
return("_O");
}
if (l == String.fromCharCode(346)) {
return("_S");
}
if (l == String.fromCharCode(377)) {
return("_Z");
}
if (l == String.fromCharCode(379)) {
return(":Z");
}
if (l == String.fromCharCode(198)) {
return("ae");
}
if (l == String.fromCharCode(216)) {
return("_o");
}
if (l == String.fromCharCode(197)) {
return("_a");
}
if (l == String.fromCharCode(196)) {
return(":a");
}
if (l == String.fromCharCode(214)) {
return(":o");
}
if (l == String.fromCharCode(220)) {
return(":u");
}
return(l);
}
function getShownLetter() {
if (letter == "_A") {
return(String.fromCharCode(260));
}
if (letter == "_C") {
return(String.fromCharCode(262));
}
if (letter == "_E") {
return(String.fromCharCode(280));
}
if (letter == "_L") {
return(String.fromCharCode(321));
}
if (letter == "_N") {
return(String.fromCharCode(323));
}
if (letter == "_O") {
return(String.fromCharCode(211));
}
if (letter == "_S") {
return(String.fromCharCode(346));
}
if (letter == "_Z") {
return(String.fromCharCode(377));
}
if (letter == ":Z") {
return(String.fromCharCode(379));
}
return(letter);
}
var occupied = null;
var letterPositions = " A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _a:a:o:uQUae_o_A_C_E_L_N_O_S_Z:Z";
static var BONUS_NONE = 0;
static var BONUS_2X_LETTER = 1;
static var BONUS_3X_LETTER = 2;
static var BONUS_2X_WORD = 3;
static var CHARS = "MIDAS";
var pressed = false;
var ha = 0;
var mode = 0;
var col = 0;
var letterClipPos = 0;
var scoreClipPos = 0;
var bonusClipPos = 0;
}
Symbol 367 MovieClip [__Packages.com.midasplayer.wordbattle.WordLabel] Frame 0
class com.midasplayer.wordbattle.WordLabel extends MovieClip
{
var id, board, selectionPlate, statusCheckbox, letters, textLabel, bgColor, textBackground, scoreLabel0, scoreLabel1, scoreLabel2, scoreLabel3, scoreLabel4;
function WordLabel () {
super();
}
function init(board, id) {
this.id = id;
this.board = board;
selectionPlate.gotoAndStop(3);
statusCheckbox.stop();
statusCheckbox.gotoAndStop(3);
letters = new Array();
textLabel.text = "";
bgColor = new Color(textBackground);
var thisLabel = this;
selectionPlate.onRollOver = function () {
thisLabel.previewMode = true;
};
selectionPlate.onRollOut = function () {
thisLabel.previewMode = false;
};
selectionPlate.onPress = function () {
thisLabel.board.labelPressed(thisLabel);
};
setSelected(false);
}
function clearClicked() {
board.wordClearPressed(this);
}
function setAccepted(accepted, showTime) {
this.accepted = accepted;
this.showTime = getTimer() + showTime;
}
function setSelected(selected) {
this.selected = selected;
selectionPlate.gotoAndStop((selected ? 1 : (((letters.length > 0) ? 2 : 3))));
if (selected) {
bgColor.setTransform({ra:100, rb:0, ga:0, gb:0, ba:0, bb:0, aa:50, ab:0});
} else {
bgColor.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:50, ab:0});
}
var _local2 = 0;
while (_local2 < letters.length) {
var _local3 = letters[_local2];
if (selected) {
_local3.setColor(1);
} else {
_local3.setColor(2);
}
_local2++;
}
}
function canClick(x, y) {
if (letters.length == 0) {
return(true);
}
var _local2 = letters[letters.length - 1];
return(_local2.isNear(x, y));
}
function addChar(letter) {
letters.push(letter);
textLabel.text = textLabel.text + letter.getShownLetter();
selectionPlate.gotoAndStop((selected ? 1 : (((letters.length > 0) ? 2 : 3))));
}
function isLastChar(letter) {
return((letters.length >= 3) && (letter == letters[letters.length - 1]));
}
function isEmpty() {
return(letters.length == 0);
}
function clearCheckBox() {
}
function clearAllLetters() {
while (letters.length > 0) {
var _local2 = letters.pop();
_local2.setColor(0);
_local2.occupied = null;
}
textLabel.text = "";
selectionPlate.gotoAndStop((selected ? 1 : (((letters.length > 0) ? 2 : 3))));
}
function getWordCode1() {
var _local4 = "";
var _local2 = 0;
while (_local2 < letters.length) {
var _local3 = letters[_local2];
if (_local2 > 0) {
_local4 = _local4 + " ";
}
_local4 = _local4 + _local3.idString;
_local2++;
}
return(_local4);
}
function getWordCode2() {
var _local4 = "";
var _local2 = 0;
while (_local2 < letters.length) {
var _local3 = letters[_local2];
if (_local2 > 0) {
_local4 = _local4 + " ";
}
_local4 = _local4 + (("" + _local3.idString) + "");
_local2++;
}
return(_local4);
}
function calcScore() {
score = 0;
if (letters.length >= 3) {
var _local5 = 1;
var _local4 = 0;
while (_local4 < letters.length) {
var _local2 = letters[_local4];
var _local3 = _local2.score;
if (_local2.bonus == com.midasplayer.wordbattle.Letter.BONUS_2X_LETTER) {
_local3 = _local3 * 2;
} else if (_local2.bonus == com.midasplayer.wordbattle.Letter.BONUS_3X_LETTER) {
_local3 = _local3 * 3;
} else if (_local2.bonus == com.midasplayer.wordbattle.Letter.BONUS_2X_WORD) {
_local5 = _local5 * 2;
}
score = score + _local3;
_local4++;
}
score = score * _local5;
score = score * (letters.length * letters.length);
score = score * 5;
}
scoreLabel0.targetValue = Math.floor(score / 1) % 10;
scoreLabel1.targetValue = Math.floor(score / 10) % 10;
scoreLabel2.targetValue = Math.floor(score / 100) % 10;
scoreLabel3.targetValue = Math.floor(score / 1000) % 10;
scoreLabel4.targetValue = Math.floor(score / 10000) % 10;
}
function clearUntil(letter) {
if (letters.length == 1) {
var _local3 = letters.pop();
_local3.setColor(0);
_local3.occupied = null;
textLabel.text = "";
} else {
while ((letters.length > 0) && (letters[letters.length - 1] != letter)) {
var _local3 = letters.pop();
_local3.setColor(0);
_local3.occupied = null;
}
}
textLabel.text = "";
var _local2 = 0;
while (_local2 < letters.length) {
textLabel.text = textLabel.text + letters[_local2].getShownLetter();
_local2++;
}
selectionPlate.gotoAndStop((selected ? 1 : (((letters.length > 0) ? 2 : 3))));
}
function onEnterFrame() {
if (showTime > 0) {
statusCheckbox._alpha = 100;
if (getTimer() > showTime) {
if (accepted) {
_global.wordGoodSound.start();
} else {
_global.wordBadSound.start();
}
statusCheckbox.gotoAndStop((accepted ? 1 : 2));
showTime = 0;
clearTime = getTimer() + 1200;
}
}
if (clearTime > 0) {
var _local3 = Math.round((clearTime - getTimer()) / 10);
if (_local3 > 100) {
_local3 = 100;
}
if (_local3 < 0) {
_local3 = 0;
}
statusCheckbox._alpha = _local3;
if (getTimer() > clearTime) {
statusCheckbox.gotoAndStop(3);
clearTime = 0;
}
}
}
var selected = false;
var previewMode = false;
var accepted = false;
var showTime = 0;
var clearTime = 0;
var score = 0;
}
Symbol 368 MovieClip [__Packages.com.midasplayer.wordbattle.Board] Frame 0
class com.midasplayer.wordbattle.Board extends MovieClip
{
var bonusPassed, roundScores, timeBonuses, timeAlert, attachMovie, wordLabel0, wordLabel1, wordLabel2, tiles, comm, roundLabel, timeLeftLabel, scoreLabel, endRoundLabel, submitButton, timeLabel2, timeLabel1, timeLabel0, timeCol, lid0, lid1, lid2, lid3, lid4, timeShower, logo, selectedLabel, roundScoreLabel0, roundScoreLabel1, roundScoreLabel2, roundScoreLabel3, roundScoreLabel4, roundScoreLabel5, roundScoreLabel6, totalScoreLabel0, totalScoreLabel1, totalScoreLabel2, totalScoreLabel3, totalScoreLabel4, totalScoreLabel5, totalScoreLabel6;
function Board () {
super();
_global.clockSound = new Sound();
_global.clockSound.attachSound("clockAlertSound");
_global.markSound = new Sound();
_global.markSound.attachSound("markSound");
_global.wordGoodSound = new Sound();
_global.wordGoodSound.attachSound("wordGoodSound");
_global.wordBadSound = new Sound();
_global.wordBadSound.attachSound("wordBadSound");
_global.submitSound = new Sound();
_global.submitSound.attachSound("submitSound");
_global.startSound = new Sound();
_global.startSound.attachSound("startSound");
_global.startSound.start();
_global.logoRevealSound = new Sound();
_global.logoRevealSound.attachSound("logoRevealSound");
_global.logoRevealSound.start();
_global.newRoundSound = new Sound();
_global.newRoundSound.attachSound("newRoundSound");
_global.newRoundSound2 = new Sound();
_global.newRoundSound2.attachSound("newRoundSound2");
_global.bonusRoundSound = new Sound();
_global.bonusRoundSound.attachSound("bonusRoundSound");
_global.submitWordSound = new Sound();
_global.submitWordSound.attachSound("submitWordSound");
_global.endgameSound = new Sound();
_global.endgameSound.attachSound("endgameSound");
bonusPassed = new Array();
roundScores = new Array();
timeBonuses = new Array();
var _local5 = 0;
while (_local5 < 6) {
bonusPassed[_local5] = 0;
roundScores[_local5] = 0;
timeBonuses[_local5] = 0;
_local5++;
}
_root.resultWindow._visible = false;
_root.goTitle._visible = false;
_root.goScoreTitle._visible = false;
_root.goBonusTitle._visible = false;
_root.goRoundList._visible = false;
_root.goScoreList._visible = false;
_root.goBonusList._visible = false;
_root.goInfo._visible = false;
}
function init() {
timeAlert.stop;
increaseTotalScore(0);
var _local8 = 0;
while (_local8 < 5) {
this["roundSlider" + _local8].light._alpha = 0;
this["roundSlider" + _local8].bonusLight._alpha = 0;
_local8++;
}
_local8 = 0;
while (_local8 < 3) {
var _local5 = 0;
while (_local5 < 10) {
var _local3 = attachMovie("Arrow", (("a_" + _local8) + "_") + _local5, (1000 + (_local8 * 10)) + _local5);
_local3.stop();
_local3._visible = false;
var _local10 = Math.floor(Math.random() * 3) + 1;
var _local9 = Math.floor(Math.random() * 3) + 1;
_local3._x = ((240 + (56 * _local10)) + 24) - 16;
_local3._y = ((20 + (56 * _local9)) + 24) - 16;
var _local2 = Math.floor(Math.random() * 8);
if (((_local2 == 0) || (_local2 == 1)) || (_local2 == 7)) {
_local3._y = _local3._y - 27;
} else if (((_local2 == 3) || (_local2 == 4)) || (_local2 == 5)) {
_local3._y = _local3._y + 27;
}
if (((_local2 == 5) || (_local2 == 6)) || (_local2 == 7)) {
_local3._x = _local3._x - 27;
} else if (((_local2 == 1) || (_local2 == 2)) || (_local2 == 3)) {
_local3._x = _local3._x + 27;
}
_local3.gotoAndStop((_local2 + 1) + (Math.floor(Math.random() * 2) * 8));
_local5++;
}
_local8++;
}
wordLabel0.init(this, 0);
wordLabel1.init(this, 1);
wordLabel2.init(this, 2);
wordLabel0.calcScore();
wordLabel1.calcScore();
wordLabel2.calcScore();
calcScore();
roundScore = 0;
revealPos = 125;
revealed = 125;
tiles = new Array();
var _local6 = 0;
while (_local6 < 5) {
tiles[_local6] = new Array();
var _local4 = 0;
while (_local4 < 5) {
var _local7 = this[(("l_" + _local6) + "_") + _local4];
_local7.occupied = null;
_local7.init(this, _local6, _local4);
tiles[_local6][_local4] = _local7.lowerLetter;
_local4++;
}
_local6++;
}
}
function initGame() {
comm = new com.midasplayer.wordbattle.Comm(this);
roundLabel.text = _global.textMappings.round;
timeLeftLabel._visible = !_global.relaxMode;
timeLeftLabel.text = _global.textMappings.time_left;
scoreLabel.text = _global.textMappings.score;
endRoundLabel.text = _global.textMappings.button_play;
startIn = getTimer() + 9000;
var thisBoard = this;
submitButton.onPress = function () {
thisBoard.submit();
};
if (_global.relaxMode) {
timeLabel2.label.text = "-";
timeLabel2.label._visible = false;
timeLabel1.label.text = "-";
timeLabel1.label._visible = false;
timeLabel0.label.text = "-";
timeLabel0.label._visible = false;
timeCol._visible = false;
}
}
function startGame() {
started = true;
lid0.gotoAndPlay(2);
lid1.gotoAndPlay(2);
lid2.gotoAndPlay(2);
lid3.gotoAndPlay(2);
lid4.gotoAndPlay(2);
roundScore = 0;
revealPos = 0;
revealed = -25;
fscommand ("gameStart");
comm.initBonuses(0, 0);
lastTime = getTimer();
}
function responseReceived(response) {
comm.responseReceived(response);
}
function nextRound() {
if (lastRoundSlider >= 0) {
this["roundSlider" + lastRoundSlider].gotoAndStop(30);
if (bonusPassed[lastRoundSlider] > 0) {
this["roundSlider" + lastRoundSlider].bonusLight._alpha = (bonusPassed[lastRoundSlider] * 5) + 50;
}
}
if (_global.shortGameMode) {
targetRound = 3;
}
if ((roundNum == targetRound) || (outOfTime)) {
roundNum = targetRound;
gameOver = true;
timeShower.play();
logo.logoLid0.play();
logo.logoLid1.play();
lid0.play();
lid1.play();
lid2.play();
lid3.play();
lid4.play();
labelPressed(null);
noInput = true;
} else {
this["roundSlider" + roundNum].gotoAndPlay(2);
lastRoundSlider = roundNum;
roundNum++;
}
}
function initArrow(word, letter, x1, y1, x2, y2, mode) {
var _local7 = this[(("a_" + word) + "_") + letter];
if (mode == -1) {
_local7._visible = false;
} else {
var _local2 = 0;
if ((x2 == (x1 + 0)) && (y2 == (y1 - 1))) {
_local2 = 0;
}
if ((x2 == (x1 + 1)) && (y2 == (y1 - 1))) {
_local2 = 1;
}
if ((x2 == (x1 + 1)) && (y2 == (y1 + 0))) {
_local2 = 2;
}
if ((x2 == (x1 + 1)) && (y2 == (y1 + 1))) {
_local2 = 3;
}
if ((x2 == (x1 + 0)) && (y2 == (y1 + 1))) {
_local2 = 4;
}
if ((x2 == (x1 - 1)) && (y2 == (y1 + 1))) {
_local2 = 5;
}
if ((x2 == (x1 - 1)) && (y2 == (y1 + 0))) {
_local2 = 6;
}
if ((x2 == (x1 - 1)) && (y2 == (y1 - 1))) {
_local2 = 7;
}
_local7._x = (((240 + (56 * x1)) + 24) - 16) + ((x2 - x1) * 28);
_local7._y = (((20 + (56 * y1)) + 24) - 16) + ((y2 - y1) * 28);
_local7._visible = true;
_local7.gotoAndStop((_local2 + 1) + (mode * 8));
}
}
function submit() {
if (!started) {
startIn = 0;
_global.startSound.stop();
endRoundLabel._visible = false;
endRoundLabel.text = _global.textMappings.end_round;
_root.startButton._visible = false;
_root.infoTitle._visible = false;
_root.infoText._visible = false;
startGame();
_global.submitSound.start();
return(undefined);
}
if (noInput) {
return(undefined);
}
_global.submitSound.start();
clockPaused = true;
var _local4 = getTimer() - roundStartTime;
halfSeconds = Math.floor(_local4 / 500);
timeBonus = 120 - halfSeconds;
if (timeBonus < 0) {
timeBonus = 0;
}
labelPressed(null);
noInput = true;
endRoundLabel._visible = false;
comm.submitWords(wordLabel0, wordLabel1, wordLabel2);
}
function calcBonuses() {
var _local4 = 0;
var _local3 = 0;
if (wordLabel0.letters.length == 5) {
_local4++;
}
if (wordLabel1.letters.length == 5) {
_local4++;
}
if (wordLabel2.letters.length == 5) {
_local4++;
}
if (wordLabel0.letters.length > 5) {
_local3++;
}
if (wordLabel1.letters.length > 5) {
_local3++;
}
if (wordLabel2.letters.length > 5) {
_local3++;
}
totalFiveLetterWords = totalFiveLetterWords + _local4;
totalSixLetterWords = totalSixLetterWords + _local3;
if (_global.shortGameMode) {
targetRound = 3;
}
if (roundNum < targetRound) {
if (roundNum < 5) {
comm.initBonuses(_local4, _local3);
} else if (roundNum < 6) {
comm.initLastRoundBonuses(totalFiveLetterWords, totalSixLetterWords);
}
}
}
function endGame() {
if ((!gameOver) && (!gameEnded)) {
gameEnded = true;
}
}
function wordsAccepted(s0, s1, s2, qualified) {
var _local11 = s0 > 0;
var _local10 = s1 > 0;
var _local9 = s2 > 0;
if (!_local11) {
s0 = 0;
}
if (!_local10) {
s1 = 0;
}
if (!_local9) {
s2 = 0;
}
gameReport = gameReport + (("<round id=\"" + (++roundReport)) + "\">");
gameReport = gameReport + (((((("<word id=\"1\" score=\"" + s0) + "\" accepted=\"") + _local11) + "\">") + wordLabel0.getWordCode1()) + "</word>");
gameReport = gameReport + (((((("<word id=\"2\" score=\"" + s1) + "\" accepted=\"") + _local10) + "\">") + wordLabel1.getWordCode1()) + "</word>");
gameReport = gameReport + (((((("<word id=\"3\" score=\"" + s2) + "\" accepted=\"") + _local9) + "\">") + wordLabel2.getWordCode1()) + "</word>");
gameReport = gameReport + "</round>";
if (_local11 && (s0 != wordLabel0.score)) {
_root.warnLabel.text = (("Warning: word0, calc: " + wordLabel0.score) + ", report: ") + s0;
}
if (_local10 && (s1 != wordLabel1.score)) {
_root.warnLabel.text = (("Warning: word1, calc: " + wordLabel1.score) + ", report: ") + s1;
}
if (_local9 && (s2 != wordLabel2.score)) {
_root.warnLabel.text = (("Warning: word2, calc: " + wordLabel2.score) + ", report: ") + s2;
}
wordLabel0.score = s0;
wordLabel1.score = s1;
wordLabel2.score = s2;
var _local4 = wordLabel0.getWordCode2();
if (_local4.length == 0) {
fscommand ("playData", "563=" + s0);
} else {
fscommand ("playData", (("563," + _local4) + "=") + s0);
}
_local4 = wordLabel1.getWordCode2();
if (_local4.length == 0) {
fscommand ("playData", "563=" + s1);
} else {
fscommand ("playData", (("563," + _local4) + "=") + s1);
}
_local4 = wordLabel2.getWordCode2();
if (_local4.length == 0) {
fscommand ("playData", "563=" + s2);
} else {
fscommand ("playData", (("563," + _local4) + "=") + s2);
}
bonusPassed[roundNum - 1] = qualified;
if (!((_local11 || (_local10)) || (_local9))) {
timeBonus = 0;
}
totalTimeBonus = totalTimeBonus + timeBonus;
increaseTotalScore(timeBonus);
timeBonuses[roundNum - 1] = timeBonus;
fscommand ("playData", (("429," + halfSeconds) + "=") + timeBonus);
wordLabel0.setAccepted(_local11, 0);
wordLabel1.setAccepted(_local10, 500);
wordLabel2.setAccepted(_local9, 1000);
if (!_local11) {
var _local12 = wordLabel0.textLabel.text;
wordLabel0.clearAllLetters();
wordLabel0.calcScore();
wordLabel0.textLabel.text = _local12;
buildWordArrows(wordLabel0);
} else if (s0 > bestWordScore) {
bestWordScore = s0;
bestWord = wordLabel0.textLabel.text;
}
if (!_local10) {
var _local12 = wordLabel1.textLabel.text;
wordLabel1.clearAllLetters();
wordLabel1.calcScore();
wordLabel1.textLabel.text = _local12;
buildWordArrows(wordLabel1);
} else if (s1 > bestWordScore) {
bestWordScore = s1;
bestWord = wordLabel1.textLabel.text;
}
if (!_local9) {
var _local12 = wordLabel2.textLabel.text;
wordLabel2.clearAllLetters();
wordLabel2.calcScore();
wordLabel2.textLabel.text = _local12;
buildWordArrows(wordLabel2);
} else if (s2 > bestWordScore) {
bestWordScore = s2;
bestWord = wordLabel2.textLabel.text;
}
var _local8 = true;
var _local3 = 0;
while (_local3 < 5) {
if (bonusPassed[_local3] == 0) {
_local8 = false;
}
_local3++;
}
if (_local8 && (!outOfTime)) {
targetRound = 6;
}
calcBonuses();
calcScore();
roundScores[roundNum - 1] = roundScore;
increaseTotalScore(roundScore);
removeWordArrows(wordLabel0);
removeWordArrows(wordLabel1);
removeWordArrows(wordLabel2);
roundScore = 0;
revealPos = 0;
revealed = -125;
}
function onEnterFrame() {
if (startIn > 0) {
var _local14 = Math.floor((startIn - getTimer()) / 1000);
endRoundLabel.text = ((_global.textMappings.button_play + " (") + _local14) + ")";
if (getTimer() > startIn) {
submit();
}
return(undefined);
}
if (!inited) {
init();
inited = true;
}
var _local10 = getTimer();
if ((endTime >= 0) && ((_local10 - endTime) > 8000)) {
timeAlert._visible = false;
var _local11 = "";
_local11 = _local11 + (("<gameresult score=\"" + totalScore.toString()) + "\">");
_local11 = _local11 + gameReport;
_local11 = _local11 + "</gameresult>";
fscommand ("gameOver", _local11);
endTime = -1;
}
if ((lastTime >= 0) && (!gameOver)) {
if ((!clockPaused) && (!_global.relaxMode)) {
passedTime = passedTime + (_local10 - lastTime);
}
lastTime = _local10;
if (gameEnded) {
passedTime = passedTime + 60000;
}
}
if (roundNum == 6) {
var _local8 = 300 - (passedTime / 1000);
if (roundXStartTime < 0) {
roundXStartTime = _local8;
}
roundXFlashTime = roundXFlashTime + ((1 / ((_local8 / roundXStartTime) + 0.1)) / 10);
var _local7 = 0;
while (_local7 < 5) {
this["roundSlider" + _local7].light._alpha = 100;
this["roundSlider" + _local7].bonusLight._alpha = (Math.sin(((-roundXFlashTime) + ((((_local7 + 5) / 5) * Math.PI) * 2)) + 1.2) * 40) + 60;
_local7++;
}
}
var _local8 = Math.floor(300 - (passedTime / 1000));
if (gameOver && ((_local10 - lastTime) > 1500)) {
if (!_root.infoTitle._visible) {
if ((_local8 <= 0) && (!gameEnded)) {
_root.goTitle.text = _global.textMappings.out_of_time;
} else {
_root.goTitle.text = _global.textMappings.game_over;
}
_root.goRoundList.text = "";
_root.goScoreList.text = "";
_root.goBonusList.text = "";
var _local7 = 0;
while (_local7 < 5) {
_root.goRoundList.text = _root.goRoundList.text + (_global.textMappings[("round" + (_local7 + 1)) + "_title"] + "\r");
_root.goScoreList.text = _root.goScoreList.text + (("" + roundScores[_local7]) + "\r");
_root.goBonusList.text = _root.goBonusList.text + (("" + timeBonuses[_local7]) + "\r");
_local7++;
}
if (targetRound < 6) {
_root.goRoundList.text = _root.goRoundList.text + (_global.textMappings.did_not_qualify + "\r");
_root.goScoreList.text = _root.goScoreList.text + "\r";
_root.goBonusList.text = _root.goBonusList.text + "\r";
} else {
_root.goRoundList.text = _root.goRoundList.text + (_global.textMappings.roundx_title + "\r");
_root.goScoreList.text = _root.goScoreList.text + (("" + roundScores[5]) + "\r");
_root.goBonusList.text = _root.goBonusList.text + (("" + timeBonuses[5]) + "\r");
}
_root.goInfo.text = ((_global.textMappings.total_score + ": ") + totalScore) + "\r";
_root.goInfo.text = _root.goInfo.text + "\r";
_root.goInfo.text = _root.goInfo.text + (((((_global.textMappings.best_word + ": ") + bestWord) + " (") + bestWordScore) + ")\r");
_root.goInfo.text = _root.goInfo.text + "\r";
var _local13 = Math.round((8000 - (_local10 - endTime)) / 1000);
if (_local13 < 0) {
_local13 = 0;
}
_root.goInfo.text = _root.goInfo.text + (_global.textMappings.the_game_will_end.toString().split("{0}").join("" + _local13) + "\r");
_root.goScoreTitle.text = _global.textMappings.score;
_root.goBonusTitle.text = _global.textMappings.bonus;
_root.goTitle._visible = true;
_root.goScoreTitle._visible = true;
_root.goBonusTitle._visible = true;
_root.goRoundList._visible = true;
_root.goScoreList._visible = true;
_root.goBonusList._visible = true;
_root.goInfo._visible = true;
}
}
if (_local8 < 0) {
if (!noInput) {
outOfTime = true;
if (_global.shortGameMode) {
targetRound = 3;
}
if (roundNum < targetRound) {
roundNum = targetRound;
}
submit();
}
_local8 = 0;
}
var _local16 = Math.floor(_local8 / 60);
var _local12 = _local8 % 60;
if (!_global.relaxMode) {
timeLabel2.label.text = "" + _local16;
timeLabel1.label.text = "" + ((_local12 < 10) ? "0" : (Math.floor(_local12 / 10)));
timeLabel0.label.text = "" + (_local12 % 10);
}
if ((_local8 <= 10) && (endTime < 0)) {
if (clockState < 0) {
clockState = 0;
_global.clockSound.start(0, 99999);
}
var _local15 = 300 - (passedTime / 1000);
timeAlertFlashTime = timeAlertFlashTime + ((1 / ((_local15 / 10) + 0.1)) / 10);
timeAlert._visible = true;
var _local9 = Math.floor(timeAlertFlashTime * 40) % 599;
if (_local9 >= 300) {
_local9 = 599 - _local9;
}
if (_local9 < 0) {
_local9 = 0;
}
timeAlert.gotoAndStop((((Math.floor(((_local9 / 300) * 12) + 1) * 300) / 12) + 300) - 6);
if (outOfTime) {
timeAlert._visible = false;
if (clockState == 0) {
clockState = 1;
_global.clockSound.stop();
}
}
} else if (lastTime >= 0) {
timeAlert._visible = true;
timeAlertValue = (timeAlertValue * 0.9) + (Math.floor(_local8) * 0.1);
timeAlert.gotoAndStop(((Math.floor(((timeAlertValue / 300) * 12) + 1) * 300) / 12) - 6);
} else {
timeAlert._visible = false;
}
if (revealed < 25) {
if (revealed < 0) {
var _local7 = 0;
while ((_local7 < 2) && (revealed < 0)) {
var _local6 = revealed + 15;
if ((_local6 >= 0) && (_local6 < 25)) {
if (_local6 == 0) {
if (_global.shortGameMode) {
targetRound = 3;
}
if (roundNum == targetRound) {
_global.endgameSound.start();
} else if ((roundNum == 5) && (targetRound == 6)) {
_global.bonusRoundSound.start();
} else {
_global.newRoundSound.start();
}
}
var _local5 = Math.floor(_local6 * 11) % 5;
var _local4 = Math.floor((_local6 * 11) / 5) % 5;
if (_global.shortGameMode) {
targetRound = 3;
}
if ((roundNum == 0) || (roundNum == targetRound)) {
this[(("l_" + _local5) + "_") + _local4].brickPopup.play();
}
}
revealed++;
_local7++;
}
} else {
var _local7 = 0;
while ((_local7 < 2) && (revealed < 25)) {
var _local6 = revealed + 15;
if ((_local6 >= 0) && (_local6 < 25)) {
var _local5 = Math.floor(_local6 * 11) % 5;
var _local4 = Math.floor((_local6 * 11) / 5) % 5;
if (_global.shortGameMode) {
targetRound = 3;
}
if ((roundNum == 0) || (roundNum == targetRound)) {
this[(("l_" + _local5) + "_") + _local4].brickPopup.play();
}
}
var _local5 = Math.floor(revealPos) % 5;
var _local4 = Math.floor(revealPos / 5) % 5;
if (_global.shortGameMode) {
targetRound = 3;
}
if (roundNum < targetRound) {
this[(("l_" + _local5) + "_") + _local4].reveal(comm.getChar(roundNum, _local5, _local4), comm.getScore(roundNum, _local5, _local4), ((roundNum < targetRound) ? (comm.getBonusAt(_local5, _local4)) : 0));
} else {
this[(("l_" + _local5) + "_") + _local4].reveal(undefined, undefined, 0);
}
revealPos = revealPos + 11;
revealed++;
_local7++;
}
}
if (revealed == 25) {
wordLabel0.clearAllLetters();
wordLabel1.clearAllLetters();
wordLabel2.clearAllLetters();
wordLabel0.calcScore();
wordLabel1.calcScore();
wordLabel2.calcScore();
wordLabel0.clearCheckBox();
wordLabel1.clearCheckBox();
wordLabel2.clearCheckBox();
buildWordArrows(wordLabel0);
buildWordArrows(wordLabel1);
buildWordArrows(wordLabel2);
calcScore();
if (_global.shortGameMode) {
targetRound = 3;
}
if (roundNum < targetRound) {
_global.newRoundSound2.start();
noInput = false;
}
var _local17 = roundNum;
nextWord();
nextRound();
if (_global.shortGameMode) {
targetRound = 3;
}
if (_local17 < targetRound) {
roundStartTime = getTimer();
endRoundLabel._visible = true;
noInput = false;
} else if (endTime < 0) {
endTime = getTimer();
}
clockPaused = false;
}
}
if (gameOver) {
timeAlert._visible = false;
}
}
function labelPressed(wordLabel) {
if (noInput) {
return(undefined);
}
if (selectedLabel != null) {
if (selectedLabel.letters.length < 3) {
selectedLabel.clearAllLetters();
}
}
if ((wordLabel != null) && (wordLabel == selectedLabel)) {
selectedLabel = null;
nextWord();
return(undefined);
}
selectedLabel = wordLabel;
wordLabel0.setSelected(wordLabel == wordLabel0);
wordLabel1.setSelected(wordLabel == wordLabel1);
wordLabel2.setSelected(wordLabel == wordLabel2);
buildWordArrows(wordLabel0);
buildWordArrows(wordLabel1);
buildWordArrows(wordLabel2);
wordLabel0.calcScore();
wordLabel1.calcScore();
wordLabel2.calcScore();
calcScore();
}
function buildWordArrows(word) {
var _local2 = 0;
while (_local2 < 10) {
if (word.letters.length >= (_local2 + 2)) {
var _local5 = word.letters[_local2];
var _local4 = word.letters[_local2 + 1];
initArrow(word.id, _local2, _local5.xPos, _local5.yPos, _local4.xPos, _local4.yPos, (word.selected ? 0 : 1));
} else {
initArrow(word.id, _local2, -1, -1, -1, -1, -1);
}
_local2++;
}
}
function removeWordArrows(word) {
var _local2 = 0;
while (_local2 < 10) {
initArrow(word.id, _local2, -1, -1, -1, -1, -1);
_local2++;
}
}
function calcScore() {
var _local2 = 0;
_local2 = _local2 + wordLabel0.score;
_local2 = _local2 + wordLabel1.score;
_local2 = _local2 + wordLabel2.score;
roundScore = _local2;
roundScoreLabel0.targetValue = Math.floor(_local2 / 1) % 10;
roundScoreLabel1.targetValue = Math.floor(_local2 / 10) % 10;
roundScoreLabel2.targetValue = Math.floor(_local2 / 100) % 10;
roundScoreLabel3.targetValue = Math.floor(_local2 / 1000) % 10;
roundScoreLabel4.targetValue = Math.floor(_local2 / 10000) % 10;
roundScoreLabel5.targetValue = Math.floor(_local2 / 100000) % 10;
roundScoreLabel6.targetValue = Math.floor(_local2 / 1000000) % 10;
}
function increaseTotalScore(toAdd) {
totalScore = totalScore + toAdd;
totalScoreLabel0.targetValue = Math.floor(totalScore / 1) % 10;
totalScoreLabel1.targetValue = Math.floor(totalScore / 10) % 10;
totalScoreLabel2.targetValue = Math.floor(totalScore / 100) % 10;
totalScoreLabel3.targetValue = Math.floor(totalScore / 1000) % 10;
totalScoreLabel4.targetValue = Math.floor(totalScore / 10000) % 10;
totalScoreLabel5.targetValue = Math.floor(totalScore / 100000) % 10;
totalScoreLabel6.targetValue = Math.floor(totalScore / 1000000) % 10;
}
function wordClearPressed(word) {
if (noInput) {
return(undefined);
}
word.clearAllLetters();
labelPressed(word);
}
function letterPressed(letter) {
if (noInput) {
return(undefined);
}
if (tiles[letter.xPos][letter.yPos].occupied == null) {
if (selectedLabel != null) {
if (selectedLabel.canClick(letter.xPos, letter.yPos)) {
if (selectedLabel.letters.length < 10) {
selectedLabel.addChar(letter);
letter.setColor(1);
tiles[letter.xPos][letter.yPos].occupied = selectedLabel;
_global.markSound.start();
letter.h = -3;
letter.ha = 0;
letter.pressed = true;
letter.setColor(1);
buildWordArrows(selectedLabel);
selectedLabel.calcScore();
calcScore();
}
} else {
_global.markSound.start();
letter.h = -3;
letter.ha = 0;
letter.pressed = true;
selectedLabel.clearAllLetters();
letterPressed(letter);
buildWordArrows(selectedLabel);
selectedLabel.calcScore();
calcScore();
}
}
} else {
var _local4 = tiles[letter.xPos][letter.yPos].occupied;
if (_local4 == selectedLabel) {
if (_local4.isLastChar(letter)) {
_global.submitWordSound.start();
buildWordArrows(_local4);
nextWord();
} else {
_global.markSound.start();
letter.h = -3;
letter.ha = 0;
letter.pressed = true;
_local4.clearUntil(letter);
_local4.calcScore();
calcScore();
buildWordArrows(_local4);
}
} else if ((selectedLabel == null) || (selectedLabel.letters.length == 0)) {
labelPressed(_local4);
}
}
}
function nextWord() {
var _local2 = 0;
while (_local2 < 3) {
if (this["wordLabel" + _local2].isEmpty()) {
labelPressed(this["wordLabel" + _local2]);
return(undefined);
}
_local2++;
}
labelPressed(null);
}
var inited = false;
var revealPos = 0;
var revealed = 0;
var lastRoundSlider = -1;
var clockState = -1;
var roundScore = 0;
var totalScore = 0;
var noInput = true;
var outOfTime = false;
var roundNum = 0;
var roundStartTime = 0;
var totalTimeBonus = 0;
var timeBonus = 0;
var halfSeconds = 0;
var lastTime = -1;
var passedTime = 0;
var endTime = -1;
var bestWord = "None!";
var bestWordScore = 0;
var gameOver = false;
var totalFiveLetterWords = 0;
var totalSixLetterWords = 0;
var targetRound = 5;
var timeAlertValue = 0;
var roundXFlashTime = 0;
var roundXStartTime = -1;
var timeAlertFlashTime = -1;
var gameEnded = false;
var started = false;
var startIn = 0;
var clockPaused = true;
var roundReport = 0;
var gameReport = "";
}
Symbol 369 MovieClip [__Packages.com.midasplayer.wordbattle.Comm] Frame 0
class com.midasplayer.wordbattle.Comm
{
var board, bonuses, config, bonusCoords, chars, scores;
function Comm (board) {
this.board = board;
parseGameData();
var _local2 = 0;
while (_local2 < 25) {
bonuses[_local2] = com.midasplayer.wordbattle.Letter.BONUS_NONE;
_local2++;
}
}
function parseGameData() {
var _local11 = new XML(_root.gameData);
_global.shortGameMode = new String(_local11.childNodes[0].attributes.mode) == "short";
_global.relaxMode = new String(_local11.childNodes[0].attributes.relaxMode) == "true";
trace(_global.relaxMode);
config = new Object();
_global.textMappings = new Object();
var _local8 = _local11.firstChild.childNodes;
var _local7 = 0;
while (_local7 < _local8.length) {
if (config[_local8[_local7].nodeName] == undefined) {
config[_local8[_local7].nodeName] = new Object();
}
config[_local8[_local7].nodeName][_local8[_local7].attributes.id] = new String(_local8[_local7].firstChild.nodeValue);
if (_local8[_local7].nodeName == "text") {
_global.textMappings[_local8[_local7].attributes.id] = new String(_local8[_local7].firstChild.nodeValue);
}
_local7++;
}
var _local10 = _local11.firstChild.attributes.characters.split(" ");
var _local9 = _local11.firstChild.attributes.scores.split(" ");
bonusCoords = _local11.firstChild.attributes.bonuscoords.split(" ");
chars = new Array();
scores = new Array();
bonuses = new Array();
var _local6 = 0;
while (_local6 < 6) {
chars[_local6] = new Array();
scores[_local6] = new Array();
var _local5 = 0;
while (_local5 < 5) {
chars[_local6][_local5] = new Array();
scores[_local6][_local5] = new Array();
var _local4 = 0;
while (_local4 < 5) {
chars[_local6][_local5][_local4] = _local10[(((_local6 * 5) * 5) + (_local4 * 5)) + _local5];
scores[_local6][_local5][_local4] = _local9[(((_local6 * 5) * 5) + (_local4 * 5)) + _local5];
_local4++;
}
_local5++;
}
_local6++;
}
}
function initBonuses(fiveLetterWords, sixLetterWords) {
if (roundCount == 5) {
return(undefined);
}
bonusPos = (roundCount - 1) * 12;
bonusReport = "1734," + (++roundCount);
var _local2 = 0;
while (_local2 < 25) {
bonuses[_local2] = com.midasplayer.wordbattle.Letter.BONUS_NONE;
_local2++;
}
_local2 = 0;
while (_local2 < fiveLetterWords) {
if (_local2 == 0) {
addBonus(com.midasplayer.wordbattle.Letter.BONUS_2X_LETTER);
addBonus(com.midasplayer.wordbattle.Letter.BONUS_2X_LETTER);
} else {
addBonus(com.midasplayer.wordbattle.Letter.BONUS_3X_LETTER);
addBonus(com.midasplayer.wordbattle.Letter.BONUS_3X_LETTER);
}
_local2++;
}
_local2 = 0;
while (_local2 < sixLetterWords) {
addBonus(com.midasplayer.wordbattle.Letter.BONUS_2X_WORD);
addBonus(com.midasplayer.wordbattle.Letter.BONUS_2X_WORD);
_local2++;
}
bonusReport = bonusReport + "=0";
fscommand ("playData", bonusReport);
}
function initLastRoundBonuses(fiveLetterWords, sixLetterWords) {
bonusPos = (roundCount - 1) * 12;
bonusReport = "1734," + (++roundCount);
var _local2 = 0;
while (_local2 < 25) {
bonuses[_local2] = com.midasplayer.wordbattle.Letter.BONUS_NONE;
_local2++;
}
_local2 = 0;
while (_local2 < fiveLetterWords) {
addBonus(com.midasplayer.wordbattle.Letter.BONUS_3X_LETTER);
_local2++;
}
_local2 = 0;
while (_local2 < sixLetterWords) {
addBonus(com.midasplayer.wordbattle.Letter.BONUS_2X_WORD);
_local2++;
}
bonusReport = bonusReport + "=0";
fscommand ("playData", bonusReport);
}
function addBonus(bonusType) {
var _local4 = new Number(bonusCoords[bonusPos++]);
var _local3 = new Number(bonusCoords[bonusPos++]);
bonusReport = bonusReport + ((((" " + _local4) + ",") + _local3) + ",");
if (bonusType == com.midasplayer.wordbattle.Letter.BONUS_2X_LETTER) {
bonusReport = bonusReport + "2L";
} else if (bonusType == com.midasplayer.wordbattle.Letter.BONUS_3X_LETTER) {
bonusReport = bonusReport + "3L";
} else if (bonusType == com.midasplayer.wordbattle.Letter.BONUS_2X_WORD) {
bonusReport = bonusReport + "2W";
}
bonusReport = bonusReport + "";
bonuses[_local4 + (_local3 * 5)] = bonusType;
}
function getChar(r, x, y) {
return(chars[r][x][y]);
}
function getScore(r, x, y) {
return(scores[r][x][y]);
}
function getBonusAt(x, y) {
return(bonuses[x + (y * 5)]);
}
function submitWords(word0, word1, word2) {
if (_global.debugMode) {
var _local3 = 0;
if (word0.letters.length >= 5) {
_local3 = _local3 + 4;
}
if (word1.letters.length >= 5) {
_local3 = _local3 + 4;
}
if (word2.letters.length >= 5) {
_local3 = _local3 + 4;
}
if (((word0.letters.length >= 4) && (word1.letters.length >= 4)) && (word2.letters.length >= 4)) {
_local3 = _local3 + 2;
}
if (_local3 > 10) {
_local3 = 10;
}
board.wordsAccepted(word0.score, word1.score, word2.score, _local3);
} else {
var _local4 = "<words>";
_local4 = _local4 + (("<word id=\"1\">" + word0.getWordCode1()) + "</word>");
_local4 = _local4 + (("<word id=\"2\">" + word1.getWordCode1()) + "</word>");
_local4 = _local4 + (("<word id=\"3\">" + word2.getWordCode1()) + "</word>");
_local4 = _local4 + "</words>";
fscommand ("request", _local4);
}
}
function replace(str, from, to) {
return(str.split(from).join(to));
}
function responseReceived(response) {
response = replace(response, "<", "<");
response = replace(response, ">", ">");
response = replace(response, """, "\"");
var _local10 = new XML(response);
var _local5 = _local10.firstChild.childNodes;
var _local11 = new Number(_local10.firstChild.attributes.qualified.toString());
var _local8 = 0;
var _local7 = 0;
var _local6 = 0;
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = new Number(_local5[_local2].attributes.id);
var _local4 = new Number(_local5[_local2].firstChild.nodeValue);
if (_local3 == 1) {
_local8 = _local4;
}
if (_local3 == 2) {
_local7 = _local4;
}
if (_local3 == 3) {
_local6 = _local4;
}
_local2++;
}
board.wordsAccepted(_local8, _local7, _local6, _local11);
}
function isWordAccepted(word) {
return(false);
}
var bonusReport = "";
var roundCount = 0;
var bonusPos = 0;
}
Symbol 370 MovieClip [__Packages.com.midasplayer.wordbattle.NumberFlipper] Frame 0
class com.midasplayer.wordbattle.NumberFlipper extends MovieClip
{
var label;
function NumberFlipper () {
super();
}
function onEnterFrame() {
if (curValue != targetValue) {
curValue++;
if (curValue > 9) {
curValue = 0;
}
label.text = curValue.toString();
}
}
var curValue = 1;
var targetValue = 0;
}