Frame 1
var game = new Jamble(this);
_global.ipb_get_gname = function () {
var _local3 = _root._url;
var _loc5 = "";
var _local2 = "";
var _loc6 = (_local3.lastIndexOf("\\") + 1);
if ((_loc6 == -1) || (_loc6 == 0)) {
_loc6 = _local3.lastIndexOf("/") + 1;
}
var _local1 = _loc6;
var _loc7 = String(_local3).length;
while (_local1 < String(_local3).length) {
_local2 = _local3.charAt(_local1);
if (_local2 == ".") {
break;
}
_loc5 = _loc5 + _local2;
_local1++;
}
return(_loc5);
};
ipb_gname = _global.ipb_get_gname();
xx = new LoadVars();
xx.onLoad = function (success) {
if (success) {
_global.ipb_scoreVar = this.scoreVar;
}
};
fname = ((("arcade/gamedata/" + ipb_gname) + "/") + ipb_gname) + ".txt";
xx.load(fname);
Instance of Symbol 314 MovieClip [classic7] in Frame 11
onClipEvent (enterFrame) {
this.gotoAndStop(1);
}
Instance of Symbol 312 MovieClip [cryptic0] in Frame 11
onClipEvent (enterFrame) {
this.gotoAndStop(1);
}
Instance of Symbol 301 MovieClip [jewels3] in Frame 11
onClipEvent (enterFrame) {
this.gotoAndStop(1);
}
Instance of Symbol 296 MovieClip [juicy0] in Frame 11
onClipEvent (enterFrame) {
this.gotoAndStop(1);
}
Symbol 361 MovieClip Frame 91
stop();
Symbol 584 MovieClip Frame 1
if (yy.savescore == 1) {
if (ipb_score == undefined) {
ipb_score = eval (_global.ipb_scoreVar);
}
xx = new LoadVars();
xx.arcadegid = _root.ibpro_gameid;
xx.gscore = ipb_score;
xx.gname = _global.ipb_get_gname();
xx.enscore = (ipb_score * yy.randchar) ^ yy.randchar2;
xx.send("index.php?autocom=arcade&do=savescore", "_self", "POST");
stop();
}
_global.ipbSend = function (ipb_score) {
_root._visible = false;
_root.enabled = false;
xx = new LoadVars();
yy = new LoadVars();
xx.sendAndLoad("index.php?autocom=arcade&do=verifyscore", yy, "POST");
};
Symbol 41 MovieClip [bomb] Frame 5
stop();
Symbol 48 MovieClip [classic6] Frame 5
stop();
Symbol 51 MovieClip [classic5] Frame 5
stop();
Symbol 54 MovieClip [classic4] Frame 5
stop();
Symbol 57 MovieClip [classic3] Frame 5
stop();
Symbol 60 MovieClip [classic2] Frame 5
stop();
Symbol 63 MovieClip [classic1] Frame 5
stop();
Symbol 70 MovieClip [classic0] Frame 5
stop();
Symbol 81 MovieClip [juicy7] Frame 6
stop();
Symbol 92 MovieClip [juicy6] Frame 6
stop();
Symbol 103 MovieClip [juicy5] Frame 6
stop();
Symbol 114 MovieClip [juicy4] Frame 6
stop();
Symbol 124 MovieClip [juicy3] Frame 6
stop();
Symbol 137 MovieClip [juicy2] Frame 6
stop();
Symbol 147 MovieClip [juicy1] Frame 6
stop();
Symbol 154 MovieClip [jewels7] Frame 6
stop();
Symbol 159 MovieClip [jewels6] Frame 6
stop();
Symbol 164 MovieClip [jewels5] Frame 6
stop();
Symbol 169 MovieClip [jewels4] Frame 6
stop();
Symbol 174 MovieClip [jewels2] Frame 6
stop();
Symbol 179 MovieClip [jewels1] Frame 6
stop();
Symbol 184 MovieClip [jewels0] Frame 6
stop();
Symbol 195 MovieClip [cryptic7] Frame 6
stop();
Symbol 206 MovieClip [cryptic6] Frame 6
stop();
Symbol 215 MovieClip [cryptic5] Frame 6
stop();
Symbol 226 MovieClip [cryptic4] Frame 6
stop();
Symbol 235 MovieClip [cryptic3] Frame 6
stop();
Symbol 246 MovieClip [cryptic2] Frame 6
stop();
Symbol 257 MovieClip [cryptic1] Frame 6
stop();
Symbol 262 MovieClip [classicClearance] Frame 1
stop();
Symbol 269 MovieClip [juicyClearance] Frame 1
stop();
Symbol 277 MovieClip [jewelsClearance] Frame 1
stop();
Symbol 286 MovieClip [crypticClearance] Frame 1
stop();
Symbol 296 MovieClip [juicy0] Frame 6
stop();
Symbol 301 MovieClip [jewels3] Frame 6
stop();
Symbol 312 MovieClip [cryptic0] Frame 6
stop();
Symbol 314 MovieClip [classic7] Frame 5
stop();
Symbol 573 MovieClip [__Packages.Jamble] Frame 0
class Jamble
{
var MissedTries, targetMC, bgMC, plusMC, minusMC, muteMC, helpPopupMC, helpMC, iconIndices, columns, sounds, levels, level, score, scoreDelta, clearanceIndex, clearanceCount, state, movingBlocks, chainCount, groups, timeCount, clearance, blocksMC, iconSet, selectedBlock1, selectorMC, selectedBlock2, frameCount, frameTotal, blockCounts, keyMC, scoreTXT, exitPromptMC, timerMaskMC, timeTotal, pressSelectMC, iconsetMC, introKeyMC, countTXT, levelTXT, exitMC, timerID, xml, volume;
function Jamble (target) {
MissedTries = new Number(0);
targetMC = target;
targetMC.onEnterFrame = mx.utils.Delegate.create(this, enterFrame);
bgMC = targetMC.bg_mc;
plusMC = bgMC.plus_mc;
minusMC = bgMC.minus_mc;
muteMC = bgMC.mute_mc;
plusMC.onRelease = mx.utils.Delegate.create(this, plusVolume);
minusMC.onRelease = mx.utils.Delegate.create(this, minusVolume);
muteMC.onRelease = mx.utils.Delegate.create(this, toggleSound);
helpPopupMC = targetMC.helpPopup_mc;
helpPopupMC._visible = false;
helpMC = targetMC.help_mc;
helpMC.onRelease = mx.utils.Delegate.create(this, help);
helpPopupMC.ok_btn.onRelease = mx.utils.Delegate.create(this, ok);
iconIndices = new Array(8);
columns = new Array(GRID_COLS);
sounds = [];
levels = new Array(18);
level = 0;
score = 0;
scoreDelta = 0;
clearanceIndex = 0;
clearanceCount = 0;
var _local2 = 0;
while (_local2 < GRID_COLS) {
columns[_local2] = new Array(GRID_ROWS);
_local2++;
}
_local2 = 0;
while (_local2 < levels.length) {
levels[_local2] = new Level(90 - (5 * _local2), 3 + _local2, 1 + _local2, 5 + (_local2 * 5));
_local2++;
}
setVolume(40);
changeState(STATE_TITLE);
}
function swapBlock(block) {
columns[block.getGridX()][block.getGridY()] = undefined;
columns[((block.getTargetX() == undefined) ? (block.getGridX()) : (block.getTargetX()))][((block.getTargetY() == undefined) ? (block.getGridY()) : (block.getTargetY()))] = block;
block.moved();
}
function handleEvent(evt) {
if (state == STATE_FALL) {
if (evt.type == "stopped") {
var _local4 = evt.target;
swapBlock(_local4);
movingBlocks--;
if (movingBlocks == 0) {
checkAll();
chainCount = chainCount + groups.length;
if (groups.length > 0) {
playSound("standard_correct");
changeState(STATE_CLEAR_FROM_CHAIN);
} else if (isLevelComplete()) {
score = score + scoreDelta;
var _local6 = getCurrentLevel().getTimeLimit() / 4;
if (timeCount < (2 * _local6)) {
score = score + ((Math.round(2 * _local6) - timeCount) * 3);
} else if (timeCount < (3 * _local6)) {
score = score + ((Math.round(3 * _local6) - timeCount) * 2);
} else {
score = score + ((Math.round(4 * _local6) - timeCount) * 1);
}
level++;
changeState(STATE_INTRO);
} else if ((!checkPotentials()) && (clearance == undefined)) {
var _local10 = blocksMC.createChildAtDepth(iconSet + "Clearance", DepthManager.kTop);
clearance = columns[Math.floor(Math.random() * GRID_COLS)][Math.floor(Math.random() * GRID_ROWS)];
clearance.getTarget().removeMovieClip();
clearance.setTarget(_local10);
clearance.setType(Block.CLEARANCE);
changeState(STATE_SELECT);
} else {
changeState(STATE_SELECT);
}
}
}
} else if (state == STATE_SELECT) {
var _local4 = evt.target;
if (evt.type == "press") {
if (_local4 == selectedBlock1) {
delete selectedBlock1;
selectorMC._visible = false;
} else if (selectedBlock1) {
if (selectedBlock1.isAdjacent(_local4)) {
selectedBlock2 = _local4;
changeState(STATE_SWITCH);
return(undefined);
}
}
if (_local4 == clearance) {
clearance.setType(iconIndices[clearanceIndex]);
groups = [];
var _local5 = 0;
while (_local5 < GRID_COLS) {
var _local3 = 0;
while (_local3 < GRID_ROWS) {
var _local2 = columns[_local5][_local3];
if (_local2.getType() == clearance.getType()) {
addGroup(new Group(_local5, _local3, _local5, _local3));
_local2.zap();
}
_local3++;
}
_local5++;
}
delete clearance;
selectorMC._visible = false;
playSound("explosion");
changeState(STATE_CLEAR_FROM_CLEARANCE);
} else if (_local4.getType() == Block.BOMB) {
var _local5 = _local4.getGridX() - 1;
while (_local5 <= (_local4.getGridX() + 1)) {
var _local3 = _local4.getGridY() - 1;
while (_local3 <= (_local4.getGridY() + 1)) {
var _local2 = columns[_local5][_local3];
if (_local2 != clearance) {
if (_local2 != _local4) {
addGroup(new Group(_local5, _local3, _local5, _local3));
}
_local2.zap();
}
_local3++;
}
_local5++;
}
selectorMC._visible = false;
playSound("big_charge_explosion");
changeState(STATE_CLEAR_FROM_BOMB);
} else {
selectedBlock1 = _local4;
selectorMC._visible = true;
selectorMC._x = _local4.getX();
selectorMC._y = _local4.getY();
playSound("select_square");
}
} else if (evt.type == "releaseOutside") {
var _local9 = Math.floor(blocksMC._xmouse / GRID_W);
var _local8 = Math.floor((-blocksMC._ymouse) / GRID_H);
if (_local4.isAdjacent(columns[_local9][_local8])) {
selectedBlock1 = _local4;
selectedBlock2 = columns[_local9][_local8];
changeState(STATE_SWITCH);
}
}
} else if (state == STATE_SWITCH) {
if ((!selectedBlock1.isMoving()) && (!selectedBlock2.isMoving())) {
selectedBlock1.moved();
selectedBlock2.moved();
columns[selectedBlock1.getGridX()][selectedBlock1.getGridY()] = selectedBlock1;
columns[selectedBlock2.getGridX()][selectedBlock2.getGridY()] = selectedBlock2;
checkGroups();
if (groups.length > 0) {
trace((("found " + groups.length) + " groups: ") + groups);
playSound("standard_correct");
changeState(STATE_CLEAR);
} else {
playSound("wrong");
changeState(STATE_SWITCH_BACK);
}
}
} else if (state == STATE_SWITCH_BACK) {
if ((!selectedBlock1.isMoving()) && (!selectedBlock2.isMoving())) {
selectedBlock1.moved();
selectedBlock2.moved();
columns[selectedBlock1.getGridX()][selectedBlock1.getGridY()] = selectedBlock1;
columns[selectedBlock2.getGridX()][selectedBlock2.getGridY()] = selectedBlock2;
changeState(STATE_SELECT);
}
}
}
function enterFrame() {
if (state == STATE_INTRO) {
frameCount++;
if (frameCount >= frameTotal) {
changeState(STATE_INIT_GAME);
}
} else if (state == STATE_SWITCH) {
frameCount++;
if (frameCount >= frameTotal) {
selectorMC._visible = false;
}
} else if ((((state == STATE_CLEAR) || (state == STATE_CLEAR_FROM_CLEARANCE)) || (state == STATE_CLEAR_FROM_CHAIN)) || (state == STATE_CLEAR_FROM_BOMB)) {
frameCount++;
trace(frameCount);
if (frameCount >= frameTotal) {
var _local14 = new Array(GRID_COLS);
var _local6 = 0;
while (_local6 < groups.length) {
var _local9 = groups[_local6];
var _local7 = _local9.getX1();
var _local11 = _local9.getY1();
var _local10 = _local9.getX2();
var _local15 = _local9.getY2();
var _local8 = columns[_local7][_local11].getType();
var _local13 = ((_local10 - _local7) + 1) * ((_local15 - _local11) + 1);
blockCounts[_local8] = blockCounts[_local8] + _local13;
var _local12 = blockCounts[_local8] >= getCurrentLevel().getSpriteCount();
if (_local11 == _local15) {
var _local4 = _local7;
while (_local4 <= _local10) {
_local14[_local4] = 1;
_local4++;
}
} else if (_local7 == _local10) {
_local14[_local7] = 1;
}
if ((state == STATE_CLEAR_FROM_CLEARANCE) || (state == STATE_CLEAR_FROM_BOMB)) {
scoreDelta = scoreDelta + (getCurrentLevel().getPointsPerSpriteClearance() * _local13);
} else {
scoreDelta = scoreDelta + (((getCurrentLevel().getPointsPerSprite() * _local13) * getChainMultiplier()) * (((state == STATE_CLEAR) && (groups.length > 1)) ? 2 : 1));
}
keyMC[("type" + _local8) + "_txt"].text = String(blockCounts[_local8]);
var _local17 = [1, 0, 0, 0, (_local12 ? 0 : -100), 0, 1, 0, 0, (_local12 ? 0 : -100), 0, 0, 1, 0, (_local12 ? 0 : -100), 0, 0, 0, 1, 0];
var _local16 = new flash.filters.ColorMatrixFilter(_local17);
keyMC[("type" + _local8) + "_mc"].filters = [_local16];
_local6++;
}
_local6 = 0;
while (_local6 < GRID_COLS) {
if (_local14[_local6]) {
var _local5 = 0;
var _local4 = 0;
while (_local4 < GRID_ROWS) {
var _local3 = columns[_local6][_local4];
if (_local3.isZapped()) {
_local3.getTarget().removeMovieClip();
_local5++;
} else if (_local5 > 0) {
_local3.moveTo(undefined, _local3.getGridY() - _local5);
movingBlocks++;
}
_local4++;
}
_local4 = 0;
while (_local4 < _local5) {
var _local3 = createBlock();
_local3.setPosition(_local6, _local4 + GRID_ROWS);
_local3.moveTo(undefined, (_local4 + GRID_ROWS) - _local5);
movingBlocks++;
columns[_local6][_local4 + GRID_ROWS] = _local3;
_local4++;
}
}
_local6++;
}
if ((state != STATE_CLEAR_FROM_CLEARANCE) && (state != STATE_CLEAR_FROM_BOMB)) {
timeCount = Math.max(timeCount - (3 * groups.length), 0);
}
changeState(STATE_FALL);
}
}
if (clearance != undefined) {
clearanceCount = (clearanceCount + 1) % 3;
if (clearanceCount == 0) {
clearanceIndex = (clearanceIndex + 1) % ((level < 8) ? 7 : 8);
clearance.getTarget().gotoAndStop(iconIndices[clearanceIndex] + 1);
}
}
if (scoreDelta > 0) {
if (scoreDelta < 2) {
scoreDelta = 0;
score = score + scoreDelta;
} else {
scoreDelta = scoreDelta - 2;
score = score + 2;
}
}
scoreTXT.text = String(score);
_root.Sparky = String(score);
}
function tick() {
if ((state == STATE_SELECT) && (!exitPromptMC._visible)) {
var _local2 = Math.round(getCurrentLevel().getTimeLimit() / 4);
timeCount++;
timerMaskMC.gotoAndStop(Math.round((timerMaskMC._totalframes * timeCount) / timeTotal));
if ((timeCount >= (2 * _local2)) && (timeCount <= ((2 * _local2) + 2))) {
playSound("orange_zone");
} else if ((timeCount >= (3 * _local2)) && (timeCount <= ((3 * _local2) + 2))) {
playSound("red_zone");
} else if (timeCount >= timeTotal) {
playSound("game_over");
endGame();
changeState(STATE_GAME_COMPLETE);
}
}
}
function changeState(newState) {
trace("moving to " + newState);
if (newState == STATE_TITLE) {
toTitle();
} else if (newState == STATE_ICON_SELECT) {
toIconSelect();
} else if (newState == STATE_INTRO) {
toIntro();
} else if (newState == STATE_INIT_GAME) {
toInitGame();
} else if (newState == STATE_FALL) {
toFall();
} else if (newState == STATE_SELECT) {
toSelect();
} else if (newState == STATE_SWITCH) {
toSwitch();
} else if (newState == STATE_SWITCH_BACK) {
toSwitchBack();
} else if (newState == STATE_CLEAR) {
toClear();
} else if (newState == STATE_CLEAR_FROM_CHAIN) {
toClearFromChain();
} else if (newState == STATE_CLEAR_FROM_CLEARANCE) {
toClearFromClearance();
} else if (newState == STATE_CLEAR_FROM_BOMB) {
toClearFromBomb();
} else if (newState == STATE_GAME_COMPLETE) {
toGameComplete();
}
}
function toTitle() {
var t = this;
state = STATE_TITLE;
score = 0;
level = 0;
targetMC.gotoAndStop("title");
bgMC.exit_mc._visible = false;
pressSelectMC = targetMC.press_mc;
pressSelectMC.onRelease = function () {
t.changeState(Jamble.STATE_ICON_SELECT);
};
}
function toIconSelect() {
var t = this;
state = STATE_ICON_SELECT;
targetMC.gotoAndStop("icon select");
bgMC.exit_mc._visible = false;
targetMC.classic_mc.onRelease = function () {
t.iconSet = Jamble.ICON_SET_CLASSIC;
t.changeState(Jamble.STATE_INTRO);
};
targetMC.cryptic_mc.onRelease = function () {
t.iconSet = Jamble.ICON_SET_CRYPTIC;
t.changeState(Jamble.STATE_INTRO);
};
targetMC.jewels_mc.onRelease = function () {
t.iconSet = Jamble.ICON_SET_JEWELS;
t.changeState(Jamble.STATE_INTRO);
};
targetMC.juicy_mc.onRelease = function () {
t.iconSet = Jamble.ICON_SET_JUICY;
t.changeState(Jamble.STATE_INTRO);
};
}
function toIntro() {
var _local5 = this;
state = STATE_INTRO;
frameCount = 0;
frameTotal = 60;
targetMC.gotoAndStop("intro");
bgMC.exit_mc._visible = false;
iconsetMC = targetMC.iconSet_mc;
iconsetMC.gotoAndStop(iconSet);
introKeyMC = targetMC.introKey_mc;
introKeyMC.gotoAndStop(iconSet);
countTXT = introKeyMC.count_txt;
countTXT.text = "x" + getCurrentLevel().getSpriteCount();
levelTXT = targetMC.level_txt;
levelTXT.text = "LEVEL " + (level + 1);
var _local2 = 0;
while (_local2 < 8) {
iconIndices[_local2] = _local2;
_local2++;
}
shuffle(iconIndices);
blockCounts = [0, 0, 0, 0, 0, 0, 0, 0];
movingBlocks = 0;
chainCount = 0;
scoreDelta = 0;
timeCount = 0;
timeTotal = getCurrentLevel().getTimeLimit();
delete clearance;
if (level < 8) {
var _local4 = iconIndices[7];
introKeyMC[("type" + _local4) + "_mc"]._visible = false;
_local2 = 0;
var _local3 = 0;
while (_local2 < 8) {
if (_local2 != _local4) {
introKeyMC[("type" + _local2) + "_mc"]._x = _local3;
_local3 = _local3 + 35;
}
_local2++;
}
}
}
function toInitGame() {
state = STATE_INIT_GAME;
targetMC.gotoAndStop("game");
bgMC.exit_mc._visible = true;
blocksMC = targetMC.blocks_mc;
selectorMC = blocksMC.selector_mc;
selectorMC._visible = false;
iconsetMC = targetMC.iconset_mc;
iconsetMC.gotoAndStop(iconSet);
keyMC = targetMC.key_mc;
keyMC.gotoAndStop(iconSet);
timerMaskMC = targetMC.timerMask_mc;
exitPromptMC = targetMC.exitPrompt_mc;
exitPromptMC._visible = false;
exitPromptMC.yes_btn.onRelease = mx.utils.Delegate.create(this, exitYes);
exitPromptMC.no_btn.onRelease = mx.utils.Delegate.create(this, exitNo);
exitMC = targetMC.exit_mc;
exitMC.onRelease = mx.utils.Delegate.create(this, exit);
scoreTXT = targetMC.score_txt;
playSound("play_and_start_level");
selectorMC.setDepthTo(DepthManager.kTop);
var _local2 = 0;
while (_local2 < GRID_COLS) {
var _local3 = 0;
while (_local3 < GRID_ROWS) {
var _local4 = createBlock();
_local4.setPosition(_local2, _local3 + GRID_ROWS);
_local4.moveTo(undefined, _local3);
movingBlocks++;
columns[_local2][_local3] = _local4;
_local3++;
}
_local2++;
}
var _local9 = ((level < 8) ? (iconIndices[7]) : undefined);
var _local10 = ((level < 8) ? 36 : 31);
var _local8 = 28;
if (level < 8) {
keyMC[("type" + _local9) + "_mc"]._visible = false;
keyMC[("type" + _local9) + "_mc"].stop();
keyMC[("type" + _local9) + "_txt"]._visible = false;
}
_local2 = 0;
var _local5 = 0;
while (_local2 < 8) {
if (_local2 != _local9) {
keyMC[("type" + _local2) + "_mc"]._xscale = 82;
keyMC[("type" + _local2) + "_mc"]._yscale = 82;
keyMC[("type" + _local2) + "_mc"]._y = _local5 + (_local8 / 2);
trace(_local5 + (_local8 / 2));
keyMC[("type" + _local2) + "_mc"].stop();
var _local7 = [1, 0, 0, 0, -100, 0, 1, 0, 0, -100, 0, 0, 1, 0, -100, 0, 0, 0, 1, 0];
var _local6 = new flash.filters.ColorMatrixFilter(_local7);
keyMC[("type" + _local2) + "_mc"].filters = [_local6];
keyMC[("type" + _local2) + "_txt"]._y = _local5;
_local5 = _local5 + _local10;
}
_local2++;
}
clearInterval(timerID);
timerID = setInterval(this, "tick", 1000);
changeState(STATE_FALL);
}
function toFall() {
state = STATE_FALL;
}
function toSelect() {
state = STATE_SELECT;
chainCount = 0;
frameCount = 0;
frameTotal = 3;
delete selectedBlock1;
delete selectedBlock2;
}
function toSwitch() {
state = STATE_SWITCH;
frameCount = 0;
frameTotal = 3;
selectorMC.play();
selectedBlock1.moveTo(selectedBlock2.getGridX(), selectedBlock2.getGridY());
selectedBlock2.moveTo(selectedBlock1.getGridX(), selectedBlock1.getGridY());
}
function toSwitchBack() {
state = STATE_SWITCH_BACK;
selectedBlock1.moveTo(selectedBlock2.getGridX(), selectedBlock2.getGridY());
selectedBlock2.moveTo(selectedBlock1.getGridX(), selectedBlock1.getGridY());
}
function toClear() {
state = STATE_CLEAR;
delete selectedBlock1;
delete selectedBlock2;
frameCount = 0;
frameTotal = 6;
}
function toClearFromChain() {
state = STATE_CLEAR_FROM_CHAIN;
delete selectedBlock1;
delete selectedBlock2;
frameCount = 0;
frameTotal = 6;
}
function toClearFromClearance() {
state = STATE_CLEAR_FROM_CLEARANCE;
delete selectedBlock1;
delete selectedBlock2;
frameCount = 0;
frameTotal = 6;
}
function toClearFromBomb() {
state = STATE_CLEAR_FROM_BOMB;
delete selectedBlock1;
delete selectedBlock2;
frameCount = 0;
frameTotal = 6;
}
function toGameComplete() {
state = STATE_GAME_COMPLETE;
targetMC.gotoAndStop("complete");
bgMC.exit_mc._visible = false;
targetMC.level_txt.text = level + 1;
targetMC.score_txt.text = score;
yesUpload();
targetMC.question_txt.text = "Play Again?";
targetMC.no_mc.onRelease = mx.utils.Delegate.create(this, noPlayAgain);
targetMC.yes_mc.onRelease = mx.utils.Delegate.create(this, yesPlayAgain);
iconsetMC = targetMC.iconSet_mc;
iconsetMC.gotoAndStop(iconSet);
}
function RetryToLoadXML() {
if (MissedTries >= 10) {
clearInterval(XMLRetryTimer);
XMLRetryTimer = 0;
}
xml = new XML();
xml.onLoad = mx.utils.Delegate.create(this, onXMLLoad);
clearInterval(XMLRetryTimer);
XMLRetryTimer = 0;
}
function onXMLLoad(success) {
if (state == STATE_GAME_COMPLETE) {
if (success) {
var _local2 = xml.firstChild;
if (_local2.nodeName == "error") {
if (_local2.attributes.errorno == 0) {
MissedTries++;
if (MissedTries >= 10) {
MissedTries = 0;
} else {
clearInterval(XMLRetryTimer);
XMLRetryTimer = 0;
XMLRetryTimer = setInterval(this, "RetryToLoadXML", 3000);
}
}
}
}
}
}
function noUpload() {
targetMC.message_txt.text = "";
targetMC.question_txt.text = "Play Again?";
targetMC.no_mc.onRelease = mx.utils.Delegate.create(this, noPlayAgain);
targetMC.yes_mc.onRelease = mx.utils.Delegate.create(this, yesPlayAgain);
}
function yesUpload() {
xml = new XML();
xml.onLoad = mx.utils.Delegate.create(this, onXMLLoad);
}
function noPlayAgain() {
stopAllSounds();
_global.ipbSend();
stop();
}
function yesPlayAgain() {
level = 0;
score = 0;
changeState(STATE_INTRO);
}
function createBlock() {
var _local3 = ((Math.random() < 0.02) ? (Block.BOMB) : (iconIndices[Math.floor(Math.random() * ((level < 8) ? 7 : 8))]));
var _local4 = blocksMC.createChildAtDepth(((_local3 == Block.BOMB) ? "bomb" : (iconSet + _local3)), DepthManager.kTop);
var _local2 = new Block(_local4, _local3);
_local2.addEventListener("stopped", this);
_local2.addEventListener("press", this);
_local2.addEventListener("releaseOutside", this);
return(_local2);
}
function shuffle(arr) {
var _local1 = arr.length - 1;
while (_local1 >= 0) {
var _local3 = Math.floor(Math.random() * 8);
var _local4 = arr[_local1];
arr[_local1] = arr[_local3];
arr[_local3] = _local4;
_local1--;
}
}
function endGame() {
clearInterval(timerID);
score = score + scoreDelta;
scoreDelta = 0;
}
function exitYes() {
stopAllSounds();
_global.ipbSend();
stop();
}
function exitNo() {
blocksMC._visible = true;
exitPromptMC._visible = false;
}
function exit() {
blocksMC._visible = false;
exitPromptMC._visible = !exitPromptMC._visible;
}
function help() {
helpPopupMC._visible = !helpPopupMC._visible;
}
function ok() {
helpPopupMC._visible = false;
}
function playSound(sound_id) {
var _local3 = targetMC.createChildAtDepth("blank", DepthManager.kTop);
var sound = new Sound(_local3);
var t = this;
var _local4 = sounds.length;
sound.attachSound(sound_id);
sound.setVolume(volume);
sound.onSoundComplete = function () {
var _local1 = 0;
while (_local1 < t.sounds.length) {
if (t.sounds[_local1][0] == sound) {
t.sounds[_local1][1].removeMovieClip();
t.sounds.splice(_local1, 1);
return(undefined);
}
_local1++;
}
};
sound.start();
sounds.push([sound, _local3]);
trace(sounds.length + " sounds currently playing");
}
function setVolume(value) {
volume = value;
var _local2 = 0;
while (_local2 < sounds.length) {
var _local3 = sounds[_local2][0];
_local3.setVolume(value);
_local2++;
}
updateVolumeLEDs();
}
function toggleSound() {
if (volume == 0) {
setVolume(40);
} else {
setVolume(0);
}
}
function plusVolume() {
setVolume(Math.min(volume + 20, 100));
}
function minusVolume() {
setVolume(Math.max(volume - 20, 0));
}
function updateVolumeLEDs() {
var _local2 = 0;
while (_local2 < 5) {
bgMC["fifth" + _local2]._alpha = ((((_local2 + 1) * 20) <= volume) ? 100 : 20);
_local2++;
}
}
function addGroup(group) {
var _local2 = groups.length - 1;
while (_local2 >= 0) {
if (groups[_local2].equals(group)) {
return(false);
}
_local2--;
}
groups.push(group);
return(true);
}
function checkGroups(check) {
var _local7;
var _local3;
var _local8 = (check ? false : true);
groups = [];
_local7 = columns[0][selectedBlock1.getGridY()].getType();
_local3 = 1;
var _local5 = 0;
while (_local5 < GRID_COLS) {
var _local4 = columns[_local5 + 1][selectedBlock1.getGridY()];
if (_local4.getType() == _local7) {
_local3++;
} else {
if (_local3 >= 3) {
if (addGroup(new Group((_local5 - _local3) + 1, selectedBlock1.getGridY(), _local5, selectedBlock1.getGridY())) && (_local8)) {
var _local6 = (_local5 - _local3) + 1;
while (_local6 <= _local5) {
var _local2 = columns[_local6][selectedBlock1.getGridY()];
if (!_local2.isZapped()) {
_local2.zap();
}
_local6++;
}
}
}
_local3 = 1;
}
_local7 = _local4.getType();
_local5++;
}
_local7 = columns[0][selectedBlock2.getGridY()].getType();
_local3 = 1;
_local5 = 0;
while (_local5 < GRID_COLS) {
var _local4 = columns[_local5 + 1][selectedBlock2.getGridY()];
if (_local4.getType() == _local7) {
_local3++;
} else {
if (_local3 >= 3) {
if (addGroup(new Group((_local5 - _local3) + 1, selectedBlock2.getGridY(), _local5, selectedBlock2.getGridY())) && (_local8)) {
var _local6 = (_local5 - _local3) + 1;
while (_local6 <= _local5) {
var _local2 = columns[_local6][selectedBlock2.getGridY()];
if (!_local2.isZapped()) {
_local2.zap();
}
_local6++;
}
}
}
_local3 = 1;
}
_local7 = _local4.getType();
_local5++;
}
_local7 = columns[selectedBlock1.getGridX()][0].getType();
_local3 = 1;
_local5 = 0;
while (_local5 < GRID_ROWS) {
var _local4 = columns[selectedBlock1.getGridX()][_local5 + 1];
if (_local4.getType() == _local7) {
_local3++;
} else {
if (_local3 >= 3) {
if (addGroup(new Group(selectedBlock1.getGridX(), (_local5 - _local3) + 1, selectedBlock1.getGridX(), _local5)) && (_local8)) {
var _local6 = (_local5 - _local3) + 1;
while (_local6 <= _local5) {
var _local2 = columns[selectedBlock1.getGridX()][_local6];
if (!_local2.isZapped()) {
_local2.zap();
}
_local6++;
}
}
}
_local3 = 1;
}
_local7 = _local4.getType();
_local5++;
}
_local7 = columns[selectedBlock2.getGridX()][0].getType();
_local3 = 1;
_local5 = 0;
while (_local5 < GRID_ROWS) {
var _local4 = columns[selectedBlock2.getGridX()][_local5 + 1];
if (_local4.getType() == _local7) {
_local3++;
} else {
if (_local3 >= 3) {
if (addGroup(new Group(selectedBlock2.getGridX(), (_local5 - _local3) + 1, selectedBlock2.getGridX(), _local5)) && (_local8)) {
var _local6 = (_local5 - _local3) + 1;
while (_local6 <= _local5) {
var _local2 = columns[selectedBlock2.getGridX()][_local6];
if (!_local2.isZapped()) {
_local2.zap();
}
_local6++;
}
}
}
_local3 = 1;
}
_local7 = _local4.getType();
_local5++;
}
}
function checkAll() {
var _local8;
var _local2;
var _local9 = 3;
var _local10 = true;
groups = [];
var _local6 = 0;
while (_local6 < GRID_ROWS) {
_local8 = columns[0][_local6].getType();
_local2 = 1;
var _local4 = 0;
while (_local4 < GRID_COLS) {
var _local7 = columns[_local4 + 1][_local6];
if (_local7.getType() == _local8) {
_local2++;
} else {
if (_local2 >= _local9) {
if (addGroup(new Group((_local4 - _local2) + 1, _local6, _local4, _local6)) && (_local10)) {
var _local5 = (_local4 - _local2) + 1;
while (_local5 <= _local4) {
var _local3 = columns[_local5][_local6];
if (!_local3.isZapped()) {
_local3.zap();
}
_local5++;
}
}
}
_local2 = 1;
}
_local8 = _local7.getType();
_local4++;
}
_local6++;
}
_local6 = 0;
while (_local6 < GRID_COLS) {
_local8 = columns[_local6][0].getType();
_local2 = 1;
var _local4 = 0;
while (_local4 < GRID_ROWS) {
var _local7 = columns[_local6][_local4 + 1];
if (_local7.getType() == _local8) {
_local2++;
} else {
if (_local2 >= _local9) {
if (addGroup(new Group(_local6, (_local4 - _local2) + 1, _local6, _local4)) && (_local10)) {
var _local5 = (_local4 - _local2) + 1;
while (_local5 <= _local4) {
var _local3 = columns[_local6][_local5];
if (!_local3.isZapped()) {
_local3.zap();
}
_local5++;
}
}
}
_local2 = 1;
}
_local8 = _local7.getType();
_local4++;
}
_local6++;
}
}
function checkPotentials() {
var _local4 = [];
var _local3 = 0;
while (_local3 < GRID_COLS) {
var _local2 = 0;
while (_local2 < (GRID_ROWS - 1)) {
selectedBlock1 = columns[_local3][_local2];
selectedBlock2 = columns[_local3][_local2 + 1];
selectedBlock1.setPosition(_local3, _local2 + 1);
selectedBlock2.setPosition(_local3, _local2);
columns[_local3][_local2] = selectedBlock2;
columns[_local3][_local2 + 1] = selectedBlock1;
checkGroups(true);
selectedBlock1.setPosition(_local3, _local2);
selectedBlock2.setPosition(_local3, _local2 + 1);
columns[_local3][_local2] = selectedBlock1;
columns[_local3][_local2 + 1] = selectedBlock2;
_local4 = _local4.concat(groups);
_local2++;
}
_local3++;
}
_local3 = 0;
while (_local3 < GRID_ROWS) {
var _local2 = 0;
while (_local2 < (GRID_COLS - 1)) {
selectedBlock1 = columns[_local2][_local3];
selectedBlock2 = columns[_local2 + 1][_local3];
selectedBlock1.setPosition(_local2 + 1, _local3);
selectedBlock2.setPosition(_local2, _local3);
columns[_local2][_local3] = selectedBlock2;
columns[_local2 + 1][_local3] = selectedBlock1;
checkGroups(true);
selectedBlock1.setPosition(_local2, _local3);
selectedBlock2.setPosition(_local2 + 1, _local3);
columns[_local2][_local3] = selectedBlock1;
columns[_local2 + 1][_local3] = selectedBlock2;
_local4 = _local4.concat(groups);
_local2++;
}
_local3++;
}
delete selectedBlock1;
delete selectedBlock2;
trace("potentials= " + _local4);
return(_local4.length > 0);
}
function getChainMultiplier() {
return([1, 2, 3, 5][chainCount % 4]);
}
function getCurrentLevel() {
return(levels[Math.min(level, levels.length - 1)]);
}
function isLevelComplete() {
var _local2 = 7;
while (_local2 >= 0) {
if (((iconIndices[7] != _local2) || (level >= 8)) && (blockCounts[_local2] < getCurrentLevel().getSpriteCount())) {
return(false);
}
_local2--;
}
return(true);
}
function traceColumns() {
var _local3 = 0;
var _local2 = 0;
_local3 = columns[_local3].length - 1;
while (_local3 >= 0) {
var _local4 = "";
_local2 = 0;
while (_local2 < columns.length) {
_local4 = _local4 + ((_local2 > 0) ? ("," + columns[_local2][_local3].getType()) : (columns[_local2][_local3].getType()));
_local2++;
}
trace(_local4);
_local3--;
}
}
static var STATE_TITLE = "title";
static var STATE_INTRO = "intro";
static var STATE_ICON_SELECT = "icon select";
static var STATE_INIT_GAME = "init game";
static var STATE_FILL = "fill";
static var STATE_CHECK = "check";
static var STATE_FALL = "fall";
static var STATE_SELECT = "select";
static var STATE_SWITCH = "switch";
static var STATE_SWITCH_BACK = "switch back";
static var STATE_CLEAR = "clear";
static var STATE_CLEAR_FROM_CLEARANCE = "clear from clearance";
static var STATE_CLEAR_FROM_CHAIN = "clear from chain";
static var STATE_CLEAR_FROM_BOMB = "clear from bomb";
static var STATE_GAME_COMPLETE = "game complete";
static var ICON_SET_CLASSIC = "classic";
static var ICON_SET_CRYPTIC = "cryptic";
static var ICON_SET_JEWELS = "jewels";
static var ICON_SET_JUICY = "juicy";
static var GRID_COLS = 8;
static var GRID_ROWS = 8;
static var GRID_W = 43;
static var GRID_H = 43;
var XMLRetryTimer = new Number(0);
}
Symbol 574 MovieClip [__Packages.Block] Frame 0
class Block
{
var targetGridX, targetGridY, tweenX, targetMC, tweenY, gridX, gridY, type, zapped;
function Block (targetMC, type) {
setTarget(targetMC);
setType(type);
mx.events.EventDispatcher.initialize(this);
}
function moveTo(targetGridX, targetGridY) {
var t = this;
this.targetGridX = targetGridX;
this.targetGridY = targetGridY;
if (targetGridX != undefined) {
tweenX = new mx.transitions.Tween(targetMC, "_x", mx.transitions.easing.Strong.easeIn, targetMC._x, (targetGridX + 0.5) * Jamble.GRID_W, 8, false);
tweenX.onMotionFinished = function () {
if (!t.tweenY.isPlaying) {
t.dispatchEvent({type:"stopped"});
}
};
}
if (targetGridY != undefined) {
tweenY = new mx.transitions.Tween(targetMC, "_y", mx.transitions.easing.Strong.easeIn, targetMC._y, (-(targetGridY + 0.5)) * Jamble.GRID_H, 8, false);
tweenY.onMotionFinished = function () {
if (!t.tweenX.isPlaying) {
t.dispatchEvent({type:"stopped"});
}
};
}
}
function moved() {
gridX = ((targetGridX == undefined) ? (gridX) : (targetGridX));
gridY = ((targetGridY == undefined) ? (gridY) : (targetGridY));
}
function setPosition(gridX, gridY) {
this.gridX = gridX;
this.gridY = gridY;
targetMC._x = (gridX + 0.5) * Jamble.GRID_W;
targetMC._y = (-(gridY + 0.5)) * Jamble.GRID_H;
}
function getX() {
return(targetMC._x);
}
function getY() {
return(targetMC._y);
}
function getGridX() {
return(gridX);
}
function getGridY() {
return(gridY);
}
function getTargetX() {
return(targetGridX);
}
function getTargetY() {
return(targetGridY);
}
function setType(type) {
this.type = type;
}
function getType() {
return(type);
}
function setTarget(target) {
targetMC = target;
targetMC.stop();
targetMC._x = (gridX + 0.5) * Jamble.GRID_W;
targetMC._y = (-(gridY + 0.5)) * Jamble.GRID_H;
targetMC.onPress = mx.utils.Delegate.create(this, press);
targetMC.onReleaseOutside = mx.utils.Delegate.create(this, releaseOutside);
}
function getTarget() {
return(targetMC);
}
function zap() {
targetMC.play();
zapped = true;
}
function isZapped() {
return(zapped);
}
function press() {
dispatchEvent({type:"press"});
}
function releaseOutside() {
dispatchEvent({type:"releaseOutside"});
}
function isAdjacent(block) {
var _local5 = getGridX();
var _local3 = getGridY();
var _local4 = block.getGridX();
var _local2 = block.getGridY();
return(((((_local5 == _local4) && (_local3 == (_local2 - 1))) || ((_local5 == _local4) && (_local3 == (_local2 + 1)))) || ((_local5 == (_local4 - 1)) && (_local3 == _local2))) || ((_local5 == (_local4 + 1)) && (_local3 == _local2)));
}
function isMoving() {
return(tweenX.isPlaying || (tweenY.isPlaying));
}
function toString() {
return((gridX + ",") + gridY);
}
function addEventListener() {
}
function removeEventListener() {
}
function dispatchEvent() {
}
static var BOMB = -1;
static var CLEARANCE = -2;
}
Symbol 575 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 576 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 577 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 578 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 579 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 580 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 581 MovieClip [__Packages.Level] Frame 0
class Level
{
var timeLimit, spriteCount, pointsPerSprite, pointsPerSpriteClearance;
function Level (t, sc, pps, ppsc) {
timeLimit = t;
spriteCount = sc;
pointsPerSprite = pps;
pointsPerSpriteClearance = ppsc;
}
function getTimeLimit() {
return(timeLimit);
}
function getSpriteCount() {
return(spriteCount);
}
function getPointsPerSprite() {
return(pointsPerSprite);
}
function getPointsPerSpriteClearance() {
return(pointsPerSpriteClearance);
}
}
Symbol 582 MovieClip [__Packages.DepthManager] Frame 0
class DepthManager
{
var _childCounter, attachMovie, _parent, swapDepths, _topmost, getDepth;
function DepthManager () {
MovieClip.prototype.createChildAtDepth = createChildAtDepth;
MovieClip.prototype.setDepthTo = setDepthTo;
MovieClip.prototype.setDepthAbove = setDepthAbove;
MovieClip.prototype.setDepthBelow = setDepthBelow;
MovieClip.prototype.findNextAvailableDepth = findNextAvailableDepth;
MovieClip.prototype.shuffleDepths = shuffleDepths;
MovieClip.prototype.getDepthByFlag = getDepthByFlag;
MovieClip.prototype.buildDepthTable = buildDepthTable;
_global.ASSetPropFlags(MovieClip.prototype, "createChildAtDepth", 1);
_global.ASSetPropFlags(MovieClip.prototype, "setDepthTo", 1);
_global.ASSetPropFlags(MovieClip.prototype, "setDepthAbove", 1);
_global.ASSetPropFlags(MovieClip.prototype, "setDepthBelow", 1);
_global.ASSetPropFlags(MovieClip.prototype, "findNextAvailableDepth", 1);
_global.ASSetPropFlags(MovieClip.prototype, "shuffleDepths", 1);
_global.ASSetPropFlags(MovieClip.prototype, "getDepthByFlag", 1);
_global.ASSetPropFlags(MovieClip.prototype, "buildDepthTable", 1);
}
static function sortFunction(a, b) {
if (a.getDepth() > b.getDepth()) {
return(1);
}
return(-1);
}
static function test(depth) {
if (depth == reservedDepth) {
return(false);
}
return(true);
}
static function createObjectAtDepth(linkageName, depthSpace, initObj) {
var _local1;
switch (depthSpace) {
case kCursor :
_local1 = holder.createChildAtDepth(linkageName, kTopmost, initObj);
break;
case kTooltip :
_local1 = holder.createChildAtDepth(linkageName, kTop, initObj);
break;
}
return(_local1);
}
function createChildAtDepth(linkageName, depthFlag, initObj) {
if (_childCounter == undefined) {
_childCounter = 0;
}
var _local3 = buildDepthTable();
var _local2 = getDepthByFlag(depthFlag, _local3);
var _local5 = "down";
if (depthFlag == kBottom) {
_local5 = "up";
}
var _local6;
if (_local3[_local2] != undefined) {
_local6 = _local2;
_local2 = findNextAvailableDepth(_local2, _local3, _local5);
}
var _local4 = attachMovie.call(this, linkageName, "depthChild" + (_childCounter++), _local2, initObj);
if (_local6 != undefined) {
_local3[_local2] = _local4;
shuffleDepths(_local4, _local6, _local3, _local5);
}
if (depthFlag == kTopmost) {
_local4._topmost = true;
}
return(_local4);
}
function setDepthTo(depthFlag) {
var _local2 = _parent.buildDepthTable();
var _local3 = _parent.getDepthByFlag(depthFlag, _local2);
if (_local2[_local3] != undefined) {
shuffleDepths(MovieClip(this), _local3, _local2, undefined);
} else {
swapDepths(_local3);
}
if (depthFlag == kTopmost) {
_topmost = true;
} else {
delete _topmost;
}
}
function setDepthAbove(targetInstance) {
if (targetInstance._parent != _parent) {
return(undefined);
}
var _local2 = targetInstance.getDepth() + 1;
var _local3 = _parent.buildDepthTable();
if ((_local3[_local2] != undefined) && (getDepth() < _local2)) {
_local2 = _local2 - 1;
}
if (_local2 > highestDepth) {
_local2 = highestDepth;
}
if (_local2 == highestDepth) {
_parent.shuffleDepths(this, _local2, _local3, "down");
} else if (_local3[_local2] != undefined) {
_parent.shuffleDepths(this, _local2, _local3, undefined);
} else {
swapDepths(_local2);
}
}
function setDepthBelow(targetInstance) {
if (targetInstance._parent != _parent) {
return(undefined);
}
var _local6 = targetInstance.getDepth() - 1;
var _local3 = _parent.buildDepthTable();
if ((_local3[_local6] != undefined) && (getDepth() > _local6)) {
_local6 = _local6 + 1;
}
var _local4 = lowestDepth + numberOfAuthortimeLayers;
var _local5;
for (_local5 in _local3) {
var _local2 = _local3[_local5];
if (_local2._parent != undefined) {
_local4 = Math.min(_local4, _local2.getDepth());
}
}
if (_local6 < _local4) {
_local6 = _local4;
}
if (_local6 == _local4) {
_parent.shuffleDepths(this, _local6, _local3, "up");
} else if (_local3[_local6] != undefined) {
_parent.shuffleDepths(this, _local6, _local3, undefined);
} else {
swapDepths(_local6);
}
}
function findNextAvailableDepth(targetDepth, depthTable, direction) {
var _local5 = lowestDepth + numberOfAuthortimeLayers;
if (targetDepth < _local5) {
targetDepth = _local5;
}
if (depthTable[targetDepth] == undefined) {
return(targetDepth);
}
var _local1 = targetDepth;
var _local2 = targetDepth;
if (direction == "down") {
while (depthTable[_local2] != undefined) {
_local2--;
}
return(_local2);
}
while (depthTable[_local1] != undefined) {
_local1++;
}
return(_local1);
}
function shuffleDepths(subject, targetDepth, depthTable, direction) {
var _local9 = lowestDepth + numberOfAuthortimeLayers;
var _local8 = _local9;
var _local5;
for (_local5 in depthTable) {
var _local7 = depthTable[_local5];
if (_local7._parent != undefined) {
_local9 = Math.min(_local9, _local7.getDepth());
}
}
if (direction == undefined) {
if (subject.getDepth() > targetDepth) {
direction = "up";
} else {
direction = "down";
}
}
var _local1 = new Array();
for (_local5 in depthTable) {
var _local7 = depthTable[_local5];
if (_local7._parent != undefined) {
_local1.push(_local7);
}
}
_local1.sort(sortFunction);
if (direction == "up") {
var _local3;
var _local11;
do {
if (_local1.length <= 0) {
break;
}
_local3 = _local1.pop();
} while (_local3 != subject);
do {
if (_local1.length <= 0) {
break;
}
_local11 = subject.getDepth();
_local3 = _local1.pop();
var _local4 = _local3.getDepth();
if (_local11 > (_local4 + 1)) {
if (_local4 >= 0) {
subject.swapDepths(_local4 + 1);
} else if ((_local11 > _local8) && (_local4 < _local8)) {
subject.swapDepths(_local8);
}
}
subject.swapDepths(_local3);
} while (_local4 != targetDepth);
} else if (direction == "down") {
var _local3;
do {
if (_local1.length <= 0) {
break;
}
_local3 = _local1.shift();
} while (_local3 != subject);
do {
if (_local1.length <= 0) {
break;
}
var _local11 = _local3.getDepth();
_local3 = _local1.shift();
var _local4 = _local3.getDepth();
if ((_local11 < (_local4 - 1)) && (_local4 > 0)) {
subject.swapDepths(_local4 - 1);
}
subject.swapDepths(_local3);
} while (_local4 != targetDepth);
}
}
function getDepthByFlag(depthFlag, depthTable) {
var _local2 = 0;
if ((depthFlag == kTop) || (depthFlag == kNotopmost)) {
var _local5 = 0;
var _local7 = false;
var _local8;
for (_local8 in depthTable) {
var _local9 = depthTable[_local8];
var _local3 = typeof(_local9);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local9.__getTextFormat != undefined))) {
if (_local9.getDepth() <= highestDepth) {
if (!_local9._topmost) {
_local2 = Math.max(_local2, _local9.getDepth());
} else if (!_local7) {
_local5 = _local9.getDepth();
_local7 = true;
} else {
_local5 = Math.min(_local5, _local9.getDepth());
}
}
}
}
_local2 = _local2 + 20;
if (_local7) {
if (_local2 >= _local5) {
_local2 = _local5 - 1;
}
}
} else if (depthFlag == kBottom) {
for (var _local8 in depthTable) {
var _local9 = depthTable[_local8];
var _local3 = typeof(_local9);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local9.__getTextFormat != undefined))) {
if (_local9.getDepth() <= highestDepth) {
_local2 = Math.min(_local2, _local9.getDepth());
}
}
}
_local2 = _local2 - 20;
} else if (depthFlag == kTopmost) {
for (var _local8 in depthTable) {
var _local9 = depthTable[_local8];
var _local3 = typeof(_local9);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local9.__getTextFormat != undefined))) {
if (_local9.getDepth() <= highestDepth) {
_local2 = Math.max(_local2, _local9.getDepth());
}
}
}
_local2 = _local2 + 100;
}
if (_local2 >= highestDepth) {
_local2 = highestDepth;
}
var _local6 = lowestDepth + numberOfAuthortimeLayers;
for (var _local9 in depthTable) {
var _local4 = depthTable[_local9];
if (_local4._parent != undefined) {
_local6 = Math.min(_local6, _local4.getDepth());
}
}
if (_local2 <= _local6) {
_local2 = _local6;
}
return(_local2);
}
function buildDepthTable(Void) {
var _local5 = new Array();
var _local4;
for (_local4 in this) {
var _local2 = this[_local4];
var _local3 = typeof(_local2);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local2.__getTextFormat != undefined))) {
if (_local2._parent == this) {
_local5[_local2.getDepth()] = _local2;
}
}
}
return(_local5);
}
static var reservedDepth = 1048575;
static var highestDepth = 1048574;
static var lowestDepth = -16383;
static var numberOfAuthortimeLayers = 383;
static var kCursor = 101;
static var kTooltip = 102;
static var kTop = 201;
static var kBottom = 202;
static var kTopmost = 203;
static var kNotopmost = 204;
static var holder = _root.createEmptyMovieClip("reserved", reservedDepth);
static var __depthManager = new DepthManager();
}
Symbol 583 MovieClip [__Packages.Group] Frame 0
class Group
{
var x1, y1, x2, y2;
function Group (x1, y1, x2, y2) {
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
}
function getX1() {
return(x1);
}
function getY1() {
return(y1);
}
function getX2() {
return(x2);
}
function getY2() {
return(y2);
}
function equals(group) {
return((((x1 == group.x1) && (y1 == group.y1)) && (x2 == group.x2)) && (y2 == group.y2));
}
function toString() {
return(((((((("(" + x1) + ",") + y1) + ",") + x2) + ",") + y2) + ")");
}
}
Instance of Symbol 286 MovieClip [crypticClearance] in Symbol 520 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(1);
}
Instance of Symbol 286 MovieClip [crypticClearance] in Symbol 520 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(2);
}
Instance of Symbol 286 MovieClip [crypticClearance] in Symbol 520 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(3);
}
Instance of Symbol 286 MovieClip [crypticClearance] in Symbol 520 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(4);
}
Instance of Symbol 286 MovieClip [crypticClearance] in Symbol 520 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(5);
}
Instance of Symbol 286 MovieClip [crypticClearance] in Symbol 520 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(6);
}
Instance of Symbol 286 MovieClip [crypticClearance] in Symbol 520 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(7);
}
Instance of Symbol 286 MovieClip [crypticClearance] in Symbol 520 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(8);
}
Instance of Symbol 277 MovieClip [jewelsClearance] in Symbol 520 MovieClip Frame 2
onClipEvent (enterFrame) {
this.gotoAndStop(1);
}
Instance of Symbol 277 MovieClip [jewelsClearance] in Symbol 520 MovieClip Frame 2
onClipEvent (enterFrame) {
this.gotoAndStop(2);
}
Instance of Symbol 277 MovieClip [jewelsClearance] in Symbol 520 MovieClip Frame 2
onClipEvent (enterFrame) {
this.gotoAndStop(3);
}
Instance of Symbol 277 MovieClip [jewelsClearance] in Symbol 520 MovieClip Frame 2
onClipEvent (enterFrame) {
this.gotoAndStop(4);
}
Instance of Symbol 277 MovieClip [jewelsClearance] in Symbol 520 MovieClip Frame 2
onClipEvent (enterFrame) {
this.gotoAndStop(5);
}
Instance of Symbol 277 MovieClip [jewelsClearance] in Symbol 520 MovieClip Frame 2
onClipEvent (enterFrame) {
this.gotoAndStop(6);
}
Instance of Symbol 277 MovieClip [jewelsClearance] in Symbol 520 MovieClip Frame 2
onClipEvent (enterFrame) {
this.gotoAndStop(7);
}
Instance of Symbol 277 MovieClip [jewelsClearance] in Symbol 520 MovieClip Frame 2
onClipEvent (enterFrame) {
this.gotoAndStop(8);
}
Instance of Symbol 269 MovieClip [juicyClearance] in Symbol 520 MovieClip Frame 3
onClipEvent (enterFrame) {
this.gotoAndStop(1);
}
Instance of Symbol 269 MovieClip [juicyClearance] in Symbol 520 MovieClip Frame 3
onClipEvent (enterFrame) {
this.gotoAndStop(2);
}
Instance of Symbol 269 MovieClip [juicyClearance] in Symbol 520 MovieClip Frame 3
onClipEvent (enterFrame) {
this.gotoAndStop(3);
}
Instance of Symbol 269 MovieClip [juicyClearance] in Symbol 520 MovieClip Frame 3
onClipEvent (enterFrame) {
this.gotoAndStop(4);
}
Instance of Symbol 269 MovieClip [juicyClearance] in Symbol 520 MovieClip Frame 3
onClipEvent (enterFrame) {
this.gotoAndStop(5);
}
Instance of Symbol 269 MovieClip [juicyClearance] in Symbol 520 MovieClip Frame 3
onClipEvent (enterFrame) {
this.gotoAndStop(6);
}
Instance of Symbol 269 MovieClip [juicyClearance] in Symbol 520 MovieClip Frame 3
onClipEvent (enterFrame) {
this.gotoAndStop(7);
}
Instance of Symbol 269 MovieClip [juicyClearance] in Symbol 520 MovieClip Frame 3
onClipEvent (enterFrame) {
this.gotoAndStop(8);
}
Instance of Symbol 262 MovieClip [classicClearance] in Symbol 520 MovieClip Frame 4
onClipEvent (enterFrame) {
this.gotoAndStop(1);
}
Instance of Symbol 262 MovieClip [classicClearance] in Symbol 520 MovieClip Frame 4
onClipEvent (enterFrame) {
this.gotoAndStop(2);
}
Instance of Symbol 262 MovieClip [classicClearance] in Symbol 520 MovieClip Frame 4
onClipEvent (enterFrame) {
this.gotoAndStop(3);
}
Instance of Symbol 262 MovieClip [classicClearance] in Symbol 520 MovieClip Frame 4
onClipEvent (enterFrame) {
this.gotoAndStop(4);
}
Instance of Symbol 262 MovieClip [classicClearance] in Symbol 520 MovieClip Frame 4
onClipEvent (enterFrame) {
this.gotoAndStop(5);
}
Instance of Symbol 262 MovieClip [classicClearance] in Symbol 520 MovieClip Frame 4
onClipEvent (enterFrame) {
this.gotoAndStop(6);
}
Instance of Symbol 262 MovieClip [classicClearance] in Symbol 520 MovieClip Frame 4
onClipEvent (enterFrame) {
this.gotoAndStop(7);
}
Instance of Symbol 262 MovieClip [classicClearance] in Symbol 520 MovieClip Frame 4
onClipEvent (enterFrame) {
this.gotoAndStop(8);
}
Symbol 540 MovieClip Frame 1
stop();