Frame 1
gamingcheck = 0;
if ((getBytesLoaded() / getBytesTotal()) >= 1) {
gotoAndStop ("connect");
}
Frame 2
gotoAndPlay (1);
Frame 9
function handleConnection(success) {
if (success) {
status_txt.text = "Connected, please login:";
showLogin(true);
butt_login.onRelease = sendLogin;
} else {
status_txt.text = "Can't connect!";
}
}
function sendLogin() {
if (!_global.isBusy) {
if (login_txt.text.length > 2) {
if (login_txt.text.indexOf("*") > -1) {
login_txt.text = "star";
}
if (login_txt.text.indexOf("<") > -1) {
input_txt.text = "nuhuh";
}
if (login_txt.text.indexOf("&") > -1) {
login_txt.text = "and";
}
if (login_txt.text == "Stiffler") {
login_txt.text = "Sniffler";
}
if (login_txt.text == "STIFFLER") {
login_txt.text = "SNIFFLER";
}
if (login_txt.text == "WEEBULL") {
login_txt.text = "BUMEYES";
}
if (login_txt.text == "WeeBull") {
login_txt.text = "BUMEYES";
}
if (login_txt.text == "stick") {
login_txt.text = "not_stick";
}
if (login_txt.text == "RATCHET") {
login_txt.text = "SNIFFLES";
}
if (login_txt.text == "stiffler") {
login_txt.text = "sniffler";
}
if (login_txt.text == "STlFFLER") {
login_txt.text = "SNIFFLER";
}
if (login_txt.text == "ST|FFLER") {
login_txt.text = "SN|FFLER";
}
smartfox.login(zone, login_txt.text, null);
} else {
status_txt.text = "Your username must be at least 3 characters long...";
}
}
}
function showLogin(bool) {
butt_login._visible = bool;
login_txt._visible = bool;
loginBox._visible = bool;
if (bool) {
Selection.setFocus("login_txt");
}
}
function showWindow(linkageName) {
_global.isBusy = true;
disabler._visible = true;
roomList_lb.setEnabled(false);
userList_lb.setEnabled(false);
var _local3 = _root.attachMovie(linkageName, linkageName, 9999);
_local3._x = (stageW / 2) - (_local3._width / 2);
_local3._y = (stageH / 2) - (_local3._height / 2);
return(_local3);
}
function hideWindow(wName) {
this[wName].removeMovieClip();
roomList_lb.setEnabled(true);
userList_lb.setEnabled(true);
disabler._visible = false;
_global.isBusy = false;
}
System.security.loadPolicyFile("xmlsocket://195.78.94.242:31337");
stop();
Stage.showMenu = false;
var stageW = 640;
var stageH = 490;
disabler._visible = false;
_global.isBusy = false;
showLogin(false);
status_txt.text = "Connecting to Weebl's Stuff...";
var ip = "195.78.94.242";
var port = 31337;
var zone = "dogfight";
var smartfox = (new it.gotoandplay.smartfoxserver.SmartFoxClient());
smartfox.onConnection = handleConnection;
smartfox.debug = true;
smartfox.connect(ip, port);
smartfox.onLogin = function (resObj) {
if (resObj.success) {
_global.myName = resObj.name;
gotoAndStop ("chat");
} else {
_gloabl.isBusy = true;
var _local3 = showWindow("errorWindow");
_local3.errorMsg.text = resObj.error;
}
};
smartfox.onConnectionLost = function () {
gotoAndStop ("connect");
};
Key.addListener(login_txt);
Frame 16
function sendChatMsg() {
if (ingame) {
if (_global.gameStarted && (input_txt.text.length > 0)) {
smartfox.sendPublicMessage(input_txt.text);
input_txt.text = "";
}
} else if (input_txt.text.length > 0) {
if (input_txt.text.indexOf("<") > -1) {
input_txt.text = "html is not allowed";
}
if (input_txt.text.indexOf("&") > -1) {
input_txt.text = "& is not a valid character";
}
smartfox.sendPublicMessage(input_txt.text);
input_txt.text = "";
}
}
function sendPrivateMessage(m, recipient) {
hideWindow("pmWindow");
smartfox.sendPrivateMessage(m, _global.pmUid);
}
function changeRoom() {
if (!_global.isBusy) {
var _local4 = roomList_lb.getSelectedItem();
var _local2 = _local4.data;
if (_local2 != smartfox.activeRoomId) {
var _local3 = smartfox.getRoom(_local2).isPrivate();
_global.newRoom = _local2;
if (_local3) {
showWindow("passwordWindow");
} else {
showWindow("joinGameWindow");
}
}
}
}
function joinGameRoom(pwd, mode) {
var _local2 = ((mode == "spectator") ? true : false);
smartfox.joinRoom(_global.newRoom, pwd, _local2);
}
function userSelected() {
if (!_global.isBusy) {
var _local2 = userList_lb.getSelectedItem().data;
if (_local2 != smartfox.myUserId) {
_global.pmUid = _local2;
var _local5 = showWindow("pmWindow");
var _local3 = smartfox.getActiveRoom().getUserList();
var _local4 = _local3[_local2];
_local5.title_txt.text = "Send a private message to " + _local4.getName();
}
}
}
function makeNewRoom() {
showWindow("newGameWindow");
}
function createRoom(name, pwd, spec) {
hideWindow("newGameWindow");
var _local1 = new Object();
_local1.name = name;
_local1.password = pwd;
_local1.maxUsers = 2;
_local1.maxSpectators = spec;
_local1.isGame = true;
_local1.isTemp = true;
xt = {};
xt.name = "maze";
xt.script = "dogFightGame.as";
_local1.extension = xt;
smartfox.createRoom(_local1);
}
function loginProtectedRoom(pwd) {
hideWindow("passwordWindow");
smartfox.joinRoom(_global.newRoom, pwd);
}
function resetRoomSelected(id) {
var _local4 = roomList_lb.getEnabled();
roomList_lb.setEnabled(true);
var _local1 = 0;
while (_local1 < roomList_lb.getLength()) {
var _local2 = roomList_lb.getItemAt(_local1);
if (_local2.data == id) {
roomList_lb.setSelectedIndex(_local1);
break;
}
_local1++;
}
roomList_lb.setEnabled(_local4);
}
function updateRoomStatus(roomId) {
var _local3 = smartfox.getRoom(roomId);
var _local4;
if (!_local3.isGame()) {
_local4 = ((((_local3.getName() + " (") + _local3.getUserCount()) + "/") + _local3.getMaxUsers()) + ")";
} else {
_local4 = (((_local3.getName() + " (") + _local3.getUserCount()) + "/") + _local3.getMaxUsers();
_local4 = _local4 + ((((")-(" + _local3.getSpectatorCount()) + "/") + _local3.getMaxSpectators()) + ")");
}
var _local1 = 0;
while (_local1 < roomList_lb.getLength()) {
var _local2 = roomList_lb.getItemAt(_local1);
if (roomId == _local2.data) {
roomList_lb.replaceItemAt(_local1, _local4, _local2.data);
break;
}
_local1++;
}
}
function myOnKeyDown() {
if (Key.isDown(17)) {
gotoAndPlay ("boot2");
trace("CTRL WAS PRESSED");
}
}
function closeConnection() {
smartfox.disconnect();
gotoAndStop ("connect");
}
stop();
iAmSpectator = false;
messageQueue = [];
roomList_lb.setChangeHandler("changeRoom");
userList_lb.setChangeHandler("userSelected");
userName_txt.text = "Logged as: " + _global.myName;
input_txt.text = "";
chat_txt.htmlText = "";
var inGame = false;
smartfox.onRoomListUpdate = function (roomList) {
roomList_lb.removeAll();
for (var _local5 in roomList) {
var _local2 = roomList[_local5];
if (_local2.isGame()) {
var _local3 = (((_local2.getName() + " (") + _local2.getUserCount()) + "/") + _local2.getMaxUsers();
_local3 = _local3 + ((((")-(" + _local2.getSpectatorCount()) + "/") + _local2.getMaxSpectators()) + ")");
roomList_lb.addItem(_local3, _local2.getId());
}
}
roomList_lb.sortItemsBy("label", "ASC");
this.joinRoom("Dog", "");
};
if (evtQueue.length > 0) {
smartfox.onRoomListUpdate(evtQueue[0]);
delete evtQueue;
}
smartfox.onJoinRoom = function (roomObj) {
if (roomObj.isGame()) {
_global.myID = this.playerId;
if (_global.myID == -1) {
iAmSpectator = true;
}
if (_global.myID == 1) {
_global.myColor = "green";
} else if (_global.myID == 2) {
_global.myColor = "red";
}
gotoAndStop ("game");
} else {
var _local9 = roomObj.getId();
var _local6 = roomObj.getUserList();
resetRoomSelected(_local9);
_global.currentRoom = roomObj;
userList_lb.removeAll();
for (var _local7 in _local6) {
var _local3 = _local6[_local7];
var _local4 = _local3.getName();
var _local5 = _local3.getId();
trace((_local4 + ", MOD = ") + _local3.isModerator());
userList_lb.addItem(_local4, _local5);
}
userList_lb.sortItemsBy("label", "ASC");
chat_txt.htmlText = chat_txt.htmlText + "<font color='#cc0000'>>> Welcome to Multiplayer Dogfighters. Press SPACE to start your plane and fire, LEFT and RIGHT cursor keys to climb or dive.</font>";
}
};
smartfox.onJoinRoomError = function (errorMsg) {
var _local1 = showWindow("errorWindow");
_local1.errorMsg.text = errorMsg;
resetRoomSelected(smartfox.activeRoomId);
};
smartfox.onUserEnterRoom = function (fromRoom, user) {
var _local2 = user.getId();
var _local1 = user.getName();
userList_lb.addItem(_local1, _local2);
userList_lb.sortItemsBy("label", "ASC");
updateRoomStatus(fromRoom);
};
smartfox.onUserLeaveRoom = function (fromRoom, usrId) {
var _local1 = 0;
while (_local1 < userList_lb.getLength()) {
var _local2 = userList_lb.getItemAt(_local1);
if (_local2.data == usrId) {
var _local3 = _local2.label;
userList_lb.removeItemAt(_local1);
break;
}
_local1++;
}
userList_lb.sortItemsBy("label", "ASC");
updateRoomStatus(fromRoom);
};
smartfox.onUserCountChange = function (roomObj) {
updateRoomStatus(roomObj.getId());
};
smartfox.onPublicMessage = function (msg, user) {
chat_txt.htmlText = chat_txt.htmlText + ((("<b>[ " + user.getName()) + " ]:</b> ") + msg);
main_sb.setScrollPosition(chat_txt.maxscroll);
};
smartfox.onPrivateMessage = function (msg, user) {
chat_txt.htmlText = chat_txt.htmlText + ((("<b><font color='#009900'>[ PM > " + user.getName()) + " ]:</font></b> ") + msg);
main_sb.setScrollPosition(chat_txt.maxscroll);
};
smartfox.onRoomAdded = function (roomObj) {
var _local2 = (((roomObj.getName() + " (") + roomObj.getUserCount()) + "/") + roomObj.getMaxUsers();
_local2 = _local2 + ((((")-(" + roomObj.getSpectatorCount()) + "/") + roomObj.getMaxSpectators()) + ")");
roomList_lb.addItem(_local2, roomObj.getId());
roomList_lb.sortItemsBy("label", "ASC");
};
smartfox.onRoomDeleted = function (roomObj) {
var _local1 = 0;
while (_local1 < roomList_lb.getLength()) {
if (roomObj.getId() == roomList_lb.getItemAt(_local1).data) {
roomList_lb.removeItemAt(_local1);
break;
}
_local1++;
}
};
smartfox.onCreateRoomError = function (errorMsg) {
var _local1 = showWindow("errorWindow");
_local1.errorMsg.text = errorMsg;
};
smartfox.onExtensionResponse = function (resObj, type) {
messageQueue.push({resObj:resObj, type:type});
};
_root.onKeyDown = myOnKeyDown;
Key.addListener(_root);
Instance of Symbol 273 MovieClip [FListBoxSymbol] "roomList_lb" in Frame 16
//component parameters
onClipEvent (construct) {
selectMultiple = false;
changeHandler = "";
}
Instance of Symbol 273 MovieClip [FListBoxSymbol] "userList_lb" in Frame 16
//component parameters
onClipEvent (construct) {
selectMultiple = false;
changeHandler = "";
}
Instance of Symbol 265 MovieClip [FScrollBarSymbol] "main_sb" in Frame 16
//component parameters
onClipEvent (construct) {
_targetInstanceName = "chat_txt";
horizontal = false;
}
Frame 23
function checkMessageQueue() {
if (messageQueue.length > 0) {
var _local1 = 0;
while (_local1 < messageQueue.length) {
smartfox.onExtensionResponse(messageQueue[_local1].resObj, messageQueue[_local1].type);
_local1++;
}
}
}
function startGame() {
hideWindow("gameEnd");
hideWindow("gameMessage");
_root.player1.name.text = player1Name;
_root.player2.name.text = player2Name;
_global.gameStarted = true;
smartfox.sendXtMessage(extensionName, "restart");
refDate = new Date();
oldMS = refDate.getTime();
sendUpdate(0);
gotoAndPlay ("gameLoop");
}
function leaveGameRoom() {
gotoAndStop ("chat");
smartfox.getRoomList();
}
function gamePaused(xtraMsg) {
win = showWindow("gameMessage");
win.message_txt.text = (((xtraMsg + "Waiting for player ") + ((_global.myID == 1) ? "2" : "1")) + newline) + "press [cancel] to leave the game";
}
function sendUpdate(uDC) {
o = [];
if (((_root["plane" + playerID].firePressed == true) && (_root["plane" + playerID].leftPressed == true)) && (_root["plane" + playerID].rightPressed == true)) {
switch (uDC) {
case 0 :
smartfox.sendXtMessage(extensionName, "1", o, "str");
break;
case 1 :
smartfox.sendXtMessage(extensionName, "2", o, "str");
break;
case 2 :
smartfox.sendXtMessage(extensionName, "3", o, "str");
break;
case 3 :
smartfox.sendXtMessage(extensionName, "4", o, "str");
break;
case 4 :
smartfox.sendXtMessage(extensionName, "5", o, "str");
break;
case 5 :
smartfox.sendXtMessage(extensionName, "6", o, "str");
break;
case 6 :
smartfox.sendXtMessage(extensionName, "7", o, "str");
break;
case 7 :
smartfox.sendXtMessage(extensionName, "8", o, "str");
break;
case 8 :
smartfox.sendXtMessage(extensionName, "9", o, "str");
break;
case 9 :
smartfox.sendXtMessage(extensionName, "0", o, "str");
break;
}
} else if (((_root["plane" + playerID].firePressed == true) && (_root["plane" + playerID].leftPressed == true)) && (_root["plane" + playerID].rightPressed == false)) {
switch (uDC) {
case 0 :
smartfox.sendXtMessage(extensionName, "-", o, "str");
break;
case 1 :
smartfox.sendXtMessage(extensionName, "=", o, "str");
break;
case 2 :
smartfox.sendXtMessage(extensionName, "#", o, "str");
break;
case 3 :
smartfox.sendXtMessage(extensionName, "q", o, "str");
break;
case 4 :
smartfox.sendXtMessage(extensionName, "w", o, "str");
break;
case 5 :
smartfox.sendXtMessage(extensionName, "e", o, "str");
break;
case 6 :
smartfox.sendXtMessage(extensionName, "r", o, "str");
break;
case 7 :
smartfox.sendXtMessage(extensionName, "t", o, "str");
break;
case 8 :
smartfox.sendXtMessage(extensionName, "y", o, "str");
break;
case 9 :
smartfox.sendXtMessage(extensionName, "u", o, "str");
break;
}
} else if (((_root["plane" + playerID].firePressed == true) && (_root["plane" + playerID].leftPressed == false)) && (_root["plane" + playerID].rightPressed == true)) {
switch (uDC) {
case 0 :
smartfox.sendXtMessage(extensionName, "i", o, "str");
break;
case 1 :
smartfox.sendXtMessage(extensionName, "o", o, "str");
break;
case 2 :
smartfox.sendXtMessage(extensionName, "p", o, "str");
break;
case 3 :
smartfox.sendXtMessage(extensionName, "[", o, "str");
break;
case 4 :
smartfox.sendXtMessage(extensionName, "]", o, "str");
break;
case 5 :
smartfox.sendXtMessage(extensionName, "a", o, "str");
break;
case 6 :
smartfox.sendXtMessage(extensionName, "s", o, "str");
break;
case 7 :
smartfox.sendXtMessage(extensionName, "d", o, "str");
break;
case 8 :
smartfox.sendXtMessage(extensionName, "f", o, "str");
break;
case 9 :
smartfox.sendXtMessage(extensionName, "g", o, "str");
break;
}
} else if (((_root["plane" + playerID].firePressed == false) && (_root["plane" + playerID].leftPressed == true)) && (_root["plane" + playerID].rightPressed == true)) {
switch (uDC) {
case 0 :
smartfox.sendXtMessage(extensionName, "h", o, "str");
break;
case 1 :
smartfox.sendXtMessage(extensionName, "j", o, "str");
break;
case 2 :
smartfox.sendXtMessage(extensionName, "k", o, "str");
break;
case 3 :
smartfox.sendXtMessage(extensionName, "l", o, "str");
break;
case 4 :
smartfox.sendXtMessage(extensionName, ";", o, "str");
break;
case 5 :
smartfox.sendXtMessage(extensionName, "'", o, "str");
break;
case 6 :
smartfox.sendXtMessage(extensionName, "z", o, "str");
break;
case 7 :
smartfox.sendXtMessage(extensionName, "x", o, "str");
break;
case 8 :
smartfox.sendXtMessage(extensionName, "c", o, "str");
break;
case 9 :
smartfox.sendXtMessage(extensionName, "v", o, "str");
break;
}
} else if (((_root["plane" + playerID].firePressed == true) && (_root["plane" + playerID].leftPressed == false)) && (_root["plane" + playerID].rightPressed == false)) {
switch (uDC) {
case 0 :
smartfox.sendXtMessage(extensionName, "b", o, "str");
break;
case 1 :
smartfox.sendXtMessage(extensionName, "n", o, "str");
break;
case 2 :
smartfox.sendXtMessage(extensionName, "m", o, "str");
break;
case 3 :
smartfox.sendXtMessage(extensionName, "Z", o, "str");
break;
case 4 :
smartfox.sendXtMessage(extensionName, "X", o, "str");
break;
case 5 :
smartfox.sendXtMessage(extensionName, "C", o, "str");
break;
case 6 :
smartfox.sendXtMessage(extensionName, "V", o, "str");
break;
case 7 :
smartfox.sendXtMessage(extensionName, "B", o, "str");
break;
case 8 :
smartfox.sendXtMessage(extensionName, "N", o, "str");
break;
case 9 :
smartfox.sendXtMessage(extensionName, "M", o, "str");
break;
}
} else if (((_root["plane" + playerID].firePressed == false) && (_root["plane" + playerID].leftPressed == true)) && (_root["plane" + playerID].rightPressed == false)) {
switch (uDC) {
case 0 :
smartfox.sendXtMessage(extensionName, "^", o, "str");
break;
case 1 :
smartfox.sendXtMessage(extensionName, "&", o, "str");
break;
case 2 :
smartfox.sendXtMessage(extensionName, "*", o, "str");
break;
case 3 :
smartfox.sendXtMessage(extensionName, "(", o, "str");
break;
case 4 :
smartfox.sendXtMessage(extensionName, ")", o, "str");
break;
case 5 :
smartfox.sendXtMessage(extensionName, "_", o, "str");
break;
case 6 :
smartfox.sendXtMessage(extensionName, "+", o, "str");
break;
case 7 :
smartfox.sendXtMessage(extensionName, "~", o, "str");
break;
case 8 :
smartfox.sendXtMessage(extensionName, "{", o, "str");
break;
case 9 :
smartfox.sendXtMessage(extensionName, "}", o, "str");
break;
}
} else if (((_root["plane" + playerID].firePressed == false) && (_root["plane" + playerID].leftPressed == false)) && (_root["plane" + playerID].rightPressed == true)) {
switch (uDC) {
case 0 :
smartfox.sendXtMessage(extensionName, ":", o, "str");
break;
case 1 :
smartfox.sendXtMessage(extensionName, "@", o, "str");
break;
case 2 :
smartfox.sendXtMessage(extensionName, "<", o, "str");
break;
case 3 :
smartfox.sendXtMessage(extensionName, ">", o, "str");
break;
case 4 :
smartfox.sendXtMessage(extensionName, "?", o, "str");
break;
case 5 :
smartfox.sendXtMessage(extensionName, " ", o, "str");
break;
case 6 :
smartfox.sendXtMessage(extensionName, "Q", o, "str");
break;
case 7 :
smartfox.sendXtMessage(extensionName, "W", o, "str");
break;
case 8 :
smartfox.sendXtMessage(extensionName, "E", o, "str");
break;
case 9 :
smartfox.sendXtMessage(extensionName, "R", o, "str");
break;
}
} else if (((_root["plane" + playerID].firePressed == false) && (_root["plane" + playerID].leftPressed == false)) && (_root["plane" + playerID].rightPressed == false)) {
switch (uDC) {
case 0 :
smartfox.sendXtMessage(extensionName, "T", o, "str");
break;
case 1 :
smartfox.sendXtMessage(extensionName, "Y", o, "str");
break;
case 2 :
smartfox.sendXtMessage(extensionName, "U", o, "str");
break;
case 3 :
smartfox.sendXtMessage(extensionName, "I", o, "str");
break;
case 4 :
smartfox.sendXtMessage(extensionName, "O", o, "str");
break;
case 5 :
smartfox.sendXtMessage(extensionName, "P", o, "str");
break;
case 6 :
smartfox.sendXtMessage(extensionName, "A", o, "str");
break;
case 7 :
smartfox.sendXtMessage(extensionName, "S", o, "str");
break;
case 8 :
smartfox.sendXtMessage(extensionName, "D", o, "str");
break;
case 9 :
smartfox.sendXtMessage(extensionName, "F", o, "str");
break;
}
}
}
stop();
messageQueue = [];
var tempLastUpdateReceived;
var o = [];
var pendingResObj;
var gameSettings = new settings();
var updateCounter;
var updateTimer;
var timeBetweenUpdates;
var lastPlayerUpdate;
timeBetweenUpdates = 1000 / gameSettings.updatesPerSecond;
var timeBetweenMessages = (timeBetweenUpdates / 2);
var lastUpdateReceived;
var reminderWait = gameSettings.rWait;
var giveUpWait = gameSettings.gUWait;
var lastUpdate;
var lastSent;
var reminderTimer;
var updateSent = false;
var currentFirePressed = false;
var currentLeftPressed = false;
var currentRightPressed = false;
reminderTimer = 0;
updateTimer = 0;
updateCounter = 0;
lastUpdateReceived = -1;
lastPlayerUpdate = -1;
var commsStarted = false;
var my_sound = new Sound();
my_sound.attachSound("atmos");
my_sound.start();
my_sound.onSoundComplete = function () {
my_sound.start();
};
var delMov1 = this.attachMovie("shed1", "shed1A", 6, {_x:2.6, _y:442.8});
setProperty("shed1A", _x , 2.6);
setProperty("shed1A", _y , 442.8);
var delMov2 = this.attachMovie("shed2", "shed2A", 4, {_x:634.5, _y:442.8});
var delMov3 = this.attachMovie("instructions", "instructionsA", 5, {_x:640, _y:0});
var lastEnemyLives;
_global.messageSkip = 3;
_global.mSCounter = 0;
var inGame = true;
_global.gameStarted = false;
var loopStarted = false;
var refDate = new Date();
var oldMS;
var newMS;
var difMS;
oldMS = refDate.getTime();
var extensionName = "maze";
var win;
var myOpponent;
var player1Id;
var player1Name;
var player2Name;
var player2Id;
var tileSize = 21;
var playerSpeed = 200;
var obstacles = "X";
var playerID;
var opponentID;
var winnerID;
var loserID;
var plane1;
var plane2;
plane1 = new plane(51.5, 454.6, 4, 4, this, "P1Plane", 37, 39, 32);
plane2 = new plane(587.8, 454.6, 12, 4, this, "P2Plane", 37, 39, 32);
plane1.planeSound.onSoundComplete = function () {
plane1.planeSound.start();
};
plane2.planeSound.onSoundComplete = function () {
plane2.planeSound.start();
};
plane1.addEnemy(plane2);
plane2.addEnemy(plane1);
gamePaused("");
smartfox.onExtensionResponse = function (resObj, protocol) {
var _local4 = resObj._cmd;
if (protocol == "xml") {
switch (_local4) {
case "start" :
trace("start received");
_global.whoseTurn = resObj.t;
player1Id = resObj.p1.id;
player2Id = resObj.p2.id;
player1Name = resObj.p1.name;
player2Name = resObj.p2.name;
_global.opID = ((_global.myID == 1) ? 2 : 1);
_root[("p" + _global.myID) + "NameText"].name.text = _global.myName;
opponentID = ((_global.myID == 1) ? 2 : 1);
playerID = ((_global.myID == 1) ? 1 : 2);
startGame();
break;
case "stop" :
_global.gameStarted = false;
plane1.clear();
plane2.clear();
my_sound.stop();
gotoAndPlay ("gameCrashed");
}
} else if (protocol == "str") {
if (_global.gameStarted == false) {
startGame();
}
_local4 = resObj[0];
var _local6 = Number(resObj[1]);
if (inGame && (_global.gameStarted == true)) {
switch (_local4) {
case "1" :
tempLastUpdateReceived = 0;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "2" :
tempLastUpdateReceived = 1;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "3" :
tempLastUpdateReceived = 2;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "4" :
tempLastUpdateReceived = 3;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "5" :
tempLastUpdateReceived = 4;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "6" :
tempLastUpdateReceived = 5;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "7" :
tempLastUpdateReceived = 6;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "8" :
tempLastUpdateReceived = 7;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "9" :
tempLastUpdateReceived = 8;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "0" :
tempLastUpdateReceived = 9;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "-" :
tempLastUpdateReceived = 0;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "=" :
tempLastUpdateReceived = 1;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "#" :
tempLastUpdateReceived = 2;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "q" :
tempLastUpdateReceived = 3;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "w" :
tempLastUpdateReceived = 4;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "e" :
tempLastUpdateReceived = 5;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "r" :
tempLastUpdateReceived = 6;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "t" :
tempLastUpdateReceived = 7;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "y" :
tempLastUpdateReceived = 8;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "u" :
tempLastUpdateReceived = 9;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "i" :
tempLastUpdateReceived = 0;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "o" :
tempLastUpdateReceived = 1;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "p" :
tempLastUpdateReceived = 2;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "[" :
tempLastUpdateReceived = 3;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "]" :
tempLastUpdateReceived = 4;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "a" :
tempLastUpdateReceived = 5;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "s" :
tempLastUpdateReceived = 6;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "d" :
tempLastUpdateReceived = 7;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "f" :
tempLastUpdateReceived = 8;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "g" :
tempLastUpdateReceived = 9;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "h" :
tempLastUpdateReceived = 0;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "j" :
tempLastUpdateReceived = 1;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "k" :
tempLastUpdateReceived = 2;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "l" :
tempLastUpdateReceived = 3;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case ";" :
tempLastUpdateReceived = 4;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "'" :
tempLastUpdateReceived = 5;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "z" :
tempLastUpdateReceived = 6;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "x" :
tempLastUpdateReceived = 7;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "c" :
tempLastUpdateReceived = 8;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "v" :
tempLastUpdateReceived = 9;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "b" :
tempLastUpdateReceived = 0;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "n" :
tempLastUpdateReceived = 1;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "m" :
tempLastUpdateReceived = 2;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "Z" :
tempLastUpdateReceived = 3;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "X" :
tempLastUpdateReceived = 4;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "C" :
tempLastUpdateReceived = 5;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "V" :
tempLastUpdateReceived = 6;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "B" :
tempLastUpdateReceived = 7;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "N" :
tempLastUpdateReceived = 8;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "M" :
tempLastUpdateReceived = 9;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = true;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "^" :
tempLastUpdateReceived = 0;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "&" :
tempLastUpdateReceived = 1;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "*" :
tempLastUpdateReceived = 2;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "(" :
tempLastUpdateReceived = 3;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case ")" :
tempLastUpdateReceived = 4;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "_" :
tempLastUpdateReceived = 5;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "+" :
tempLastUpdateReceived = 6;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "~" :
tempLastUpdateReceived = 7;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "{" :
tempLastUpdateReceived = 8;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "}" :
tempLastUpdateReceived = 9;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = true;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case ":" :
tempLastUpdateReceived = 0;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "@" :
tempLastUpdateReceived = 1;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "<" :
tempLastUpdateReceived = 2;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case ">" :
tempLastUpdateReceived = 3;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "?" :
tempLastUpdateReceived = 4;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case " " :
tempLastUpdateReceived = 5;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "Q" :
tempLastUpdateReceived = 6;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "W" :
tempLastUpdateReceived = 7;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "E" :
tempLastUpdateReceived = 8;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "R" :
tempLastUpdateReceived = 9;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = true;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "T" :
tempLastUpdateReceived = 0;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "Y" :
tempLastUpdateReceived = 1;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "U" :
tempLastUpdateReceived = 2;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "I" :
tempLastUpdateReceived = 3;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "O" :
tempLastUpdateReceived = 4;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "P" :
tempLastUpdateReceived = 5;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "A" :
tempLastUpdateReceived = 6;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "S" :
tempLastUpdateReceived = 7;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "D" :
tempLastUpdateReceived = 8;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
case "F" :
tempLastUpdateReceived = 9;
if ((tempLastUpdateReceived > updateCounter) or ((tempLastUpdateReceived < 5) and (updateCounter >= 5))) {
pendingResObj = resObj;
} else {
_root["plane" + opponentID].firePressed = false;
_root["plane" + opponentID].leftPressed = false;
_root["plane" + opponentID].rightPressed = false;
lastUpdateReceived = tempLastUpdateReceived;
}
break;
}
}
}
};
checkMessageQueue();
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (Key.getCode() == _root["plane" + playerID].fireKey) {
_root["plane" + playerID].firePressed = true;
}
if (Key.getCode() == _root["plane" + playerID].leftKey) {
_root["plane" + playerID].leftPressed = true;
}
if (Key.getCode() == _root["plane" + playerID].rightKey) {
_root["plane" + playerID].rightPressed = true;
}
};
Key.addListener(keyListener);
Frame 24
this.gamingcheck = 0;
trace("Gameloop entered");
loopStarted = true;
var inGame = true;
var rejectMessages = false;
var extensionName = "maze";
opponentID = ((_global.myID == 1) ? 2 : 1);
playerID = ((_global.myID == 1) ? 1 : 2);
refDate = new Date();
newMS = refDate.getTime();
difMS = newMS - oldMS;
if (difMS >= 1) {
oldMS = newMS;
}
updateTimer = updateTimer + difMS;
reminderTimer = reminderTimer + difMS;
if (updateTimer >= timeBetweenMessages) {
if (messageSent == false) {
currentFirePressed = _root["plane" + playerID].firePressed;
currentLeftPressed = _root["plane" + playerID].leftPressed;
currentRightPressed = _root["plane" + playerID].rightPressed;
sendUpdate(updateCounter);
_root["plane" + playerID].firePressed = false;
_root["plane" + playerID].leftPressed = false;
_root["plane" + playerID].rightPressed = false;
messageSent = true;
}
}
if (updateTimer >= timeBetweenUpdates) {
if (lastUpdateReceived == updateCounter) {
updateTimer = 0;
reminderTimer = 0;
lastSent = o;
updateCounter++;
plane1.setCurrentUpdate(updateCounter);
plane2.setCurrentUpdate(updateCounter);
if (updateCounter > 9) {
updateCounter = 0;
}
if ((lastPlayerUpdate < updateCounter) or ((lastPlayerUpdate >= 5) and (updateCounter < 5))) {
trace("lastPlayerUpdate");
trace(lastPlayerUpdate);
trace("lastUpdateReceived");
trace(lastPlayerUpdate);
trace("updateCounter");
trace(updateCounter);
trace("plane1fire");
trace(plane1.firePressed);
trace("plane1left");
trace(plane1.leftPressed);
trace("plane1right");
trace(plane1.rightPressed);
trace("plane2fire");
trace(plane2.firePressed);
trace("plane2left");
trace(plane2.leftPressed);
trace("plane2right");
trace(plane2.rightPressed);
lastPlayerUpdate = updateCounter;
plane1.updatePosition(timeBetweenUpdates);
plane2.updatePosition(timeBetweenUpdates);
plane1.updateHits();
plane2.updateHits();
plane1.clearDead();
plane2.clearDead();
if (playerID == 1) {
if (currentFirePressed == true) {
plane1.updateInput(plane1.fireKey, true);
}
if (currentLeftPressed == true) {
plane1.updateInput(plane1.leftKey, true);
}
if (currentRightPressed == true) {
plane1.updateInput(plane1.rightKey, true);
}
currentFirePressed = false;
currentLeftPressed = false;
currentRightPressed = false;
if (plane2.firePressed == true) {
plane2.updateInput(plane2.fireKey, true);
}
if (plane2.leftPressed == true) {
plane2.updateInput(plane2.leftKey, true);
}
if (plane2.rightPressed == true) {
plane2.updateInput(plane2.rightKey, true);
}
plane2.firePressed = false;
plane2.leftPressed = false;
plane2.rightPressed = false;
} else if (playerID == 2) {
if (plane1.firePressed == true) {
plane1.updateInput(plane1.fireKey, true);
}
if (plane1.leftPressed == true) {
plane1.updateInput(plane1.leftKey, true);
}
if (plane1.rightPressed == true) {
plane1.updateInput(plane1.rightKey, true);
}
plane1.firePressed = false;
plane1.leftPressed = false;
plane1.rightPressed = false;
if (currentFirePressed == true) {
plane2.updateInput(plane2.fireKey, true);
}
if (currentLeftPressed == true) {
plane2.updateInput(plane2.leftKey, true);
}
if (currentRightPressed == true) {
plane2.updateInput(plane2.rightKey, true);
}
currentFirePressed = false;
currentLeftPressed = false;
currentRightPressed = false;
}
plane1.setMC();
plane2.setMC();
messageSent = false;
}
}
if (((lastUpdateReceived < updateCounter) or ((lastUpdateReceived >= 5) and (updateCounter < 5))) && (pendingResObj != [])) {
smartfox.onExtensionResponse(pendingResObj, "str");
pendingResObj = [];
}
} else {
plane1.updatePseudoPosition(difMS);
plane2.updatePseudoPosition(difMS);
}
if ((plane1.health <= 0) and (plane2.health > 0)) {
winnerID = 2;
loserID = 1;
refDate = new Date();
oldMS = refDate.getTime();
plane1.clear();
plane2.clear();
delMov1.removeMovieClip();
delMov2.removeMovieClip();
delMov3.removeMovieClip();
for (var i in this) {
if (typeof(this[i]) == "movieclip") {
this[i].removeMovieClip();
}
}
gotoAndPlay ("gameOver");
} else if ((plane1.health > 0) and (plane2.health <= 0)) {
winnerID = 1;
loserID = 2;
refDate = new Date();
oldMS = refDate.getTime();
plane1.clear();
plane2.clear();
delMov1.removeMovieClip();
delMov2.removeMovieClip();
delMov3.removeMovieClip();
for (var i in this) {
if (typeof(this[i]) == "movieclip") {
this[i].removeMovieClip();
}
}
gotoAndPlay ("gameOver");
}
p1NameText.text = player1Name;
p1ScoreText.text = "Lives: " + plane1.health;
p2NameText.text = player2Name;
p2ScoreText.text = "Lives: " + plane2.health;
testText1.text = opponentID;
if (_root["plane" + opponentID].health != lastEnemyLives) {
plane1.bullet1.deathPending = true;
plane1.bullet2.deathPending = true;
plane1.bullet3.deathPending = true;
plane1.bullet4.deathPending = true;
plane1.bullet5.deathPending = true;
plane2.bullet1.deathPending = true;
plane2.bullet2.deathPending = true;
plane2.bullet3.deathPending = true;
plane2.bullet4.deathPending = true;
plane2.bullet5.deathPending = true;
plane1.bullet1.clearDead();
plane1.bullet2.clearDead();
plane1.bullet3.clearDead();
plane1.bullet4.clearDead();
plane1.bullet5.clearDead();
plane2.bullet1.clearDead();
plane2.bullet2.clearDead();
plane2.bullet3.clearDead();
plane2.bullet4.clearDead();
plane2.bullet5.clearDead();
}
lastEnemyLives = _root["plane" + opponentID].health;
Frame 25
gotoAndPlay ("gameLoop");
Frame 26
gotoAndPlay ("gameLoop");
Frame 27
resetGameVars();
plane1.planeSound.stop();
plane2.planeSound.stop();
delMov1.removeMovieClip();
delMov1.removeMovieClip();
delMov1.removeMovieClip();
if (winnerID == 1) {
_root.winnerText.text = player1Name;
_root.loserText.text = player2Name;
} else if (winnerID == 2) {
_root.winnerText.text = player2Name;
_root.loserText.text = player1Name;
}
Frame 28
refDate = new Date();
newMS = refDate.getTime();
trace(newMS - oldMS);
resetGameVars();
if ((newMS - oldMS) < 5000) {
gotoAndPlay ("gameOver");
} else {
inGame = false;
disabler._visible = false;
gotoAndStop ("chat");
smartfox.getRoomList();
}
Frame 29
delMov1.removeMovieClip();
delMov2.removeMovieClip();
delMov3.removeMovieClip();
delMov1.removeMovieClip();
delMov1.removeMovieClip();
delMov1.removeMovieClip();
plane1.planeSound.stop();
plane2.planeSound.stop();
resetGameVars();
Frame 30
refDate = new Date();
newMS = refDate.getTime();
trace(newMS - oldMS);
if ((newMS - oldMS) < 5000) {
gotoAndPlay ("gameCrashed");
} else {
inGame = false;
disabler._visible = false;
gotoAndStop ("chat");
smartfox.getRoomList();
}
Frame 61
if (!_global.isBusy) {
closeConnection();
}
Frame 89
stop();
Symbol 12 MovieClip [expMov] Frame 1
var done = false;
Symbol 12 MovieClip [expMov] Frame 12
done = true;
Symbol 17 MovieClip [expMov] Frame 1
var done = false;
Symbol 17 MovieClip [expMov] Frame 12
done = true;
Symbol 20 MovieClip [FHighlightSymbol] Frame 1
var component = _parent.controller;
component.registerSkinElement(highlight_mc, "selection");
stop();
Symbol 20 MovieClip [FHighlightSymbol] Frame 2
component.registerSkinElement(highlight_mc2, "selectionDisabled");
stop();
Symbol 20 MovieClip [FHighlightSymbol] Frame 3
component.registerSkinElement(highlight_mc3, "selectionUnfocused");
stop();
Symbol 23 MovieClip [FLabelSymbol] Frame 1
#initclip 17
_global.FLabelClass = function () {
if (this.hostComponent == undefined) {
this.hostComponent = ((this._parent.controller == undefined) ? (this._parent) : (this._parent.controller));
}
if (this.customTextStyle == undefined) {
if (this.hostComponent.textStyle == undefined) {
this.hostComponent.textStyle = new TextFormat();
}
this.textStyle = this.hostComponent.textStyle;
this.enable = true;
}
};
FLabelClass.prototype = new MovieClip();
Object.registerClass("FLabelSymbol", FLabelClass);
FLabelClass.prototype.setLabel = function (label) {
var _local2 = this.hostComponent.styleTable.embedFonts.value;
if (_local2 != undefined) {
this.labelField.embedFonts = _local2;
}
this.labelField.setNewTextFormat(this.textStyle);
this.labelField.text = ((label == undefined) ? "" : (label));
if (this.labelField.text != "") {
this.labelField._height = this.labelField.textHeight + 2;
}
};
FLabelClass.prototype.setSize = function (width) {
this.labelField._width = width;
};
FLabelClass.prototype.setEnabled = function (enable) {
this.enable = enable;
var _local2 = this.hostComponent.styleTable[(enable ? "textColor" : "textDisabled")].value;
if (_local2 == undefined) {
_local2 = (enable ? 0 : 8947848);
}
this.setColor(_local2);
};
FLabelClass.prototype.getLabel = function () {
return(this.labelField.text);
};
FLabelClass.prototype.setColor = function (col) {
this.labelField.textColor = col;
};
#endinitclip
Symbol 24 MovieClip [FUIComponentSymbol] Frame 1
#initclip 15
function FUIComponentClass() {
this.init();
}
FUIComponentClass.prototype = new MovieClip();
FUIComponentClass.prototype.init = function () {
this.enable = true;
this.focused = false;
this.useHandCursor = false;
this._accImpl = new Object();
this._accImpl.stub = true;
this.styleTable = new Array();
if (_global.globalStyleFormat == undefined) {
_global.globalStyleFormat = new FStyleFormat();
globalStyleFormat.isGlobal = true;
_global._focusControl = new Object();
_global._focusControl.onSetFocus = function (oldFocus, newFocus) {
oldFocus.myOnKillFocus();
newFocus.myOnSetFocus();
};
Selection.addListener(_global._focusControl);
}
if (this._name != undefined) {
this._focusrect = false;
this.tabEnabled = true;
this.focusEnabled = true;
this.tabChildren = false;
this.tabFocused = true;
if (this.hostStyle == undefined) {
globalStyleFormat.addListener(this);
} else {
this.styleTable = this.hostStyle;
}
this.deadPreview._visible = false;
this.deadPreview._width = (this.deadPreview._height = 1);
this.methodTable = new Object();
this.keyListener = new Object();
this.keyListener.controller = this;
this.keyListener.onKeyDown = function () {
this.controller.myOnKeyDown();
};
this.keyListener.onKeyUp = function () {
this.controller.myOnKeyUp();
};
for (var _local3 in this.styleFormat_prm) {
this.setStyleProperty(_local3, this.styleFormat_prm[_local3]);
}
}
};
FUIComponentClass.prototype.setEnabled = function (enabledFlag) {
this.enable = ((arguments.length > 0) ? (enabledFlag) : true);
this.tabEnabled = (this.focusEnabled = enabledFlag);
if ((!this.enable) && (this.focused)) {
Selection.setFocus(undefined);
}
};
FUIComponentClass.prototype.getEnabled = function () {
return(this.enable);
};
FUIComponentClass.prototype.setSize = function (w, h) {
this.width = w;
this.height = h;
this.focusRect.removeMovieClip();
};
FUIComponentClass.prototype.setChangeHandler = function (chng, obj) {
this.handlerObj = ((obj == undefined) ? (this._parent) : (obj));
this.changeHandler = chng;
};
FUIComponentClass.prototype.invalidate = function (methodName) {
this.methodTable[methodName] = true;
this.onEnterFrame = this.cleanUI;
};
FUIComponentClass.prototype.cleanUI = function () {
if (this.methodTable.setSize) {
this.setSize(this.width, this.height);
} else {
this.cleanUINotSize();
}
this.methodTable = new Object();
delete this.onEnterFrame;
};
FUIComponentClass.prototype.cleanUINotSize = function () {
for (var _local2 in this.methodTable) {
this[_local2]();
}
};
FUIComponentClass.prototype.drawRect = function (x, y, w, h) {
var _local4 = this.styleTable.focusRectInner.value;
var _local5 = this.styleTable.focusRectOuter.value;
if (_local4 == undefined) {
_local4 = 16777215 /* 0xFFFFFF */;
}
if (_local5 == undefined) {
_local5 = 0;
}
this.createEmptyMovieClip("focusRect", 1000);
this.focusRect.controller = this;
this.focusRect.lineStyle(1, _local5);
this.focusRect.moveTo(x, y);
this.focusRect.lineTo(x + w, y);
this.focusRect.lineTo(x + w, y + h);
this.focusRect.lineTo(x, y + h);
this.focusRect.lineTo(x, y);
this.focusRect.lineStyle(1, _local4);
this.focusRect.moveTo(x + 1, y + 1);
this.focusRect.lineTo((x + w) - 1, y + 1);
this.focusRect.lineTo((x + w) - 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, y + 1);
};
FUIComponentClass.prototype.pressFocus = function () {
this.tabFocused = false;
this.focusRect.removeMovieClip();
Selection.setFocus(this);
};
FUIComponentClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this.width + 4, this.height + 4);
};
FUIComponentClass.prototype.myOnSetFocus = function () {
this.focused = true;
Key.addListener(this.keyListener);
if (this.tabFocused) {
this.drawFocusRect();
}
};
FUIComponentClass.prototype.myOnKillFocus = function () {
this.tabFocused = true;
this.focused = false;
this.focusRect.removeMovieClip();
Key.removeListener(this.keyListener);
};
FUIComponentClass.prototype.executeCallBack = function () {
this.handlerObj[this.changeHandler](this);
};
FUIComponentClass.prototype.updateStyleProperty = function (styleFormat, propName) {
this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal);
};
FUIComponentClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
if (value == "") {
return(undefined);
}
var _local19 = parseInt(value);
if (!isNaN(_local19)) {
value = _local19;
}
var _local18 = ((arguments.length > 2) ? (isGlobal) : false);
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].useGlobal || (!_local18)) {
this.styleTable[propName].value = value;
if (this.setCustomStyleProperty(propName, value)) {
} else if (propName == "embedFonts") {
this.invalidate("setSize");
} else if (propName.substring(0, 4) == "text") {
if (this.textStyle == undefined) {
this.textStyle = new TextFormat();
}
var _local15 = propName.substring(4, propName.length);
var _local17 = _local15.substring(0, 1);
_local17 = _local17.toLowerCase();
_local15 = _local17 + _local15.substring(1, _local15.length);
this.textStyle[_local15] = value;
this.invalidate("setSize");
} else {
for (var _local16 in this.styleTable[propName].coloredMCs) {
var _local4 = new Color(this.styleTable[propName].coloredMCs[_local16]);
if (this.styleTable[propName].value == undefined) {
var _local5 = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
_local4.setTransform(_local5);
} else {
_local4.setRGB(value);
}
}
}
this.styleTable[propName].useGlobal = _local18;
}
};
FUIComponentClass.prototype.registerSkinElement = function (skinMCRef, propName) {
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].coloredMCs == undefined) {
this.styleTable[propName].coloredMCs = new Object();
}
this.styleTable[propName].coloredMCs[skinMCRef] = skinMCRef;
if (this.styleTable[propName].value != undefined) {
var _local4 = new Color(skinMCRef);
_local4.setRGB(this.styleTable[propName].value);
}
};
_global.FStyleFormat = function () {
this.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true};
this.listeners = new Object();
this.isGlobal = false;
if (arguments.length > 0) {
for (var _local3 in arguments[0]) {
this[_local3] = arguments[0][_local3];
}
}
};
_global.FStyleFormat.prototype = new Object();
FStyleFormat.prototype.addListener = function () {
var _local3 = 0;
while (_local3 < arguments.length) {
var _local4 = arguments[_local3];
this.listeners[arguments[_local3]] = _local4;
for (var _local5 in this) {
if (this.isAStyle(_local5)) {
_local4.updateStyleProperty(this, _local5.toString());
}
}
_local3++;
}
};
FStyleFormat.prototype.removeListener = function (component) {
this.listeners[component] = undefined;
for (var _local4 in this) {
if (this.isAStyle(_local4)) {
if (component.styleTable[_local4].useGlobal == this.isGlobal) {
component.styleTable[_local4].useGlobal = true;
var _local3 = (this.isGlobal ? undefined : (globalStyleFormat[_local4]));
component.setStyleProperty(_local4, _local3, true);
}
}
}
};
FStyleFormat.prototype.applyChanges = function () {
var _local6 = 0;
for (var _local5 in this.listeners) {
var _local3 = this.listeners[_local5];
if (arguments.length > 0) {
var _local4 = 0;
while (_local4 < arguments.length) {
if (this.isAStyle(arguments[_local4])) {
_local3.updateStyleProperty(this, arguments[_local4]);
}
_local4++;
}
} else {
for (var _local4 in this) {
if (this.isAStyle(_local4)) {
_local3.updateStyleProperty(this, _local4.toString());
}
}
}
}
};
FStyleFormat.prototype.isAStyle = function (name) {
return((this.nonStyles[name] ? false : true));
};
#endinitclip
Symbol 37 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 47 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 56 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 57 MovieClip [UpArrow] Frame 1
stop();
Symbol 57 MovieClip [UpArrow] Frame 2
stop();
Symbol 57 MovieClip [UpArrow] Frame 3
stop();
Symbol 64 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 71 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 76 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(highlight3D_mc, "highlight3D");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
Symbol 77 MovieClip [ScrollThumb] Frame 1
stop();
Symbol 85 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 93 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 101 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 102 MovieClip [DownArrow] Frame 1
stop();
Symbol 102 MovieClip [DownArrow] Frame 2
stop();
Symbol 102 MovieClip [DownArrow] Frame 3
stop();
Symbol 148 Button
on (release) {
closeMe();
}
Symbol 150 Button
on (release) {
sendMessage();
}
Symbol 151 MovieClip [pmWindow] Frame 1
function closeMe() {
_parent.hideWindow(this._name);
}
function sendMessage() {
var _local3 = message.text;
if (_local3.length > 0) {
_parent.sendPrivateMessage(_local3, _global.pmUid);
message.text = "";
}
}
Selection.setFocus("message");
Symbol 155 Button
on (release) {
login();
}
Symbol 156 MovieClip [passwordWindow] Frame 1
function closeMe() {
_parent.hideWindow(this._name);
}
function login() {
var _local2 = pword.text;
if (_local2.length > 0) {
pword.text = "";
_parent.loginProtectedRoom(_local2);
}
}
Selection.setFocus("roomName");
Symbol 162 Button
on (release) {
create();
}
Symbol 163 MovieClip [newGameWindow] Frame 1
function closeMe() {
_parent.hideWindow(this._name);
}
function create() {
if (roomName.text != "") {
rName = roomName.text;
rPwd = pword.text;
roomName.text = "";
pword.text = "";
_parent.createRoom(rName, rPwd);
}
}
Selection.setFocus("roomName");
Symbol 166 MovieClip [gameMessage] Frame 1
function closeMe() {
_parent.leaveGameRoom();
_parent.hideWindow(this._name);
}
Symbol 169 Button
on (release) {
closeMe();
}
Symbol 171 Button
on (release) {
restart();
}
Symbol 172 MovieClip [gameEnd] Frame 1
function closeMe() {
_parent.leaveGameRoom();
_parent.hideWindow(this._name);
}
function restart() {
_parent.smartfox.sendObject({type:"restart"});
_parent.restartGame();
}
Symbol 175 Button
on (release) {
closeMe();
}
Symbol 176 MovieClip [errorWindow] Frame 1
function closeMe() {
_parent.hideWindow(this._name);
}
Selection.setFocus("roomName");
Symbol 186 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 189 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "background");
Symbol 192 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "backgroundDisabled");
Symbol 194 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "backgroundDisabled");
Symbol 197 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(disabled_mc, "foregroundDisabled");
Symbol 200 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(dot_mc, "radioDot");
Symbol 201 MovieClip [frb_states] Frame 1
stop();
Symbol 201 MovieClip [frb_states] Frame 2
stop();
Symbol 201 MovieClip [frb_states] Frame 3
stop();
Symbol 201 MovieClip [frb_states] Frame 4
stop();
Symbol 201 MovieClip [frb_states] Frame 5
stop();
Symbol 204 Button
on (release) {
closeMe();
}
Symbol 205 Button
on (release) {
sendMessage();
}
Symbol 206 MovieClip [pmWindow] Frame 1
function closeMe() {
_parent.hideWindow(this._name);
}
function sendMessage() {
var _local3 = message.text;
if (_local3.length > 0) {
_parent.sendPrivateMessage(_local3, _global.pmUid);
message.text = "";
}
}
Selection.setFocus("message");
Symbol 208 Button
on (release) {
closeMe();
}
Symbol 210 Button
on (release) {
joinGame();
}
Symbol 211 MovieClip [gameSpecMessage] Frame 1
function closeMe() {
_parent.leaveGameRoom();
_parent.hideWindow(this._name);
}
function joinGame() {
_parent.switchSpectator();
}
Symbol 213 Button
on (release) {
if (!_parent.iAmSpectator) {
restart();
}
}
Symbol 214 MovieClip [gameEnd] Frame 1
function closeMe() {
_parent.leaveGameRoom();
_parent.hideWindow(this._name);
}
function restart() {
_parent.sendRestart();
_parent.restartGame();
}
Symbol 216 MovieClip [gameMessage] Frame 1
function closeMe() {
_parent.leaveGameRoom();
_parent.hideWindow(this._name);
}
Symbol 218 Button
on (release) {
closeMe();
}
Symbol 219 MovieClip [errorWindow] Frame 1
function closeMe() {
_parent.hideWindow(this._name);
}
Selection.setFocus("roomName");
Symbol 224 Button
on (release) {
create();
}
Symbol 225 MovieClip [newGameWindow] Frame 1
function closeMe() {
_parent.hideWindow(this._name);
}
function create() {
if (roomName.text != "") {
var _local3 = roomName.text;
var _local2 = pword.text;
var _local4 = spec.text;
roomName.text = "";
pword.text = "";
_parent.createRoom(_local3, _local2, _local4);
}
}
Selection.setFocus("roomName");
Symbol 230 MovieClip [FBoundingBoxSymbol] Frame 1
var component = _parent;
component.registerSkinElement(boundingBox, "background");
stop();
Symbol 230 MovieClip [FBoundingBoxSymbol] Frame 2
component.registerSkinElement(boundingBox2, "backgroundDisabled");
stop();
Symbol 233 MovieClip [FRadioButtonSymbol] Frame 1
#initclip 18
function FRadioButtonClass() {
this.init();
}
function FRadioButtonGroupClass() {
this.radioInstances = new Array();
}
FRadioButtonClass.prototype = new FUIComponentClass();
FRadioButtonGroupClass.prototype = new FUIComponentClass();
Object.registerClass("FRadioButtonSymbol", FRadioButtonClass);
FRadioButtonClass.prototype.init = function () {
if (this.initialState == undefined) {
this.selected = false;
} else {
this.selected = this.initialState;
}
super.setSize(this._width, this._height);
this.boundingBox_mc.unloadMovie();
this.boundingBox_mc._width = 0;
this.boundingBox_mc._height = 0;
this.attachMovie("frb_hitArea", "frb_hitArea_mc", 1);
this.attachMovie("frb_states", "frb_states_mc", 2);
this.attachMovie("FLabelSymbol", "fLabel_mc", 3);
super.init();
this._xscale = 100;
this._yscale = 100;
this.setSize(this.width, this.height);
this.setChangeHandler(this.changeHandler);
if (this.label != undefined) {
this.setLabel(this.label);
}
if (this.initialState == undefined) {
this.setValue(false);
} else {
this.setValue(this.initialState);
}
if (this.data == "") {
this.data = undefined;
} else {
this.setData(this.data);
}
this.addToRadioGroup();
this.ROLE_SYSTEM_RADIOBUTTON = 45;
this.STATE_SYSTEM_SELECTED = 16;
this.EVENT_OBJECT_STATECHANGE = 32778;
this.EVENT_OBJECT_NAMECHANGE = 32780;
this._accImpl.master = this;
this._accImpl.stub = false;
this._accImpl.get_accRole = this.get_accRole;
this._accImpl.get_accName = this.get_accName;
this._accImpl.get_accState = this.get_accState;
this._accImpl.get_accDefaultAction = this.get_accDefaultAction;
this._accImpl.accDoDefaultAction = this.accDoDefaultAction;
};
FRadioButtonClass.prototype.setHitArea = function (w, h) {
var _local3 = this.frb_hitArea_mc;
this.hitArea = _local3;
if (this.frb_states_mc._width > w) {
_local3._width = this.frb_states_mc._width;
} else {
_local3._width = w;
}
_local3._visible = false;
if (arguments.length > 1) {
_local3._height = h;
}
};
FRadioButtonClass.prototype.txtFormat = function (pos) {
var _local3 = this.textStyle;
var _local4 = this.styleTable;
_local3.align = ((_local4.textAlign.value == undefined) ? ((_local3.align = pos)) : undefined);
_local3.leftMargin = ((_local4.textLeftMargin.value == undefined) ? ((_local3.leftMargin = 0)) : undefined);
_local3.rightMargin = ((_local4.textRightMargin.value == undefined) ? ((_local3.rightMargin = 0)) : undefined);
if (this.fLabel_mc._height > this.height) {
super.setSize(this.width, this.fLabel_mc._height);
} else {
super.setSize(this.width, this.height);
}
this.setEnabled(this.enable);
};
FRadioButtonClass.prototype.setSize = function (w, h) {
this.setLabel(this.getLabel());
this.setLabelPlacement(this.labelPlacement);
if (this.frb_states_mc._height < this.fLabel_mc.labelField._height) {
super.setSize(w, this.fLabel_mc.labelField._height);
}
this.setHitArea(this.width, this.height);
this.setLabelPlacement(this.labelPlacement);
};
FRadioButtonClass.prototype.setLabelPlacement = function (pos) {
this.setLabel(this.getLabel());
this.txtFormat(pos);
var _local7 = this.fLabel_mc._height / 2;
var _local8 = this.frb_states_mc._height / 2;
var _local5 = _local8 - _local7;
var _local6 = this.frb_states_mc._width;
var _local2 = this.frb_states_mc;
var _local9 = this.fLabel_mc;
var _local3 = this.width - _local2._width;
if (_local2._width > this.width) {
_local3 = 0;
} else {
_local3 = this.width - _local2._width;
}
this.fLabel_mc.setSize(_local3);
if ((pos == "right") || (pos == undefined)) {
this.labelPlacement = "right";
this.frb_states_mc._x = 0;
this.fLabel_mc._x = _local6;
this.txtFormat("left");
} else if (pos == "left") {
this.labelPlacement = "left";
this.fLabel_mc._x = 0;
this.frb_states_mc._x = this.width - _local6;
this.txtFormat("right");
}
this.fLabel_mc._y = _local5;
this.frb_hitArea_mc._y = _local5;
this.setLabel(this.getLabel());
};
FRadioButtonClass.prototype.setData = function (dataValue) {
this.data = dataValue;
};
FRadioButtonClass.prototype.getData = function () {
return(this.data);
};
FRadioButtonClass.prototype.getState = function () {
return(this.selected);
};
FRadioButtonClass.prototype.getSize = function () {
return(this.width);
};
FRadioButtonClass.prototype.getGroupName = function () {
return(this.groupName);
};
FRadioButtonClass.prototype.setGroupName = function (groupName) {
var _local2 = 0;
while (_local2 < this._parent[this.groupName].radioInstances.length) {
if (this._parent[this.groupName].radioInstances[_local2] == this) {
delete this._parent[this.groupName].radioInstances[_local2];
}
_local2++;
}
this.groupName = groupName;
this.addToRadioGroup();
};
FRadioButtonClass.prototype.addToRadioGroup = function () {
if (this._parent[this.groupName] == undefined) {
this._parent[this.groupName] = new FRadioButtonGroupClass();
}
this._parent[this.groupName].addRadioInstance(this);
};
FRadioButtonClass.prototype.setValue = function (selected) {
if (selected || (selected == undefined)) {
this.setState(true);
this.focusRect.removeMovieClip();
this.executeCallBack();
} else if (selected == false) {
this.setState(false);
}
};
FRadioButtonClass.prototype.setTabState = function (selected) {
Selection.setFocus(this);
this.setState(selected);
this.drawFocusRect();
this.executeCallBack();
};
FRadioButtonClass.prototype.setState = function (selected) {
if (selected || (selected == undefined)) {
this.tabEnabled = true;
for (var _local3 in this._parent) {
if ((this != this._parent[_local3]) && (this._parent[_local3].groupName == this.groupName)) {
this._parent[_local3].setState(false);
this._parent[_local3].tabEnabled = false;
}
}
}
if (this.enable) {
this.fLabel_mc.setEnabled(true);
if (selected || (selected == undefined)) {
this.frb_states_mc.gotoAndStop("selectedEnabled");
this.enabled = false;
this.selected = true;
this.tabEnabled = true;
this.tabFocused = true;
} else {
this.frb_states_mc.gotoAndStop("unselectedEnabled");
this.enabled = true;
this.selected = false;
this.tabEnabled = false;
var _local4 = this._parent[this.groupName].getEnabled();
var _local5 = this._parent[this.groupName].getValue() == undefined;
if (_local4 && (_local5)) {
this._parent[this.groupName].radioInstances[0].tabEnabled = true;
}
}
} else {
this.fLabel_mc.setEnabled(false);
if (selected || (selected == undefined)) {
this.frb_states_mc.gotoAndStop("selectedDisabled");
this.enabled = false;
this.selected = true;
this.tabEnabled = false;
} else {
this.frb_states_mc.gotoAndStop("unselectedDisabled");
this.enabled = false;
this.selected = false;
this.tabEnabled = false;
}
}
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_STATECHANGE, true);
}
};
FRadioButtonClass.prototype.getValue = function () {
if (this.selected) {
if ((this.data == "") || (this.data == undefined)) {
return(this.getLabel());
}
return(this.data);
}
};
FRadioButtonClass.prototype.setEnabled = function (enable) {
if ((enable == true) || (enable == undefined)) {
this.enable = true;
super.setEnabled(true);
} else {
this.enable = false;
super.setEnabled(false);
}
this.setState(this.selected);
var _local5 = this._parent[this.groupName].getEnabled() == undefined;
var _local4 = this._parent[this.groupName].radioInstances[0].getEnabled() == false;
if (_local5 && (_local4)) {
var _local3 = 0;
while (_local3 < this._parent[this.groupName].radioInstances.length) {
if (this._parent[this.groupName].radioInstances[_local3].getEnabled() == true) {
this._parent[this.groupName].radioInstances[_local3].tabEnabled = true;
return(undefined);
}
_local3++;
}
}
};
FRadioButtonClass.prototype.getEnabled = function () {
return(this.enable);
};
FRadioButtonClass.prototype.setLabel = function (label) {
this.fLabel_mc.setLabel(label);
this.txtFormat();
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_NAMECHANGE);
}
};
FRadioButtonClass.prototype.getLabel = function () {
return(this.fLabel_mc.getLabel());
};
FRadioButtonClass.prototype.onPress = function () {
this.pressFocus();
this.frb_states_mc.gotoAndStop("press");
};
FRadioButtonClass.prototype.onRelease = function () {
this.frb_states_mc.gotoAndStop("unselectedDisabled");
this.setValue(!this.selected);
};
FRadioButtonClass.prototype.onReleaseOutside = function () {
this.frb_states_mc.gotoAndStop("unselectedEnabled");
};
FRadioButtonClass.prototype.onDragOut = function () {
this.frb_states_mc.gotoAndStop("unselectedEnabled");
};
FRadioButtonClass.prototype.onDragOver = function () {
this.frb_states_mc.gotoAndStop("press");
};
FRadioButtonClass.prototype.executeCallBack = function () {
this.handlerObj[this.changeHandler](this._parent[this.groupName]);
};
FRadioButtonGroupClass.prototype.addRadioInstance = function (instance) {
this.radioInstances.push(instance);
this.radioInstances[0].tabEnabled = true;
};
FRadioButtonGroupClass.prototype.setEnabled = function (enableFlag) {
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
this.radioInstances[_local2].setEnabled(enableFlag);
_local2++;
}
};
FRadioButtonGroupClass.prototype.getEnabled = function () {
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
if (this.radioInstances[_local2].getEnabled() != this.radioInstances[0].getEnabled()) {
return(undefined);
}
_local2++;
}
return(this.radioInstances[0].getEnabled());
};
FRadioButtonGroupClass.prototype.setChangeHandler = function (changeHandler, obj) {
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
this.radioInstances[_local2].setChangeHandler(changeHandler, obj);
_local2++;
}
};
FRadioButtonGroupClass.prototype.getValue = function () {
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
if (this.radioInstances[_local2].selected == true) {
if ((this.radioInstances[_local2].data == "") || (this.radioInstances[_local2].data == undefined)) {
return(this.radioInstances[_local2].getLabel());
}
return(this.radioInstances[_local2].data);
}
_local2++;
}
};
FRadioButtonGroupClass.prototype.getData = function () {
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
if (this.radioInstances[_local2].selected) {
return(this.radioInstances[_local2].getData());
}
_local2++;
}
};
FRadioButtonGroupClass.prototype.getInstance = function () {
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
if (this.radioInstances[_local2].selected == true) {
return(_local2);
}
_local2++;
}
};
FRadioButtonGroupClass.prototype.setValue = function (dataValue) {
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
if (this.radioInstances[_local2].data == dataValue) {
this.radioInstances[_local2].setValue(true);
return(undefined);
}
_local2++;
}
_local2 = 0;
while (_local2 < this.radioInstances.length) {
if (this.radioInstances[_local2].getLabel() == dataValue) {
this.radioInstances[_local2].setValue(true);
}
_local2++;
}
};
FRadioButtonGroupClass.prototype.setSize = function (w) {
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
this.radioInstances[_local2].setSize(w);
_local2++;
}
};
FRadioButtonGroupClass.prototype.getSize = function () {
var _local3 = 0;
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
if (this.radioInstances[_local2].width >= _local3) {
_local3 = this.radioInstances[_local2].width;
}
_local2++;
}
return(_local3);
};
FRadioButtonGroupClass.prototype.setGroupName = function (groupName) {
this.oldGroupName = this.radioInstances[0].groupName;
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
this.radioInstances[_local2].groupName = groupName;
this.radioInstances[_local2].addToRadioGroup();
_local2++;
}
delete this._parent[this.oldGroupName];
};
FRadioButtonGroupClass.prototype.getGroupName = function () {
return(this.radioInstances[0].groupName);
};
FRadioButtonGroupClass.prototype.setLabelPlacement = function (pos) {
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
this.radioInstances[_local2].setLabelPlacement(pos);
_local2++;
}
};
FRadioButtonGroupClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
this.radioInstances[_local2].setStyleProperty(propName, value, isGlobal);
_local2++;
}
};
FRadioButtonGroupClass.prototype.addListener = function () {
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
this.radioInstances[_local2].addListener();
_local2++;
}
};
FRadioButtonGroupClass.prototype.applyChanges = function () {
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
this.radioInstances[_local2].applyChanges();
_local2++;
}
};
FRadioButtonGroupClass.prototype.removeListener = function (component) {
var _local2 = 0;
while (_local2 < this.radioInstances.length) {
this.radioInstances[_local2].removeListener(component);
_local2++;
}
};
FRadioButtonClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this._width + 6, this._height - 3);
};
FRadioButtonClass.prototype.myOnKillFocus = function () {
Key.removeListener(this.keyListener);
this.focused = false;
this.focusRect.removeMovieClip();
this._parent[this.groupName].foobar = 0;
};
FRadioButtonClass.prototype.myOnKeyDown = function () {
if ((Key.getCode() == 32) && (this._parent[this.groupName].getValue() == undefined)) {
if (this._parent[this.groupName].radioInstances[0] == this) {
this.setTabState(true);
}
}
if ((Key.getCode() == 40) && (this.pressOnce == undefined)) {
this.foobar = this._parent[this.groupName].getInstance();
var _local2 = this.foobar;
while (_local2 < this._parent[this.groupName].radioInstances.length) {
var _local3 = _local2 + 1;
if (this._parent[this.groupName].radioInstances[_local3].getEnabled()) {
this._parent[this.groupName].radioInstances[_local3].setTabState(true);
return(undefined);
}
_local2++;
}
}
if ((Key.getCode() == 38) && (this.pressOnce == undefined)) {
this.foobar = this._parent[this.groupName].getInstance();
var _local2 = this.foobar;
while (_local2 >= 0) {
var _local3 = _local2 - 1;
if (this._parent[this.groupName].radioInstances[_local3].getEnabled()) {
this._parent[this.groupName].radioInstances[_local3].setTabState(true);
return(undefined);
}
_local2--;
}
}
};
FRadioButtonClass.prototype.get_accRole = function (childId) {
return(this.master.ROLE_SYSTEM_RADIOBUTTON);
};
FRadioButtonClass.prototype.get_accName = function (childId) {
return(this.master.getLabel());
};
FRadioButtonClass.prototype.get_accState = function (childId) {
if (this.master.getState()) {
return(this.master.STATE_SYSTEM_SELECTED);
}
return(0);
};
FRadioButtonClass.prototype.get_accDefaultAction = function (childId) {
if (this.master.getState()) {
return("UnCheck");
}
return("Check");
};
FRadioButtonClass.prototype.accDoDefaultAction = function (childId) {
this.master.setValue(!this.master.getValue());
};
#endinitclip
boundingBox_mc._visible = false;
deadPreview._visible = false;
Symbol 235 Button
on (release) {
login();
}
Symbol 236 MovieClip [joinGameWindow] Frame 1
function closeMe() {
_parent.hideWindow(this._name);
}
function login() {
var _local3 = radioGroup.getValue();
_parent.joinGameRoom("", _local3);
_parent.hideWindow(this._name);
}
Selection.setFocus("roomName");
Instance of Symbol 233 MovieClip [FRadioButtonSymbol] "rb_player" in Symbol 236 MovieClip [joinGameWindow] Frame 1
//component parameters
onClipEvent (construct) {
label = "Player";
initialState = true;
groupName = "radioGroup";
data = "player";
labelPlacement = "right";
changeHandler = "";
}
Symbol 240 MovieClip [passwordWindow] Frame 1
function closeMe() {
_parent.hideWindow(this._name);
}
function login() {
var _local3 = pword.text;
if (_local3.length > 0) {
pword.text = "";
var _local4 = radioGroup.getValue();
_parent.joinGameRoom(_local3, _local4);
_parent.hideWindow(this._name);
}
}
Selection.setFocus("roomName");
Instance of Symbol 233 MovieClip [FRadioButtonSymbol] "rb_player" in Symbol 240 MovieClip [passwordWindow] Frame 1
//component parameters
onClipEvent (construct) {
label = "Player";
initialState = true;
groupName = "radioGroup";
data = "player";
labelPlacement = "right";
changeHandler = "";
}
Instance of Symbol 233 MovieClip [FRadioButtonSymbol] "rb_spectator" in Symbol 240 MovieClip [passwordWindow] Frame 1
//component parameters
onClipEvent (construct) {
label = "Spectator";
initialState = false;
groupName = "radioGroup";
data = "spectator";
labelPlacement = "right";
changeHandler = "";
}
Symbol 264 MovieClip Frame 1
var component = _parent;
component.registerSkinElement(track_mc, "scrollTrack");
Symbol 265 MovieClip [FScrollBarSymbol] Frame 1
#initclip 20
FScrollBarClass = function () {
if (this._height == 4) {
return(undefined);
}
this.init();
this.minPos = (this.maxPos = (this.pageSize = (this.largeScroll = 0)));
this.smallScroll = 1;
this.width = (this.horizontal ? (this._width) : (this._height));
this._xscale = (this._yscale = 100);
this.setScrollPosition(0);
this.tabEnabled = false;
if (this._targetInstanceName.length > 0) {
this.setScrollTarget(this._parent[this._targetInstanceName]);
}
this.tabChildren = false;
this.setSize(this.width);
};
FScrollBarClass.prototype = new FUIComponentClass();
FScrollBarClass.prototype.setHorizontal = function (flag) {
if (this.horizontal && (!flag)) {
this._xscale = 100;
this._rotation = 0;
} else if (flag && (!this.horizontal)) {
this._xscale = -100;
this._rotation = -90;
}
this.horizontal = flag;
};
FScrollBarClass.prototype.setScrollProperties = function (pSize, mnPos, mxPos) {
if (!this.enable) {
return(undefined);
}
this.pageSize = pSize;
this.minPos = Math.max(mnPos, 0);
this.maxPos = Math.max(mxPos, 0);
this.scrollPosition = Math.max(this.minPos, this.scrollPosition);
this.scrollPosition = Math.min(this.maxPos, this.scrollPosition);
if ((this.maxPos - this.minPos) <= 0) {
this.scrollThumb_mc.removeMovieClip();
this.upArrow_mc.gotoAndStop(3);
this.downArrow_mc.gotoAndStop(3);
this.downArrow_mc.onPress = (this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = null));
this.upArrow_mc.onPress = (this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = null));
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onRelease = null);
this.scrollTrack_mc.onDragOut = (this.scrollTrack_mc.onRollOut = null);
this.scrollTrack_mc.useHandCursor = false;
} else {
var _local2 = this.getScrollPosition();
this.upArrow_mc.gotoAndStop(1);
this.downArrow_mc.gotoAndStop(1);
this.upArrow_mc.onPress = (this.upArrow_mc.onDragOver = this.startUpScroller);
this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = this.stopScrolling);
this.downArrow_mc.onPress = (this.downArrow_mc.onDragOver = this.startDownScroller);
this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = this.stopScrolling);
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onDragOver = this.startTrackScroller);
this.scrollTrack_mc.onRelease = this.stopScrolling;
this.scrollTrack_mc.onDragOut = this.stopScrolling;
this.scrollTrack_mc.onRollOut = this.stopScrolling;
this.scrollTrack_mc.useHandCursor = false;
this.attachMovie("ScrollThumb", "scrollThumb_mc", 3);
this.scrollThumb_mc._x = 0;
this.scrollThumb_mc._y = this.upArrow_mc._height;
this.scrollThumb_mc.onPress = this.startDragThumb;
this.scrollThumb_mc.controller = this;
this.scrollThumb_mc.onRelease = (this.scrollThumb_mc.onReleaseOutside = this.stopDragThumb);
this.scrollThumb_mc.useHandCursor = false;
this.thumbHeight = (this.pageSize / ((this.maxPos - this.minPos) + this.pageSize)) * this.trackSize;
this.thumbMid_mc = this.scrollThumb_mc.mc_sliderMid;
this.thumbTop_mc = this.scrollThumb_mc.mc_sliderTop;
this.thumbBot_mc = this.scrollThumb_mc.mc_sliderBot;
this.thumbHeight = Math.max(this.thumbHeight, 6);
this.midHeight = (this.thumbHeight - this.thumbTop_mc._height) - this.thumbBot_mc._height;
this.thumbMid_mc._yscale = (this.midHeight * 100) / this.thumbMid_mc._height;
this.thumbMid_mc._y = this.thumbTop_mc._height;
this.thumbBot_mc._y = this.thumbTop_mc._height + this.midHeight;
this.scrollTop = this.scrollThumb_mc._y;
this.trackHeight = this.trackSize - this.thumbHeight;
this.scrollBot = this.trackHeight + this.scrollTop;
_local2 = Math.min(_local2, this.maxPos);
this.setScrollPosition(Math.max(_local2, this.minPos));
}
};
FScrollBarClass.prototype.getScrollPosition = function () {
return(this.scrollPosition);
};
FScrollBarClass.prototype.setScrollPosition = function (pos) {
this.scrollPosition = pos;
if (this.scrollThumb_mc != undefined) {
pos = Math.min(pos, this.maxPos);
pos = Math.max(pos, this.minPos);
}
this.scrollThumb_mc._y = (((pos - this.minPos) * this.trackHeight) / (this.maxPos - this.minPos)) + this.scrollTop;
this.executeCallBack();
};
FScrollBarClass.prototype.setLargeScroll = function (lScroll) {
this.largeScroll = lScroll;
};
FScrollBarClass.prototype.setSmallScroll = function (sScroll) {
this.smallScroll = sScroll;
};
FScrollBarClass.prototype.setEnabled = function (enabledFlag) {
var _local3 = this.enable;
if (enabledFlag && (!_local3)) {
this.enable = enabledFlag;
if (this.textField != undefined) {
this.setScrollTarget(this.textField);
} else {
this.setScrollProperties(this.pageSize, this.cachedMinPos, this.cachedMaxPos);
this.setScrollPosition(this.cachedPos);
}
this.clickFilter = undefined;
} else if ((!enabledFlag) && (_local3)) {
this.textField.removeListener(this);
this.cachedPos = this.getScrollPosition();
this.cachedMinPos = this.minPos;
this.cachedMaxPos = this.maxPos;
if (this.clickFilter == undefined) {
this.setScrollProperties(this.pageSize, 0, 0);
} else {
this.clickFilter = true;
}
this.enable = enabledFlag;
}
};
FScrollBarClass.prototype.setSize = function (hgt) {
if (this._height == 1) {
return(undefined);
}
this.width = hgt;
this.scrollTrack_mc._yscale = 100;
this.scrollTrack_mc._yscale = (100 * this.width) / this.scrollTrack_mc._height;
if (this.upArrow_mc == undefined) {
this.attachMovie("UpArrow", "upArrow_mc", 1);
this.attachMovie("DownArrow", "downArrow_mc", 2);
this.downArrow_mc.controller = (this.upArrow_mc.controller = this);
this.upArrow_mc.useHandCursor = (this.downArrow_mc.useHandCursor = false);
this.upArrow_mc._x = (this.upArrow_mc._y = 0);
this.downArrow_mc._x = 0;
}
this.scrollTrack_mc.controller = this;
this.downArrow_mc._y = this.width - this.downArrow_mc._height;
this.trackSize = this.width - (2 * this.downArrow_mc._height);
if (this.textField != undefined) {
this.onTextChanged();
} else {
this.setScrollProperties(this.pageSize, this.minPos, this.maxPos);
}
};
FScrollBarClass.prototype.scrollIt = function (inc, mode) {
var _local3 = this.smallScroll;
if (inc != "one") {
_local3 = ((this.largeScroll == 0) ? (this.pageSize) : (this.largeScroll));
}
var _local2 = this.getScrollPosition() + (mode * _local3);
if (_local2 > this.maxPos) {
_local2 = this.maxPos;
} else if (_local2 < this.minPos) {
_local2 = this.minPos;
}
this.setScrollPosition(_local2);
};
FScrollBarClass.prototype.startDragThumb = function () {
this.lastY = this._ymouse;
this.onMouseMove = this.controller.dragThumb;
};
FScrollBarClass.prototype.dragThumb = function () {
this.scrollMove = this._ymouse - this.lastY;
this.scrollMove = this.scrollMove + this._y;
if (this.scrollMove < this.controller.scrollTop) {
this.scrollMove = this.controller.scrollTop;
} else if (this.scrollMove > this.controller.scrollBot) {
this.scrollMove = this.controller.scrollBot;
}
this._y = this.scrollMove;
var _local2 = this.controller;
_local2.scrollPosition = Math.round(((_local2.maxPos - _local2.minPos) * (this._y - _local2.scrollTop)) / _local2.trackHeight) + _local2.minPos;
this.controller.isScrolling = true;
updateAfterEvent();
this.controller.executeCallBack();
};
FScrollBarClass.prototype.stopDragThumb = function () {
this.controller.isScrolling = false;
this.onMouseMove = null;
};
FScrollBarClass.prototype.startTrackScroller = function () {
this.controller.trackScroller();
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "page", -1);
};
FScrollBarClass.prototype.scrollInterval = function (inc, mode) {
clearInterval(this.scrolling);
if (inc == "page") {
this.trackScroller();
} else {
this.scrollIt(inc, mode);
}
this.scrolling = setInterval(this, "scrollInterval", 35, inc, mode);
};
FScrollBarClass.prototype.trackScroller = function () {
if ((this.scrollThumb_mc._y + this.thumbHeight) < this._ymouse) {
this.scrollIt("page", 1);
} else if (this.scrollThumb_mc._y > this._ymouse) {
this.scrollIt("page", -1);
}
};
FScrollBarClass.prototype.stopScrolling = function () {
this.controller.downArrow_mc.gotoAndStop(1);
this.controller.upArrow_mc.gotoAndStop(1);
clearInterval(this.controller.scrolling);
};
FScrollBarClass.prototype.startUpScroller = function () {
this.controller.upArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", -1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", -1);
};
FScrollBarClass.prototype.startDownScroller = function () {
this.controller.downArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", 1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", 1);
};
FScrollBarClass.prototype.setScrollTarget = function (tF) {
if (tF == undefined) {
this.textField.removeListener(this);
delete this.textField[(this.horizontal ? "hScroller" : "vScroller")];
if ((this.textField.hScroller != undefined) && (this.textField.vScroller != undefined)) {
this.textField.unwatch("text");
this.textField.unwatch("htmlText");
}
}
this.textField = undefined;
if (!(tF instanceof TextField)) {
return(undefined);
}
this.textField = tF;
this.textField[(this.horizontal ? "hScroller" : "vScroller")] = this;
this.onTextChanged();
this.onChanged = function () {
this.onTextChanged();
};
this.onScroller = function () {
if (!this.isScrolling) {
if (!this.horizontal) {
this.setScrollPosition(this.textField.scroll);
} else {
this.setScrollPosition(this.textField.hscroll);
}
}
};
this.textField.addListener(this);
this.textField.watch("text", this.callback);
this.textField.watch("htmlText", this.callback);
};
FScrollBarClass.prototype.callback = function (prop, oldVal, newVal) {
clearInterval(this.hScroller.synchScroll);
clearInterval(this.vScroller.synchScroll);
this.hScroller.synchScroll = setInterval(this.hScroller, "onTextChanged", 50);
this.vScroller.synchScroll = setInterval(this.vScroller, "onTextChanged", 50);
return(newVal);
};
FScrollBarClass.prototype.onTextChanged = function () {
if ((!this.enable) || (this.textField == undefined)) {
return(undefined);
}
clearInterval(this.synchScroll);
if (this.horizontal) {
var _local3 = this.textField.hscroll;
this.setScrollProperties(this.textField._width, 0, this.textField.maxhscroll);
this.setScrollPosition(Math.min(_local3, this.textField.maxhscroll));
} else {
var _local3 = this.textField.scroll;
var _local2 = this.textField.bottomScroll - this.textField.scroll;
this.setScrollProperties(_local2, 1, this.textField.maxscroll);
this.setScrollPosition(Math.min(_local3, this.textField.maxscroll));
}
};
FScrollBarClass.prototype.executeCallBack = function () {
if (this.textField == undefined) {
super.executeCallBack();
} else if (this.horizontal) {
this.textField.hscroll = this.getScrollPosition();
} else {
this.textField.scroll = this.getScrollPosition();
}
};
Object.registerClass("FScrollBarSymbol", FScrollBarClass);
#endinitclip
Symbol 266 MovieClip [FListItemSymbol] Frame 1
#initclip 24
function FListItemClass() {
this.init();
}
FListItemClass.prototype = new FSelectableItemClass();
Object.registerClass("FListItemSymbol", FListItemClass);
#endinitclip
Symbol 267 MovieClip [DataProviderSymbol] Frame 1
#initclip 16
_global.DataProviderClass = function () {
this.init();
};
DataProviderClass.prototype.init = function () {
this.items = new Array();
this.uniqueID = 0;
this.views = new Array();
};
DataProviderClass.prototype.addView = function (viewRef) {
this.views.push(viewRef);
var _local2 = {event:"updateAll"};
viewRef.modelChanged(_local2);
};
DataProviderClass.prototype.addItemAt = function (index, value) {
if (index < this.getLength()) {
this.items.splice(index, 0, "tmp");
}
this.items[index] = new Object();
if (typeof(value) == "object") {
this.items[index] = value;
} else {
this.items[index].label = value;
}
this.items[index].__ID__ = this.uniqueID++;
var _local4 = {event:"addRows", firstRow:index, lastRow:index};
this.updateViews(_local4);
};
DataProviderClass.prototype.addItem = function (value) {
this.addItemAt(this.getLength(), value);
};
DataProviderClass.prototype.removeItemAt = function (index) {
var _local4 = this.items[index];
this.items.splice(index, 1);
var _local3 = {event:"deleteRows", firstRow:index, lastRow:index};
this.updateViews(_local3);
return(_local4);
};
DataProviderClass.prototype.removeAll = function () {
this.items = new Array();
this.updateViews({event:"deleteRows", firstRow:0, lastRow:this.getLength() - 1});
};
DataProviderClass.prototype.replaceItemAt = function (index, itemObj) {
if ((index < 0) || (index >= this.getLength())) {
return(undefined);
}
var _local4 = this.getItemID(index);
if (typeof(itemObj) == "object") {
this.items[index] = itemObj;
} else {
this.items[index].label = itemObj;
}
this.items[index].__ID__ = _local4;
this.updateViews({event:"updateRows", firstRow:index, lastRow:index});
};
DataProviderClass.prototype.getLength = function () {
return(this.items.length);
};
DataProviderClass.prototype.getItemAt = function (index) {
return(this.items[index]);
};
DataProviderClass.prototype.getItemID = function (index) {
return(this.items[index].__ID__);
};
DataProviderClass.prototype.sortItemsBy = function (fieldName, order) {
this.items.sortOn(fieldName);
if (order == "DESC") {
this.items.reverse();
}
this.updateViews({event:"sort"});
};
DataProviderClass.prototype.updateViews = function (eventObj) {
var _local2 = 0;
while (_local2 < this.views.length) {
this.views[_local2].modelChanged(eventObj);
_local2++;
}
};
#endinitclip
Symbol 268 MovieClip [FSelectableItemSymbol] Frame 1
#initclip 22
function FSelectableItemClass() {
this.init();
}
FSelectableItemClass.prototype = new FUIComponentClass();
FSelectableItemClass.prototype.init = function () {
if (this._name != "itemAsset") {
this.highlighted = false;
this.layoutContent(100);
}
};
FSelectableItemClass.prototype.drawItem = function (itmObj, selected) {
this.displayContent(itmObj, selected);
if ((this.highlighted != selected) || ((this.controller.focused != this.oldFocus) && (selected))) {
this.setHighlighted(selected);
}
this.oldFocus = this.controller.focused;
};
FSelectableItemClass.prototype.setSize = function (width, height) {
var _local2 = -16384;
this.width = width;
this.layoutContent(width);
this.attachMovie("FHighlightSymbol", "highlight_mc", _local2);
this.highlight_mc._x = 0.5;
this.highlight_mc._width = width - 0.5;
this.highlight_mc._height = height;
this.highlight_mc.controller = this;
this.highlight_mc._alpha = 0;
this.highlight_mc.trackAsMenu = true;
this.highlight_mc.onPress = function () {
if (this.controller.enable) {
this.controller.controller.clickHandler(this.controller.itemNum);
}
};
this.highlight_mc.onDragOver = function () {
if (this.controller.controller.focused) {
this.onPress();
}
};
this.highlight_mc.useHandCursor = false;
this.highlight_mc.trackAsMenu = true;
};
FSelectableItemClass.prototype.setEnabled = function (enabledFlag) {
this.enable = enabledFlag;
this.fLabel_mc.setEnabled(enabledFlag);
this.highlight_mc.gotoAndStop((enabledFlag ? "unfocused" : "disabled"));
};
FSelectableItemClass.prototype.layoutContent = function (width) {
this.attachMovie("FLabelSymbol", "fLabel_mc", 2, {hostComponent:this.controller});
this.fLabel_mc._x = 2;
this.fLabel_mc._y = 0;
this.fLabel_mc.setSize(width - 2);
this.fLabel_mc.labelField.selectable = false;
};
FSelectableItemClass.prototype.displayContent = function (itmObj, selected) {
var _local2 = "";
if (itmObj.label != undefined) {
_local2 = itmObj.label;
} else if (typeof(itmObj) == "object") {
for (var _local4 in itmObj) {
if (_local4 != "__ID__") {
_local2 = (itmObj[_local4] + ", ") + _local2;
}
}
_local2 = _local2.substring(0, _local2.length - 2);
} else {
_local2 = itmObj;
}
if (this.fLabel_mc.labelField.text != _local2) {
this.fLabel_mc.setLabel(_local2);
}
var _local5 = (selected ? (this.controller.styleTable.textSelected.value) : (this.controller.styleTable.textColor.value));
if (_local5 == undefined) {
_local5 = (selected ? 16777215 : 0);
}
this.fLabel_mc.setColor(_local5);
};
FSelectableItemClass.prototype.getItemIndex = function () {
return(this.controller.getScrollPosition() + this.itemNum);
};
FSelectableItemClass.prototype.getItemModel = function () {
return(this.controller.getItemAt(this.getItemIndex()));
};
FSelectableItemClass.prototype.getHostDataProvider = function () {
return(this.controller.dataProvider);
};
FSelectableItemClass.prototype.setHighlighted = function (flag) {
fade = this.controller.styleTable.fadeRate.value;
if (((fade == undefined) || (fade == 0)) || (!flag)) {
this.highlight_mc._alpha = (flag ? 100 : 0);
delete this.onEnterFrame;
} else {
this.fadeN = fade;
this.fadeX = 1;
this.highlight_mc._alpha = 20;
this.onEnterFrame = function () {
this.highlight_mc._alpha = (60 * Math.sqrt((this.fadeX++) / this.fadeN)) + 40;
if (this.fadeX > this.fadeN) {
delete this.onEnterFrame;
}
};
}
this.highlighted = flag;
};
#endinitclip
Symbol 269 MovieClip [FSelectableListSymbol] Frame 1
#initclip 19
function FSelectableListClass() {
this.init();
}
FSelectableListClass.prototype = new FUIComponentClass();
FSelectableListClass.prototype.init = function () {
super.init();
this.enable = true;
this.selected = new Array();
this.topDisplayed = (this.numDisplayed = 0);
this.lastSelected = 0;
this.tabChildren = false;
if (this._name != undefined) {
this.dataProvider = new DataProviderClass();
this.dataProvider.addView(this);
}
};
FSelectableListClass.prototype.addItemAt = function (index, label, data) {
if (index < 0) {
return(undefined);
}
this.dataProvider.addItemAt(index, {label:label, data:data});
};
FSelectableListClass.prototype.addItem = function (label, data) {
this.dataProvider.addItem({label:label, data:data});
};
FSelectableListClass.prototype.removeItemAt = function (index) {
this.selectHolder = this.getSelectedIndex();
var _local2 = this.getItemAt(index);
this.dataProvider.removeItemAt(index);
return(_local2);
};
FSelectableListClass.prototype.removeAll = function () {
this.dataProvider.removeAll();
};
FSelectableListClass.prototype.replaceItemAt = function (index, newLabel, newData) {
this.dataProvider.replaceItemAt(index, {label:newLabel, data:newData});
};
FSelectableListClass.prototype.sortItemsBy = function (fieldName, order) {
this.lastSelID = this.dataProvider.getItemID(this.lastSelected);
this.dataProvider.sortItemsBy(fieldName, order);
};
FSelectableListClass.prototype.getLength = function () {
return(this.dataProvider.getLength());
};
FSelectableListClass.prototype.getSelectedIndex = function () {
for (var _local3 in this.selected) {
var _local2 = this.selected[_local3].sIndex;
if (_local2 != undefined) {
return(_local2);
}
}
};
FSelectableListClass.prototype.getSelectedItem = function () {
return(this.getItemAt(this.getSelectedIndex()));
};
FSelectableListClass.prototype.getItemAt = function (index) {
return(this.dataProvider.getItemAt(index));
};
FSelectableListClass.prototype.getEnabled = function () {
return(this.enable);
};
FSelectableListClass.prototype.getValue = function () {
var _local2 = this.getSelectedItem();
return(((_local2.data == undefined) ? (_local2.label) : (_local2.data)));
};
FSelectableListClass.prototype.setSelectedIndex = function (index, flag) {
if (((index >= 0) && (index < this.getLength())) && (this.enable)) {
this.clearSelected();
this.selectItem(index, true);
this.lastSelected = index;
this.invalidate("updateControl");
if (flag != false) {
this.executeCallBack();
}
}
};
FSelectableListClass.prototype.setDataProvider = function (obj) {
this.setScrollPosition(0);
this.clearSelected();
if (obj instanceof Array) {
this.dataProvider = new DataProviderClass();
var _local2 = 0;
while (_local2 < obj.length) {
var _local4 = ((typeof(obj[_local2]) == "string") ? ({label:obj[_local2]}) : (obj[_local2]));
this.dataProvider.addItem(_local4);
_local2++;
}
} else {
this.dataProvider = obj;
}
this.dataProvider.addView(this);
};
FSelectableListClass.prototype.setItemSymbol = function (linkID) {
this.tmpPos = this.getScrollPosition();
this.itemSymbol = linkID;
this.invalidate("setSize");
this.setScrollPosition(this.tmpPos);
};
FSelectableListClass.prototype.setEnabled = function (enabledFlag) {
this.cleanUI();
super.setEnabled(enabledFlag);
this.enable = enabledFlag;
this.boundingBox_mc.gotoAndStop((this.enable ? "enabled" : "disabled"));
var _local4 = Math.min(this.numDisplayed, this.getLength());
var _local3 = 0;
while (_local3 < _local4) {
this.container_mc[("fListItem" + _local3) + "_mc"].setEnabled(this.enable);
_local3++;
}
if (this.enable) {
this.invalidate("updateControl");
}
};
FSelectableListClass.prototype.updateControl = function () {
var _local2 = 0;
while (_local2 < this.numDisplayed) {
this.container_mc[("fListItem" + _local2) + "_mc"].drawItem(this.getItemAt(this.topDisplayed + _local2), this.isSelected(this.topDisplayed + _local2));
_local2++;
}
};
FSelectableListClass.prototype.setSize = function (w, h) {
super.setSize(w, h);
this.boundingBox_mc._xscale = (this.boundingBox_mc._yscale = 100);
this.boundingBox_mc._xscale = (this.width * 100) / this.boundingBox_mc._width;
this.boundingBox_mc._yscale = (this.height * 100) / this.boundingBox_mc._height;
var _local3 = 0;
while (_local3 < this.numDisplayed) {
this.container_mc.attachMovie(this.itemSymbol, ("fListItem" + _local3) + "_mc", 10 + _local3, {controller:this, itemNum:_local3});
var _local4 = this.container_mc[("fListItem" + _local3) + "_mc"];
var _local5 = ((this.scrollOffset == undefined) ? 0 : (this.scrollOffset));
_local4.setSize(this.width - _local5, this.itmHgt);
_local4._y = (this.itmHgt - 2) * _local3;
_local3++;
}
this.updateControl();
};
FSelectableListClass.prototype.modelChanged = function (eventObj) {
var _local4 = eventObj.firstRow;
var _local6 = eventObj.lastRow;
var _local8 = eventObj.event;
if (_local8 == "addRows") {
for (var _local2 in this.selected) {
if ((this.selected[_local2].sIndex != undefined) && (this.selected[_local2].sIndex >= _local4)) {
this.selected[_local2].sIndex = this.selected[_local2].sIndex + ((_local6 - _local4) + 1);
this.setSelectedIndex(this.selected[_local2].sIndex, false);
}
}
} else if (_local8 == "deleteRows") {
if (_local4 == _local6) {
var _local5 = _local4;
if (this.selectHolder == _local5) {
this.selectionDeleted = true;
}
if (((this.topDisplayed + this.numDisplayed) >= this.getLength()) && (this.topDisplayed > 0)) {
this.topDisplayed--;
if (this.selectionDeleted && ((_local5 - 1) >= 0)) {
this.setSelectedIndex(_local5 - 1, false);
}
} else if (this.selectionDeleted) {
var _local7 = this.getLength();
if (((_local5 == (_local7 - 1)) && (_local7 > 1)) || (_local5 > (_local7 / 2))) {
this.setSelectedIndex(_local5 - 1, false);
} else {
this.setSelectedIndex(_local5, false);
}
}
for (var _local2 in this.selected) {
if (this.selected[_local2].sIndex > _local4) {
this.selected[_local2].sIndex--;
}
}
} else {
this.clearSelected();
this.topDisplayed = 0;
}
} else if (_local8 == "sort") {
var _local7 = this.getLength();
var _local2 = 0;
while (_local2 < _local7) {
if (this.isSelected(_local2)) {
var _local3 = this.dataProvider.getItemID(_local2);
if (_local3 == this.lastSelID) {
this.lastSelected = _local2;
}
this.selected[String(_local3)].sIndex = _local2;
}
_local2++;
}
}
this.invalidate("updateControl");
};
FSelectableListClass.prototype.measureItmHgt = function () {
this.attachMovie(this.itemSymbol, "tmpItem_mc", 0, {controller:this});
this.tmpItem_mc.drawItem({label:"Sizer: PjtTopg"}, false);
this.itmHgt = this.tmpItem_mc._height;
this.tmpItem_mc.removeMovieClip();
};
FSelectableListClass.prototype.selectItem = function (index, selectedFlag) {
if (selectedFlag && (!this.isSelected(index))) {
this.selected[String(this.dataProvider.getItemID(index))] = {sIndex:index};
} else if (!selectedFlag) {
delete this.selected[String(this.dataProvider.getItemID(index))];
}
};
FSelectableListClass.prototype.isSelected = function (index) {
return(this.selected[String(this.dataProvider.getItemID(index))].sIndex != undefined);
};
FSelectableListClass.prototype.clearSelected = function () {
for (var _local3 in this.selected) {
var _local2 = this.selected[_local3].sIndex;
if (((_local2 != undefined) && (this.topDisplayed <= _local2)) && (_local2 < (this.topDisplayed + this.numDisplayed))) {
this.container_mc[("fListItem" + (_local2 - this.topDisplayed)) + "_mc"].drawItem(this.getItemAt(_local2), false);
}
}
delete this.selected;
this.selected = new Array();
};
FSelectableListClass.prototype.selectionHandler = function (itemNum) {
var _local2 = this.topDisplayed + itemNum;
if (this.getItemAt(_local2 == undefined)) {
this.changeFlag = false;
return(undefined);
}
this.changeFlag = true;
this.clearSelected();
this.selectItem(_local2, true);
this.container_mc[("fListItem" + itemNum) + "_mc"].drawItem(this.getItemAt(_local2), this.isSelected(_local2));
};
FSelectableListClass.prototype.moveSelBy = function (incr) {
var _local3 = this.getSelectedIndex();
var _local2 = _local3 + incr;
_local2 = Math.max(0, _local2);
_local2 = Math.min(this.getLength() - 1, _local2);
if (_local2 == _local3) {
return(undefined);
}
if ((_local3 < this.topDisplayed) || (_local3 >= (this.topDisplayed + this.numDisplayed))) {
this.setScrollPosition(_local3);
}
if ((_local2 >= (this.topDisplayed + this.numDisplayed)) || (_local2 < this.topDisplayed)) {
this.setScrollPosition(this.topDisplayed + incr);
}
this.selectionHandler(_local2 - this.topDisplayed);
};
FSelectableListClass.prototype.clickHandler = function (itmNum) {
this.focusRect.removeMovieClip();
if (!this.focused) {
this.pressFocus();
}
this.selectionHandler(itmNum);
this.onMouseUp = this.releaseHandler;
};
FSelectableListClass.prototype.releaseHandler = function () {
if (this.changeFlag) {
this.executeCallBack();
}
this.changeFlag = false;
this.onMouseUp = undefined;
};
FSelectableListClass.prototype.myOnSetFocus = function () {
super.myOnSetFocus();
var _local3 = 0;
while (_local3 < this.numDisplayed) {
this.container_mc[("fListItem" + _local3) + "_mc"].highlight_mc.gotoAndStop("enabled");
_local3++;
}
};
FSelectableListClass.prototype.myOnKillFocus = function () {
super.myOnKillFocus();
var _local3 = 0;
while (_local3 < this.numDisplayed) {
this.container_mc[("fListItem" + _local3) + "_mc"].highlight_mc.gotoAndStop("unfocused");
_local3++;
}
};
#endinitclip
Instance of Symbol 267 MovieClip [DataProviderSymbol] "dPAsset" in Symbol 269 MovieClip [FSelectableListSymbol] Frame 1
//component parameters
onClipEvent (construct) {
}
Instance of Symbol 268 MovieClip [FSelectableItemSymbol] "ItemAsset" in Symbol 269 MovieClip [FSelectableListSymbol] Frame 1
//component parameters
onClipEvent (construct) {
}
Symbol 270 MovieClip [FScrollSelectListSymbol] Frame 1
#initclip 21
function FScrollSelectListClass() {
this.init();
}
FScrollSelectListClass.prototype = new FSelectableListClass();
FScrollSelectListClass.prototype.getScrollPosition = function () {
return(this.topDisplayed);
};
FScrollSelectListClass.prototype.setScrollPosition = function (pos) {
if (this.enable) {
pos = Math.min(pos, this.getLength() - this.numDisplayed);
pos = Math.max(pos, 0);
this.scrollBar_mc.setScrollPosition(pos);
}
};
FScrollSelectListClass.prototype.setAutoHideScrollBar = function (flag) {
this.permaScrollBar = !flag;
this.setSize(this.width, this.height);
};
FScrollSelectListClass.prototype.setEnabled = function (enabledFlag) {
super.setEnabled(enabledFlag);
this.scrollBar_mc.setEnabled(this.enable);
};
FScrollSelectListClass.prototype.setSize = function (w, h) {
var _local3 = this.getScrollPosition();
super.setSize(w, h);
if (this.scrollBar_mc != undefined) {
this.removed = true;
}
this.scrollBar_mc = undefined;
this.initScrollBar();
this.setScrollPosition(_local3);
};
FScrollSelectListClass.prototype.modelChanged = function (eventObj) {
super.modelChanged(eventObj);
this.invalidate("initScrollBar");
};
FScrollSelectListClass.prototype.initScrollBar = function () {
if ((!this.permaScrollBar) && (this.getLength() <= this.numDisplayed)) {
if (this.removed) {
this.scrollBar_mc.removeMovieClip();
this.scrollBar_mc = undefined;
this.scrollOffset = undefined;
this.invalidate("setSize");
}
} else {
if (this.scrollBar_mc == undefined) {
this.container_mc.attachMovie("FScrollBarSymbol", "scrollBar_mc", 3000, {hostStyle:this.styleTable});
this.scrollBar_mc = this.container_mc.scrollBar_mc;
this.scrollBar_mc.setChangeHandler("scrollHandler", this);
this.scrollBar_mc.setSize(this.height);
this.scrollBar_mc._x = this.width - this.scrollBar_mc._width;
this.scrollBar_mc._y = 0;
this.scrollBar_mc.setLargeScroll(this.numDisplayed - 1);
this.scrollOffset = this.scrollBar_mc._width;
this.invalidate("setSize");
}
this.scrollBar_mc.setScrollProperties(this.numDisplayed, 0, this.getLength() - this.numDisplayed);
}
};
FScrollSelectListClass.prototype.scrollHandler = function (scrollBar) {
var _local2 = scrollBar.getScrollPosition();
this.topDisplayed = _local2;
if (this.lastPosition != _local2) {
this.updateControl();
}
this.lastPosition = _local2;
};
FScrollSelectListClass.prototype.clickHandler = function (itmNum) {
super.clickHandler(itmNum);
if ((this.dragScrolling == undefined) && (this.scrollBar_mc != undefined)) {
this.dragScrolling = setInterval(this, "dragScroll", 15);
}
};
FScrollSelectListClass.prototype.releaseHandler = function () {
clearInterval(this.dragScrolling);
this.dragScrolling = undefined;
super.releaseHandler();
};
FScrollSelectListClass.prototype.dragScroll = function () {
clearInterval(this.dragScrolling);
if (this.container_mc._ymouse < 0) {
this.setScrollPosition(this.getScrollPosition() - 1);
this.selectionHandler(0);
this.scrollInterval = Math.max(25, (-23.8 * (-this.container_mc._ymouse)) + 500);
this.dragScrolling = setInterval(this, "dragScroll", this.scrollInterval);
} else if (this.container_mc._ymouse > ((this.itmHgt - 2) * this.numDisplayed)) {
this.setScrollPosition(this.getScrollPosition() + 1);
this.selectionHandler(this.numDisplayed - 1);
this.scrollInterval = Math.max(25, (-23.8 * Math.abs((this.container_mc._ymouse - ((this.itmHgt - 2) * this.numDisplayed)) - 2)) + 500);
this.dragScrolling = setInterval(this, "dragScroll", this.scrollInterval);
} else {
this.dragScrolling = setInterval(this, "dragScroll", 15);
}
};
FScrollSelectListClass.prototype.myOnKeyDown = function () {
if (this.focused) {
this.keyCodes = new Array(40, 38, 34, 33, 36, 35);
this.keyIncrs = new Array(1, -1, this.numDisplayed - 1, -(this.numDisplayed - 1), -this.getLength(), this.getLength());
var _local2 = 0;
while (_local2 < this.keyCodes.length) {
if (Key.isDown(this.keyCodes[_local2])) {
this.moveSelBy(this.keyIncrs[_local2]);
return(undefined);
}
_local2++;
}
this.findInputText();
}
};
FScrollSelectListClass.prototype.findInputText = function () {
var _local2 = Key.getAscii();
if ((_local2 >= 33) && (_local2 <= 126)) {
this.findString(String.fromCharCode(_local2));
}
};
FScrollSelectListClass.prototype.findString = function (str) {
if (this.getLength() == 0) {
return(undefined);
}
var _local4 = this.getSelectedIndex();
var _local6 = 0;
var _local2 = _local4 + 1;
while (_local2 != _local4) {
var _local3 = this.getItemAt(_local2).label.substring(0, str.length);
if ((str == _local3) || (str.toUpperCase() == _local3.toUpperCase())) {
_local6 = _local2 - _local4;
break;
}
if (_local2 >= (this.getLength() - 1)) {
_local2 = -1;
}
_local2++;
}
if (_local6 != 0) {
this.moveSelBy(_local6);
}
};
#endinitclip
Instance of Symbol 265 MovieClip [FScrollBarSymbol] "scrollBarAsset" in Symbol 270 MovieClip [FScrollSelectListSymbol] Frame 1
//component parameters
onClipEvent (construct) {
_targetInstanceName = "";
horizontal = false;
}
onClipEvent (load) {
this._width = (this._height = 1);
}
Instance of Symbol 269 MovieClip [FSelectableListSymbol] "superClassAsset" in Symbol 270 MovieClip [FScrollSelectListSymbol] Frame 1
//component parameters
onClipEvent (construct) {
}
Symbol 273 MovieClip [FListBoxSymbol] Frame 1
#initclip 23
function FListBoxClass() {
this.itemSymbol = "FListItemSymbol";
this.init();
this.permaScrollBar = true;
var _local2 = 0;
while (_local2 < this.labels.length) {
this.addItem(this.labels[_local2], this.data[_local2]);
_local2++;
}
this.boundingBox_mc.gotoAndStop(1);
this.width = this._width;
this.height = this._height;
this._yscale = (this._xscale = 100);
this.setSize(this.width, this.height);
if (this.changeHandler.length > 0) {
this.setChangeHandler(this.changeHandler);
}
}
FListBoxClass.prototype = new FScrollSelectListClass();
Object.registerClass("FListBoxSymbol", FListBoxClass);
FListBoxClass.prototype.getSelectedIndices = function () {
var _local2 = new Array();
for (var _local3 in this.selected) {
_local2.push(this.selected[_local3].sIndex);
}
return(((_local2.length > 0) ? (_local2) : undefined));
};
FListBoxClass.prototype.getSelectedItems = function () {
var _local3 = this.getSelectedIndices();
var _local4 = new Array();
var _local2 = 0;
while (_local2 < _local3.length) {
_local4.push(this.getItemAt(_local3[_local2]));
_local2++;
}
return(((_local4.length > 0) ? (_local4) : undefined));
};
FListBoxClass.prototype.getSelectMultiple = function () {
return(this.selectMultiple);
};
FListBoxClass.prototype.getRowCount = function () {
return(this.numDisplayed);
};
FListBoxClass.prototype.setSelectedIndices = function (indexArray) {
this.clearSelected();
var _local2 = 0;
while (_local2 < indexArray.length) {
this.selectItem(indexArray[_local2], true);
_local2++;
}
this.updateControl();
};
FListBoxClass.prototype.setSelectMultiple = function (flag) {
this.selectMultiple = flag;
};
FListBoxClass.prototype.setRowCount = function (count) {
var _local2 = (count * (this.itmHgt - 2)) + 2;
this.setSize(this.width, _local2);
};
FListBoxClass.prototype.setWidth = function (wdt) {
this.setSize(wdt, this.height);
};
FListBoxClass.prototype.setSize = function (w, h) {
if (!this.enable) {
return(undefined);
}
w = Math.max(((w == undefined) ? 0 : (w)), 20);
h = Math.max(((h == undefined) ? 0 : (h)), 40);
this.container_mc.removeMovieClip();
this.container_mc = this.createEmptyMovieClip("container", 3);
this.measureItmHgt();
this.numDisplayed = Math.floor(h / (this.itmHgt - 2));
this.height = (this.numDisplayed * (this.itmHgt - 2)) + 2;
super.setSize(w, this.height);
};
FListBoxClass.prototype.removeItemAt = function (index) {
this.selectHolder = this.getSelectedIndices();
return(super.removeItemAt(index));
};
FListBoxClass.prototype.selectionHandler = function (itemNum) {
if (this.clickFilter) {
var _local3 = this.topDisplayed + itemNum;
if (this.getItemAt(_local3) == undefined) {
this.changeFlag = false;
return(undefined);
}
this.changeFlag = true;
if (((!this.selectMultiple) && (!Key.isDown(17))) || ((!Key.isDown(16)) && (!Key.isDown(17)))) {
this.clearSelected();
this.selectItem(_local3, true);
this.lastSelected = _local3;
this.container_mc[("fListItem" + itemNum) + "_mc"].drawItem(this.getItemAt(_local3), this.isSelected(_local3));
} else if (Key.isDown(16) && (this.selectMultiple)) {
if (this.lastSelected == -1) {
this.lastSelected = _local3;
}
var _local4 = ((this.lastSelected < _local3) ? 1 : -1);
this.clearSelected();
var _local2 = this.lastSelected;
while (_local2 != _local3) {
this.selectItem(_local2, true);
if ((_local2 >= this.topDisplayed) && (_local2 < (this.topDisplayed + this.numDisplayed))) {
this.container_mc[("fListItem" + (_local2 - this.topDisplayed)) + "_mc"].drawItem(this.getItemAt(_local2), this.isSelected(_local2));
}
_local2 = _local2 + _local4;
}
this.selectItem(_local3, true);
this.container_mc[("fListItem" + (_local3 - this.topDisplayed)) + "_mc"].drawItem(this.getItemAt(_local3), this.isSelected(_local3));
} else if (Key.isDown(17)) {
var _local6 = this.isSelected(_local3);
if (!this.selectMultiple) {
this.clearSelected();
}
if (!((!this.selectMultiple) && (_local6))) {
this.selectItem(_local3, !_local6);
this.container_mc[("fListItem" + itemNum) + "_mc"].drawItem(this.getItemAt(this.topDisplayed + itemNum), this.isSelected(this.topDisplayed + itemNum));
}
this.lastSelected = _local3;
}
} else {
this.clickFilter = true;
}
};
FListBoxClass.prototype.moveSelBy = function (itemNum) {
super.moveSelBy(itemNum);
this.releaseHandler();
};
#endinitclip
this.deadPreview._visible = false;
Instance of Symbol 270 MovieClip [FScrollSelectListSymbol] "superClassAsset" in Symbol 273 MovieClip [FListBoxSymbol] Frame 1
//component parameters
onClipEvent (construct) {
}
Symbol 340 MovieClip [__Packages.it.gotoandplay.smartfoxserver.SmartFoxClient] Frame 0
class it.gotoandplay.smartfoxserver.SmartFoxClient extends XMLSocket
{
var objRef, os, isConnected, debug, arrayTags, messageHandlers, httpConnection, onConnect, onData, onXML, onClose, fpMajorVersion, pollingDelayFn, roomList, buddyList, myBuddyVars, activeRoomId, myUserId, myUserName, playerId, changingRoom, amIModerator, configLoader, onConfigLoadFailure, ipAddress, blueBoxIpAddress, port, onConfigLoadSuccess, onBuddyListUpdate, onBuddyList, t1, socketConnectionTimeoutThread, onConnection, onConnectionLost, close;
function SmartFoxClient (objRef) {
super();
this.objRef = objRef;
os = it.gotoandplay.smartfoxserver.ObjectSerializer.getInstance();
isConnected = false;
debug = false;
initialize();
arrayTags = {uLs:true, rmList:true, vars:true, bList:true, vs:true, mv:true};
messageHandlers = new Object();
httpConnection = new it.gotoandplay.smartfoxserver.http.HttpConnection(mx.utils.Delegate.create(this, handleHttpConnect), mx.utils.Delegate.create(this, handleHttpClose), mx.utils.Delegate.create(this, handleHttpData), mx.utils.Delegate.create(this, handleHttpError));
onConnect = connectionEstablished;
onData = gotData;
onXML = xmlReceived;
onClose = connectionClosed;
fpMajorVersion = getFpMajorVersion();
if (fpMajorVersion < 8) {
pollingDelayFn = _global.setInterval;
} else {
pollingDelayFn = _global.setTimeout;
}
setupMessageHandlers();
}
function get httpPollSpeed() {
return(_httpPollSpeed);
}
function set httpPollSpeed(sp) {
if ((sp >= MIN_POLL_SPEED) && (sp <= MAX_POLL_SPEED)) {
_httpPollSpeed = sp;
}
//return(httpPollSpeed);
}
function getFpMajorVersion() {
var _local1 = System.capabilities.version.indexOf(",");
return(Number(System.capabilities.version.substr(_local1 - 1, 1)));
}
function initialize(isLogout) {
if (isLogout == undefined) {
isLogout = false;
}
roomList = {};
buddyList = [];
myBuddyVars = [];
activeRoomId = null;
myUserId = null;
myUserName = "";
playerId = null;
changingRoom = false;
amIModerator = false;
if (!isLogout) {
isConnected = false;
isHttpMode = false;
preConnection = true;
}
}
function loadConfig(configFile, autoConnect) {
if (configFile == undefined) {
configFile = DEFAULT_CONFIG_FILE;
}
if (autoConnect == undefined) {
autoConnectOnConfigSuccess = DEFAULT_AUTO_CONNECT;
} else {
autoConnectOnConfigSuccess = autoConnect;
}
configLoader = new XML();
configLoader.ignoreWhite = true;
configLoader.onLoad = mx.utils.Delegate.create(this, onConfigLoadSucceeded);
configLoader.load(configFile);
}
function onConfigLoadSucceeded(ok) {
if (!ok) {
onConfigLoadFailure("Could not load config file!");
return(undefined);
}
var _local6 = configLoader.childNodes[0].childNodes;
var _local4 = 0;
while (_local4 < _local6.length) {
var _local5 = _local6[_local4];
var _local2 = _local5.nodeName.toLowerCase();
var _local3 = _local5.firstChild.nodeValue;
if (_local2 == "ip") {
ipAddress = (blueBoxIpAddress = _local3);
} else if (_local2 == "port") {
port = Number(_local3);
} else if (_local2 == "zone") {
defaultZone = _local3;
} else if (_local2 == "smartconnect") {
smartConnect = ((_local3 == "true") ? true : false);
} else if (_local2 == "blueboxipaddress") {
blueBoxIpAddress = _local3;
} else if (_local2 == "blueboxport") {
blueBoxPort = _local3;
} else if (_local2 == "debug") {
debug = ((_local3 == "true") ? true : false);
} else if (_local2 == "httpport") {
httpPort = Number(_local3);
} else if (_local2 == "httppollspeed") {
httpPollSpeed = (Number(_local3));
} else if (_local2 == "socketconnectiontimeout") {
socketConnectionTimeout = Number(_local3);
} else if (_local2 == "rawprotocolseparator") {
rawProtocolSeparator = _local3;
}
_local4++;
}
if (autoConnectOnConfigSuccess) {
connect(ipAddress, port);
} else {
onConfigLoadSuccess();
}
}
function onConfigLoadFailed(code) {
if (code == 404) {
onConfigLoadFailure("Could not find configuration file.");
} else {
onConfigLoadFailure("Could not load configuration file. Http status = " + code);
}
}
function getVersion() {
return((((majVersion + ".") + minVersion) + ".") + subVersion);
}
function connected() {
return(isConnected);
}
function getConnectionMode() {
var _local2 = CONNECTION_MODE_DISCONNECTED;
if (isConnected) {
if (isHttpMode) {
_local2 = CONNECTION_MODE_HTTP;
} else {
_local2 = CONNECTION_MODE_SOCKET;
}
}
return(_local2);
}
function setupMessageHandlers() {
addMessageHandler("sys", handleSysMessages);
addMessageHandler("xt", handleExtensionMessages);
}
function addMessageHandler(handlerId, handlerMethod) {
if (messageHandlers[handlerId] == undefined) {
messageHandlers[handlerId] = new Object();
messageHandlers[handlerId].handleMessage = handlerMethod;
} else {
trace(("Warning: [" + handlerId) + "] handler could not be created. A handler with this name already exist!");
}
}
function isModerator() {
return(amIModerator);
}
function handleSysMessages(xmlObj, scope) {
var _local9 = xmlObj.attributes.action;
var _local20 = xmlObj.attributes.r;
if (_local9 == "apiOK") {
scope.isConnected = true;
scope.onConnection(true);
} else if (_local9 == "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 (_local9 == "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 (_local9 == "logKO") {
var _local62 = xmlObj.login.attributes.e;
scope.onLogin({success:false, name:"", error:_local62});
} else if (_local9 == "logout") {
scope.initialize(true);
scope.onLogout();
} else if (_local9 == "rmList") {
var _local10 = xmlObj.rmList.rmList;
scope.roomList = new Array();
for (var _local43 in _local10) {
var _local6 = _local10[_local43].attributes.id;
var _local2 = _local10[_local43].attributes;
var _local4 = _local2.id;
var _local22 = _local10[_local43].n.value;
var _local23 = Number(_local2.maxu);
var _local24 = Number(_local2.maxs);
var _local66 = (_local2.temp ? true : false);
var _local54 = (_local2.game ? true : false);
var _local30 = (_local2.priv ? true : false);
var _local31 = Number(_local2.ucnt);
var _local25 = Number(_local2.scnt);
var _local71 = (_local2.lmb ? true : false);
scope.roomList[_local6] = new it.gotoandplay.smartfoxserver.Room(_local4, _local22, _local23, _local24, _local66, _local54, _local30);
scope.roomList[_local6].userCount = _local31;
scope.roomList[_local6].specCount = _local25;
scope.roomList[_local6].setIsLimbo(_local71);
var _local3 = _local10[_local43].vars.vars;
var _local37 = 0;
while (_local37 < _local3.length) {
var _local28 = _local3[_local37].attributes.n;
var _local12 = _local3[_local37].attributes.t;
var _local11 = _local3[_local37].value;
var _local13;
if (_local12 == "b") {
_local13 = Boolean;
_local11 = Number(_local11);
} else if (_local12 == "n") {
_local13 = Number;
} else if (_local12 == "s") {
_local13 = String;
} else if (_local12 == "x") {
_local13 = function (x) {
return(null);
};
}
scope.roomList[_local6].variables[_local28] = _local13(_local11);
_local37++;
}
}
scope.onRoomListUpdate(scope.roomList);
} else if (_local9 == "joinOK") {
var _local49 = xmlObj.uLs.attributes.r;
var _local7 = xmlObj.uLs.uLs;
var _local16 = xmlObj.vars.vars;
scope.activeRoomId = Number(_local49);
var _local50 = scope.roomList[_local49];
_local50.userList = new Object();
scope.playerId = xmlObj.pid.attributes.id;
_local50.setMyPlayerIndex(xmlObj.pid.attributes.id);
_local50.variables = new Object();
var _local37 = 0;
while (_local37 < _local16.length) {
var _local28 = _local16[_local37].attributes.n;
var _local12 = _local16[_local37].attributes.t;
var _local11 = _local16[_local37].value;
if (_local12 == "b") {
var _local13 = Boolean;
_local11 = Number(_local11);
} else if (_local12 == "n") {
var _local13 = Number;
} else if (_local12 == "s") {
var _local13 = String;
} else if (_local12 == "x") {
var _local13 = function (x) {
return(null);
};
}
_local50.variables[_local28] = _local13(_local11);
_local37++;
}
var _local72 = 0;
var _local59 = 0;
var _local43 = 0;
while (_local43 < _local7.length) {
var _local22 = _local7[_local43].n.value;
var _local4 = _local7[_local43].attributes.i;
var _local63 = _local7[_local43].attributes.m;
var _local75 = _local7[_local43].attributes.s;
var _local51 = _local7[_local43].attributes.p;
_local50.userList[_local4] = new it.gotoandplay.smartfoxserver.User(_local4, _local22);
_local50.userList[_local4].isMod = ((_local63 == "1") ? true : false);
_local50.userList[_local4].isSpec = ((_local75 == "1") ? true : false);
_local50.userList[_local4].pid = ((_local51 == undefined) ? -1 : _local51);
if (_local50.isGame() && (_local75 == "1")) {
_local59++;
} else {
_local72++;
}
var _local14 = _local7[_local43].vars.vars;
_local50.userList[_local4].variables = {};
var _local41 = _local50.userList[_local4].variables;
_local37 = 0;
while (_local37 < _local14.length) {
var _local28 = _local14[_local37].attributes.n;
var _local12 = _local14[_local37].attributes.t;
var _local11 = _local14[_local37].value;
if (_local12 == "b") {
var _local13 = Boolean;
_local11 = Number(_local11);
} else if (_local12 == "n") {
var _local13 = Number;
} else if (_local12 == "s") {
var _local13 = String;
} else if (_local12 == "x") {
var _local13 = function (x) {
return(null);
};
}
_local41[_local28] = _local13(_local11);
_local37++;
}
_local43++;
}
_local50.userCount = _local72;
_local50.specCount = _local59;
scope.changingRoom = false;
scope.onJoinRoom(scope.roomList[_local49]);
} else if (_local9 == "joinKO") {
scope.changingRoom = false;
var _local65 = xmlObj.error.attributes.msg;
scope.onJoinRoomError(_local65);
} else if (_local9 == "uER") {
var _local69 = xmlObj.u.attributes.i;
var _local64 = xmlObj.u.n.value;
var _local63 = xmlObj.u.attributes.m;
var _local75 = xmlObj.u.attributes.s;
var _local51 = xmlObj.u.attributes.p;
var _local50 = scope.roomList[_local20];
_local50.userList[_local69] = new it.gotoandplay.smartfoxserver.User(_local69, _local64);
_local50.userList[_local69].isMod = ((_local63 == "1") ? true : false);
_local50.userList[_local69].isSpec = ((_local75 == "1") ? true : false);
_local50.userList[_local69].pid = ((_local51 == undefined) ? -1 : _local51);
if (_local50.isGame() && (_local75 == "1")) {
_local50.specCount++;
} else {
_local50.userCount++;
}
var _local14 = xmlObj.u.vars.vars;
_local50.userList[_local69].variables = {};
var _local41 = _local50.userList[_local69].variables;
var _local37 = 0;
while (_local37 < _local14.length) {
var _local28 = _local14[_local37].attributes.n;
var _local12 = _local14[_local37].attributes.t;
var _local11 = _local14[_local37].value;
if (_local12 == "b") {
var _local13 = Boolean;
_local11 = Number(_local11);
} else if (_local12 == "n") {
var _local13 = Number;
} else if (_local12 == "s") {
var _local13 = String;
} else if (_local12 == "x") {
var _local13 = function (x) {
return(null);
};
}
_local41[_local28] = _local13(_local11);
_local37++;
}
scope.onUserEnterRoom(_local20, _local50.userList[_local69]);
} else if (_local9 == "userGone") {
var _local69 = xmlObj.user.attributes.id;
var _local50 = scope.roomList[_local20];
var _local64 = _local50.userList[_local69].name;
var _local75 = _local50.userList[_local69].isSpec;
delete _local50.userList[_local69];
if (_local50.isGame() && _local75) {
_local50.specCount--;
} else {
_local50.userCount--;
}
scope.onUserLeaveRoom(_local20, _local69, _local64);
} else if (_local9 == "pubMsg") {
var _local69 = xmlObj.user.attributes.id;
var _local47 = xmlObj.txt.value;
_local47 = scope.os.decodeEntities(_local47.toString());
scope.onPublicMessage(_local47.toString(), scope.roomList[_local20].userList[_local69], _local20);
} else if (_local9 == "prvMsg") {
var _local69 = xmlObj.user.attributes.id;
var _local47 = xmlObj.txt.value;
_local47 = scope.os.decodeEntities(_local47);
scope.onPrivateMessage(_local47.toString(), scope.roomList[_local20].userList[_local69], _local69, _local20);
} else if (_local9 == "dmnMsg") {
var _local69 = xmlObj.user.attributes.id;
var _local47 = xmlObj.txt.value;
_local47 = scope.os.decodeEntities(_local47);
scope.onAdminMessage(_local47.toString(), scope.roomList[_local20].userList[_local69]);
} else if (_local9 == "modMsg") {
var _local69 = xmlObj.user.attributes.id;
var _local47 = xmlObj.txt.value;
_local47 = scope.os.decodeEntities(_local47);
scope.onModeratorMessage(_local47.toString(), scope.roomList[_local20].userList[_local69]);
} else if (_local9 == "dataObj") {
var _local73 = xmlObj.user.attributes.id;
var _local60 = xmlObj.dataObj.value;
var _local61 = scope.os.deserialize(_local60);
scope.onObjectReceived(_local61, scope.roomList[_local20].userList[_local73]);
} else if (_local9 == "uVarsUpdate") {
var _local69 = xmlObj.user.attributes.id;
var _local15 = xmlObj.vars.vars;
var _local33 = scope.roomList[_local20].userList[_local69];
if (_local33.variables == undefined) {
_local33.variables = {};
}
var _local34 = [];
var _local37 = 0;
while (_local37 < _local15.length) {
var _local28 = _local15[_local37].attributes.n;
var _local12 = _local15[_local37].attributes.t;
var _local11 = _local15[_local37].value;
_local34.push(_local28);
_local34[_local28] = true;
if (_local12 == "x") {
delete _local33.variables[_local28];
} else {
if (_local12 == "b") {
var _local13 = Boolean;
_local11 = Number(_local11);
} else if (_local12 == "n") {
var _local13 = Number;
} else if (_local12 == "s") {
var _local13 = String;
}
_local33.variables[_local28] = _local13(_local11);
}
_local37++;
}
scope.onUserVariablesUpdate(_local33, _local34);
} else if (_local9 == "rVarsUpdate") {
var _local15 = xmlObj.vars.vars;
var _local50 = scope.roomList[_local20];
var _local34 = [];
if (_local50.variables == undefined) {
_local50.variables = new Object();
}
var _local37 = 0;
while (_local37 < _local15.length) {
var _local28 = _local15[_local37].attributes.n;
var _local12 = _local15[_local37].attributes.t;
var _local11 = _local15[_local37].value;
_local34.push(_local28);
_local34[_local28] = true;
if (_local12 == "x") {
delete _local50.variables[_local28];
} else {
if (_local12 == "b") {
var _local13 = Boolean;
_local11 = Number(_local11);
} else if (_local12 == "n") {
var _local13 = Number;
} else if (_local12 == "s") {
var _local13 = String;
}
_local50.variables[_local28] = _local13(_local11);
}
_local37++;
}
scope.onRoomVariablesUpdate(_local50, _local34);
} else if (_local9 == "createRmKO") {
var _local62 = xmlObj.room.attributes.e;
scope.onCreateRoomError(_local62);
} else if (_local9 == "uCount") {
var _local72 = xmlObj.attributes.u;
var _local59 = xmlObj.attributes.s;
var _local44 = scope.roomList[_local20];
_local44.userCount = Number(_local72);
_local44.specCount = Number(_local59);
scope.onUserCountChange(_local44);
} else if (_local9 == "roomAdd") {
var _local38 = xmlObj.rm.attributes;
var _local52 = _local38.id;
var _local67 = xmlObj.rm.name.value;
var _local74 = Number(_local38.max);
var _local58 = Number(_local38.spec);
var _local66 = (_local38.temp ? true : false);
var _local54 = (_local38.game ? true : false);
var _local68 = (_local38.priv ? true : false);
var _local71 = (_local38.limbo ? true : false);
var _local36 = new it.gotoandplay.smartfoxserver.Room(_local52, _local67, _local74, _local58, _local66, _local54, _local68);
_local36.setIsLimbo(_local71);
scope.roomList[_local52] = _local36;
var _local15 = xmlObj.rm.vars.vars;
_local36.variables = new Object();
var _local37 = 0;
while (_local37 < _local15.length) {
var _local28 = _local15[_local37].attributes.n;
var _local12 = _local15[_local37].attributes.t;
var _local11 = _local15[_local37].value;
if (_local12 == "b") {
var _local13 = Boolean;
_local11 = Number(_local11);
} else if (_local12 == "n") {
var _local13 = Number;
} else if (_local12 == "s") {
var _local13 = String;
}
_local36.variables[_local28] = _local13(_local11);
_local37++;
}
scope.onRoomAdded(_local36);
} else if (_local9 == "roomDel") {
var _local53 = xmlObj.rm.attributes.id;
var _local55 = scope.roomList[_local53];
delete scope.roomList[_local53];
scope.onRoomDeleted(_local55);
} else if (_local9 == "leaveRoom") {
var _local76 = xmlObj.rm.attributes.id;
scope.onRoomLeft(_local76);
} else if (_local9 == "roundTripRes") {
scope.t2 = getTimer();
scope.onRoundTripResponse(scope.t2 - scope.t1);
} else if (_local9 == "swSpec") {
var _local46 = Number(xmlObj.pid.attributes.id);
var _local48 = Number(xmlObj.pid.attributes.u);
if (_local46 > 0) {
scope.roomList[_local20].userCount++;
scope.roomList[_local20].specCount--;
}
if (!isNaN(_local48)) {
var _local50 = scope.roomList[_local20];
_local50.userList[_local48].pid = _local46;
_local50.userList[_local48].isSpec = false;
} else {
scope.playerId = _local46;
scope.onSpectatorSwitched(scope.playerId > 0, scope.playerId, scope.roomList[_local20]);
}
} else if (_local9 == "bList") {
var _local8 = xmlObj.bList.bList;
if (_local8 == undefined) {
scope.onBuddyListError(xmlObj.err.value);
return(undefined);
}
var _local18 = xmlObj.mv.mv;
if (_local18 != undefined) {
for (var it in _local18) {
var _local32 = _local18[it].attributes.n;
var _local27 = _local18[it].value;
scope.myBuddyVars[_local32] = _local27;
}
}
var _local43 = 0;
while (_local43 < _local8.length) {
var _local35 = {};
_local35.isOnline = ((_local8[_local43].attributes.s == "1") ? true : false);
_local35.name = _local8[_local43].n.value;
_local35.id = _local8[_local43].attributes.i;
_local35.isBlocked = ((_local8[_local43].attributes.x == "1") ? true : false);
_local35.variables = {};
var _local21 = _local8[_local43].vs.vs;
for (var _local37 in _local21) {
var _local29 = _local21[_local37].attributes.n;
var _local26 = _local21[_local37].value;
_local35.variables[_local29] = _local26;
}
scope.buddyList.push(_local35);
_local43++;
}
scope.onBuddyList(scope.buddyList);
} else if (_local9 == "bUpd") {
var _local39 = false;
var _local42 = xmlObj.b;
if (_local42 == undefined) {
scope.onBuddyListError(xmlObj.err.value);
return(undefined);
}
var _local35 = {};
_local35.name = _local42.n.value;
_local35.id = _local42.attributes.i;
_local35.isOnline = ((_local42.attributes.s == "1") ? true : false);
_local35.isBlocked = ((_local42.attributes.x == "1") ? true : false);
var _local21 = _local42.vs.vs;
var _local17 = null;
for (var it in scope.buddyList) {
_local17 = scope.buddyList[it];
if (_local17.name == _local35.name) {
scope.buddyList[it] = _local35;
_local35.isBlocked = _local17.isBlocked;
_local35.variables = _local17.variables;
for (var _local43 in _local21) {
var _local29 = _local21[_local43].attributes.n;
var _local26 = _local21[_local43].value;
_local35.variables[_local29] = _local26;
}
_local39 = true;
break;
}
}
if (_local39) {
scope.onBuddyListUpdate(_local35);
}
} else if (_local9 == "bAdd") {
var _local42 = xmlObj.b;
var _local35 = {};
_local35.name = _local42.n.value;
_local35.id = _local42.attributes.i;
_local35.isOnline = ((_local42.attributes.s == "1") ? true : false);
_local35.isBlocked = ((_local42.attributes.x == "1") ? true : false);
_local35.variables = {};
var _local21 = _local42.vs.vs;
for (var _local43 in _local21) {
var _local29 = _local21[_local43].attributes.n;
var _local26 = _local21[_local43].value;
_local35.variables[_local29] = _local26;
}
scope.buddyList.push(_local35);
scope.onBuddyList(scope.buddyList);
} else if (_local9 == "remB") {
var _local40 = xmlObj.n.value;
var _local35 = null;
for (var it in scope.buddyList) {
_local35 = scope.buddyList[it];
if (_local35.name == _local40) {
delete scope.buddyList[it];
scope.onBuddyList(scope.buddyList);
break;
}
}
} else if (_local9 == "bPrm") {
var _local56 = xmlObj.n.value;
var _local45 = "";
if (xmlObj.txt != undefined) {
_local45 = scope.os.decodeEntities(_local45);
}
scope.onBuddyPermissionRequest(_local56, _local45);
} else if (_local9 == "roomB") {
var _local70 = xmlObj.br.attributes.r;
var _local19 = _local70.toString().split(",");
for (var _local43 in _local19) {
_local19[_local43] = Number(_local19[_local43]);
}
scope.onBuddyRoom(_local19);
} else if (_local9 == "rndK") {
var _local57 = xmlObj.k.value;
scope.onRandomKey(_local57);
}
}
function handleExtensionMessages(dataObj, scope, type) {
if (type == undefined) {
type = "xml";
}
if (type == "xml") {
var _local6 = dataObj.attributes.action;
var _local7 = dataObj.attributes.r;
if (_local6 == "xtRes") {
var _local4 = dataObj.value;
var _local5 = scope.os.deserialize(_local4);
scope.onExtensionResponse(_local5, type);
}
} else if (type == "str") {
scope.onExtensionResponse(dataObj, type);
} else if (type == "json") {
scope.onExtensionResponse(dataObj.o, type);
}
}
function sendXtMessage(xtName, cmdName, paramObj, type, roomId) {
if (roomId == undefined) {
roomId = activeRoomId;
}
if (type == undefined) {
type = "xml";
}
if (type == "xml") {
var _local11;
_local11 = {t:"xt"};
var _local10 = {name:xtName, cmd:cmdName, param:paramObj};
var _local12 = ("<![CDATA[" + os.serialize(_local10)) + "]]>";
send(_local11, "xtReq", roomId, _local12);
} else if (type == "str") {
var _local4;
_local4 = (((((((rawProtocolSeparator + "xt") + rawProtocolSeparator) + xtName) + rawProtocolSeparator) + cmdName) + rawProtocolSeparator) + roomId) + rawProtocolSeparator;
var _local2 = 0;
while (_local2 < paramObj.length) {
_local4 = _local4 + (paramObj[_local2].toString() + rawProtocolSeparator);
_local2++;
}
sendString(_local4);
} else if (type == "json") {
var _local5 = {};
_local5.x = xtName;
_local5.c = cmdName;
_local5.r = roomId;
_local5.p = paramObj;
var _local6 = {};
_local6.t = "xt";
_local6.b = _local5;
try {
var _local13 = it.gotoandplay.smartfoxserver.JSON.stringify(_local6);
sendJson(_local13);
} catch(ex) {
if (debug) {
trace("Error in sending JSON message.");
trace((((((ex.name + " : ") + ex.message) + " : ") + ex.at) + " : ") + ex.text);
}
}
}
}
function dumpObj(obj, depth) {
if (depth == undefined) {
depth = 0;
}
if (debug) {
if (depth == 0) {
trace("+-----------------------------------------------+");
trace("+ Object Dump +");
trace("+-----------------------------------------------+");
}
for (var _local8 in obj) {
var _local4 = obj[_local8];
var _local5 = typeof(_local4);
if (_local5 != "object") {
var _local3 = "";
var _local2 = 0;
while (_local2 < depth) {
_local3 = _local3 + "\t";
_local2++;
}
_local3 = _local3 + (((((_local8 + " : ") + _local4) + " ( ") + _local5) + " )");
trace(_local3);
} else {
dumpObj(_local4, depth + 1);
}
}
}
}
function login(zone, name, pass) {
var _local3 = {t:"sys"};
var _local2 = ((((("<login z='" + zone) + "'><nick><![CDATA[") + name) + "]]></nick><pword><![CDATA[") + pass) + "]]></pword></login>";
send(_local3, "login", 0, _local2);
}
function logout() {
var _local2 = {t:"sys"};
send(_local2, "logout", -1, "");
}
function getRoomList() {
var _local2 = {t:"sys"};
send(_local2, "getRmList", (activeRoomId ? (activeRoomId) : -1), "");
}
function autoJoin() {
var _local2 = {t:"sys"};
send(_local2, "autoJoin", (activeRoomId ? (activeRoomId) : -1), "");
}
function joinRoom(newRoom, pword, isSpectator, dontLeave, oldRoom) {
var _local2 = null;
var _local7;
if (isSpectator) {
_local7 = 1;
} else {
_local7 = 0;
}
if (!changingRoom) {
if (typeof(newRoom) == "number") {
_local2 = newRoom;
} else {
for (var _local4 in roomList) {
if (roomList[_local4].name == newRoom) {
_local2 = roomList[_local4].id;
break;
}
}
}
if (_local2 != null) {
var _local9 = {t:"sys"};
var _local6 = (dontLeave ? "0" : "1");
var _local5;
if (oldRoom) {
_local5 = oldRoom;
} else {
_local5 = activeRoomId;
}
if (activeRoomId == null) {
_local6 = "0";
_local5 = -1;
}
var _local8 = ((((((((("<room id='" + _local2) + "' pwd='") + pword) + "' spec='") + _local7) + "' leave='") + _local6) + "' old='") + _local5) + "' />";
send(_local9, "joinRoom", (activeRoomId ? (activeRoomId) : -1), _local8);
changingRoom = true;
} else {
trace("SmartFoxError: requested room to join does not exist!");
}
}
}
function sendBuddyPermissionResponse(allowBuddy, targetBuddy) {
var _local2 = ((("<n res='" + (allowBuddy ? "g" : "r")) + "'><![CDATA[") + targetBuddy) + "]]></n>";
send({t:"sys"}, "bPrm", -1, _local2);
}
function sendPublicMessage(message, roomId) {
if (roomId == undefined) {
roomId = activeRoomId;
}
var _local2 = {t:"sys"};
var _local3 = ("<txt><![CDATA[" + os.encodeEntities(message)) + "]]></txt>";
send(_local2, "pubMsg", roomId, _local3);
}
function sendPrivateMessage(message, recipientId, roomId) {
if (roomId == undefined) {
roomId = activeRoomId;
}
var _local2 = {t:"sys"};
var _local3 = ((("<txt rcp='" + recipientId) + "'><![CDATA[") + os.encodeEntities(message)) + "]]></txt>";
send(_local2, "prvMsg", roomId, _local3);
}
function sendModeratorMessage(message, type, id) {
var _local2 = {t:"sys"};
var _local3 = ((((("<txt t='" + type) + "' id='") + id) + "'><![CDATA[") + os.encodeEntities(message)) + "]]></txt>";
send(_local2, "modMsg", activeRoomId, _local3);
}
function sendObject(obj, roomId) {
if (roomId == undefined) {
roomId = activeRoomId;
}
var _local2 = ("<![CDATA[" + os.serialize(obj)) + "]]>";
var _local3 = {t:"sys"};
send(_local3, "asObj", roomId, _local2);
}
function sendObjectToGroup(obj, userList, roomId) {
if (roomId == undefined) {
roomId = activeRoomId;
}
var _local3 = "";
for (var _local4 in userList) {
if (!isNaN(userList[_local4])) {
_local3 = _local3 + (userList[_local4] + ",");
}
}
_local3 = _local3.substr(0, _local3.length - 1);
obj._$$_ = _local3;
var _local5 = ("<![CDATA[" + os.serialize(obj)) + "]]>";
var _local6 = {t:"sys"};
send(_local6, "asObjG", roomId, _local5);
}
function setBuddyBlockStatus(buddyName, status) {
var _local2 = getBuddyByName(buddyName);
if (_local2 != null) {
if (_local2.blocked != status) {
_local2.isBlocked = status;
var _local3 = ((("<n x='" + (status ? "1" : "0")) + "'><![CDATA[") + buddyName) + "]]></n>";
send({t:"sys"}, "setB", -1, _local3);
onBuddyListUpdate(_local2);
}
}
}
function setUserVariables(varObj, roomId) {
if (roomId == undefined) {
roomId = activeRoomId;
}
var _local9 = {t:"sys"};
var _local6 = "<vars>";
var _local4 = roomList[roomId].userList[myUserId];
for (var _local7 in varObj) {
var _local2 = varObj[_local7];
var _local3 = null;
if (typeof(_local2) == "boolean") {
_local3 = "b";
_local2 = (_local2 ? 1 : 0);
} else if (typeof(_local2) == "number") {
_local3 = "n";
} else if (typeof(_local2) == "string") {
_local3 = "s";
} else if (typeof(_local2) == "null") {
_local3 = "x";
delete _local4.variables[_local7];
}
if (_local3 != null) {
_local4.variables[_local7] = _local2;
_local6 = _local6 + (((((("<var n='" + _local7) + "' t='") + _local3) + "'><![CDATA[") + _local2) + "]]></var>");
}
}
_local6 = _local6 + "</vars>";
send(_local9, "setUvars", roomId, _local6);
}
function setBuddyVariables(varList) {
var _local6 = {t:"sys"};
var _local4 = "<vars>";
for (var _local5 in varList) {
var _local2 = varList[_local5];
if (myBuddyVars[_local5] != _local2) {
myBuddyVars[_local5] = _local2;
_local4 = _local4 + (((("<var n='" + _local5) + "'><![CDATA[") + _local2) + "]]></var>");
}
}
_local4 = _local4 + "</vars>";
send(_local6, "setBvars", -1, _local4);
}
function dumpRoomList() {
for (var _local5 in roomList) {
var _local2 = roomList[_local5];
trace(newline);
trace("-------------------------------------");
trace(((" > Room: (" + _local5) + ") - ") + _local2.getName());
trace("isTemp: " + _local2.isTemp());
trace("isGame: " + _local2.isGame());
trace("isPriv: " + _local2.isPrivate());
trace((("Users: " + _local2.getUserCount()) + " / ") + _local2.getMaxUsers());
trace("Variables: ");
for (var _local4 in _local2.variables) {
trace((("\t" + _local4) + " = ") + _local2.getVariable(_local4));
}
trace("\rUserList: ");
var _local3 = _local2.getUserList();
for (var _local4 in _local3) {
trace((("\t" + _local3[_local4].getId()) + " > ") + _local3[_local4].getName());
}
}
}
function createRoom(roomObj, roomId) {
if (roomId == undefined) {
roomId = activeRoomId;
}
var _local7 = {t:"sys"};
var _local10 = (roomObj.updatable ? 1 : 0);
var _local5 = (roomObj.isGame ? 1 : 0);
var _local6 = 1;
var _local8 = roomObj.maxSpectators;
if (_local5 && (roomObj.exitCurrentRoom != undefined)) {
_local6 = (roomObj.exitCurrentRoom ? 1 : 0);
}
var _local3 = ((((((("<room upd='" + _local10) + "' tmp='1' gam='") + _local5) + "' spec='") + _local8) + "' exit='") + _local6) + "'>";
_local3 = _local3 + (("<name><![CDATA[" + roomObj.name) + "]]></name>");
_local3 = _local3 + (("<pwd><![CDATA[" + ((roomObj.password == undefined) ? "" : (roomObj.password))) + "]]></pwd>");
_local3 = _local3 + (("<max>" + roomObj.maxUsers) + "</max>");
if (roomObj.uCount != undefined) {
_local3 = _local3 + (("<uCnt>" + (roomObj.uCount ? "1" : "0")) + "</uCnt>");
}
if (roomObj.extension != undefined) {
_local3 = _local3 + ("<xt n='" + roomObj.extension.name);
_local3 = _local3 + (("' s='" + roomObj.extension.script) + "' />");
}
if (roomObj.vars == undefined) {
_local3 = _local3 + "<vars></vars>";
} else {
_local3 = _local3 + "<vars>";
for (var _local4 in roomObj.vars) {
_local3 = _local3 + getXmlRoomVariable(roomObj.vars[_local4]);
}
_local3 = _local3 + "</vars>";
}
_local3 = _local3 + "</room>";
send(_local7, "createRoom", roomId, _local3);
}
function leaveRoom(roomId) {
var _local3 = {t:"sys"};
var _local2 = ("<rm id='" + roomId) + "' />";
send(_local3, "leaveRoom", roomId, _local2);
}
function getRoom(roomId) {
if (typeof(roomId) == "number") {
return(roomList[roomId]);
}
if (typeof(roomId) == "string") {
for (var _local4 in roomList) {
var _local2 = roomList[_local4];
if (_local2.getName() == roomId) {
return(_local2);
}
}
}
}
function getActiveRoom() {
return(roomList[activeRoomId]);
}
function setRoomVariables(varList, roomId, setOwnership) {
if (roomId == undefined) {
roomId = activeRoomId;
}
if (setOwnership == undefined) {
setOwnership = true;
}
var _local5 = {t:"sys"};
var _local4;
if (setOwnership) {
_local4 = "<vars>";
} else {
_local4 = "<vars so='0'>";
}
var _local2 = 0;
while (_local2 < varList.length) {
_local4 = _local4 + getXmlRoomVariable(varList[_local2]);
_local2++;
}
_local4 = _local4 + "</vars>";
send(_local5, "setRvars", roomId, _local4);
}
function getXmlRoomVariable(rVar) {
var _local5 = rVar.name;
var _local1 = rVar.val;
var _local6 = (rVar.priv ? "1" : "0");
var _local4 = (rVar.persistent ? "1" : "0");
var _local2 = null;
if (typeof(_local1) == "boolean") {
_local2 = "b";
_local1 = (_local1 ? 1 : 0);
} else if (typeof(_local1) == "number") {
_local2 = "n";
} else if (typeof(_local1) == "string") {
_local2 = "s";
} else if (typeof(_local1) == "null") {
_local2 = "x";
}
if (_local2 != null) {
return(((((((((("<var n='" + _local5) + "' t='") + _local2) + "' pr='") + _local6) + "' pe='") + _local4) + "'><![CDATA[") + _local1) + "]]></var>");
}
return("");
}
function loadBuddyList() {
var _local2 = {t:"sys"};
send(_local2, "loadB", -1, "");
}
function addBuddy(buddyName) {
if ((buddyName != myUserName) && (!checkBuddy(buddyName))) {
var _local6 = roomList[activeRoomId].getUserList().getUser(buddyName);
var _local4 = {t:"sys"};
var _local3 = ("<n>" + buddyName) + "</n>";
send(_local4, "addB", -1, _local3);
}
}
function removeBuddy(buddyName) {
for (var _local3 in buddyList) {
if (buddyList[_local3].name == buddyName) {
delete buddyList[_local3];
break;
}
}
var _local5 = {t:"sys"};
var _local4 = ("<n>" + buddyName) + "</n>";
send(_local5, "remB", -1, _local4);
onBuddyList(buddyList);
}
function getBuddyByName(buddyName) {
var _local2;
for (var _local4 in buddyList) {
_local2 = buddyList[_local4];
if (_local2.name == buddyName) {
return(_local2);
}
}
return(null);
}
function getBuddyById(id) {
var _local2;
for (var _local4 in buddyList) {
_local2 = buddyList[_local4];
if (_local2.id == id) {
return(_local2);
}
}
return(null);
}
function getBuddyRoom(buddy) {
if (buddy.id != -1) {
send({t:"sys", bid:buddy.id}, "roomB", -1, ("<b id='" + buddy.id) + "' />");
}
}
function checkBuddy(name) {
var _local2 = false;
for (var _local4 in buddyList) {
if (buddyList[_local4].name == name) {
_local2 = true;
break;
}
}
return(_local2);
}
function clearBuddyList() {
buddyList = [];
send({t:"sys"}, "clearB", -1, "");
onBuddyList(buddyList);
}
function roundTripBench() {
t1 = getTimer();
var _local2 = {t:"sys"};
send(_local2, "roundTrip", activeRoomId, "");
}
function switchSpectator(roomId) {
if (roomId == undefined) {
roomId = activeRoomId;
}
var _local2 = {t:"sys"};
send(_local2, "swSpec", roomId, "");
}
function getRandomKey() {
send({t:"sys"}, "rndK", -1, "");
}
function send(header, action, fromRoom, message) {
var _local3 = makeHeader(header);
_local3 = _local3 + ((((((("<body action='" + action) + "' r='") + fromRoom) + "'>") + message) + "</body>") + closeHeader());
if (debug) {
trace(("[Sending]: " + _local3) + newline);
}
if (isHttpMode) {
httpConnection.send(_local3);
} else {
super.send(_local3);
}
}
function uploadFile(fileRef, id, nick, port) {
if (id == undefined) {
id = myUserId;
}
if (nick == undefined) {
nick = myUserName;
}
if (port == undefined) {
port = httpPort;
}
fileRef.upload((((((("http://" + ipAddress) + ":") + port) + "/default/Upload.py?id=") + id) + "&nick=") + nick);
if (debug) {
trace((((((("[UPLOAD]: http://" + ipAddress) + ":") + port) + "/default/Upload.py?id=") + id) + "&nick=") + nick);
}
}
function getUploadPath() {
return(((("http://" + ipAddress) + ":") + httpPort) + "/default/uploads/");
}
function sendString(message) {
if (debug) {
trace(("[Sending]: " + message) + newline);
}
if (isHttpMode) {
httpConnection.send(message);
} else {
super.send(message);
}
}
function sendJson(message) {
if (debug) {
trace(("[Sending - json]: " + message) + newline);
}
if (isHttpMode) {
httpConnection.send(message);
} else {
super.send(message);
}
}
function gotData(message) {
if (message.charAt(0) == rawProtocolSeparator) {
strReceived(message);
} else if (message.charAt(0) == "<") {
onXML(new XML(message));
} else if (message.charAt(0) == "{") {
jsonReceived(message);
}
}
function connectionEstablished(ok) {
if (ok) {
clearInterval(socketConnectionTimeoutThread);
preConnection = false;
var _local3 = {t:"sys"};
var _local2 = ((("<ver v='" + majVersion.toString()) + minVersion.toString()) + subVersion.toString()) + "' />";
send(_local3, "verChk", 0, _local2);
} else if (smartConnect && (preConnection)) {
if (debug) {
trace("** Socket connection failed. Trying BlueBox **");
}
isHttpMode = true;
var _local4 = ((blueBoxIpAddress != null) ? (blueBoxIpAddress) : (ipAddress));
var _local5 = ((blueBoxPort != 0) ? (blueBoxPort) : (httpPort));
httpConnection.connect(_local4, _local5);
} else {
preConnection = false;
onConnection(false);
}
}
function connectionClosed() {
isConnected = false;
if (preConnection) {
connectionEstablished(false);
} else {
initialize();
onConnectionLost();
}
}
function connect(ipAdr, port) {
if (!isConnected) {
ipAddress = ipAdr;
this.port = port;
super.connect(ipAdr, port);
socketConnectionTimeoutThread = setInterval(mx.utils.Delegate.create(this, socketTimeoutHandler), socketConnectionTimeout);
} else {
trace((("WARNING! You're already connected to -> " + ipAddress) + ":") + this.port);
}
}
function disconnect() {
close();
isConnected = false;
if (isHttpMode) {
httpConnection.close();
}
initialize();
onConnectionLost();
}
function xmlReceived(message) {
var _local2 = new Object();
message2Object(message.childNodes, _local2);
if (debug) {
trace("[Received]: " + message);
}
var _local3 = _local2.msg.attributes.t;
messageHandlers[_local3].handleMessage(_local2.msg.body, this, "xml");
}
function socketTimeoutHandler() {
clearInterval(socketConnectionTimeoutThread);
close();
}
function strReceived(message) {
var _local2 = message.substr(1, message.length - 2).split(rawProtocolSeparator);
if (debug) {
trace("[Received - Str]: " + message);
}
var _local4 = _local2[0];
messageHandlers[_local4].handleMessage(_local2.splice(1, _local2.length - 1), this, "str");
}
function jsonReceived(message) {
var _local2 = it.gotoandplay.smartfoxserver.JSON.parse(message);
if (debug) {
trace("[Received - json]: " + message);
}
var _local3 = _local2.t;
messageHandlers[_local3].handleMessage(_local2.b, this, "json");
}
function message2Object(xmlNodes, parentObj) {
var _local8 = 0;
var _local3 = null;
while (_local8 < xmlNodes.length) {
var _local4 = xmlNodes[_local8];
var _local5 = _local4.nodeName;
var _local6 = _local4.nodeValue;
if (parentObj instanceof Array) {
_local3 = {};
parentObj.push(_local3);
_local3 = parentObj[parentObj.length - 1];
} else {
parentObj[_local5] = new Object();
_local3 = parentObj[_local5];
}
for (var _local11 in _local4.attributes) {
if (typeof(_local3.attributes) == "undefined") {
_local3.attributes = {};
}
var _local2 = _local4.attributes[_local11];
if (!isNaN(Number(_local2))) {
_local2 = Number(_local2);
}
if (_local2.toLowerCase() == "true") {
_local2 = true;
} else if (_local2.toLowerCase() == "false") {
_local2 = false;
}
_local3.attributes[_local11] = _local2;
}
if (arrayTags[_local5]) {
_local3[_local5] = [];
_local3 = _local3[_local5];
}
if (_local4.hasChildNodes() && (_local4.firstChild.nodeValue == undefined)) {
var _local9 = _local4.childNodes;
message2Object(_local9, _local3);
} else {
_local6 = _local4.firstChild.nodeValue;
if (((!isNaN(_local6)) && (_local4.nodeName != "txt")) && (_local4.nodeName != "var")) {
_local6 = Number(_local6);
}
_local3.value = _local6;
}
_local8++;
}
}
function makeHeader(headerObj) {
var _local2 = "<msg";
for (var _local3 in headerObj) {
_local2 = _local2 + ((((" " + _local3) + "='") + headerObj[_local3]) + "'");
}
_local2 = _local2 + ">";
return(_local2);
}
function closeHeader() {
return("</msg>");
}
function handleDelayedPoll() {
httpConnection.send(HTTP_POLL_REQUEST);
if (fpMajorVersion < 8) {
clearInterval(pollingThread);
}
}
function handleHttpConnect(params) {
isConnected = true;
preConnection = false;
connectionEstablished(true);
httpConnection.send(HTTP_POLL_REQUEST);
}
function handleHttpClose(params) {
initialize();
onConnectionLost();
}
function handleHttpData(params) {
var _local5 = params.data;
var _local4 = _local5.split(newline);
var _local3;
var _local2 = 0;
while (_local2 < (_local4.length - 1)) {
_local3 = _local4[_local2];
if (_local3.length > 0) {
gotData(_local3);
}
_local2++;
}
if (_httpPollSpeed > 0) {
pollingThread = pollingDelayFn(mx.utils.Delegate.create(this, handleDelayedPoll), _httpPollSpeed);
} else {
httpConnection.send(HTTP_POLL_REQUEST);
}
}
function handleHttpError(params) {
if (!isConnected) {
onConnection(false);
} else {
connectionClosed();
}
}
static var MIN_POLL_SPEED = 0;
static var DEFAULT_POLL_SPEED = 750;
static var MAX_POLL_SPEED = 10000;
static var HTTP_POLL_REQUEST = "poll";
static var MODMSG_TO_USER = "u";
static var MODMSG_TO_ROOM = "r";
static var MODMSG_TO_ZONE = "z";
static var PROTOCOL_XML = "xml";
static var PROTOCOL_STR = "str";
static var PROTOCOL_JSON = "json";
static var CONNECTION_MODE_DISCONNECTED = "disconnected";
static var CONNECTION_MODE_SOCKET = "socket";
static var CONNECTION_MODE_HTTP = "http";
var DEFAULT_CONFIG_FILE = "config.xml";
var DEFAULT_AUTO_CONNECT = true;
var majVersion = 1;
var minVersion = 5;
var subVersion = 4;
var autoConnectOnConfigSuccess = true;
var defaultZone = "";
var httpPort = 8080;
var rawProtocolSeparator = "%";
var blueBoxPort = 0;
var smartConnect = true;
var socketConnectionTimeout = 5000;
var isHttpMode = false;
var _httpPollSpeed = DEFAULT_POLL_SPEED;
var pollingThread = -1;
var preConnection = true;
}
Symbol 341 MovieClip [__Packages.it.gotoandplay.smartfoxserver.ObjectSerializer] Frame 0
class it.gotoandplay.smartfoxserver.ObjectSerializer
{
static var __instance;
var tabs, xmlStr, debug, eof, ascTab, ascTabRev, hexTable;
function ObjectSerializer () {
init();
}
static function getInstance() {
if (__instance == null) {
__instance = new it.gotoandplay.smartfoxserver.ObjectSerializer();
}
return(__instance);
}
function init() {
tabs = "\t\t\t\t\t\t\t\t\t\t";
xmlStr = "";
debug = false;
eof = "";
ascTab = [];
ascTab[">"] = ">";
ascTab["<"] = "<";
ascTab["&"] = "&";
ascTab["'"] = "'";
ascTab["\""] = """;
ascTabRev = [];
ascTabRev[">"] = ">";
ascTabRev["<"] = "<";
ascTabRev["&"] = "&";
ascTabRev["'"] = "'";
ascTabRev["""] = "\"";
hexTable = new Array();
hexTable["0"] = 0;
hexTable["1"] = 1;
hexTable["2"] = 2;
hexTable["3"] = 3;
hexTable["4"] = 4;
hexTable["5"] = 5;
hexTable["6"] = 6;
hexTable["7"] = 7;
hexTable["8"] = 8;
hexTable["9"] = 9;
hexTable.A = 10;
hexTable.B = 11;
hexTable.C = 12;
hexTable.D = 13;
hexTable.E = 14;
hexTable.F = 15;
}
function serialize(obj) {
var _local2 = {};
_local2.xmlStr = "";
if (debug) {
eof = newline;
}
obj2xml(_local2, obj, 0, "");
return(_local2.xmlStr);
}
function obj2xml(envelope, obj, lev, objn) {
if (lev == 0) {
envelope.xmlStr = envelope.xmlStr + ("<dataObj>" + eof);
} else {
if (debug) {
envelope.xmlStr = envelope.xmlStr + tabs.substr(0, lev);
}
var _local8 = ((obj instanceof Array) ? "a" : "o");
envelope.xmlStr = envelope.xmlStr + ((((("<obj t='" + _local8) + "' o='") + objn) + "'>") + eof);
}
for (var _local7 in obj) {
var _local2 = typeof(obj[_local7]);
var _local3 = obj[_local7];
if ((((_local2 == "boolean") || (_local2 == "number")) || (_local2 == "string")) || (_local2 == "null")) {
if (_local2 == "boolean") {
_local3 = Number(_local3);
} else if (_local2 == "null") {
_local2 = "x";
_local3 = "";
} else if (_local2 == "string") {
_local3 = encodeEntities(_local3);
}
if (debug) {
envelope.xmlStr = envelope.xmlStr + tabs.substr(0, lev + 1);
}
envelope.xmlStr = envelope.xmlStr + ((((((("<var n='" + _local7) + "' t='") + _local2.substr(0, 1)) + "'>") + _local3) + "</var>") + eof);
} else if (_local2 == "object") {
obj2xml(envelope, _local3, lev + 1, _local7);
if (debug) {
envelope.xmlStr = envelope.xmlStr + tabs.substr(0, lev + 1);
}
envelope.xmlStr = envelope.xmlStr + ("</obj>" + eof);
}
}
if (lev == 0) {
envelope.xmlStr = envelope.xmlStr + ("</dataObj>" + eof);
}
}
function deserialize(xmlObj) {
var _local3 = new XML(xmlObj);
_local3.ignoreWhite = true;
var _local2 = new Object();
xml2obj(_local3, _local2);
return(_local2);
}
function xml2obj(xmlNode, currObj) {
var _local2 = 0;
var _local3 = xmlNode.firstChild;
while (_local3.childNodes[_local2]) {
if (_local3.childNodes[_local2].nodeName == "obj") {
var _local9 = _local3.childNodes[_local2].attributes.o;
var _local7 = _local3.childNodes[_local2].attributes.t;
if (_local7 == "a") {
currObj[_local9] = [];
} else if (_local7 == "o") {
currObj[_local9] = {};
}
xml2obj(new XML(_local3.childNodes[_local2]), currObj[_local9]);
} else {
var _local9 = _local3.childNodes[_local2].attributes.n;
var _local4 = _local3.childNodes[_local2].attributes.t;
var _local8 = _local3.childNodes[_local2].firstChild.nodeValue;
var _local5;
if (_local4 == "b") {
_local5 = function (b) {
return(Boolean(Number(b)));
};
} else if (_local4 == "n") {
_local5 = Number;
} else if (_local4 == "s") {
_local5 = String;
} else if (_local4 == "x") {
_local5 = function (x) {
return(null);
};
}
currObj[_local9] = _local5(_local8);
}
_local2++;
}
}
function encodeEntities(st) {
var _local5 = "";
var _local4 = 0;
while (_local4 < st.length) {
var _local3 = st.charAt(_local4);
var _local2 = st.charCodeAt(_local4);
if (((_local2 == 9) || (_local2 == 10)) || (_local2 == 13)) {
_local5 = _local5 + _local3;
} else if ((_local2 >= 32) && (_local2 <= 126)) {
if (ascTab[_local3] != undefined) {
_local5 = _local5 + ascTab[_local3];
} else {
_local5 = _local5 + _local3;
}
} else {
_local5 = _local5 + _local3;
}
_local4++;
}
return(_local5);
}
function decodeEntities(st) {
var _local7;
var _local6;
var _local5;
var _local3;
var _local8;
var _local2 = 0;
_local7 = "";
while (_local2 < st.length) {
_local6 = st.charAt(_local2);
if (_local6 == "&") {
_local5 = _local6;
do {
_local2++;
_local3 = st.charAt(_local2);
_local5 = _local5 + _local3;
} while ((_local3 != ";") && (_local2 < st.length));
_local8 = ascTabRev[_local5];
if (_local8 != undefined) {
_local7 = _local7 + _local8;
} else {
_local7 = _local7 + String.fromCharCode(getCharCode(_local5));
}
} else {
_local7 = _local7 + _local6;
}
_local2++;
}
return(_local7);
}
function getCharCode(ent) {
var _local1 = ent.substr(3, ent.length);
_local1 = _local1.substr(0, _local1.length - 1);
return(Number("0x" + _local1));
}
}
Symbol 342 MovieClip [__Packages.it.gotoandplay.smartfoxserver.http.HttpConnection] Frame 0
class it.gotoandplay.smartfoxserver.http.HttpConnection
{
var codec, handlers, sessionId, ipAddr, port, webUrl, loaderFactory, _classRef;
function HttpConnection (httpConnectHandler, httpCloseHandler, httpDataHandler, httpErrorHandler) {
codec = new it.gotoandplay.smartfoxserver.http.RawProtocolCodec();
handlers = [];
handlers[onHttpConnect] = httpConnectHandler;
handlers[onHttpClose] = httpCloseHandler;
handlers[onHttpData] = httpDataHandler;
handlers[onHttpError] = httpErrorHandler;
}
function getSessionId() {
return(sessionId);
}
function isConnected() {
return(connected);
}
function connect(addr, port) {
if (port == undefined) {
port = 8080;
}
ipAddr = addr;
this.port = port;
webUrl = (((("http://" + ipAddr) + ":") + this.port) + "/") + servletUrl;
sessionId = null;
loaderFactory = new it.gotoandplay.smartfoxserver.http.LoaderFactory(this, handleResponse, webUrl, paramName);
send(HANDSHAKE);
}
function close() {
send(DISCONNECT);
}
function send(message) {
if ((connected || ((!connected) && (message == HANDSHAKE))) || ((!connected) && (message == "poll"))) {
if (message != "poll") {
trace("[ Send ]: " + codec.encode(sessionId, message));
}
loaderFactory.sendAndLoad(codec.encode(sessionId, message));
}
}
function handleResponse(data) {
var _local2 = _classRef;
if (data != undefined) {
var _local3 = {};
if (data.charAt(0) == HANDSHAKE_TOKEN) {
if (_local2.sessionId == null) {
_local2.sessionId = _local2.codec.decode(data);
_local2.connected = true;
_local3.sessionId = _local2.sessionId;
_local3.success = true;
_local2.dispatchEvent(onHttpConnect, _local3);
} else {
trace("**ERROR** SessionId is being rewritten");
}
} else if (data.indexOf(CONN_LOST) == 0) {
_local3.data = {};
_local2.dispatchEvent(onHttpClose, _local3);
} else {
_local3.data = data;
_local2.dispatchEvent(onHttpData, _local3);
}
} else if (!_local2.connected) {
_local2.handleIOError("I/O error: null response from server");
}
}
function handleIOError(error) {
var _local2 = {};
_local2.message = error;
dispatchEvent(onHttpError, _local2);
}
function dispatchEvent(type, params) {
handlers[type](params);
}
static var HANDSHAKE = "connect";
static var DISCONNECT = "disconnect";
static var CONN_LOST = "ERR#01";
static var HANDSHAKE_TOKEN = "#";
static var servletUrl = "BlueBox/HttpBox.do";
static var paramName = "sfsHttp";
static var onHttpData = "onHttpData";
static var onHttpError = "onHttpError";
static var onHttpConnect = "onHttpConnect";
static var onHttpClose = "onHttpClose";
var connected = false;
}
Symbol 343 MovieClip [__Packages.it.gotoandplay.smartfoxserver.http.LoaderFactory] Frame 0
class it.gotoandplay.smartfoxserver.http.LoaderFactory
{
var poolSize, webUrl, loaderParamName, sendersPool, loadersPool, currentIndex;
function LoaderFactory (httpConnection, responseHandler, _webUrl, _loaderParamName, _poolSize) {
if (_poolSize > 0) {
poolSize = _poolSize;
} else {
poolSize = DEFAULT_POOL_SIZE;
}
webUrl = _webUrl;
loaderParamName = _loaderParamName;
sendersPool = [];
loadersPool = [];
var _local3 = 0;
while (_local3 < poolSize) {
var _local4 = new LoadVars();
var _local2 = new LoadVars();
_local2._classRef = httpConnection;
_local2.onData = responseHandler;
sendersPool.push(_local4);
loadersPool.push(_local2);
_local3++;
}
currentIndex = 0;
}
function sendAndLoad(message) {
var _local2 = sendersPool[currentIndex];
var _local3 = loadersPool[currentIndex];
_local2[loaderParamName] = message;
_local2.sendAndLoad(webUrl, _local3);
currentIndex++;
if (currentIndex >= poolSize) {
currentIndex = 0;
}
}
function handleHTTPStatus(status) {
trace("---> Status received: " + status);
}
static var DEFAULT_POOL_SIZE = 8;
}
Symbol 344 MovieClip [__Packages.it.gotoandplay.smartfoxserver.http.IHttpProtocolCodec] Frame 0
interface it.gotoandplay.smartfoxserver.http.IHttpProtocolCodec
{
}
Symbol 345 MovieClip [__Packages.it.gotoandplay.smartfoxserver.http.RawProtocolCodec] Frame 0
class it.gotoandplay.smartfoxserver.http.RawProtocolCodec implements it.gotoandplay.smartfoxserver.http.IHttpProtocolCodec
{
function RawProtocolCodec () {
}
function encode(sessionId, message) {
return(((sessionId == null) ? "" : (sessionId)) + message);
}
function decode(message) {
var _local1;
if (message.charAt(0) == it.gotoandplay.smartfoxserver.http.HttpConnection.HANDSHAKE_TOKEN) {
_local1 = message.substr(1, SESSION_ID_LEN);
}
return(_local1);
}
static var SESSION_ID_LEN = 32;
}
Symbol 346 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 347 MovieClip [__Packages.it.gotoandplay.smartfoxserver.Room] Frame 0
class it.gotoandplay.smartfoxserver.Room
{
var id, name, maxUsers, maxSpectators, temp, game, priv, limbo, updatable, description, userCount, specCount, userList, variables, myPlayerIndex;
function Room (id, name, maxUsers, maxSpectators, isTemp, isGame, isPrivate) {
this.id = id;
this.name = name;
this.maxUsers = maxUsers;
this.maxSpectators = maxSpectators;
temp = isTemp;
game = isGame;
priv = isPrivate;
limbo = false;
updatable = false;
description = "";
userCount = 0;
specCount = 0;
userList = new Object();
variables = new Array();
}
function getUserList() {
return(userList);
}
function getUser(userId) {
if (typeof(userId) == "number") {
return(userList[userId]);
}
if (typeof(userId) == "string") {
for (var _local4 in userList) {
var _local2 = userList[_local4];
if (_local2.getName() == userId) {
return(_local2);
}
}
}
}
function getVariable(varName) {
return(variables[varName]);
}
function getVariables() {
return(variables);
}
function getName() {
return(name);
}
function getId() {
return(id);
}
function isTemp() {
return(temp);
}
function isGame() {
return(game);
}
function isPrivate() {
return(priv);
}
function getUserCount() {
return(userCount);
}
function getSpectatorCount() {
return(specCount);
}
function getMaxUsers() {
return(maxUsers);
}
function getMaxSpectators() {
return(maxSpectators);
}
function setMyPlayerIndex(id) {
myPlayerIndex = id;
}
function getMyPlayerIndex() {
return(myPlayerIndex);
}
function setIsLimbo(b) {
limbo = b;
}
function isLimbo() {
return(limbo);
}
}
Symbol 348 MovieClip [__Packages.it.gotoandplay.smartfoxserver.User] Frame 0
class it.gotoandplay.smartfoxserver.User
{
var id, name, variables, isSpec, isMod, pid;
function User (id, name) {
this.id = id;
this.name = name;
variables = new Object();
isSpec = false;
}
function getId() {
return(id);
}
function getName() {
return(name);
}
function getVariable(varName) {
return(variables[varName]);
}
function getVariables() {
return(variables);
}
function setIsSpectator(b) {
isSpec = b;
}
function isSpectator() {
return(isSpec);
}
function setModerator(b) {
isMod = b;
}
function isModerator() {
return(isMod);
}
function getPlayerId() {
return(pid);
}
function setPlayerId(pid) {
this.pid = pid;
}
}
Symbol 349 MovieClip [__Packages.it.gotoandplay.smartfoxserver.JSON] Frame 0
class it.gotoandplay.smartfoxserver.JSON
{
function JSON () {
}
static function stringify(arg) {
var _local3;
var _local2;
var _local6;
var _local1 = "";
var _local4;
switch (typeof(arg)) {
case "object" :
if (arg) {
if (arg instanceof Array) {
_local2 = 0;
while (_local2 < arg.length) {
_local4 = stringify(arg[_local2]);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + _local4;
_local2++;
}
return(("[" + _local1) + "]");
}
if (typeof(arg.toString) != "undefined") {
for (_local2 in arg) {
_local4 = arg[_local2];
if ((typeof(_local4) != "undefined") && (typeof(_local4) != "function")) {
_local4 = stringify(_local4);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + ((stringify(_local2) + ":") + _local4);
}
}
return(("{" + _local1) + "}");
}
}
return("null");
case "number" :
return((isFinite(arg) ? (String(arg)) : "null"));
case "string" :
_local6 = arg.length;
_local1 = "\"";
_local2 = 0;
while (_local2 < _local6) {
_local3 = arg.charAt(_local2);
if (_local3 >= " ") {
if ((_local3 == "\\") || (_local3 == "\"")) {
_local1 = _local1 + "\\";
}
_local1 = _local1 + _local3;
} else {
switch (_local3) {
case "\b" :
_local1 = _local1 + "\\b";
break;
case "\f" :
_local1 = _local1 + "\\f";
break;
case newline :
_local1 = _local1 + "\\n";
break;
case "\r" :
_local1 = _local1 + "\\r";
break;
case "\t" :
_local1 = _local1 + "\\t";
break;
default :
_local3 = _local3.charCodeAt();
_local1 = _local1 + (("\\u00" + Math.floor(_local3 / 16).toString(16)) + (_local3 % 16).toString(16));
}
}
_local2 = _local2 + 1;
}
return(_local1 + "\"");
case "boolean" :
return(String(arg));
}
return("null");
}
static function parse(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 = at + 1;
return(ch);
};
var _white = function () {
while (ch) {
if (ch <= " ") {
_next();
} else if (ch == "/") {
switch (_next()) {
case "/" :
while ((_next() && (ch != newline)) && (ch != "\r")) {
}
break;
case "*" :
_next();
for(;;){
if (ch) {
if (ch == "*") {
if (_next() == "/") {
_next();
// unexpected jump
}
} else {
_next();
}
} else {
_error("Unterminated comment");
}
};
break;
default :
_error("Syntax error");
}
} else {
return;
}
}
};
var _string = function () {
var _local4;
var _local1 = "";
var _local3;
var _local2;
var _local5 = false;
if (ch == "\"") {
while (_next()) {
if (ch == "\"") {
_next();
return(_local1);
}
if (ch == "\\") {
switch (_next()) {
case "b" :
_local1 = _local1 + "\b";
break;
case "f" :
_local1 = _local1 + "\f";
break;
case "n" :
_local1 = _local1 + newline;
break;
case "r" :
_local1 = _local1 + "\r";
break;
case "t" :
_local1 = _local1 + "\t";
break;
case "u" :
_local2 = 0;
_local4 = 0;
while (_local4 < 4) {
_local3 = parseInt(_next(), 16);
if (!isFinite(_local3)) {
_local5 = true;
break;
}
_local2 = (_local2 * 16) + _local3;
_local4 = _local4 + 1;
}
if (_local5) {
_local5 = false;
break;
}
_local1 = _local1 + String.fromCharCode(_local2);
break;
default :
_local1 = _local1 + ch;
}
} else {
_local1 = _local1 + ch;
}
}
}
_error("Bad string");
};
var _array = function () {
var _local1 = [];
if (ch == "[") {
_next();
_white();
if (ch == "]") {
_next();
return(_local1);
}
while (ch) {
_local1.push(_value());
_white();
if (ch == "]") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad array");
};
var _object = function () {
var _local2;
var _local1 = {};
if (ch == "{") {
_next();
_white();
if (ch == "}") {
_next();
return(_local1);
}
while (ch) {
_local2 = _string();
_white();
if (ch != ":") {
break;
}
_next();
_local1[_local2] = _value();
_white();
if (ch == "}") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad object");
};
var _number = function () {
var _local1 = "";
var _local2;
if (ch == "-") {
_local1 = "-";
_next();
}
while ((ch >= "0") && (ch <= "9")) {
_local1 = _local1 + ch;
_next();
}
if (ch == ".") {
_local1 = _local1 + ".";
while ((_next() && (ch >= "0")) && (ch <= "9")) {
_local1 = _local1 + ch;
}
}
_local2 = 1 * _local1;
if (!isFinite(_local2)) {
_error("Bad number");
} else {
return(_local2);
}
};
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"))) {
break;
}
_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());
}
}
Symbol 350 MovieClip [__Packages.plane] Frame 0
class plane
{
var planeSettings, planeSound, bulletSound, stallSound, explodeSound, firePressed, leftPressed, rightPressed, explosionLength, dying, stallDiving, deathDiving, mCRefreshPending, deathPending, leftKey, rightKey, fireKey, ID, birthX, birthY, birthDirection, x, y, pseudoX, pseudoY, direction, state, speed, masterClip, health, bullet1, bullet2, bullet3, bullet4, bullet5, refScreen, active, bulletTimer, bulletDelay, currentUpdateCounter, enemyPlane, explosionStartTime, ownMovieClip, lastFrameNumber;
function plane (cX, cY, cDirection, cState, cMasterClip, cID, cLeftKey, cRightKey, cFireKey) {
planeSettings = new settings();
planeSound = new Sound();
bulletSound = new Sound();
stallSound = new Sound();
explodeSound = new Sound();
explodeSound.attachSound("explode");
planeSound.attachSound("plane_noise");
bulletSound.attachSound("gun");
stallSound.attachSound("stall");
firePressed = false;
leftPressed = false;
rightPressed = false;
explosionLength = planeSettings.explosionLength;
dying = false;
stallDiving = false;
deathDiving = false;
mCRefreshPending = false;
deathPending = false;
leftKey = cLeftKey;
rightKey = cRightKey;
fireKey = cFireKey;
ID = cID;
birthX = cX;
birthY = cY;
birthDirection = cDirection;
x = cX;
y = cY;
pseudoX = cX;
pseudoY = cY;
direction = cDirection;
previousDirection = cDirection + 1;
state = cState;
speed = planeSettings.planeSpeed;
masterClip = cMasterClip;
setMC();
health = 5;
bullet1 = new bullet(masterClip, ID + "Bullet1");
bullet2 = new bullet(masterClip, ID + "Bullet2");
bullet3 = new bullet(masterClip, ID + "Bullet3");
bullet4 = new bullet(masterClip, ID + "Bullet4");
bullet5 = new bullet(masterClip, ID + "Bullet5");
refScreen = new screen();
active = false;
bulletTimer = 0;
bulletDelay = planeSettings.bulletDelay;
currentUpdateCounter = 0;
}
function setCurrentUpdate(toSet) {
currentUpdateCounter++;
}
function addEnemy(ePlane) {
enemyPlane = ePlane;
}
function die() {
health--;
direction = E;
active = false;
deathDiving = false;
stallDiving = false;
angleChangeCount = 0;
dying = true;
explosionStartTime = currentUpdateCounter;
explodeSound.start();
removeMovieClip(ID);
renewMC("expMov");
}
function stall() {
stallSound.start();
stallDiving = true;
stallDiveCount = 0;
}
function beginDeathDive() {
stallSound.start();
deathDiving = true;
active = false;
}
function updateHits() {
if (active == true) {
if (ownMovieClip.hitTest(enemyPlane.ownMovieClip)) {
if (enemyPlane.active == true) {
enemyPlane.deathPending = true;
}
if (active == true) {
deathPending = true;
}
}
if (enemyPlane.bullet1.active == true) {
if (ownMovieClip.hitTest(enemyPlane.bullet1.ownMovieClip)) {
deathPending = true;
enemyPlane.bullet1.die();
}
}
if (enemyPlane.bullet2.active == true) {
if (ownMovieClip.hitTest(enemyPlane.bullet2.ownMovieClip)) {
deathPending = true;
enemyPlane.bullet2.die();
}
}
if (enemyPlane.bullet3.active == true) {
if (ownMovieClip.hitTest(enemyPlane.bullet3.ownMovieClip)) {
deathPending = true;
enemyPlane.bullet3.die();
}
}
if (enemyPlane.bullet4.active == true) {
if (ownMovieClip.hitTest(enemyPlane.bullet4.ownMovieClip)) {
deathPending = true;
enemyPlane.bullet4.die();
}
}
if (enemyPlane.bullet5.active == true) {
if (ownMovieClip.hitTest(enemyPlane.bullet5.ownMovieClip)) {
deathPending = true;
enemyPlane.bullet5.die();
}
}
}
}
function updateInput(inputCode, remote) {
if (planeSoundStarted == false) {
planeSound.start();
planeSoundStarted = true;
}
if ((active == false) and (dying == false)) {
switch (inputCode) {
case leftKey :
active = true;
break;
case rightKey :
active = true;
break;
case fireKey :
active = true;
}
} else if (((stallDiving == false) and (deathDiving == false)) and (dying == false)) {
switch (inputCode) {
case leftKey :
if (direction == 0) {
direction = 15;
} else {
direction = direction - 1;
}
break;
case rightKey :
if (direction == 15) {
direction = 0;
} else {
direction = direction + 1;
}
break;
case fireKey :
if (bulletTimer != 0) {
break;
}
if (bullet1.active == false) {
bulletSound.start();
bullet1.launch(x, y, direction);
bulletTimer = bulletDelay;
} else if (bullet2.active == false) {
bulletSound.start();
bullet2.launch(x, y, direction);
bulletTimer = bulletDelay;
} else if (bullet3.active == false) {
bulletSound.start();
bullet3.launch(x, y, direction);
bulletTimer = bulletDelay;
} else if (bullet4.active == false) {
bulletSound.start();
bullet4.launch(x, y, direction);
bulletTimer = bulletDelay;
} else {
if (bullet5.active != false) {
break;
}
bulletSound.start();
bullet5.launch(x, y, direction);
bulletTimer = bulletDelay;
}
}
}
setMC();
}
function updatePosition(timeElapsed) {
trace("update pos called");
if (bulletTimer > 0) {
bulletTimer = bulletTimer - timeElapsed;
}
if (bulletTimer < 0) {
bulletTimer = 0;
}
bullet1.updatePosition(timeElapsed);
bullet2.updatePosition(timeElapsed);
bullet3.updatePosition(timeElapsed);
bullet4.updatePosition(timeElapsed);
bullet5.updatePosition(timeElapsed);
if ((active == false) and (dying == true)) {
if ((currentUpdateCounter - explosionStartTime) >= explosionLength) {
reBirth();
}
}
if (stallDiving == true) {
stallDiveCount = stallDiveCount + timeElapsed;
if (stallDiveCount >= stallDiveTime) {
stallDiveCount = 0;
stallDiving = false;
angleChangeCount = 0;
} else {
angleChangeCount = angleChangeCount + timeElapsed;
if (angleChangeCount >= angleChangeInterval) {
if (direction > S) {
direction--;
} else if (direction < S) {
direction++;
}
angleChangeCount = 0;
}
}
}
if ((active == true) or ((active == false) and (deathDiving == true))) {
switch (direction) {
case N :
y = y - (speed * timeElapsed);
steepClimbCount = steepClimbCount + timeElapsed;
break;
case NNE :
y = y - ((speed * timeElapsed) * 0.923879532511287);
x = x + ((speed * timeElapsed) * 0.38268343236509);
steepClimbCount = steepClimbCount + timeElapsed;
break;
case NE :
y = y - ((speed * timeElapsed) * Math.SQRT1_2);
x = x + ((speed * timeElapsed) * 0.707106781186547);
steepClimbCount = 0;
break;
case ENE :
y = y - ((speed * timeElapsed) * 0.38268343236509);
x = x + ((speed * timeElapsed) * 0.923879532511287);
steepClimbCount = 0;
break;
case E :
x = x + (speed * timeElapsed);
steepClimbCount = 0;
break;
case ESE :
x = x + ((speed * timeElapsed) * 0.923879532511287);
y = y + ((speed * timeElapsed) * 0.38268343236509);
steepClimbCount = 0;
break;
case SE :
x = x + ((speed * timeElapsed) * Math.SQRT1_2);
y = y + ((speed * timeElapsed) * 0.707106781186547);
steepClimbCount = 0;
break;
case SSE :
x = x + ((speed * timeElapsed) * 0.38268343236509);
y = y + ((speed * timeElapsed) * 0.923879532511287);
steepClimbCount = 0;
break;
case S :
y = y + (speed * timeElapsed);
steepClimbCount = 0;
break;
case SSW :
y = y + ((speed * timeElapsed) * 0.923879532511287);
x = x - ((speed * timeElapsed) * 0.38268343236509);
steepClimbCount = 0;
break;
case SW :
y = y + ((speed * timeElapsed) * Math.SQRT1_2);
x = x - ((speed * timeElapsed) * 0.707106781186547);
steepClimbCount = 0;
break;
case WSW :
y = y + ((speed * timeElapsed) * 0.38268343236509);
x = x - ((speed * timeElapsed) * 0.923879532511287);
steepClimbCount = 0;
break;
case W :
x = x - (speed * timeElapsed);
steepClimbCount = 0;
break;
case WNW :
x = x - ((speed * timeElapsed) * 0.923879532511287);
y = y - ((speed * timeElapsed) * 0.38268343236509);
steepClimbCount = 0;
break;
case NW :
x = x - ((speed * timeElapsed) * Math.SQRT1_2);
y = y - ((speed * timeElapsed) * 0.707106781186547);
steepClimbCount = 0;
break;
case NNW :
x = x - ((speed * timeElapsed) * 0.38268343236509);
y = y - ((speed * timeElapsed) * 0.923879532511287);
steepClimbCount = steepClimbCount + timeElapsed;
}
if (x > (refScreen.width + (getProperty(ID, _width) / 2))) {
x = -1 * (getProperty(ID, _width) / 2);
}
if (x < (-1 * (getProperty(ID, _width) / 2))) {
x = refScreen.width + (getProperty(ID, _width) / 2);
}
if (y > (refScreen.height + (getProperty(ID, _height) / 2))) {
die();
}
if (y < 0) {
y = 0;
}
setMC();
}
if (deathDiving == true) {
angleChangeCount = angleChangeCount + timeElapsed;
if (angleChangeCount >= angleChangeInterval) {
if (direction > S) {
direction--;
} else if (direction < S) {
direction++;
}
angleChangeCount = 0;
}
}
if (steepClimbCount >= steepClimbTime) {
stall();
}
pseudoX = x;
pseudoY = y;
setProperty(ID, _x , x);
setProperty(ID, _y , y);
}
function reBirth() {
x = birthX;
y = birthY;
direction = birthDirection;
active = false;
dying = false;
mCRefreshPending = true;
}
function checkPosition() {
if ((active == false) and (dying == true)) {
if ((ownMovieClip._currentframe == ownMovieClip._totalframes) or (lastFrameNumber > ownMovieClip._currentframe)) {
reBirth();
}
lastFrameNumber = ownMovieClip._currentframe;
}
setProperty(ID, _x , x);
setProperty(ID, _y , y);
bullet1.checkPosition();
bullet2.checkPosition();
bullet3.checkPosition();
bullet4.checkPosition();
bullet5.checkPosition();
setMC();
}
function clearDead() {
if (deathPending == true) {
deathPending = false;
lastFrameNumber = 0;
beginDeathDive();
}
}
function refreshMC() {
if (mCRefreshPending == true) {
mCRefreshPending = false;
}
}
function clear() {
planeSound.stop();
removeMovieClip(ID);
bullet1.clear();
bullet2.clear();
bullet3.clear();
bullet4.clear();
bullet5.clear();
}
function setMC() {
reCastDirection();
if (dying == false) {
if (previousDirection != direction) {
switch (direction) {
case N :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1E");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2E");
}
setProperty(ID, _rotation , -90);
break;
case NNE :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1E");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2E");
}
setProperty(ID, _rotation , -67.5);
break;
case NE :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1E");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2E");
}
setProperty(ID, _rotation , -45);
break;
case ENE :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1E");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2E");
}
setProperty(ID, _rotation , -22.5);
break;
case E :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1E");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2E");
}
setProperty(ID, _rotation , 0);
break;
case ESE :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1E");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2E");
}
setProperty(ID, _rotation , 22.5);
break;
case SE :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1E");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2E");
}
setProperty(ID, _rotation , 45);
break;
case SSE :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1E");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2E");
}
setProperty(ID, _rotation , 67.5);
break;
case S :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1W");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2W");
}
setProperty(ID, _rotation , -90);
break;
case SSW :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1W");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2W");
}
setProperty(ID, _rotation , -67.5);
break;
case SW :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1W");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2W");
}
setProperty(ID, _rotation , -45);
break;
case WSW :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1W");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2W");
}
setProperty(ID, _rotation , -22.5);
break;
case W :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1W");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2W");
}
break;
case WNW :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1W");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2W");
}
setProperty(ID, _rotation , 22.5);
break;
case NW :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1W");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2W");
}
setProperty(ID, _rotation , 45);
break;
case NNW :
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
renewMC("plane1W");
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
renewMC("plane2W");
}
setProperty(ID, _rotation , 67.5);
break;
}
}
previousDirection = direction;
}
}
function renewMC(newMC) {
if (ID == "P1Plane") {
masterClip.removeMovieClip(ID);
ID = "P1Plane";
masterClip.attachMovie(newMC, ID, 2, {_x:x, _y:y});
} else {
masterClip.removeMovieClip(ID);
ID = "P2Plane";
masterClip.attachMovie(newMC, ID, 1, {_x:x, _y:y});
}
for (var _local2 in masterClip) {
if (typeof(masterClip[_local2]) == "movieclip") {
if (masterClip[_local2]._name == ID) {
ownMovieClip = masterClip[_local2];
break;
}
}
}
}
function reCastDirection() {
if ((direction >= -0.5) && (direction < 0.5)) {
direction = 0;
} else if ((direction >= 0.5) && (direction < 1.5)) {
direction = 1;
} else if ((direction >= 1.5) && (direction < 2.5)) {
direction = 2;
} else if ((direction >= 2.5) && (direction < 3.5)) {
direction = 3;
} else if ((direction >= 3.5) && (direction < 4.5)) {
direction = 4;
} else if ((direction >= 4.5) && (direction < 5.5)) {
direction = 5;
} else if ((direction >= 5.5) && (direction < 6.5)) {
direction = 6;
} else if ((direction >= 6.5) && (direction < 7.5)) {
direction = 7;
} else if ((direction >= 7.5) && (direction < 8.5)) {
direction = 8;
} else if ((direction >= 8.5) && (direction < 9.5)) {
direction = 9;
} else if ((direction >= 9.5) && (direction < 10.5)) {
direction = 10;
} else if ((direction >= 10.5) && (direction < 11.5)) {
direction = 11;
} else if ((direction >= 11.5) && (direction < 12.5)) {
direction = 12;
} else if ((direction >= 12.5) && (direction < 13.5)) {
direction = 13;
} else if ((direction >= 13.5) && (direction < 14.5)) {
direction = 14;
} else if ((direction >= 14.5) && (direction < 15.5)) {
direction = 15;
} else {
direction = 1;
}
}
function updatePseudoPosition(timeElapsed) {
trace("updatepseudo called");
bullet1.updatePseudoPosition(timeElapsed);
bullet2.updatePseudoPosition(timeElapsed);
bullet3.updatePseudoPosition(timeElapsed);
bullet4.updatePseudoPosition(timeElapsed);
bullet5.updatePseudoPosition(timeElapsed);
if ((active == true) or ((active == false) and (deathDiving == true))) {
switch (direction) {
case N :
pseudoY = pseudoY - (speed * timeElapsed);
break;
case NNE :
pseudoY = pseudoY - ((speed * timeElapsed) * 0.923879532511287);
pseudoX = pseudoX + ((speed * timeElapsed) * 0.38268343236509);
break;
case NE :
pseudoY = pseudoY - ((speed * timeElapsed) * Math.SQRT1_2);
pseudoX = pseudoX + ((speed * timeElapsed) * 0.707106781186547);
break;
case ENE :
pseudoY = pseudoY - ((speed * timeElapsed) * 0.38268343236509);
pseudoX = pseudoX + ((speed * timeElapsed) * 0.923879532511287);
break;
case E :
pseudoX = pseudoX + (speed * timeElapsed);
break;
case ESE :
pseudoX = pseudoX + ((speed * timeElapsed) * 0.923879532511287);
pseudoY = pseudoY + ((speed * timeElapsed) * 0.38268343236509);
break;
case SE :
pseudoX = pseudoX + ((speed * timeElapsed) * Math.SQRT1_2);
pseudoY = pseudoY + ((speed * timeElapsed) * 0.707106781186547);
break;
case SSE :
pseudoX = pseudoX + ((speed * timeElapsed) * 0.38268343236509);
pseudoY = pseudoY + ((speed * timeElapsed) * 0.923879532511287);
break;
case S :
pseudoY = pseudoY + (speed * timeElapsed);
break;
case SSW :
pseudoY = pseudoY + ((speed * timeElapsed) * 0.923879532511287);
pseudoX = pseudoX - ((speed * timeElapsed) * 0.38268343236509);
break;
case SW :
pseudoY = pseudoY + ((speed * timeElapsed) * Math.SQRT1_2);
pseudoX = pseudoX - ((speed * timeElapsed) * 0.707106781186547);
break;
case WSW :
pseudoY = pseudoY + ((speed * timeElapsed) * 0.38268343236509);
pseudoX = pseudoX - ((speed * timeElapsed) * 0.923879532511287);
break;
case W :
pseudoX = pseudoX - (speed * timeElapsed);
break;
case WNW :
pseudoX = pseudoX - ((speed * timeElapsed) * 0.923879532511287);
pseudoY = pseudoY - ((speed * timeElapsed) * 0.38268343236509);
break;
case NW :
pseudoX = pseudoX - ((speed * timeElapsed) * Math.SQRT1_2);
pseudoY = pseudoY - ((speed * timeElapsed) * 0.707106781186547);
break;
case NNW :
pseudoX = pseudoX - ((speed * timeElapsed) * 0.38268343236509);
pseudoY = pseudoY - ((speed * timeElapsed) * 0.923879532511287);
}
}
setProperty(ID, _x , pseudoX);
setProperty(ID, _y , pseudoY);
}
var N = 0;
var NNE = 1;
var NE = 2;
var ENE = 3;
var E = 4;
var ESE = 5;
var SE = 6;
var SSE = 7;
var S = 8;
var SSW = 9;
var SW = 10;
var WSW = 11;
var W = 12;
var WNW = 13;
var NW = 14;
var NNW = 15;
var stallDiveTime = 1000;
var stallDiveCount = 0;
var steepClimbTime = 3000;
var steepClimbCount = 0;
var angleChangeInterval = 100;
var angleChangeCount = 0;
var previousDirection = plane.prototype.direction + 1;
var planeSoundStarted = false;
}
Symbol 351 MovieClip [__Packages.bullet] Frame 0
class bullet
{
var deathPending, ID, masterClip, lastActive, active, refScreen, bulletSettings, speed, x, y, nneXMultiplier, neXMultiplier, eneXMultiplier, eseXMultiplier, seXMultiplier, sseXMultiplier, sswXMultiplier, swXMultiplier, wswXMultiplier, wnwXMultiplier, nwXMultiplier, nnwXMultiplier, nneYMultiplier, neYMultiplier, eneYMultiplier, eseYMultiplier, seYMultiplier, sseYMultiplier, sswYMultiplier, swYMultiplier, wswYMultiplier, wnwYMultiplier, nwYMultiplier, nnwYMultiplier, pseudoX, pseudoY, direction, ownMovieClip;
function bullet (cMasterClip, cID) {
deathPending = false;
ID = cID;
masterClip = cMasterClip;
lastActive = false;
active = false;
refScreen = new screen();
bulletSettings = new settings();
speed = bulletSettings.bulletSpeed;
x = 0;
y = 0;
nneXMultiplier = speed * 0.38268343236509;
neXMultiplier = speed * 0.707106781186547;
eneXMultiplier = speed * 0.923879532511287;
eseXMultiplier = speed * 0.923879532511287;
seXMultiplier = speed * Math.SQRT1_2;
sseXMultiplier = speed * 0.38268343236509;
sswXMultiplier = speed * 0.38268343236509;
swXMultiplier = speed * 0.707106781186547;
wswXMultiplier = speed * 0.923879532511287;
wnwXMultiplier = speed * 0.923879532511287;
nwXMultiplier = speed * Math.SQRT1_2;
nnwXMultiplier = speed * 0.38268343236509;
nneYMultiplier = speed * 0.923879532511287;
neYMultiplier = speed * Math.SQRT1_2;
eneYMultiplier = speed * 0.38268343236509;
eseYMultiplier = speed * 0.38268343236509;
seYMultiplier = speed * 0.707106781186547;
sseYMultiplier = speed * 0.923879532511287;
sswYMultiplier = speed * 0.923879532511287;
swYMultiplier = speed * Math.SQRT1_2;
wswYMultiplier = speed * 0.38268343236509;
wnwYMultiplier = speed * 0.38268343236509;
nwYMultiplier = speed * 0.707106781186547;
nnwYMultiplier = speed * 0.923879532511287;
}
function launch(lX, lY, lDirection) {
x = lX;
y = lY;
pseudoX = lX;
pseudoY = lY;
direction = lDirection;
active = true;
masterClip.attachMovie("bulletMov", ID, masterClip.getNextHighestDepth(), {_x:x, _y:y});
for (var _local2 in masterClip) {
if (typeof(masterClip[_local2]) == "movieclip") {
if (masterClip[_local2]._name == ID) {
ownMovieClip = masterClip[_local2];
break;
}
}
}
}
function die() {
active = false;
removeMovieClip(ID);
}
function updateHits(ePlane) {
}
function updatePosition(timeElapsed) {
if (active == true) {
switch (direction) {
case N :
y = y - (speed * timeElapsed);
break;
case NNE :
y = y - (timeElapsed * nneYMultiplier);
x = x + (timeElapsed * nneXMultiplier);
break;
case NE :
y = y - (timeElapsed * neYMultiplier);
x = x + (timeElapsed * neXMultiplier);
break;
case ENE :
y = y - (timeElapsed * eneYMultiplier);
x = x + (timeElapsed * eneXMultiplier);
break;
case E :
x = x + (speed * timeElapsed);
break;
case ESE :
x = x + (timeElapsed * eseXMultiplier);
y = y + (timeElapsed * eseYMultiplier);
break;
case SE :
x = x + (timeElapsed * seXMultiplier);
y = y + (timeElapsed * seYMultiplier);
break;
case SSE :
x = x + (timeElapsed * seXMultiplier);
y = y + (timeElapsed * seYMultiplier);
break;
case S :
y = y + (speed * timeElapsed);
break;
case SSW :
y = y + (timeElapsed * sswYMultiplier);
x = x - (timeElapsed * sswXMultiplier);
break;
case SW :
y = y + (timeElapsed * swYMultiplier);
x = x - (timeElapsed * swXMultiplier);
break;
case WSW :
y = y + (timeElapsed * wswYMultiplier);
x = x - (timeElapsed * wswXMultiplier);
break;
case W :
x = x - (speed * timeElapsed);
break;
case WNW :
x = x - (timeElapsed * wnwXMultiplier);
y = y - (timeElapsed * wnwYMultiplier);
break;
case NW :
x = x - (timeElapsed * nwXMultiplier);
y = y - (timeElapsed * nwYMultiplier);
break;
case NNW :
x = x - (timeElapsed * nnwXMultiplier);
y = y - (timeElapsed * nnwYMultiplier);
}
if ((x < (-getProperty(ID, _width))) or (x > (refScreen.width + getProperty(ID, _width)))) {
deathPending = true;
}
if ((y < (-getProperty(ID, _height))) or (y > (refScreen.height + getProperty(ID, _height)))) {
deathPending = true;
}
if (active == true) {
setProperty(ID, _x , x);
setProperty(ID, _y , y);
}
}
pseudoX = x;
pseudoY = y;
clearDead();
}
function checkPosition() {
if ((active == true) && (lastActive == false)) {
masterClip.attachMovie("bulletMov", ID, masterClip.getNextHighestDepth(), {_x:x, _y:y});
for (var _local2 in masterClip) {
if (typeof(masterClip[_local2]) == "movieclip") {
if (masterClip[_local2]._name == ID) {
ownMovieClip = masterClip[_local2];
break;
}
}
}
}
if ((active == false) && (lastActive == true)) {
removeMovieClip(ID);
}
lastActive = active;
if (active == true) {
setProperty(ID, _x , x);
setProperty(ID, _y , y);
}
}
function clearDead() {
if (deathPending == true) {
deathPending = false;
die();
}
}
function clear() {
removeMovieClip(ID);
}
function updatePseudoPosition(timeElapsed) {
if (active == true) {
switch (direction) {
case N :
pseudoY = pseudoY - (speed * timeElapsed);
break;
case NNE :
pseudoY = pseudoY - (timeElapsed * nneYMultiplier);
pseudoX = pseudoX + (timeElapsed * nneXMultiplier);
break;
case NE :
pseudoY = pseudoY - (timeElapsed * neYMultiplier);
pseudoX = pseudoX + (timeElapsed * neXMultiplier);
break;
case ENE :
pseudoY = pseudoY - (timeElapsed * eneYMultiplier);
pseudoX = pseudoX + (timeElapsed * eneXMultiplier);
break;
case E :
pseudoX = pseudoX + (speed * timeElapsed);
break;
case ESE :
pseudoX = pseudoX + (timeElapsed * eseXMultiplier);
pseudoY = pseudoY + (timeElapsed * eseYMultiplier);
break;
case SE :
pseudoX = pseudoX + (timeElapsed * seXMultiplier);
pseudoY = pseudoY + (timeElapsed * seYMultiplier);
break;
case SSE :
pseudoX = pseudoX + (timeElapsed * seXMultiplier);
pseudoY = pseudoY + (timeElapsed * seYMultiplier);
break;
case S :
pseudoY = pseudoY + (speed * timeElapsed);
break;
case SSW :
pseudoY = pseudoY + (timeElapsed * sswYMultiplier);
pseudoX = pseudoX - (timeElapsed * sswXMultiplier);
break;
case SW :
pseudoY = pseudoY + (timeElapsed * swYMultiplier);
pseudoX = pseudoX - (timeElapsed * swXMultiplier);
break;
case WSW :
pseudoY = pseudoY + (timeElapsed * wswYMultiplier);
pseudoX = pseudoX - (timeElapsed * wswXMultiplier);
break;
case W :
pseudoX = pseudoX - (speed * timeElapsed);
break;
case WNW :
pseudoX = pseudoX - (timeElapsed * wnwXMultiplier);
pseudoY = pseudoY - (timeElapsed * wnwYMultiplier);
break;
case NW :
pseudoX = pseudoX - (timeElapsed * nwXMultiplier);
pseudoY = pseudoY - (timeElapsed * nwYMultiplier);
break;
case NNW :
pseudoX = pseudoX - (timeElapsed * nnwXMultiplier);
pseudoY = pseudoY - (timeElapsed * nnwYMultiplier);
}
if (active == true) {
setProperty(ID, _x , pseudoX);
setProperty(ID, _y , pseudoY);
}
}
}
var N = 0;
var NNE = 1;
var NE = 2;
var ENE = 3;
var E = 4;
var ESE = 5;
var SE = 6;
var SSE = 7;
var S = 8;
var SSW = 9;
var SW = 10;
var WSW = 11;
var W = 12;
var WNW = 13;
var NW = 14;
var NNW = 15;
}
Symbol 352 MovieClip [__Packages.screen] Frame 0
class screen
{
var width, height;
function screen () {
width = 640;
height = 445;
}
}
Symbol 353 MovieClip [__Packages.settings] Frame 0
class settings
{
function settings () {
}
var updatesPerSecond = 4;
var rWait = 500;
var gUWait = 5000;
var planeSpeed = 0.15;
var bulletSpeed = 0.3;
var explosionLength = 1;
var bulletDelay = 0;
}
Symbol 306 Button
on (release) {
if (!_global.isBusy) {
sendChatMsg();
}
}
Symbol 307 Button
on (release) {
if (!_global.isBusy) {
closeConnection();
}
}
Symbol 309 Button
on (release) {
if (!_global.isBusy) {
makeNewRoom();
}
}
Symbol 311 MovieClip Frame 1
this._parent.gamingcheck = this._parent.gamingcheck + 1;
trace(this._parent.gamingcheck);
if (this._parent.gamingcheck == 121) {
tellTarget (this._parent) {
gotoAndPlay ("chatty");
};
}
Symbol 339 Button
on (release) {
getURL ("http://www.weebls-stuff.com/games/Rock+Scissors+Paper+Multiplayer/");
}