STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228091
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2561 · P5121

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/92197094?noj=FRM92197094-4DC" width="1" height="1"></div>

sweet-monster.swf

This is the info page for
Flash #115501

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS1/AS2]
Combined Code
frame 1 { var strGAUserName = 'Guest'; var nGAUserID = '-1'; var nGAEmail = 'Gu@st.'; var blnMusic = true; var blnFX = true; stop(); } // unknown tag 88 length 173 movieClip 7 { } movieClip 9 { } movieClip 11 { } button 12 { on (release) { getURL('http://www.gamesarcade.net', '_blank'); } } movieClip 13 { frame 2 { getURL('javascript:document.sweetmonster.SetVariable('_level0.strCookies',(document.cookie) ? parseCookie(document.cookie) : '');', ''); } frame 31 { if (_level0.strCookies != '') { var tmpArr = (String(_level0.strCookies)).split('*####*'); _root.nGAUserID = tmpArr[0]; _root.strGAUserName = tmpArr[1]; _root.nGAEmail = tmpArr[2]; gotoAndPlay(35); } } frame 32 { gotoAndPlay(_currentframe - 1); } frame 132 { _parent.play(); } } movieClip 437 __Packages.it.gotoandplay.smartfoxserver.SmartFoxClient { #initclip if (!_global.it) { _global.it = new Object(); } if (!_global.it.gotoandplay) { _global.it.gotoandplay = new Object(); } if (!_global.it.gotoandplay.smartfoxserver) { _global.it.gotoandplay.smartfoxserver = new Object(); } if (!_global.it.gotoandplay.smartfoxserver.SmartFoxClient) { var v1 = function (objRef) { super(); this.objRef = objRef; this.os = it.gotoandplay.smartfoxserver.ObjectSerializer.getInstance(); this.isConnected = false; this.debug = false; this.initialize(); this.arrayTags = {'uLs': true, 'rmList': true, 'vars': true, 'bList': true, 'vs': true, 'mv': true}; this.messageHandlers = new Object(); this.httpConnection = new it.gotoandplay.smartfoxserver.http.HttpConnection(mx.utils.Delegate.create(this, this.handleHttpConnect), mx.utils.Delegate.create(this, this.handleHttpClose), mx.utils.Delegate.create(this, this.handleHttpData), mx.utils.Delegate.create(this, this.handleHttpError)); this.onConnect = this.connectionEstablished; this.onData = this.gotData; this.onXML = this.xmlReceived; this.onClose = this.connectionClosed; this.fpMajorVersion = this.getFpMajorVersion(); if (this.fpMajorVersion < 8) { this.pollingDelayFn = _global.setInterval; } else { this.pollingDelayFn = _global.setTimeout; } this.setupMessageHandlers(); }; it.gotoandplay.smartfoxserver.SmartFoxClient = v1; it.gotoandplay.smartfoxserver.SmartFoxClient extends XMLSocket; var v2 = v1.prototype; v2.__get__httpPollSpeed = function () { return this._httpPollSpeed; }; v2.__set__httpPollSpeed = function (sp) { if (sp >= it.gotoandplay.smartfoxserver.SmartFoxClient.MIN_POLL_SPEED && sp <= it.gotoandplay.smartfoxserver.SmartFoxClient.MAX_POLL_SPEED) { this._httpPollSpeed = sp; } return this.__get__httpPollSpeed(); }; v2.getFpMajorVersion = function () { var v1 = System.capabilities.version.indexOf(','); return Number(System.capabilities.version.substr(v1 - 1, 1)); }; v2.initialize = function (isLogout) { if (isLogout == undefined) { isLogout = false; } this.roomList = {}; this.buddyList = []; this.myBuddyVars = []; this.activeRoomId = -1; this.myUserId = null; this.myUserName = ''; this.playerId = null; this.changingRoom = false; this.amIModerator = false; if (!isLogout) { this.isConnected = false; this.isHttpMode = false; this.preConnection = true; } }; v2.loadConfig = function (configFile, autoConnect) { if (configFile == undefined) { configFile = this.DEFAULT_CONFIG_FILE; } if (autoConnect == undefined) { this.autoConnectOnConfigSuccess = this.DEFAULT_AUTO_CONNECT; } else { this.autoConnectOnConfigSuccess = autoConnect; } this.configLoader = new XML(); this.configLoader.ignoreWhite = true; this.configLoader.onLoad = mx.utils.Delegate.create(this, this.onConfigLoadSucceeded); this.configLoader.load(configFile); }; v2.onConfigLoadSucceeded = function (ok) { if (!ok) { this.onConfigLoadFailure('Could not load config file!'); return undefined; } var v6 = this.configLoader.childNodes[0].childNodes; var v4 = 0; while (v4 < v6.length) { var v5 = v6[v4]; var v2 = v5.nodeName.toLowerCase(); var v3 = v5.firstChild.nodeValue; if (v2 == 'ip') { this.blueBoxIpAddress = v3; this.ipAddress = this.blueBoxIpAddress; } else { if (v2 == 'port') { this.port = Number(v3); } else { if (v2 == 'zone') { this.defaultZone = v3; } else { if (v2 == 'smartconnect') { this.smartConnect = (v3 == 'true') ? true : false; } else { if (v2 == 'blueboxipaddress') { this.blueBoxIpAddress = v3; } else { if (v2 == 'blueboxport') { this.blueBoxPort = v3; } else { if (v2 == 'debug') { this.debug = (v3 == 'true') ? true : false; } else { if (v2 == 'httpport') { this.httpPort = Number(v3); } else { if (v2 == 'httppollspeed') { this.__set__httpPollSpeed(Number(v3)); } else { if (v2 == 'socketconnectiontimeout') { this.socketConnectionTimeout = Number(v3); } else { if (v2 == 'rawprotocolseparator') { this.rawProtocolSeparator = v3; } } } } } } } } } } } ++v4; } if (this.autoConnectOnConfigSuccess) { this.connect(this.ipAddress, this.port); } else { this.onConfigLoadSuccess(); } }; v2.onConfigLoadFailed = function (code) { if (code == 404) { this.onConfigLoadFailure('Could not find configuration file.'); } else { this.onConfigLoadFailure('Could not load configuration file. Http status = ' + code); } }; v2.getVersion = function () { return this.majVersion + '.' + this.minVersion + '.' + this.subVersion; }; v2.connected = function () { return this.isConnected; }; v2.getConnectionMode = function () { var v2 = it.gotoandplay.smartfoxserver.SmartFoxClient.CONNECTION_MODE_DISCONNECTED; if (this.isConnected) { if (this.isHttpMode) { v2 = it.gotoandplay.smartfoxserver.SmartFoxClient.CONNECTION_MODE_HTTP; return v2; } v2 = it.gotoandplay.smartfoxserver.SmartFoxClient.CONNECTION_MODE_SOCKET; } return v2; }; v2.setupMessageHandlers = function () { this.addMessageHandler('sys', this.handleSysMessages); this.addMessageHandler('xt', this.handleExtensionMessages); }; v2.addMessageHandler = function (handlerId, handlerMethod) { if (this.messageHandlers[handlerId] == undefined) { this.messageHandlers[handlerId] = new Object(); this.messageHandlers[handlerId].handleMessage = handlerMethod; } else { trace('Warning: [' + handlerId + '] handler could not be created. A handler with this name already exist!'); } }; v2.isModerator = function () { return this.amIModerator; }; v2.handleSysMessages = function (xmlObj, scope) { var v8 = xmlObj.attributes.action; var v17 = xmlObj.attributes.r; if (v8 == 'apiOK') { scope.isConnected = true; scope.onConnection(true); } else { if (v8 == 'apiKO') { scope.onConnection(false); trace('--------------------------------------------------------'); trace(' WARNING! The API you are using are not compatible with '); trace(' the SmartFoxServer instance you\'re trying to connect to'); trace('--------------------------------------------------------'); } else { if (v8 == 'logOK') { scope.myUserId = xmlObj.login.attributes.id; scope.myUserName = xmlObj.login.attributes.n; scope.amIModerator = (xmlObj.login.attributes.mod == '0') ? false : true; scope.onLogin({'success': true, 'name': scope.myUserName, 'error': ''}); scope.getRoomList(); } else { if (v8 == 'logKO') { var v62 = xmlObj.login.attributes.e; scope.onLogin({'success': false, 'name': '', 'error': v62}); } else { if (v8 == 'logout') { scope.initialize(true); scope.onLogout(); } else { if (v8 == 'rmList') { var v9 = xmlObj.rmList.rmList; scope.roomList = new Array(); for (var v43 in v9) { var v5 = v9[v43].attributes.id; var v2 = v9[v43].attributes; var v24 = v2.id; var v21 = v9[v43].n.value; var v22 = Number(v2.maxu); var v23 = Number(v2.maxs); var v66 = v2.temp ? true : false; var v54 = v2.game ? true : false; var v30 = v2.priv ? true : false; var v31 = Number(v2.ucnt); var v25 = Number(v2.scnt); var v72 = v2.lmb ? true : false; scope.roomList[v5] = new it.gotoandplay.smartfoxserver.Room(v24, v21, v22, v23, v66, v54, v30); scope.roomList[v5].userCount = v31; scope.roomList[v5].specCount = v25; scope.roomList[v5].setIsLimbo(v72); var v3 = v9[v43].vars.vars; var v36 = 0; while (v36 < v3.length) { var v28 = v3[v36].attributes.n; var v11 = v3[v36].attributes.t; var v10 = v3[v36].value; var v12; if (v11 == 'b') { v12 = Boolean; v10 = Number(v10); } else { if (v11 == 'n') { v12 = Number; } else { if (v11 == 's') { v12 = String; } else { if (v11 == 'x') { v12 = function (x) { return null; }; } } } } scope.roomList[v5].variables[v28] = v12(v10); ++v36; } } scope.onRoomListUpdate(scope.roomList); } else { if (v8 == 'joinOK') { var v48 = xmlObj.uLs.attributes.r; var v6 = xmlObj.uLs.uLs; var v15 = xmlObj.vars.vars; scope.activeRoomId = Number(v48); var v50 = scope.roomList[v48]; v50.userList = new Object(); scope.playerId = xmlObj.pid.attributes.id; v50.setMyPlayerIndex(xmlObj.pid.attributes.id); v50.variables = new Object(); var v36 = 0; while (v36 < v15.length) { var v28 = v15[v36].attributes.n; var v11 = v15[v36].attributes.t; var v10 = v15[v36].value; if (v11 == 'b') { var v12 = Boolean; v10 = Number(v10); } else { if (v11 == 'n') { var v12 = Number; } else { if (v11 == 's') { var v12 = String; } else { if (v11 == 'x') { var v12 = function (x) { return null; }; } } } } v50.variables[v28] = v12(v10); ++v36; } var v73 = 0; var v59 = 0; var v43 = 0; while (v43 < v6.length) { var v63 = v6[v43].n.value; var v69 = v6[v43].attributes.i; var v64 = v6[v43].attributes.m; var v76 = v6[v43].attributes.s; var v51 = v6[v43].attributes.p; var v37 = new it.gotoandplay.smartfoxserver.User(v69, v63); v50.userList[v69] = v37; v37.isMod = (v64 == '1') ? true : false; v37.isSpec = (v76 == '1') ? true : false; v37.pid = (v51 == undefined) ? -1 : v51; if (v50.isGame() && v76 == '1') { ++v59; } else { ++v73; } var v13 = v6[v43].vars.vars; v50.userList[v69].variables = {}; v36 = 0; while (v36 < v13.length) { v28 = v13[v36].attributes.n; v11 = v13[v36].attributes.t; v10 = v13[v36].value; if (v11 == 'b') { v12 = Boolean; v10 = Number(v10); } else { if (v11 == 'n') { v12 = Number; } else { if (v11 == 's') { v12 = String; } else { if (v11 == 'x') { v12 = function (x) { return null; }; } } } } v37.variables[v28] = v12(v10); ++v36; } ++v43; } v50.userCount = v73; v50.specCount = v59; scope.changingRoom = false; scope.onJoinRoom(scope.roomList[v48]); } else { if (v8 == 'joinKO') { scope.changingRoom = false; var v65 = xmlObj.error.attributes.msg; scope.onJoinRoomError(v65); } else { if (v8 == 'uER') { var v69 = xmlObj.u.attributes.i; var v63 = xmlObj.u.n.value; var v64 = xmlObj.u.attributes.m; var v76 = xmlObj.u.attributes.s; var v51 = xmlObj.u.attributes.p; var v50 = scope.roomList[v17]; var v37 = new it.gotoandplay.smartfoxserver.User(v69, v63); v50.userList[v69] = v37; v37.isMod = (v64 == '1') ? true : false; v37.isSpec = (v76 == '1') ? true : false; v37.pid = (v51 == undefined) ? -1 : v51; if (v50.isGame() && v76 == '1') { ++v50.specCount; } else { ++v50.userCount; } var v13 = xmlObj.u.vars.vars; v50.userList[v69].variables = {}; var v36 = 0; while (v36 < v13.length) { var v28 = v13[v36].attributes.n; var v11 = v13[v36].attributes.t; var v10 = v13[v36].value; if (v11 == 'b') { var v12 = Boolean; v10 = Number(v10); } else { if (v11 == 'n') { var v12 = Number; } else { if (v11 == 's') { var v12 = String; } else { if (v11 == 'x') { var v12 = function (x) { return null; }; } } } } v37.variables[v28] = v12(v10); ++v36; } scope.onUserEnterRoom(v17, v50.userList[v69]); } else { if (v8 == 'userGone') { var v69 = xmlObj.user.attributes.id; var v50 = scope.roomList[v17]; var v63 = v50.userList[v69].name; var v76 = v50.userList[v69].isSpec; delete v50.userList[v69]; if (v50.isGame() && v76) { --v50.specCount; } else { --v50.userCount; } scope.onUserLeaveRoom(v17, v69, v63); } else { if (v8 == 'pubMsg') { var v69 = xmlObj.user.attributes.id; var v47 = xmlObj.txt.value; v47 = scope.os.decodeEntities(v47.toString()); scope.onPublicMessage(v47.toString(), scope.roomList[v17].userList[v69], v17); } else { if (v8 == 'prvMsg') { var v69 = xmlObj.user.attributes.id; var v47 = xmlObj.txt.value; v47 = scope.os.decodeEntities(v47); scope.onPrivateMessage(v47.toString(), scope.roomList[v17].userList[v69], v69, v17); } else { if (v8 == 'dmnMsg') { var v69 = xmlObj.user.attributes.id; var v47 = xmlObj.txt.value; v47 = scope.os.decodeEntities(v47); scope.onAdminMessage(v47.toString(), scope.roomList[v17].userList[v69]); } else { if (v8 == 'modMsg') { var v69 = xmlObj.user.attributes.id; var v47 = xmlObj.txt.value; v47 = scope.os.decodeEntities(v47); scope.onModeratorMessage(v47.toString(), scope.roomList[v17].userList[v69]); } else { if (v8 == 'dataObj') { var v74 = xmlObj.user.attributes.id; var v60 = xmlObj.dataObj.value; var v61 = scope.os.deserialize(v60); scope.onObjectReceived(v61, scope.roomList[v17].userList[v74]); } else { if (v8 == 'uVarsUpdate') { var v69 = xmlObj.user.attributes.id; var v14 = xmlObj.vars.vars; var v46 = scope.roomList[v17].userList[v69]; if (v46.variables == undefined) { v46.variables = {}; } var v33 = []; var v36 = 0; while (v36 < v14.length) { var v28 = v14[v36].attributes.n; var v11 = v14[v36].attributes.t; var v10 = v14[v36].value; v33.push(v28); v33[v28] = true; if (v11 == 'x') { delete v46.variables[v28]; } else { if (v11 == 'b') { var v12 = Boolean; v10 = Number(v10); } else { if (v11 == 'n') { var v12 = Number; } else { if (v11 == 's') { var v12 = String; } } } v46.variables[v28] = v12(v10); } ++v36; } scope.globalUserVariableUpdate(v46); scope.onUserVariablesUpdate(v46, v33); } else { if (v8 == 'rVarsUpdate') { var v14 = xmlObj.vars.vars; var v50 = scope.roomList[v17]; var v33 = []; if (v50.variables == undefined) { v50.variables = new Object(); } var v36 = 0; while (v36 < v14.length) { var v28 = v14[v36].attributes.n; var v11 = v14[v36].attributes.t; var v10 = v14[v36].value; v33.push(v28); v33[v28] = true; if (v11 == 'x') { delete v50.variables[v28]; } else { if (v11 == 'b') { var v12 = Boolean; v10 = Number(v10); } else { if (v11 == 'n') { var v12 = Number; } else { if (v11 == 's') { var v12 = String; } } } v50.variables[v28] = v12(v10); } ++v36; } scope.onRoomVariablesUpdate(v50, v33); } else { if (v8 == 'createRmKO') { var v62 = xmlObj.room.attributes.e; scope.onCreateRoomError(v62); } else { if (v8 == 'uCount') { var v73 = xmlObj.attributes.u; var v59 = xmlObj.attributes.s; var v44 = scope.roomList[v17]; v44.userCount = Number(v73); v44.specCount = Number(v59); scope.onUserCountChange(v44); } else { if (v8 == 'roomAdd') { var v38 = xmlObj.rm.attributes; var v52 = v38.id; var v67 = xmlObj.rm.name.value; var v75 = Number(v38.max); var v58 = Number(v38.spec); var v66 = v38.temp ? true : false; var v54 = v38.game ? true : false; var v68 = v38.priv ? true : false; var v72 = v38.limbo ? true : false; var v35 = new it.gotoandplay.smartfoxserver.Room(v52, v67, v75, v58, v66, v54, v68); v35.setIsLimbo(v72); scope.roomList[v52] = v35; var v14 = xmlObj.rm.vars.vars; v35.variables = new Object(); var v36 = 0; while (v36 < v14.length) { var v28 = v14[v36].attributes.n; var v11 = v14[v36].attributes.t; var v10 = v14[v36].value; if (v11 == 'b') { var v12 = Boolean; v10 = Number(v10); } else { if (v11 == 'n') { var v12 = Number; } else { if (v11 == 's') { var v12 = String; } } } v35.variables[v28] = v12(v10); ++v36; } scope.onRoomAdded(v35); } else { if (v8 == 'roomDel') { var v53 = xmlObj.rm.attributes.id; var v55 = scope.roomList[v53]; delete scope.roomList[v53]; scope.onRoomDeleted(v55); } else { if (v8 == 'leaveRoom') { var v77 = xmlObj.rm.attributes.id; scope.onRoomLeft(v77); } else { if (v8 == 'roundTripRes') { scope.t2 = getTimer(); scope.onRoundTripResponse(scope.t2 - scope.t1); } else { if (v8 == 'swSpec') { var v42 = Number(xmlObj.pid.attributes.id); var v70 = Number(xmlObj.pid.attributes.u); if (v42 > 0) { ++scope.roomList[v17].userCount; --scope.roomList[v17].specCount; } if (!isNaN(v70)) { var v50 = scope.roomList[v17]; v50.userList[v70].pid = v42; v50.userList[v70].isSpec = false; } else { scope.playerId = v42; scope.onSpectatorSwitched(scope.playerId > 0, scope.playerId, scope.roomList[v17]); } } else { if (v8 == 'swPl') { var v42 = Number(xmlObj.pid.attributes.id); var v49 = xmlObj.pid.attributes.u == undefined; if (v42 == -1) { --scope.roomList[v17].userCount; ++scope.roomList[v17].specCount; if (!v49) { var v70 = Number(xmlObj.pid.attributes.u); var v46 = scope.roomList[v17].userList[v70]; if (v46 != undefined) { v46.isSpec = true; v46.pid = v42; } } } if (v49) { scope.playerId = v42; scope.onPlayerSwitched(v42 == -1, v42, scope.roomList[v17]); } } else { if (v8 == 'bList') { var v7 = xmlObj.bList.bList; if (v7 == undefined) { scope.onBuddyListError(xmlObj.err.value); return undefined; } var v18 = xmlObj.mv.mv; if (v18 != undefined) { for (var it in v18) { var v32 = v18[it].attributes.n; var v27 = v18[it].value; scope.myBuddyVars[v32] = v27; } } var v43 = 0; while (v43 < v7.length) { var v34 = {}; v34.isOnline = (v7[v43].attributes.s == '1') ? true : false; v34.name = v7[v43].n.value; v34.id = v7[v43].attributes.i; v34.isBlocked = (v7[v43].attributes.x == '1') ? true : false; v34.variables = {}; var v20 = v7[v43].vs.vs; for (var v36 in v20) { var v29 = v20[v36].attributes.n; var v26 = v20[v36].value; v34.variables[v29] = v26; } scope.buddyList.push(v34); ++v43; } scope.onBuddyList(scope.buddyList); } else { if (v8 == 'bUpd') { var v39 = false; var v41 = xmlObj.b; if (v41 == undefined) { scope.onBuddyListError(xmlObj.err.value); return undefined; } var v34 = {}; v34.name = v41.n.value; v34.id = v41.attributes.i; v34.isOnline = (v41.attributes.s == '1') ? true : false; v34.isBlocked = (v41.attributes.x == '1') ? true : false; var v20 = v41.vs.vs; var v16 = null; for (var it in scope.buddyList) { v16 = scope.buddyList[it]; if (v16.name == v34.name) { scope.buddyList[it] = v34; v34.isBlocked = v16.isBlocked; v34.variables = v16.variables; for (var v43 in v20) { var v29 = v20[v43].attributes.n; var v26 = v20[v43].value; v34.variables[v29] = v26; } v39 = true; break; } } if (v39) { scope.onBuddyListUpdate(v34); } } else { if (v8 == 'bAdd') { var v41 = xmlObj.b; var v34 = {}; v34.name = v41.n.value; v34.id = v41.attributes.i; v34.isOnline = (v41.attributes.s == '1') ? true : false; v34.isBlocked = (v41.attributes.x == '1') ? true : false; v34.variables = {}; var v20 = v41.vs.vs; for (var v43 in v20) { var v29 = v20[v43].attributes.n; var v26 = v20[v43].value; v34.variables[v29] = v26; } scope.buddyList.push(v34); scope.onBuddyList(scope.buddyList); } else { if (v8 == 'remB') { var v40 = xmlObj.n.value; var v34 = null; for (var it in scope.buddyList) { v34 = scope.buddyList[it]; if (v34.name == v40) { delete scope.buddyList[it]; scope.onBuddyList(scope.buddyList); break; } } } else { if (v8 == 'bPrm') { var v56 = xmlObj.n.value; var v45 = ''; if (xmlObj.txt != undefined) { v45 = scope.os.decodeEntities(v45); } scope.onBuddyPermissionRequest(v56, v45); } else { if (v8 == 'roomB') { var v71 = xmlObj.br.attributes.r; var v19 = (v71.toString()).split(','); for (var v43 in v19) { v19[v43] = Number(v19[v43]); } scope.onBuddyRoom(v19); } else { if (v8 == 'rndK') { var v57 = xmlObj.k.value; scope.onRandomKey(v57); } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } }; v2.handleExtensionMessages = function (dataObj, scope, type) { if (type == undefined) { type = 'xml'; } if (type == 'xml') { var v6 = dataObj.attributes.action; var v7 = dataObj.attributes.r; if (v6 == 'xtRes') { var v4 = dataObj.value; var v5 = scope.os.deserialize(v4); scope.onExtensionResponse(v5, type); } } else { if (type == 'str') { scope.onExtensionResponse(dataObj, type); } else { if (type == 'json') { scope.onExtensionResponse(dataObj.o, type); } } } }; v2.sendXtMessage = function (xtName, cmdName, paramObj, type, roomId) { if (!this.checkRoomList()) { return undefined; } if (roomId == undefined) { roomId = this.activeRoomId; } if (type == undefined) { type = 'xml'; } if (type == 'xml') { var v11; v11 = {'t': 'xt'}; var v10 = {'name': xtName, 'cmd': cmdName, 'param': paramObj}; var v12 = '<![CDATA[' + this.os.serialize(v10) + ']]>'; this.send(v11, 'xtReq', roomId, v12); } else { if (type == 'str') { var v4; v4 = this.rawProtocolSeparator + 'xt' + this.rawProtocolSeparator + xtName + this.rawProtocolSeparator + cmdName + this.rawProtocolSeparator + roomId + this.rawProtocolSeparator; var v2 = 0; while (v2 < paramObj.length) { v4 += paramObj[v2].toString() + this.rawProtocolSeparator; ++v2; } this.sendString(v4); } else { if (type == 'json') { var v5 = {}; v5.x = xtName; v5.c = cmdName; v5.r = roomId; v5.p = paramObj; var v6 = {}; v6.t = 'xt'; v6.b = v5; try { var v13 = it.gotoandplay.smartfoxserver.JSON.stringify(v6); this.sendJson(v13); } catch (ex) { if (this.debug) { trace('Error in sending JSON message.'); trace(ex.name + ' : ' + ex.message + ' : ' + ex.at + ' : ' + ex.text); } } } } } }; v2.dumpObj = function (obj, depth) { if (depth == undefined) { depth = 0; } if (this.debug) { if (depth == 0) { trace('+-----------------------------------------------+'); trace('+ Object Dump +'); trace('+-----------------------------------------------+'); } for (var v8 in obj) { var v4 = obj[v8]; var v5 = typeof v4; if (v5 != 'object') { var v3 = ''; var v2 = 0; while (v2 < depth) { v3 += '\t'; ++v2; } v3 += v8 + ' : ' + v4 + ' ( ' + v5 + ' )'; trace(v3); } else { this.dumpObj(v4, depth + 1); } } } }; v2.login = function (zone, name, pass) { var v3 = {'t': 'sys'}; var v2 = '<login z=\'' + zone + '\'><nick><![CDATA[' + name + ']]></nick><pword><![CDATA[' + pass + ']]></pword></login>'; this.send(v3, 'login', 0, v2); }; v2.logout = function () { var v2 = {'t': 'sys'}; this.send(v2, 'logout', -1, ''); }; v2.getRoomList = function () { var v2 = {'t': 'sys'}; this.send(v2, 'getRmList', this.activeRoomId ? this.activeRoomId : -1, ''); }; v2.autoJoin = function () { if (!this.checkRoomList()) { return undefined; } var v2 = {'t': 'sys'}; this.send(v2, 'autoJoin', this.activeRoomId ? this.activeRoomId : -1, ''); }; v2.joinRoom = function (newRoom, pword, isSpectator, dontLeave, oldRoom) { if (!this.checkRoomList()) { return undefined; } var v2 = null; var v7; if (isSpectator) { v7 = 1; } else { v7 = 0; } if (!this.changingRoom) { if (typeof newRoom == 'number') { v2 = newRoom; } else { for (var v4 in this.roomList) { if (this.roomList[v4].name == newRoom) { v2 = this.roomList[v4].id; break; } } } if (v2 != null) { var v9 = {'t': 'sys'}; var v6 = dontLeave ? '0' : '1'; var v5; if (oldRoom) { v5 = oldRoom; } else { v5 = this.activeRoomId; } if (this.activeRoomId == null) { v6 = '0'; v5 = -1; } var v8 = '<room id=\'' + v2 + '\' pwd=\'' + pword + '\' spec=\'' + v7 + '\' leave=\'' + v6 + '\' old=\'' + v5 + '\' />'; this.send(v9, 'joinRoom', this.activeRoomId ? this.activeRoomId : -1, v8); this.changingRoom = true; } else { trace('SmartFoxError: requested room to join does not exist!'); } } }; v2.sendBuddyPermissionResponse = function (allowBuddy, targetBuddy) { var v2 = '<n res=\'' + (allowBuddy ? 'g' : 'r') + '\'><![CDATA[' + targetBuddy + ']]></n>'; this.send({'t': 'sys'}, 'bPrm', -1, v2); }; v2.sendPublicMessage = function (message, roomId) { if (!this.checkRoomList() || !this.checkJoin()) { return undefined; } if (roomId == undefined) { roomId = this.activeRoomId; } var v2 = {'t': 'sys'}; var v3 = '<txt><![CDATA[' + this.os.encodeEntities(message) + ']]></txt>'; this.send(v2, 'pubMsg', roomId, v3); }; v2.sendPrivateMessage = function (message, recipientId, roomId) { if (!this.checkRoomList() || !this.checkJoin()) { return undefined; } if (roomId == undefined) { roomId = this.activeRoomId; } var v2 = {'t': 'sys'}; var v3 = '<txt rcp=\'' + recipientId + '\'><![CDATA[' + this.os.encodeEntities(message) + ']]></txt>'; this.send(v2, 'prvMsg', roomId, v3); }; v2.sendModeratorMessage = function (message, type, id) { if (!this.checkRoomList() || !this.checkJoin()) { return undefined; } var v2 = {'t': 'sys'}; var v3 = '<txt t=\'' + type + '\' id=\'' + id + '\'><![CDATA[' + this.os.encodeEntities(message) + ']]></txt>'; this.send(v2, 'modMsg', this.activeRoomId, v3); }; v2.sendObject = function (obj, roomId) { if (!this.checkRoomList() || !this.checkJoin()) { return undefined; } if (roomId == undefined) { roomId = this.activeRoomId; } var v2 = '<![CDATA[' + this.os.serialize(obj) + ']]>'; var v3 = {'t': 'sys'}; this.send(v3, 'asObj', roomId, v2); }; v2.sendObjectToGroup = function (obj, userList, roomId) { if (!this.checkRoomList() || !this.checkJoin()) { return undefined; } if (roomId == undefined) { roomId = this.activeRoomId; } var v3 = ''; for (var v4 in userList) { if (!isNaN(userList[v4])) { v3 += userList[v4] + ','; } } v3 = v3.substr(0, v3.length - 1); obj._$$_ = v3; var v5 = '<![CDATA[' + this.os.serialize(obj) + ']]>'; var v6 = {'t': 'sys'}; this.send(v6, 'asObjG', roomId, v5); }; v2.setBuddyBlockStatus = function (buddyName, status) { var v2 = this.getBuddyByName(buddyName); if (v2 != null) { if (v2.blocked != status) { v2.isBlocked = status; var v3 = '<n x=\'' + (status ? '1' : '0') + '\'><![CDATA[' + buddyName + ']]></n>'; this.send({'t': 'sys'}, 'setB', -1, v3); this.onBuddyListUpdate(v2); } } }; v2.setUserVariables = function (varObj, roomId) { if (!this.checkRoomList() || !this.checkJoin()) { return undefined; } if (roomId == undefined) { roomId = this.activeRoomId; } var v9 = {'t': 'sys'}; var v6 = '<vars>'; var v4 = this.roomList[roomId].userList[this.myUserId]; for (var v7 in varObj) { var v2 = varObj[v7]; var v3 = null; if (typeof v2 == 'boolean') { v3 = 'b'; v2 = v2 ? 1 : 0; } else { if (typeof v2 == 'number') { v3 = 'n'; } else { if (typeof v2 == 'string') { v3 = 's'; } else { if (typeof v2 == 'null') { v3 = 'x'; delete v4.variables[v7]; } } } } if (v3 != null) { v4.variables[v7] = v2; v6 += '<var n=\'' + v7 + '\' t=\'' + v3 + '\'><![CDATA[' + v2 + ']]></var>'; } } v6 += '</vars>'; v4.setVariables(varObj); this.send(v9, 'setUvars', roomId, v6); }; v2.setBuddyVariables = function (varList) { var v6 = {'t': 'sys'}; var v4 = '<vars>'; for (var v5 in varList) { var v2 = varList[v5]; if (this.myBuddyVars[v5] != v2) { this.myBuddyVars[v5] = v2; v4 += '<var n=\'' + v5 + '\'><![CDATA[' + v2 + ']]></var>'; } } v4 += '</vars>'; this.send(v6, 'setBvars', -1, v4); }; v2.dumpRoomList = function () { for (var v5 in this.roomList) { var v2 = this.roomList[v5]; trace('\n'); trace('-------------------------------------'); trace(' > Room: (' + v5 + ') - ' + v2.getName()); trace('isTemp: ' + v2.isTemp()); trace('isGame: ' + v2.isGame()); trace('isPriv: ' + v2.isPrivate()); trace('Users: ' + v2.getUserCount() + ' / ' + v2.getMaxUsers()); trace('Variables: '); for (var v4 in v2.variables) { trace('\t' + v4 + ' = ' + v2.getVariable(v4)); } trace('\rUserList: '); var v3 = v2.getUserList(); for (v4 in v3) { trace('\t' + v3[v4].getId() + ' > ' + v3[v4].getName()); } } }; v2.createRoom = function (roomObj, roomId) { if (!this.checkRoomList() || !this.checkJoin()) { return undefined; } if (roomId == undefined) { roomId = this.activeRoomId; } var v8 = {'t': 'sys'}; var v5 = roomObj.isGame ? 1 : 0; var v6 = 1; var v9 = roomObj.maxSpectators; var v7 = roomObj.joinAsSpectator ? '1' : '0'; if (v5 && roomObj.exitCurrentRoom != undefined) { v6 = roomObj.exitCurrentRoom ? 1 : 0; } var v3 = '<room tmp=\'1\' gam=\'' + v5 + '\' spec=\'' + v9 + '\' exit=\'' + v6 + '\' jas=\'' + v7 + '\'>'; v3 += '<name><![CDATA[' + roomObj.name + ']]></name>'; v3 += '<pwd><![CDATA[' + ((roomObj.password == undefined) ? '' : roomObj.password) + ']]></pwd>'; v3 += '<max>' + roomObj.maxUsers + '</max>'; if (roomObj.uCount != undefined) { v3 += '<uCnt>' + (roomObj.uCount ? '1' : '0') + '</uCnt>'; } if (roomObj.extension != undefined) { v3 += '<xt n=\'' + roomObj.extension.name; v3 += '\' s=\'' + roomObj.extension.script + '\' />'; } if (roomObj.vars == undefined) { v3 += '<vars></vars>'; } else { v3 += '<vars>'; for (var v4 in roomObj.vars) { v3 += this.getXmlRoomVariable(roomObj.vars[v4]); } v3 += '</vars>'; } v3 += '</room>'; this.send(v8, 'createRoom', roomId, v3); }; v2.leaveRoom = function (roomId) { if (!this.checkRoomList() || !this.checkJoin()) { return undefined; } var v3 = {'t': 'sys'}; var v2 = '<rm id=\'' + roomId + '\' />'; this.send(v3, 'leaveRoom', roomId, v2); }; v2.getRoom = function (roomId) { if (!this.checkRoomList()) { return undefined; } if (typeof roomId == 'number') { return this.roomList[roomId]; } else { if (typeof roomId == 'string') { for (var v4 in this.roomList) { var v2 = this.roomList[v4]; if (v2.getName() == roomId) { return v2; } } } } }; v2.getActiveRoom = function () { if (!this.checkRoomList() || !this.checkJoin()) { return null; } return this.roomList[this.activeRoomId]; }; v2.setRoomVariables = function (varList, roomId, setOwnership) { if (!this.checkRoomList() || !this.checkJoin()) { return undefined; } if (roomId == undefined) { roomId = this.activeRoomId; } if (setOwnership == undefined) { setOwnership = true; } var v5 = {'t': 'sys'}; var v4; if (setOwnership) { v4 = '<vars>'; } else { v4 = '<vars so=\'0\'>'; } var v2 = 0; while (v2 < varList.length) { v4 += this.getXmlRoomVariable(varList[v2]); ++v2; } v4 += '</vars>'; this.send(v5, 'setRvars', roomId, v4); }; v2.getXmlRoomVariable = function (rVar) { var v5 = rVar.name; var v1 = rVar.val; var v6 = rVar.priv ? '1' : '0'; var v4 = rVar.persistent ? '1' : '0'; var v2 = null; if (typeof v1 == 'boolean') { v2 = 'b'; v1 = v1 ? 1 : 0; } else { if (typeof v1 == 'number') { v2 = 'n'; } else { if (typeof v1 == 'string') { v2 = 's'; } else { if (typeof v1 == 'null') { v2 = 'x'; } } } } if (v2 != null) { return '<var n=\'' + v5 + '\' t=\'' + v2 + '\' pr=\'' + v6 + '\' pe=\'' + v4 + '\'><![CDATA[' + v1 + ']]></var>'; } else { return ''; } }; v2.loadBuddyList = function () { var v2 = {'t': 'sys'}; this.send(v2, 'loadB', -1, ''); }; v2.addBuddy = function (buddyName) { if (buddyName != this.myUserName && !this.checkBuddy(buddyName)) { var v6 = (this.roomList[this.activeRoomId].getUserList()).getUser(buddyName); var v4 = {'t': 'sys'}; var v3 = '<n>' + buddyName + '</n>'; this.send(v4, 'addB', -1, v3); } }; v2.removeBuddy = function (buddyName) { for (var v3 in this.buddyList) { if (this.buddyList[v3].name == buddyName) { delete this.buddyList[v3]; break; } } var v5 = {'t': 'sys'}; var v4 = '<n>' + buddyName + '</n>'; this.send(v5, 'remB', -1, v4); this.onBuddyList(this.buddyList); }; v2.getBuddyByName = function (buddyName) { var v2; for (var v4 in this.buddyList) { v2 = this.buddyList[v4]; if (v2.name == buddyName) { return v2; } } return null; }; v2.getBuddyById = function (id) { var v2; for (var v4 in this.buddyList) { v2 = this.buddyList[v4]; if (v2.id == id) { return v2; } } return null; }; v2.getBuddyRoom = function (buddy) { if (buddy.id != -1) { this.send({'t': 'sys'}, 'roomB', -1, '<b id=\'' + buddy.id + '\' />'); } }; v2.checkBuddy = function (name) { var v2 = false; for (var v4 in this.buddyList) { if (this.buddyList[v4].name == name) { v2 = true; break; } } return v2; }; v2.clearBuddyList = function () { this.buddyList = []; this.send({'t': 'sys'}, 'clearB', -1, ''); this.onBuddyList(this.buddyList); }; v2.roundTripBench = function () { this.t1 = getTimer(); var v2 = {'t': 'sys'}; this.send(v2, 'roundTrip', this.activeRoomId, ''); }; v2.switchSpectator = function (roomId) { if (!this.checkRoomList() || !this.checkJoin()) { return undefined; } if (roomId == undefined) { roomId = this.activeRoomId; } var v2 = {'t': 'sys'}; this.send(v2, 'swSpec', roomId, ''); }; v2.switchPlayer = function (roomId) { if (!this.checkRoomList() || !this.checkJoin()) { return undefined; } if (roomId == undefined) { roomId = this.activeRoomId; } var v2 = {'t': 'sys'}; this.send(v2, 'swPl', roomId, ''); }; v2.getRandomKey = function () { this.send({'t': 'sys'}, 'rndK', -1, ''); }; v2.send = function (header, action, fromRoom, message) { var v3 = this.makeHeader(header); v3 += '<body action=\'' + action + '\' r=\'' + fromRoom + '\'>' + message + '</body>' + this.closeHeader(); if (this.debug) { trace('[Sending]: ' + v3 + '\n'); } if (this.isHttpMode) { this.httpConnection.send(v3); } else { super.send(v3); } }; v2.uploadFile = function (fileRef, id, nick, port) { if (id == undefined) { id = this.myUserId; } if (nick == undefined) { nick = this.myUserName; } if (port == undefined) { port = this.httpPort; } fileRef.upload('http://' + this.ipAddress + ':' + port + '/default/Upload.py?id=' + id + '&nick=' + nick); if (this.debug) { trace('[UPLOAD]: http://' + this.ipAddress + ':' + port + '/default/Upload.py?id=' + id + '&nick=' + nick); } }; v2.getUploadPath = function () { return 'http://' + this.ipAddress + ':' + this.httpPort + '/default/uploads/'; }; v2.sendString = function (message) { if (this.debug) { trace('[Sending]: ' + message + '\n'); } if (this.isHttpMode) { this.httpConnection.send(message); } else { super.send(message); } }; v2.sendJson = function (message) { if (this.debug) { trace('[Sending - json]: ' + message + '\n'); } if (this.isHttpMode) { this.httpConnection.send(message); } else { super.send(message); } }; v2.gotData = function (message) { if (message.charAt(0) == this.rawProtocolSeparator) { this.strReceived(message); } else { if (message.charAt(0) == '<') { this.onXML(new XML(message)); } else { if (message.charAt(0) == '{') { this.jsonReceived(message); } } } }; v2.connectionEstablished = function (ok) { if (ok) { clearInterval(this.socketConnectionTimeoutThread); this.preConnection = false; var v3 = {'t': 'sys'}; var v2 = '<ver v=\'' + this.majVersion.toString() + this.minVersion.toString() + this.subVersion.toString() + '\' />'; this.send(v3, 'verChk', 0, v2); } else { if (this.smartConnect && this.preConnection) { if (this.debug) { trace('** Socket connection failed. Trying BlueBox **'); } this.isHttpMode = true; var v4 = (this.blueBoxIpAddress != null) ? this.blueBoxIpAddress : this.ipAddress; var v5 = (this.blueBoxPort != 0) ? this.blueBoxPort : this.httpPort; this.httpConnection.connect(v4, v5); } else { this.preConnection = false; this.onConnection(false); } } }; v2.connectionClosed = function () { this.isConnected = false; if (this.preConnection) { this.connectionEstablished(false); } else { this.initialize(); this.onConnectionLost(); } }; v2.connect = function (ipAdr, port) { if (!this.isConnected) { this.ipAddress = ipAdr; this.port = port; super.connect(ipAdr, port); this.socketConnectionTimeoutThread = setInterval(mx.utils.Delegate.create(this, this.socketTimeoutHandler), this.socketConnectionTimeout); } else { trace('WARNING! You\'re already connected to -> ' + this.ipAddress + ':' + this.port); } }; v2.disconnect = function () { this.close(); this.isConnected = false; if (this.isHttpMode) { this.httpConnection.close(); } this.initialize(); this.onConnectionLost(); }; v2.xmlReceived = function (message) { var v2 = new Object(); this.message2Object(message.childNodes, v2); if (this.debug) { trace('[Received]: ' + message); } var v3 = v2.msg.attributes.t; this.messageHandlers[v3].handleMessage(v2.msg.body, this, 'xml'); }; v2.socketTimeoutHandler = function () { clearInterval(this.socketConnectionTimeoutThread); this.close(); }; v2.globalUserVariableUpdate = function (user) { var v5 = user.getId(); for (var v6 in this.roomList) { var v3 = this.roomList[v6]; var v2 = v3.getUser(v5); if (v2 != undefined && v2 != user) { v2.variables = user.variables; } } }; v2.checkRoomList = function () { var v4 = true; var v2 = 0; for (var v3 in this.roomList) { ++v2; break; } if (v2 == 0) { v4 = false; this.errorTrace('The room list is empty!\nThe client API cannot function properly until the room list is populated.\nPlease consult the documentation for more infos.'); } return v4; }; v2.checkJoin = function () { var v2 = true; if (this.activeRoomId < 0) { v2 = false; this.errorTrace('You haven\'t joined any rooms!\nIn order to interact with the server you should join at least one room.\nPlease consult the documentation for more infos.'); } return v2; }; v2.errorTrace = function (msg) { trace('\n****************************************************************'); trace('Internal error:'); trace(msg); trace('****************************************************************'); }; v2.strReceived = function (message) { var v2 = (message.substr(1, message.length - 2)).split(this.rawProtocolSeparator); if (this.debug) { trace('[Received - Str]: ' + message); } var v4 = v2[0]; this.messageHandlers[v4].handleMessage(v2.splice(1, v2.length - 1), this, 'str'); }; v2.jsonReceived = function (message) { var v2 = it.gotoandplay.smartfoxserver.JSON.parse(message); if (this.debug) { trace('[Received - json]: ' + message); } var v3 = v2.t; this.messageHandlers[v3].handleMessage(v2.b, this, 'json'); }; v2.message2Object = function (xmlNodes, parentObj) { var v8 = 0; var v3 = null; while (v8 < xmlNodes.length) { var v4 = xmlNodes[v8]; var v5 = v4.nodeName; var v6 = v4.nodeValue; if (parentObj instanceof Array) { v3 = {}; parentObj.push(v3); v3 = parentObj[parentObj.length - 1]; } else { parentObj[v5] = new Object(); v3 = parentObj[v5]; } for (var v11 in v4.attributes) { if (typeof v3.attributes == 'undefined') { v3.attributes = {}; } var v2 = v4.attributes[v11]; if (!isNaN(Number(v2))) { v2 = Number(v2); } if (v2.toLowerCase() == 'true') { v2 = true; } else { if (v2.toLowerCase() == 'false') { v2 = false; } } v3.attributes[v11] = v2; } if (this.arrayTags[v5]) { v3[v5] = []; v3 = v3[v5]; } if (v4.hasChildNodes() && v4.firstChild.nodeValue == undefined) { var v9 = v4.childNodes; this.message2Object(v9, v3); } else { v6 = v4.firstChild.nodeValue; if (!isNaN(v6) && v4.nodeName != 'txt' && v4.nodeName != 'var') { v6 = Number(v6); } v3.value = v6; } ++v8; } }; v2.makeHeader = function (headerObj) { var v2 = '<msg'; for (var v3 in headerObj) { v2 += ' ' + v3 + '=\'' + headerObj[v3] + '\''; } v2 += '>'; return v2; }; v2.closeHeader = function () { return '</msg>'; }; v2.handleDelayedPoll = function () { this.httpConnection.send(it.gotoandplay.smartfoxserver.SmartFoxClient.HTTP_POLL_REQUEST); if (this.fpMajorVersion < 8) { clearInterval(this.pollingThread); } }; v2.handleHttpConnect = function (params) { this.isConnected = true; this.preConnection = false; this.connectionEstablished(true); this.httpConnection.send(it.gotoandplay.smartfoxserver.SmartFoxClient.HTTP_POLL_REQUEST); }; v2.handleHttpClose = function (params) { this.initialize(); this.onConnectionLost(); }; v2.handleHttpData = function (params) { var v5 = params.data; var v4 = v5.split('\n'); var v3; var v2 = 0; while (v2 < v4.length - 1) { v3 = v4[v2]; if (v3.length > 0) { this.gotData(v3); } ++v2; } if (this._httpPollSpeed > 0) { this.pollingThread = this.pollingDelayFn(mx.utils.Delegate.create(this, this.handleDelayedPoll), this._httpPollSpeed); } else { this.httpConnection.send(it.gotoandplay.smartfoxserver.SmartFoxClient.HTTP_POLL_REQUEST); } }; v2.handleHttpError = function (params) { if (!this.isConnected) { this.onConnection(false); } else { this.connectionClosed(); } }; v1.MIN_POLL_SPEED = 0; v1.DEFAULT_POLL_SPEED = 750; v1.MAX_POLL_SPEED = 10000; v1.HTTP_POLL_REQUEST = 'poll'; v1.MODMSG_TO_USER = 'u'; v1.MODMSG_TO_ROOM = 'r'; v1.MODMSG_TO_ZONE = 'z'; v1.PROTOCOL_XML = 'xml'; v1.PROTOCOL_STR = 'str'; v1.PROTOCOL_JSON = 'json'; v1.CONNECTION_MODE_DISCONNECTED = 'disconnected'; v1.CONNECTION_MODE_SOCKET = 'socket'; v1.CONNECTION_MODE_HTTP = 'http'; v2.DEFAULT_CONFIG_FILE = 'config.xml'; v2.DEFAULT_AUTO_CONNECT = true; v2.majVersion = 1; v2.minVersion = 5; v2.subVersion = 8; v2.autoConnectOnConfigSuccess = true; v2.defaultZone = ''; v2.httpPort = 8080; v2.rawProtocolSeparator = '%'; v2.blueBoxPort = 0; v2.smartConnect = true; v2.socketConnectionTimeout = 5000; v2.isHttpMode = false; v2._httpPollSpeed = it.gotoandplay.smartfoxserver.SmartFoxClient.DEFAULT_POLL_SPEED; v2.pollingThread = -1; v2.preConnection = true; v2.addProperty('httpPollSpeed', v2.__get__httpPollSpeed, v2.__set__httpPollSpeed); ASSetPropFlags(it.gotoandplay.smartfoxserver.SmartFoxClient.prototype, null, 1); } #endinitclip } movieClip 438 __Packages.it.gotoandplay.smartfoxserver.ObjectSerializer { #initclip if (!_global.it) { _global.it = new Object(); } if (!_global.it.gotoandplay) { _global.it.gotoandplay = new Object(); } if (!_global.it.gotoandplay.smartfoxserver) { _global.it.gotoandplay.smartfoxserver = new Object(); } if (!_global.it.gotoandplay.smartfoxserver.ObjectSerializer) { var v1 = function () { this.init(); }; it.gotoandplay.smartfoxserver.ObjectSerializer = v1; var v2 = v1.prototype; v1.getInstance = function () { if (it.gotoandplay.smartfoxserver.ObjectSerializer.__instance == null) { it.gotoandplay.smartfoxserver.ObjectSerializer.__instance = new it.gotoandplay.smartfoxserver.ObjectSerializer(); } return it.gotoandplay.smartfoxserver.ObjectSerializer.__instance; }; v2.init = function () { this.tabs = '\t\t\t\t\t\t\t\t\t\t'; this.xmlStr = ''; this.debug = false; this.eof = ''; this.ascTab = []; this.ascTab.> = '&gt;'; this.ascTab.< = '&lt;'; this.ascTab.& = '&amp;'; this.ascTab.\' = '&apos;'; this.ascTab." = '&quot;'; this.ascTabRev = []; this.ascTabRev.&gt; = '>'; this.ascTabRev.&lt; = '<'; this.ascTabRev.&amp; = '&'; this.ascTabRev.&apos; = '\''; this.ascTabRev.&quot; = '"'; this.hexTable = new Array(); this.hexTable.0 = 0; this.hexTable.1 = 1; this.hexTable.2 = 2; this.hexTable.3 = 3; this.hexTable.4 = 4; this.hexTable.5 = 5; this.hexTable.6 = 6; this.hexTable.7 = 7; this.hexTable.8 = 8; this.hexTable.9 = 9; this.hexTable.A = 10; this.hexTable.B = 11; this.hexTable.C = 12; this.hexTable.D = 13; this.hexTable.E = 14; this.hexTable.F = 15; }; v2.serialize = function (obj) { var v2 = {}; v2.xmlStr = ''; if (this.debug) { this.eof = '\n'; } this.obj2xml(v2, obj, 0, ''); return v2.xmlStr; }; v2.obj2xml = function (envelope, obj, lev, objn) { if (lev == 0) { envelope.xmlStr += '<dataObj>' + this.eof; } else { if (this.debug) { envelope.xmlStr += this.tabs.substr(0, lev); } var v8 = obj instanceof Array ? 'a' : 'o'; envelope.xmlStr += '<obj t=\'' + v8 + '\' o=\'' + objn + '\'>' + this.eof; } for (var v7 in obj) { var v2 = typeof obj[v7]; var v3 = obj[v7]; if (v2 == 'boolean' || v2 == 'number' || v2 == 'string' || v2 == 'null') { if (v2 == 'boolean') { v3 = Number(v3); } else { if (v2 == 'null') { v2 = 'x'; v3 = ''; } else { if (v2 == 'string') { v3 = this.encodeEntities(v3); } } } if (this.debug) { envelope.xmlStr += this.tabs.substr(0, lev + 1); } envelope.xmlStr += '<var n=\'' + v7 + '\' t=\'' + v2.substr(0, 1) + '\'>' + v3 + '</var>' + this.eof; } else { if (v2 == 'object') { this.obj2xml(envelope, v3, lev + 1, v7); if (this.debug) { envelope.xmlStr += this.tabs.substr(0, lev + 1); } envelope.xmlStr += '</obj>' + this.eof; } } } if (lev == 0) { envelope.xmlStr += '</dataObj>' + this.eof; } }; v2.deserialize = function (xmlObj) { var v3 = new XML(xmlObj); v3.ignoreWhite = true; var v2 = new Object(); this.xml2obj(v3, v2); return v2; }; v2.xml2obj = function (xmlNode, currObj) { var v2 = 0; var v3 = xmlNode.firstChild; while (v3.childNodes[v2]) { if (v3.childNodes[v2].nodeName == 'obj') { var v9 = v3.childNodes[v2].attributes.o; var v7 = v3.childNodes[v2].attributes.t; if (v7 == 'a') { currObj[v9] = []; } else { if (v7 == 'o') { currObj[v9] = {}; } } this.xml2obj(new XML(v3.childNodes[v2]), currObj[v9]); } else { var v9 = v3.childNodes[v2].attributes.n; var v4 = v3.childNodes[v2].attributes.t; var v8 = v3.childNodes[v2].firstChild.nodeValue; var v5; if (v4 == 'b') { v5 = function (b) { return Boolean(Number(b)); }; } else { if (v4 == 'n') { v5 = Number; } else { if (v4 == 's') { v5 = String; } else { if (v4 == 'x') { v5 = function (x) { return null; }; } } } } currObj[v9] = v5(v8); } ++v2; } }; v2.encodeEntities = function (st) { var v5 = ''; var v4 = 0; while (v4 < st.length) { var v3 = st.charAt(v4); var v2 = st.charCodeAt(v4); if (v2 == 9 || v2 == 10 || v2 == 13) { v5 += v3; } else { if (v2 >= 32 && v2 <= 126) { if (this.ascTab[v3] != undefined) { v5 += this.ascTab[v3]; } else { v5 += v3; } } else { v5 += v3; } } ++v4; } return v5; }; v2.decodeEntities = function (st) { var v7; var v6; var v5; var v3; var v8; var v2 = 0; v7 = ''; while (v2 < st.length) { v6 = st.charAt(v2); if (v6 == '&') { v5 = v6; do { ++v2; v3 = st.charAt(v2); v5 += v3; } while (v3 != ';' && v2 < st.length); v8 = this.ascTabRev[v5]; if (v8 != undefined) { v7 += v8; } else { v7 += String.fromCharCode(this.getCharCode(v5)); } } else { v7 += v6; } ++v2; } return v7; }; v2.getCharCode = function (ent) { var v1 = ent.substr(3, ent.length); v1 = v1.substr(0, v1.length - 1); return Number('0x' + v1); }; ASSetPropFlags(it.gotoandplay.smartfoxserver.ObjectSerializer.prototype, null, 1); } #endinitclip } movieClip 439 __Packages.it.gotoandplay.smartfoxserver.http.HttpConnection { #initclip if (!_global.it) { _global.it = new Object(); } if (!_global.it.gotoandplay) { _global.it.gotoandplay = new Object(); } if (!_global.it.gotoandplay.smartfoxserver) { _global.it.gotoandplay.smartfoxserver = new Object(); } if (!_global.it.gotoandplay.smartfoxserver.http) { _global.it.gotoandplay.smartfoxserver.http = new Object(); } if (!_global.it.gotoandplay.smartfoxserver.http.HttpConnection) { var v1 = function (httpConnectHandler, httpCloseHandler, httpDataHandler, httpErrorHandler) { this.codec = new it.gotoandplay.smartfoxserver.http.RawProtocolCodec(); this.handlers = []; this.handlers[it.gotoandplay.smartfoxserver.http.HttpConnection.onHttpConnect] = httpConnectHandler; this.handlers[it.gotoandplay.smartfoxserver.http.HttpConnection.onHttpClose] = httpCloseHandler; this.handlers[it.gotoandplay.smartfoxserver.http.HttpConnection.onHttpData] = httpDataHandler; this.handlers[it.gotoandplay.smartfoxserver.http.HttpConnection.onHttpError] = httpErrorHandler; }; it.gotoandplay.smartfoxserver.http.HttpConnection = v1; var v2 = v1.prototype; v2.getSessionId = function () { return this.sessionId; }; v2.isConnected = function () { return this.connected; }; v2.connect = function (addr, port) { if (port == undefined) { port = 8080; } this.ipAddr = addr; this.port = port; this.webUrl = 'http://' + this.ipAddr + ':' + this.port + '/' + it.gotoandplay.smartfoxserver.http.HttpConnection.servletUrl; this.sessionId = null; this.loaderFactory = new it.gotoandplay.smartfoxserver.http.LoaderFactory(this, this.handleResponse, this.webUrl, it.gotoandplay.smartfoxserver.http.HttpConnection.paramName); this.send(it.gotoandplay.smartfoxserver.http.HttpConnection.HANDSHAKE); }; v2.close = function () { this.send(it.gotoandplay.smartfoxserver.http.HttpConnection.DISCONNECT); }; v2.send = function (message) { if (this.connected || !this.connected && message == it.gotoandplay.smartfoxserver.http.HttpConnection.HANDSHAKE || !this.connected && message == 'poll') { if (message != 'poll') { trace('[ Send ]: ' + this.codec.encode(this.sessionId, message)); } this.loaderFactory.sendAndLoad(this.codec.encode(this.sessionId, message)); } }; v2.handleResponse = function (data) { var v2 = this._classRef; if (data != undefined) { var v3 = {}; if (data.charAt(0) == it.gotoandplay.smartfoxserver.http.HttpConnection.HANDSHAKE_TOKEN) { if (v2.sessionId == null) { v2.sessionId = v2.codec.decode(data); v2.connected = true; v3.sessionId = v2.sessionId; v3.success = true; v2.dispatchEvent(it.gotoandplay.smartfoxserver.http.HttpConnection.onHttpConnect, v3); } else { trace('**ERROR** SessionId is being rewritten'); } } else { if (data.indexOf(it.gotoandplay.smartfoxserver.http.HttpConnection.CONN_LOST) == 0) { v3.data = {}; v2.dispatchEvent(it.gotoandplay.smartfoxserver.http.HttpConnection.onHttpClose, v3); } else { v3.data = data; v2.dispatchEvent(it.gotoandplay.smartfoxserver.http.HttpConnection.onHttpData, v3); } } } else { if (!v2.connected) { v2.handleIOError('I/O error: null response from server'); } } }; v2.handleIOError = function (error) { var v2 = {}; v2.message = error; this.dispatchEvent(it.gotoandplay.smartfoxserver.http.HttpConnection.onHttpError, v2); }; v2.dispatchEvent = function (type, params) { this.handlers[type](params); }; v1.HANDSHAKE = 'connect'; v1.DISCONNECT = 'disconnect'; v1.CONN_LOST = 'ERR#01'; v1.HANDSHAKE_TOKEN = '#'; v1.servletUrl = 'BlueBox/HttpBox.do'; v1.paramName = 'sfsHttp'; v1.onHttpData = 'onHttpData'; v1.onHttpError = 'onHttpError'; v1.onHttpConnect = 'onHttpConnect'; v1.onHttpClose = 'onHttpClose'; v2.connected = false; ASSetPropFlags(it.gotoandplay.smartfoxserver.http.HttpConnection.prototype, null, 1); } #endinitclip } movieClip 440 __Packages.it.gotoandplay.smartfoxserver.http.LoaderFactory { #initclip if (!_global.it) { _global.it = new Object(); } if (!_global.it.gotoandplay) { _global.it.gotoandplay = new Object(); } if (!_global.it.gotoandplay.smartfoxserver) { _global.it.gotoandplay.smartfoxserver = new Object(); } if (!_global.it.gotoandplay.smartfoxserver.http) { _global.it.gotoandplay.smartfoxserver.http = new Object(); } if (!_global.it.gotoandplay.smartfoxserver.http.LoaderFactory) { var v1 = function (httpConnection, responseHandler, _webUrl, _loaderParamName, _poolSize) { if (_poolSize > 0) { this.poolSize = _poolSize; } else { this.poolSize = it.gotoandplay.smartfoxserver.http.LoaderFactory.DEFAULT_POOL_SIZE; } this.webUrl = _webUrl; this.loaderParamName = _loaderParamName; this.sendersPool = []; this.loadersPool = []; var v3 = 0; while (v3 < this.poolSize) { var v4 = new LoadVars(); var v2 = new LoadVars(); v2._classRef = httpConnection; v2.onData = responseHandler; this.sendersPool.push(v4); this.loadersPool.push(v2); ++v3; } this.currentIndex = 0; }; it.gotoandplay.smartfoxserver.http.LoaderFactory = v1; var v2 = v1.prototype; v2.sendAndLoad = function (message) { var v2 = this.sendersPool[this.currentIndex]; var v3 = this.loadersPool[this.currentIndex]; v2[this.loaderParamName] = message; v2.sendAndLoad(this.webUrl, v3); ++this.currentIndex; if (this.currentIndex >= this.poolSize) { this.currentIndex = 0; } }; v2.handleHTTPStatus = function (status) { trace('---> Status received: ' + status); }; v1.DEFAULT_POOL_SIZE = 8; ASSetPropFlags(it.gotoandplay.smartfoxserver.http.LoaderFactory.prototype, null, 1); } #endinitclip } movieClip 441 __Packages.it.gotoandplay.smartfoxserver.http.IHttpProtocolCodec { #initclip if (!_global.it) { _global.it = new Object(); } if (!_global.it.gotoandplay) { _global.it.gotoandplay = new Object(); } if (!_global.it.gotoandplay.smartfoxserver) { _global.it.gotoandplay.smartfoxserver = new Object(); } if (!_global.it.gotoandplay.smartfoxserver.http) { _global.it.gotoandplay.smartfoxserver.http = new Object(); } if (!_global.it.gotoandplay.smartfoxserver.http.IHttpProtocolCodec) { _global.it.gotoandplay.smartfoxserver.http.IHttpProtocolCodec = function () {}; } #endinitclip } movieClip 442 __Packages.it.gotoandplay.smartfoxserver.http.RawProtocolCodec { #initclip if (!_global.it) { _global.it = new Object(); } if (!_global.it.gotoandplay) { _global.it.gotoandplay = new Object(); } if (!_global.it.gotoandplay.smartfoxserver) { _global.it.gotoandplay.smartfoxserver = new Object(); } if (!_global.it.gotoandplay.smartfoxserver.http) { _global.it.gotoandplay.smartfoxserver.http = new Object(); } if (!_global.it.gotoandplay.smartfoxserver.http.RawProtocolCodec) { var v1 = function () {}; it.gotoandplay.smartfoxserver.http.RawProtocolCodec = v1; var v2 = v1.prototype; _global.it.gotoandplay.smartfoxserver.http.RawProtocolCodec implements _global.it.gotoandplay.smartfoxserver.http.IHttpProtocolCodec; v2.encode = function (sessionId, message) { if (sessionId != null) { return sessionId + message; } return '' + message; }; v2.decode = function (message) { var v1; if (message.charAt(0) == it.gotoandplay.smartfoxserver.http.HttpConnection.HANDSHAKE_TOKEN) { v1 = message.substr(1, it.gotoandplay.smartfoxserver.http.RawProtocolCodec.SESSION_ID_LEN); } return v1; }; v1.SESSION_ID_LEN = 32; ASSetPropFlags(it.gotoandplay.smartfoxserver.http.RawProtocolCodec.prototype, null, 1); } #endinitclip } movieClip 443 __Packages.mx.utils.Delegate { #initclip if (!_global.mx) { _global.mx = new Object(); } if (!_global.mx.utils) { _global.mx.utils = new Object(); } if (!_global.mx.utils.Delegate) { var v1 = function (f) { super(); this.func = f; }; mx.utils.Delegate = v1; mx.utils.Delegate extends Object; var v2 = v1.prototype; v1.create = function (obj, func) { var v2 = function () { var v2 = arguments.callee.target; var v3 = arguments.callee.func; return v3.apply(v2, arguments); }; v2.target = obj; v2.func = func; return v2; }; v2.createDelegate = function (obj) { return mx.utils.Delegate.create(obj, this.func); }; ASSetPropFlags(mx.utils.Delegate.prototype, null, 1); } #endinitclip } movieClip 444 __Packages.it.gotoandplay.smartfoxserver.Room { #initclip if (!_global.it) { _global.it = new Object(); } if (!_global.it.gotoandplay) { _global.it.gotoandplay = new Object(); } if (!_global.it.gotoandplay.smartfoxserver) { _global.it.gotoandplay.smartfoxserver = new Object(); } if (!_global.it.gotoandplay.smartfoxserver.Room) { var v1 = function (id, name, maxUsers, maxSpectators, isTemp, isGame, isPrivate) { this.id = id; this.name = name; this.maxUsers = maxUsers; this.maxSpectators = maxSpectators; this.temp = isTemp; this.game = isGame; this.priv = isPrivate; this.limbo = false; this.updatable = false; this.description = ''; this.userCount = 0; this.specCount = 0; this.userList = new Object(); this.variables = new Array(); }; it.gotoandplay.smartfoxserver.Room = v1; var v2 = v1.prototype; v2.getUserList = function () { return this.userList; }; v2.getUser = function (userId) { if (typeof userId == 'number') { return this.userList[userId]; } else { if (typeof userId == 'string') { for (var v4 in this.userList) { var v2 = this.userList[v4]; if (v2.getName() == userId) { return v2; } } } } }; v2.getVariable = function (varName) { return this.variables[varName]; }; v2.getVariables = function () { return this.variables; }; v2.getName = function () { return this.name; }; v2.getId = function () { return this.id; }; v2.isTemp = function () { return this.temp; }; v2.isGame = function () { return this.game; }; v2.isPrivate = function () { return this.priv; }; v2.getUserCount = function () { return this.userCount; }; v2.getSpectatorCount = function () { return this.specCount; }; v2.getMaxUsers = function () { return this.maxUsers; }; v2.getMaxSpectators = function () { return this.maxSpectators; }; v2.setMyPlayerIndex = function (id) { this.myPlayerIndex = id; }; v2.getMyPlayerIndex = function () { return this.myPlayerIndex; }; v2.setIsLimbo = function (b) { this.limbo = b; }; v2.isLimbo = function () { return this.limbo; }; ASSetPropFlags(it.gotoandplay.smartfoxserver.Room.prototype, null, 1); } #endinitclip } movieClip 445 __Packages.it.gotoandplay.smartfoxserver.User { #initclip if (!_global.it) { _global.it = new Object(); } if (!_global.it.gotoandplay) { _global.it.gotoandplay = new Object(); } if (!_global.it.gotoandplay.smartfoxserver) { _global.it.gotoandplay.smartfoxserver = new Object(); } if (!_global.it.gotoandplay.smartfoxserver.User) { var v1 = function (id, name) { this.id = id; this.name = name; this.variables = new Object(); this.isSpec = false; }; it.gotoandplay.smartfoxserver.User = v1; var v2 = v1.prototype; v2.getId = function () { return this.id; }; v2.getName = function () { return this.name; }; v2.getVariable = function (varName) { return this.variables[varName]; }; v2.getVariables = function () { return this.variables; }; v2.setIsSpectator = function (b) { this.isSpec = b; }; v2.isSpectator = function () { return this.isSpec; }; v2.setModerator = function (b) { this.isMod = b; }; v2.isModerator = function () { return this.isMod; }; v2.getPlayerId = function () { return this.pid; }; v2.setPlayerId = function (pid) { this.pid = pid; }; v2.setVariables = function (o) { for (var v4 in o) { var v2 = o[v4]; if (v2 != null) { this.variables[v4] = v2; } else { delete this.variables[v4]; } } }; ASSetPropFlags(it.gotoandplay.smartfoxserver.User.prototype, null, 1); } #endinitclip } movieClip 446 __Packages.it.gotoandplay.smartfoxserver.JSON { #initclip if (!_global.it) { _global.it = new Object(); } if (!_global.it.gotoandplay) { _global.it.gotoandplay = new Object(); } if (!_global.it.gotoandplay.smartfoxserver) { _global.it.gotoandplay.smartfoxserver = new Object(); } if (!_global.it.gotoandplay.smartfoxserver.JSON) { var v1 = function () {}; it.gotoandplay.smartfoxserver.JSON = v1; var v2 = v1.prototype; v1.stringify = function (arg) { var v3; var v2; var v6; var v1 = ''; var v4; switch (typeof arg) { return 'null'; case 'object': if (arg) { if (arg instanceof Array) { v2 = 0; while (v2 < arg.length) { v4 = it.gotoandplay.smartfoxserver.JSON.stringify(arg[v2]); if (v1) { v1 += ','; } v1 += v4; ++v2; } return '[' + v1 + ']'; } else { if (typeof arg.toString != 'undefined') { for (v2 in arg) { v4 = arg[v2]; if (typeof v4 != 'undefined' && typeof v4 != 'function') { v4 = it.gotoandplay.smartfoxserver.JSON.stringify(v4); if (v1) { v1 += ','; } v1 += it.gotoandplay.smartfoxserver.JSON.stringify(v2) + ':' + v4; } } return '{' + v1 + '}'; } } } return 'null'; case 'number': return isFinite(arg) ? String(arg) : 'null'; case 'string': v6 = arg.length; v1 = '"'; v2 = 0; while (v2 < v6) { v3 = arg.charAt(v2); if (v3 >= ' ') { if (v3 == '\\' || v3 == '"') { v1 += '\\'; } v1 += v3; } else { switch (v3) { case '\b': v1 += '\\b'; break; case '\f': v1 += '\\f'; break; case '\n': v1 += '\\n'; break; case '\r': v1 += '\\r'; break; case '\t': v1 += '\\t'; break; default: v3 = v3.charCodeAt(); v1 += '\\u00' + (Math.floor(v3 / 16)).toString(16) + (v3 % 16).toString(16); } } v2 += 1; } return v1 + '"'; case 'boolean': return String(arg); } return 'null'; }; v1.parse = function (text) { var at = 0; var ch = ' '; var _value; var _error = function (m) { throw {'name': 'JSONError', 'message': m, 'at': at - 1, 'text': text}; }; var _next = function () { ch = text.charAt(at); at += 1; return ch; }; var _white = function () { while (ch) { if (ch <= ' ') { _next(); } else { if (ch == '/') { switch (_next()) { case '/': for (;;) { if (!(_next() && ch != '\n' && ch != '\r')) break; } break; case '*': _next(); for (;;) { if (ch) { if (ch == '*') { if (_next() == '/') { _next(); break; } } else { _next(); } continue; } _error('Unterminated comment'); } break; default: _error('Syntax error'); } } else { break; } } } }; var _string = function () { var v4; var v1 = ''; var v3; var v2; var v5 = false; if (ch == '"') { while (_next()) { if (ch == '"') { _next(); return v1; } else { if (ch == '\\') { switch (_next()) { case 'b': v1 += '\b'; break; case 'f': v1 += '\f'; break; case 'n': v1 += '\n'; break; case 'r': v1 += '\r'; break; case 't': v1 += '\t'; break; case 'u': v2 = 0; v4 = 0; while (v4 < 4) { v3 = parseInt(_next(), 16); if (!isFinite(v3)) { v5 = true; break; } v2 = v2 * 16 + v3; v4 += 1; } if (v5) { v5 = false; } else { v1 += String.fromCharCode(v2); break; default: v1 += ch; } } } else { v1 += ch; } } } } _error('Bad string'); }; var _array = function () { var v1 = []; if (ch == '[') { _next(); _white(); if (ch == ']') { _next(); return v1; } while (ch) { v1.push(_value()); _white(); if (ch == ']') { _next(); return v1; } else { if (ch != ',') { break; } } _next(); _white(); } } _error('Bad array'); }; var _object = function () { var v2; var v1 = {}; if (ch == '{') { _next(); _white(); if (ch == '}') { _next(); return v1; } while (ch) { v2 = _string(); _white(); if (ch != ':') { break; } _next(); v1[v2] = _value(); _white(); if (ch == '}') { _next(); return v1; } else { if (ch != ',') { break; } } _next(); _white(); } } _error('Bad object'); }; var _number = function () { var v1 = ''; var v2; if (ch == '-') { v1 = '-'; _next(); } for (;;) { if (!(ch >= '0' && ch <= '9')) break; v1 += ch; _next(); } if (ch == '.') { v1 += '.'; for (;;) { if (!(_next() && ch >= '0' && ch <= '9')) break; v1 += ch; } } v2 = 1 * v1; if (!isFinite(v2)) { _error('Bad number'); } else { return v2; } }; var _word = function () { switch (ch) { case 't': if (_next() == 'r' && _next() == 'u' && _next() == 'e') { _next(); return true; } break; case 'f': if (_next() == 'a' && _next() == 'l' && _next() == 's' && _next() == 'e') { _next(); return false; } break; case 'n': if (_next() == 'u' && _next() == 'l' && _next() == 'l') { _next(); return null; } } _error('Syntax error'); }; _value = function () { _white(); switch (ch) { case '{': return _object(); case '[': return _array(); case '"': return _string(); case '-': return _number(); } return (ch >= '0' && ch <= '9') ? _number() : _word(); }; return _value(); }; ASSetPropFlags(it.gotoandplay.smartfoxserver.JSON.prototype, null, 1); } #endinitclip } frame 2 { stop(); var blnFirstTimeLoaded = true; var nControls = 'mouse'; soSweetMonster = SharedObject.getLocal('sweetmonster'); if (soSweetMonster.data.topscore == null) { soSweetMonster.data.topscore = 0; soSweetMonster.data.bestlevel = 1; } removeMovieClip(movSMLogo); removeMovieClip(movTips); } movieClip 16 { } // unknown tag 88 length 70 movieClip 22 { } movieClip 25 { } movieClip 26 { } movieClip 29 { } movieClip 30 { } movieClip 45 { frame 1 { stop(); } frame 47 { --_root.nLoopMouth; if (_root.nLoopMouth > 0) { gotoAndPlay(15); } } } movieClip 46 { } movieClip 49 { } button 50 { on (press) { getURL('http://www.gamesarcade.net', '_blank'); fPlaySFX('button'); } } movieClip 53 { } instance of movieClip 53 { onClipEvent (enterFrame) { if (_root.getBytesLoaded() == _root.getBytesTotal()) { _root.gotoAndStop(3); } } } // unknown tag 88 length 68 movieClip 59 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } } movieClip 76 { frame 1 { stop(); } frame 9 { gotoAndStop(1); } frame 14 { gotoAndStop(1); } frame 19 { gotoAndStop(1); } frame 24 { gotoAndStop(1); } frame 29 { gotoAndStop(1); } frame 34 { gotoAndStop(1); } frame 39 { gotoAndStop(1); } frame 44 { gotoAndStop(1); } frame 49 { gotoAndStop(1); } frame 54 { gotoAndStop(1); } frame 59 { gotoAndStop(1); } frame 64 { gotoAndStop(1); } frame 69 { gotoAndStop(1); } frame 74 { gotoAndStop(1); } frame 79 { gotoAndStop(1); } } movieClip 85 { frame 1 { stop(); } frame 9 { gotoAndStop(1); } frame 14 { gotoAndStop(1); } frame 19 { gotoAndStop(1); } frame 24 { gotoAndStop(1); } frame 29 { gotoAndStop(1); } frame 34 { gotoAndStop(1); } frame 39 { gotoAndStop(1); } } movieClip 91 { frame 1 { stop(); } frame 15 { gotoAndStop(1); } frame 24 { gotoAndStop(1); } frame 29 { gotoAndStop(1); } frame 34 { gotoAndStop(1); } frame 39 { gotoAndStop(1); } frame 44 { gotoAndStop(1); } frame 49 { gotoAndStop(1); } } movieClip 94 { frame 1 { stop(); } } movieClip 97 { frame 1 { stop(); } } movieClip 100 { frame 1 { stop(); } } frame 3 { function fPlayMusic() { clearInterval(intMusicWait); if (blnMusic) { sndMusic1.gotoAndStop(3); } } function fStopSound() { blnFX = false; blnMusic = false; movSoundControl.gotoAndStop(2); sndMusic1.gotoAndStop(2); } function fRestartSound() { blnFX = true; blnMusic = true; movSoundControl.gotoAndStop(1); sndMusic1.gotoAndStop(3); } function fPlaySFX(fx) { if (blnFX) { if (fx == 'good') { sndGood.gotoAndPlay(nGoodCount * 5); trace(nGoodCount); if (nGoodCount == 5 || nGoodCount == 10) { nLoopMouth = 2; movStacker.movMonsterBody.movMouth.gotoAndPlay(random(20) + 20); } else { if (nGoodCount == 3) { nLoopMouth = 1; movStacker.movMonsterBody.movMouth.gotoAndPlay(38); } else { nLoopMouth = 1; movStacker.movMonsterBody.movMouth.gotoAndPlay(random(20) + 20); } } ++nGoodCount; if (nGoodCount > 15) { nGoodCount = 1; } } if (fx == 'bad') { sndBad.gotoAndPlay(nBadCount * 5); ++nBadCount; if (nBadCount > 6) { nBadCount = 1; } } if (fx == 'button') { sndButton.play(); } if (fx == 'drop') { sndDrop.play(); } if (fx == 'tray') { sndTray.play(); } } } removeMovieClip(movSMLogo); removeMovieClip(movTips); var nGoodCount = 3; var nBadCount = 1; if (blnFirstTimeLoaded) { blnFirstTimeLoaded = false; if (blnFX) { nLoopMouth = 2; movStacker.movMouth.gotoAndPlay(2); sndOther.gotoAndPlay(2); } intMusicWait = setInterval(fPlayMusic, 2500); } stop(); } movieClip 102 { } button 103 { on (release) { fPlaySFX('button'); gotoAndStop(4); } } movieClip 108 { } movieClip 109 { } movieClip 112 { } button 114 { on (release) { _root.nControls = 'keys'; _root.fPlaySFX('button'); gotoAndStop(2); } } button 117 { on (release) { _root.nControls = 'mouse'; _root.fPlaySFX('button'); gotoAndStop(1); } } button 123 { on (release) { _root.nControls = 'mouse'; _root.fPlaySFX('button'); gotoAndStop(1); } } movieClip 124 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 126 { } button 127 { on (release) { _root.fStopSound(); } } button 129 { on (release) { _root.fRestartSound(); } } movieClip 131 { frame 1 { stop(); } frame 2 { stop(); } } instance movSoundControl of movieClip 131 { onClipEvent (keyDown) { var k = Key.getCode(); if (k == 83) { if (_root.blnFX) { _root.fStopSound(); } else { _root.fRestartSound(); } } } } frame 4 { function fCreateLevelSelection(bl) { xCount = 0; yCount = 0; var i = 1; while (i < 31) { duplicateMovieClip(movLS, 'movLS' + i, 25 + i); (eval('movLS' + i))._x = 92 + xCount * 96; (eval('movLS' + i))._y = 105 + yCount * 78; (eval('movLS' + i)).nLevel = i; if (i <= bl) { (eval('movLS' + i)).gotoAndStop(2); } (eval('movLS' + i)).txtL.text = 'LEVEL ' + i; (eval('movLS' + i)).movLevIcon.gotoAndStop(i); ++xCount; if (i % 6 == 0) { xCount = 0; ++yCount; } ++i; } } function fSelectLevel(obj) { nLevel = obj.nLevel; fSetLevelSettings(); var v1 = 1; while (v1 < 31) { removeMovieClip('movLS' + v1); ++v1; } play(); } function fSetLevelSettings() { switch (nLevel) { case 1: nSpeed = 20; nColours = 2; nMinTimeApart = 3500; nMaxTimeApart = 6000; break; case 2: case 3: nSpeed = 14; nColours = 4; nMinTimeApart = 1800; nMaxTimeApart = 3000; break; case 4: case 5: nSpeed = 14; nColours = 5; nMinTimeApart = 1500; nMaxTimeApart = 3000; break; case 6: case 7: case 8: nSpeed = 14; nColours = 5; nMinTimeApart = 1250; nMaxTimeApart = 2500; break; case 9: case 10: nSpeed = 14; nColours = 6; nMinTimeApart = 1250; nMaxTimeApart = 2600; break; case 11: nSpeed = 14; nColours = 6; nMinTimeApart = 1500; nMaxTimeApart = 2200; break; case 12: case 13: nSpeed = 12; nColours = 7; nMinTimeApart = 1300; nMaxTimeApart = 2400; break; case 14: case 15: nSpeed = 12; nColours = 7; nMinTimeApart = 750; nMaxTimeApart = 3500; break; case 16: case 17: case 18: case 19: case 20: nSpeed = 12; nColours = 8; nMinTimeApart = 750; nMaxTimeApart = 3000; break; case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30: nSpeed = 10; nColours = 8; nMinTimeApart = 700; nMaxTimeApart = 2500; } } stop(); removeMovieClip(movSMLogo); removeMovieClip(movTips); txtPass.text = ''; var xCount = 0; var yCount = 0; var nLevel = 1; var nSpeed = 14; var nColours = 4; var nMinTimeApart = 1500; var nMaxTimeApart = 2500; fCreateLevelSelection(soSweetMonster.data.bestlevel); } button 134 { on (release) { fPlaySFX('button'); var i = 1; while (i < 31) { removeMovieClip('movLS' + i); ++i; } gotoAndStop(3); } } button 139 { on (release) { var nNewLevel = 0; switch (txtPass.text.toLowerCase()) { case 'gobstopper': nNewLevel = 5; break; case 'humbug': nNewLevel = 10; break; case 'jelly bean': nNewLevel = 15; break; case 'fireball': nNewLevel = 20; break; case 'liquorice': nNewLevel = 25; break; case 'bon bon': nNewLevel = 30; } txtPass.text = ''; if (nNewLevel > 0) { var i = 1; while (i < 31) { removeMovieClip('movLS' + i); ++i; } fCreateLevelSelection(nNewLevel); fPlaySFX('button'); } else { fPlaySFX('drop'); } } } movieClip 142 { } movieClip 144 { } movieClip 149 { } movieClip 153 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } } movieClip 180 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } frame 10 { stop(); } frame 11 { stop(); } frame 12 { stop(); } frame 13 { stop(); } frame 14 { stop(); } frame 15 { stop(); } frame 16 { stop(); } frame 17 { stop(); } frame 18 { stop(); } frame 19 { stop(); } frame 20 { stop(); } frame 21 { stop(); } frame 22 { stop(); } frame 23 { stop(); } frame 24 { stop(); } frame 25 { stop(); } frame 26 { stop(); } frame 27 { stop(); } frame 28 { stop(); } frame 29 { stop(); } frame 30 { stop(); } } movieClip 181 { } button 183 { on (release) { _root.fPlaySFX('button'); _root.fSelectLevel(this); } } movieClip 184 { frame 1 { stop(); } frame 2 { stop(); } } frame 5 { function fStartLevel() { GAMESTATE = 'STARTLEVEL'; arrLeftOvers = new Array(); movMessages.gotoAndStop(nLevel + 1); txtTileCounter.text = 'Sweet Count:'; txtLives = nLives; } function fEndLevel() { clearInterval(intMainGame); GAMESTATE = 'ENDLEVEL'; txtTargetInfo.text = ''; var v1 = 0; while (v1 < movStacker.arrTileStack.length) { removeMovieClip(movStacker.arrTileStack[v1]); ++v1; } movStacker.gotoAndPlay(3); intDelayEndLevel = setInterval(fDoRemoveLeftOvers, 2500); } function fDoRemoveLeftOvers() { clearInterval(intDelayEndLevel); var v2 = 4; while (v2 >= 0) { var v1 = 0; while (v1 < 5) { if (movStacker.arrGrid[v2][v1] != 0) { arrLeftOvers.push(movStacker.arrGrid[v2][v1]); ++nLeftOvers; } ++v1; } --v2; } intLeftOvers = setInterval(fRemoveLeftOver, 250); } function fRemoveLeftOver() { if (arrLeftOvers.length > 0) { removeMovieClip(arrLeftOvers[arrLeftOvers.length - 1]); arrLeftOvers.pop(); nLevelScore -= 5; nTotalScore -= 5; txtTotalScore = nTotalScore; txtLevelScore = nLevelScore; } else { fEndLevelComplete(); } } function fEndLevelComplete() { clearInterval(intLeftOvers); var v1 = 0; while (v1 < nTileCount) { removeMovieClip('movT' + v1); ++v1; } movStacker._alpha = 0; movEndLevelMessages.gotoAndStop(2); movEndLevelMessages.txtTitle.text = 'LEVEL ' + nLevel + ' COMPLETE'; movEndLevelMessages.txtLScore.text = nLevelScore; movEndLevelMessages.txtSweetsLeft.text = nLeftOvers; movEndLevelMessages.txtTScore.text = nTotalScore; nLeftOvers = 0; } function fNextLevel() { movEndLevelMessages.gotoAndStop(1); if (nLevel == 30) { GAMESTATE = 'GAMEOVER'; movGameOver.gotoAndStop(4); } else { ++nLevel; if (soSweetMonster.data.bestlevel < nLevel) { soSweetMonster.data.bestlevel = nLevel; } fSetLevelSettings(); fStartLevel(); } } function fGameOver() { _root.fPlaySFX('bad'); movStacker._alpha = 0; clearInterval(intMainGame); GAMESTATE = 'GAMEOVER'; var v2 = 0; while (v2 < nTileCount) { removeMovieClip('movT' + v2); ++v2; } movGameOver.gotoAndStop(2); } function fQuit() { fGameOver(); movGameOver.gotoAndStop(3); } function fStartAgain() { movGameOver.gotoAndStop(1); nLevel = 1; gotoAndStop(4); } function fStartPlay() { fPlaySFX('button'); nTileCount = 0; nLevelScore = 0; nHCount = 0; nVCount = 0; nDCount = 0; nXCount = 0; movStacker.fClearVars(); fUpdateScores(); movMessages.gotoAndStop(1); GAMESTATE = 'PLAYING'; movStacker._alpha = 100; intMainGame = setInterval(fMainGame, random(nMaxTimeApart - nMinTimeApart) + nMinTimeApart); } function fMainGame() { var nRand = String(random(5) + 1); var nRandColour = random(nColours) + 1; duplicateMovieClip('movTile' + nRand, 'movT' + nTileCount, nTileCount); (eval('movT' + nTileCount)).nColour = nRandColour; (eval('movT' + nTileCount)).movTile.gotoAndStop(nRandColour); ++nTileCount; nLevelScore += 5; nTotalScore += 5; if (nLevel == 1 && nTileCount == 1) { movTips.gotoAndPlay(1); } clearInterval(intMainGame); intMainGame = setInterval(fMainGame, random(nMaxTimeApart - nMinTimeApart) + nMinTimeApart); fUpdateScores(); } function fUpdateScores() { txtTotalScore = nTotalScore; txtLevelScore = nLevelScore; if (nTargetTileCount > 0) { txtTileCount = nTargetTileCount - nTileCount; } else { txtTileCount = nTileCount; } txtVCount = nVCount; txtHCount = nHCount; txtDCount = nDCount; if (nTotalScore > nExtraLifeCount * 75000) { ++nLives; txtLives = nLives; ++nExtraLifeCount; } if (nTargetVCount > 0 && nVCount >= nTargetVCount) { fEndLevel(); } if (nTargetHCount > 0 && nHCount >= nTargetHCount) { fEndLevel(); } if (nTargetDCount > 0 && nDCount >= nTargetDCount) { fEndLevel(); } if (nTargetTileCount > 0 && nTileCount >= nTargetTileCount) { fEndLevel(); } if (nTargetScore > 0 && nLevelScore >= nTargetScore) { fEndLevel(); } } function fMoveTile(obj) { if (obj._name.indexOf('movTile') == -1 && GAMESTATE == 'PLAYING') { if (obj.strStackStatus == 'Moving') { ++obj.nC; if (obj.nC == nSpeed) { obj.nextFrame(); obj.nC = 0; if (obj._currentframe == 9) { obj.movTile.gotoAndStop(obj.nColour); if (movStacker.nSlot == obj.nSlot && movStacker.arrTileStack.length < 6) { obj.strStackStatus = 'Stacked'; if (!nFirstTileCaught && _root.nLevel == 1) { movTips.gotoAndPlay(101); nFirstTileCaught = true; } movStacker.arrTileStack.push(obj); } else { obj.strStackStatus = 'Dropped'; } } } } else { if (obj.strStackStatus == 'Stacked') { } else { if (obj.strStackStatus == 'Grid') { obj._x == obj.nGridX; if (obj._y < obj.nGridY) { obj._y += 10; } else { if (obj._y == obj.nGridY) { if (obj.nColour < 0) { obj.nColour = -obj.nColour; movStacker.fCheckForWinningLine(movStacker.arrGrid); } } } } else { if (obj.strStackStatus == 'Dropped') { obj._y += 40; if (obj._y > 580) { --nLives; fPlaySFX('drop'); txtLives = nLives; if (nLives == 0) { fGameOver(); } removeMovieClip(obj); } } } } } if (obj.blnFlashing) { if (obj._alpha == 100) { obj._alpha = 30; } else { if (obj._alpha == 30) { obj._alpha = 100; } } } } } stop(); var GAMESTATE = ''; var nLives = 4; var nStackerSlot = 0; var nTileCount = 0; var nGridX = 0; var nGridY = 0; var nLevelScore = 0; var nTotalScore = 0; var nHCount = 0; var nVCount = 0; var nDCount = 0; var nXCount = 0; var nTargetHCount = 0; var nTargetVCount = 0; var nTargetDCount = 0; var nTargetXCount = 0; var nTargetTileCount = 0; var nTargetScore = 0; var nExtraLifeCount = 1; var arrLeftOvers = new Array(); var nLeftOvers = 0; var nFirstTileCaught = false; var nFirstTileClicked = false; var nFirstStackDone = false; movSMLogo.swapDepths(999999); movTips.swapDepths(999998); txtTileCounter.text = 'Sweet Count:'; movStacker._alpha = 0; fStartLevel(); } movieClip 188 { } movieClip 190 { } movieClip 195 { } movieClip 196 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } frame 10 { stop(); } frame 11 { stop(); } frame 12 { stop(); } frame 13 { stop(); } frame 14 { stop(); } frame 15 { stop(); } frame 16 { stop(); } frame 17 { stop(); } frame 18 { stop(); } frame 19 { stop(); } frame 20 { stop(); } frame 21 { stop(); } frame 22 { stop(); } frame 23 { stop(); } frame 24 { stop(); } frame 25 { stop(); } frame 26 { stop(); } frame 27 { stop(); } frame 28 { stop(); } frame 29 { stop(); } frame 30 { stop(); } frame 31 { stop(); } frame 32 { stop(); } frame 33 { stop(); } frame 34 { stop(); } frame 35 { stop(); } frame 36 { stop(); } frame 37 { stop(); } frame 38 { stop(); } frame 39 { stop(); } frame 40 { stop(); } frame 41 { stop(); } frame 42 { stop(); } frame 43 { stop(); } frame 44 { stop(); } frame 45 { stop(); } frame 46 { stop(); } frame 47 { stop(); } frame 48 { stop(); } frame 49 { stop(); } frame 50 { stop(); } frame 51 { stop(); } frame 52 { stop(); } frame 53 { stop(); } frame 54 { stop(); } frame 55 { stop(); } frame 56 { stop(); } frame 57 { stop(); } frame 58 { stop(); } frame 59 { stop(); } frame 60 { stop(); } frame 61 { stop(); } frame 62 { stop(); } frame 63 { stop(); } frame 64 { stop(); } frame 65 { stop(); } frame 66 { stop(); } frame 67 { stop(); } frame 68 { stop(); } frame 69 { stop(); } frame 70 { stop(); } frame 71 { stop(); } frame 72 { stop(); } frame 73 { stop(); } frame 74 { stop(); } frame 75 { stop(); } frame 76 { stop(); } frame 77 { stop(); } frame 78 { stop(); } frame 79 { stop(); } frame 80 { stop(); } frame 81 { stop(); } frame 82 { stop(); } frame 83 { stop(); } frame 84 { stop(); } frame 85 { stop(); } frame 86 { stop(); } frame 87 { stop(); } frame 88 { stop(); } frame 89 { stop(); } frame 90 { stop(); } frame 91 { stop(); } frame 92 { stop(); } frame 93 { stop(); } frame 94 { stop(); } frame 95 { stop(); } frame 96 { stop(); } frame 97 { stop(); } frame 98 { stop(); } frame 99 { stop(); } frame 100 { stop(); } frame 101 { stop(); } } movieClip 198 { } movieClip 201 { } movieClip 202 { frame 62 { stop(); } } movieClip 203 { } instance movConveyor of movieClip 203 { onClipEvent (load) { var c = 0; var f1 = 1; var f2 = -24; var f3 = -49; var f4 = -74; } onClipEvent (enterFrame) { ++c; if (c > _root.nSpeed / 24) { ++f1; ++f2; ++f3; ++f4; c = 0; if (f1 > 100) { f1 = 1; } if (f2 > 100) { f2 = 1; } if (f3 > 100) { f3 = 1; } if (f4 > 100) { f4 = 1; } if (f1 > 0) { mov.movLine1.gotoAndStop(f1); } if (f2 > 0) { mov.movLine2.gotoAndStop(f2); } if (f3 > 0) { mov.movLine3.gotoAndStop(f3); } if (f4 > 0) { mov.movLine4.gotoAndStop(f4); } } } } movieClip 207 { } movieClip 208 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } } instance movTile1 of movieClip 208 { onClipEvent (load) { var nC = 0; var strStackStatus = 'Moving'; var nSlot = 1; var nHeight; var blnFlashing = false; var nColour; var blnCheckedLine = false; } onClipEvent (enterFrame) { _root.fMoveTile(this); } } movieClip 209 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } } instance movTile2 of movieClip 209 { onClipEvent (load) { var nC = 0; var strStackStatus = 'Moving'; var nSlot = 2; var nHeight; var blnFlashing = false; var nColour; var blnCheckedLine = false; } onClipEvent (enterFrame) { _root.fMoveTile(this); } } movieClip 210 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } } instance movTile3 of movieClip 210 { onClipEvent (load) { var nC = 0; var strStackStatus = 'Moving'; var nSlot = 3; var nHeight; var blnFlashing = false; var nColour; var blnCheckedLine = false; } onClipEvent (enterFrame) { _root.fMoveTile(this); } } movieClip 211 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } } instance movTile4 of movieClip 211 { onClipEvent (load) { var nC = 0; var strStackStatus = 'Moving'; var nSlot = 4; var nHeight; var blnFlashing = false; var nColour; var blnCheckedLine = false; } onClipEvent (enterFrame) { _root.fMoveTile(this); } } movieClip 212 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } } instance movTile5 of movieClip 212 { onClipEvent (load) { var nC = 0; var strStackStatus = 'Moving'; var nSlot = 5; var nHeight; var blnFlashing = false; var nColour; var blnCheckedLine = false; } onClipEvent (enterFrame) { _root.fMoveTile(this); } } movieClip 216 { } movieClip 218 { } movieClip 220 { } movieClip 221 { frame 1 { stop(); } } movieClip 222 { } movieClip 236 { frame 1 { stop(); var nJumps = 0; } frame 2 { play(); } frame 2 { movMonsterBody.movMouth.gotoAndStop(27); } frame 3 { play(); } frame 4 { play(); } frame 5 { play(); } frame 6 { play(); } frame 7 { play(); } frame 7 { movMonsterBody.movMouth.gotoAndStop(35); } frame 8 { play(); } frame 9 { play(); } frame 10 { play(); } frame 11 { play(); } frame 12 { play(); } frame 12 { movMonsterBody.movMouth.gotoAndStop(45); } frame 13 { play(); } frame 14 { ++nJumps; if (nJumps == 4) { gotoAndStop(1); } else { gotoAndPlay(2); } } } instance movStacker of movieClip 236 { onClipEvent (load) { function fClearVars() { arrTileStack = new Array(); arrAllWinners = new Array(); blnIsFlashing = false; var v1 = 0; while (v1 < 5) { arrGrid[v1] = new Array(0, 0, 0, 0, 0, 0, 0, 0); ++v1; } } function fCheckForWinningLine() { if (!blnIsFlashing) { arrAllWinners = new Array(); var v3 = 0; while (v3 < 5) { var v10 = 0; var v5 = new Array(); var v7 = 0; while (v7 < 5) { if (v10 > 0) { if (v10 == arrGrid[v3][v7].nColour) { if (v5.length == 0) { v5.push(arrGrid[v3][v7 - 1]); } v5.push(arrGrid[v3][v7]); } else { if (v5.length < 3) { v5 = new Array(); } } } v10 = arrGrid[v3][v7].nColour; ++v7; } if (v5.length >= 3) { arrAllWinners.push(v5); if (!_root.nFirstStackDone && _root.nLevel == 1) { _root.movTips.gotoAndPlay(301); _root.nFirstStackDone = true; } ++_root.nVCount; _root.nLevelScore += 500 * v5.length; _root.nTotalScore += 500 * v5.length; if (v5.length == 5) { _root.nLevelScore += 2500; _root.nTotalScore += 2500; } _root.fUpdateScores(); } ++v3; } v3 = 0; while (v3 < 5) { v10 = 0; var v4 = new Array(); v7 = 0; while (v7 < 5) { if (v10 > 0) { if (v10 == arrGrid[v7][v3].nColour) { if (v4.length == 0) { v4.push(arrGrid[v7 - 1][v3]); } v4.push(arrGrid[v7][v3]); } else { if (v4.length < 3) { v4 = new Array(); } } } v10 = arrGrid[v7][v3].nColour; ++v7; } if (v4.length >= 3) { arrAllWinners.push(v4); if (!_root.nFirstStackDone && _root.nLevel == 1) { _root.movTips.gotoAndPlay(401); } ++_root.nHCount; _root.nLevelScore += 1000 * v4.length; _root.nTotalScore += 1000 * v4.length; if (v4.length == 5) { _root.nLevelScore += 5000; _root.nTotalScore += 5000; } _root.fUpdateScores(); } ++v3; } var v2 = new Array(); v2[0] = '0011223344'; v2[1] = '0413223140'; v2[2] = '01122334'; v2[3] = '00112233'; v2[4] = '11223344'; v2[5] = '10213243'; v2[6] = '03122130'; v2[7] = '04132231'; v2[8] = '13223140'; v2[9] = '14233241'; v2[10] = '021324'; v2[11] = '011223'; v2[12] = '122334'; v2[13] = '001122'; v2[14] = '112233'; v2[15] = '223344'; v2[16] = '102132'; v2[17] = '213243'; v2[18] = '203142'; v2[19] = '021120'; v2[20] = '031221'; v2[21] = '122130'; v2[22] = '041222'; v2[23] = '132231'; v2[24] = '223140'; v2[25] = '142332'; v2[26] = '233241'; v2[27] = '243342'; BigX = '00112233445504133140'; v3 = 0; while (v3 < v2.length) { v10 = 0; var v9 = 0; var v11 = new Array(); v7 = 0; while (v7 < v2[v3].length) { if (v10 > 0) { if (v10 == arrGrid[Number(v2[v3].charAt(v7))][Number(v2[v3].charAt(v7 + 1))].nColour) { ++v9; } else { v7 = v2[v3].length; } } v10 = arrGrid[Number(v2[v3].charAt(v7))][Number(v2[v3].charAt(v7 + 1))].nColour; v7 += 2; } if (v9 == v2[v3].length / 2 - 1) { v7 = 0; while (v7 < v2[v3].length) { v11.push(arrGrid[Number(v2[v3].charAt(v7))][Number(v2[v3].charAt(v7 + 1))]); v7 += 2; } arrAllWinners.push(v11); ++_root.nDCount; _root.nLevelScore += 2000 * (v9 + 1); _root.nTotalScore += 2000 * (v9 + 1); if (v9 == 4) { _root.nLevelScore += 10000; _root.nTotalScore += 10000; } _root.fUpdateScores(); } ++v3; } var v12 = false; var v8 = 0; while (v8 < arrAllWinners.length) { var v6 = 0; while (v6 < arrAllWinners[v8].length) { if (arrAllWinners[v8][v6] != null) { arrAllWinners[v8][v6].blnFlashing = true; v12 = true; } ++v6; } ++v8; } if (v12) { _root.fPlaySFX('good'); blnIsFlashing = true; intFlashing = setInterval(fFlashingDone, 1000); } } } function fFlashingDone() { blnIsFlashing = false; clearInterval(intFlashing); var v3 = 0; while (v3 < arrAllWinners.length) { var v5 = 0; while (v5 < arrAllWinners[v3].length) { if (arrAllWinners[v3][v5] != null) { arrGrid[arrAllWinners[v3][v5].nSlot - 1][arrAllWinners[v3][v5].nHeight] = 0; removeMovieClip(arrAllWinners[v3][v5]); } ++v5; } ++v3; } var v2 = 0; while (v2 < 5) { var v4 = 0; while (v4 < 5) { if (arrGrid[v2][v4] != 0) { var v1 = -1; v3 = v4 - 1; while (v3 >= 0) { if (arrGrid[v2][v3] == 0) { v1 = v3; } --v3; } if (v1 != -1) { arrGrid[v2][v1] = arrGrid[v2][v4]; arrGrid[v2][v4] = 0; arrGrid[v2][v1].blnCheckedLine = false; arrGrid[v2][v1].swapDepths((v2 + 1) * 10000 + v1); arrGrid[v2][v1].nGridY = 345 - v1 * 20; arrGrid[v2][v1].nHeight = v1; arrGrid[v2][v1].nColour = -arrGrid[v2][v1].nColour; arrGrid[v2][v1].strStackStatus = 'Grid'; } } ++v4; } ++v2; } fCheckForWinningLine(); } function fDoMouseDown() { _root.fPlaySFX('tray'); movMonsterBody.movArms.play(); if (arrTileStack[arrTileStack.length - 1] != null) { if (!_root.nFirstTileClicked && _root.nLevel == 1) { _root.movTips.gotoAndPlay(201); _root.nFirstTileClicked = true; } arrTileStack[arrTileStack.length - 1].strStackStatus = 'Grid'; arrTileStack[arrTileStack.length - 1].nGridX = 104 + nSlot * 104; var v2 = 0; while (v2 < 5) { if (arrGrid[nSlot - 1][v2] == 0) { arrTileStack[arrTileStack.length - 1].nGridY = 345 - v2 * 20; arrTileStack[arrTileStack.length - 1].nHeight = v2; arrTileStack[arrTileStack.length - 1].nSlot = nSlot; arrTileStack[arrTileStack.length - 1].swapDepths(nSlot * 10000 + v2); arrTileStack[arrTileStack.length - 1].nColour = -arrTileStack[arrTileStack.length - 1].nColour; arrGrid[nSlot - 1][v2] = arrTileStack[arrTileStack.length - 1]; arrTileStack[arrTileStack.length - 1].movTile.gotoAndStop(arrTileStack[arrTileStack.length - 1].nColour); arrTileStack.pop(); v2 = 5; } ++v2; } } } var nSlot1 = 180; var nSlot2 = 315; var nSlot3 = 450; var nSlot4 = 580; var nSlot = 5; var arrTileStack = new Array(); var arrAllWinners = new Array(); var blnIsFlashing = false; var arrGrid = new Array(); fClearVars(); } onClipEvent (enterFrame) { if (_root.GAMESTATE == 'PLAYING' && _root.nControls == 'mouse') { var nX = _root._xmouse; if (nX < nSlot1) { nSlot = 1; nMyX = 74; } else { if (nX >= nSlot1 && nX < nSlot2) { nSlot = 2; nMyX = 198; } else { if (nX >= nSlot2 && nX < nSlot3) { nSlot = 3; nMyX = 322; } else { if (nX >= nSlot3 && nX < nSlot4) { nSlot = 4; nMyX = 446; } else { if (nX >= nSlot4) { nSlot = 5; nMyX = 570; } } } } } _x = nMyX; _root.movTips._x = nMyX + 150; } if (_root.GAMESTATE == 'PLAYING') { var i = 0; while (i < arrTileStack.length) { arrTileStack[i]._x = nMyX; arrTileStack[i]._y = 245 - i * 20; ++i; } } } onClipEvent (mouseDown) { if (_root.GAMESTATE == 'PLAYING' && _root.nControls == 'mouse') { fDoMouseDown(); } } onClipEvent (keyDown) { if (_root.GAMESTATE == 'PLAYING' && _root.nControls == 'keys') { var k = Key.getCode(); if (k == 32) { fDoMouseDown(); } if (k == 39) { if (nSlot < 5) { ++nSlot; } } else { if (k == 37) { if (nSlot > 1) { --nSlot; } } } if (nSlot == 1) { nMyX = 52; } else { if (nSlot == 2) { nMyX = 182; } else { if (nSlot == 3) { nMyX = 322; } else { if (nSlot == 4) { nMyX = 452; } else { if (nSlot == 5) { nMyX = 582; } } } } } _x = nMyX; _root.movTips._x = nMyX + 150; } } } movieClip 240 { } movieClip 242 { } movieClip 244 { } movieClip 250 { frame 1 { stop(); } frame 100 { gotoAndStop(1); } frame 200 { gotoAndStop(1); } frame 300 { gotoAndStop(1); } frame 400 { gotoAndStop(1); } frame 500 { gotoAndStop(1); } } movieClip 257 { } movieClip 262 { } movieClip 263 { } button 264 { on (release, keyPress '<Space>') { _root.nTargetVCount = 3; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '3 verticals'; _root.fStartPlay(); } } button 269 { on (release, keyPress '<Space>') { _root.nTargetVCount = 5; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '5 verticals'; _root.fStartPlay(); } } button 273 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 3; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '3 diagonals'; _root.fStartPlay(); } } button 276 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 20000; _root.txtTargetInfo.text = '20,000 points'; _root.fStartPlay(); } } button 279 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetHCount = 0; _root.nTargetTileCount = 50; _root.nTargetScore = 0; _root.txtTargetInfo.text = '50 sweets'; _root.fStartPlay(); _root.txtTileCounter.text = 'Sweets To Go:'; } } button 283 { on (release, keyPress '<Space>') { _root.nTargetVCount = 10; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '10 verticals'; _root.fStartPlay(); } } button 287 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 6; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '6 diagonals'; _root.fStartPlay(); } } button 290 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 55; _root.nTargetScore = 0; _root.txtTargetInfo.text = '55 sweets'; _root.fStartPlay(); _root.txtTileCounter.text = 'Sweets To Go:'; } } button 293 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 40000; _root.txtTargetInfo.text = '40,000 points'; _root.fStartPlay(); } } button 296 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetHCount = 5; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '5 horizontals'; _root.fStartPlay(); } } button 300 { on (release, keyPress '<Space>') { _root.nTargetVCount = 12; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '15 verticals'; _root.fStartPlay(); } } button 304 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 10; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '10 diagonals'; _root.fStartPlay(); } } button 307 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 75; _root.nTargetScore = 0; _root.txtTargetInfo.text = '75 sweets'; _root.fStartPlay(); _root.txtTileCounter.text = 'Tiles To Go:'; } } button 310 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 60000; _root.txtTargetInfo.text = '60,000 points'; _root.fStartPlay(); } } button 313 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetHCount = 8; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '8 horizontals'; _root.fStartPlay(); } } button 317 { on (release, keyPress '<Space>') { _root.nTargetVCount = 15; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '15 verticals'; _root.fStartPlay(); } } button 321 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 15; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '10 horizontals'; _root.fStartPlay(); } } button 324 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 15; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '20 diagonals'; _root.fStartPlay(); } } button 327 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 100000; _root.txtTargetInfo.text = '100,000 points'; _root.fStartPlay(); } } button 330 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetHCount = 0; _root.nTargetTileCount = 100; _root.nTargetScore = 0; _root.txtTargetInfo.text = '100 sweets'; _root.fStartPlay(); _root.txtTileCounter.text = 'Sweets To Go:'; } } button 334 { on (release, keyPress '<Space>') { _root.nTargetVCount = 20; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '20 verticals'; _root.fStartPlay(); } } button 338 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 15; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '15 horizontals'; _root.fStartPlay(); } } button 341 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 20; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '25 diagonals'; _root.fStartPlay(); } } button 344 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 150000; _root.txtTargetInfo.text = '150,000 points'; _root.fStartPlay(); } } button 347 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetHCount = 0; _root.nTargetTileCount = 150; _root.nTargetScore = 0; _root.txtTargetInfo.text = '150 sweets'; _root.fStartPlay(); _root.txtTileCounter.text = 'Sweets To Go:'; } } button 351 { on (release, keyPress '<Space>') { _root.nTargetVCount = 30; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '30 verticals'; _root.fStartPlay(); } } button 355 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 30; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '30 horizontals'; _root.fStartPlay(); } } button 358 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 30; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 0; _root.txtTargetInfo.text = '30 diagonals'; _root.fStartPlay(); } } button 361 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetHCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetTileCount = 0; _root.nTargetScore = 500000; _root.txtTargetInfo.text = '500,000 points'; _root.fStartPlay(); } } button 364 { on (release, keyPress '<Space>') { _root.nTargetVCount = 0; _root.nTargetDCount = 0; _root.nTargetXCount = 0; _root.nTargetHCount = 0; _root.nTargetTileCount = 250; _root.nTargetScore = 0; _root.fStartPlay(); _root.txtTargetInfo.text = '250 sweets'; _root.txtTileCounter.text = 'Sweets To Go:'; } } movieClip 368 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } frame 5 { stop(); } frame 6 { stop(); } frame 7 { stop(); } frame 8 { stop(); } frame 9 { stop(); } frame 10 { stop(); } frame 11 { stop(); } frame 12 { stop(); } frame 13 { stop(); } frame 14 { stop(); } frame 15 { stop(); } frame 16 { stop(); } frame 17 { stop(); } frame 18 { stop(); } frame 19 { stop(); } frame 20 { stop(); } frame 21 { stop(); } frame 22 { stop(); } frame 23 { stop(); } frame 24 { stop(); } frame 25 { stop(); } frame 26 { stop(); } frame 27 { stop(); } frame 28 { stop(); } frame 29 { stop(); } frame 30 { stop(); } frame 31 { stop(); } } button 370 { on (release, keyPress '<Space>') { _root.fPlaySFX('button'); _root.fNextLevel(); } } movieClip 377 { frame 1 { stop(); } frame 2 { stop(); } } movieClip 383 { } movieClip 384 { } button 385 { on (release) { _root.fPlaySFX('button'); _root.fStartAgain(); } } button 387 { on (release) { getURL('http://www.gamesarcade.net', '_blank'); _root.fPlaySFX('button'); } } button 389 { on (release) { getURL('http://www.gamesarcade.net/highscores.asp?id=34&start=1', '_blank'); _root.fPlaySFX('button'); } } movieClip 393 { } movieClip 394 { } movieClip 398 { frame 2 { function handleConnection(success) { if (success) { writeTrace('Connected'); smartfox.login(zone, username, ''); } else { writeTrace('Connection Error'); } } function fSend() { var v1 = new Object(); v1.usr = userID; v1.gameid = gameID; v1.score1 = score1; v1.score2 = score2; v1.score3 = score3; v1.scoretotal = scoretotal; smartfox.sendXtMessage('insecticide', 'z', v1); nextFrame(); writeTrace('Highscores posted'); } function writeTrace(obj) { trace(obj); } var userID = _root.nGAUserID; var username = 'GamesUser' + userID; var gameID = 34; var score1 = 0; var score2 = 0; var score3 = 0; var scoretotal = _root.nTotalScore; var ip = '74.54.49.98'; var port = 9339; var zone = 'gamescores'; var lobbyName = 'MainRoom'; var smartfox = new it.gotoandplay.smartfoxserver.SmartFoxClient(); smartfox.debug = true; var evtQueue = []; smartfox.onConnection = handleConnection; smartfox.onJoinRoom = handleJoinRoom; smartfox.connect(ip, port); stop(); smartfox.onLogin = function (resObj) { if (resObj.success) { writeTrace('login success'); } else { writeTrace('login failed'); } }; smartfox.onRoomListUpdate = function (o) { evtQueue.push(o); smartfox.autoJoin(); }; smartfox.onJoinRoom = function (o) { fSend(); }; smartfox.onConnectionLost = function () { writeTrace('Connection Lost'); smartfox = null; }; } frame 3 { stop(); } } movieClip 405 { } movieClip 407 { } movieClip 410 { } movieClip 412 { } movieClip 414 { } movieClip 415 { } movieClip 418 { frame 1 { stop(); } frame 2 { stop(); } frame 3 { stop(); } frame 4 { stop(); } } button 420 { on (release, keyPress 'q') { fPlaySFX('button'); fQuit(); } } movieClip 423 { } movieClip 436 { }




http://swfchan.com/24/115501/info.shtml
Created: 9/3 -2019 12:52:45 Last modified: 9/3 -2019 12:52:45 Server time: 04/05 -2024 23:48:27