Frame 2
if (_framesloaded < 25) {
gotoAndPlay (1);
}
Frame 3
function getUserInfo(scope, callback) {
var _local1 = _global;
var _local2 = this;
var _local3 = _root;
stop();
lVars = new LoadVars();
lVars.onLoad = function (success) {
var _local1 = _global;
var _local2 = this;
var _local3 = _root;
_local1.userInfoObj = new Object();
_local1.userInfoObj.userName = lVars.user_name;
_local3.mcDebug.dTrace("[getUserInfo]user_name:" + _local1.userInfoObj.userName);
_local1.userInfoObj.isLoggedIn = function () {
var _local1 = this;
_root.mcDebug.dTrace("this.userName:" + _local1.userName);
return(((_local1.userName != "Anonymous") and (_local1.userName != "")) and (_local1.userName != undefined));
};
_local3.mcDebug.dTrace("logged in ?:" + _local1.userInfoObj.isLoggedIn());
callback.call(scope, 1);
};
lVars.onLoadError = function () {
trace("error getting user info");
};
lVars.sendAndLoad("http://www.pizmogames.com/levelheads/php/get_user_info.php", lVars, "POST");
}
function loadFps(x, y) {
var _local1 = _root;
_local1.createEmptyMovieClip("mcFps", _local1.getNextHighestDepth());
_local1.mcFps.loadMovie(_global.baseUrl + "shared/fps/fps.swf");
_local1.mcFps._x = x;
_local1.mcFps._y = y;
}
function getUserInfo_cb() {
_root.play();
}
function dTrace(str) {
if (_root.mcDebug == undefined) {
trace(str);
} else {
_root.mcDebug.dTrace(str);
}
}
function postHighScoreClicked() {
if (_root.highScoreData == undefined) {
_root.highScoreData = new Object();
}
determineScore();
loadHighScoreHub();
}
function determineScore() {
_root.highScoreData.score = _root.score;
}
function returnToGameFromHighScore() {
if (_root.highScoreData != undefined) {
_root.highScoreData = undefined;
}
}
function viewHighScoresClicked() {
_root.highScoreData = undefined;
loadHighScoreHub();
}
function checkScoreRank(mc) {
var _local1 = _root;
url = "http://www.pizmogames.com/php/highscore/check_score_rank.php";
if (_local1.highScoreData == undefined) {
_local1.highScoreData = new Object();
}
determineScore();
lVars = new LoadVars();
lVars.score = _local1.highScoreData.score;
lVars.lower_is_better = "0";
lVars.time_period = "daily";
lVars.game_handle = _local1.gameInfo.game_handle;
lVars.onLoad = function (success) {
mcDebug.dTrace("done checking score rank");
_root.mcDebug.dTraceObject(lVars);
trace("your rank is:" + lVars.rank);
rank = Number(lVars.rank);
suffixArr = ["th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th"];
suffix = suffixArr[rank % 10];
if ((rank == 12) or (rank == 11)) {
suffix = "th";
}
mc.rankTxt = lVars.rank + suffix;
mc.play();
};
lVars.sendAndLoad(url, lVars, "POST");
}
function loadHighScoreHub() {
_root.createEmptyMovieClip("mcHighScoreHub", 999997);
mcHighScoreHub._xscale = 99;
mcHighScoreHub._yscale = mcHighScoreHub._xscale;
if (_global.baseUrl.indexOf("file:", 0) == -1) {
suffix = "?" + random(999999);
} else {
suffix = "";
}
_root.mcHighScoreHub.loadMovie((_global.baseUrl + "shared/highScoreHub/highScoreHub.swf") + suffix);
}
function initGlobals() {
xUnit = 36.8;
yUnit = 36.8;
gDdoubleClickTime = 300;
numRows = 10;
numColumns = 10;
chipArray = new Array();
nextZOrder = 100;
i = 0;
while (i < numRows) {
chipArray.push(new Array());
i++;
}
straightArrays = new Array();
stopSignTimeCounterMax = 168;
stopSignAnimCounter = 0;
handJibeAnimCounter = 0;
numMessageAnims = 6;
secsPerLevel = 59;
firstWildHandLevel = 3;
}
function initGame() {
var chip;
var i;
var j;
score = 0;
i = numRows - 1;
while (i >= 0) {
j = 0;
while (j < numColumns) {
clipName = ("mcChip" + i) + j;
if (eval ("mcPuzzle.mcChip" + i) == undefined) {
duplicateMovieClip (mcPuzzle.mcChip, clipName, nextZOrder);
}
chip = eval (("mcPuzzle.mcChip" + i) + j);
nextZOrder++;
chipArray[i][j] = chip;
chip._x = 0 + (j * xUnit);
chip._y = 50 + (i * yUnit);
chip.column = j;
chip.row = i;
chip._visible = false;
chip.num = -1;
j++;
}
i--;
}
i = 0;
while (i < 15) {
clipName = "mcmessage" + i;
if (eval ("mcAllMessages.mcmessage" + i) == undefined) {
duplicateMovieClip (mcAllMessages.mcmessage, clipName, nextZOrder);
nextZorder++;
}
message = eval ("mcPuzzle.mcMessage" + i);
message.state = "idle";
i++;
}
handJibeFinalX = mcHandJibeAnim._x;
handJibeFinaly = mcHandJibeAnim._y;
if (gamePlayedAlready == undefined) {
gamePlayedAlready = true;
} else {
logActivity("play_again");
}
}
function initLevel() {
var chip;
var _local2;
var _local1;
_local2 = numRows - 1;
while (_local2 >= 0) {
_local1 = 0;
while (_local1 < numColumns) {
chipArray[_local2][_local1].mcButton._visible = true;
clearChip(chipArray[_local2][_local1]);
_local1++;
}
_local2--;
}
mcStopSigns._visible = false;
stopSignTimeCounter = 0;
numRowsDropped = 0;
if (levelNum > 4) {
_local2 = numRows - 1;
while (_local2 >= (numRows - 2)) {
_local1 = 0;
while (_local1 < numColumns) {
setRandomChip(chipArray[_local2][_local1]);
_local1++;
}
_local2--;
}
numRowsDropped = 2;
}
colToDropChip = 0;
whereToGo = "init loop";
dropDir = 1;
paused = false;
timePaused = 0;
numInitialRows = 1 + Number(levelNum);
trace("numInitialRows:" + numInitialRows);
if (numInitialRows > (numRows - 2)) {
numInitialRows = numRows - 2;
}
addChipCounterMax = 75 - (levelNum * 12);
trace("addChipCounterMax:" + addChipCounterMax);
if (addChipCounterMax < 4) {
addChipCounterMax = 7;
}
addChipCounter = addChipCounterMax;
chipJustClicked = false;
if (levelnum > 1) {
mcSoundObj.playsound("level start");
}
logActivity("level_start_" + levelnum);
}
function stepDropInitialChips() {
var _local2;
var _local1;
var _local3;
setRandomChip(chipArray[0][colToDropChip]);
if (((colToDropChip + dropDir) < 0) or ((colToDropChip + dropDir) > numColumns)) {
numRowsDropped++;
if (numRowsDropped == numInitialRows) {
whereToGo = "play";
startTime = getTimer();
if (levelNum >= firstWildHandLevel) {
_local2 = numRows - 1;
while (_local2 >= 0) {
_local1 = 0;
while (_local1 < numColumns) {
if ((chipArray[_local2][_local1].num == 0) and chipArray[_local2][_local1]._visible) {
_local3 = chipArray[_local2][_local1];
}
_local1++;
}
_local2--;
}
_local3.wildCardFlag = true;
_local3.play();
trace((("made wild card:" + _local3.row) + ",") + _local3.column);
}
} else {
dropDir = -dropDir;
mcSoundObj.playSound("contact");
}
} else {
colToDropChip = colToDropChip + dropDir;
}
moveChipsDown();
}
function setRandomChip(chip) {
var _local1 = chip;
var frm;
if ((levelnum >= firstWildHandLevel) and (random(50) == 1)) {
_local1.wildCardFlag = true;
} else {
_local1.wildCardFlag = false;
_local1.num = random(6);
setChipToNum(_local1, _local1.num);
}
_local1._visible = true;
}
function setChipToNum(chip, num) {
var _local1 = chip;
_local1.num = num;
_local1.gotoAndStop("h" + _local1.num);
}
function updateTimer() {
secsElapsed = int(((getTimer() - startTime) - timePaused) / 1000);
timer = secsPerLevel - secsElapsed;
}
function step() {
var _local2;
var _local1;
var k;
var chip;
var dir;
if (!paused) {
moveChipsDown();
if (chipJustClicked) {
checkCloseEmptyColumns(true);
chipJustClicked = false;
}
if (stopSignTimeCounter > 0) {
stopSignTimeCounter--;
mcStopSigns.secs = int(stopSignTimeCounter / 24);
if (stopSignTimeCounter == 0) {
mcStopSigns._visible = false;
}
} else {
if (handJibeAnimCounter == 0) {
addChipCounter--;
}
if (addChipcounter == 0) {
numFilled = 0;
_local2 = 1;
while (_local2 < numRows) {
_local1 = 0;
while (_local1 < numColumns) {
if (chipArray[_local2][_local1]._visible) {
numFilled++;
}
_local1++;
}
_local2++;
}
filledPercent = (numFilled / ((numRows - 1) * numcolumns)) * 100;
if (filledPercent == 100) {
whereToGo = "level lost";
mcSoundObj.playSound("lose");
mcSoundObj.music.setVolume(0);
setRandomChip(chipArray[0][random(numColumns)]);
logActivity("level_lost_" + levelnum);
} else {
dropNewChip();
}
}
if (stopSignAnimCounter > 0) {
mcStopSigns._x = mcStopSigns._x + stopSignDx;
mcStopSigns._y = mcStopSigns._y + stopSignDy;
stopSignAnimCounter--;
if (stopSignAnimCounter == 0) {
stopSignTimeCounter = stopSignTimeCounterMax;
mcStopSigns.play();
mcStopSigns._x = stopSignFinalX;
mcStopSigns._y = stopSignFinaly;
}
}
if (handJibeAnimCounter > 0) {
mcHandJibeAnim._x = mcHandJibeAnim._x + handJibeDx;
mcHandJibeAnim._y = mcHandJibeAnim._y + handJibeDy;
handJibeAnimCounter--;
if (handJibeAnimCounter == 0) {
handJibeTimeCounter = handJibeTimeCounterMax;
mcHandJibeAnim.play();
mcHandJibeAnim._x = handJibeFinalX;
mcHandJibeAnim._y = handJibeFinaly;
}
}
}
updateTimer();
if (Number(timer) == 0) {
levelWon();
}
}
}
function levelWon() {
whereToGo = "level won";
stopAllSounds();
levMod3 = (levelNum - (int(levelnum / 3) * 3)) + 1;
mcSoundObj.playSound("level won " + levMod3);
mcSoundObj.music.setVolume(0);
logActivity("level_won_" + levelnum);
}
function dropNewChip() {
foundEmptyColumn = false;
while (!foundEmptyColumn) {
j = random(numColumns);
if (chipArray[1][j]._visible == false) {
foundEmptyColumn = true;
}
}
i = 0;
setRandomChip(chipArray[i][j]);
addChipCounter = addChipCounterMax;
if (filledPercent < 50) {
addChipCounter = int(addChipCounterMax * 0.6);
}
if (filledPercent < 40) {
addChipCounter = int(addChipCounterMax * 0.45);
}
if (filledPercent < 30) {
addChipCounter = int(addChipCounterMax * 0.3);
}
if (filledPercent < 20) {
if (levelNum > 1) {
addChipCounter = int(addChipCounterMax * 0.1);
}
}
}
function chipClicked(chip) {
var _local3 = chip;
var _local1;
var _local2;
resetMessageTypesSetAlready();
sameColorArray = new Array();
sameColorArray.push(_local3);
recursivelyCheckForSameColor(_local3);
dir = 1;
if (chipArray[_local3.row - 1][_local3.column].num == (_local3.num + dir)) {
straightArrays[0] = new Array(chipArray[_local3.row - 1][_local3.column]);
recursivelyCheckForStraight(chipArray[_local3.row - 1][_local3.column], dir, straightArrays[0]);
}
if (chipArray[_local3.row + 1][_local3.column].num == (_local3.num + dir)) {
straightArrays[1] = new Array(chipArray[_local3.row + 1][_local3.column]);
recursivelyCheckForStraight(chipArray[_local3.row + 1][_local3.column], dir, straightArrays[1]);
}
if (chipArray[_local3.row][_local3.column - 1].num == (_local3.num + dir)) {
straightArrays[2] = new Array(chipArray[_local3.row][_local3.column - 1]);
recursivelyCheckForStraight(chipArray[_local3.row][_local3.column - 1], dir, straightArrays[2]);
}
if (chipArray[_local3.row][_local3.column + 1].num == (_local3.num + dir)) {
straightArrays[3] = new Array(chipArray[_local3.row][_local3.column + 1]);
recursivelyCheckForStraight(chipArray[_local3.row][_local3.column + 1], dir, straightArrays[3]);
}
chipsToRemove = new Array();
if (_local3.num == 1) {
bunniesFound = new Array();
if (chipArray[_local3.row - 1][_local3.column]._visible and (chipArray[_local3.row - 1][_local3.column].num == 2)) {
bunniesFound.push(chipArray[_local3.row - 1][_local3.column]);
}
b = 0;
while (b < bunniesFound.length) {
rowdir = bunniesFound[b].row - _local3.row;
columndir = bunniesFound[b].column - _local3.column;
_local1 = _local3.row;
_local2 = _local3.column;
keepgoing = true;
while (keepgoing) {
removeChip(chipArray[_local1][_local2]);
_local1 = _local1 + rowdir;
_local2 = _local2 + columndir;
if ((((_local1 >= numrows) or (_local1 < 0)) or (_local2 >= numColumns)) or (_local2 < 0)) {
keepgoing = false;
}
}
b++;
}
if (bunniesFound.length > 0) {
mcSoundObj.playsound("match shoot bunny");
setMessage(_local3, "shoot the bunny");
}
}
checkPairs(_local3, chipArray[_local3.row - 1][_local3.column]);
checkPairs(_local3, chipArray[_local3.row + 1][_local3.column]);
checkPairs(_local3, chipArray[_local3.row][_local3.column + 1]);
checkPairs(_local3, chipArray[_local3.row][_local3.column - 1]);
if ((_local3.num == 2) and (sameColorArray.length >= 5)) {
_local1 = 0;
while (_local1 < numRows) {
_local2 = 0;
while (_local2 <= numColumns) {
if (chipArray[_local1][_local2].num == 1) {
removeChip(chipArray[_local1][_local2]);
}
_local2++;
}
_local1++;
}
setMessage(_local3, "peace");
mcSoundObj.playsound("match peace");
}
if ((_local3.num == 5) and (sameColorArray.length >= 5)) {
if (stopSignAnimCounter == 0) {
if (stopSignTimeCounter > 0) {
stopSignTimeCounter = stopSignTimeCounterMax;
} else {
stopSignFinalX = mcStopSigns._x;
stopSignFinaly = mcStopSigns._y;
stopSignAnimCounter = 20;
mcStopSigns._y = _ymouse;
stopSignDx = (stopSignFinalX - mcStopSigns._x) / stopSignAnimCounter;
stopSignDy = (stopSignFinaly - mcStopSigns._y) / stopSignAnimCounter;
mcStopSigns._visible = true;
mcStopSigns.gotoAndStop(1);
mcSoundObj.playSound("match stop sign");
}
}
}
if (sameColorArray.length >= 3) {
setMessage(_local3, "same", sameColorArray.length);
_local1 = 0;
while (_local1 < sameColorArray.length) {
removeChip(sameColorArray[_local1]);
_local1++;
}
mcSoundObj.playSound("match same " + (random(2) + 1));
}
if (chipsToRemove.length > 0) {
chipsToRemove.push(_local3);
_local1 = 0;
while (_local1 < chipsToRemove.length) {
removeChip(chipsToRemove[_local1]);
_local1++;
}
}
_local1 = 0;
while (_local1 < straightArrays.length) {
playStraightSound = false;
if (straightArrays[_local1].length >= 3) {
playStraightSound = true;
firstNum = straightArrays[_local1][0].num;
_local2 = 0;
while (_local2 < straightArrays[_local1].length) {
removeChip(straightArrays[_local1][_local2]);
_local2++;
}
removeChip(_local3);
if (straightArrays[_local1].length >= 6) {
handJibeAnimCounter = 20;
mcHandJibeAnim._y = _ymouse;
mcHandJibeAnim._x = _xmouse;
handJibeDx = (handJibeFinalX - mcHandJibeAnim._x) / handJibeAnimCounter;
handJibeDy = (handJibeFinaly - mcHandJibeAnim._y) / handJibeAnimCounter;
mcHandJibeAnim._visible = true;
mcHandJibeAnim.gotoAndStop(1);
removeAllChips();
playStraightSound = false;
mcSoundObj.playSound("match hand jibe");
logActivity("hand_jibe_found");
} else {
setMessage(_local3, "straight", firstNum, (firstNum + straightArrays[_local1].length) - 1);
}
}
straightArrays[_local1] = new Array();
if (playStraightSound) {
mcSoundObj.playSound("match straight");
}
_local1++;
}
chipJustClicked = true;
}
function handJibeAnimDone() {
mcHandJibeAnim._visible = false;
}
function checkCloseEmptyColumns(soundFlag) {
var _local1;
var _local2;
var _local3;
playEmptyColumnSound = false;
_local3 = 0;
while (_local3 < int((numColumns / 2) + 1)) {
columnEmpty = true;
_local1 = 0;
while (_local1 < numRows) {
if (chipArray[_local1][_local3]._visible) {
columnEmpty = false;
}
_local1++;
}
if (columnEmpty) {
allPreviousColumnsEmpty = true;
_local2 = _local3;
while (_local2 >= 0) {
_local1 = 0;
while (_local1 < numRows) {
copyOneChipToAnother(chipArray[_local1][_local2 - 1], chipArray[_local1][_local2]);
if (chipArray[_local1][_local2 - 1]._visible) {
allPreviousColumnsEmpty = false;
}
clearChip(chipArray[_local1][_local2 - 1]);
_local1++;
}
_local2--;
}
if (!allPreviousColumnsEmpty) {
playEmptyColumnSound = true;
}
}
columnEmpty = true;
colToCheck = (numColumns - _local3) - 1;
_local1 = 0;
while (_local1 < numRows) {
if (chipArray[_local1][colToCheck]._visible) {
columnEmpty = false;
}
_local1++;
}
if (columnEmpty) {
allPreviousColumnsEmpty = true;
_local2 = colToCheck;
while (_local2 < numColumns) {
_local1 = 0;
while (_local1 < numRows) {
if (chipArray[_local1][_local2 + 1]._visible) {
allPreviousColumnsEmpty = false;
}
copyOneChipToAnother(chipArray[_local1][_local2 + 1], chipArray[_local1][_local2]);
clearChip(chipArray[_local1][_local2 + 1]);
_local1++;
}
_local2++;
}
if (!allPreviousColumnsEmpty) {
playEmptyColumnSound = true;
}
}
_local3++;
}
if (soundflag and playEmptyColumnSound) {
mcSoundObj.playsound("contract column");
}
}
function closeColumnIfEmpty(j, dir) {
var _local2 = j;
var _local3 = dir;
var _local1;
columnEmpty = true;
_local1 = 0;
while (_local1 < numRows) {
if (chipArray[_local1][_local2]._visible) {
columnEmpty = false;
}
_local1++;
}
if (columnEmpty) {
_local1 = 0;
while (_local1 < numRows) {
copyOneChipToAnother(chipArray[_local1][_local2 - _local3], chipArray[_local1][_local2]);
clearChip(chipArray[_local1][_local2 - _local3]);
_local1++;
}
}
}
function checkPairs(chip, chipNear) {
var _local1 = chipNear;
var _local2 = chip;
if (_local1._visible) {
pairFound = false;
if ((_local1.num == 5) and (_local2.num == 2)) {
pairFound = true;
mcSoundObj.playSound("match scissors");
}
if ((_local1.num == 0) and (_local2.num == 5)) {
pairFound = true;
mcSoundObj.playSound("match paper");
}
if ((_local1.num == 2) and (_local2.num == 0)) {
pairFound = true;
mcSoundObj.playSound("match rock");
}
if ((_local1.num == 5) and (_local2.num == 5)) {
if (sameColorArray.length == 2) {
pairFound = true;
mcSoundObj.playSound("match high five");
}
}
if (pairFound) {
chipsToRemove.push(_local1);
setMessage(_local2, "srp", String(_local2.num) + String(_local1.num));
}
}
}
function resetMessageTypesSetAlready() {
messageTypesSetAlready = new Array();
}
function setMessage(chip, mtype, param1, param2) {
var _local1 = mtype;
var _local2 = param1;
var _local3 = chip;
if (messageTypesSetAlready[_local1] == undefined) {
message = findUnusedMessage();
switch (_local1) {
case "srp" :
message.content.gotoAndPlay("srp " + _local2);
break;
case "straight" :
message.content.gotoAndPlay("straight");
message.content.firstNum = _local2;
message.content.lastNum = param2;
trace(((("passed " + _local2) + " ,") + param2) + " to straight message");
break;
case "same" :
message.content.val = _local2;
message.content.num = _local3.num;
message.content.gotoAndPlay("same");
break;
default :
message.content.gotoAndPlay(_local1);
}
message._x = _local3._x;
message._y = _local3._y - 70;
message.state = "active";
if (_local3.column > (0.8 * numColumns)) {
messageAnimNum = random((numMessageAnims / 2) + 1);
} else {
messageAnimNum = random(numMessageAnims);
}
trace("anim num:" + messageAnimNum);
message.gotoAndPlay("anim " + messageAnimNum);
messageTypesSetAlready[_local1] = true;
}
}
function findUnusedMessage() {
var i;
var availmessage;
availMessage = undefined;
i = 0;
while (i < 15) {
message = eval ("mcAllMessages.mcMessage" + i);
if (message.state == "idle") {
availMessage = message;
}
i++;
}
return(availMessage);
}
function recursivelyCheckForSameColor(chip, arr) {
var _local1 = chip;
if (_local1._visible) {
checkAddChipToSameColorArray(_local1, chipArray[_local1.row - 1][_local1.column]);
checkAddChipToSameColorArray(_local1, chipArray[_local1.row + 1][_local1.column]);
checkAddChipToSameColorArray(_local1, chipArray[_local1.row][_local1.column + 1]);
checkAddChipToSameColorArray(_local1, chipArray[_local1.row][_local1.column - 1]);
}
}
function checkAddChipToSameColorArray(chip, chipNear) {
var _local1 = chipNear;
if (_local1._visible) {
if (!arrayContainsItem(sameColorArray, _local1)) {
if (_local1.num == chip.num) {
sameColorArray.push(_local1);
recursivelyCheckForSameColor(_local1);
}
}
}
}
function recursivelyCheckForStraight(chip, dir, arr) {
var _local1 = chip;
var _local2 = arr;
var _local3 = dir;
checkAddChipToStraightArray(_local1, chipArray[_local1.row - 1][_local1.column], _local3, _local2);
checkAddChipToStraightArray(_local1, chipArray[_local1.row + 1][_local1.column], _local3, _local2);
checkAddChipToStraightArray(_local1, chipArray[_local1.row][_local1.column + 1], _local3, _local2);
checkAddChipToStraightArray(_local1, chipArray[_local1.row][_local1.column - 1], _local3, _local2);
}
function checkAddChipToStraightArray(chip, chipNear, dir, arr) {
var _local1 = chipNear;
if (_local1._visible) {
if (_local1.num == (chip.num + dir)) {
arr.push(_local1);
recursivelyCheckForStraight(_local1, dir, arr);
}
}
}
function removeChip(chip) {
chip.gotoAndPlay("die" + random(3));
chip.num = -1;
score = score + 10;
}
function clearChip(chip) {
chip._visible = false;
chip.num = -1;
}
function removeAllChips() {
var _local2;
var _local1;
_local2 = numRows - 1;
while (_local2 >= 0) {
_local1 = 0;
while (_local1 < numColumns) {
removeChip(chipArray[_local2][_local1]);
_local1++;
}
_local2--;
}
}
function moveChipsDown() {
var _local1;
var _local2;
var _local3;
playContactSound = false;
_local1 = numRows - 2;
while (_local1 >= 0) {
_local2 = 0;
while (_local2 < numColumns) {
_local3 = chipArray[_local1][_local2];
chipBelow = chipArray[_local1 + 1][_local2];
if (_local3._visible and (chipBelow._visible == false)) {
copyOneChipToAnother(_local3, chipBelow);
_local3._visible = false;
if ((_local1 + 1) == (numRows - 1)) {
checkCloseEmptyColumns(false);
}
if (chipArray[_local1 + 2][_local2]._visible or ((_local1 + 1) == (numRows - 1))) {
playContactSound = true;
}
}
_local2++;
}
_local1--;
}
if (playContactSound) {
mcSoundObj.playSound("contact");
}
}
function copyOneChipToAnother(chipToCopyFrom, chip) {
var _local1 = chipToCopyFrom;
var _local2 = chip;
_local2.num = _local1.num;
if (_local1.wildCardFlag) {
_local2.gotoAndPlay(_local1._currentframe);
} else {
_local2.gotoAndStop(_local1._currentframe);
}
_local2._visible = _local1._visible;
_local2.wildCardFlag = _local1.wildCardFlag;
}
function pauseClicked() {
mcPausedMessage._visible = true;
_root.mcSoundObj.playSound("click");
pauseGame();
logActivity("pause_clicked");
}
function continueClicked() {
mcPausedMessage._visible = false;
_root.mcSoundObj.playSound("click");
continueGame();
}
function helpClicked() {
mcHelp._visible = true;
mcHelp.gotoAndStop(1);
_root.mcSoundObj.playSound("click");
pauseGame();
logActivity("help_clicked");
}
function helpOKclicked() {
mcHelp._visible = false;
_root.mcSoundObj.playSound("click");
continueGame();
}
function pauseGame() {
paused = true;
if (mcSoundObj.soundon) {
soundOnBeforePause = true;
_root.mcSoundObj.toggleSound();
} else {
soundOnBeforePause = false;
}
pauseStartTime = getTimer();
}
function continueGame() {
paused = false;
if (soundOnBeforePause) {
_root.mcSoundObj.toggleSound();
}
timePaused = timePaused + (getTimer() - pauseStartTime);
}
function arrayContainsItem(arr, item) {
var _local2 = arr;
var _local3 = item;
var _local1;
contains = false;
_local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] == _local3) {
contains = true;
}
_local1++;
}
return(contains);
}
function getTotalMediaLoadedPct() {
var _local1 = _root;
bytesTotal = _local1.getBytesTotal() + _local1.mcSoundObj.getBytesTotal();
bytesLoaded = _local1.getBytesLoaded() + _local1.mcSoundObj.getBytesLoaded();
return((bytesLoaded / bytesTotal) * 100);
}
function logActivity(activity) {
url = ("activity_log/" + activity) + ".swf";
mcLogger.loadMovie(url);
trace("logged:" + url);
}
function sendToAFriend() {
getURL ("javascript:sendtofriend()");
}
function loadTout(mcTout) {
var _local2 = mcTout;
var _local1 = ((_global.baseUrl + "games/handjibe/media/tout") + random(3)) + ".swf";
trace((("url:" + _local1) + ",") + _local2);
loadMovie (_local1, _local2);
}
MENU = new ContextMenu();
MENU.hideBuiltInItems();
Functioned = new ContextMenuItem("Copyright \u00A9 Pizmo Games", undefined);
MENU.customItems.push(Functioned);
_root.menu = MENU;
urlArr = this._url.split("/");
_global.baseUrl = "";
var i = 0;
while (i < (urlArr.length - 3)) {
_global.baseUrl = _global.baseUrl + (urlArr[i] + "/");
i++;
}
trace("_global.baseUrl:" + _global.baseUrl);
_global.padString = function (str, char, num) {
var _local2 = num;
var _local3 = char;
var _local1 = str;
while (_local1.length < _local2) {
_local1 = _local3 + _local1;
}
return(_local1);
};
String.prototype.pluralize = function (num) {
if (Math.abs(num) > 1) {
this = this + "s";
}
};
Array.prototype.duplicateArray = function () {
var _local3 = this.length;
var _local2 = new Array();
var _local1 = 0;
while (_local1 < _local3) {
_local2.push(this[_local1]);
_local1++;
}
return(_local2);
};
Array.prototype.getPos = function (val) {
var _local2 = this;
var _local3 = -1;
var _local1;
_local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] == val) {
_local3 = _local1;
}
_local1++;
}
return(_local3);
};
Array.prototype.deleteItem = function (item) {
var _local1 = this.getPos(item);
if (_local1 != -1) {
this.splice(_local1, 1);
}
};
_root.createEmptyMovieClip("mcDialogue", _root.getNextHighestDepth());
dialogueClipLoader = new MovieClipLoader();
dialogueClipLoader.onLoadError = function () {
};
dialogueClipLoader.onLoadInit = function () {
};
url = _global.baseUrl + "shared/interfaceElements/dialogue.swf";
dialogueClipLoader.loadClip(url, _root.mcDialogue);
System.security.allowDomain("pizmogames.com");
showDebugLog = false;
if (showDebugLog) {
_root.createEmptyMovieClip("mcDebug", _root.getNextHighestDepth());
_root.mcDebug._x = 530;
loader = new MovieClipLoader();
loader.onLoadInit = function () {
};
loader.onLoadError = function (s) {
trace("error loading :" + s);
};
loader.loadClip(_global.baseUrl + "shared/debug/debugLog.swf", _root.mcDebug);
}
showFps = false;
if (showFps) {
loadFps(5, 5);
}
if (_root.gameInfo == undefined) {
_root.gameInfo = new Object();
}
_root.gameInfo.game_handle = "handjibe";
_root.gameInfo.scoreDataType = "number";
_root.gameInfo.game_name_full = "Hand Jibe";
_root.gameInfo.lower_scores_better = "0";
_quality = "high";
Frame 7
mcSoundObj.loadMovie("media/sound.swf");
Frame 9
if (starttime == undefined) {
starttime = getTimer();
delaySeconds = 2;
gotoAndPlay(_currentframe - 1);
} else if ((getTimer() - starttime) < (delaySeconds * 1000)) {
gotoAndPlay(_currentframe - 1);
} else {
starttime = undefined;
}
Frame 22
if (getTotalMediaLoadedPct() == 100) {
gotoAndPlay ("title");
}
Instance of Symbol 37 MovieClip in Frame 23
onClipEvent (enterFrame) {
var pct;
pct = _root.getTotalMediaLoadedPct();
mcBar.gotoAndStop(int(pct));
if (pct >= 100) {
_root.gotoAndPlay("title");
}
}
Frame 26
stop();
Frame 30
levelNum = 1;
mcSoundObj.playMusic("main theme");
mcSoundObj.music.setVolume(50);
stop();
Instance of Symbol 108 MovieClip "mcStopSigns" in Frame 32
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 216 MovieClip "mcHandJibeAnim" in Frame 34
onClipEvent (load) {
_visible = false;
}
Frame 35
initGlobals();
initGame();
Instance of Symbol 235 MovieClip "mcPausedMessage" in Frame 36
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 251 MovieClip "mcHelp" in Frame 36
onClipEvent (load) {
_visible = false;
}
Frame 37
initLevel();
mcSoundObj.fadeOutMusic(2);
mcSoundObj.playMusic("music game");
Frame 39
stepDropChips();
Frame 40
stepDropInitialChips();
gotoAndPlay(whereToGo);
Frame 42
step();
Frame 43
step();
gotoAndPlay(wheretogo);
Frame 48
stop();
Frame 55
stop();
Symbol 15 MovieClip Frame 11
stop();
Symbol 16 MovieClip Frame 10
stop();
Symbol 25 Button
on (release) {
_root.chipClicked(_parent);
}
Instance of Symbol 26 MovieClip "mcButton" in Symbol 30 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 36 MovieClip Frame 101
stop();
Symbol 54 MovieClip Frame 1
num = 0;
Instance of Symbol 26 MovieClip "mcButton" in Symbol 54 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 54 MovieClip Frame 21
num = 1;
Symbol 54 MovieClip Frame 41
num = 2;
Symbol 54 MovieClip Frame 61
num = 3;
Symbol 54 MovieClip Frame 81
num = 4;
Symbol 54 MovieClip Frame 101
num = 5;
Symbol 54 MovieClip Frame 119
gotoAndPlay (1);
Symbol 54 MovieClip Frame 121
_visible = false;
stop();
Symbol 54 MovieClip Frame 124
_visible = false;
stop();
Symbol 54 MovieClip Frame 127
_visible = false;
stop();
Symbol 58 Button
on (release) {
_root.mcSoundObj.playSound("click");
gotoAndStop ("rules 2 hold");
}
Instance of Symbol 54 MovieClip in Symbol 66 MovieClip Frame 1
onClipEvent (load) {
chipToChange.wildCardFlag = true;
chipToChange.play();
}
Instance of Symbol 54 MovieClip in Symbol 66 MovieClip Frame 1
onClipEvent (load) {
chipToChange.wildCardFlag = true;
chipToChange.play();
}
Instance of Symbol 54 MovieClip in Symbol 66 MovieClip Frame 1
onClipEvent (load) {
chipToChange.wildCardFlag = true;
chipToChange.play();
}
Symbol 67 Button
on (release) {
_parent.mcSoundObj.playSound("click");
gotoAndPlay ("rules 2");
}
Symbol 68 Button
on (release) {
gotoAndStop ("rules 1 hold");
_parent.mcSoundObj.playSound("click");
}
Symbol 69 Button
on (release) {
_parent.mcSoundObj.playSound("click");
gotoAndStop ("rules 3 hold");
}
Symbol 76 Button
on (release) {
gotoAndStop ("rules 2 hold");
_parent.mcSoundObj.playSound("click");
}
Symbol 77 Button
on (release) {
gotoAndStop ("rules 2 hold");
_root.mcSoundObj.playSound("click");
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 7
onClipEvent (load) {
_root.setChipToNum(this, 3);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 7
onClipEvent (load) {
_root.setChipToNum(this, 4);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 7
onClipEvent (load) {
_root.setChipToNum(this, 5);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 7
onClipEvent (load) {
_root.setChipToNum(this, 0);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 7
onClipEvent (load) {
_root.setChipToNum(this, 1);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 7
onClipEvent (load) {
_root.setChipToNum(this, 2);
}
Symbol 78 MovieClip Frame 11
_root.mcSoundObj.playsound("contract column");
Symbol 78 MovieClip Frame 24
if (starttime == undefined) {
starttime = getTimer();
delaySeconds = 6;
gotoAndPlay(_currentframe - 1);
} else if ((getTimer() - starttime) < (delaySeconds * 1000)) {
gotoAndPlay(_currentframe - 1);
} else {
starttime = undefined;
}
Symbol 78 MovieClip Frame 29
_root.mcSoundObj.playsound("contract column");
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 41
onClipEvent (load) {
_root.setChipToNum(this, 5);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 41
onClipEvent (load) {
_root.setChipToNum(this, 0);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 41
onClipEvent (load) {
_root.setChipToNum(this, 2);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 41
onClipEvent (load) {
_root.setChipToNum(this, 5);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 41
onClipEvent (load) {
_root.setChipToNum(this, 5);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 41
onClipEvent (load) {
_root.setChipToNum(this, 1);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 41
onClipEvent (load) {
_root.setChipToNum(this, 2);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 41
onClipEvent (load) {
_root.setChipToNum(this, 3);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 41
onClipEvent (load) {
_root.setChipToNum(this, 4);
}
Symbol 78 MovieClip Frame 43
_root.mcSoundObj.playsound("contract column");
Symbol 78 MovieClip Frame 56
if (starttime == undefined) {
starttime = getTimer();
delaySeconds = 9;
gotoAndPlay(_currentframe - 1);
} else if ((getTimer() - starttime) < (delaySeconds * 1000)) {
gotoAndPlay(_currentframe - 1);
} else {
starttime = undefined;
}
Symbol 78 MovieClip Frame 62
_root.mcSoundObj.playsound("contract column");
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 73
onClipEvent (load) {
_root.setChipToNum(this, 1);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 73
onClipEvent (load) {
_root.setChipToNum(this, 2);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 73
onClipEvent (load) {
_root.setChipToNum(this, 2);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 73
onClipEvent (load) {
_root.setChipToNum(this, 2);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 73
onClipEvent (load) {
_root.setChipToNum(this, 2);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 73
onClipEvent (load) {
_root.setChipToNum(this, 2);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 73
onClipEvent (load) {
_root.setChipToNum(this, 2);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 73
onClipEvent (load) {
_root.setChipToNum(this, 5);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 73
onClipEvent (load) {
_root.setChipToNum(this, 5);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 73
onClipEvent (load) {
_root.setChipToNum(this, 5);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 73
onClipEvent (load) {
_root.setChipToNum(this, 5);
}
Instance of Symbol 54 MovieClip in Symbol 78 MovieClip Frame 73
onClipEvent (load) {
_root.setChipToNum(this, 5);
}
Symbol 78 MovieClip Frame 75
_root.mcSoundObj.playsound("contract column");
Symbol 78 MovieClip Frame 86
if (starttime == undefined) {
starttime = getTimer();
delaySeconds = 9;
gotoAndPlay(_currentframe - 1);
} else if ((getTimer() - starttime) < (delaySeconds * 1000)) {
gotoAndPlay(_currentframe - 1);
} else {
starttime = undefined;
}
Symbol 78 MovieClip Frame 90
_root.mcSoundObj.playsound("contract column");
Symbol 83 MovieClip Frame 1
stop();
Symbol 83 MovieClip Frame 2
stop();
Symbol 83 MovieClip Frame 3
stop();
Symbol 83 MovieClip Frame 4
stop();
Symbol 83 MovieClip Frame 5
stop();
Symbol 83 MovieClip Frame 6
stop();
Symbol 85 MovieClip Frame 1
starttime = getTimer();
beatTime = 498.375;
Symbol 85 MovieClip Frame 3
timeElapsed = getTimer() - starttime;
if (timeElapsed < beatTime) {
gotoAndPlay ("loop");
} else {
starttime = starttime + beatTime;
}
Symbol 85 MovieClip Frame 4
if (totalBeats == undefined) {
totalBeats = 0;
}
totalBeats++;
if (totalBeats == 4) {
mcTitle.mcHand.play();
totalBeats = 0;
}
Symbol 85 MovieClip Frame 7
gotoAndPlay ("loop");
Symbol 91 Button
on (release) {
play();
mcSoundObj.playSound("click");
}
Symbol 94 Button
on (release) {
_root.viewHighScoresClicked();
mcSoundObj.playSound("click");
}
Symbol 108 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 19
stop();
Symbol 110 MovieClip Frame 1
starttime = getTimer();
beatTime = 498.375;
Symbol 110 MovieClip Frame 3
timeElapsed = getTimer() - starttime;
if (timeElapsed < beatTime) {
gotoAndPlay ("loop");
} else {
starttime = starttime + beatTime;
}
Symbol 110 MovieClip Frame 4
if (totalBeats == undefined) {
totalBeats = 0;
}
totalBeats++;
if (totalBeats == 4) {
mcTitle.mcHand.play();
totalBeats = 0;
}
Symbol 110 MovieClip Frame 7
gotoAndPlay ("loop");
Symbol 113 Button
on (release) {
_root.mcSoundObj.playSound("click");
gotoAndPlay ("title");
}
Symbol 115 Button
on (release) {
helpClicked();
}
Symbol 117 Button
on (release) {
_root.mcSoundObj.playSound("click");
pauseClicked();
}
Symbol 119 Button
on (release) {
gotoAndPlay ("init level");
}
Symbol 135 Button
on (release) {
play();
_root.mcSoundObj.playSound("click");
_root.logActivity("more_rules_clicked");
}
Symbol 146 Button
on (release) {
play();
_root.mcSoundObj.playSound("click");
}
Symbol 151 MovieClip Frame 1
stop();
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 151 MovieClip Frame 2
stop();
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 2
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 2
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 2
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 26 MovieClip "mcButton" in Symbol 151 MovieClip Frame 2
onClipEvent (load) {
_visible = false;
}
Symbol 191 MovieClip Frame 1
stop();
Symbol 193 MovieClip Frame 1
stop();
Symbol 193 MovieClip Frame 3
stop();
Symbol 193 MovieClip Frame 6
stop();
Symbol 193 MovieClip Frame 9
stop();
Symbol 193 MovieClip Frame 12
stop();
Symbol 193 MovieClip Frame 15
stop();
Symbol 193 MovieClip Frame 18
stop();
Symbol 193 MovieClip Frame 20
h0.gotoAndStop(firstNum);
h1.gotoAndStop(firstNum + 1);
if (((lastNum - firstNum) + 1) > 5) {
h2._visible = false;
} else {
h2.gotoAndStop(firstNum + 2);
}
h3.gotoAndStop(lastNum + 1);
Symbol 193 MovieClip Frame 21
stop();
Symbol 193 MovieClip Frame 23
box.gotoAndStop(num + 1);
Symbol 193 MovieClip Frame 24
stop();
Symbol 194 MovieClip Frame 1
state = "idle";
stop();
Symbol 194 MovieClip Frame 42
gotoAndStop (1);
Symbol 194 MovieClip Frame 91
gotoAndStop (1);
Symbol 194 MovieClip Frame 130
gotoAndStop (1);
Symbol 194 MovieClip Frame 169
gotoAndStop (1);
Symbol 194 MovieClip Frame 209
gotoAndStop (1);
Symbol 195 MovieClip Frame 1
stop();
Symbol 216 MovieClip Frame 1
stop();
Symbol 216 MovieClip Frame 43
_root.handJibeAnimDone();
Symbol 224 MovieClip Frame 1
num = _root.levelNum;
stop();
Symbol 226 MovieClip Frame 53
stop();
Symbol 234 Button
on (release) {
_parent.continueClicked();
}
Symbol 240 Button
on (release) {
_root.mcSoundObj.playSound("click");
nextFrame();
}
Symbol 245 Button
on (release) {
_parent.helpOKclicked();
}
Symbol 249 Button
on (release) {
_root.mcSoundObj.playSound("click");
prevFrame();
}
Symbol 251 MovieClip Frame 1
stop();
Symbol 258 Button
on (release) {
_root.mcSoundObj.playSound("click");
_parent.levelNum++;
_parent.gotoAndPlay("init level");
}
Symbol 260 Button
on (release) {
_root.mcSoundObj.playSound("click");
_parent.levelNum++;
_parent.gotoAndPlay("init level");
}
Symbol 262 MovieClip Frame 1
if ((_root.levelnum + 1) == _root.firstWildHandLevel) {
gotoAndStop (3);
}
Symbol 262 MovieClip Frame 2
stop();
Symbol 262 MovieClip Frame 3
stop();
Symbol 267 Button
on (release) {
_parent.gotoAndPlay("title");
}
Symbol 269 Button
on (release) {
_root.sendToAFriend();
}
Symbol 273 Button
on (release) {
_root.postHighScoreClicked();
gotoAndPlay ("posted");
}
Symbol 279 Button
on (release) {
_root.viewHighScoresClicked();
}
Symbol 280 MovieClip Frame 1
_root.checkScoreRank(this);
stop();
Symbol 280 MovieClip Frame 2
stop();
Symbol 280 MovieClip Frame 5
stop();
Symbol 284 MovieClip Frame 1
_root.loadTout(mcTout);