Frame 2
function loadFps(x, y) {
_root.createEmptyMovieClip("mcFps", _root.getNextHighestDepth());
_root.mcFps.loadMovie(_global.baseUrl + "shared/fps/fps.swf");
_root.mcFps._x = x;
_root.mcFps._y = y;
}
function setSite(mc) {
if (miniClipFlag) {
mc.gotoAndStop("miniClip");
} else if (!pizmoFlag) {
if (!pizmoLinkAllowed) {
mc.gotoAndStop("noPizmoNoLinkAllowed");
} else {
mc.gotoAndStop("noPizmoLinkAllowed");
}
}
}
function getUserInfo_cb() {
_root.play();
}
function loadTout(initParams) {
toutName = _root.toutname;
if (toutName == undefined) {
toutName = "blind";
}
var _local3 = ((_global.baseUrl + "sharedAssets/as2/touts/") + toutName) + ".swf";
trace((("toutUrl:" + _local3) + ",") + initParams.containerClip);
initParams.containerClip.loadMovie(_local3);
}
function clearTout(initParmams) {
initParams.scope.mcTout.removeMovieClip();
}
function setRightClickMenu() {
MENU = new ContextMenu();
MENU.hideBuiltInItems();
Functioned = new ContextMenuItem("Copyright \u00A9 Pizmo Games", undefined);
MENU.customItems.push(Functioned);
_root.menu = MENU;
}
function sendToAFriend() {
getURL ("javascript:sendtofriend()");
}
function dTrace(str) {
if (_root.mcDebug == undefined) {
trace(str);
} else {
_root.mcDebug.dTrace(str);
}
}
function gotoPizmo() {
getURL ("http://www.pizmogames.com", "_new");
}
function setDialoguePizmoEnvironment(mc) {
if (!_root.pizmoFlag) {
if (_root.pizmoLinkAllowed) {
mc.gotoAndStop(2);
} else {
mc.gotoAndStop(3);
}
}
}
function checkPercentLoaded() {
return((getBytesLoaded() / getBytesTotal()) * 100);
}
function checkCopyProtection() {
if (pizmoFlag) {
actualURL = this._url.split("?")[0];
validLoad = true;
cpError = "";
if (Stage.scaleMode != "exactFit") {
validLoad = false;
cpError = cpError + (("CP failure code 1: scaleMode:" + Stage.scaleMode) + " ");
}
if ((actualURL.indexOf("http://pizmogames.com") == -1) && (actualURL.indexOf("http://www.pizmogames.com") == -1)) {
validLoad = false;
cpError = cpError + "CP failure code 2 ";
}
if (gLoadedFromHtml != "true") {
}
if ((!validLoad) and (!gShockwave)) {
getURL ("http://www.pizmogames.com");
stop();
trace("failed copyright protection:" + cpError);
}
}
}
function sendToAFriend() {
getURL ("javascript:sendtofriend()");
}
function loadMedia() {
_root.createEmptyMovieClip("mcWordList", _root.getNextHighestDepth());
mcWordList.loadMovie(_global.gameBaseUrl + "media/wordlist.swf");
mcSound.loadMovie(_global.gameBaseUrl + "media/sound.swf");
}
function checkPercentLoaded() {
gBytesLoaded = _root.getBytesLoaded();
gBytesLoaded = gBytesLoaded + _root.mcWordList.getBytesLoaded();
gBytesLoaded = gBytesLoaded + _root.mcSound.getBytesLoaded();
gBytesTotal = _root.getBytesTotal();
gBytesTotal = gBytesTotal + _root.mcWordList.getBytesTotal();
gBytesTotal = gBytesTotal + _root.mcSound.getBytesTotal();
trace("checkPercentLoaded():" + ((gBytesLoaded / gBytesTotal) * 100));
return((gBytesLoaded / gBytesTotal) * 100);
}
function initRaceOver() {
mcDialogue.headerText = _root.gGameController.getUserRaceOverMessage();
mcDialogue.bestWord = _root.gGameController.bestWord.toUpperCase();
mcDialogue.bestWordScore = _root.gGameController.bestWordScore;
suffix = "";
if (_root.pizmoFlag == false) {
if (_root.pizmoLinkAllowed) {
suffix = "_noPizmoLinkAllowed";
} else {
suffix = "_noPizmoNoLinkAllowed";
}
}
if (_root.gShockwaveFlag) {
suffix = "_sw";
}
if (_root.miniClipFlag) {
suffix = "_miniClip";
}
if (!_root.gGameController.getUserWonFlag()) {
mcDialogue.setDialogue("lose" + suffix, "fade");
} else {
trace((("_root.gGameController.levelNum:" + _root.gGameController.levelNum) + ",") + _root.gGameController.numLevelsInTour);
if (_root.gGameController.levelNum < _root.gGameController.numLevelsInTour) {
mcDialogue.setDialogue("win race", "fade");
} else {
mcDialogue.setDialogue("win tour" + suffix, "fade");
}
}
}
function setPizmoFades() {
filter.FilterUtilities.setFade(mcPizmo, 1, 0.5);
mcPizmo._visible = true;
_global.setTimeout(this, "fadeOutPiz", 1500);
}
function fadeOutPiz() {
filter.FilterUtilities.setFade(mcPizmo, -1, 0.5);
play();
}
function initShockwaveHighScore() {
System.security.allowDomain("shockwave.com", "gameblast.shockwave.com", "www.shockwave.com", "dev.shockwave.com", "stage.shockwave.com");
_level0.swHighScoreObject = new Object();
_level0.swHighScoreObject.showTab = "view";
_level0.swHighScoreObject.gameId = "wordwindsactioneasy";
_level0.swHighScoreObject.gameTitle = "Word Sailing";
_level0.swHighScoreObject.screenWidth = 800;
_level0.swHighScoreObject.screenHeight = 600;
_level0.swHighScoreObject.scoreDescriptor = "points";
_level0.swHighScoreObject.numPlayers = 1;
_level0.swHighScoreObject.player1Score = 0;
_level0.swHighScoreObject.player2Score = 0;
_level0.swHighScoreObject.player3Score = 0;
_level0.swHighScoreObject.player4Score = 0;
_level0.HSHubURL = "http://www.shockwave.com/content/highscores/scorez-2002.swf";
}
function playAgain() {
_root.HSHubSubmitter._visible = true;
_root.disabler._visible = false;
gotoAndPlay ("title");
}
_quality = "HIGH";
debugOptions = {clickToPushBoats:false};
debugOptions.shortRaces = debug_short_races == "1";
urlArr = this._url.split("/");
_global.baseUrl = "";
var i = 0;
while (i < (urlArr.length - 3)) {
_global.baseUrl = _global.baseUrl + (urlArr[i] + "/");
i++;
}
trace("_global.baseUrl:" + _global.baseUrl);
_global.gameBaseUrl = "";
var i = 0;
while (i < (urlArr.length - 1)) {
_global.gameBaseUrl = _global.gameBaseUrl + (urlArr[i] + "/");
i++;
}
trace("_global.gameBaseUrl:" + _global.gameBaseUrl);
_global.padString = function (str, char, num) {
var _local1 = str;
while (_local1.length < num) {
_local1 = char + _local1;
}
return(_local1);
};
String.prototype.pluralize = function (num) {
if (Math.abs(num) > 1) {
this=this + "s";//parameter overwritten
this + "s";
}
};
Array.prototype.duplicateArray = function () {
var _local4 = this.length;
var _local3 = new Array();
var _local2 = 0;
while (_local2 < _local4) {
_local3.push(this[_local2]);
_local2++;
}
return(_local3);
};
Array.prototype.getPos = function (val) {
var _local3 = -1;
var _local2;
_local2 = 0;
while (_local2 < this.length) {
if (this[_local2] == val) {
_local3 = _local2;
}
_local2++;
}
return(_local3);
};
Array.prototype.deleteItem = function (item) {
var _local2 = this.getPos(item);
if (_local2 != -1) {
this.splice(_local2, 1);
}
};
setRightClickMenu();
checkCopyProtection();
_root.pizmoFlag = false;
_root.pizmoLinkAllowed = true;
_root.gShockwaveFlag = false;
_root.miniClipFlag = true;
showDebugLog = false;
if (showDebugLog) {
_root.createEmptyMovieClip("mcDebug", _root.getNextHighestDepth());
_root.mcDebug._x = 10;
var cLoader = new MovieClipLoader();
cLoader.onLoadInit = function () {
};
cLoader.onLoadError = function (s) {
trace("error loading :" + s);
};
cLoader.loadClip(_global.baseUrl + "shared/debug/debugLog.swf", _root.mcDebug);
}
showFps = false;
if (showFps) {
loadFps(5, 5);
}
if (gShockwaveFlag) {
initShockwaveHighScore();
}
Frame 6
if (_framesloaded < 12) {
gotoAndPlay ("preloading");
}
Frame 8
function setFade(mc, dir, seconds, callback) {
if (dir == -1) {
mc.alphaAmt = 1;
} else {
mc.alphaAmt = 0;
mc._visible = false;
}
mc.alphaDelta = (1 / (24 * seconds)) * dir;
mc.callBack = callback;
var matrix = new Array();
matrix = matrix.concat([1, 0, 0, 0, 0]);
matrix = matrix.concat([0, 1, 0, 0, 0]);
matrix = matrix.concat([0, 0, 1, 0, 0]);
matrix = matrix.concat([0, 0, 0, mc.alphaAmt, 0]);
mc.matrix = matrix;
mc.onEnterFrame = function () {
with (this) {
if (!mc._visible) {
mc._visible = true;
}
alphaAmt = alphaAmt + alphaDelta;
matrix[18] = alphaAmt;
var filter = (new flash.filters.ColorMatrixFilter(matrix));
filters = new Array(filter);
if ((alphaAmt <= 0) or (alphaAmt >= 1)) {
callback();
delete onEnterFrame;
}
}
};
}
function setGlowFilter(mc) {
var _local3 = 39423;
var _local9 = 0.8;
var _local6 = 30;
var _local5 = 30;
var _local7 = 2;
var _local1 = 3;
var _local4 = false;
var _local8 = false;
var _local2 = new flash.filters.GlowFilter(_local3, _local9, _local6, _local5, _local7, _local1, _local4, _local8);
mc.filters = new Array(_local2);
}
function clearFilters(mc) {
mc.filters = new Array();
}
if (!gShockwaveFlag) {
if (_root.gameInfo == undefined) {
_root.gameInfo = new Object();
}
_root.gameInfo.game_handle = "wordwinds";
_root.gameInfo.scoreDataType = "number";
_root.gameInfo.game_name_full = "Word Winds";
_root.gameInfo.lower_scores_better = "0";
}
Frame 10
loadMedia();
gotoAndPlay ("loading");
Instance of Symbol 327 MovieClip "mcPizmo" in Frame 12
onClipEvent (load) {
}
Frame 13
setPizmoFades();
stop();
Frame 16
if (checkPercentLoaded() >= 100) {
gotoAndPlay ("loaded");
}
Frame 19
if (startTimeLoad == undefined) {
startTimeLoad = getTimer();
}
timeElapsed = getTimer() - startTimeLoad;
pct = checkPercentLoaded() * Math.min(1, timeElapsed / 2000);
var newFrame = Math.floor((pct / 100) * 50);
mcLoader.loadedPctTxt.text = String(Math.floor(pct)) + "%";
if ((newFrame > 0) and (newFrame != mcLoader._currentframe)) {
mcLoader.gotoAndStop(newFrame);
}
if (pct < 100) {
gotoAndPlay ("loading");
}
Instance of Symbol 465 MovieClip in Frame 22
onClipEvent (load) {
_visible = _root.pizmoLinkAllowed;
}
Frame 23
callback = function () {
_root.play();
};
setFade(mcLoader, -1, 0.25, callback);
stop();
trace(mcWordList.validWord("ANT"));
trace(mcWordList.validWord("ADROITLY"));
trace(mcWordList.validWord("BEGUILING"));
trace(mcWordList.validWord("APOPLECTIC"));
Frame 26
mcSound.playMusic(1, "intro theme", 45);
mcSound.playMusic(2, "ambient", 25);
if (!gShockwaveFlag) {
gLogger = new Logger("wordwinds");
logActivity("loadComplete");
}
Frame 29
initParams = new Object();
stop();
Frame 30
callback = function () {
_root.play();
};
setFade(mcTitleGraphic, -1, 0.15, callback);
stop();
Frame 32
gUseSushi = false;
if (gUseSushi) {
_global.sushi = new com.rawfishsoftware.sushi.SushiAPI();
sushi.enableLogging(true);
} else {
gotoAndPlay ("init game");
}
Frame 34
sushi.connectToServerSocket("127.0.0.1", 5556, "MoveObject", function (s) {
if (!s) {
gotoAndStop ("login");
} else {
trace("Can't connect!");
}
});
sushi.getFPS(24);
stop();
Frame 37
function onJoinSession(s) {
if (!s) {
gotoAndPlay ("awaitingRacers");
} else {
button.enabled = 1;
error.text = "Nickname in use or session full!";
}
}
Selection.setFocus(nick);
button_ok = function () {
if (nick.text != "") {
button.enabled = 0;
var _local1 = sushi.getSessionList()[0].id;
sushi.me.joinSession(nick.text, _local1, 1, 1, [400, 300, 0], onJoinSession);
}
};
stop();
Frame 40
stop();
onEnterFrame = function () {
ids = sushi.room.getMemberIDs(1);
numRacers.text = ids.length;
if (ids.length == 2) {
play();
delete onEnterFrame;
}
};
Frame 46
gGameController = new code.gameController();
initParams.mcWordList = mcWordList;
initParams.mcBoard = mcBoard;
initParams.mcWordDisplay = mcWordDisplay;
initParams.useSushi = gUseSushi;
initParams.mcCourseDisplay = mcCourseDisplay;
gGameController.initGame(initParams);
Instance of Symbol 499 MovieClip in Frame 46
onClipEvent (load) {
_visible = _root.pizmoLinkAllowed;
}
Frame 47
gGameController.initLevel();
mcSound.playSound(1, "transitionWind");
Frame 73
gGameController.initLetters();
mcSound.fadeOutMusic(1, 1);
mcSound.playSound(2, "lettersAppear");
onEnterFrame = function () {
gGameController.stepGame();
};
stop();
_quality = "HIGH";
Instance of Symbol 500 MovieClip in Frame 73
onClipEvent (load) {
_visible = _root.miniClipFlag;
}
Instance of Symbol 524 MovieClip "mcInterface" in Frame 73
onClipEvent (load) {
_root.setFade(this, 1, 0.15, undefined);
}
Frame 75
stop();
Instance of Symbol 536 MovieClip "mcRaceStartMessage" in Frame 75
onClipEvent (load) {
_visible = false;
}
Frame 84
initRaceOver();
stop();
Symbol 4 MovieClip [FBoundingBoxSymbol] Frame 1
var component = _parent;
component.registerSkinElement(boundingBox, "background");
stop();
Symbol 4 MovieClip [FBoundingBoxSymbol] Frame 2
component.registerSkinElement(boundingBox2, "backgroundDisabled");
stop();
Symbol 7 MovieClip [FPushButtonSymbol] Frame 1
#initclip 3
function FPushButtonClass() {
this.init();
}
FPushButtonClass.prototype = new FUIComponentClass();
Object.registerClass("FPushButtonSymbol", FPushButtonClass);
FPushButtonClass.prototype.init = function () {
super.setSize(this._width, this._height);
this.boundingBox_mc.unloadMovie();
this.attachMovie("fpb_states", "fpbState_mc", 1);
this.attachMovie("FLabelSymbol", "fLabel_mc", 2);
this.attachMovie("fpb_hitArea", "fpb_hitArea_mc", 3);
super.init();
this.btnState = false;
this.setClickHandler(this.clickHandler);
this._xscale = 100;
this._yscale = 100;
this.setSize(this.width, this.height);
if (this.label != undefined) {
this.setLabel(this.label);
}
this.ROLE_SYSTEM_PUSHBUTTON = 43;
this.STATE_SYSTEM_PRESSED = 8;
this.EVENT_OBJECT_STATECHANGE = 32778;
this.EVENT_OBJECT_NAMECHANGE = 32780;
this._accImpl.master = this;
this._accImpl.stub = false;
this._accImpl.get_accRole = this.get_accRole;
this._accImpl.get_accName = this.get_accName;
this._accImpl.get_accState = this.get_accState;
this._accImpl.get_accDefaultAction = this.get_accDefaultAction;
this._accImpl.accDoDefaultAction = this.accDoDefaultAction;
};
FPushButtonClass.prototype.setHitArea = function (w, h) {
var _local3 = this.fpb_hitArea_mc;
this.hitArea = _local3;
_local3._visible = false;
_local3._width = w;
_local3._height = ((arguments.length > 1) ? (h) : (_local3._height));
};
FPushButtonClass.prototype.setSize = function (w, h) {
w = ((w == undefined) ? 0 : (w));
h = ((h == undefined) ? 0 : (h));
w = ((w < 6) ? 6 : (w));
if (arguments.length > 1) {
if (h < 6) {
h = 6;
}
}
super.setSize(w, h);
this.setLabel(this.getLabel());
this.arrangeLabel();
this.setHitArea(w, h);
this.boundingBox_mc._width = w;
this.boundingBox_mc._height = h;
this.drawFrame();
if (this.focused) {
super.myOnSetFocus();
}
this.initContentPos("fLabel_mc");
};
FPushButtonClass.prototype.arrangeLabel = function () {
var _local2 = this.fLabel_mc;
var _local4 = this.height;
var _local5 = this.width - 2;
var _local3 = 1;
this.fLabel_mc.setSize(_local5 - (_local3 * 4));
_local2._x = _local3 * 3;
_local2._y = (_local4 / 2) - (_local2._height / 2);
};
FPushButtonClass.prototype.getLabel = function () {
return(this.fLabel_mc.labelField.text);
};
FPushButtonClass.prototype.setLabel = function (label) {
this.fLabel_mc.setLabel(label);
this.txtFormat();
this.arrangeLabel();
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_NAMECHANGE);
}
};
FPushButtonClass.prototype.getEnabled = function () {
return(this.enabled);
};
FPushButtonClass.prototype.setEnabled = function (enable) {
if (enable || (enable == undefined)) {
this.gotoFrame(1);
this.drawFrame();
this.fLabel_mc.setEnabled(true);
this.enabled = true;
super.setEnabled(true);
} else {
this.gotoFrame(4);
this.drawFrame();
this.fLabel_mc.setEnabled(false);
this.enabled = false;
super.setEnabled(false);
}
};
FPushButtonClass.prototype.txtFormat = function () {
var _local3 = this.textStyle;
var _local4 = this.styleTable;
_local3.align = ((_local4.textAlign.value == undefined) ? ((_local3.align = "center")) : undefined);
_local3.leftMargin = ((_local4.textLeftMargin.value == undefined) ? ((_local3.leftMargin = 1)) : undefined);
_local3.rightMargin = ((_local4.textRightMargin.value == undefined) ? ((_local3.rightMargin = 1)) : undefined);
if (this.fLabel_mc._height > this.height) {
super.setSize(this.width, this.fLabel_mc._height);
} else {
super.setSize(this.width, this.height);
}
this.fLabel_mc.labelField.setTextFormat(this.textStyle);
this.setEnabled(this.enable);
};
FPushButtonClass.prototype.drawFrame = function () {
var _local3 = 1;
var _local7 = 0;
var _local6 = 0;
var _local11 = this.width;
var _local10 = this.height;
var _local12 = ["up_mc", "over_mc", "down_mc", "disabled_mc"];
var _local5 = _local12[this.fpbState_mc._currentframe - 1];
var _local4 = "frame";
var _local2 = 0;
while (_local2 < 6) {
_local7 = _local7 + ((_local2 % 2) * _local3);
_local6 = _local6 + ((_local2 % 2) * _local3);
_local11 = _local11 - (((_local2 + 1) % 2) * _local3);
_local10 = _local10 - (((_local2 + 1) % 2) * _local3);
var _local9 = Math.abs(_local7 - _local11) + (2 * _local3);
var _local8 = Math.abs(_local6 - _local10) + (2 * _local3);
this.fpbState_mc[_local5][_local4 + _local2]._width = _local9;
this.fpbState_mc[_local5][_local4 + _local2]._height = _local8;
this.fpbState_mc[_local5][_local4 + _local2]._x = _local7 - _local3;
this.fpbState_mc[_local5][_local4 + _local2]._y = _local6 - _local3;
_local2++;
}
};
FPushButtonClass.prototype.setClickHandler = function (chng, obj) {
this.handlerObj = ((arguments.length < 2) ? (this._parent) : (obj));
this.clickHandler = chng;
};
FPushButtonClass.prototype.executeCallBack = function () {
this.handlerObj[this.clickHandler](this);
};
FPushButtonClass.prototype.initContentPos = function (mc) {
this.incrVal = 1;
this.initx = this[mc]._x - (this.getBtnState() * this.incrVal);
this.inity = this[mc]._y - (this.getBtnState() * this.incrVal);
this.togx = this.initx + this.incrVal;
this.togy = this.inity + this.incrVal;
};
FPushButtonClass.prototype.setBtnState = function (state) {
this.btnState = state;
if (state) {
this.fLabel_mc._x = this.togx;
this.fLabel_mc._y = this.togy;
} else {
this.fLabel_mc._x = this.initx;
this.fLabel_mc._y = this.inity;
}
};
FPushButtonClass.prototype.getBtnState = function () {
return(this.btnState);
};
FPushButtonClass.prototype.myOnSetFocus = function () {
this.focused = true;
super.myOnSetFocus();
};
FPushButtonClass.prototype.onPress = function () {
this.pressFocus();
this.fpbState_mc.gotoAndStop(3);
this.drawFrame();
this.setBtnState(true);
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_STATECHANGE, true);
}
};
FPushButtonClass.prototype.onRelease = function () {
this.fpbState_mc.gotoAndStop(2);
this.drawFrame();
this.executeCallBack();
this.setBtnState(false);
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_STATECHANGE, true);
}
};
FPushButtonClass.prototype.onRollOver = function () {
this.fpbState_mc.gotoAndStop(2);
this.drawFrame();
};
FPushButtonClass.prototype.onRollOut = function () {
this.fpbState_mc.gotoAndStop(1);
this.drawFrame();
};
FPushButtonClass.prototype.onReleaseOutside = function () {
this.setBtnState(false);
this.fpbState_mc.gotoAndStop(1);
this.drawFrame();
};
FPushButtonClass.prototype.onDragOut = function () {
this.setBtnState(false);
this.fpbState_mc.gotoAndStop(1);
this.drawFrame();
};
FPushButtonClass.prototype.onDragOver = function () {
this.setBtnState(true);
this.fpbState_mc.gotoAndStop(3);
this.drawFrame();
};
FPushButtonClass.prototype.myOnKeyDown = function () {
if ((Key.getCode() == 32) && (this.pressOnce == undefined)) {
this.onPress();
this.pressOnce = 1;
}
};
FPushButtonClass.prototype.myOnKeyUp = function () {
if (Key.getCode() == 32) {
this.onRelease();
this.pressOnce = undefined;
}
};
FPushButtonClass.prototype.get_accRole = function (childId) {
return(this.master.ROLE_SYSTEM_PUSHBUTTON);
};
FPushButtonClass.prototype.get_accName = function (childId) {
return(this.master.getLabel());
};
FPushButtonClass.prototype.get_accState = function (childId) {
if (this.pressOnce) {
return(this.master.STATE_SYSTEM_PRESSED);
}
return(this.master.STATE_SYSTEM_DEFAULT);
};
FPushButtonClass.prototype.get_accDefaultAction = function (childId) {
return("Press");
};
FPushButtonClass.prototype.accDoDefaultAction = function (childId) {
this.master.onPress();
this.master.onRelease();
};
#endinitclip
boundingBox_mc._visible = false;
deadPreview._visible = false;
Symbol 12 MovieClip [FLabelSymbol] Frame 1
#initclip 1
_global.FLabelClass = function () {
if (this.hostComponent == undefined) {
this.hostComponent = ((this._parent.controller == undefined) ? (this._parent) : (this._parent.controller));
}
if (this.customTextStyle == undefined) {
if (this.hostComponent.textStyle == undefined) {
this.hostComponent.textStyle = new TextFormat();
}
this.textStyle = this.hostComponent.textStyle;
this.enable = true;
}
};
FLabelClass.prototype = new MovieClip();
Object.registerClass("FLabelSymbol", FLabelClass);
FLabelClass.prototype.setLabel = function (label) {
var _local2 = this.hostComponent.styleTable.embedFonts.value;
if (_local2 != undefined) {
this.labelField.embedFonts = _local2;
}
this.labelField.setNewTextFormat(this.textStyle);
this.labelField.text = ((label == undefined) ? "" : (label));
if (this.labelField.text != "") {
this.labelField._height = this.labelField.textHeight + 2;
}
};
FLabelClass.prototype.setSize = function (width) {
this.labelField._width = width;
};
FLabelClass.prototype.setEnabled = function (enable) {
this.enable = enable;
var _local2 = this.hostComponent.styleTable[(enable ? "textColor" : "textDisabled")].value;
if (_local2 == undefined) {
_local2 = (enable ? 0 : 8947848);
}
this.setColor(_local2);
};
FLabelClass.prototype.getLabel = function () {
return(this.labelField.text);
};
FLabelClass.prototype.setColor = function (col) {
this.labelField.textColor = col;
};
#endinitclip
Symbol 21 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(frame5, "face");
component.registerSkinElement(frame3, "shadow");
component.registerSkinElement(frame1, "darkshadow");
component.registerSkinElement(frame4, "highlight");
component.registerSkinElement(frame2, "highlight3D");
Symbol 27 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(frame5, "face");
component.registerSkinElement(frame3, "shadow");
component.registerSkinElement(frame1, "darkshadow");
component.registerSkinElement(frame4, "highlight");
component.registerSkinElement(frame2, "highlight3D");
Symbol 33 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(frame5, "face");
component.registerSkinElement(frame4, "shadow");
component.registerSkinElement(frame2, "darkshadow");
component.registerSkinElement(frame3, "highlight");
component.registerSkinElement(frame1, "highlight3D");
Symbol 39 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(frame5, "face");
component.registerSkinElement(frame3, "shadow");
component.registerSkinElement(frame1, "darkshadow");
component.registerSkinElement(frame4, "highlight");
component.registerSkinElement(frame2, "highlight3D");
Symbol 40 MovieClip [fpb_states] Frame 1
stop();
Symbol 40 MovieClip [fpb_states] Frame 2
stop();
Symbol 40 MovieClip [fpb_states] Frame 3
stop();
Symbol 40 MovieClip [fpb_states] Frame 4
stop();
Symbol 41 MovieClip [FUIComponentSymbol] Frame 1
#initclip 2
function FUIComponentClass() {
this.init();
}
FUIComponentClass.prototype = new MovieClip();
FUIComponentClass.prototype.init = function () {
this.enable = true;
this.focused = false;
this.useHandCursor = false;
this._accImpl = new Object();
this._accImpl.stub = true;
this.styleTable = new Array();
if (_global.globalStyleFormat == undefined) {
_global.globalStyleFormat = new FStyleFormat();
globalStyleFormat.isGlobal = true;
_global._focusControl = new Object();
_global._focusControl.onSetFocus = function (oldFocus, newFocus) {
oldFocus.myOnKillFocus();
newFocus.myOnSetFocus();
};
Selection.addListener(_global._focusControl);
}
if (this._name != undefined) {
this._focusrect = false;
this.tabEnabled = true;
this.focusEnabled = true;
this.tabChildren = false;
this.tabFocused = true;
if (this.hostStyle == undefined) {
globalStyleFormat.addListener(this);
} else {
this.styleTable = this.hostStyle;
}
this.deadPreview._visible = false;
this.deadPreview._width = (this.deadPreview._height = 1);
this.methodTable = new Object();
this.keyListener = new Object();
this.keyListener.controller = this;
this.keyListener.onKeyDown = function () {
this.controller.myOnKeyDown();
};
this.keyListener.onKeyUp = function () {
this.controller.myOnKeyUp();
};
for (var _local3 in this.styleFormat_prm) {
this.setStyleProperty(_local3, this.styleFormat_prm[_local3]);
}
}
};
FUIComponentClass.prototype.setEnabled = function (enabledFlag) {
this.enable = ((arguments.length > 0) ? (enabledFlag) : true);
this.tabEnabled = (this.focusEnabled = enabledFlag);
if ((!this.enable) && (this.focused)) {
Selection.setFocus(undefined);
}
};
FUIComponentClass.prototype.getEnabled = function () {
return(this.enable);
};
FUIComponentClass.prototype.setSize = function (w, h) {
this.width = w;
this.height = h;
this.focusRect.removeMovieClip();
};
FUIComponentClass.prototype.setChangeHandler = function (chng, obj) {
this.handlerObj = ((obj == undefined) ? (this._parent) : (obj));
this.changeHandler = chng;
};
FUIComponentClass.prototype.invalidate = function (methodName) {
this.methodTable[methodName] = true;
this.onEnterFrame = this.cleanUI;
};
FUIComponentClass.prototype.cleanUI = function () {
if (this.methodTable.setSize) {
this.setSize(this.width, this.height);
} else {
this.cleanUINotSize();
}
this.methodTable = new Object();
delete this.onEnterFrame;
};
FUIComponentClass.prototype.cleanUINotSize = function () {
for (var _local2 in this.methodTable) {
this[_local2]();
}
};
FUIComponentClass.prototype.drawRect = function (x, y, w, h) {
var _local4 = this.styleTable.focusRectInner.value;
var _local5 = this.styleTable.focusRectOuter.value;
if (_local4 == undefined) {
_local4 = 16777215 /* 0xFFFFFF */;
}
if (_local5 == undefined) {
_local5 = 0;
}
this.createEmptyMovieClip("focusRect", 1000);
this.focusRect.controller = this;
this.focusRect.lineStyle(1, _local5);
this.focusRect.moveTo(x, y);
this.focusRect.lineTo(x + w, y);
this.focusRect.lineTo(x + w, y + h);
this.focusRect.lineTo(x, y + h);
this.focusRect.lineTo(x, y);
this.focusRect.lineStyle(1, _local4);
this.focusRect.moveTo(x + 1, y + 1);
this.focusRect.lineTo((x + w) - 1, y + 1);
this.focusRect.lineTo((x + w) - 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, y + 1);
};
FUIComponentClass.prototype.pressFocus = function () {
this.tabFocused = false;
this.focusRect.removeMovieClip();
Selection.setFocus(this);
};
FUIComponentClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this.width + 4, this.height + 4);
};
FUIComponentClass.prototype.myOnSetFocus = function () {
this.focused = true;
Key.addListener(this.keyListener);
if (this.tabFocused) {
this.drawFocusRect();
}
};
FUIComponentClass.prototype.myOnKillFocus = function () {
this.tabFocused = true;
this.focused = false;
this.focusRect.removeMovieClip();
Key.removeListener(this.keyListener);
};
FUIComponentClass.prototype.executeCallBack = function () {
this.handlerObj[this.changeHandler](this);
};
FUIComponentClass.prototype.updateStyleProperty = function (styleFormat, propName) {
this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal);
};
FUIComponentClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
if (value == "") {
return(undefined);
}
var _local19 = parseInt(value);
if (!isNaN(_local19)) {
value = _local19;
}
var _local18 = ((arguments.length > 2) ? (isGlobal) : false);
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].useGlobal || (!_local18)) {
this.styleTable[propName].value = value;
if (this.setCustomStyleProperty(propName, value)) {
} else if (propName == "embedFonts") {
this.invalidate("setSize");
} else if (propName.substring(0, 4) == "text") {
if (this.textStyle == undefined) {
this.textStyle = new TextFormat();
}
var _local15 = propName.substring(4, propName.length);
var _local17 = _local15.substring(0, 1);
_local17 = _local17.toLowerCase();
_local15 = _local17 + _local15.substring(1, _local15.length);
this.textStyle[_local15] = value;
this.invalidate("setSize");
} else {
for (var _local16 in this.styleTable[propName].coloredMCs) {
var _local4 = new Color(this.styleTable[propName].coloredMCs[_local16]);
if (this.styleTable[propName].value == undefined) {
var _local5 = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
_local4.setTransform(_local5);
} else {
_local4.setRGB(value);
}
}
}
this.styleTable[propName].useGlobal = _local18;
}
};
FUIComponentClass.prototype.registerSkinElement = function (skinMCRef, propName) {
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].coloredMCs == undefined) {
this.styleTable[propName].coloredMCs = new Object();
}
this.styleTable[propName].coloredMCs[skinMCRef] = skinMCRef;
if (this.styleTable[propName].value != undefined) {
var _local4 = new Color(skinMCRef);
_local4.setRGB(this.styleTable[propName].value);
}
};
_global.FStyleFormat = function () {
this.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true};
this.listeners = new Object();
this.isGlobal = false;
if (arguments.length > 0) {
for (var _local3 in arguments[0]) {
this[_local3] = arguments[0][_local3];
}
}
};
_global.FStyleFormat.prototype = new Object();
FStyleFormat.prototype.addListener = function () {
var _local3 = 0;
while (_local3 < arguments.length) {
var _local4 = arguments[_local3];
this.listeners[arguments[_local3]] = _local4;
for (var _local5 in this) {
if (this.isAStyle(_local5)) {
_local4.updateStyleProperty(this, _local5.toString());
}
}
_local3++;
}
};
FStyleFormat.prototype.removeListener = function (component) {
this.listeners[component] = undefined;
for (var _local4 in this) {
if (this.isAStyle(_local4)) {
if (component.styleTable[_local4].useGlobal == this.isGlobal) {
component.styleTable[_local4].useGlobal = true;
var _local3 = (this.isGlobal ? undefined : (globalStyleFormat[_local4]));
component.setStyleProperty(_local4, _local3, true);
}
}
}
};
FStyleFormat.prototype.applyChanges = function () {
var _local6 = 0;
for (var _local5 in this.listeners) {
var _local3 = this.listeners[_local5];
if (arguments.length > 0) {
var _local4 = 0;
while (_local4 < arguments.length) {
if (this.isAStyle(arguments[_local4])) {
_local3.updateStyleProperty(this, arguments[_local4]);
}
_local4++;
}
} else {
for (var _local4 in this) {
if (this.isAStyle(_local4)) {
_local3.updateStyleProperty(this, _local4.toString());
}
}
}
}
};
FStyleFormat.prototype.isAStyle = function (name) {
return((this.nonStyles[name] ? false : true));
};
#endinitclip
Symbol 51 MovieClip [mcPowerUp] Frame 1
gotoAndPlay(2 + random(_totalframes));
Symbol 51 MovieClip [mcPowerUp] Frame 67
gotoAndPlay ("loop");
Symbol 57 MovieClip [mcBuoyStart] Frame 1
gotoAndPlay(2 + random(_totalframes));
Symbol 57 MovieClip [mcBuoyStart] Frame 50
gotoAndPlay ("loop");
Symbol 62 MovieClip [mcBuoyFinish] Frame 1
gotoAndPlay(2 + random(_totalframes));
Symbol 62 MovieClip [mcBuoyFinish] Frame 50
gotoAndPlay ("loop");
Symbol 65 Button
on (release, releaseOutside) {
controlObj.buttonReleased();
}
on (dragOut) {
controlObj.buttonDragOut();
}
on (rollOver) {
controlObj.buttonRollover();
}
Symbol 76 MovieClip [mcLetter] Frame 1
stop();
Instance of Symbol 71 MovieClip "mcHilite" in Symbol 76 MovieClip [mcLetter] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 79 MovieClip [mcWordDisplay] Frame 1
function setWord(wrd) {
txt = wrd;
}
txt = "";
trace("word display");
Symbol 85 MovieClip [mcWindAnim] Frame 1
Symbol 85 MovieClip [mcWindAnim] Frame 17
boatObj.triggerAddSpeed();
Symbol 85 MovieClip [mcWindAnim] Frame 27
stop();
_root.mcBoard.removeMovieClip(this);
Symbol 89 MovieClip [mcLetterWindAnim] Frame 19
boatObj.triggerAddSpeed();
Symbol 89 MovieClip [mcLetterWindAnim] Frame 27
stop();
_root.mcBoard.removeMovieClip(this);
Symbol 90 MovieClip [mcRipple] Frame 33
stop();
_root.gGameController.removeRipple(this);
Symbol 97 MovieClip [mcToolTip] Frame 1
stop();
Symbol 103 MovieClip [mcCourseBoatIcon] Frame 1
stop();
Symbol 105 MovieClip Frame 1
randomFrame = 2 + int(_x / 30);
gotoAndPlay(randomFrame);
Symbol 105 MovieClip Frame 34
gotoAndPlay ("loop");
Symbol 113 MovieClip [mcTurnDisplay] Frame 1
function setToBoat(boatObj, userTurnFlag) {
_visible = true;
xCorrection = boatObj.xCorrection;
if (onEnterFrame == undefined) {
onEnterFrame = step;
}
if (userTurnFlag) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
mcToTrack = boatObj.mc;
}
function step() {
_x = Math.max(-67, mcToTrack._x + xCorrection);
_y = mcToTrack._y;
}
function dTrace(str) {
var _local2 = "[turnDisplay AS 1.0 code in clip!!!]";
if (_root.mcDebug.dTrace == undefined) {
trace(_local2 + str);
} else {
_root.mcDebug.dTrace(_local2 + str);
}
}
function traceVar(varName) {
dTrace((varName + ":") + this[varName]);
}
stop();
Symbol 132 Button
on (release) {
_root.mcSound.playSound(1, "click");
returnLabel = "win race";
gotoAndPlay ("confirm quit");
}
on (rollOver) {
_root.mcSound.playSound(1, "rollover");
}
Symbol 136 Button
on (release) {
closeDialogue();
_root.gGameController.nextLevelClicked();
}
on (rollOver) {
_root.mcSound.playSound(1, "rollover");
}
Symbol 146 Button
on (release) {
_root.mcSound.playSound(1, "click");
_root.gGameController.gotoMenu();
}
on (rollOver) {
_root.mcSound.playSound(1, "rollover");
}
Symbol 148 Button
on (release) {
_root.mcSound.playSound(1, "click");
_root.sendToAFriend();
}
on (rollOver) {
_root.mcSound.playSound(1, "rollover");
}
Symbol 155 Button
on (release) {
_root.mcSound.playSound(1, "click");
_root.postHighScoreClicked();
play();
}
on (rollOver) {
_root.mcSound.playSound(1, "rollover");
}
Symbol 160 MovieClip Frame 1
_root.checkScoreRank(this);
stop();
Symbol 160 MovieClip Frame 2
stop();
Symbol 160 MovieClip Frame 3
stop();
Symbol 166 Button
on (release) {
_root.mcSound.playSound(1, "click");
_root.gotoPizmo();
}
on (rollOver) {
_root.mcSound.playSound(1, "rollover");
}
Symbol 175 MovieClip Frame 1
this._visible = false;
Symbol 185 Button
on (release) {
gameURL = ("http://www.miniclip.com/games/" + gamename) + "/en/";
trace("Going to game: " + gameURL);
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 187 MovieClip Frame 1
System.security.allowDomain("www.miniclip.com");
Instance of Symbol 175 MovieClip "mcHighscores" in Symbol 187 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 187 MovieClip Frame 2
if (scoreLocation == undefined) {
trace(("*** Miniclip Highscore Component: scoreLocation (" + scoreLocation) + ") is undefined.");
}
if ((((_url.indexOf("miniclip.com") == -1) && (_url.indexOf("miniclip.net") == -1)) && (_url.indexOf("miniclip.co.uk") == -1)) && (_url.indexOf("miniclips.com"))) {
gotoAndStop(_currentframe + 1);
} else {
var noCache = (getTimer() + random(100000));
mcTarget.loadMovie("http://www.miniclip.com/swfcontent/highscore.swf?noCache=" + noCache);
stop();
}
Symbol 187 MovieClip Frame 3
stop();
Symbol 194 Button
on (release) {
_root.mcSound.playSound(1, "click");
_level0.swHighScoreObject.player1Score = _root.gGameController.gameScore;
_root.swHighScoreObject.showTab = "submit";
_visible = false;
docount = true;
_parent.disabler._visible = true;
_parent.disable._x = 294.6;
_root.mcDebug.dTrace("swscore:" + _level0.swHighScoreObject.player1Score);
loadMovieNum (_root.HSHubURL, 2);
}
on (rollOver) {
_root.mcSound.playSound(1, "rollover");
}
Symbol 195 Button
on (release) {
_root.mcSound.playSound(1, "click");
_root.swHighScoreObject.showTab = "view";
_visible = false;
docount = true;
_parent.disabler._visible = true;
loadMovieNum (_root.HSHubURL, 2);
}
on (rollOver) {
_root.mcSound.playSound(1, "rollover");
}
Symbol 217 Button
on (release) {
closeDialogue();
_root.gGameController.gotoMenu();
}
on (rollOver) {
_root.mcSound.playSound(1, "rollover");
}
Symbol 219 Button
on (release) {
_root.mcSound.playSound(1, "click");
if (returnLabel != undefined) {
gotoAndPlay(returnLabel);
} else {
closeDialogue();
}
}
on (rollOver) {
_root.mcSound.playSound(1, "rollover");
}
Symbol 221 MovieClip [mcDialogue] Frame 1
function setDialogue(where, transitionType) {
trace("setDialogue:" + where);
gotoAndPlay(where);
if (transitionType != "noFade") {
_alpha = 0;
onEnterFrame = function () {
_alpha = Math.min(100, _alpha + 15);
if (_alpha == 100) {
delete onEnterFrame;
}
};
}
}
function closeDialogue() {
gotoAndStop (1);
}
stop();
Symbol 221 MovieClip [mcDialogue] Frame 5
stop();
Symbol 221 MovieClip [mcDialogue] Frame 8
mcTout.loadMovie(_global.baseUrl + "wordwinds/project/tout.swf");
stop();
Symbol 221 MovieClip [mcDialogue] Frame 13
stop();
Symbol 221 MovieClip [mcDialogue] Frame 18
stop();
Instance of Symbol 187 MovieClip "comHighscores" in Symbol 221 MovieClip [mcDialogue] Frame 22
//component parameters
onClipEvent (construct) {
scoreLocation = "_root.gGameController.gameScore";
gamename = "word sailing";
saveScore = true;
scoreIsTime = false;
scoreReversed = false;
negativeScoreAllowed = false;
}
Symbol 221 MovieClip [mcDialogue] Frame 23
stop();
Instance of Symbol 197 MovieClip "HSHubSubmitter" in Symbol 221 MovieClip [mcDialogue] Frame 29
onClipEvent (load) {
docount = false;
}
onClipEvent (enterFrame) {
if (docount) {
trycount++;
if ((_level2.getBytesTotal() == -1) && (trycount > 60)) {
docount = false;
trycount = 0;
}
}
}
Instance of Symbol 200 MovieClip "disabler" in Symbol 221 MovieClip [mcDialogue] Frame 29
onClipEvent (load) {
this.swapDepths(120001);
_visible = false;
_x = -10000;
}
Symbol 221 MovieClip [mcDialogue] Frame 30
mcTout.loadMovie(_global.baseUrl + "wordwinds/project/tout.swf");
stop();
Symbol 221 MovieClip [mcDialogue] Frame 36
if (_root.pizmoFlag) {
mcTout.loadMovie(_global.baseUrl + "wordwinds/project/tout.swf");
}
stop();
Instance of Symbol 200 MovieClip "disabler" in Symbol 221 MovieClip [mcDialogue] Frame 39
onClipEvent (load) {
this.swapDepths(120001);
_visible = false;
}
Symbol 221 MovieClip [mcDialogue] Frame 40
stop();
Symbol 221 MovieClip [mcDialogue] Frame 46
stop();
Instance of Symbol 197 MovieClip "HSHubSubmitter" in Symbol 221 MovieClip [mcDialogue] Frame 50
onClipEvent (load) {
this.swapDepths(100033);
docount = false;
}
onClipEvent (enterFrame) {
if (docount) {
trycount++;
if ((_level2.getBytesTotal() == -1) && (trycount > 60)) {
docount = false;
trycount = 0;
}
}
}
Symbol 221 MovieClip [mcDialogue] Frame 52
stop();
Instance of Symbol 187 MovieClip "comHighscores" in Symbol 221 MovieClip [mcDialogue] Frame 57
//component parameters
onClipEvent (construct) {
scoreLocation = "_root.gGameController.gameScore";
gamename = "Word Sailing";
saveScore = true;
scoreIsTime = false;
scoreReversed = false;
negativeScoreAllowed = false;
}
Symbol 221 MovieClip [mcDialogue] Frame 59
stop();
Symbol 221 MovieClip [mcDialogue] Frame 68
stop();
Symbol 229 MovieClip [mcCourse] Frame 1
stop();
Symbol 251 MovieClip Frame 1
stop();
Symbol 263 MovieClip Frame 1
stop();
Symbol 271 MovieClip Frame 1
stop();
Symbol 280 MovieClip [mcBoatGraphic] Frame 1
stop();
Symbol 280 MovieClip [mcBoatGraphic] Frame 6
gotoAndPlay (1);
Symbol 298 MovieClip Frame 1
stop();
Symbol 298 MovieClip Frame 12
gotoAndPlay (1);
Symbol 298 MovieClip Frame 18
gotoAndPlay (1);
Symbol 308 Button
on (release) {
_root.gotoPizmo();
}
Symbol 310 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 313 Button
on (release) {
_root.gotoPizmo();
}
Symbol 315 MovieClip Frame 1
stop();
Symbol 315 MovieClip Frame 3
stop();
Symbol 315 MovieClip Frame 17
stop();
Symbol 315 MovieClip Frame 32
stop();
Symbol 319 MovieClip Frame 1
stop();
Instance of Symbol 315 MovieClip in Symbol 319 MovieClip Frame 1
onClipEvent (load) {
_root.setSite(this);
}
Symbol 537 MovieClip [__Packages.filter.FilterUtilities] Frame 0
class filter.FilterUtilities
{
function FilterUtilities () {
}
static function setFade(mc, dir, seconds, callback, callbackScope) {
mc.mcFilterDummy.removeMovieClip();
var depth = mc.getNextHighestDepth();
mc.createEmptyMovieClip("mcFilterDummy", depth);
var mcDummy = mc.mcFilterDummy;
if (dir == -1) {
mcDummy.alphaAmt = 1;
} else {
mcDummy.alphaAmt = 0;
mc._visible = false;
}
mcDummy.alphaDelta = (1 / (24 * seconds)) * dir;
mcDummy.callback = callback;
mcDummy.callbackScope = callbackScope;
mcDummy.mc = mc;
var matrix = new Array();
matrix = matrix.concat([1, 0, 0, 0, 0]);
matrix = matrix.concat([0, 1, 0, 0, 0]);
matrix = matrix.concat([0, 0, 1, 0, 0]);
matrix = matrix.concat([0, 0, 0, mc.alphaAmt, 0]);
mcDummy.matrix = matrix;
mcDummy.onEnterFrame = function () {
with (this) {
if (!mc._visible) {
mc._visible = true;
}
alphaAmt = alphaAmt + alphaDelta;
matrix[18] = alphaAmt;
myFilter = new flash.filters.ColorMatrixFilter(matrix);
mc.filters = new Array(myFilter);
if ((alphaAmt <= 0) or (alphaAmt >= 1)) {
callback.call(callbackScope);
mc.filters = [];
if (alphaDelta < 0) {
mc._visible = false;
}
delete onEnterFrame;
}
}
};
}
static function setGlow(mc, color, alpha, blur, strength) {
setGlowFilter(mc, color, alpha, blur, strength);
}
static function setGlowFilter(mc, color, alpha, blur, strength) {
if (color == undefined) {
color = 16777215 /* 0xFFFFFF */;
}
if (alpha == undefined) {
alpha = 0.8;
}
if (blur == undefined) {
blur = 30;
}
var _local7 = blur;
var _local6 = blur;
if (strength == undefined) {
strength = 2;
}
var _local2 = 3;
var _local5 = false;
var _local9 = false;
var _local3 = new flash.filters.GlowFilter(color, alpha, _local7, _local6, strength, _local2, _local5, _local9);
mc.filters = new Array(_local3);
}
static function setBlur(mc, blurX, blurY, quality) {
var _local1 = new flash.filters.BlurFilter(blurX, blurY, quality);
mc.filters = new Array(_local1);
}
static function clearFilters(mc) {
mc.filters = new Array();
}
static function setTransparency(mc, n) {
var _local1 = new Array();
_local1 = _local1.concat([1, 0, 0, 0, 0]);
_local1 = _local1.concat([0, 1, 0, 0, 0]);
_local1 = _local1.concat([0, 0, 1, 0, 0]);
_local1 = _local1.concat([0, 0, 0, n / 100, 0]);
var _local2 = new flash.filters.ColorMatrixFilter(_local1);
mc.filters = new Array(_local2);
}
static function createThresholdBitmap(initParams) {
var _local4 = initParams.thresholdLevel;
var _local1 = initParams.mcSource;
var _local6 = initParams.mcTarget;
var _local5 = new flash.geom.Matrix();
dTrace((((("[FilterUtilities] createThresholdBitmap: " + initParams.mcSource) + ",") + initParams.mcTarget) + ",") + _local4);
var _local2;
_local2 = new flash.display.BitmapData(_local1._width, _local1._height, false, 4294967295);
_local2.draw(_local1, _local5);
_local2.threshold(_local2, new flash.geom.Rectangle(0, 0, _local1._width, _local1._height), new flash.geom.Point(0, 0), ">=", (_local4 / 100) * 16777215, 16777215, 16777215, false);
_local6.attachBitmap(_local2, 2, "auto", true);
}
static function dTrace(str) {
var _local2 = "[FilterUtilities]";
if (_root.mcDebug.dTrace == undefined) {
trace(_local2 + str);
} else {
_root.mcDebug.dTrace(_local2 + str);
}
}
}
Symbol 538 MovieClip [__Packages.com.rawfishsoftware.sushi.SushiAPI] Frame 0
class com.rawfishsoftware.sushi.SushiAPI
{
var $d, $e, session, me, member, mob, room, team, challenge, event, logger, serial, connectionType, $fps, ip, port, $game, $cb, $sc, $socket, $http, $cbid, $cblist, $pollFreq, $memberIDs, $memberNames, $tempTeamList, $nocb, $toGo, $ttid, $clientSpeed;
function SushiAPI () {
$d = "\x02";
$e = "\x03";
session = new com.rawfishsoftware.sushi.Session(this);
me = new com.rawfishsoftware.sushi.Me(this);
member = new com.rawfishsoftware.sushi.Member(this);
mob = new com.rawfishsoftware.sushi.Mob(this);
room = new com.rawfishsoftware.sushi.Room(this);
team = new com.rawfishsoftware.sushi.Team(this);
challenge = new com.rawfishsoftware.sushi.Challenge(this);
event = new com.rawfishsoftware.sushi.Event(this);
logger = new com.rawfishsoftware.sushi.Logger(this);
serial = new com.rawfishsoftware.sushi.Serializer();
$speedCheck();
$init();
session.sessionList = [];
connectionType = "";
me.$init();
$fps = 0;
}
function connectToServer() {
if (arguments[0].toUpperCase() == "SOCKET") {
connectToServerSocket(arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
} else if (arguments[0].toUpperCase() == "HTTP") {
connectToServerHTTP(arguments[1], arguments[2], arguments[3], arguments[4]);
}
}
function connectToServerSocket(ip, port, game, callback, scope) {
$smode = 1;
this.ip = ip;
this.port = port;
$game = game;
$cb = callback;
$sc = scope;
$socket = new com.rawfishsoftware.sushi.SushiSocket(ip, port, this);
}
function connectToServerHTTP(ip, game, callback, scope) {
$smode = 0;
this.ip = ip;
$game = game;
$cb = callback;
$sc = scope;
$http = new com.rawfishsoftware.sushi.SushiHTTP(ip, this);
}
function disconnectFromServer() {
if ($smode) {
$socket.close();
_root.$$sushimc.swapDepths(0);
_root.$$sushimc.removeMovieClip();
$init();
} else {
var _local3 = new LoadVars();
_local3.i = me.id;
_local3.m = (("11" + $d) + me.id) + $e;
_root.$$sushimc.swapDepths(0);
_root.$$sushimc.removeMovieClip();
$init();
_local3.onLoad = function (s) {
};
_local3.sendAndLoad($http.ip, _local3, "POST");
}
session.sessionList = [];
connectionType = "";
me.$init();
}
function sendUserMessage(messageID, routing, targetID, dataArray) {
$sts = $sts + ((((((((((("53" + $d) + messageID) + $d) + me.id) + $d) + routing) + $d) + targetID) + $d) + dataArray.join($d)) + $e);
}
function getFPS(fps) {
$fps = fps;
}
function loadSessionList(gameName, callback, scope) {
$cblist[++$cbid] = {event:callback, action:7, scope:scope};
$sts = $sts + ((((("29" + $d) + $cbid) + $d) + gameName) + $e);
}
function getSessionList() {
return(session.sessionList);
}
function setPollingInterval(frames) {
$pollFreq = frames;
}
function getPollingInterval() {
return($pollFreq);
}
function searchMember(memberName, callback, scope) {
$cblist[++$cbid] = {event:callback, scope:scope};
$sts = $sts + ((((("51" + $d) + $cbid) + $d) + memberName) + $e);
}
function isBadWord(word, callback, scope) {
$cblist[++$cbid] = {event:callback, scope:scope};
$sts = $sts + ((((("57" + $d) + $cbid) + $d) + word) + $e);
}
function callPlugin(pluginID, parameters, callback, scope) {
$cblist[++$cbid] = {event:callback, scope:scope};
$sts = $sts + ((((((("19" + $d) + $cbid) + $d) + pluginID) + $d) + parameters.join($d)) + $e);
}
function receiveMyUpdates(status) {
$sts = $sts + ((("4" + $d) + int(status)) + $e);
}
function encodeObject(objectToEncode) {
return(serial.serialize(objectToEncode));
}
function decodeObject(stringToDecode) {
return(serial.unserialize(stringToDecode));
}
function sendObject(routing, targetID, objectToSend) {
$sts = $sts + ((((((("86" + $d) + routing) + $d) + targetID) + $d) + serial.serialize(objectToSend)) + $e);
}
function getVersion() {
return(((($majorVersion + ".") + $minorVersion) + ".") + $subVersion);
}
function echo() {
var _local2 = new LocalConnection();
_local2.send("_SUSHIOutput", "echo", arguments);
}
function getMemberList(roomID) {
if (roomID == undefined) {
roomID = "";
}
$sts = $sts + ((("14" + $d) + roomID) + $e);
}
function enableLogging(value) {
logging = value;
if (connectionType != "") {
$sts = $sts + ((("87" + $d) + Number(value)) + $e);
}
}
function $init() {
$cb = null;
$sc = null;
$memberIDs = {x0:"Administrator"};
$memberNames = {xAdministrator:0};
$cbid = 0;
$cblist = {};
$tempTeamList = {};
$pollFreq = 100;
$nocb = true;
$toGo = 0;
member.$init();
mob.$init();
team.$init();
session.$init();
room.$init();
challenge.$init();
event.$init();
}
function $p($x) {
var _local71 = $x.split($e);
var _local72 = _local71.length - 1;
var _local38;
var _local12;
var _local4;
_local38 = 0;
while (_local38 < _local72) {
_local12 = _local71[_local38].split($d);
if (logging) {
logger.log(_local12, "SERVER");
}
_local4 = parseInt(_local12[0]);
if (_local4 == 6) {
$onUpdate(member, _local12, event.onUpdateMember);
} else if (_local4 == 26) {
$onUpdate(mob, _local12, event.onUpdateMob);
} else if (_local4 == 54) {
$onIndexUpdate(member, _local12, event.onIndexUpdateMember);
} else if (_local4 == 60) {
$onIndexUpdate(mob, _local12, event.onIndexUpdateMob);
} else if (_local4 == 40) {
$onUpdate(team, _local12, event.onUpdateTeam);
} else if (_local4 == 38) {
$onUpdate(room, _local12, event.onUpdateRoom);
} else if (_local4 == 17) {
var _local42 = _local12.slice(1, _local12.length);
var _local43 = _local42.length;
var _local65 = session.data;
var _local21;
var _local27 = session.__cb;
var _local7 = 0;
while (_local7 < _local43) {
_local21 = _local42[_local7];
_local65[_local21] = _local42[_local7 + 1];
if (_local27) {
var _local18 = _local27["_" + _local21];
if (_local18) {
_local18.cb.apply(_local18.sc, [_local42[_local7 + 1]]);
}
}
_local7 = _local7 + 2;
}
event.onIndexUpdateSession.$call(_local42);
} else if (_local4 == 75) {
$onIndexUpdate(room, _local12, event.onIndexUpdateRoom);
} else if (_local4 == 74) {
$onIndexUpdate(team, _local12, event.onIndexUpdateTeam);
} else if (_local4 == 25) {
var _local48 = _local12[1];
var room = parseInt(_local12[2]);
var _local44 = parseInt(_local12[3]);
var _local51 = _local12.slice(4, _local12.length);
if (mob.list["_" + _local48] == null) {
var _local6 = (mob.list["_" + _local48] = {id:_local48, room:room, member:_local44});
room.list["_" + room].mobs.push(_local48);
}
mob.list["_" + _local48].data = _local51;
if ($nocb) {
event.onNewMob.$call(_local48, _local44, _local51);
}
} else if (_local4 == 27) {
var _local48 = _local12[1];
var _local24 = mob.list["_" + _local48].room;
$removeValue(room.list["_" + _local24].mobs, _local48);
delete mob.list["_" + _local48];
event.onRemoveMob.$call(_local48);
} else if (_local4 == 21) {
var _local48 = int(_local12[1]);
if (_local48 != me.id) {
var _local19 = int(_local12[2]);
var _local6 = int(_local12[3]);
var _local42 = _local12.slice(4, _local12.length);
var _local24 = room.list["_" + _local6];
var _local10 = 0;
while (_local10 < _local24.mobs.length) {
delete mob.list["_" + _local24.mobs[_local10]];
_local10++;
}
_local24.mobs = [];
$removeValue(_local24.members, _local48);
room.list["_" + _local19].members.push(_local48);
member.list["_" + _local48].room = _local19;
$reb(_local42, member.list["_" + _local48].data);
event.onMemberChangesRoom.$call(_local48, _local19, _local6, _local42);
echo("removeMember");
if (challenge.id && (_local6 == challenge.room)) {
$removeValue(challenge.$challengers, _local48);
echo((("remove from challengerlist:" + challenge.$challengers) + " ") + _local48);
}
}
} else if (_local4 == 53) {
var _local42 = _local12.slice(5, _local12.length);
event.onUserMessage.$call(_local12[1], int(_local12[2]), int(_local12[3]), int(_local12[4]), _local42);
} else if (_local4 == 5) {
var _local28 = int(_local12[1]);
var _local30 = _local12[2];
var _local45 = int(_local12[3]);
var _local37 = int(_local12[4]);
var _local55 = _local12[5];
var _local50 = _local12.slice(6, _local12.length);
room.list["_" + _local37].members.push(_local28);
session.members.push(_local28);
$memberIDs["x" + _local28] = _local30;
$memberNames["x" + _local30] = _local28;
team.list["_" + _local45].members.push(_local28);
member.list["_" + _local28] = {id:_local28, name:_local30, room:_local37, team:_local45, data:_local50, platform:_local55, challenger:0, spectator:0};
event.onNewMember.$call(_local28, _local45, _local37, _local55, _local50);
} else if (_local4 == 16) {
var _local42 = _local12.slice(1, _local12.length);
var _local65 = session.data;
var _local27 = session.__cb;
var _local56 = _local42.length;
var _local7 = 0;
while (_local7 < _local56) {
_local65[_local7] = _local42[_local7];
if (_local27) {
var _local18 = _local27["_" + _local7];
if (_local18) {
_local18.cb.apply(_local18.sc, [_local42[_local7]]);
}
}
_local7++;
}
if ($nocb) {
event.onUpdateSession.$call(_local48, _local42);
}
} else if (_local4 == 10) {
event.onChatMessage.$call(int(_local12[1]), int(_local12[2]), int(_local12[3]), _local12[4]);
} else if (_local4 == 11) {
var _local28 = int(_local12[1]);
var _local45 = int(_local12[2]);
var room = int(_local12[3]);
var _local30 = member.getName(_local28);
if (challenge.id) {
$removeValue(challenge.$challengers, _local28);
}
session.members.removeValue(_local28);
$removeValue(room.list["_" + room].members, _local28);
$removeValue(team.list["_" + _local45].members, _local28);
$removeValue(session.members, _local28);
event.onRemoveMember.$call(_local28, _local45, room);
delete $memberIDs["x" + _local28];
delete $memberNames["x" + _local30];
} else if (_local4 == 86) {
event.onObjectReceived.$call(int(_local12[1]), int(_local12[2]), serial.unserialize(_local12[3]));
} else if (_local4 == 62) {
ping = getTimer() - $netTimer;
} else if (_local4 == 49) {
var _local48 = int(_local12[1]);
var _local41 = int(_local12[2]);
member.list["_" + _local48].spectator = _local41;
event.onBeSpectator.$call(_local48, _local41);
} else if (_local4 == 32) {
var _local9 = "";
var _local63 = 1;
var _local49 = parseInt(_local12[1]);
var _local3 = parseInt(_local12[2]);
var _local53 = $cblist[_local49];
var _local69 = _local53.action;
if (!_local3) {
if (_local69 == 2) {
if (logging) {
_local9 = "'changeRoom' status:" + logger.errors[_local3];
}
$reb(_local53.data, me.data);
$removeValue(room.list["_" + me.room].members, me.id);
if ($toGo) {
_local53.toGo = $toGo;
}
me.room = _local53.toGo;
room.list["_" + me.room].members.push(me.id);
mob.$iid = 0;
$nocb = true;
me.$roomToGo = null;
if (challenge.id && (challenge.room != _local53.toGo)) {
challenge.id = 0;
challenge.$challengers = [];
me.moderator = 0;
}
$toGo = 0;
} else if (_local69 == 3) {
if (logging) {
_local9 = "'createRoom' status:" + logger.errors[_local3];
}
} else if (_local69 == 4) {
if (logging) {
_local9 = "'joinSession' status:" + logger.errors[_local3];
}
if ($toGo) {
_local53.roomToGo = $toGo;
}
me.session = _local53.sessionToGo;
me.team = _local53.teamToGo;
me.room = _local53.roomToGo;
me.data = _local53.data;
var _local6 = $tempTeamList["_" + me.session].teamList;
var _local56 = _local6.length;
var _local13;
var _local7 = 0;
while (_local7 < _local56) {
session.teams.push(_local6[_local7].id);
_local13 = (team.list["_" + _local6[_local7].id] = {});
_local13.limit = _local6[_local7].limit;
_local13.name = _local6[_local7].name;
_local13.id = _local6[_local7].id;
_local13.members = [];
_local7++;
}
room.list["_" + me.room].members.push(me.id);
session.members.push(me.id);
$memberIDs["x" + me.id] = me.name;
$memberNames["x" + me.name] = me.id;
member.list["_" + me.id] = {challenger:0, id:me.id, name:me.name, room:me.room, team:me.team, data:me.data, platform:"FLASH"};
_local6 = session.getMemberIDs();
_local56 = _local6.length;
_local7 = 0;
while (_local7 < _local56) {
var _local65 = _local6[_local7];
team.list["_" + member.getTeam(_local65)].members.push(_local65);
_local7++;
}
_local7 = 0;
while (_local7 < session.sessionList.length) {
_local6 = session.sessionList[_local7];
if (_local6.id == me.session) {
break;
}
_local7++;
}
session.id = _local6.id;
session.name = _local6.name;
$nocb = true;
} else if (_local69 == 5) {
if (logging) {
_local9 = "'changeTeam' status:" + logger.errors[_local3];
}
$removeValue(team.list["_" + me.team].members, me.id);
me.team = _local53.toGo;
team["_" + me.team].members.push(me.id);
} else if (_local69 == 6) {
_local53.obj.data[_local53.index] = _local53.value;
} else if (_local69 == 12) {
if (logging) {
_local9 = "'beSpectator' status:" + logger.errors[_local3];
}
me.spectator = _local53.value;
} else if (_local69 == 8) {
if (logging) {
_local9 = "'changeName' status:" + logger.errors[_local3];
}
var _local19 = _local53.newName;
delete $memberNames["x" + me.name];
$memberNames["x" + _local19] = me.id;
me.name = (member.list["_" + me.id].name = ($memberIDs["x" + me.id] = _local19));
}
} else {
if (_local3 == 10) {
if (logging) {
logger.log("Server is full!", "STATUS");
}
$cb.apply($sc, [3]);
$cb = ($sc = null);
disconnectFromServer();
}
if (_local69 == 7) {
if (logging) {
_local9 = "'loadSessionList' status:" + logger.errors[_local3];
}
_local3 = 2;
} else if (_local69 == 3) {
if (_local3 == 11) {
if (logging) {
_local9 = "'createRoom' status:" + logger.errors[_local3];
}
_local3 = 2;
}
} else if (_local69 == 4) {
if (logging) {
_local9 = "'joinSession' status:" + logger.errors[_local3];
}
if (_local3 == 3) {
_local3 = 1;
} else if (_local3 == 4) {
_local3 = 2;
} else if (_local3 == 2) {
_local3 = 3;
} else if (_local3 == 5) {
_local3 = 4;
} else if (_local3 == 14) {
_local3 = 5;
}
} else if (_local69 == 2) {
if (logging) {
_local9 = "'changeRoom' status:" + logger.errors[_local3];
}
if (_local3 == 2) {
_local3 = 1;
} else if (_local3 == 6) {
_local3 = 2;
} else if (_local3 == 7) {
_local3 = 3;
} else if (_local3 == 13) {
_local63 = 0;
_local3 = 4;
} else if (_local3 == 14) {
_local3 = 5;
}
} else if (_local69 == 6) {
if (logging) {
_local9 = "'indexUpdateConditional' status:" + logger.errors[_local3];
}
_local3 = 1;
} else if (_local69 == 10) {
if (_local3 == 12) {
if (logging) {
_local9 = "'requestChallenge' status:" + logger.errors[_local3];
}
challenge.id = int(_local12[3]);
me.moderator = 1;
_local3 = 0;
challenge.$template = _local53.template;
challenge.$timeout = _local53.timeout;
challenge.$minMembers = _local53.minMembers;
} else {
if (logging) {
_local9 = "'requestChallenge' status:" + logger.errors[_local3];
}
challenge.id = 0;
_local3 = 1;
}
} else if (_local69 == 12) {
if (logging) {
_local9 = "'beSpectator' status:" + logger.errors[_local3];
}
if (_local3 == 8) {
_local3 = 1;
}
} else if (_local69 == 8) {
if (logging) {
_local9 = "'changeName' status:" + logger.errors[_local3];
}
if (_local3 == 5) {
_local3 = 1;
} else if (_local3 == 3) {
_local3 = 2;
}
}
}
if (logging) {
logger.log(_local9, "STATUS");
}
_local53.event.apply(_local53.scope, ((_local12.length == 4) ? [_local3, parseInt(_local12[3])] : [_local3]));
if (_local63) {
delete $cblist[_local49];
}
} else if (_local4 == 19) {
var _local49 = parseInt(_local12[1]);
var _local53 = $cblist[_local49];
_local53.event.apply(_local53.scope, _local12.slice(3, _local12.length));
delete $cblist[_local49];
} else if (_local4 == 30) {
var _local26 = int(_local12[1]);
var _local35 = parseInt(_local12[2]);
var _local29 = 0;
var _local30 = _local12[3];
var _local16 = _local12[4].split("\x04");
var _local56 = _local16.length;
var _local20 = [];
var _local42 = [];
_local42 = _local12.slice(5, _local12.length);
var _local10 = 0;
while (_local10 < _local56) {
_local29 = (_local20[_local16[_local10]] = int(_local16[_local10 + 1]));
_local10 = _local10 + 2;
}
session.rooms.push(_local26);
room.list["_" + _local26] = {data:_local42, mobs:[], members:[], waitingQueue:[], locked:0, id:_local26, limit:_local29, name:_local30, teamLimits:_local20, password:_local35};
(_local42.length ? event.onNewRoom.$call(_local26, _local30, _local29, _local42) : event.onNewRoom.$call(_local26, _local30, _local29));
} else if (_local4 == 23) {
var room = int(_local12[1]);
$removeValue(session.rooms, room);
delete room.list["_" + room];
event.onRemoveRoom.$call(room);
} else if (_local4 == 34) {
room.list["_" + me.$roomToGo].waitingQueue = [];
if (_local12[1] != null) {
var _local42 = _local12.slice(1, _local12.length);
room.list["_" + me.$roomToGo].waitingQueue = _local42;
event.onUpdateWaitingQueue.$call(me.$roomToGo, _local42);
}
} else if (_local4 == 67) {
challenge.id = int(_local12[1]);
_local12.push(me.id);
var _local65 = _local12.slice(3, _local12.length);
event.onChallengeRequest.$call(int(_local12[2]), _local65);
} else if (_local4 == 69) {
challenge.$challengers = _local12.slice(3, _local12.length);
challenge.room = int(_local12[2]);
event.onStartChallenge.$call(int(_local12[2]));
} else if (_local4 == 73) {
event.onPlay.$call(int(_local12[1]));
} else if (_local4 == 68) {
if (challenge.id == _local12[2]) {
event.onAnswerChallengeRequest.$call(int(_local12[1]), int(_local12[3]));
}
} else if (_local4 == 72) {
if (challenge.id == int(_local12[1])) {
challenge.id = 0;
challenge.$challengers = [];
me.moderator = 0;
event.onCancelChallenge.$call(int(_local12[2]));
}
} else if (_local4 == 18) {
if (me.id == int(_local12[1])) {
me.moderator = 1;
}
event.onModeratorChanged.$call(int(_local12[1]));
} else if (_local4 == 64) {
(int(_local12[2]) ? event.onIncludeMember.$call(int(_local12[1])) : event.onExcludeMember.$call(int(_local12[1])));
} else if (_local4 == 24) {
$toGo = int(_local12[1]);
} else if (_local4 == 36) {
var _local28 = _local12[1];
var _local30 = _local12[2];
delete $memberNames["x" + _local30];
$memberNames["x" + _local30] = _local28;
member.list["_" + _local28].name = ($memberIDs["x" + _local28] = _local30);
event.onMemberNameChanged.$call(int(_local28), _local30);
} else if (_local4 == 39) {
room.list["_" + _local12[1]].locked = int(_local12[2]);
event.onRoomLocked.$call(int(_local12[1]), int(_local12[2]));
} else if (_local4 == 8) {
me.master = 1;
event.onMaster.$call();
} else if (_local4 == 9) {
me.master = 0;
event.onSlave.$call();
} else if (_local4 == 43) {
var _local48 = parseInt(_local12[1]);
if (_local48 != me.id) {
var _local36 = int(_local12[3]);
var _local59 = int(_local12[2]);
$removeValue(team.list["_" + _local59].members, _local48);
team.list["_" + _local36].members.push(_local48);
member.list["_" + _local48].team = _local36;
event.onMemberChangesTeam.$call(_local48, _local59, _local36);
}
} else if (_local4 == 52) {
var _local53 = $cblist[_local12[1]];
if (_local12[2] == -1) {
_local53.event.apply(_local53.scope, [0]);
} else {
var _local31 = [];
var _local56 = _local12.length;
var _local7 = 2;
while (_local7 < _local56) {
if (_local12[_local7] != -1) {
_local31.push({id:_local12[_local7], session:_local12[_local7 + 1], team:_local12[_local7 + 2], room:_local12[_local7 + 3], spectator:0});
}
_local7 = _local7 + 4;
}
_local53.event.apply(_local53.scope, [_local31]);
}
} else if (_local4 == 56) {
event.onSystemMessage.$call(_local12[1]);
} else if (_local4 == 1) {
if (connectionType == "HTTP") {
$http.lv.i = (me.id = parseInt(_local12[1]));
$http.lv.s = parseInt(_local12[2]);
} else {
me.id = parseInt(_local12[1]);
}
} else if (_local4 == 2) {
$cblist[++$cbid] = {event:$cb, action:7, scope:$sc};
$sts = $sts + ((((("29" + $d) + $cbid) + $d) + $game) + $e);
$sts = $sts + ((("3" + $d) + (getTimer() - $netTimer)) + $e);
if (logging) {
$sts = $sts + ((("87" + $d) + "1") + $e);
}
} else if (_local4 == 35) {
var _local29 = 0;
var _local17;
var _local32 = _local12.length;
var _local19 = 1;
var _local64;
var _local34;
var _local20 = [];
var _local33;
var _local66;
var _local68 = 0;
while (_local19 < _local32) {
var _local48 = parseInt(_local12[_local19++]);
var _local35 = ((parseInt(_local12[_local19++]) == 1) ? true : false);
_local66 = parseInt(_local12[_local19++]);
_local64 = parseInt(_local12[_local19++]);
_local34 = _local12[_local19++];
_local33 = parseInt(_local12[_local19++]);
var _local16 = _local12[_local19++].split("\x04");
var _local56 = _local16.length;
_local20 = [];
var _local10 = 0;
while (_local10 < _local56) {
_local29 = _local29 + ((_local20[_local16[_local10]] = parseInt(_local16[_local10 + 1])));
_local10 = _local10 + 2;
}
session.rooms.push(_local48);
_local17 = (room.list["_" + _local48] = {data:[], mobs:[], members:[], waitingQueue:[], locked:_local33, id:_local48, limit:_local29, name:_local34, teamLimits:_local20, password:_local35});
while ((_local12[_local19].charCodeAt(0) != 1) && (_local19 < _local32)) {
_local17.data.push(_local12[_local19]);
_local19++;
}
_local19++;
_local29 = 0;
}
} else if (_local4 == 7) {
if (!$smode) {
event.onDisconnect.$call();
}
_root.$$sushimc.swapDepths(0);
_root.$$sushimc.removeMovieClip();
$init();
event.onServerRestart.$call();
} else if (_local4 == 65) {
var _local48 = int(_local12[1]);
if ((_local48 == me.id) && (!$smode)) {
_root.$$sushimc.swapDepths(0);
_root.$$sushimc.removeMovieClip();
$init();
}
event.onMemberKicked.$call(_local48);
} else if (_local4 == 77) {
event.onBadwordDetected.$call();
} else if (_local4 == 57) {
var _local49 = parseInt(_local12[1]);
var _local53 = $cblist[_local49];
_local53.event.apply(_local53.scope, [parseInt(_local12[2])]);
delete $cblist[_local49];
} else if (_local4 == 61) {
if (connectionType == "SOCKET") {
$pint = setInterval(this, "$ping", parseInt(_local12[1]));
}
} else if (_local4 == 44) {
var _local67 = true;
var _local19 = 2;
var _local25;
var _local5;
var _local8;
var _local11;
var _local32 = _local12.length;
var _local60 = $cblist[_local12[1]];
session.sessionList = [];
var _local22;
while (_local19 < _local32) {
_local25 = parseInt(_local12[_local19++]);
_local5 = {};
var _local14 = 0;
var _local15 = 0;
_local5.teamList = [];
_local5.name = _local12[_local19++];
_local5.version = _local12[_local19++];
_local5.id = _local25;
session.sessionList.push(_local5);
_local22 = ($tempTeamList["_" + _local25] = {});
_local22.teamList = [];
do {
_local8 = {};
_local11 = {};
var _local48 = (_local11.id = (_local8.id = parseInt(_local12[_local19++])));
$ttid[_local48] = [];
_local8.name = (_local11.name = _local12[_local19++]);
_local14 = _local14 + ((_local8.activeMembers = parseInt(_local12[_local19++])));
_local15 = _local15 + ((_local11.limit = (_local8.limit = parseInt(_local12[_local19++]))));
_local5.teamList.push(_local8);
_local22.teamList.push(_local11);
} while (_local12[_local19].charCodeAt(0) != 1);
_local5.activeMembers = _local14;
_local5.limit = _local15;
_local14 = 0;
_local15 = 0;
_local5.data = [];
_local19++;
do {
_local5.data.push(_local12[_local19++]);
} while (_local12[_local19].charCodeAt(0) != 1);
_local19++;
}
_local60.event.apply(_local60.scope, [0]);
delete $cblist[_local12[1]];
} else if (_local4 == 33) {
if (_local12[1] != null) {
var _local56 = _local12.length - 6;
var _local23;
var _local7 = 0;
while (_local7 <= _local56) {
var _local48 = parseInt(_local12[_local7 + 4]);
_local23 = parseInt(_local12[_local7 + 1]);
var _local24 = parseInt(_local12[_local7 + 2]);
var _local19 = _local12[_local7 + 5];
var _local32 = parseInt(_local12[_local7 + 3]);
var _local17 = _local12[_local7 + 6];
session.members.push(_local48);
room.list["_" + _local24].members.push(_local48);
team.list["_" + _local23].members.push(_local48);
$memberIDs["x" + _local48] = _local19;
$memberNames["x" + _local19] = _local48;
member.list["_" + _local48] = {challenger:0, id:_local48, name:_local19, room:_local24, data:[], team:_local23, platform:_local17, spectator:_local32};
_local7 = _local7 + 6;
}
if (room.$cb) {
room.$cb.apply(room.$sc, [0]);
room.$cb = (room.$sc = null);
}
}
}
_local38++;
}
}
function $speedCheck() {
var _local8 = getTimer();
var _local7 = "0,00,00000000000000,00,0000,00,0,0,0#0,000,0,000000000,0,000#0,0,0000,0,000#0,0000,00000000000,0,0#0,00000000,00#000,00#0,0,000#0,00,00000000000,00#0,00,0000,000#0,0,0000#00,0000,0#";
var _local5;
var _local6;
var _local3;
var _local2;
var _local4;
_local5 = 0;
while (_local5 <= 400) {
_local3 = _local7.split("#");
_local4 = _local3.length;
_local2 = 0;
while (_local2 < _local4) {
_local6 = _local3[_local2].split(",");
_local2++;
}
_local5++;
}
$clientSpeed = getTimer() - _local8;
}
function $reb(a, d) {
var _local1;
var _local2 = a.length;
_local1 = 0;
while (_local1 < _local2) {
d[_local1] = a[_local1];
_local1++;
}
}
function $update(o, j, id, d) {
var _local2 = d.join($d);
$reb(d, o.list["_" + id].data);
$sts = $sts + (((((j + $d) + id) + $d) + _local2) + $e);
}
function $silentUpdate(o, j, id, d) {
var _local3 = d.join($d);
var _local2 = o.list["_" + id];
$reb(d, _local2.data);
$sts = $sts + (((((j + $d) + id) + $d) + _local3) + $e);
}
function $indexUpdate(o, j, id, d) {
var _local6 = d.join($d);
var _local4 = d.length;
var _local5 = o.list["_" + id].data;
var _local2;
_local2 = 0;
while (_local2 < _local4) {
_local5[d[_local2]] = d[_local2 + 1];
_local2 = _local2 + 2;
}
$sts = $sts + (((((j + $d) + id) + $d) + _local6) + $e);
}
function $indexUpdateEval(o, j, id, d) {
$sts = $sts + (((((j + $d) + id) + $d) + d.join($d)) + $e);
}
function $indexUpdateConditional(o, j, id, d, cb, sc) {
$cblist[++$cbid] = {event:cb, action:6, obj:o.list["_" + id], index:d[0], value:d[1], scope:sc};
$sts = $sts + (((((((j + $d) + id) + $d) + d.join($d)) + $d) + $cbid) + $e);
}
function $onUpdate(o, p, cb) {
var _local5 = p[1];
var _local4 = p.slice(2, p.length);
var _local10 = o.list["_" + _local5];
var _local7 = _local10.data;
var _local2;
var _local8 = _local4.length;
var _local6 = _local10.__cb;
_local2 = 0;
while (_local2 < _local8) {
_local7[_local2] = _local4[_local2];
if (_local6) {
var _local3 = _local6["_" + _local2];
if (_local3) {
if (o != mob) {
_local3.cb.apply(_local3.sc, [int(_local5), _local4[_local2]]);
} else {
_local3.cb.apply(_local3.sc, [_local5, _local4[_local2]]);
}
}
}
_local2++;
}
if ($nocb) {
cb.$call(_local5, _local4);
}
}
function $onIndexUpdate(o, p, cb) {
var _local6 = p[1];
var _local4 = p.slice(2, p.length);
var _local9 = _local4.length;
var _local11 = o.list["_" + _local6];
var _local8 = _local11.data;
var _local7 = _local11.__cb;
var _local2 = 0;
while (_local2 < _local9) {
var _local5 = _local4[_local2];
_local8[_local5] = _local4[_local2 + 1];
if (_local7) {
var _local3 = _local7["_" + _local5];
if (_local3) {
if (o != mob) {
_local3.cb.apply(_local3.sc, [int(_local6), _local4[_local2 + 1]]);
} else {
_local3.cb.apply(_local3.sc, [_local6, _local4[_local2 + 1]]);
}
}
}
_local2 = _local2 + 2;
}
cb.$call(_local6, _local4);
}
function $removeValue() {
var _local3 = arguments[0];
var _local4 = arguments[1];
var _local2 = _local3.length;
_local2 = _local3.length;
while (_local2 >= 0) {
if (_local3[_local2] == _local4) {
_local3.splice(_local2, 1);
return(true);
}
_local2--;
}
return(false);
}
function $ping() {
$netTimer = getTimer();
$sts = $sts + (("62" + $d) + $e);
}
function $getFPS() {
fps = -1000 / ($$fps - (($$fps = getTimer())));
speedFac = $fps / fps;
}
function $dump(o) {
var _local2;
trace("**************************************************");
echo("**************************************************");
trace("Dump:");
echo("Dump:");
for (_local2 in o) {
trace((_local2 + " => ") + o[_local2]);
echo((_local2 + " => ") + o[_local2]);
}
trace("**************************************************");
echo("**************************************************");
}
var fps = 0;
var speedFac = 1;
var ping = -1;
var LIMIT = 0;
var logging = false;
var $sts = "";
var $$fps = 0;
var $pon = false;
var $smode = -1;
var $netTimer = -1;
var $pint = null;
var $majorVersion = 2;
var $minorVersion = 2;
var $subVersion = 4;
}
Symbol 539 MovieClip [__Packages.com.rawfishsoftware.sushi.Member] Frame 0
class com.rawfishsoftware.sushi.Member
{
var ref, d, e, list;
function Member (r) {
ref = r;
d = ref.$d;
e = ref.$e;
$init();
}
function $init() {
list = {};
}
function getTeam(memberID) {
return(list["_" + memberID].team);
}
function getName(memberID) {
return(ref.$memberIDs["x" + memberID]);
}
function getName_list(memberIDs) {
var _local4 = [];
var _local2;
_local2 = 0;
while (_local2 < memberIDs.length) {
_local4.push(getName(memberIDs[_local2]));
_local2++;
}
return(_local4);
}
function getID(memberName) {
return(ref.$memberNames["x" + memberName]);
}
function getObject(memberID) {
return(list["_" + memberID]);
}
function getData(memberID) {
return(list["_" + memberID].data.slice());
}
function getRoom(memberID) {
return(list["_" + memberID].room);
}
function getPlatform(memberID) {
return(list["_" + memberID].platform);
}
function isSpectator(memberID) {
return(list["_" + memberID].spectator);
}
function chat(targetMemberID, message) {
ref.$sts = ref.$sts + ((((((((("10" + d) + ref.me.id) + d) + "0") + d) + targetMemberID) + d) + message) + e);
}
function registerEvents(memberID, object) {
list["_" + memberID].$class = object;
}
function degisterEvents(memberID, object) {
list["_" + memberID].$class = null;
}
function setDataIndexCallback(memberID, index, callback, scope) {
var _local2 = list["_" + memberID];
if (!_local2.__cb) {
_local2.__cb = [];
}
_local2.__cb["_" + index] = {cb:callback, sc:scope};
}
function clearDataIndexCallback(memberID, index) {
var _local3 = list["_" + memberID];
delete _local3.__cb["_" + index];
var _local5 = _local3.data.length;
var _local4 = 0;
var _local2 = 0;
while (_local2 < _local5) {
if (_local3.__cb["_" + _local2]) {
_local4++;
break;
}
_local2++;
}
if (!_local4) {
delete _local3.__cb;
}
}
function clearAllDataIndexCallbacks(memberID) {
var _local2 = list["_" + memberID];
delete _local2.__cb;
}
var name = "member";
}
Symbol 540 MovieClip [__Packages.com.rawfishsoftware.sushi.Me] Frame 0
class com.rawfishsoftware.sushi.Me
{
var ref, d, e, data, id, room, session, team, name, $mobid, $tempcbid, spectator, master, moderator, $roomToGo;
function Me (r) {
ref = r;
d = ref.$d;
e = ref.$e;
$init();
}
function $init() {
data = [];
id = (room = (session = (team = -1)));
name = "";
$mobid = ($tempcbid = 0);
spectator = (master = (moderator = 0));
}
function joinSession(name, sessionID, teamID, roomID, data, callback, scope) {
this.name = name;
ref.$cblist[++ref.$cbid] = {data:data, cbid:ref.$cbid, event:callback, teamToGo:teamID, roomToGo:roomID, sessionToGo:sessionID, action:4, scope:scope};
ref.$nocb = false;
ref.session.data = [];
ref.$sts = ref.$sts + ((((((((((((((("45" + d) + ref.$cbid) + d) + sessionID) + d) + teamID) + d) + roomID) + d) + "") + d) + name) + d) + data.join(d)) + e);
}
function joinSessionPassword(name, password, sessionID, teamID, roomID, data, callback, scope) {
this.name = name;
ref.$cblist[++ref.$cbid] = {data:data, cbid:ref.$cbid, event:callback, teamToGo:teamID, roomToGo:roomID, sessionToGo:sessionID, action:4, scope:scope};
ref.$nocb = false;
ref.session.data = [];
ref.$sts = ref.$sts + ((((((((((((((("45" + d) + ref.$cbid) + d) + sessionID) + d) + teamID) + d) + roomID) + d) + password) + d) + name) + d) + data.join(d)) + e);
}
function leaveSession() {
ref.$sts = ref.$sts + (("28" + d) + e);
ref.$init();
}
function changeName(newName, callback, scope) {
ref.$cblist[++ref.$cbid] = {event:callback, newName:newName, action:8, scope:scope};
ref.$sts = ref.$sts + ((((((("36" + d) + ref.$cbid) + d) + id) + d) + newName) + e);
}
function changeTeam(newTeamID, callback, scope) {
ref.$cblist[++ref.$cbid] = {event:callback, toGo:newTeamID, action:5, scope:scope};
ref.$sts = ref.$sts + ((((((((("42" + d) + ref.$cbid) + d) + id) + d) + team) + d) + newTeamID) + e);
}
function createRoom(roomName, templateName, callback, scope) {
ref.$cblist[++ref.$cbid] = {event:callback, toGo:-1, action:3, scope:scope};
ref.$nocb = false;
var _local2 = [];
ref.$sts = ref.$sts + ((((((((((((("22" + d) + ref.$cbid) + d) + id) + d) + "") + d) + roomName) + d) + templateName) + d) + _local2.join("\x01")) + e);
}
function createRoomPassword(roomName, password, templateName, callback, scope) {
ref.$cblist[++ref.$cbid] = {event:callback, toGo:-1, action:3, scope:scope};
ref.$nocb = false;
var _local2 = [];
ref.$sts = ref.$sts + ((((((((((((("22" + d) + ref.$cbid) + d) + id) + d) + password) + d) + roomName) + d) + templateName) + d) + _local2.join("\x01")) + e);
}
function createPrivateRoom(roomName, templateName, memberIDs, callback, scope) {
ref.$cblist[++ref.$cbid] = {event:callback, toGo:-1, action:3, scope:scope};
ref.$nocb = false;
memberIDs.push(ref.me.id);
ref.$sts = ref.$sts + ((((((((((((("22" + d) + ref.$cbid) + d) + id) + d) + "") + d) + roomName) + d) + templateName) + d) + memberIDs.join("\x01")) + e);
}
function createPrivateRoomPassword(roomName, password, templateName, memberIDs, callback, scope) {
ref.$cblist[++ref.$cbid] = {event:callback, toGo:-1, action:3, scope:scope};
ref.$nocb = false;
memberIDs.push(ref.me.id);
ref.$sts = ref.$sts + ((((((((((((("22" + d) + ref.$cbid) + d) + id) + d) + password) + d) + roomName) + d) + templateName) + d) + memberIDs.join("\x01")) + e);
}
function changeRoom(roomID, dataArray, callback, scope) {
ref.$cblist[++ref.$cbid] = {event:callback, toGo:roomID, action:2, data:dataArray, scope:scope};
$roomToGo = roomID;
ref.$sts = ref.$sts + ((((((((((("20" + d) + ref.$cbid) + d) + id) + d) + roomID) + d) + "") + d) + dataArray.join(d)) + e);
}
function changeRoomPassword(roomID, password, dataArray, callback, scope) {
ref.$cblist[++ref.$cbid] = {event:callback, toGo:roomID, action:2, data:dataArray, scope:scope};
$roomToGo = roomID;
ref.$sts = ref.$sts + ((((((((((("20" + d) + ref.$cbid) + d) + id) + d) + roomID) + d) + password) + d) + dataArray.join(d)) + e);
}
function update(dataArray) {
ref.$reb(dataArray, data);
ref.$update(ref.member, "6", id, dataArray);
}
function silentUpdate(dataArray) {
ref.$reb(dataArray, data);
ref.$update(ref.member, "31", id, dataArray);
}
function indexUpdate(dataArray) {
ref.$ireb(dataArray, data);
ref.$indexUpdate(ref.member, "54", id, dataArray);
}
function createMob(roomID, deleteOnExit, dataArray) {
var _local2 = (id + "m") + ($mobid++);
ref.mob.list["_" + _local2] = {id:_local2, room:roomID, data:dataArray, $lu:"", $liu:""};
ref.room.list["_" + roomID].mobs.push(_local2);
ref.$sts = ref.$sts + ((((((((((("25" + d) + _local2) + d) + roomID) + d) + "1") + d) + deleteOnExit) + d) + dataArray.join(d)) + e);
return(_local2);
}
function beSpectator(status, callback, scope) {
ref.$cblist[++ref.$cbid] = {event:callback, action:12, scope:scope, value:status};
ref.$sts = ref.$sts + ((((("48" + d) + ref.$cbid) + d) + status) + e);
}
}
Symbol 541 MovieClip [__Packages.com.rawfishsoftware.sushi.Mob] Frame 0
class com.rawfishsoftware.sushi.Mob
{
var ref, d, e, list, $iid;
function Mob (r) {
ref = r;
d = ref.$d;
e = ref.$e;
$init();
}
function $init() {
list = [];
$iid = 0;
}
function update(mobID, dataArray) {
ref.$update(this, "26", mobID, dataArray);
}
function silentUpdate(mobID, dataArray) {
ref.$update(this, "15", mobID, dataArray);
}
function indexUpdate(mobID, dataArray) {
ref.$indexUpdate(this, "60", mobID, dataArray);
}
function indexUpdateEval(mobID, dataArray) {
ref.$indexUpdateEval(this, "41", mobID, dataArray);
}
function indexUpdateConditional(mobID, dataArray, callback, scope) {
ref.$indexUpdateConditional(this, "41", mobID, dataArray, callback, scope);
}
function remove(mobID) {
ref.$sts = ref.$sts + ((("27" + d) + mobID) + e);
var _local2 = list["_" + mobID].room;
ref.$removeValue(ref.room.list["_" + _local2].mobs, mobID);
trace("list:" + ref.room.list["_" + _local2].mobs);
delete list["_" + mobID];
}
function getMember(mobID) {
return(list["_" + mobID].member);
}
function getRoom(mobID) {
return(list["_" + mobID].room);
}
function getObject(mobID) {
return(list["_" + mobID]);
}
function getData(mobID) {
return(list["_" + mobID].data);
}
function init(roomID, deleteOnExit, dataArray) {
var _local2 = ((++$iid) + "m") + roomID;
var _local3 = (deleteOnExit ? 1 : 0);
if (list["_" + _local2] == null) {
list["_" + _local2] = {id:_local2, room:roomID, data:dataArray, member:ref.me.id};
if (ref.me.master) {
ref.$sts = ref.$sts + ((((((((("47" + d) + _local2) + d) + roomID) + d) + _local3) + d) + dataArray.join(d)) + e);
}
}
return(_local2);
}
function registerEvents(mobID, object) {
list["_" + mobID].$class = object;
}
function deregisterEvents(mobID) {
list["_" + mobID].$class = null;
}
function setDataIndexCallback(mobID, index, callback, scope) {
var _local2 = list["_" + mobID];
if (!_local2.__cb) {
_local2.__cb = [];
}
_local2.__cb["_" + index] = {cb:callback, sc:scope};
}
function clearDataIndexCallback(mobID, index) {
var _local3 = list["_" + mobID];
delete _local3.__cb["_" + index];
var _local5 = _local3.data.length;
var _local4 = 0;
var _local2 = 0;
while (_local2 < _local5) {
if (_local3.__cb["_" + _local2]) {
_local4++;
break;
}
_local2++;
}
if (!_local4) {
delete _local3.__cb;
}
}
function clearAllDataIndexCallbacks(mobID) {
var _local2 = list["_" + mobID];
delete _local2.__cb;
}
}
Symbol 542 MovieClip [__Packages.com.rawfishsoftware.sushi.Session] Frame 0
class com.rawfishsoftware.sushi.Session
{
var ref, d, e, teams, rooms, members, data, $cb, sessionList, name, __cb;
function Session (r) {
ref = r;
d = ref.$d;
e = ref.$e;
$init();
}
function $init() {
teams = [];
rooms = [];
members = [];
data = [];
$cb = [];
}
function getSessionList() {
return(sessionList);
}
function update(dataArray) {
var _local2 = dataArray.join(d).toString();
ref.$reb(dataArray, data);
ref.$sts = ref.$sts + ((("16" + d) + _local2) + e);
}
function indexUpdate(dataArray) {
var _local6 = dataArray.join(d).toString();
var _local4 = d.length;
var _local5 = data;
var _local2 = 0;
while (_local2 < _local4) {
_local5[dataArray[_local2]] = dataArray[_local2 + 1];
_local2 = _local2 + 2;
}
ref.$sts = ref.$sts + ((("17" + d) + _local6) + e);
}
function indexUpdateEval(dataArray) {
ref.$sts = ref.$sts + ((("59" + d) + dataArray.join(d).toString()) + e);
}
function indexUpdateConditional(dataArray, callback, scope) {
ref.$cblist[++ref.$cbid] = {event:callback, action:6, obj:this, index:dataArray[0], value:dataArray[1], scope:scope};
ref.$sts = ref.$sts + ((((("59" + d) + dataArray.join(d)) + d) + ref.$cbid) + e);
}
function getTeamIDs() {
return(teams.slice());
}
function getTeamNames() {
var _local2 = teams.length;
var _local3 = [];
while (_local2--) {
_local3.push(ref.team.list["_" + teams[_local2]].name);
}
return(_local3);
}
function getMemberNames() {
var _local2 = members.length;
var _local3 = [];
while (_local2--) {
_local3.push(ref.member.getName(members[_local2]));
}
return(_local3);
}
function getData() {
return(data);
}
function getName() {
return(name);
}
function getRoomIDs() {
return(rooms.slice());
}
function getMemberIDs() {
return(members.slice());
}
function getNumberOfRooms() {
return(rooms.length);
}
function getNumberOfTeams() {
return(teams.length);
}
function getNumberOfMembers() {
return(members.length);
}
function chat(message) {
ref.$sts = ref.$sts + ((((((((("10" + d) + ref.me.id) + d) + "2") + d) + "0") + d) + message) + e);
}
function setDataIndexCallback(index, callback, scope) {
if (!__cb) {
__cb = [];
}
__cb["_" + index] = {cb:callback, sc:scope};
}
function clearDataIndexCallback(index) {
delete __cb["_" + index];
var _local4 = data.length;
var _local3 = 0;
var _local2 = 0;
while (_local2 < _local4) {
if (__cb["_" + _local2]) {
_local3++;
break;
}
_local2++;
}
if (!_local3) {
delete __cb;
}
}
function clearAllDataIndexCallbacks() {
delete __cb;
}
}
Symbol 543 MovieClip [__Packages.com.rawfishsoftware.sushi.Team] Frame 0
class com.rawfishsoftware.sushi.Team
{
var ref, d, e, list;
function Team (r) {
ref = r;
d = ref.$d;
e = ref.$e;
$init();
}
function $init() {
list = [];
}
function update(teamID, dataArray) {
ref.$update(this, "40", teamID, dataArray);
}
function indexUpdate(teamID, dataArray) {
ref.$indexUpdate(this, "74", teamID, dataArray);
}
function indexUpdateEval(teamID, dataArray) {
ref.$indexUpdateEval(this, "50", teamID, dataArray);
}
function indexUpdateConditional(teamID, dataArray, callback, scope) {
ref.$indexUpdateConditional(this, "50", teamID, dataArray, callback, scope);
}
function getMemberIDs(teamID) {
return(list["_" + teamID].members);
}
function getName_list(teamIDs) {
var _local4 = [];
var _local2;
_local2 = 0;
while (_local2 < teamIDs.length) {
_local4.push(getName(teamIDs[_local2]));
_local2++;
}
return(_local4);
}
function getName(teamID) {
return(list["_" + teamID].name);
}
function getNumberOfMemberIDs(teamID) {
return(list["_" + teamID].members.length);
}
function getMemberNames(teamID) {
var _local4 = list["_" + teamID].members;
var _local2 = _local4.length;
var _local3 = [];
while (_local2--) {
_local3.push(ref.member["_" + _local4[_local2]].name);
}
return(_local3);
}
function getLimit(teamID) {
return(list["_" + teamID].limit);
}
function getData(teamID) {
return(list["_" + teamID].data);
}
function getObject(teamID) {
return(list["_" + teamID]);
}
function chat(targetTeamID, message) {
ref.$sts = ref.$sts + ((((((((("10" + d) + ref.me.id) + d) + "3") + d) + targetTeamID) + d) + message) + e);
}
function roomChat(targetTeamID, message) {
ref.$sts = ref.$sts + ((((((((("10" + d) + ref.me.id) + d) + "4") + d) + targetTeamID) + d) + message) + e);
}
function checkMemberID(teamID, memberID) {
var _local3 = list["_" + teamID].members;
var _local2;
var _local4 = _local3.length;
var _local5;
_local2 = 0;
while (_local2 < _local4) {
if (_local5 == _local3[_local2]) {
return(true);
}
_local2++;
}
return(false);
}
function registerEvents(teamID, object) {
list["_" + teamID].$class = object;
}
function deregisterEvents(teamID) {
list["_" + teamID].$class = null;
}
function setDataIndexCallback(teamID, index, callback, scope) {
var _local2 = list["_" + teamID];
if (!_local2.__cb) {
_local2.__cb = new Array();
}
_local2.__cb["_" + index] = {cb:callback, sc:scope};
}
function clearDataIndexCallback(teamID, index) {
var _local3 = list["_" + teamID];
delete _local3.__cb["_" + index];
var _local5 = _local3.data.length;
var _local4 = 0;
var _local2 = 0;
while (_local2 < _local5) {
if (_local3.__cb["_" + _local2]) {
_local4++;
break;
}
_local2++;
}
if (!_local4) {
delete _local3.__cb;
}
}
function clearAllDataIndexCallbacks(teamID) {
var _local2 = list["_" + teamID];
delete _local2.__cb;
}
}
Symbol 544 MovieClip [__Packages.com.rawfishsoftware.sushi.Room] Frame 0
class com.rawfishsoftware.sushi.Room
{
var ref, d, e, list;
function Room (r) {
ref = r;
d = ref.$d;
e = ref.$e;
$init();
}
function $init() {
list = new Array();
}
function update(roomID, dataArray) {
ref.$update(this, "38", roomID, dataArray);
}
function indexUpdate(roomID, dataArray) {
ref.$indexUpdate(this, "75", roomID, dataArray);
}
function getMemberList(roomID, callback, scope) {
ref.$sts = ref.$sts + ((("14" + d) + roomID) + e);
$cb = callback;
$sc = scope;
}
function indexUpdateEval(roomID, dataArray) {
ref.$indexUpdateEval(this, "58", roomID, dataArray);
}
function indexUpdateConditional(roomID, dataArray, callback, scope) {
ref.$indexUpdateConditional(this, "58", roomID, dataArray, callback, scope);
}
function getName(roomID) {
return(list["_" + roomID].name);
}
function getName_list(roomIDs) {
var _local4 = [];
var _local2;
_local2 = 0;
while (_local2 < roomIDs.length) {
_local4.push(getName(roomIDs[_local2]));
_local2++;
}
return(_local4);
}
function checkMemberID(roomID, memberID) {
var _local3 = list["_" + roomID].members;
var _local2;
var _local4 = _local3.length;
_local2 = 0;
while (_local2 < _local4) {
if (memberID == _local3[_local2]) {
return(true);
}
_local2++;
}
return(false);
}
function getMemberIDs(roomID) {
return(list["_" + roomID].members.slice());
}
function getNumberOfMobs() {
return(list["_" + ref.me.room].mobs.length);
}
function getNumberOfMembers(roomID) {
return(list["_" + roomID].members.length);
}
function lock(roomID, lock) {
ref.$sts = ref.$sts + ((((("39" + d) + roomID) + d) + lock) + e);
}
function isLocked(roomID) {
return(list["_" + roomID].locked);
}
function getNumberOfTeamMembers(roomID, teamID) {
var _local4 = 0;
var _local8;
var _local2;
var _local3 = list["_" + roomID].members;
var _local6 = _local3.length;
var _local5 = ref.member;
_local2 = 0;
while (_local2 < _local6) {
if (_local5.list["_" + _local3[_local2]].team == teamID) {
_local4++;
}
_local2++;
}
return(_local4);
}
function getMemberNames(roomID) {
var _local3 = [];
var _local4 = list["_" + roomID].members;
var _local2;
var _local5 = _local4.length;
_local2 = 0;
while (_local2 < _local5) {
_local3.push(ref.member.getName(_local4[_local2]));
_local2++;
}
return(_local3);
}
function getTeamMemberNames(roomID, teamID) {
var _local4 = [];
var _local5 = list["_" + roomID].members;
var _local2;
var _local6 = _local5.length;
var _local7 = ref.member;
var _local3;
_local2 = 0;
while (_local2 < _local6) {
_local3 = _local7.list["_" + _local5[_local2]];
if (_local3.team == teamID) {
_local4.push(_local3.name);
}
_local2++;
}
return(_local4);
}
function getTeamMemberIds(roomID, teamID) {
var _local4 = [];
var _local5 = list["_" + roomID].members;
var _local2;
var _local6 = _local5.length;
var _local7 = ref.member;
var _local3;
_local2 = 0;
while (_local2 < _local6) {
_local3 = _local7["_" + _local5[_local2]];
if (_local3.team == teamID) {
_local4.push(_local3.id);
}
_local2++;
}
return(_local4);
}
function getLimit(roomID) {
return(list["_" + roomID].limit);
}
function getTeamLimit(roomID, teamID) {
return(list["_" + roomID].teamLimits[teamID]);
}
function getWaitingQueue(roomID) {
return(list["_" + roomID].waitingQueue.slice());
}
function getMobIDs() {
return(list["_" + ref.me.room].mobs.slice());
}
function getData(roomID) {
return(list["_" + ref.me.room].data.slice());
}
function getObject(roomID) {
return(list["_" + ref.me.room]);
}
function chat(targetRoomID, message) {
ref.$sts = ref.$sts + ((((((((("10" + d) + ref.me.id) + d) + "1") + d) + targetRoomID) + d) + message) + e);
}
function registerEvents(roomID, object) {
list["_" + roomID].$class = object;
}
function degisterEvents(roomID, object) {
list["_" + roomID].$class = null;
}
function setDataIndexCallback(roomID, index, callback, scope) {
var _local2 = list["_" + roomID];
if (!_local2.__cb) {
_local2.__cb = [];
}
_local2.__cb["_" + index] = {cb:callback, sc:scope};
}
function clearDataIndexCallback(roomID, index) {
var _local3 = list["_" + roomID];
delete _local3.__cb["_" + index];
var _local5 = _local3.data.length;
var _local4 = 0;
var _local2 = 0;
while (_local2 < _local5) {
if (_local3.__cb["_" + _local2]) {
_local4++;
break;
}
_local2++;
}
if (!_local4) {
delete _local3.__cb;
}
}
function clearAllDataIndexCallbacks(roomID) {
var _local2 = list["_" + roomID];
delete _local2.__cb;
}
function hasPassword(roomID) {
return(list["_" + roomID].password);
}
var $cb = null;
var $sc = null;
}
Symbol 545 MovieClip [__Packages.com.rawfishsoftware.sushi.Challenge] Frame 0
class com.rawfishsoftware.sushi.Challenge
{
var ref, d, e, id, $challengers, $minMembers, $timeout, $template;
function Challenge (r) {
ref = r;
d = ref.$d;
e = ref.$e;
}
function $init() {
id = 0;
$challengers = [];
}
function request(roomTemplate, timeout, minMembers, memberIDs, callback, scope) {
ref.$cblist[++ref.$cbid] = {event:callback, action:10, scope:scope, template:roomTemplate, timeout:timeout, minMembers:minMembers};
ref.$sts = ref.$sts + ((((((((((((("66" + d) + "-1") + d) + ref.$cbid) + d) + roomTemplate) + d) + timeout) + d) + minMembers) + d) + memberIDs.join(d)) + e);
}
function reChallenge(callback, scope) {
ref.$cblist[++ref.$cbid] = {event:callback, action:10, scope:scope, template:$template, timeout:$timeout, minMembers:$minMembers};
var _local2 = ref.room.getMemberIDs(ref.me.room).slice(0);
ref.removeValue(_local2, ref.me.id);
ref.$sts = ref.$sts + ((((((((((((("66" + d) + id) + d) + ref.$cbid) + d) + $template) + d) + $timeout) + d) + $minMembers) + d) + _local2.join(d)) + e);
}
function answerRequest(status) {
ref.$sts = ref.$sts + ((((((("68" + d) + ref.me.id) + d) + id) + d) + status) + e);
if (!status) {
id = 0;
$challengers = [];
ref.me.moderator = 0;
}
}
function cancel() {
ref.$sts = ref.$sts + ((("72" + d) + id) + e);
id = 0;
$challengers = [];
ref.me.moderator = 0;
}
function start(memberIDsOrder) {
if (memberIDsOrder) {
ref.$sts = ref.$sts + ((((("70" + d) + id) + d) + memberIDsOrder.join(d)) + e);
} else {
ref.$sts = ref.$sts + ((("70" + d) + id) + e);
}
}
function nextMember() {
ref.$sts = ref.$sts + ((("71" + d) + id) + e);
}
function includeMember(memberID) {
ref.$sts = ref.$sts + ((((("64" + d) + memberID) + d) + "1") + e);
}
function excludeMember(memberID) {
ref.$sts = ref.$sts + ((((("64" + d) + memberID) + d) + "0") + e);
}
function getMemberIDs() {
return($challengers.slice());
}
function getMemberPosition(memberID) {
var _local3 = $challengers.length;
var _local2;
_local2 = 0;
while (_local2 < _local3) {
if ($challengers[_local2] == memberID) {
return(_local2);
}
_local2++;
}
return(-1);
}
}
Symbol 546 MovieClip [__Packages.com.rawfishsoftware.sushi.Event] Frame 0
class com.rawfishsoftware.sushi.Event
{
var ref, onNewMember, onUpdateMember, onIndexUpdateMember, onMemberChangesRoom, onRemoveMember, onNewMob, onMaster, onSlave, onUpdateMob, onIndexUpdateMob, onRemoveMob, onNewRoom, onRemoveRoom, onUpdateRoom, onIndexUpdateRoom, onUpdateWaitingQueue, onUpdateTeam, onIndexUpdateTeam, onMemberChangesTeam, onChatMessage, onUserMessage, onSystemMessage, onDisconnect, onServerRestart, onUpdateSession, onIndexUpdateSession, onChallengeRequest, onAnswerChallengeRequest, onCancelChallenge, onModeratorChanged, onIncludeMember, onExcludeMember, onRoomLocked, onStartChallenge, onPlay, onBeSpectator, onMemberKicked, onBadwordDetected, onMemberNameChanged, onObjectReceived;
function Event (r) {
ref = r;
$init();
}
function $init() {
onNewMember = new com.rawfishsoftware.sushi.$Event(ref, "onNewMember", "member");
onUpdateMember = new com.rawfishsoftware.sushi.$Event(ref, "onUpdateMember", "member");
onIndexUpdateMember = new com.rawfishsoftware.sushi.$Event(ref, "onIndexUpdateMember", "member");
onMemberChangesRoom = new com.rawfishsoftware.sushi.$Event(ref, "onMemberChangesRoom", "member");
onRemoveMember = new com.rawfishsoftware.sushi.$Event(ref, "onRemoveMember", "member");
onNewMob = new com.rawfishsoftware.sushi.$Event(ref, "onNewMob", "mob");
onMaster = new com.rawfishsoftware.sushi.$Event(ref, "onMaster");
onSlave = new com.rawfishsoftware.sushi.$Event(ref, "onSlave");
onUpdateMob = new com.rawfishsoftware.sushi.$Event(ref, "onUpdateMob", "mob");
onIndexUpdateMob = new com.rawfishsoftware.sushi.$Event(ref, "onIndexUpdateMob", "mob");
onRemoveMob = new com.rawfishsoftware.sushi.$Event(ref, "onRemoveMob", "mob");
onNewRoom = new com.rawfishsoftware.sushi.$Event(ref, "onNewRoom");
onRemoveRoom = new com.rawfishsoftware.sushi.$Event(ref, "onRemoveRoom", "room");
onUpdateRoom = new com.rawfishsoftware.sushi.$Event(ref, "onUpdateRoom", "room");
onIndexUpdateRoom = new com.rawfishsoftware.sushi.$Event(ref, "onIndexUpdateRoom", "room");
onUpdateWaitingQueue = new com.rawfishsoftware.sushi.$Event(ref, "onUpdateWaitingQueue", "room");
onUpdateTeam = new com.rawfishsoftware.sushi.$Event(ref, "onUpdateTeam", "team");
onIndexUpdateTeam = new com.rawfishsoftware.sushi.$Event(ref, "onIndexUpdateTeam", "team");
onMemberChangesTeam = new com.rawfishsoftware.sushi.$Event(ref, "onMemberChangesTeam", "team");
onChatMessage = new com.rawfishsoftware.sushi.$Event(ref, "onChatMessage", "member");
onUserMessage = new com.rawfishsoftware.sushi.$Event(ref, "onUserMessage");
onSystemMessage = new com.rawfishsoftware.sushi.$Event(ref, "onSystemMessage");
onDisconnect = new com.rawfishsoftware.sushi.$Event(ref, "onDisconnect");
onServerRestart = new com.rawfishsoftware.sushi.$Event(ref, "onServerRestart");
onUpdateSession = new com.rawfishsoftware.sushi.$Event(ref, "onUpdateSession", "session");
onIndexUpdateSession = new com.rawfishsoftware.sushi.$Event(ref, "onIndexUpdateSession", "session");
onChallengeRequest = new com.rawfishsoftware.sushi.$Event(ref, "onChallengeRequest");
onAnswerChallengeRequest = new com.rawfishsoftware.sushi.$Event(ref, "onAnswerChallengeRequest");
onCancelChallenge = new com.rawfishsoftware.sushi.$Event(ref, "onCancelChallenge");
onModeratorChanged = new com.rawfishsoftware.sushi.$Event(ref, "onModeratorChanged");
onIncludeMember = new com.rawfishsoftware.sushi.$Event(ref, "onIncludeMember");
onExcludeMember = new com.rawfishsoftware.sushi.$Event(ref, "onExcludeMember");
onRoomLocked = new com.rawfishsoftware.sushi.$Event(ref, "onRoomLocked", "room");
onStartChallenge = new com.rawfishsoftware.sushi.$Event(ref, "onStartChallenge");
onPlay = new com.rawfishsoftware.sushi.$Event(ref, "onPlay");
onBeSpectator = new com.rawfishsoftware.sushi.$Event(ref, "onBeSpectator", "member");
onMemberKicked = new com.rawfishsoftware.sushi.$Event(ref, "onMemberKicked", "member");
onBadwordDetected = new com.rawfishsoftware.sushi.$Event(ref, "onBadwordDetected");
onMemberNameChanged = new com.rawfishsoftware.sushi.$Event(ref, "onMemberNameChanged");
onObjectReceived = new com.rawfishsoftware.sushi.$Event(ref, "onObjectReceived");
}
}
Symbol 547 MovieClip [__Packages.com.rawfishsoftware.sushi.$Event] Frame 0
class com.rawfishsoftware.sushi.$Event
{
var event, object, sushi;
function $Event (s, e, obj) {
event = e;
if (obj) {
object = obj;
}
sushi = s;
}
function setCallback(callback, scope) {
this.callback = callback;
this.scope = scope;
}
function clearCallback() {
callback = null;
scope = null;
}
function addListener(object) {
removeListener(object);
listeners.push(object);
hasListeners = true;
}
function removeAllListeners() {
listeners = [];
hasListeners = false;
}
function removeListener(object) {
var _local2 = listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == object) {
_local2.splice(_local3, 1);
if (!_local2.length) {
hasListeners = false;
}
return(true);
}
}
return(false);
}
function $call() {
var _local3 = sushi[object].list["_" + arguments[0]].$class;
if (_local3) {
_local3[event].apply(_local3, arguments);
}
if (callback) {
callback.apply(scope, arguments);
}
if (hasListeners) {
var _local5;
var _local4 = listeners;
for (_local5 in _local4) {
_local3 = _local4[_local5];
_local3[event].apply(_local3, arguments);
}
}
}
var callback = null;
var scope = null;
var listeners = [];
var hasListeners = false;
}
Symbol 548 MovieClip [__Packages.com.rawfishsoftware.sushi.Logger] Frame 0
class com.rawfishsoftware.sushi.Logger
{
var ref, $d, $e, mess_in, mess_out, errors;
function Logger (r) {
ref = r;
$d = ref.$d;
$e = ref.$e;
mess_in = {m1:["idMessage", "ID", "", "", ""], m5:["newMember", "ID", "name", "teamID", "roomID", "platform", "!data"], m6:["memberUpdate", "ID", "!data"], m7:["serverRestart"], m8:["masterClient"], m9:["slaveClient"], m10:["chatMessage", "senderID", "routing", "", "message"], m11:["removeMember", "ID", "teamID", "roomID"], m16:["sessionUpdate", "!data"], m17:["sessionIndexUpdate", "$data"], m19:["pluginAnswer", "", "pluginID", "!data"], m21:["changeRoom", "ID", "newRoomID", "oldRoomID", "!data"], m23:["removeRoom", "roomID"], m25:["newMob", "mobID", "roomID", "creatorID", "!data"], m26:["mobUpdate", "mobID", "!data"], m27:["removeMob", "mobID"], m30:["newRoom", "roomID", "password", "name", "", "!data"], m34:["waitingQueue", "queue"], m36:["memberNameChanged", "memberID", "newName"], m38:["roomUpdate", "roomID", "!data"], m39:["lockRoom", "roomID", "value"], m40:["teamUpdate", "teamID", "!data"], m43:["changeTeam", "userID", "oldTeamID", "newTeamID"], m49:["beSpectator", "value"], m52:["memberSearchResult", "", "!resultList"], m53:["userMessage", "messageID", "", "routing", "targetID", "!data"], m54:["memberIndexUpdate", "memberID", "$data"], m57:["isBadwordAnswer", "", "result"], m60:["mobIndexUpdate", "mobID", "$data"], m64:["in/excludeMember", "memberID", "value"], m65:["kickMember", "memberID"], m67:["challengeRequest", "challengeID", "challengerID", "!participantIDs"], m68:["acceptChallenge", "userID", "challengeID", "value"], m69:["startChallenge", "challengeID", "roomID", "!order"], m73:["play", "userID"], m72:["cancelChallenge", "challengeID", "status"], m74:["teamIndexUpdate", "teamID", "$data"], m75:["roomIndexUpdate", "roomID", "$data"], m86:["sendObject", "routing", "targetID", "object"], m87:["serverError", "message"]};
mess_out = {m2:["clientSpeed", "time"], m3:["netSpeed", "time"], m4:["receiveMyUpdates", "value"], m6:["meUpdate", "", "!data"], m10:["chatMessage", "myID", "routing", "targetUserID", "message"], m11:["removeMe", "myID"], m14:["getMemberList", "roomID"], m15:["mobSilentUpdate", "mobID", "!data"], m16:["sessionUpdate", "!data"], m17:["sessionIndexUpdate", "$data"], m19:["callPlugin", "", "pluginID", "!data"], m20:["changeRoom", "", "myID", "roomID", "password", "!data"], m22:["createRoom", "", "myID", "password", "name", "roomTemplate", "!clientIdList"], m25:["createMob", "mobID", "roomID", "delete", "!data"], m26:["mobUpdate", "mobID", "!data"], m27:["removeMob", "mobID"], m28:["leaveSession", ""], m29:["loadSessionList", "", "game"], m31:["meSilentUpdate", "", "!data"], m36:["changeName", "", "", "newName"], m38:["roomUpdate", "roomID", "!data"], m39:["lockRoom", "roomID", "lock"], m40:["teamUpdate", "teamID", "!data"], m41:["mobIndexUpdateEval|Conditional", "mobID", "%data"], m42:["changeTeam", "", "userID", "oldTeamID", "newTeamID"], m45:["joinSession", "", "sessionID", "teamID", "roomID", "password", "name", "!data"], m47:["initMob", "mobID", "roomID", "delete", "!data"], m48:["beSpectator", "", "value"], m50:["teamIndexUpdateEval|Conditional", "teamID", "%data"], m51:["searchClient", "", "!names"], m53:["userMessage", "messageID", "", "routing", "targetID", "!data"], m54:["meIndexUpdate", "myID", "$data"], m57:["isBadword", "", "word"], m58:["roomIndexUpdateEval|Conditional", "roomID", "%data"], m59:["sessionIndexUpdateEval|Conditional", "%data"], m60:["mobIndexUpdate", "mobID", "$data"], m64:["in/excludeMember", "memberID", "value"], m66:["requestChallenge", "", "", "roomTemplate", "timeout", "minUsers", "!participantIDs"], m68:["acceptChallenge", "userID", "challengeID", "value"], m70:["startChallenge", "challengeID", "!order"], m71:["nextMember", "challengeID"], m72:["cancelChallenge", "challengeID"], m74:["teamIndexUpdate", "teamID", "$data"], m75:["roomIndexUpdate", "roomID", "$data"], m86:["sendObject", "routing", "targetID", "object"], m87:["enableLogging", "value"]};
errors = ["ok", "create room failed", "room full", "name contains badword", "team full", "name used", "user is not allowed to enter room", "room doesn't exist", "failed", "game not found", "server full", "room-template not found", "challenge born", "queued", "wrong password"];
}
function log(n, a) {
if (typeof(n) == "string") {
var _local4 = n.split($e);
var _local6 = _local4.length;
var _local3;
var _local8;
var _local5 = $d;
n = 0;
while (n < _local6) {
_local3 = _local4[n].split(_local5);
$log(_local3, a);
n++;
}
} else {
$log(n, a);
}
}
function $log(n, a) {
var _local8 = "";
if (a == "SERVER") {
_local8 = mess_in["m" + n[0]];
} else if (a == "FLASH") {
_local8 = mess_out["m" + n[0]];
} else if (a == "STATUS") {
trace("SERVER: " + n);
var _local14 = new LocalConnection();
_local14.send("_SUSHIOutput", "echo", (("<b>ID" + ref.me.id) + ":SERVER:</b> ") + n);
}
if (_local8) {
var _local9 = "";
var _local10 = "";
var _local5 = ((((_local10 + "'") + _local8[0]) + "'") + _local9) + " ";
var _local2;
var _local11 = n.length;
_local2 = 1;
while (_local2 < _local11) {
if (_local8[_local2] != "") {
var _local7 = _local8[_local2].substring(0, 1);
if (((_local7 != "$") && (_local7 != "%")) && (_local7 != "!")) {
_local5 = _local5 + (((((_local10 + _local8[_local2]) + ":") + _local9) + n[_local2]) + " ");
} else {
if (_local7 == "!") {
var _local12 = _local8[_local2].slice(1, length(_local8[_local2]));
_local5 = _local5 + ((((((_local10 + _local12) + ":") + _local9) + "[") + n.slice(_local2, _local11).join(",")) + "]");
} else if (_local7 == "$") {
_local5 = _local5 + (((_local10 + "data:") + _local9) + "[");
var _local4 = _local2;
while (_local4 < _local11) {
_local5 = _local5 + (((n[_local4] + ":") + n[_local4 + 1]) + " ");
_local4 = _local4 + 2;
}
_local5 = _local5 + "]";
} else if (_local7 == "%") {
if ((_local11 - _local2) == 3) {
var _local6 = n[_local2 + 1];
if ((((_local6 == "/") || (_local6 == "+")) || (_local6 == "-")) || (_local6 == "*")) {
_local6 = _local6 + "=";
}
_local5 = _local5 + (((((((_local10 + "evaluate:") + _local9) + "[index") + n[_local2]) + _local6) + n[_local2 + 2]) + "]");
} else {
var _local6 = n[_local2 + 1];
if ((((_local6 == "/") || (_local6 == "+")) || (_local6 == "-")) || (_local6 == "*")) {
_local6 = _local6 + "=";
}
_local5 = _local5 + (((((((((((_local10 + "conditional:") + _local9) + "[") + n[_local2]) + _local6) + n[_local2 + 2]) + " if ") + n[_local2 + 3]) + n[_local2 + 4]) + n[_local2 + 5]) + "]");
}
}
break;
}
}
_local2++;
}
trace((a + ": ") + _local5);
var _local14 = new LocalConnection();
_local14.send("_SUSHIOutput", "echo", (((("<b>ID" + ref.me.id) + ":") + a) + ":</b> ") + _local5);
}
}
}
Symbol 549 MovieClip [__Packages.com.rawfishsoftware.sushi.Serializer] Frame 0
class com.rawfishsoftware.sushi.Serializer
{
var buffer;
function Serializer () {
}
function serialize(what) {
var _local2 = new String("");
_local2 = serialize_internal("", what);
return(_local2);
}
function serialize_internal(buf, struct_c) {
if (((!isNaN(struct_c)) && (struct_c.__proto__ != Boolean.prototype)) && (struct_c.__proto__ != Date.prototype)) {
var _local2 = new Number(struct_c);
} else {
var _local2 = struct_c;
}
switch (_local2.__proto__) {
case Boolean.prototype :
buf = ((buf + "b:") + int(_local2)) + ";";
break;
case null :
case undefined :
buf = buf + "N;";
break;
case Number.prototype :
if (_local2 >= 1E15) {
buf = ((buf + "d:") + _local2) + ";";
} else if ((_local2 % 1) == 0) {
buf = ((buf + "i:") + _local2) + ";";
} else {
buf = ((buf + "d:") + _local2) + ";";
}
break;
case String.prototype :
buf = ((((buf + "s:") + calcLength(_local2)) + ":\"") + _local2) + "\";";
break;
case Date.prototype :
buf = ((((buf + "s:") + length(_local2)) + ":\"") + _local2) + "\";";
break;
case Object.prototype :
case Array.prototype :
var _local4 = 0;
var _local5 = new String("");
buf = buf + "a:";
for (var _local6 in _local2) {
_local5 = _local5 + (serialize_internal("", _local6) + serialize_internal("", _local2[_local6]));
_local4 = _local4 + 1;
}
buf = (((buf + _local4) + ":{") + _local5) + "}";
break;
default :
buf = buf + "i:0;";
}
return(buf);
}
function calcLength(struct) {
var _local1;
var _local3 = 0;
var _local4 = struct.length;
var _local2 = 0;
while (_local2 < _local4) {
_local1 = ord(struct.charAt(_local2));
if (_local1 < 128) {
_local3 = _local3 + 1;
} else if (_local1 < 1024) {
_local3 = _local3 + 2;
} else if (_local1 < 32768) {
_local3 = _local3 + 3;
} else if (_local1 < 2097152) {
_local3 = _local3 + 4;
}
_local2++;
}
return(_local3);
}
function unserialize(what) {
buffer = what;
return(unserialize_internal(what));
}
function unserialize_internal(obj) {
var _local3 = obj.charAt(0);
var _local2;
switch (_local3) {
case "d" :
_local2 = parse_double();
break;
case "i" :
_local2 = parse_int();
break;
case "b" :
_local2 = parse_boolean();
break;
case "s" :
_local2 = parse_string();
break;
case "a" :
_local2 = parse_array();
break;
case "O" :
_local2 = parse_object();
break;
case "N" :
}
if (_local2[0] != -1) {
buffer = buffer.substr(buffer.indexOf(";", (_local2[0] + length(_local3)) + length(_local2[0].toString())) + 1);
}
return(_local2[1]);
}
function parse_array() {
var _local3 = 0;
var _local5 = getArrayLength();
var _local4 = new Array();
while (_local3 < _local5) {
var _local2 = getNext();
_local4[_local2[0]] = _local2[1];
_local3++;
}
buffer = buffer.substr(1);
return(new Array(-1, _local4));
}
function parse_object() {
var _local6 = parse_string();
buffer = buffer.substr(buffer.indexOf(":", _local6[0]));
var _local7 = _local6[1];
var _local3 = 0;
var _local5 = getObjectLength();
var _local4 = new Object();
while (_local3 < _local5) {
var _local2 = getNext();
_local4[_local2[0]] = _local2[1];
_local3++;
}
buffer = buffer.substr(1);
return(new Array(-1, _local4));
}
function parse_string() {
var _local2 = getStringLenght();
var _local3 = getCStringLenght();
if (_local2 eq _local3) {
var _local4 = buffer.substr(length(_local2) + 4, _local2).toString();
} else {
var _local4 = buffer.substr(length(_local2) + 4, _local3).toString();
}
return(new Array(_local3, _local4));
}
function parse_boolean() {
var _local2 = getLength();
var _local3 = ((_local2 < 1) ? false : true);
return(new Array(length(_local2.toString()), _local3));
}
function parse_double() {
var _local2 = getFloatLength();
var _local3 = _local2;
return(new Array(length(_local2.toString()), _local3));
}
function parse_int() {
var _local2 = getLength();
var _local3 = _local2;
return(new Array(length(_local2.toString()), _local3));
}
function getStringLenght(str) {
var _local2 = parseInt(buffer.substr(2, buffer.indexOf(":", 3) - 2));
return(_local2);
}
function getCStringLenght(str) {
var _local5 = parseInt(buffer.substr(2, buffer.indexOf(":", 3) - 2));
var _local3;
var _local2 = _local5;
var _local4 = buffer;
_local3 = 0;
while (_local3 < _local2) {
if (_local4.charCodeAt(_local3 + 5) > 128) {
if (_local4.charCodeAt(_local3 + 5) > 255) {
_local2 = _local2 - 2;
} else {
_local2 = _local2 - 1;
}
}
_local3++;
}
return(_local2);
}
function getLength() {
var _local2 = parseInt(buffer.substr(2, buffer.indexOf(";", 3) - 2));
return(_local2);
}
function getFloatLength() {
var _local2 = parseFloat(buffer.substr(2, buffer.indexOf(";", 3) - 2));
return(_local2);
}
function getArrayLength() {
var _local2 = parseInt(buffer.substr(2, (buffer.indexOf(":", 2) - buffer.indexOf(":", 1)) + 1));
buffer = buffer.substr(buffer.indexOf(":", 2) + 2);
return(_local2);
}
function getObjectLength() {
var _local2 = parseInt(buffer.substr(1, buffer.indexOf(":", 1)));
buffer = buffer.substr(buffer.indexOf(":", 1) + 2);
return(_local2);
}
function getNext(str) {
var _local2 = unserialize_internal(buffer);
var _local3 = unserialize_internal(buffer);
return(new Array(_local2, _local3));
}
static var className = "it.sephiroth.Serializer";
static var classVersion = "2.1.4b";
var instanceName = "Serializer";
}
Symbol 550 MovieClip [__Packages.com.rawfishsoftware.sushi.SushiSocket] Frame 0
class com.rawfishsoftware.sushi.SushiSocket extends XMLSocket
{
var ref, mc, connect;
function SushiSocket (ip, p, r) {
super();
ref = r;
System.security.loadPolicyFile((("xmlsocket://" + ip) + ":") + p);
mc = _root.createEmptyMovieClip("$$sushimc", 9999998);
mc.sushi = ref;
mc.socket = this;
mc.onEnterFrame = function () {
var _local2 = this.sushi;
if (_local2.$sts != "") {
if (_local2.logging) {
_local2.logger.log(_local2.$sts, "FLASH");
}
this.socket.send(_local2.$sts);
_local2.$sts = "";
}
if (_local2.$fps) {
_local2.$getFPS();
}
};
connect(ip, p);
}
function onConnect(s) {
if (s) {
var _local2 = ref.$d;
ref.connectionType = "SOCKET";
ref.$connected = 1;
ref.$sts = ref.$sts + ((((((((((("S55" + _local2) + "FLASH") + _local2) + "1") + _local2) + ref.LIMIT) + ref.$e) + "2") + _local2) + ref.$clientSpeed) + ref.$e);
ref.$netTimer = getTimer();
} else {
ref.$cb.apply(ref.$sc, [1]);
}
}
function onData(m) {
ref.$p.apply(ref, [m]);
}
function onClose() {
ref.$connected = 0;
_root.$$sushimc.swapDepths(0);
_root.$$sushimc.removeMovieClip();
ref.event.onDisconnect.$call();
ref.$init();
ref.sessionList = [];
}
}
Symbol 551 MovieClip [__Packages.com.rawfishsoftware.sushi.SushiHTTP] Frame 0
class com.rawfishsoftware.sushi.SushiHTTP
{
var ref, ip, lv, pf;
function SushiHTTP (i, r) {
ref = r;
ip = i;
lv = new LoadVars();
pf = ref.$pollFreq;
connect();
}
function connect() {
var _local2 = ref.$d;
var _local3 = 0;
lv.onLoad = function (s) {
if (s) {
this.ref.$http.communicate();
this.ref.$p(this.m);
} else {
this.ref.$cb.apply(this.ref.$sc, [1]);
}
};
lv.ref = ref;
lv.m = (((((((((("55" + _local2) + "FLASH") + _local2) + "1") + _local2) + ref.LIMIT) + ref.$e) + "2") + _local2) + ref.$clientSpeed) + ref.$e;
lv.i = ref.me.id;
lv.sendAndLoad(ip, lv, "POST");
}
function communicate() {
_root.createEmptyMovieClip("$$sushimc", 9999998);
_root.$$sushimc.ref = this;
_root.$$sushimc.onEnterFrame = function () {
this.ref.poll();
if (this.ref.$fps) {
this.ref.$getFPS();
}
};
ref.connectionType = "HTTP";
ref.$connected = 1;
ref.$netTimer = getTimer();
lv.onLoad = function (s) {
if (this.m != "") {
this.ref.$p(this.m);
}
this.ref.$http.pon = false;
this.ref.$http.pf = this.ref.$pollFreq;
};
}
function poll() {
if (!pon) {
if (ref.$sts != "") {
update();
} else if (!(--pf)) {
update();
}
}
}
function update() {
lv.m = ref.$sts;
pon = true;
ref.$sts = "";
if (ref.logging) {
ref.logger.log(lv.m, "FLASH");
}
lv.sendAndLoad(ip, lv, "POST");
}
var pon = false;
}
Symbol 552 MovieClip [__Packages.code.gameController] Frame 0
class code.gameController
{
var nextDepths, maxWordLength, frequencyArray, possibleVowelArray, possibleConsonantArray, letterScoreHash, scoreKerningHash, legDataArr, powerUpController, numLevelsInTour, mcWordList, mcBoard, mcWordDisplay, mcWordSoFar, difficulty, gameType, courseObj, pScreenSafeRect, gDoubleClickTimeMax, gBoardRect, mcBoardMirror, levelNum, gameScore, levelScore, wordScore, diffWordArr, gameTypeNum, numBoatsInRace, turnBasedFlag, finishLineX, letterColor, numUserTurnsMax, numUserTurns, mcTurnDisplay, pViewX, gameObjArr, boatObjArr, myBoatObj, gOrigin, gameState, whereToGo, builtWordArray, completedWords, boatWon, bestWordScore, numLetters, letterArray, spaceBetweenLetters, turnNum, builtWordString, bestWord, prePauseGameState, gLastClickedTime;
function gameController () {
nextDepths = {ripple:50, island:55000, boat:75500, powerUp:90000, staticLetters:100000, movingLetters:120000, powerUpAnim:130000};
maxWordLength = 8;
var _local8;
_local8 = "A_6_1,B_2_2,C_3_2,D_4_2,E_10_1,F_2_2,G_3_2,H_2_2,I_5_1,J_1_4,K_1_3,L_4_1,M_3_2,N_7_1,O_8_1,P_2_1,Q_1_5,R_5_1,S_6_1,T_6_1,U_3_1,V_2_2,W_2_2,X_1_5,Y_2_3,Z_1_5";
frequencyArray = _local8.split(",");
possibleVowelArray = new Array();
possibleConsonantArray = new Array();
letterScoreHash = new Array();
initPossibleLetterArray("vowel");
initPossibleLetterArray("consonant");
scoreKerningHash = new Array();
var _local9 = "A_2,B_0,C_2,D_4,E_2,F_3,G_1,H_2,I_0,J_1,K_2,L_0,M_4,N_3,O_4,P_2,Q_4,R_3,S_1,T_4,U_7,V_8,W_8,X_2,Y_7,Z_0";
var _local5 = _local9.split(",");
var _local4 = 0;
while (_local4 < _local5.length) {
var _local3 = _local5[_local4].split("_");
scoreKerningHash[_local3[0]] = Number(_local3[1]);
_local4++;
}
_local5 = "St. Thomas_21,Anguilla_24,Barbuda_30,Montserrat_30,Dominica_27,Martinique_31,St. Lucia_40,Barbados_23.5,Grenadines_32,Tobago_22.5,Trinidad_19.5".split(",");
legDataArr = new Array();
_local4 = 0;
while (_local4 < _local5.length) {
var _local3 = _local5[_local4].split("_");
legDataArr.push({island:_local3[0], distance:Number(_local3[1])});
_local4++;
}
powerUpController = new code.PowerUpController();
numLevelsInTour = 10;
if (_root.debugOptions.shortRaces) {
numLevelsInTour = 2;
}
}
function initPossibleLetterArray(type) {
var _local5;
var _local3;
var _local2;
var _local7;
_local5 = 0;
while (_local5 < frequencyArray.length) {
var _local4 = frequencyArray[_local5].split("_");
_local2 = _local4[0];
_local7 = Number(_local4[1]);
letterScoreHash[_local2] = Number(_local4[2]);
_local3 = 0;
while (_local3 < _local7) {
if (vowelTest(_local2)) {
if (type == "vowel") {
possibleVowelArray.push(_local2);
}
} else if (type == "consonant") {
possibleConsonantArray.push(_local2);
}
_local3++;
}
_local5++;
}
}
function initGame(initParams) {
mcWordList = initParams.mcWordList;
mcBoard = initParams.mcBoard;
mcWordDisplay = initParams.mcWordDisplay;
mcWordSoFar = initParams.mcWordSoFar;
difficulty = initParams.difficulty;
gameType = initParams.gameType;
courseObj = new code.courseDisplay(initParams.mcCourseDisplay);
trace("courseObj:" + courseObj);
var _local4 = mcBoard.mcScreenSafeRect;
pScreenSafeRect = new flash.geom.Rectangle(_local4._x, _local4._y, _local4._width, _local4._height);
gDoubleClickTimeMax = 300;
gBoardRect = new flash.geom.Rectangle(mcBoard.mcBoardRect._x, mcBoard.mcBoardRect._y, mcBoard.mcBoardRect._width, mcBoard.mcBoardRect._height);
trace("gBoardRect:" + gBoardRect);
mcBoard.pGameController = this;
mcBoardMirror = mcBoard._parent.mcBoardMirror;
if (_root.initialLevelNum == undefined) {
levelNum = 1;
} else {
levelNum = _root.initialLevelNum;
}
gameScore = 0;
levelScore = 0;
wordScore = 0;
setInterface();
diffWordArr = new Array("Easy", "Medium", "Difficult");
_root.modeAndDifficulty = (diffWordArr[initParams.difficulty] + " ") + initParams.gameType;
Key.addListener(_root);
_root.onKeyDown = function () {
_root.gGameController.checkKey();
};
var _local5 = gameType.split(" ");
var _local6 = _local5[_local5.length - 1];
_level0.swHighScoreObject.gameId = ("wordwinds" + _local6.toLowerCase()) + diffWordArr[difficulty].toLowerCase();
dTrace("_level0.swHighScoreObject.gameId:" + _level0.swHighScoreObject.gameId);
}
function setInterface() {
_root.levelNum = levelNum;
_root.gameScore = gameScore;
_root.mcWordScore.wordScore = wordScore;
}
function initLevel() {
clearSelectedWord();
switch (gameType) {
case "Race by Turns" :
gameTypeNum = 0;
numBoatsInRace = 3;
turnBasedFlag = true;
finishLineX = (1200 + (difficulty * 250)) + ((levelNum - 1) * 100);
letterColor = 1609387 /* 0x188EAB */;
var _local25 = new Array(0, 1.6, 2.8);
var _local22 = _local25[difficulty] + (levelNum * 0.1);
trace("boatBotIntelligence:" + _local22);
break;
case "Race Action" :
gameTypeNum = 1;
numBoatsInRace = 3;
turnBasedFlag = false;
finishLineX = (2400 + (difficulty * 250)) + ((levelNum - 1) * 100);
letterColor = 1664665 /* 0x196699 */;
_local25 = new Array(0, 0.8, 2);
_local22 = _local25[difficulty] + (levelNum * 0.1);
if (difficulty == 0) {
var _local20 = 2000;
var _local19 = 1000 * (6 + Math.max(0, (5 - levelNum) * 0.6));
} else {
var _local20 = 2000;
var _local19 = 6000;
}
trace((((("boatBotIntelligence:" + _local22) + ",") + _local20) + ",") + _local19);
break;
case "Puzzle" :
gameTypeNum = 2;
numBoatsInRace = 1;
numUserTurnsMax = 10;
numUserTurns = 0;
turnBasedFlag = false;
var _local27 = new Array(1600, 2100, 2600);
finishLineX = _local27[difficulty] + ((levelNum - 1) * 100);
letterColor = 6291543 /* 0x600057 */;
}
if (_root.debugOptions.shortRaces) {
finishLineX = finishLineX * 0.4;
}
if (turnBasedFlag) {
mcBoard.attachMovie("mcTurnDisplay", "mcTurnDisplay", 99999);
mcTurnDisplay = mcBoard.mcTurnDisplay;
dTrace((("mcTurnDisplay:" + mcTurnDisplay) + ",") + mcTurnDisplay.setToBoat);
}
pViewX = 0;
gameObjArr = new Array();
boatObjArr = new Array();
trace("gUserBoatNum:" + _root.gUserBoatNum);
if (numBoatsInRace > 1) {
var _local3 = 0;
while (_local3 < numBoatsInRace) {
if (_local3 != (_root.gUserBoatNum - 1)) {
mcBoard.attachMovie("mcBoat", "mcBoat_Bot" + _local3, (nextDepths.boat = nextDepths.boat + 10));
var _local13 = mcBoard["mcBoat_Bot" + _local3];
var _local5 = new code.boatBot({mc:_local13, intelligence:_local22, timeBetweenWordsMin:_local20, timeBetweenWordsMax:_local19});
_local5.setBoatStyleNum(_local3);
gameObjArr.push(_local5);
boatObjArr.push(_local5);
}
_local3++;
}
}
mcBoard.attachMovie("mcBoat", "mcBoat_my", (nextDepths.boat = nextDepths.boat + 10));
myBoatObj = new code.boat(mcBoard.mcBoat_my);
myBoatObj.setBoatStyleNum(_root.gUserBoatNum - 1);
gameObjArr.push(myBoatObj);
boatObjArr.push(myBoatObj);
var _local23 = boatObjArr.length;
var _local3 = 0;
while (_local3 < _local23) {
var _local6 = gameObjArr[_local3];
mcBoard.attachMovie("mcDot", "mcDot" + _local3, _local6.mc.getDepth() - 1);
var _local7 = new code.objectInWater(mcBoard["mcDot" + _local3]);
gameObjArr.push(_local7);
var _local11 = mcBoard.mcFirstBoatPos._y + (_local3 * 75);
if (numBoatsInRace == 1) {
_local11 = _local11 + 75;
}
var _local4 = {boatNum:_local3, pGameController:this, boatName:"boat" + _local3, x:mcBoard.mcFirstBoatPos._x, y:_local11};
_local4.mirrorClipLinkage = "mcBoatGraphic";
_local4.initialDelayFrames = _local3 * 10;
_local4.targetDotObj = _local7;
_local6.initBoat(_local4);
_local3++;
}
_local23 = 2;
_local3 = 0;
while (_local3 < _local23) {
if (numBoatsInRace > 1) {
var _local12 = (boatObjArr[_local3].y + boatObjArr[_local3 + 1].y) / 2;
var _local9 = Math.floor((boatObjArr[_local3].mc.getDepth() + boatObjArr[_local3 + 1].mc.getDepth()) / 2);
} else {
var _local8 = -45 + (_local3 * 75);
var _local12 = boatObjArr[0].y + _local8;
var _local9 = Math.floor(boatObjArr[0].mc.getDepth() + (_local8 / 10));
}
mcBoard.attachMovie("mcBuoyStart", "mcBuoyStart_" + _local3, _local9);
var _local14 = mcBoard["mcBuoyStart_" + _local3];
var _local10 = new code.objectInWater(_local14);
_local10.init({x:mcBoard.mcStartPos._x, y:_local12, pGameController:this, mirrorClipLinkage:"mcBuoyStartGraphic"});
gameObjArr.push(_local10);
mcBoard.attachMovie("mcBuoyFinish", "mcBuoyFinish_" + _local3, _local9 + 1);
_local10 = new code.objectInWater(mcBoard["mcBuoyFinish_" + _local3]);
_local10.init({x:getFinishLineX(), y:_local12, pGameController:this, mirrorClipLinkage:"mcBuoyFinishGraphic"});
gameObjArr.push(_local10);
_local3++;
}
mcBoard.attachMovie("mcIsland3", "mcIsland", nextDepths.island++);
var _local24 = new code.island(mcBoard.mcIsland);
_local24.init({x:500, y:mcBoard.mcHorizonLine._y, pGameController:this, mirrorClipLinkage:"XmcIsland"});
gameObjArr.push(_local24);
if (_root.gFlashVersion >= 8) {
var _local21 = new Array();
_local21 = _local21.concat([1, 0, 0, 0, 0]);
_local21 = _local21.concat([0, 1, 0, 0, 0]);
_local21 = _local21.concat([0, 0, 1, 0, 0]);
_local21 = _local21.concat([0, 0, 0, 0.2, 0]);
var _local26 = new flash.filters.ColorMatrixFilter(_local21);
mcBoardMirror.filters = new Array(_local26);
} else {
mcBoardMirror._alpha = 10;
}
gOrigin = new flash.geom.Point(_root.mcOrigin._x, _root.mcOrigin._y);
var _local32;
gameState = "initialPan";
whereToGo = "play loop";
builtWordArray = new Array();
completedWords = "";
boatWon = undefined;
bestWordScore = 0;
courseObj.init();
levelScore = 0;
}
function changeView(amt) {
pViewX = pViewX + amt;
for (var _local3 in gameObjArr) {
var _local2 = gameObjArr[_local3];
_local2.setLoc();
}
}
function getFinishLineX() {
return(finishLineX);
}
function getStartLineX() {
return(mcBoard.mcStartPos._x);
}
function raceOver(fromNum) {
if (gameState == "normal") {
trace("[gameController] race over" + fromNum);
_root.gotoAndPlay("race over");
if (boatWon == myBoatObj) {
_root.mcSound.playSound(2, "win theme", 30);
_root.gLogger.logActivity(((((diffWordArr[difficulty] + "/") + gameType) + "/level") + levelNum) + "/won");
} else {
_root.mcSound.playSound(2, "lose theme", 30);
_root.gLogger.logActivity(((((diffWordArr[difficulty] + "/") + gameType) + "/level") + levelNum) + "/lost");
}
gameState = "raceOver";
}
}
function checkRaceWon(boatObj) {
if (!turnBasedFlag) {
if (boatObj.testPassedFinishLine()) {
boatObj.activeFlag = false;
boatObj.raceCompleteFlag = true;
if (boatWon == undefined) {
boatWon = boatObj;
}
raceOver(0);
}
} else if (boatObj.testPassedFinishLine() and (gameState == "normal")) {
boatWon = boatObj;
raceOver(2);
}
}
function testTargetPassedFinishLine(boatObj) {
var _local2 = false;
if (boatObj.getTargetX() >= getFinishLineX()) {
_local2 = true;
}
return(_local2);
}
function testPassedStartLine(boatObj) {
return(boatObj.x >= getStartLineX());
}
function menuButtonClicked() {
_root.mcDialogue.setDialogue("confirm quit", "noFade");
}
function tryAgainClicked() {
delete _root.onEnterFrame;
cleanUpGame();
setInterface();
_root.mcSound.playSound(1, "click");
_root.gotoAndPlay("init level");
}
function gotoMenu() {
_root.mcSound.playMusic(1, "intro theme", 60, "fadeIn", 1);
_root.mcSound.playSound(1, "click");
delete _root.onEnterFrame;
_root.gotoAndPlay("title");
}
function nextLevelClicked() {
delete _root.onEnterFrame;
cleanUpGame();
levelNum++;
setInterface();
_root.mcSound.playSound(1, "click");
_root.gotoAndPlay("init level");
}
function vowelTest(ch) {
var _local1 = "AEIOU";
return(_local1.indexOf(ch) > -1);
}
function getRandomLetter() {
var _local10 = letterArray.length > (numLetters - 5);
var _local7 = "all";
if (_local10) {
var _local6 = letterArray.length;
var _local4 = 0;
var _local5 = 0;
var _local2 = 0;
while (_local2 < _local6) {
var _local3 = letterArray[_local2].getLetter();
if (vowelTest(_local3)) {
_local4++;
} else {
_local5++;
}
_local2++;
}
var _local12;
if (_local4 < 4) {
_local7 = "vowel";
}
if (_local5 < 4) {
_local7 = "consonant";
}
}
switch (_local7) {
case "vowel" :
trace("NEEDED VOWEL!!!!");
var _local12 = useRandomLetter("vowel");
break;
case "consonant" :
trace("NEEDED CONSONANT");
_local12 = useRandomLetter("consonant");
break;
case "all" :
var _local9 = random(possibleConsonantArray.length + possibleVowelArray.length);
if (_local9 < possibleConsonantArray.length) {
_local12 = useRandomLetter("consonant");
} else {
_local12 = useRandomLetter("vowel");
}
}
var _local11 = 1;
var _local8 = random(100);
if (_local8 > 97) {
_local11 = 3;
} else if (_local8 > 89) {
_local11 = 2;
}
return({ltr:_local12, multiplier:_local11});
}
function useRandomLetter(type) {
var _local3;
switch (type) {
case "vowel" :
var _local2 = random(possibleVowelArray.length);
_local3 = possibleVowelArray[_local2];
possibleVowelArray.splice(_local2, 1);
if (possibleVowelArray.length == 0) {
initPossibleLetterArray("vowel");
}
break;
case "consonant" :
_local2 = random(possibleConsonantArray.length);
_local3 = possibleConsonantArray[_local2];
possibleConsonantArray.splice(_local2, 1);
if (possibleConsonantArray.length != 0) {
break;
}
initPossibleLetterArray("consonant");
}
return(_local3);
}
function initLetters() {
numLetters = 11;
spaceBetweenLetters = 740 / numLetters;
var _local16 = 1;
letterArray = new Array();
var _local15 = 15;
var _local4 = numLetters - 1;
while (_local4 >= 0) {
var _local11 = nextDepths.staticLetters;
nextDepths.staticLetters++;
var _local5 = "mcLetter" + _local11;
_root.mcCloud.attachMovie("mcLetter", _local5, _local11);
var _local7 = _root.mcCloud[_local5];
nextDepths.movingLetters++;
var _local6 = new code.letter();
var _local9 = nextDepths.movingLetters;
var _local8 = letterPosToX(_local4);
var _local3 = {pGameController:this, animDepth:_local9, normalDepth:_local11, boatObj:myBoatObj, mc:_local7, letterNum:_local4};
_local3.locX = _local8;
_local3.locY = _local15;
_local3.letterColor = letterColor;
_local6.initLetter(_local3);
letterArray.push(_local6);
_local4--;
}
}
function letterPosToX(pos) {
return(-70 + (pos * spaceBetweenLetters));
}
function setLettersInactive() {
var _local2 = 0;
while (_local2 < numLetters) {
letterArray[_local2].setInactive();
_local2++;
}
}
function addRipple(boatObj) {
var _local7 = nextDepths.ripple;
nextDepths.ripple++;
mcBoard.attachMovie("mcRipple", "mcRipple" + nextDepths.ripple, nextDepths.ripple);
var _local4 = mcBoard["mcRipple" + nextDepths.ripple];
var _local2 = new code.ripple(_local4);
var _local3 = {x:boatObj.x + boatObj.xCorrection, y:boatObj.y, pGameController:this};
_local2.init(_local3);
gameObjArr.push(_local2);
}
function removeRipple(mcRipple) {
removeItemFromArray(gameObjArr, mcRipple.controlObj);
removeMovieClip(mcRipple);
}
function removeGameObj(obj) {
removeItemFromArray(gameObjArr, obj);
removeMovieClip(obj.mc);
}
function startRace() {
gameState = "normal";
if (turnBasedFlag) {
myBoatObj.setActive();
turnNum = myBoatObj.boatNum;
mcTurnDisplay.setToBoat(boatObjArr[turnNum], turnNum == myBoatObj.boatNum);
} else {
var _local2 = 0;
while (_local2 < boatObjArr.length) {
boatObjArr[_local2].setActive();
_local2++;
}
}
var _local2 = 0;
while (_local2 < letterArray.length) {
letterArray[_local2].mc.mcButton._visible = true;
_local2++;
}
powerUpController.init({gameType:gameType, levelNum:levelNum, pGameController:this});
}
function advanceTurn() {
boatObjArr[turnNum].setInactive();
if (turnNum == 1) {
boatWon = undefined;
var _local3 = 0;
while (_local3 < numBoatsInRace) {
var _local2 = boatObjArr[_local3];
if (testTargetPassedFinishLine(_local2)) {
if (boatWon == undefined) {
boatWon = _local2;
trace("boatWon == undefined:");
} else if (_local2.getTargetX() > boatWon.getTargetX()) {
boatWon = _local2;
trace(("boatWon = boatObj:" + _local2.boatNum) + _local2.getTargetX());
}
}
_local3++;
}
}
if (boatWon != undefined) {
dTrace(("####################BOAT " + boatWon.boatNum) + " WILL WIN!");
mcTurnDisplay._visible = false;
if (boatWon.testPassedFinishLine()) {
}
} else {
var _local4 = turnNum;
turnNum++;
if (turnNum >= numBoatsInRace) {
turnNum = 0;
}
while (boatObjArr[turnNum].raceCompleteFlag and (turnNum != _local4)) {
turnNum++;
if (turnNum >= numBoatsInRace) {
turnNum = 0;
}
}
boatObjArr[turnNum].setActive();
mcTurnDisplay.setToBoat(boatObjArr[turnNum], turnNum == myBoatObj.boatNum);
}
}
function checkKey() {
if (gameState == "normal") {
var _local5;
var _local6 = true;
if ((gameType == "Puzzle") and (numUserTurns >= numUserTurnsMax)) {
_local6 = false;
}
if (_local6) {
switch (Key.getAscii()) {
case 8 :
_local5 = "BACKSPACE";
builtWordArray[builtWordArray.length - 1].clearHilite();
builtWordArray.pop();
determineWordSoFar();
break;
case 13 :
submitWord();
break;
case 32 :
shuffleLetters();
break;
default :
_local5 = chr(Key.getAscii()).toUpperCase();
var _local4;
var _local3 = 0;
while (_local3 < letterArray.length) {
if ((!letterArray[_local3].getSelectedState()) and letterArray[_local3].getActiveState()) {
if (letterArray[_local3].getLetter() == _local5) {
if (_local4 == undefined) {
_local4 = letterArray[_local3];
} else if (letterArray[_local3].getLetterScore() > _local4.getLetterScore()) {
_local4 = letterArray[_local3];
}
}
}
_local3++;
}
if (_local4 == undefined) {
break;
}
attemptAddLetterToBuiltWord(_local4);
determineWordSoFar();
_root.mcSound.playSound(1, "letter click");
}
}
}
}
function checkLetterDrag(letterObjDragging) {
var _local5 = new Array();
_local5.push(letterArray[0]);
var _local4 = 1;
while (_local4 < letterArray.length) {
var _local6 = letterArray[_local4];
var _local2 = 0;
while (_local6.mc._x > _local5[_local2].mc._x) {
_local2++;
}
_local5.splice(_local2, 0, _local6);
_local4++;
}
_local4 = 0;
while (_local4 < _local5.length) {
var _local3 = _local5[_local4];
var _local7 = _local3.xTarget;
_local3.xTarget = letterPosToX(_local4);
if (_local7 != _local3.xTarget) {
if (_local3 != letterObjDragging) {
_local3.setMoveTowardsTargetX(spaceBetweenLetters / 4);
}
}
_local4++;
}
}
function stepGame() {
var _local3;
switch (gameState) {
case "initialPan" :
if (pViewX <= 0) {
gameState = "startingLine";
_root.play();
} else {
var _local7;
if (pViewX < 150) {
_local7 = (((150 - pViewX) / 150) * 20) - 20;
} else {
_local7 = -20;
}
_local7 = Math.min(-1, _local7);
changeView(_local7);
}
break;
case "startingLine" :
var _local6 = gameObjArr.length;
var _local4 = 0;
while (_local4 < _local6) {
gameObjArr[_local4].step();
_local4++;
}
break;
case "normal" :
var _local8 = myBoatObj.mc._x - pScreenSafeRect.right;
if (_local8 > 0) {
changeView(_local8);
}
_local6 = gameObjArr.length;
_local4 = 0;
while (_local4 < _local6) {
gameObjArr[_local4].step();
_local4++;
}
if (numBoatsInRace > 1) {
var _local5;
_local4 = 0;
while (_local4 < boatObjArr.length) {
_local5 = 1;
_local3 = 0;
while (_local3 < boatObjArr.length) {
if (boatObjArr[_local4].x < boatObjArr[_local3].x) {
_local5++;
}
_local3++;
}
if (testPassedStartLine(boatObjArr[_local4])) {
boatObjArr[_local4].setBoatRacePosNum(_local5);
}
_local4++;
}
}
break;
case "raceOver" :
_local6 = gameObjArr.length;
_local4 = 0;
for(;;){
if (_local4 >= _local6) {
break;
}
gameObjArr[_local4].step();
_local4++;
};
}
}
function boatComeToStop(boatObj) {
if (turnBasedFlag) {
if (boatObj.testPassedFinishLine()) {
}
} else if (numBoatsInRace == 1) {
if (numUserTurns >= numUserTurnsMax) {
raceOver(0);
}
}
if (boatObj == myBoatObj) {
_root.mcWordScore.onEnterFrame = function () {
this._alpha = this._alpha - 10;
if (this._alpha <= 0) {
delete this.onEnterFrame;
}
};
}
}
function getUserWonFlag() {
return(boatWon == myBoatObj);
}
function determineWordSoFar() {
var _local3;
builtWordString = "";
wordScore = 0;
_local3 = 0;
while (_local3 < builtWordArray.length) {
var _local4 = builtWordArray[_local3].getLetter();
builtWordString = builtWordString + _local4;
wordScore = wordScore + builtWordArray[_local3].getLetterScore();
_root.mcWordScore._alpha = 100;
delete _root.mcWordScore.onEnterFrame;
_local3++;
}
setInterface();
mcWordDisplay.setWord(builtWordString);
_root.builtWordStr = builtWordString;
myBoatObj.drawTargetGraphic({vel:wordScore * 2, hypothetical:true});
}
function submitWord() {
dTrace((("submit word:" + builtWordString) + ",") + gameState);
if ((!turnBasedFlag) or (turnBasedFlag and (turnNum == myBoatObj.boatNum))) {
if (builtWordArray.length > 0) {
dTrace((((("mcWordList:" + mcWordList) + ",") + mcWordList.validWord) + ",") + mcWordList.validWord(builtWordString.toUpperCase()));
if (mcWordList.validWord(builtWordString.toUpperCase())) {
var _local5 = builtWordArray.length;
var _local3 = 0;
while (_local3 < _local5) {
var _local4 = builtWordArray[_local3];
createLetterWindAnim(myBoatObj, _local4, (_local5 - 1) - _local3);
_local4.countLetter(_local3);
_local3++;
}
completedWords = completedWords + (builtWordString + " ");
myBoatObj.prepareAddSpeed(wordScore * 2);
gameScore = gameScore + wordScore;
levelScore = levelScore + wordScore;
if (wordScore > bestWordScore) {
bestWordScore = wordScore;
bestWord = builtWordString;
}
var _local6 = Math.max(0, Math.min(4, Math.floor(wordScore - 5)));
dTrace("submit word:submit word " + _local6);
if (turnBasedFlag) {
advanceTurn();
}
numUserTurns++;
if (numBoatsInRace == 1) {
courseObj.setNumTurns(numUserTurns, numUserTurnsMax);
if (numUserTurns == numUserTurnsMax) {
setLettersInactive();
}
}
deselectAllLetters();
builtWordArray = new Array();
_root.builtWordStr = "";
} else {
_root.mcSound.playSound(1, "word reject");
clearSelectedWord();
}
setInterface();
}
}
}
function clearSelectedWord() {
deselectAllLetters();
builtWordArray = new Array();
determineWordSoFar();
}
function pauseGame() {
prePauseGameState = gameState;
gameState = "paused";
}
function unPauseGame() {
gameState = prePauseGameState;
}
function togglePause() {
if (gameState == "paused") {
unPauseGame();
} else {
pauseGame();
}
}
function getUserRaceOverMessage() {
var _local2;
if (numBoatsInRace == 1) {
if (boatWon == myBoatObj) {
_local2 = "You Made It!";
} else {
_local2 = " You Didn't Quite Make It...";
}
} else if (boatWon == myBoatObj) {
_local2 = "You Won the Race!";
} else {
var _local3 = new Array(undefined, "SECOND", "Second", "Third");
_local2 = "You came in " + _local3[myBoatObj.racePos];
}
return(_local2);
}
function createLetterWindAnim(boatObj, letterObj, order) {
var depth = mcBoard.getNextHighestDepth();
if (letterObj != undefined) {
mcBoard.attachMovie("mcLetterWindAnim", "mcLetterWindAnim_" + depth, depth);
var mcAnimClip = mcBoard["mcLetterWindAnim_" + depth];
mcAnimClip.mcLetter.letterChar = letterObj.getLetter();
} else {
mcBoard.attachMovie("mcWindAnim", "mcWindAnim" + depth, depth);
var mcAnimClip = mcBoard["mcWindAnim" + depth];
mcAnimClip.mcLetter.letterChar = "";
}
mcAnimClip._x = boatObj.mc._x + boatObj.xCorrection;
mcAnimClip._y = boatObj.mc._y;
mcAnimClip.boatObj = boatObj;
mcAnimClip._alpha = 30;
if (order != undefined) {
mcAnimClip.gotoAndPlay(14 - order);
}
mcAnimClip.onEnterFrame = function () {
with (this) {
_x = boatObj.mcBoat._x;
_alpha = _alpha + 10;
}
};
}
function deselectAllLetters() {
var _local2 = 0;
while (_local2 < letterArray.length) {
letterArray[_local2].clearHilite();
_local2++;
}
}
function cleanUpGame() {
var _local4;
for (var _local3 in mcBoard) {
removeMovieClip(mcBoard[_local3]);
}
for (var _local3 in _root.mcBoardMirror) {
removeMovieClip(_root.mcBoardMirror[_local3]);
}
for (var _local3 in _root.mcCloud) {
removeMovieClip(_root.mcCloud[_local3]);
}
for (var _local3 in courseObj) {
removeMovieClip(courseObj[_local3]);
}
}
function resetGame() {
cleanUpGame();
_root.gotoAndPlay("init level");
}
function getLegNames() {
return((legDataArr[levelNum - 1].island + " to \n ") + legDataArr[levelNum].island);
}
function getLegNumText() {
var _local2 = new Array("", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN");
return("LEG " + _local2[levelNum]);
}
function getLegDistance() {
return(legDataArr[levelNum].distance + " sea miles");
}
function letterClicked(letterObj) {
var _local6 = letterObj.mc;
var _local2;
var _local3;
var _local5 = true;
if ((gameType == "Puzzle") and (numUserTurns >= numUserTurnsMax)) {
_local5 = false;
}
if (_local5) {
if (letterObj.getSelectedState()) {
if ((getTimer() - gLastClickedTime) < gDoubleClickTimeMax) {
submitWord();
} else {
_local3 = true;
_local2 = builtWordArray.length - 1;
while (_local3) {
if ((builtWordArray[_local2] == letterObj) or (_local2 < 0)) {
_local3 = false;
}
builtWordArray[_local2].clearHilite();
builtWordArray.pop();
_local2--;
}
determineWordSoFar();
}
} else {
attemptAddLetterToBuiltWord(letterObj);
}
gLastClickedTime = getTimer();
}
}
function attemptAddLetterToBuiltWord(letterObj) {
if (builtWordArray.length < maxWordLength) {
addLetterToBuiltWord(letterObj);
} else {
_root.mcSound.playSound(1, "word reject");
}
}
function addLetterToBuiltWord(letterObj) {
if (builtWordArray.length < maxWordLength) {
builtWordArray.push(letterObj);
letterObj.mc.builtWordArrayPos = builtWordArray.length - 1;
letterObj.setHilite();
determineWordSoFar();
}
}
function shuffleLetters() {
clearSelectedWord();
var _local3 = new Array();
var _local2 = 0;
while (_local2 < letterArray.length) {
_local3.push({ltr:letterArray[_local2].getLetter(), hilite:letterArray[_local2].getSelectedState(), multiplier:letterArray[_local2].multiplier});
_local2++;
}
_local2 = 0;
while (_local2 < letterArray.length) {
var _local4 = random(_local3.length);
var _local5 = _local3[_local4];
_local3.splice(_local4, 1);
letterArray[_local2].setLetter(_local5);
_local2++;
}
}
function dumpLetters() {
var _local2 = 0;
while (_local2 < letterArray.length) {
letterArray[_local2].chooseRandomLetter();
_local2++;
}
}
function sendObjToScreenLoc(mcLetter, loc, initialDelayFrames, speed) {
if (speed == undefined) {
speed = 1;
}
if (initialDelayFrames == undefined) {
initialDelayFrames = 0;
}
if (mcLetter.animDelayFrames == undefined) {
mcLetter.animDelayFrames = initialDelayFrames;
} else {
mcLetter.animDelayFrames = Math.max(mcLetter.animDelayFrames, initialDelayFrames);
}
mcLetter.targetLoc = loc;
var dx = (loc.x - mcLetter._x);
var dy = (loc.y - mcLetter._y);
mcLetter.numAnimSteps = Math.floor(Math.sqrt((dx * dx) + (dy * dy)) / (15 * speed));
mcLetter.numAnimSteps = Math.max(6, mcLetter.numAnimSteps);
mcLetter.dx = dx / mcLetter.numAnimSteps;
mcLetter.dy = dy / mcLetter.numAnimSteps;
mcLetter.onEnterFrame = function () {
if (this.animDelayFrames > 0) {
this.animDelayFrames--;
} else if (this.numAnimSteps > 0) {
this._x = this._x + this.dx;
this._y = this._y + this.dy;
this.numAnimSteps--;
} else {
delete this.onEnterFrame;
this._x = this.targetLoc.x;
this._y = this.targetLoc.y;
this.swapDepths(this.normalDepth);
if (this.onAnimComplete != undefined) {
this.onAnimComplete();
}
this.onAnimComplete = undefined;
}
};
}
function removeItemFromArray(arr, item) {
var _local3;
var _local1 = 0;
while (_local1 < arr.length) {
if (arr[_local1] == item) {
_local3 = _local1;
}
_local1++;
}
if (_local3 != undefined) {
arr.splice(_local3, 1);
}
}
function dTrace(str) {
var _local2 = "[gameController]";
if (_root.mcDebug.dTrace == undefined) {
trace(_local2 + str);
} else {
_root.mcDebug.dTrace(_local2 + str);
}
}
function traceVar(varName) {
dTrace((varName + ":") + this[varName]);
}
}
Symbol 553 MovieClip [__Packages.code.PowerUpController] Frame 0
class code.PowerUpController
{
var levelNum, gameType, mcBoard, pGameController, xMin, xMax;
function PowerUpController () {
}
function init(initParams) {
levelNum = initParams.levelNum;
gameType = initParams.gameType;
mcBoard = _root.mcBoard;
pGameController = initParams.pGameController;
xMin = pGameController.gBoardRect.right;
xMax = pGameController.getFinishLineX() - 200;
trace((("xMin:" + xMin) + ",") + xMax);
if (random(3) == 0) {
addPowerUp(0, pGameController.myBoatObj);
}
}
function addPowerUp(typeNum, boatObj) {
var _local2 = pGameController.nextDepths.powerUp;
mcBoard.attachMovie("mcPowerUp", "mcPowerUp" + _local2, _local2);
var _local5 = mcBoard["mcPowerUp" + _local2];
pGameController.nextDepths.powerUp++;
var _local3 = {mc:_local5, typeNum:typeNum, boatObj:boatObj, pGameController:pGameController, mirrorClipLinkage:"mcPowerUpGraphic"};
_local3.x = xMin + random(xMax - xMin);
var _local4 = new code.powerUp(_local5);
_local4.initPowerUp(_local3);
pGameController.gameObjArr.push(_local4);
}
}
Symbol 554 MovieClip [__Packages.code.objectInWater] Frame 0
class code.objectInWater
{
var mc, pGameController, x, y, mcReflected, mcToReflect;
function objectInWater (mClip) {
mc = mClip;
}
function init(initParams) {
pGameController = initParams.pGameController;
x = initParams.x;
y = initParams.y;
mc.controlObj = this;
var _local3 = initParams.mirrorClipLinkage;
pGameController.mcBoardMirror.attachMovie(_local3, mc._name, pGameController.mcBoardMirror.getNextHighestDepth());
mcReflected = pGameController.mcBoardMirror[mc._name];
mcReflected._yscale = -100;
mcToReflect = mc.mcObject;
setLoc();
}
function setLoc() {
mc._x = x - pGameController.pViewX;
mc._y = y;
mcReflected._x = mc._x + xCorrection;
mcReflected._y = mc._y - 200;
mc._visible = (mc._x < 920) and (mc._x > -100);
mcReflected._visible = mc._visible;
if (!mcReflected._visible) {
mcReflected._x = 300;
}
}
function step() {
mcReflected._rotation = -mcToReflect._rotation;
}
function removeClips() {
removeMovieClip(mc);
removeMovieClip(mcReflected);
}
var xCorrection = 0;
}
Symbol 555 MovieClip [__Packages.code.powerUp] Frame 0
class code.powerUp extends code.objectInWater
{
var boatObj, typeNum, mc, init, setLoc, hitFlag, y, x, pGameController, removeClips;
function powerUp (mc) {
super(mc);
}
function initPowerUp(initParams) {
boatObj = initParams.boatObj;
typeNum = initParams.typeNum;
initParams.x = initParams.x;
initParams.y = boatObj.y;
mc.controlObj = this;
mc.gotoAndStop(typeNum + 1);
init(initParams);
setLoc();
hitFlag = false;
trace((((("[Power up]" + mc) + ",") + x) + ",") + y);
trace("init():" + init);
}
function step() {
setLoc();
if (!hitFlag) {
if (boatObj.x >= x) {
hitFlag = true;
pGameController.removeItemFromArray(pGameController.gameObjArr, this);
if (!(typeNum === 0)) {
} else {
trace((((((("[Powerup]" + mc.targetX) + ",") + mc.targetY) + ",") + mc.deltaX) + ",") + mc.deltaY);
var depth = pGameController.nextDepths.powerUpAnim;
pGameController.nextDepths.powerUpAnim++;
var frm = mc._currentframe;
_root.mcBoard.attachMovie("mcPowerUpGraphic", "mcPowerUpGraphic" + depth, depth);
var mcObject = _root.mcBoard["mcPowerUpGraphic" + depth];
mcObject.gotoAndStop(frm);
mcObject.targetX = _root.mcInterface.mcDumpButton._x;
mcObject.targetY = _root.mcInterface.mcDumpButton._y;
mcObject._x = mc._x;
mcObject._y = mc._y;
var numSteps = 10;
mcObject.deltaX = (mcObject.targetX - mcObject._x) / numSteps;
mcObject.deltaY = (mcObject.targetY - mcObject._y) / numSteps;
removeClips();
_root.mcSound.playSound(1, "submit word 3", 30);
mcObject.onEnterFrame = function () {
with (this) {
_x = _x + deltaX;
_y = _y + deltaY;
if (Math.abs(_y - targetY) <= 1) {
trace("[Powerup] reached target");
_visible = false;
_root.mcInterface.mcDumpButton.play();
delete onEnterFrame;
_root.mcSound.playSound(1, "submit word 3", 30);
}
}
};
}
}
}
}
}
Symbol 556 MovieClip [__Packages.code.courseDisplay] Frame 0
class code.courseDisplay
{
var mc, courseLength, numTurns, pGameController, numBoats, iconArr;
function courseDisplay (pmc) {
mc = pmc;
courseLength = "";
numTurns = "";
}
function init() {
pGameController = _root.gGameController;
mc.gotoAndStop(pGameController.gameTypeNum + 1);
numBoats = pGameController.numBoatsInRace;
iconArr = new Array();
var _local4 = 0;
while (_local4 < numBoats) {
mc["mcCourseBoatIcon" + _local4].removeMovieClip();
mc.attachMovie("mcCourseBoatIcon", "mcCourseBoatIcon" + _local4, mc.getNextHighestDepth());
var _local3 = mc["mcCourseBoatIcon" + _local4];
var _local5 = pGameController.boatObjArr[_local4];
_local3.gotoAndStop(_local5.boatStyleNum + 1);
_local3.boatToTrack = _local5;
iconArr.push(_local3);
_local3._x = -1000;
_local3._y = mc.mcStart._y;
trace((((("mcBoatIcon:" + _local3) + ",") + _local5) + ", ") + _local5.boatStyleNum);
_local4++;
}
if (numBoats == 1) {
setNumTurns(0, pGameController.numUserTurnsMax);
} else {
numTurns = "";
}
mc.controlObj = this;
mc.onEnterFrame = function () {
this.controlObj.step();
};
}
function step() {
var _local4;
_local4 = 0;
while (_local4 < iconArr.length) {
var _local2 = iconArr[_local4];
var _local3 = _local2.boatToTrack.getPercentDone();
var _local5 = _local2._x;
_local2._x = mc.mcStart._x + Math.max(-200, (mc.mcFinish._x - mc.mcStart._x) * _local3);
if (_local2._x != _local5) {
if (_local3 < 0) {
_local2.n = "";
} else if (_local3 >= 1) {
_local2.n = "100%";
} else {
_local2.n = String(Math.floor(_local3 * 100) + "%");
}
}
_local4++;
}
}
function setNumTurns(x, xmax) {
trace((("[setNumTurns]m" + x) + ",") + xmax);
mc.numTurns = "words left: " + String(xmax - x);
}
}
Symbol 557 MovieClip [__Packages.code.boat] Frame 0
class code.boat extends code.objectInWater
{
var xCorrection, activeFlag, init, boatNum, targetDotObj, pGameController, y, x, delayFrames, mc, mcBoatGraphic, dragFactor, velocityXmin, windRotInfluence, velocityX, countDownToNewRippleMax, countDownToNewRipple, raceCompleteFlag, targetX, boatStyleNum, sailFullFlag, windRotTheta, windRotStrength, speedToAdd, setLoc, percentDone, mcReflected;
function boat (mc) {
super(mc);
dTrace("controller");
xCorrection = -69;
if (_root.debugOptions.clickToPushBoats) {
mc.onRelease = function () {
this.controlObj.addSpeed(6 + random(8));
};
}
activeFlag = false;
}
function initBoat(initParams) {
init(initParams);
boatNum = initParams.boatNum;
targetDotObj = initParams.targetDotObj;
targetDotObj.init({x:x, y:y, pGameController:pGameController, mirrorClipLinkage:""});
delayFrames = initParams.initialDelayFrames;
mc.gotoAndPlay(random(mc._totalframes + 1));
mcBoatGraphic = mc.mcObject;
mcBoatGraphic.boatName = "s.s." + initParams.boatName;
dragFactor = 0.92;
velocityXmin = 0.6;
windRotInfluence = 0;
setBoatStyle();
velocityX = 19;
countDownToNewRippleMax = 22;
countDownToNewRipple = 10;
raceCompleteFlag = false;
targetX = x;
}
function setBoatStyleNum(num) {
boatStyleNum = num;
}
function setActive() {
activeFlag = true;
mcBoatGraphic.mcNumber._visible = true;
}
function getActive() {
return(activeFlag);
}
function setInactive() {
activeFlag = false;
}
function addSpeed(amt) {
velocityX = velocityX + amt;
mcBoatGraphic.gotoAndStop("full");
sailFullFlag = true;
windRotTheta = 0;
windRotInfluence = 1;
windRotStrength = amt;
mc.mcSpray.play("large");
_root.mcSound.playSound(boatNum + 1, "boat surge", amt * 5);
drawTargetGraphic({vel:velocityX});
targetX = targetDotObj.x;
}
function prepareAddSpeed(amt) {
speedToAdd = amt;
drawTargetGraphic(velocityX + amt);
_root.mcSound.playSound(boatNum + 1, "wind", Math.min(100, (amt - 3) * 6));
}
function drawTargetGraphic(initParams) {
var _local2 = initParams.vel;
var _local3 = 0;
while (_local2 > velocityXmin) {
_local3 = _local3 + _local2;
_local2 = _local2 * dragFactor;
}
targetDotObj.x = x + _local3;
targetDotObj.mc._visible = true;
targetDotObj.setLoc();
}
function triggerAddSpeed() {
if (speedToAdd > 0) {
addSpeed(speedToAdd);
speedToAdd = 0;
}
}
function isMoving() {
return((velocityX > 0) and (delayFrames == 0));
}
function step() {
if (delayFrames > 0) {
delayFrames--;
} else {
if (velocityX > 0) {
x = x + velocityX;
setLoc();
velocityX = velocityX * dragFactor;
if (velocityX < velocityXmin) {
velocityX = 0;
pGameController.boatComeToStop(this);
targetDotObj._visible = false;
targetDotObj.setLoc();
dragFactor = 0.94;
}
if (windRotInfluence < 0.9) {
if (sailFullFlag) {
mcBoatGraphic.play();
sailFullFlag = false;
}
}
pGameController.checkRaceWon(this);
percentDone = (x - pGameController.getStartLineX()) / (pGameController.getFinishLineX() - pGameController.getStartLineX());
percentDone = Math.max(0, Math.min(1, percentDone));
}
if (windRotInfluence > 0) {
windRotInfluence = windRotInfluence - 0.01;
if (windRotInfluence < 0) {
windRotInfluence = 0;
}
}
var _local4 = 1 - windRotInfluence;
var _local3 = _local4 * mc.mcWaveRotDummy._rotation;
if (windRotInfluence > 0) {
_local3 = _local3 + ((windRotInfluence * windRotStrength) * Math.cos(windRotTheta));
windRotTheta = windRotTheta + 0.3;
}
mcBoatGraphic._rotation = _local3;
if (velocityX > 1) {
if (_local3 < prevRot1) {
if (prevRot2 < prevRot1) {
if (mc.mcSpray._currentframe == 1) {
mc.mcSpray.gotoAndPlay("small");
}
}
}
prevRot2 = prevRot1;
prevRot1 = _local3;
}
countDownToNewRipple--;
if (countDownToNewRipple <= 0) {
countDownToNewRipple = countDownToNewRippleMax;
pGameController.addRipple(this);
}
super.step();
}
}
function setBoatRacePosNum(num) {
racePos = num;
mcBoatGraphic.mcNumber.gotoAndStop(racePos + 1);
}
function testPassedFinishLine() {
return(percentDone == 1);
}
function setBoatStyle() {
mcBoatGraphic.mcHull.gotoAndStop(boatStyleNum + 1);
mcReflected.mcHull.gotoAndStop(boatStyleNum + 1);
mcBoatGraphic.mcBoatNameOnSail.gotoAndStop(boatStyleNum + 1);
mcReflected.mcBoatNameOnSail.gotoAndStop(boatStyleNum + 1);
}
function getTargetX() {
return(targetX);
}
function getPercentDone() {
return(percentDone);
}
function dTrace(str) {
var _local2 = "[boat]";
if (_root.mcDebug.dTrace == undefined) {
trace(_local2 + str);
} else {
_root.mcDebug.dTrace(_local2 + str);
}
}
function traceVar(varName) {
dTrace((varName + ":") + this[varName]);
}
var prevRot1 = 0;
var prevRot2 = 0;
var racePos = "";
var graphFrame = 0;
}
Symbol 558 MovieClip [__Packages.code.boatBot] Frame 0
class code.boatBot extends code.boat
{
var intelligence, timeBetweenWordsMin, timeBetweenWordsMax, pGameController, timeToAddSpeed, numPointsInFakeWord, needToSendWindAnim, activeFlag, prepareAddSpeed;
function boatBot (initParams) {
super(initParams.mc);
intelligence = initParams.intelligence;
timeBetweenWordsMin = initParams.timeBetweenWordsMin;
timeBetweenWordsMax = initParams.timeBetweenWordsMax;
}
function setTimeToAddSpeed() {
if (pGameController.turnBasedFlag) {
timeToAddSpeed = getTimer() + 1000;
} else {
timeToAddSpeed = (getTimer() + timeBetweenWordsMin) + random(timeBetweenWordsMax - timeBetweenWordsMin);
}
numPointsInFakeWord = 3 + random(4 * intelligence);
needToSendWindAnim = true;
trace("[BoatBot] timeToAddSpeed:" + timeToAddSpeed);
}
function setActive() {
super.setActive();
setTimeToAddSpeed();
}
function triggerAddSpeed() {
super.triggerAddSpeed();
if (pGameController.turnBasedFlag) {
pGameController.advanceTurn();
}
setTimeToAddSpeed();
}
function step() {
if (activeFlag) {
var _local5 = getTimer();
if (_local5 > timeToAddSpeed) {
timeToAddSpeed = 9999999999999;
prepareAddSpeed(numPointsInFakeWord * 2);
var _local4 = 1;
var _local3 = 0;
while (_local3 < _local4) {
pGameController.createLetterWindAnim(this, undefined, 6);
_local3++;
}
}
}
super.step();
}
}
Symbol 559 MovieClip [__Packages.code.island] Frame 0
class code.island extends code.objectInWater
{
var pGameController, x, mc, y;
function island (mc) {
super(mc);
}
function setLoc() {
mc._x = x - (pGameController.pViewX * 0.6);
mc._y = y;
if ((mc._x + mc._width) <= -30) {
x = x + (800 + mc._width);
}
}
}
Symbol 560 MovieClip [__Packages.code.letter] Frame 0
class code.letter
{
var mc, pGameController, letterNum, normalDepth, animDepth, boatObj, hilitedFlag, origX, origY, draggingFlag, xTarget, type, multiplier, delayFrames, alphaDelta;
function letter () {
}
function initLetter(initParams) {
mc = initParams.mc;
pGameController = initParams.pGameController;
letterNum = initParams.letterNum;
mc.controlObj = this;
normalDepth = initParams.normalDepth;
animDepth = initParams.animDepth;
chooseRandomLetter();
boatObj = initParams.boatObj;
mc.mcButton._visible = true;
hilitedFlag = false;
origX = initParams.locX;
origY = initParams.locY;
mc._x = origX;
mc._y = origY;
setFadeIn({delayFrames:letterNum});
draggingFlag = false;
}
function buttonRollover() {
}
function buttonReleased() {
if (pGameController.gameState == "normal") {
_root.mcSound.playSound(1, "letter click");
if (mc.getDepth() == animDepth) {
mc.swapDepths(normalDepth);
delete mc.onMouseMove;
mc._x = xTarget;
mc._y = origY;
pGameController.finalizeDrag();
} else {
pGameController.letterClicked(this);
}
draggingFlag = false;
}
}
function buttonDragOut() {
mc.onMouseMove = iterateDrag;
mc.swapDepths(animDepth);
draggingFlag = true;
}
function testDragging() {
return(draggingFlag);
}
function iterateDrag() {
with (this) {
_x = _parent._xmouse;
_y = Math.min(controlObj.origY + 100, Math.max(controlObj.origY - 50, _parent._ymouse));
controlObj.pGameController.checkLetterDrag(controlObj);
}
}
function setMoveTowardsTargetX(increment) {
mc.increment = increment;
mc.onEnterFrame = function () {
with (this) {
var deltaX = (controlObj.xTarget - _x);
if (Math.abs(deltaX) > 3) {
var dirToMove = (Math.abs(deltaX) / deltaX);
_x = _x + (increment * dirToMove);
} else {
_x = controlObj.xTarget;
delete onEnterFrame;
}
}
};
}
function countLetter(pos) {
mc.letterChar = "";
chooseRandomLetter();
setFadeIn({delayFrames:pos});
}
function initDrop(delay) {
mc.targetY = origY;
mc._y = origY - 80;
mc.delayFrames = delay;
mc.onEnterFrame = function () {
with (this) {
if (delayFrames > 0) {
delayFrames--;
} else {
_y = _y + 10;
if (_y >= targetY) {
_y = targetY;
delete mc.onEnterFrame;
}
}
}
};
}
function chooseRandomLetter() {
setLetter(pGameController.getRandomLetter());
type = "normal";
}
function setLetter(initParams) {
mc.letterChar = initParams.ltr;
multiplier = initParams.multiplier;
mc.letterScore = (pGameController.letterScoreHash[initParams.ltr] + multiplier) - 1;
mc.gotoAndStop(multiplier);
}
function getLetter() {
return(mc.letterChar);
}
function getLetterScore() {
return(Number(mc.letterScore));
}
function setFadeIn(initParams) {
mc._alpha = 0;
delayFrames = initParams.delayFrames;
alphaDelta = 20;
mc.onEnterFrame = function () {
this.controlObj.iterateFadeIn();
};
}
function iterateFadeIn() {
if (delayFrames <= 0) {
mc._alpha = mc._alpha + alphaDelta;
if (mc._alpha >= 100) {
delete mc.onEnterFrame;
}
} else {
delayFrames--;
}
}
function setLetterGraphics() {
mc._visible = true;
clearHilite();
}
function setHilite() {
hilitedFlag = true;
mc.mcHilite._visible = true;
}
function getSelectedState() {
return(hilitedFlag);
}
function clearHilite() {
hilitedFlag = false;
mc.mcHilite._visible = false;
}
function setInactive() {
}
function getActiveState() {
return(mc.mcButton._visible);
}
}
Symbol 561 MovieClip [__Packages.code.ripple] Frame 0
class code.ripple
{
var mc, pGameController, x, y;
function ripple (mClip) {
mc = mClip;
}
function init(initParams) {
pGameController = initParams.pGameController;
x = initParams.x;
y = initParams.y;
mc.controlObj = this;
setLoc();
}
function setLoc() {
mc._x = x - pGameController.pViewX;
mc._y = y;
}
}
Instance of Symbol 339 MovieClip "mcDockReflection" in Symbol 340 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(Math.floor(_y));
}
Symbol 340 MovieClip Frame 2
stop();
Symbol 343 Button
on (release) {
buttonClicked();
}
on (rollOver) {
setRollOver();
}
on (rollOut) {
setRollOut();
}
Symbol 344 MovieClip Frame 1
function buttonClicked() {
_root.mcSound.playSound(2, "click");
_root.gUserBoatNum = boatNum;
trace("p:" + _parent);
_parent.play();
}
function setBoatStyle() {
mcBoat.mcObject.mcHull.gotoAndStop(boatNum);
mcBoat.mcObject.mcBoatNameOnSail.gotoAndStop(boatNum);
mcBoat.mcObject.mcNumber._visible = false;
mcBoat.gotoAndPlay(1 + ((boatNum - 1) * 10));
mcReflectedBoat._x = _x;
mcReflectedBoat._y = _y + 63;
mcReflectedBoat._yscale = -mcBoat._yscale;
mcReflectedBoat._xscale = mcBoat._xscale;
mcReflectedBoat.mcHull.gotoAndStop(boatNum);
mcReflectedBoat.mcNumber.boatNum = boatNum;
mcReflectedBoat.mcBoatNameOnSail.gotoAndStop(boatNum);
}
function setRollOver() {
mcBoat.mcObject.gotoAndStop("full");
rolledOver = true;
_root.setGlowFilter(mcBoat);
var _local3 = Math.floor(mcBoat._totalframes / 2);
mcBoat.gotoAndPlay(_local3 + Math.abs(mcBoat._currentframe - _local3));
_root.mcSound.playSound(1, "wind", 40);
_root.mcSound.playSound(2, "rollover");
_parent.mcChooseBoatMessage._x = _x - 190;
_parent.mcChooseBoatMessage._y = _y - 15;
}
function setRollOut() {
rolledOver = false;
mcBoat.mcObject.gotoAndPlay("full");
mcBoat.filters = new Array();
_parent.mcToolTip._x = -1000;
delete _parent.mcToolTip.onMouseMove;
}
boatNum = Number(_name.split("_")[1]);
rolledOver = false;
_parent.mcReflected.attachMovie("mcBoatGraphic", "mcBoatGraphic" + boatNum, Math.floor((_y + 163) + 260));
mcReflectedBoat = _parent.mcReflected["mcBoatGraphic" + boatNum];
setBoatStyle();
stop();
onEnterFrame = function () {
mcBoat.mcObject._rotation = mcBoat.mcWaveRotDummy._rotation;
if (rolledOver) {
mcBoat.mcObject._rotation = mcBoat.mcObject._rotation + 8;
}
mcReflectedBoat._rotation = -mcBoat.mcObject._rotation;
};
Instance of Symbol 45 MovieClip in Symbol 344 MovieClip Frame 1
onClipEvent (load) {
gotoAndPlay(Math.floor(_totalframes / 2));
}
Symbol 345 MovieClip Frame 1
var matrix = new Array();
matrix = matrix.concat([1, 0, 0, 0, 0]);
matrix = matrix.concat([0, 1, 0, 0, 0]);
matrix = matrix.concat([0, 0, 1, 0, 0]);
matrix = matrix.concat([0, 0, 0, 0.25, 0]);
var filter;
filter = new flash.filters.ColorMatrixFilter(matrix);
trace("filter:" + filter);
mcDockReflection.filters = new Array(filter);
trace("mcDockReflection.filters:" + mcDockReflection.filters);
trace("filter:" + filter);
Symbol 366 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 367 MovieClip Frame 1
stop();
Symbol 367 MovieClip Frame 2
stop();
Symbol 381 Button
on (release) {
buttonClicked("Race Action");
}
on (rollOver) {
setRollover(0);
}
on (rollOut) {
setRollout();
}
Symbol 385 Button
on (release) {
buttonClicked("Race by Turns");
}
on (rollOver) {
setRollover(1);
}
on (rollOut) {
setRollOut();
}
Symbol 393 Button
on (release) {
buttonClicked("Puzzle");
}
on (rollOver) {
setRollover(2);
}
on (rollOut) {
setRollOut();
}
Symbol 396 Button
on (release) {
_root.mcSound.playSound(1, "click");
_parent.gotoAndPlay(1);
}
Symbol 403 Button
on (release) {
setDifficulty(0);
}
on (rollOver) {
setRollover(0);
}
on (rollOut) {
setRollout();
}
Symbol 408 Button
on (release) {
setDifficulty(1);
}
on (rollOver) {
setRollover(1);
}
on (rollOut) {
setRollout();
}
Symbol 413 Button
on (release) {
setDifficulty(2);
}
on (rollOver) {
setRollover(2);
}
on (rollOut) {
setRollout();
}
Symbol 415 Button
on (release) {
_root.mcSound.playSound(1, "click");
gotoAndPlay ("gameType");
}
Symbol 450 MovieClip Frame 1
Symbol 450 MovieClip Frame 3
stop();
startTime = getTimer();
delayTicks = 1200;
onEnterFrame = function () {
if ((getTimer() - startTime) > delayTicks) {
play();
}
};
Symbol 450 MovieClip Frame 99
gotoAndPlay ("loop");
Symbol 455 Button
on (release) {
_root.mcSound.playSound(1, "click");
_root.play();
}
on (rollOver) {
_root.mcSound.playSound(1, "rollover");
}
Symbol 459 Button
on (release) {
_root.mcSound.playSound(1, "click");
gotoAndPlay (1);
}
Symbol 460 MovieClip Frame 1
function buttonClicked(str) {
_root.mcSound.playSound(2, "click");
_root.initParams.gameType = str;
play();
}
function setRollover(num) {
mcButton = eval ("mcButton" + num);
mcBoatIcon._x = mcButton._x + 134;
_root.mcSound.playSound(1, "rollover");
}
function setRollout() {
mcBoatIcon._x = -1000;
}
function setDifficulty(num) {
_root.mcSound.playSound(2, "click");
_root.initParams.difficulty = num;
play();
}
stop();
Instance of Symbol 301 MovieClip [mcBoat] "mcBoatIcon" in Symbol 460 MovieClip Frame 1
onClipEvent (load) {
var matrix = new Array();
matrix = matrix.concat([1, 0, 0, 0, 0]);
matrix = matrix.concat([0, 1, 0, 0, 0]);
matrix = matrix.concat([0, 0, 1, 0, 0]);
matrix = matrix.concat([0, 0, 0, 1, 0]);
var filter = (new flash.filters.ColorMatrixFilter(matrix));
this.filters = new Array(filter);
}
onClipEvent (enterFrame) {
mcObject._rotation = mcWaveRotDummy._rotation * 2;
}
Symbol 460 MovieClip Frame 3
gotoAndPlay ("course");
Instance of Symbol 301 MovieClip [mcBoat] "mcBoatIcon" in Symbol 460 MovieClip Frame 4
onClipEvent (load) {
var matrix = new Array();
matrix = matrix.concat([1, 0, 0, 0, 0]);
matrix = matrix.concat([0, 1, 0, 0, 0]);
matrix = matrix.concat([0, 0, 1, 0, 0]);
matrix = matrix.concat([0, 0, 0, 1, 0]);
var filter = (new flash.filters.ColorMatrixFilter(matrix));
this.filters = new Array(filter);
}
onClipEvent (enterFrame) {
mcObject._rotation = mcWaveRotDummy._rotation * 2;
}
Symbol 460 MovieClip Frame 9
function setRollover(num) {
trace(" eval(mcButton+num):" + this["mcButton" + num]);
mcButton = eval ("mcButton" + num);
mcBoatIcon._y = mcButton._y + 28;
mcBoatIcon._x = (mcButton._x + mcButton._width) - 10;
trace((((mcButton._y + ",") + mcButton._x) + ",") + mcButton._width);
_root.mcSound.playSound(1, "rollover");
}
function setRollout() {
}
stop();
Symbol 460 MovieClip Frame 12
_root.play();
stop();
Symbol 461 MovieClip Frame 1
var m = new Array();
m = m.concat([1, 0, 0, 0, 0]);
m = m.concat([0, 1, 0, 0, 0]);
m = m.concat([0, 0, 1, 0, 0]);
m = m.concat([0, 0, 0, 0.15, 0]);
var filter = (new flash.filters.ColorMatrixFilter(m));
mcReflected.filters = new Array(filter);
stop();
Instance of Symbol 367 MovieClip in Symbol 461 MovieClip Frame 1
onClipEvent (load) {
_root.setSite(this);
}
Instance of Symbol 460 MovieClip in Symbol 461 MovieClip Frame 4
/* no clip actions */
Symbol 461 MovieClip Frame 5
stop();
Symbol 464 Button
on (release) {
_root.gotoPizmo();
}
Instance of Symbol 231 MovieClip [mcCloud] in Symbol 468 MovieClip Frame 1
onClipEvent (load) {
this.onRelease = function () {
_root.gGameController.clearSelectedWord();
};
}
Symbol 470 MovieClip Frame 2
stop();
Instance of Symbol 472 MovieClip "mcScreenSafeRect" in Symbol 478 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 474 MovieClip "mcStartPos" in Symbol 478 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 474 MovieClip "mcFirstBoatPos" in Symbol 478 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 472 MovieClip "mcBoardRect" in Symbol 478 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 477 MovieClip "mcHorizonLine" in Symbol 478 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 494 Button
on (release) {
gGameController.menuButtonClicked();
}
Symbol 496 Button
on (release) {
_root.mcSound.toggleSound();
}
Symbol 498 Button
on (release) {
_root.gotoPizmo();
}
Symbol 505 Button
on (release) {
_root.gGameController.submitWord();
}
Symbol 510 Button
on (release) {
_root.gGameController.shuffleLetters();
}
Symbol 515 Button
on (release) {
_root.gGameController.clearSelectedWord();
}
Symbol 521 Button
on (release) {
_root.gGameController.dumpLetters();
_visible = false;
}
Symbol 522 Button
on (release) {
_root.gGameController.dumpLetters();
gotoAndPlay (1);
}
Symbol 523 MovieClip Frame 2
stop();
Symbol 523 MovieClip Frame 19
stop();
Symbol 530 Button
on (release) {
buttonClicked();
_root.mcSound.playSound(1, "click");
}
on (rollOver) {
_root.mcSound.playSound(1, "rollover");
}
Symbol 536 MovieClip Frame 1
stop();
onEnterFrame = function () {
if (delayFrames == undefined) {
delayFrames = 42;
} else {
delayFrames--;
if (delayFrames == 0) {
play();
}
}
};
Symbol 536 MovieClip Frame 3
function buttonClicked() {
_visible = false;
_root.gGameController.startRace();
}
function fadeComplete() {
_root.gGameController.startRace();
}
_visible = true;
_root.setFade(this, 1, 0.15, undefined);
legNames = _root.gGameController.getLegNames();
legNumText = _root.gGameController.getLegNumText();
dist = _root.gGameController.getLegDistance();
gotoAndStop(_root.gGameController.levelNum + 1);