Frame 1
var link = "";
_global.playerScore = 0;
_global.playerLevel = 0;
_global.submitScoreMode = false;
_global.gamePaused = false;
_global.saved = new sharedData();
_global.continueMode = false;
_global.autoSave = true;
_global.soundSant = true;
if ((((_url.indexOf("glowingeyegames.com") != -1) || (_url.indexOf("kongregate.com") != -1)) || (_url.indexOf("smileygamer.com") != -1)) || (_url.indexOf("mindjolt.com") != -1)) {
_global.autoSave = true;
} else {
_global.autoSave = false;
}
var defPieceTypeArray = new Array();
defPieceTypeArray = [3, 4, 4, 5, 5, 6, 6, 7, 7, 8];
var defLevelClearArray = new Array();
defLevelClearArray = [10, 11, 12, 13, 14, 15, 15, 15, 15];
var defPieceLockedArray = new Array();
defPieceLockedArray = [-1, -1, 20, 19, 18, 17, 16, 15, 14, 13];
var myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success) {
if (success) {
trace("loaded XML succes");
var _local2 = "";
var _local1 = "";
var _local4 = 0;
while (_local4 < myXML.firstChild.childNodes.length) {
if (String(myXML.firstChild.childNodes[_local4].attributes.type) == "pieceTypes") {
defPieceTypeArray = [];
_local2 = String(myXML.firstChild.childNodes[_local4].attributes.value);
_local1 = "";
var _local3 = 0;
while (_local3 < _local2.length) {
if (_local2.charAt(_local3) == ",") {
defPieceTypeArray.push(Number(_local1));
_local1 = "";
} else {
_local1 = _local1 + _local2.charAt(_local3);
}
_local3++;
}
if (_local1 != "") {
defPieceTypeArray.push(Number(_local1));
}
trace((("defPieceTypeArray=" + defPieceTypeArray[0]) + " ") + defPieceTypeArray[1]);
}
if (String(myXML.firstChild.childNodes[_local4].attributes.type) == "linesClearLevel") {
defLevelClearArray = [];
_local2 = String(myXML.firstChild.childNodes[_local4].attributes.value);
_local1 = "";
var _local3 = 0;
while (_local3 < _local2.length) {
if (_local2.charAt(_local3) == ",") {
defLevelClearArray.push(Number(_local1));
_local1 = "";
} else {
_local1 = _local1 + _local2.charAt(_local3);
}
_local3++;
}
if (_local1 != "") {
defLevelClearArray.push(Number(_local1));
}
trace((("defLevelClearArray...=" + defLevelClearArray[0]) + " ") + defLevelClearArray[1]);
}
if (String(myXML.firstChild.childNodes[_local4].attributes.type) == "lockPiece") {
defPieceLockedArray = [];
_local2 = String(myXML.firstChild.childNodes[_local4].attributes.value);
_local1 = "";
var _local3 = 0;
while (_local3 < _local2.length) {
if (_local2.charAt(_local3) == ",") {
defPieceLockedArray.push(Number(_local1));
_local1 = "";
} else {
_local1 = _local1 + _local2.charAt(_local3);
}
_local3++;
}
if (_local1 != "") {
defPieceLockedArray.push(Number(_local1));
}
trace((("defLevelClearArray...=" + defPieceLockedArray[0]) + " ") + defPieceLockedArray[1]);
}
_local4++;
}
}
};
myXML.load(com.communitymx.CacheManager.uncacheURL("settings.XML"));
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
stop();
var adShown = true;
loadingField._visible = true;
__com_mochibot__("1088ee13", this, 10301, true);
mochi.MochiServices.connect("cc092839f6d52144");
this.onEnterFrame = function () {
if (adShown) {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
this.onEnterFrame = null;
_root.link = "logo";
_root.fader.play();
} else {
loadingField._visible = true;
loadingField.text = ("Loading... " + String(Math.floor((_root.getBytesLoaded() * 100) / _root.getBytesTotal()))) + "%";
}
}
};
Frame 20
var CPMStarContentSpotID = "413Q3093B5B3";
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + CPMStarContentSpotID);
Frame 26
Mouse.hide();
if (_global.soundSant) {
_global.soundSant = false;
_root.jukeBoxMC.playMainMenuLoop();
}
if (_global.autoSave && (_global.saved.continuePossible)) {
continueBt.enabled = true;
continueBt._alpha = 100;
continueText._alpha = 100;
} else {
continueBt.enabled = false;
continueBt._alpha = 70;
continueText._alpha = 70;
}
Instance of Symbol 327 MovieClip in Frame 26
onClipEvent (enterFrame) {
if (_global.saved.getMusic()) {
musicTxt.text = "Music On";
} else {
musicTxt.text = "Music Off";
}
}
on (release) {
_global.saved.toggleMusic();
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
var filter1 = (new flash.filters.GlowFilter(0, 0.8, 5, 5, 2.5, 1, false, false));
var filterArray1 = new Array();
filterArray1.push(filter1);
musicTxt.filters = filterArray1;
_root.jukeBoxMC.playSound("mouseOver");
}
on (rollOut) {
musicTxt.filters = [];
}
Instance of Symbol 329 MovieClip in Frame 26
on (release) {
_global.saved.toggleSound();
_root.jukeBoxMC.playSound("mouseClick");
}
onClipEvent (enterFrame) {
if (_global.saved.getSound()) {
musicTxt.text = "Sound On";
} else {
musicTxt.text = "Sound Off";
}
}
on (rollOver) {
var filter1 = (new flash.filters.GlowFilter(0, 0.8, 5, 5, 2.5, 1, false, false));
var filterArray1 = new Array();
filterArray1.push(filter1);
musicTxt.filters = filterArray1;
_root.jukeBoxMC.playSound("mouseOver");
}
on (rollOut) {
musicTxt.filters = [];
}
Instance of Symbol 335 MovieClip in Frame 26
onClipEvent (enterFrame) {
if (_global.saved.instrOn) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
on (release) {
_global.saved.toggleInstr();
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
var filter1 = (new flash.filters.GlowFilter(0, 0.99, 5, 5, 5, 3, false, false));
var filterArray1 = new Array();
filterArray1.push(filter1);
this.filters = filterArray1;
_root.jukeBoxMC.playSound("mouseOver");
}
on (rollOut) {
var filter1 = (new flash.filters.GlowFilter(0, 0.9, 3, 3, 2.5, 2, false, false));
var filterArray1 = new Array();
filterArray1.push(filter1);
this.filters = filterArray1;
}
Instance of Symbol 347 MovieClip in Frame 26
on (release) {
getURL ("http://www.smileygamer.com/?gameref=2342", "_blank");
}
Instance of Symbol 347 MovieClip in Frame 26
on (release) {
getURL ("http://www.smileygamer.com/?gameref=2342", "_blank");
}
Instance of Symbol 354 MovieClip "mouseMC" in Frame 26
onClipEvent (enterFrame) {
this._x = _root._xmouse + 19;
this._y = _root._ymouse + 19;
}
Frame 30
if (_global.saved.instrOn == false) {
_root.gotoAndStop("game");
}
Frame 50
scoreField.text = _global.playerScore;
playerRating.scor = _global.playerLevel;
winSubmit.nameField.text = _global.saved.getPlayerName();
var isHS_sant = _global.saved.isHS(_global.playerScore);
if (isHS_sant) {
messageField.text = "Congratulations! You have a high score!";
winSubmit._visible = true;
goMainMenuButton._visible = false;
goPlayAgainButton._visible = false;
Selection.setFocus(this.winSubmit.nameField);
Selection.setSelection(0, this.winSubmit.nameField.length);
} else {
messageField.text = "Unfortunatly you did not get a high score.";
winSubmit._visible = false;
goMainMenuButton._visible = true;
goPlayAgainButton._visible = true;
}
goPlayAgainButton.onRelease = function () {
_root.link = "game";
_root.fader.gotoAndPlay(2);
};
goMainMenuButton.onRelease = function () {
_root.link = "mainMenu";
_root.fader.gotoAndPlay(2);
_root.jukeBoxMC.playSound("mouseClick");
};
goPlayAgainButton.onRollOver = function () {
_root.jukeBoxMC.playSound("mouseOver");
};
goMainMenuButton.onRollOver = function () {
_root.jukeBoxMC.playSound("mouseOver");
};
Frame 60
function mochiSubmitCallBack(args) {
if (args.scores != null) {
trace("Scores received!");
var _local1 = mochi.MochiScores.scoresArrayToObjects(args.scores);
onlineStatWin.rank1Field.text = _local1.places.daily;
onlineStatWin.rank2Field.text = _local1.counts.daily;
onlineStatWin._visible = true;
}
}
onlineStatWin._visible = false;
var selectat;
selectat = new TextFormat();
selectat.font = "Comic Sans MS";
selectat.color = 16711680 /* 0xFF0000 */;
selectat.size = 14;
var defFormat;
defFormat = new TextFormat();
defFormat.font = "Comic Sans MS";
defFormat.color = 16777215 /* 0xFFFFFF */;
defFormat.size = 14;
var h = new Array();
var i = 0;
while (i < 20) {
h[i] = new Array();
i++;
}
h[0][0] = nn1;
h[0][1] = ns1;
h[1][0] = nn2;
h[1][1] = ns2;
h[2][0] = nn3;
h[2][1] = ns3;
h[3][0] = nn4;
h[3][1] = ns4;
h[4][0] = nn5;
h[4][1] = ns5;
h[5][0] = nn6;
h[5][1] = ns6;
h[6][0] = nn7;
h[6][1] = ns7;
h[7][0] = nn8;
h[7][1] = ns8;
h[8][0] = nn9;
h[8][1] = ns9;
h[9][0] = nn10;
h[9][1] = ns10;
var i = 0;
while (i < 10) {
h[i][0].text = "";
h[i][0].setNewTextFormat(defFormat);
h[i][1].text = "";
h[i][1].setNewTextFormat(defFormat);
i++;
}
if (_global.submitScoreMode) {
mainMenuBt._x = 186;
playAgainBt._x = 421;
_global.saved.setHS(_global.saved.getPlayerName(), _global.playerScore);
mochi.MochiScores.setBoardID("a0988b1dca181604");
mochi.MochiScores.submit(_global.playerScore, _global.saved.getPlayerName(), this, "mochiSubmitCallBack");
} else {
onlineStatWin._visible = false;
mainMenuBt._x = 300;
playAgainBt._x = 1000;
}
_global.saved.HS.sortOn("score", Array.DESCENDING | Array.NUMERIC);
var i = 0;
while (i < 10) {
if (_global.saved.HS[i].name != undefined) {
h[i][0].text = _global.saved.HS[i].name;
h[i][1].text = _global.saved.HS[i].score;
}
i++;
}
var i = 0;
while (i < 10) {
if (((h[i][0].text == _global.saved.getPlayerName()) && (Number(h[i][1].text) == _global.playerScore)) && (_global.submitScoreMode)) {
trace("found " + i);
h[i][0].setNewTextFormat(selectat);
h[i][1].setNewTextFormat(selectat);
h[i][0].text = _global.saved.getPlayerName();
h[i][1].text = _global.playerScore;
break;
}
i++;
}
_global.submitScoreMode = false;
mainMenuBt.onRelease = function () {
_root.link = "mainMenu";
_root.fader.gotoAndPlay(2);
_root.jukeBoxMC.playSound("mouseClick");
};
playAgainBt.onRelease = function () {
_root.link = "game";
_root.fader.gotoAndPlay(2);
_root.jukeBoxMC.playSound("mouseClick");
};
playAgainBt.onRollOver = function () {
_root.jukeBoxMC.playSound("mouseOver");
};
mainMenuBt.onRollOver = function () {
_root.jukeBoxMC.playSound("mouseOver");
};
Instance of Symbol 439 MovieClip in Frame 70
onClipEvent (enterFrame) {
if (_global.saved.instrOn) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
on (release) {
_global.saved.toggleInstr();
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
var filter1 = (new flash.filters.GlowFilter(0, 0.99, 5, 5, 5, 3, false, false));
var filterArray1 = new Array();
filterArray1.push(filter1);
this.filters = filterArray1;
_root.jukeBoxMC.playSound("mouseOver");
}
on (rollOut) {
var filter1 = (new flash.filters.GlowFilter(0, 0.9, 3, 3, 2.5, 2, false, false));
var filterArray1 = new Array();
filterArray1.push(filter1);
this.filters = filterArray1;
}
Instance of Symbol 457 MovieClip in Frame 90
on (release) {
getURL ("http://www.glowingeyegames.com", "_blank");
}
Symbol 10 MovieClip Frame 1
stop();
Symbol 10 MovieClip Frame 28
stop();
this._visible = false;
Symbol 14 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 2
stop();
Symbol 125 MovieClip Frame 3
stop();
Symbol 125 MovieClip Frame 4
stop();
Symbol 125 MovieClip Frame 5
stop();
Symbol 125 MovieClip Frame 6
stop();
Symbol 125 MovieClip Frame 7
stop();
Symbol 125 MovieClip Frame 8
stop();
Symbol 125 MovieClip Frame 9
stop();
Symbol 125 MovieClip Frame 10
stop();
Symbol 125 MovieClip Frame 11
stop();
Symbol 125 MovieClip Frame 12
stop();
Symbol 125 MovieClip Frame 13
stop();
Symbol 125 MovieClip Frame 14
stop();
Symbol 125 MovieClip Frame 15
stop();
Symbol 125 MovieClip Frame 16
stop();
Symbol 125 MovieClip Frame 17
stop();
Symbol 125 MovieClip Frame 18
stop();
Symbol 125 MovieClip Frame 19
stop();
Symbol 125 MovieClip Frame 20
stop();
Symbol 125 MovieClip Frame 21
stop();
Symbol 125 MovieClip Frame 22
stop();
Symbol 125 MovieClip Frame 23
stop();
Symbol 125 MovieClip Frame 24
stop();
Symbol 125 MovieClip Frame 25
stop();
Symbol 125 MovieClip Frame 26
stop();
Symbol 125 MovieClip Frame 27
stop();
Symbol 125 MovieClip Frame 28
stop();
Symbol 125 MovieClip Frame 29
stop();
Symbol 125 MovieClip Frame 30
stop();
Symbol 125 MovieClip Frame 31
stop();
Symbol 125 MovieClip Frame 32
stop();
Symbol 125 MovieClip Frame 33
stop();
Symbol 125 MovieClip Frame 34
stop();
Symbol 125 MovieClip Frame 35
stop();
Symbol 125 MovieClip Frame 36
stop();
Symbol 143 MovieClip Frame 8
stop();
Symbol 144 MovieClip Frame 8
stop();
_parent._parent.removePiece(_parent.ID);
Symbol 145 MovieClip [pieceMC] Frame 1
#initclip 18
Object.registerClass("pieceMC", pieceMC);
#endinitclip
stop();
Symbol 145 MovieClip [pieceMC] Frame 2
stop();
Symbol 145 MovieClip [pieceMC] Frame 3
stop();
Symbol 145 MovieClip [pieceMC] Frame 4
stop();
Symbol 145 MovieClip [pieceMC] Frame 5
stop();
Symbol 145 MovieClip [pieceMC] Frame 6
stop();
Symbol 145 MovieClip [pieceMC] Frame 7
stop();
Symbol 145 MovieClip [pieceMC] Frame 8
stop();
Symbol 145 MovieClip [pieceMC] Frame 9
stop();
Symbol 145 MovieClip [pieceMC] Frame 11
stop();
Symbol 145 MovieClip [pieceMC] Frame 12
stop();
Symbol 145 MovieClip [pieceMC] Frame 13
stop();
Symbol 145 MovieClip [pieceMC] Frame 14
stop();
Symbol 145 MovieClip [pieceMC] Frame 55
stop();
trace("remove_instance");
_parent.removePiece(ID);
Symbol 153 MovieClip [ratings] Frame 1
#initclip 12
Object.registerClass("ratings", ratings);
#endinitclip
Symbol 156 MovieClip Frame 1
stop();
Symbol 156 MovieClip Frame 14
stop();
Symbol 157 MovieClip [nextShapePanel] Frame 1
#initclip 13
Object.registerClass("nextShapePanel", nextShapePanel);
#endinitclip
stop();
Symbol 157 MovieClip [nextShapePanel] Frame 5
all1.lacatMC._visible = false;
all2.lacatMC._visible = false;
all3.lacatMC._visible = false;
if (!addDualMode) {
if (_parent.level <= 10) {
nextArray[0] = randRange(1, _parent.pieceTypeArray[_parent.level - 1]);
nextArray[1] = randRange(1, _parent.pieceTypeArray[_parent.level - 1]);
nextArray[2] = randRange(1, _parent.pieceTypeArray[_parent.level - 1]);
} else {
nextArray[0] = randRange(1, _parent.pieceTypeArray[8]);
nextArray[1] = randRange(1, _parent.pieceTypeArray[8]);
nextArray[2] = randRange(1, _parent.pieceTypeArray[8]);
}
all1.gotoAndStop(nextArray[0]);
all2.gotoAndStop(nextArray[1]);
all3.gotoAndStop(nextArray[2]);
dual1Array[0] = -1;
dual2Array[0] = -1;
dual1Array[1] = -1;
dual2Array[1] = -1;
dual1Array[2] = -1;
dual2Array[2] = -1;
} else {
all1.gotoAndStop(nextArray[0]);
if (nextArray[0] == 14) {
all1.dualMC.gotoAndStop(("b" + String(dual1Array[0])) + String(dual2Array[0]));
} else {
dual1Array[0] = -1;
dual2Array[0] = -1;
}
all2.gotoAndStop(nextArray[1]);
if (nextArray[1] == 14) {
all2.dualMC.gotoAndStop(("b" + String(dual1Array[1])) + String(dual2Array[1]));
} else {
dual1Array[1] = -1;
dual2Array[1] = -1;
}
all3.gotoAndStop(nextArray[2]);
if (nextArray[2] == 14) {
all3.dualMC.gotoAndStop(("b" + String(dual1Array[2])) + String(dual2Array[2]));
} else {
dual1Array[2] = -1;
dual2Array[2] = -1;
}
addDualMode = false;
}
var tempC = _parent.lockedCounter;
var limit = -1;
tempC++;
if (nextArray[0] < 10) {
if (_parent.level < 10) {
limit = _parent.pieceLockedArray[_parent.level - 1];
} else {
limit = _parent.pieceLockedArray[8];
}
if ((tempC >= limit) && (limit > 0)) {
all1.lacatMC._visible = true;
tempC = 0;
}
}
tempC++;
if (nextArray[1] < 10) {
if (_parent.level < 10) {
limit = _parent.pieceLockedArray[_parent.level - 1];
} else {
limit = _parent.pieceLockedArray[8];
}
if ((tempC >= limit) && (limit > 0)) {
all2.lacatMC._visible = true;
tempC = 0;
}
}
tempC++;
if (nextArray[2] < 10) {
if (_parent.level < 10) {
limit = _parent.pieceLockedArray[_parent.level - 1];
} else {
limit = _parent.pieceLockedArray[8];
}
if ((tempC >= limit) && (limit > 0)) {
all3.lacatMC._visible = true;
tempC = 0;
}
}
Symbol 168 MovieClip [hex2] Frame 1
#initclip 14
Object.registerClass("hex2", hexMC);
#endinitclip
Symbol 171 MovieClip [hex1] Frame 1
#initclip 15
Object.registerClass("hex1", hexMC);
#endinitclip
Symbol 174 MovieClip Frame 1
stop();
Symbol 174 MovieClip Frame 2
stop();
Symbol 174 MovieClip Frame 3
stop();
Symbol 174 MovieClip Frame 4
stop();
Symbol 174 MovieClip Frame 5
stop();
Symbol 178 MovieClip [bonusShapePanel] Frame 1
#initclip 16
Object.registerClass("bonusShapePanel", bonusShapePanel);
#endinitclip
stop();
Symbol 178 MovieClip [bonusShapePanel] Frame 5
var str;
all1.gotoAndStop(bonusArray[0].tip + 1);
trace(("Bonus============ " + bonusArray[0].tip) + ".................................");
all1.tipText.text = "";
if (nBonus < 3) {
switch (bonusArray[0].tip) {
case 1 :
all1.tipText.text = "Joker\nShape";
break;
case 2 :
all1.tipText.text = "Joker\nRemoves\nSimilar\nShapes";
break;
case 3 :
all1.tipText.text = "Joker\nUnlocks\nLocked\nPieces";
break;
default :
all1.tipText.text = "";
}
}
if (bonusArray[0].tip == 3) {
str = "";
str = str + String(bonusArray[0].dual1);
str = str + String(bonusArray[0].dual2);
trace("str=" + str);
all1.dual.gotoAndStop("b" + str);
}
all2.gotoAndStop(bonusArray[1].tip + 1);
all2.tipText.text = "";
if (nBonus < 3) {
switch (bonusArray[1].tip) {
case 1 :
all2.tipText.text = "Joker\nShape";
break;
case 2 :
all2.tipText.text = "Joker\nRemoves\nSimilar\nShapes";
break;
case 3 :
all2.tipText.text = "Joker\nUnlocks\nLocked\nPieces";
break;
default :
all2.tipText.text = "";
}
}
if (bonusArray[1].tip == 3) {
str = "";
str = str + String(bonusArray[1].dual1);
str = str + String(bonusArray[1].dual2);
all2.dual.gotoAndStop("b" + str);
}
all3.gotoAndStop(bonusArray[2].tip + 1);
all3.tipText.text = "";
if (nBonus < 3) {
switch (bonusArray[2].tip) {
case 1 :
all3.tipText.text = "Joker\nShape";
break;
case 2 :
all3.tipText.text = "Joker\nRemoves\nSimilar\nShapes";
break;
case 3 :
all3.tipText.text = "Joker\nUnlocks\nLocked\nPieces";
break;
default :
all3.tipText.text = "";
}
}
if (bonusArray[2].tip == 3) {
str = "";
str = str + String(bonusArray[2].dual1);
str = str + String(bonusArray[2].dual2);
all3.dual.gotoAndStop("b" + str);
}
all4.gotoAndStop(bonusArray[3].tip + 1);
if (bonusArray[3].tip == 3) {
str = "";
str = str + String(bonusArray[3].dual1);
str = str + String(bonusArray[3].dual2);
all4.dual.gotoAndStop("b" + str);
}
all5.gotoAndStop(bonusArray[4].tip + 1);
if (bonusArray[4].tip == 3) {
str = "";
str = str + String(bonusArray[4].dual1);
str = str + String(bonusArray[4].dual2);
all5.dual.gotoAndStop("b" + str);
}
all6.gotoAndStop(bonusArray[5].tip + 1);
if (bonusArray[5].tip == 3) {
str = "";
str = str + String(bonusArray[5].dual1);
str = str + String(bonusArray[5].dual2);
all6.dual.gotoAndStop("b" + str);
}
Symbol 197 Button
on (release) {
getURL ("http://www.glowingeyegames.com/", "_blank");
}
Symbol 203 Button
on (release) {
getURL ("http://www.smileygamer.com/", "_blank");
}
Symbol 205 MovieClip Frame 1
stop();
if (_global.autoSave == false) {
gotoAndStop (2);
}
Symbol 216 Button
on (release) {
_global.saved.toggleMusic2();
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 220 Button
on (release) {
_global.saved.toggleSound();
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 228 Button
on (release) {
_root.inGameInstructionsMC._x = 300;
_root.gameMC._x = 2000;
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 234 Button
on (release) {
trace("stare == " + stare);
_root.jukeBoxMC.playSound("mouseClick");
if ((stare == "addPiecesStartGame") || (stare == "addPieceStartDelay")) {
exitAfterNew = true;
} else {
_root.link = "mainMenu";
_root.fader.gotoAndPlay(2);
_global.soundSant = true;
}
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 241 MovieClip Frame 1
stop();
this._x = 700;
Symbol 242 MovieClip [Director] Frame 1
#initclip 17
Object.registerClass("Director", Director);
#endinitclip
Instance of Symbol 219 MovieClip in Symbol 242 MovieClip [Director] Frame 1
onClipEvent (enterFrame) {
if (_global.saved.getMusic()) {
musicTxt.text = "Music On";
} else {
musicTxt.text = "Music Off";
}
}
Instance of Symbol 222 MovieClip in Symbol 242 MovieClip [Director] Frame 1
onClipEvent (enterFrame) {
if (_global.saved.getSound()) {
musicTxt.text = "Sound On";
} else {
musicTxt.text = "Sound Off";
}
}
Symbol 247 MovieClip Frame 1
stop();
Symbol 247 MovieClip Frame 18
_root.gotoAndStop(_root.link);
Symbol 458 MovieClip [__Packages.com.communitymx.CacheManager] Frame 0
class com.communitymx.CacheManager
{
function CacheManager () {
}
static function uncacheURL(url) {
if (_cmInstance == undefined) {
_cmInstance = new com.communitymx.CacheManager();
}
return(_cmInstance.formatString(url));
}
function formatString(url) {
if (isLocalPlayback()) {
return(url);
}
var _local2 = "×tamp=" + new Date().getTime();
return(((url + "?cachebuster=") + Math.random()) + _local2);
}
function isLocalPlayback() {
return(_url.indexOf("file") == 0);
}
static var _cmInstance = undefined;
}
Symbol 459 MovieClip [__Packages.sharedData] Frame 0
class sharedData
{
var HS, pieces, nPieces, hexs, sd, level, score, multiply, totalLines, lockedCounter, next1, next2, next3, dual11, dual12, dual13, dual21, dual22, dual23, pieceID;
function sharedData () {
HS = new Array();
pieces = new Array();
nPieces = 0;
hexs = new Array();
sd = SharedObject.getLocal("chromatica_game");
if (sd.data.playerName == undefined) {
sd.data.playerName = "Player";
playerName = "Player";
} else {
playerName = sd.data.playerName;
}
if (sd.data.soundOn == undefined) {
sd.data.soundOn = true;
soundOn = true;
} else {
soundOn = sd.data.soundOn;
}
if (sd.data.musicOn == undefined) {
sd.data.musicOn = true;
musicOn = true;
} else {
musicOn = sd.data.musicOn;
}
if (sd.data.instrOn == undefined) {
sd.data.instrOn = true;
instrOn = true;
} else {
instrOn = sd.data.instrOn;
}
if (sd.data.HS == undefined) {
sd.data.HS = new Array();
sd.data.nHS = 0;
} else {
HS = sd.data.HS;
nHS = sd.data.nHS;
}
if (sd.data.continuePossible == undefined) {
sd.data.continuePossible = false;
continuePossible = false;
} else {
continuePossible = sd.data.continuePossible;
}
if (sd.data.level == undefined) {
sd.data.level = 0;
level = 0;
} else {
level = sd.data.level;
}
if (sd.data.score == undefined) {
sd.data.score = 0;
score = 0;
} else {
score = sd.data.score;
}
if (sd.data.multiply == undefined) {
sd.data.multiply = 0;
multiply = 0;
} else {
multiply = sd.data.multiply;
}
if (sd.data.totalLines == undefined) {
sd.data.totalLines = 0;
totalLines = 0;
} else {
totalLines = sd.data.totalLines;
}
if (sd.data.lockedCounter == undefined) {
sd.data.lockedCounter = 0;
lockedCounter = 0;
} else {
lockedCounter = sd.data.lockedCounter;
}
if (sd.data.nPieces == undefined) {
sd.data.nPieces = 0;
nPieces = 0;
} else {
nPieces = sd.data.nPieces;
}
if (sd.data.next1 == undefined) {
sd.data.next1 = 0;
next1 = 0;
} else {
next1 = sd.data.next1;
}
if (sd.data.next2 == undefined) {
sd.data.next2 = 0;
next2 = 0;
} else {
next2 = sd.data.next2;
}
if (sd.data.next3 == undefined) {
sd.data.next3 = 0;
next3 = 0;
} else {
next3 = sd.data.next3;
}
if (sd.data.dual11 == undefined) {
sd.data.dual11 = -1;
dual11 = -1;
} else {
dual11 = sd.data.dual11;
}
if (sd.data.dual12 == undefined) {
sd.data.dual12 = -1;
dual12 = -1;
} else {
dual12 = sd.data.dual12;
}
if (sd.data.dual13 == undefined) {
sd.data.dual13 = -1;
dual13 = -1;
} else {
dual13 = sd.data.dual13;
}
if (sd.data.dual21 == undefined) {
sd.data.dual21 = -1;
dual21 = -1;
} else {
dual21 = sd.data.dual21;
}
if (sd.data.dual22 == undefined) {
sd.data.dual22 = -1;
dual22 = -1;
} else {
dual22 = sd.data.dual22;
}
if (sd.data.dual23 == undefined) {
sd.data.dual23 = -1;
dual23 = -1;
} else {
dual23 = sd.data.dual23;
}
if (sd.data.pieceID == undefined) {
sd.data.pieceID = 0;
pieceID = 0;
} else {
pieceID = sd.data.pieceID;
}
if (sd.data.pieces == undefined) {
sd.data.pieces = new Array();
sd.data.nPieces = 0;
} else {
pieces = sd.data.pieces;
nPieces = sd.data.nPieces;
}
if (sd.data.hexs == undefined) {
sd.data.hexs = new Array();
} else {
hexs = sd.data.hexs;
}
sd.flush();
}
function saveGame() {
trace("saving....");
nPieces = 0;
sd.data.level = _root.gameMC.level;
level = _root.gameMC.level;
sd.data.score = _root.gameMC.score;
score = _root.gameMC.score;
sd.data.multiply = _root.gameMC.multiply;
multiply = _root.gameMC.multiply;
sd.data.totalLines = _root.gameMC.totalLines;
totalLines = _root.gameMC.totalLines;
sd.data.lockedCounter = _root.gameMC.lockedCounter;
lockedCounter = _root.gameMC.lockedCounter;
sd.data.pieceID = _root.gameMC.pieceID;
pieceID = _root.gameMC.pieceID;
var _local4 = 0;
while (_local4 < _root.gameMC.nPieces) {
var _local3 = new Object();
_local3.x = _root.gameMC.pieceArray[_local4]._x;
_local3.y = _root.gameMC.pieceArray[_local4]._y;
_local3.id = _root.gameMC.pieceArray[_local4].ID;
_local3.type = _root.gameMC.pieceArray[_local4].type;
_local3.d1 = _root.gameMC.pieceArray[_local4].dual1;
_local3.d2 = _root.gameMC.pieceArray[_local4].dual2;
_local3.hex = _root.gameMC.pieceArray[_local4].hex;
_local3.pieceLocked = _root.gameMC.pieceArray[_local4].pieceLocked;
pieces[nPieces] = _local3;
nPieces++;
_local4++;
}
sd.data.pieces = pieces;
sd.data.nPieces = nPieces;
_local4 = 0;
while (_local4 < 46) {
var _local5 = new Object();
_local5.piece = _root.gameMC.boardArray[_local4].piece;
_local5.pieceType = _root.gameMC.boardArray[_local4].pieceType;
hexs[_local4] = _local5;
_local4++;
}
sd.data.hexs = hexs;
sd.data.next1 = _root.gameMC.nextShapePanelMC.nextArray[0];
next1 = _root.gameMC.nextShapePanelMC.nextArray[0];
sd.data.next2 = _root.gameMC.nextShapePanelMC.nextArray[1];
next2 = _root.gameMC.nextShapePanelMC.nextArray[1];
sd.data.next3 = _root.gameMC.nextShapePanelMC.nextArray[2];
next3 = _root.gameMC.nextShapePanelMC.nextArray[2];
sd.data.continuePossible = true;
continuePossible = true;
sd.flush();
}
function deleteSavedGame() {
sd.data.continuePossible = false;
continuePossible = false;
sd.flush();
}
function setPlayerName(player) {
sd.data.playerName = player;
playerName = player;
sd.flush();
}
function getPlayerName() {
return(playerName);
}
function setSound(snd) {
sd.data.soundOn = snd;
soundOn = snd;
sd.flush();
}
function getSound() {
return(soundOn);
}
function setMusic(mus) {
sd.data.musicOn = mus;
musicOn = mus;
sd.flush();
}
function getMusic() {
return(musicOn);
}
function toggleInstr() {
instrOn = !instrOn;
sd.data.instrOn = instrOn;
sd.flush();
}
function toggleMusic() {
setMusic(!getMusic());
if (getMusic()) {
_root.jukeBoxMC.playMainMenuLoop();
} else {
_root.jukeBoxMC.stopMusic();
}
}
function toggleMusic2() {
setMusic(!getMusic());
if (getMusic()) {
_root.jukeBoxMC.playInGameLoop();
} else {
_root.jukeBoxMC.stopMusic();
}
}
function toggleSound() {
if (getSound()) {
_root.jukeBoxMC.stopSound();
}
setSound(!getSound());
}
function isHS(scor) {
if ((sd.data.HS.length < 10) || (sd.data.HS[9].score < scor)) {
return(true);
}
return(false);
}
function getHS(nr) {
if (nHS > nr) {
return(HS[nr]);
}
return({name:"", score:0});
}
function setHS(playerName, playerScore) {
HS.push({name:playerName, score:playerScore});
HS.sortOn("score", Array.DESCENDING | Array.NUMERIC);
sd.data.HS = [];
trace("before array=" + sd.data.HS);
var _local2 = 0;
while (_local2 < 10) {
if (HS.length <= _local2) {
break;
}
sd.data.HS[_local2] = HS[_local2];
_local2++;
}
sd.flush();
}
var playerName = "";
var soundOn = true;
var musicOn = true;
var instrOn = true;
var nHS = 0;
var continuePossible = false;
}
Symbol 460 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.32");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 461 MovieClip [__Packages.ratings] Frame 0
class ratings extends MovieClip
{
var l1, l2, l3, l4, g1, g2, g3, g4, g5, scor, ratingTextField;
function ratings () {
super();
}
function onLoad() {
l1 = 2;
l2 = 4;
l3 = 6;
l4 = 8;
}
function setStars() {
g1._visible = false;
g2._visible = false;
g3._visible = false;
g4._visible = false;
g5._visible = false;
if (scor >= 0) {
g1._visible = true;
ratingTextField.text = "Beginner";
}
if (scor > l1) {
g2._visible = true;
ratingTextField.text = "Novice";
}
if (scor > l2) {
g3._visible = true;
ratingTextField.text = "Skilled";
}
if (scor > l3) {
g4._visible = true;
ratingTextField.text = "Expert";
}
if (scor > l4) {
g5._visible = true;
ratingTextField.text = "Genius";
}
scor = -1;
}
function onEnterFrame() {
if (scor >= 0) {
setStars();
}
}
}
Symbol 462 MovieClip [__Packages.nextShapePanel] Frame 0
class nextShapePanel extends MovieClip
{
var addDualMode, nextArray, dual1Array, dual2Array, all1, all2, all3, play, _parent;
function nextShapePanel () {
super();
}
function onLoad() {
addDualMode = false;
nextArray = new Array();
nextArray = [2, 2, 2];
dual1Array = new Array();
dual1Array = [-1, -1, -1];
dual2Array = new Array();
dual2Array = [-1, -1, -1];
all1.lacatMC._visible = false;
all2.lacatMC._visible = false;
all3.lacatMC._visible = false;
}
function randRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
function playAnimation() {
play();
}
function addDualPiece() {
var _local4 = -1;
var _local3;
var _local2;
trace("adding dual shape........");
if (nextArray[0] < 10) {
_local4 = 0;
_local3 = nextArray[0];
} else if (nextArray[1] < 10) {
_local4 = 1;
_local3 = nextArray[1];
} else if (nextArray[2] < 10) {
_local4 = 2;
_local3 = nextArray[2];
}
if (_local4 < 0) {
return(undefined);
}
if (_parent.level <= 10) {
_local2 = randRange(1, _parent.pieceTypeArray[_parent.level - 1]);
} else {
_local2 = randRange(1, _parent.pieceTypeArray[8]);
}
while (_local3 == _local2) {
if (_parent.level <= 10) {
_local2 = randRange(1, _parent.pieceTypeArray[_parent.level - 1]);
} else {
_local2 = randRange(1, _parent.pieceTypeArray[8]);
}
}
if (_local3 > _local2) {
var _local5 = _local3;
_local3 = _local2;
_local2 = _local5;
}
dual1Array[_local4] = _local3;
dual2Array[_local4] = _local2;
nextArray[_local4] = 14;
addDualMode = true;
(play());// not popped
}
function onEnterFrame() {
}
}
Symbol 463 MovieClip [__Packages.hexMC] Frame 0
class hexMC extends MovieClip
{
var activateMC, demoSelect, _parent, hitTest, ID;
function hexMC () {
super();
}
function onLoad() {
activateMC._visible = false;
demoSelect._visible = false;
}
function activate() {
activateMC._visible = true;
}
function deactivate() {
activateMC._visible = false;
}
function stabilesteVloareaPiesei(v) {
var _local2 = 0;
while (_local2 < _parent._parent.nPieces) {
if (_parent._parent.pieceArray[_local2].ID == piece) {
_parent._parent.pieceArray[_local2].valoare = v;
break;
}
_local2++;
}
}
function getPieceValue() {
var _local2 = 0;
while (_local2 < _parent._parent.nPieces) {
if (_parent._parent.pieceArray[_local2].ID == piece) {
return(_parent._parent.pieceArray[_local2].valoare);
}
_local2++;
}
}
function eliminaPiesa() {
var _local2 = 0;
while (_local2 < _parent._parent.nPieces) {
if (_parent._parent.pieceArray[_local2].ID == piece) {
_parent._parent.pieceArray[_local2].dead = true;
piece = -1;
pieceType = -1;
break;
}
_local2++;
}
}
function onMouseUp() {
if (hitTest(_root._xmouse, _root._ymouse, true)) {
_parent._parent.mouseClickListener(ID);
}
}
function onEnterFrame() {
}
var piece = -1;
var pieceType = -1;
}
Symbol 464 MovieClip [__Packages.bonusShapePanel] Frame 0
class bonusShapePanel extends MovieClip
{
var bonusArray, nBonus, messageText, play;
function bonusShapePanel () {
super();
}
function onLoad() {
bonusArray = new Array();
nBonus = 0;
var _local2 = 0;
while (_local2 < 10) {
bonusArray[_local2] = new Object();
bonusArray[_local2].tip = 0;
bonusArray[_local2].dual1 = -1;
bonusArray[_local2].dual2 = -1;
_local2++;
}
}
function randRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
function addBonus(nr, maxType) {
messageText._visible = false;
var _local3 = 0;
while (_local3 < nr) {
var _local2 = new Object();
_local2.tip = randRange(1, 3);
_local2.dual1 = -1;
_local2.dual2 = -1;
trace("BONUS:::" + _local2.tip);
bonusArray[nBonus].tip = _local2.tip;
bonusArray[nBonus].dual1 = _local2.dual1;
bonusArray[nBonus].dual2 = _local2.dual2;
nBonus++;
_local3++;
}
}
function getBonus() {
var _local3 = new Object();
_local3.tip = bonusArray[0].tip;
_local3.dual1 = bonusArray[0].dual1;
_local3.dual2 = bonusArray[0].dual2;
trace("NBonus:" + nBonus);
trace((((bonusArray[0].tip + " - ") + bonusArray[1].tip) + " - ") + bonusArray[2].tip);
var _local2 = 0;
while (_local2 < (nBonus - 1)) {
bonusArray[_local2].tip = bonusArray[_local2 + 1].tip;
bonusArray[_local2].dual1 = bonusArray[_local2 + 1].dual1;
bonusArray[_local2].dual2 = bonusArray[_local2 + 1].dual2;
_local2++;
}
bonusArray[nBonus - 1].tip = 0;
bonusArray[nBonus - 1].dual1 = -1;
bonusArray[nBonus - 1].dual2 = -1;
nBonus--;
play();
return(_local3);
}
}
Symbol 465 MovieClip [__Packages.Director] Frame 0
class Director extends MovieClip
{
var demoStart, demoEnd, deEliminat, tutArray, tutMC, levelClearArray, pieceTypeArray, pieceLockedArray, score, multiply, totalLines, level, lockedCounter, boardArray, pieceArray, tDrum, ntDrum, hexBoard, drum, drumIndex, nDrum, attachMovie, getNextHighestDepth, nextShapePanelMC, bonusPanelMC, levelClearAnimation, scoreField, multiplyField, linesField, levelField;
function Director () {
super();
}
function onLoad() {
demoStart = (demoEnd = -1);
deEliminat = new Array();
tutArray = new Array();
var _local3 = 0;
while (_local3 < 10) {
tutArray[_local3] = new Array();
_local3++;
}
tutMC._visible = false;
levelClearArray = new Array();
pieceTypeArray = new Array();
pieceLockedArray = new Array();
pieceTypeArray = _root.defPieceTypeArray;
levelClearArray = _root.defLevelClearArray;
pieceLockedArray = _root.defPieceLockedArray;
score = 0;
multiply = 1;
totalLines = 0;
level = 1;
lockedCounter = 0;
updateStats();
boardArray = new Array();
pieceArray = new Array();
tDrum = new Array();
ntDrum = 0;
boardArray[0] = hexBoard.h0;
boardArray[1] = hexBoard.h1;
boardArray[2] = hexBoard.h2;
boardArray[3] = hexBoard.h3;
boardArray[4] = hexBoard.h4;
boardArray[5] = hexBoard.h5;
boardArray[6] = hexBoard.h6;
boardArray[7] = hexBoard.h7;
boardArray[8] = hexBoard.h8;
boardArray[9] = hexBoard.h9;
boardArray[10] = hexBoard.h10;
boardArray[11] = hexBoard.h11;
boardArray[12] = hexBoard.h12;
boardArray[13] = hexBoard.h13;
boardArray[14] = hexBoard.h14;
boardArray[15] = hexBoard.h15;
boardArray[16] = hexBoard.h16;
boardArray[17] = hexBoard.h17;
boardArray[18] = hexBoard.h18;
boardArray[19] = hexBoard.h19;
boardArray[20] = hexBoard.h20;
boardArray[21] = hexBoard.h21;
boardArray[22] = hexBoard.h22;
boardArray[23] = hexBoard.h23;
boardArray[24] = hexBoard.h24;
boardArray[25] = hexBoard.h25;
boardArray[26] = hexBoard.h26;
boardArray[27] = hexBoard.h27;
boardArray[28] = hexBoard.h28;
boardArray[29] = hexBoard.h29;
boardArray[30] = hexBoard.h30;
boardArray[31] = hexBoard.h31;
boardArray[32] = hexBoard.h32;
boardArray[33] = hexBoard.h33;
boardArray[34] = hexBoard.h34;
boardArray[35] = hexBoard.h35;
boardArray[36] = hexBoard.h36;
boardArray[37] = hexBoard.h37;
boardArray[38] = hexBoard.h38;
boardArray[39] = hexBoard.h39;
boardArray[40] = hexBoard.h40;
boardArray[41] = hexBoard.h41;
boardArray[42] = hexBoard.h42;
boardArray[43] = hexBoard.h43;
boardArray[44] = hexBoard.h44;
boardArray[45] = hexBoard.h45;
boardArray[0].l1 = -1;
boardArray[0].l2 = -1;
boardArray[0].l3 = 1;
boardArray[0].l4 = 7;
boardArray[0].l5 = -1;
boardArray[0].l6 = -1;
boardArray[1].l1 = -1;
boardArray[1].l2 = 2;
boardArray[1].l3 = 9;
boardArray[1].l4 = 8;
boardArray[1].l5 = 7;
boardArray[1].l6 = 0;
boardArray[2].l1 = -1;
boardArray[2].l2 = -1;
boardArray[2].l3 = 3;
boardArray[2].l4 = 9;
boardArray[2].l5 = 1;
boardArray[2].l6 = -1;
boardArray[3].l1 = -1;
boardArray[3].l2 = 4;
boardArray[3].l3 = 11;
boardArray[3].l4 = 10;
boardArray[3].l5 = 9;
boardArray[3].l6 = 2;
boardArray[4].l1 = -1;
boardArray[4].l2 = -1;
boardArray[4].l3 = 5;
boardArray[4].l4 = 11;
boardArray[4].l5 = 3;
boardArray[4].l6 = -1;
boardArray[5].l1 = -1;
boardArray[5].l2 = 6;
boardArray[5].l3 = 13;
boardArray[5].l4 = 12;
boardArray[5].l5 = 11;
boardArray[5].l6 = 4;
boardArray[6].l1 = -1;
boardArray[6].l2 = -1;
boardArray[6].l3 = -1;
boardArray[6].l4 = 13;
boardArray[6].l5 = 5;
boardArray[6].l6 = -1;
boardArray[7].l1 = 0;
boardArray[7].l2 = 1;
boardArray[7].l3 = 8;
boardArray[7].l4 = 14;
boardArray[7].l5 = -1;
boardArray[7].l6 = -1;
boardArray[8].l1 = 1;
boardArray[8].l2 = 9;
boardArray[8].l3 = 16;
boardArray[8].l4 = 15;
boardArray[8].l5 = 14;
boardArray[8].l6 = 7;
boardArray[9].l1 = 2;
boardArray[9].l2 = 3;
boardArray[9].l3 = 10;
boardArray[9].l4 = 16;
boardArray[9].l5 = 8;
boardArray[9].l6 = 1;
boardArray[10].l1 = 3;
boardArray[10].l2 = 11;
boardArray[10].l3 = 18;
boardArray[10].l4 = 17;
boardArray[10].l5 = 16;
boardArray[10].l6 = 9;
boardArray[11].l1 = 4;
boardArray[11].l2 = 5;
boardArray[11].l3 = 12;
boardArray[11].l4 = 18;
boardArray[11].l5 = 10;
boardArray[11].l6 = 3;
boardArray[12].l1 = 5;
boardArray[12].l2 = 13;
boardArray[12].l3 = 20;
boardArray[12].l4 = 19;
boardArray[12].l5 = 18;
boardArray[12].l6 = 11;
boardArray[13].l1 = 6;
boardArray[13].l2 = -1;
boardArray[13].l3 = -1;
boardArray[13].l4 = 20;
boardArray[13].l5 = 12;
boardArray[13].l6 = 5;
boardArray[14].l1 = 7;
boardArray[14].l2 = 8;
boardArray[14].l3 = 15;
boardArray[14].l4 = 21;
boardArray[14].l5 = -1;
boardArray[14].l6 = -1;
boardArray[15].l1 = 8;
boardArray[15].l2 = 16;
boardArray[15].l3 = 23;
boardArray[15].l4 = 22;
boardArray[15].l5 = 21;
boardArray[15].l6 = 14;
boardArray[16].l1 = 9;
boardArray[16].l2 = 10;
boardArray[16].l3 = 17;
boardArray[16].l4 = 23;
boardArray[16].l5 = 15;
boardArray[16].l6 = 8;
boardArray[17].l1 = 10;
boardArray[17].l2 = 18;
boardArray[17].l3 = 25;
boardArray[17].l4 = 24;
boardArray[17].l5 = 23;
boardArray[17].l6 = 16;
boardArray[18].l1 = 11;
boardArray[18].l2 = 12;
boardArray[18].l3 = 19;
boardArray[18].l4 = 25;
boardArray[18].l5 = 17;
boardArray[18].l6 = 10;
boardArray[19].l1 = 12;
boardArray[19].l2 = 20;
boardArray[19].l3 = 27;
boardArray[19].l4 = 26;
boardArray[19].l5 = 25;
boardArray[19].l6 = 18;
boardArray[20].l1 = 13;
boardArray[20].l2 = -1;
boardArray[20].l3 = -1;
boardArray[20].l4 = 27;
boardArray[20].l5 = 19;
boardArray[20].l6 = 12;
boardArray[21].l1 = 14;
boardArray[21].l2 = 15;
boardArray[21].l3 = 22;
boardArray[21].l4 = 28;
boardArray[21].l5 = -1;
boardArray[21].l6 = -1;
boardArray[22].l1 = 15;
boardArray[22].l2 = 23;
boardArray[22].l3 = 30;
boardArray[22].l4 = 29;
boardArray[22].l5 = 28;
boardArray[22].l6 = 21;
boardArray[23].l1 = 16;
boardArray[23].l2 = 17;
boardArray[23].l3 = 24;
boardArray[23].l4 = 30;
boardArray[23].l5 = 22;
boardArray[23].l6 = 15;
boardArray[24].l1 = 17;
boardArray[24].l2 = 25;
boardArray[24].l3 = 32;
boardArray[24].l4 = 31;
boardArray[24].l5 = 30;
boardArray[24].l6 = 23;
boardArray[25].l1 = 18;
boardArray[25].l2 = 19;
boardArray[25].l3 = 26;
boardArray[25].l4 = 32;
boardArray[25].l5 = 24;
boardArray[25].l6 = 17;
boardArray[26].l1 = 19;
boardArray[26].l2 = 27;
boardArray[26].l3 = 34;
boardArray[26].l4 = 33;
boardArray[26].l5 = 32;
boardArray[26].l6 = 25;
boardArray[27].l1 = 20;
boardArray[27].l2 = -1;
boardArray[27].l3 = -1;
boardArray[27].l4 = 34;
boardArray[27].l5 = 26;
boardArray[27].l6 = 19;
boardArray[28].l1 = 21;
boardArray[28].l2 = 22;
boardArray[28].l3 = 29;
boardArray[28].l4 = 35;
boardArray[28].l5 = -1;
boardArray[28].l6 = -1;
boardArray[29].l1 = 22;
boardArray[29].l2 = 30;
boardArray[29].l3 = 37;
boardArray[29].l4 = 36;
boardArray[29].l5 = 35;
boardArray[29].l6 = 28;
boardArray[30].l1 = 23;
boardArray[30].l2 = 24;
boardArray[30].l3 = 31;
boardArray[30].l4 = 37;
boardArray[30].l5 = 29;
boardArray[30].l6 = 22;
boardArray[31].l1 = 24;
boardArray[31].l2 = 32;
boardArray[31].l3 = 39;
boardArray[31].l4 = 38;
boardArray[31].l5 = 37;
boardArray[31].l6 = 30;
boardArray[32].l1 = 25;
boardArray[32].l2 = 26;
boardArray[32].l3 = 33;
boardArray[32].l4 = 39;
boardArray[32].l5 = 31;
boardArray[32].l6 = 24;
boardArray[33].l1 = 26;
boardArray[33].l2 = 34;
boardArray[33].l3 = 41;
boardArray[33].l4 = 40;
boardArray[33].l5 = 39;
boardArray[33].l6 = 32;
boardArray[34].l1 = 27;
boardArray[34].l2 = -1;
boardArray[34].l3 = -1;
boardArray[34].l4 = 41;
boardArray[34].l5 = 33;
boardArray[34].l6 = 26;
boardArray[35].l1 = 28;
boardArray[35].l2 = 29;
boardArray[35].l3 = 36;
boardArray[35].l4 = 42;
boardArray[35].l5 = -1;
boardArray[35].l6 = -1;
boardArray[36].l1 = 29;
boardArray[36].l2 = 37;
boardArray[36].l3 = 43;
boardArray[36].l4 = -1;
boardArray[36].l5 = 42;
boardArray[36].l6 = 35;
boardArray[37].l1 = 30;
boardArray[37].l2 = 31;
boardArray[37].l3 = 38;
boardArray[37].l4 = 43;
boardArray[37].l5 = 36;
boardArray[37].l6 = 29;
boardArray[38].l1 = 31;
boardArray[38].l2 = 39;
boardArray[38].l3 = 44;
boardArray[38].l4 = -1;
boardArray[38].l5 = 43;
boardArray[38].l6 = 37;
boardArray[39].l1 = 32;
boardArray[39].l2 = 33;
boardArray[39].l3 = 40;
boardArray[39].l4 = 44;
boardArray[39].l5 = 38;
boardArray[39].l6 = 31;
boardArray[40].l1 = 33;
boardArray[40].l2 = 41;
boardArray[40].l3 = 45;
boardArray[40].l4 = -1;
boardArray[40].l5 = 44;
boardArray[40].l6 = 39;
boardArray[41].l1 = 34;
boardArray[41].l2 = -1;
boardArray[41].l3 = -1;
boardArray[41].l4 = 45;
boardArray[41].l5 = 40;
boardArray[41].l6 = 33;
boardArray[42].l1 = 35;
boardArray[42].l2 = 36;
boardArray[42].l3 = -1;
boardArray[42].l4 = -1;
boardArray[42].l5 = -1;
boardArray[42].l6 = -1;
boardArray[43].l1 = 37;
boardArray[43].l2 = 38;
boardArray[43].l3 = -1;
boardArray[43].l4 = -1;
boardArray[43].l5 = -1;
boardArray[43].l6 = 36;
boardArray[44].l1 = 39;
boardArray[44].l2 = 40;
boardArray[44].l3 = -1;
boardArray[44].l4 = -1;
boardArray[44].l5 = -1;
boardArray[44].l6 = 38;
boardArray[45].l1 = 41;
boardArray[45].l2 = -1;
boardArray[45].l3 = -1;
boardArray[45].l4 = -1;
boardArray[45].l5 = -1;
boardArray[45].l6 = 40;
_local3 = 0;
while (_local3 < 46) {
boardArray[_local3].ID = _local3;
_local3++;
}
drum = new Array();
drumIndex = 0;
nDrum = 0;
startGame();
_root.jukeBoxMC.playInGameLoop();
}
function startGame() {
initTut();
if (_global.continueMode == false) {
stare = "startGameDelay";
} else {
delayCounter = 0;
stare = "restoreGameDelay";
}
}
function initTut() {
tutLine = randRange(0, 2);
tutArray[0][0] = 8;
tutArray[0][1] = 16;
tutArray[0][2] = 17;
tutArray[0][3] = 31;
tutArray[0][4] = 25;
tutArray[0][5] = 7;
tutArray[1][0] = 35;
tutArray[1][1] = 29;
tutArray[1][2] = 30;
tutArray[1][3] = 18;
tutArray[1][4] = 24;
tutArray[1][5] = 24;
tutArray[2][0] = 43;
tutArray[2][1] = 37;
tutArray[2][2] = 30;
tutArray[2][3] = 7;
tutArray[2][4] = 23;
tutArray[2][5] = 23;
tutMC.arrowMC._x = (hexBoard._x + boardArray[tutArray[tutLine][3]]._x) + 30;
tutMC.arrowMC._y = (hexBoard._y + boardArray[tutArray[tutLine][3]]._y) - 30;
}
function addTutPieces() {
var _local3;
_local3 = tutArray[tutLine][startPiecesNumber];
pieceArray[nPieces] = attachMovie("pieceMC", "pieceMC" + String(pieceID), getNextHighestDepth(), {_x:hexBoard._x + boardArray[_local3]._x, _y:hexBoard._y + boardArray[_local3]._y, ID:pieceID, hex:_local3});
pieceArray[nPieces].pieceLocked = false;
pieceArray[nPieces].setType(tutLine + 1, -1, -1);
boardArray[_local3].piece = pieceID;
boardArray[_local3].pieceType = pieceArray[nPieces].type;
nPieces++;
pieceID++;
startPiecesNumber++;
_root.jukeBoxMC.playSound("addPieces");
nextShapePanelMC.playAnimation();
stare = "addPieceStartDelay";
}
function addFirstPieces(nr) {
var _local3;
var _local9;
if ((46 - nPieces) >= nr) {
_local9 = nr;
} else {
_local9 = 46 - nPieces;
}
var _local4 = 0;
while (_local4 < _local9) {
startPiecesNumber++;
_local3 = randRange(0, 45);
while (((boardArray[_local3].piece >= 0) || (_local3 == tutArray[tutLine][4])) || (_local3 == tutArray[tutLine][5])) {
_local3 = randRange(0, 45);
}
pieceArray[nPieces] = attachMovie("pieceMC", "pieceMC" + String(pieceID), getNextHighestDepth(), {_x:hexBoard._x + boardArray[_local3]._x, _y:hexBoard._y + boardArray[_local3]._y, ID:pieceID, hex:_local3});
pieceArray[nPieces].pieceLocked = false;
if (level <= 10) {
pieceArray[nPieces].setType(randRange(1, pieceTypeArray[level - 1]), -1, -1);
} else {
pieceArray[nPieces].setType(randRange(1, pieceTypeArray[8]), -1, -1);
}
boardArray[_local3].piece = pieceID;
boardArray[_local3].pieceType = pieceArray[nPieces].type;
nPieces++;
pieceID++;
_local4++;
}
_root.jukeBoxMC.playSound("addPieces");
nextShapePanelMC.playAnimation();
stare = "addPieceStartDelay";
}
function restoreGame() {
level = _global.saved.level;
score = _global.saved.score;
multiply = _global.saved.multiply;
totalLines = _global.saved.totalLines;
lockedCounter = _global.saved.lockedCounter;
pieceID = _global.saved.pieceID;
updateStats();
var _local3 = 0;
while (_local3 < _global.saved.nPieces) {
pieceArray[nPieces] = attachMovie("pieceMC", "pieceMC" + String(pieceID), getNextHighestDepth(), {_x:_global.saved.pieces[_local3].x, _y:_global.saved.pieces[_local3].y, ID:_global.saved.pieces[_local3].id, hex:_global.saved.pieces[_local3].hex});
pieceArray[nPieces].setType(_global.saved.pieces[_local3].type, _global.saved.pieces[_local3].d1, _global.saved.pieces[_local3].d2);
pieceArray[nPieces].pieceLocked = _global.saved.pieces[_local3].pieceLocked;
pieceArray[nPieces].lockedMC._visible = _global.saved.pieces[_local3].pieceLocked;
nPieces++;
_local3++;
}
_local3 = 0;
while (_local3 < 46) {
boardArray[_local3].piece = _global.saved.hexs[_local3].piece;
boardArray[_local3].pieceType = _global.saved.hexs[_local3].pieceType;
_local3++;
}
nextShapePanelMC.nextArray[0] = _global.saved.next1;
nextShapePanelMC.nextArray[1] = _global.saved.next2;
nextShapePanelMC.nextArray[2] = _global.saved.next3;
trace("1: " + nextShapePanelMC.nextArray[0]);
trace("2: " + nextShapePanelMC.nextArray[1]);
trace("3: " + nextShapePanelMC.nextArray[2]);
nextShapePanelMC.all1.gotoAndStop(nextShapePanelMC.nextArray[0]);
nextShapePanelMC.all2.gotoAndStop(nextShapePanelMC.nextArray[1]);
nextShapePanelMC.all3.gotoAndStop(nextShapePanelMC.nextArray[2]);
nextShapePanelMC.dual1Array[0] = _global.saved.dual11;
nextShapePanelMC.dual1Array[1] = _global.saved.dual12;
nextShapePanelMC.dual1Array[2] = _global.saved.dual13;
nextShapePanelMC.dual2Array[0] = _global.saved.dual21;
nextShapePanelMC.dual2Array[1] = _global.saved.dual22;
nextShapePanelMC.dual2Array[2] = _global.saved.dual23;
stare = "playerMove";
}
function randRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
function addPiece(nr) {
var _local3;
var _local5 = 0;
var _local11;
if ((46 - nPieces) >= nr) {
_local11 = nr;
} else {
_local11 = 46 - nPieces;
}
var _local6 = 0;
while (_local6 < _local11) {
_local3 = randRange(0, 45);
while (boardArray[_local3].piece >= 0) {
_local3 = randRange(0, 45);
}
pieceArray[nPieces] = attachMovie("pieceMC", "pieceMC" + String(pieceID), getNextHighestDepth(), {_x:hexBoard._x + boardArray[_local3]._x, _y:hexBoard._y + boardArray[_local3]._y, ID:pieceID, hex:_local3});
if (bonusPanelMC.nBonus > 0) {
var _local4 = new Object();
_local4 = bonusPanelMC.getBonus();
trace((((("Bonus:" + _local4.tip) + " dual1=") + _local4.dual1) + " dual2") + _local4.dual2);
pieceArray[nPieces].setType(_local4.tip + 10, _local4.dual1, _local4.dual2);
} else {
lockedCounter++;
pieceArray[nPieces].setType(nextShapePanelMC.nextArray[_local5], nextShapePanelMC.dual1Array[_local5], nextShapePanelMC.dual2Array[_local5]);
if (nextShapePanelMC.nextArray[_local5] < 10) {
if (level <= 10) {
if ((lockedCounter >= pieceLockedArray[level - 1]) && (pieceLockedArray[level - 1] > 0)) {
pieceArray[nPieces].pieceLocked = true;
pieceArray[nPieces].lockedMC._visible = true;
lockedCounter = 0;
}
} else if ((lockedCounter >= pieceLockedArray[8]) && (pieceLockedArray[level - 1] > 0)) {
pieceArray[nPieces].pieceLocked = true;
pieceArray[nPieces].lockedMC._visible = true;
lockedCounter = 0;
}
}
_local5++;
}
boardArray[_local3].piece = pieceID;
boardArray[_local3].pieceType = pieceArray[nPieces].type;
nPieces++;
pieceID++;
_local6++;
}
_root.jukeBoxMC.playSound("addPieces");
nextShapePanelMC.play();
delayCounter = 0;
stare = "delayAfterNew";
}
function addDualPiece() {
nextShapePanelMC.addDualPiece();
}
function addBonusPiece(nr) {
bonusPanelMC.addBonus(nr, pieceTypeArray[level - 1]);
bonusPanelMC.play();
}
function floodFill(nod) {
boardArray[nod].activate();
if ((boardArray[boardArray[nod].l1].piece == -1) && (!boardArray[boardArray[nod].l1].activateMC._visible)) {
floodFill(boardArray[nod].l1);
}
if ((boardArray[boardArray[nod].l2].piece == -1) && (!boardArray[boardArray[nod].l2].activateMC._visible)) {
floodFill(boardArray[nod].l2);
}
if ((boardArray[boardArray[nod].l3].piece == -1) && (!boardArray[boardArray[nod].l3].activateMC._visible)) {
floodFill(boardArray[nod].l3);
}
if ((boardArray[boardArray[nod].l4].piece == -1) && (!boardArray[boardArray[nod].l4].activateMC._visible)) {
floodFill(boardArray[nod].l4);
}
if ((boardArray[boardArray[nod].l5].piece == -1) && (!boardArray[boardArray[nod].l5].activateMC._visible)) {
floodFill(boardArray[nod].l5);
}
if ((boardArray[boardArray[nod].l6].piece == -1) && (!boardArray[boardArray[nod].l6].activateMC._visible)) {
floodFill(boardArray[nod].l6);
}
}
function deselectAll() {
var _local2 = 0;
while (_local2 < 46) {
boardArray[_local2].deactivate();
_local2++;
}
}
function eDrum(st, end) {
return(boardArray[end].activateMC._visible);
}
function hexValid(nextIndex) {
var _local3 = true;
if (nextIndex == -1) {
_local3 = false;
}
if (boardArray[nextIndex].piece >= 0) {
_local3 = false;
}
var _local2 = 0;
while (_local2 < nDrum) {
if (drum[_local2] == nextIndex) {
_local3 = false;
break;
}
_local2++;
}
return(_local3);
}
function getDistance(i1, i2) {
var _local5 = hexBoard._x + boardArray[i1]._x;
var _local3 = hexBoard._y + boardArray[i1]._y;
var _local4 = hexBoard._x + boardArray[i2]._x;
var _local2 = hexBoard._y + boardArray[i2]._y;
return(Math.sqrt(((_local4 - _local5) * (_local4 - _local5)) + ((_local2 - _local3) * (_local2 - _local3))));
}
function gasesteDrum(ind) {
drum[nDrum] = ind;
nDrum++;
if (drum[nDrum - 1] == endHex) {
return(undefined);
}
var _local3 = new Array();
_local3 = [];
if (hexValid(boardArray[ind].l1)) {
_local3.push({ix:boardArray[ind].l1, d:getDistance(endHex, boardArray[ind].l1)});
}
if (hexValid(boardArray[ind].l2)) {
_local3.push({ix:boardArray[ind].l2, d:getDistance(endHex, boardArray[ind].l2)});
}
if (hexValid(boardArray[ind].l3)) {
_local3.push({ix:boardArray[ind].l3, d:getDistance(endHex, boardArray[ind].l3)});
}
if (hexValid(boardArray[ind].l4)) {
_local3.push({ix:boardArray[ind].l4, d:getDistance(endHex, boardArray[ind].l4)});
}
if (hexValid(boardArray[ind].l5)) {
_local3.push({ix:boardArray[ind].l5, d:getDistance(endHex, boardArray[ind].l5)});
}
if (hexValid(boardArray[ind].l6)) {
_local3.push({ix:boardArray[ind].l6, d:getDistance(endHex, boardArray[ind].l6)});
}
_local3.sortOn(["d"], Array.NUMERIC);
var _local2 = 0;
while (_local2 < _local3.length) {
gasesteDrum(_local3[_local2].ix);
if (drum[nDrum - 1] == endHex) {
break;
}
_local2++;
}
if (drum[nDrum - 1] != endHex) {
nDrum--;
}
}
function gasesteDemoDrum(ind) {
drum[nDrum] = ind;
nDrum++;
if (drum[nDrum - 1] == demoEnd) {
return(undefined);
}
var _local3 = new Array();
_local3 = [];
if (hexValid(boardArray[ind].l1)) {
_local3.push({ix:boardArray[ind].l1, d:getDistance(demoEnd, boardArray[ind].l1)});
}
if (hexValid(boardArray[ind].l2)) {
_local3.push({ix:boardArray[ind].l2, d:getDistance(demoEnd, boardArray[ind].l2)});
}
if (hexValid(boardArray[ind].l3)) {
_local3.push({ix:boardArray[ind].l3, d:getDistance(demoEnd, boardArray[ind].l3)});
}
if (hexValid(boardArray[ind].l4)) {
_local3.push({ix:boardArray[ind].l4, d:getDistance(demoEnd, boardArray[ind].l4)});
}
if (hexValid(boardArray[ind].l5)) {
_local3.push({ix:boardArray[ind].l5, d:getDistance(demoEnd, boardArray[ind].l5)});
}
if (hexValid(boardArray[ind].l6)) {
_local3.push({ix:boardArray[ind].l6, d:getDistance(demoEnd, boardArray[ind].l6)});
}
_local3.sortOn(["d"], Array.NUMERIC);
var _local2 = 0;
while (_local2 < _local3.length) {
gasesteDemoDrum(_local3[_local2].ix);
if (drum[nDrum - 1] == demoEnd) {
break;
}
_local2++;
}
if (drum[nDrum - 1] != demoEnd) {
nDrum--;
}
}
function eLink(h1, h2) {
if (((boardArray[h1].l1 == h2) || (boardArray[h1].l2 == h2)) || (boardArray[h1].l3 == h2)) {
return(true);
}
if (((boardArray[h1].l4 == h2) || (boardArray[h1].l5 == h2)) || (boardArray[h1].l6 == h2)) {
return(true);
}
return(false);
}
function normalizeazaDrum() {
var _local5 = true;
while (_local5) {
_local5 = false;
var _local4 = 0;
while (_local4 < (nDrum - 1)) {
var _local2 = nDrum - 1;
while (_local2 > (_local4 + 1)) {
if (eLink(drum[_local4], drum[_local2])) {
_local5 = true;
var _local3 = _local2;
while (_local3 < nDrum) {
drum[((_local4 + _local3) - _local2) + 1] = drum[_local3];
_local3++;
}
nDrum = nDrum - ((_local2 - _local4) - 1);
trace("normalizat ... ... ... ... ...");
break;
}
_local2--;
}
if (_local5) {
break;
}
_local4++;
}
}
}
function mouseClickListener(index) {
if (stare != "playerMove") {
return(undefined);
}
if (boardArray[index].piece >= 0) {
if (startHex == index) {
deselectAll();
demoStart = -1;
demoEnd = -1;
startHex = -1;
endHex = -1;
clearHexs();
pieceArray[startPieceIndex].deselectPiece();
_root.jukeBoxMC.playSound("deselectPiece");
return(undefined);
}
var _local5;
var _local3 = 0;
while (_local3 < nPieces) {
if (pieceArray[_local3].ID == boardArray[index].piece) {
_local5 = _local3;
break;
}
_local3++;
}
if (pieceArray[_local5].pieceLocked) {
_root.jukeBoxMC.playSound("selectBadPiece");
return(undefined);
}
if (startHex != -1) {
pieceArray[startPieceIndex].deselectPiece();
}
demoStart = index;
startHex = index;
deselectAll();
floodFill(index);
if (tutMC._visible) {
if (index == tutArray[tutLine][3]) {
tutMC.arrowMC._x = (hexBoard._x + boardArray[tutArray[tutLine][4]]._x) + 30;
tutMC.arrowMC._y = (hexBoard._y + boardArray[tutArray[tutLine][4]]._y) - 30;
} else {
tutMC._visible = false;
}
}
_local3 = 0;
while (_local3 < nPieces) {
if (pieceArray[_local3].ID == boardArray[index].piece) {
startPieceIndex = _local3;
break;
}
_local3++;
}
pieceArray[startPieceIndex].selectPiece();
_root.jukeBoxMC.playSound("selectGoodPiece");
return(undefined);
}
if ((startHex >= 0) && (endHex == -1)) {
if (eDrum(startHex, index)) {
endHex = index;
deselectAll();
nDrum = 0;
drumIndex = 0;
var _local7 = getTimer();
gasesteDrum(startHex);
var _local6 = getTimer();
trace(("cautarea a durat:" + (_local6 - _local7)) + " mls.................................................");
if (nDrum > 0) {
normalizeazaDrum();
pieceArray[startPieceIndex].deselectPiece();
stare = "moving";
tutMC._visible = false;
} else {
endHex = -1;
}
return(undefined);
}
_root.jukeBoxMC.playSound("selectBadPiece");
}
}
function setHexToPiece(pID, hexNr) {
var _local2 = 0;
while (_local2 < nPieces) {
if (pieceArray[_local2].ID == pID) {
trace("found pieceID and changed the hex for that piece............................");
pieceArray[_local2].hex = hexNr;
break;
}
_local2++;
}
}
function movePiece() {
if (nDrum == 0) {
drum = [];
stare = "checkBoard";
return(undefined);
}
if ((drumIndex + 1) == nDrum) {
boardArray[endHex].piece = boardArray[startHex].piece;
boardArray[endHex].pieceType = boardArray[startHex].pieceType;
setHexToPiece(boardArray[endHex].piece, endHex);
boardArray[startHex].piece = -1;
boardArray[startHex].pieceType = -1;
nDrum = 0;
drum = [];
stare = "checkBoardAfterMove";
startHex = -1;
endHex = -1;
demoStart = -1;
demoEnd = -1;
drum = [];
nDrum = 1000;
clearHexs();
return(undefined);
}
if ((Math.abs(pieceArray[startPieceIndex]._x - (hexBoard._x + boardArray[drum[drumIndex + 1]]._x)) > 18) || (Math.abs(pieceArray[startPieceIndex]._y - (hexBoard._y + boardArray[drum[drumIndex + 1]]._y)) > 18)) {
pieceArray[startPieceIndex]._x = pieceArray[startPieceIndex]._x + ((boardArray[drum[drumIndex + 1]]._x - boardArray[drum[drumIndex]]._x) / 3.5);
pieceArray[startPieceIndex]._y = pieceArray[startPieceIndex]._y + ((boardArray[drum[drumIndex + 1]]._y - boardArray[drum[drumIndex]]._y) / 3.5);
} else {
pieceArray[startPieceIndex]._x = hexBoard._x + boardArray[drum[drumIndex + 1]]._x;
pieceArray[startPieceIndex]._y = hexBoard._y + boardArray[drum[drumIndex + 1]]._y;
drumIndex++;
if ((drumIndex + 1) != nDrum) {
pieceArray[startPieceIndex]._x = pieceArray[startPieceIndex]._x + ((boardArray[drum[drumIndex + 1]]._x - boardArray[drum[drumIndex]]._x) / 3.5);
pieceArray[startPieceIndex]._y = pieceArray[startPieceIndex]._y + ((boardArray[drum[drumIndex + 1]]._y - boardArray[drum[drumIndex]]._y) / 3.5);
}
}
}
function removePiece(pID) {
var _local2 = 0;
_local2 = 0;
while (_local2 < nPieces) {
if (pieceArray[_local2].ID == pID) {
pieceArray[_local2].removeMovieClip();
break;
}
_local2++;
}
if (_local2 < nPieces) {
while (_local2 < (nPieces - 1)) {
pieceArray[_local2] = pieceArray[_local2 + 1];
_local2++;
}
pieceArray[nPieces - 1] = null;
nPieces--;
}
}
function getPieceValueInLine(lineLength) {
switch (lineLength) {
case 4 :
return(100);
case 5 :
return(200);
case 6 :
return(500);
case 7 :
return(2000);
}
}
function getDual(id, dd) {
var _local2 = 0;
while (_local2 < nPieces) {
if (pieceArray[_local2].ID == id) {
if (dd == 1) {
return(pieceArray[_local2].dual1);
}
if (dd == 2) {
return(pieceArray[_local2].dual2);
}
break;
}
_local2++;
}
}
function compatible(p1, p2, index1, index2) {
if ((p1 == p2) && (p1 != -1)) {
return(true);
}
if (((p1 == 11) && (p2 != -1)) || ((p2 == 11) && (p1 != -1))) {
return(true);
}
if (((p1 == 12) && (p2 != -1)) || ((p2 == 12) && (p1 != -1))) {
return(true);
}
if (((p1 == 13) && (p2 != -1)) || ((p2 == 13) && (p1 != -1))) {
return(true);
}
if ((p1 == 14) && (p2 == 14)) {
var _local6 = getDual(boardArray[index1].piece, 1);
var _local9 = getDual(boardArray[index1].piece, 2);
var _local8 = getDual(boardArray[index2].piece, 1);
var _local7 = getDual(boardArray[index2].piece, 2);
if ((((_local6 == _local8) || (_local6 == _local7)) || (_local9 == _local8)) || (_local9 == _local7)) {
return(true);
}
return(false);
}
if (p1 == 14) {
var _local6 = getDual(boardArray[index1].piece, 1);
var _local9 = getDual(boardArray[index1].piece, 2);
if ((_local6 == p2) || (_local9 == p2)) {
return(true);
}
return(false);
}
if (p2 == 14) {
var _local8 = getDual(boardArray[index2].piece, 1);
var _local7 = getDual(boardArray[index2].piece, 2);
if ((_local8 == p1) || (_local7 == p1)) {
return(true);
}
return(false);
}
return(false);
}
function checkForKey(x) {
trace("CHECKING FOR Key");
var _local5 = false;
var _local3 = 0;
while (_local3 < x.length) {
if (boardArray[x[_local3]].pieceType == 13) {
_local5 = true;
break;
}
_local3++;
}
if (!_local5) {
return(undefined);
}
trace("gasit cheie......");
_root.jukeBoxMC.playSound("useKey");
_local3 = 0;
while (_local3 < nPieces) {
pieceArray[_local3].unlock();
_local3++;
}
}
function checkForBomb(x) {
trace("CHECKING FOR BOMB");
var _local6 = false;
var _local3 = 0;
while (_local3 < x.length) {
if (boardArray[x[_local3]].pieceType == 12) {
_local6 = true;
break;
}
_local3++;
}
if (!_local6) {
return(undefined);
}
trace("gasit bomba......");
var _local5 = -1;
_local3 = 0;
while (_local3 < x.length) {
if ((boardArray[x[_local3]].pieceType > 0) && (boardArray[x[_local3]].pieceType < 10)) {
_local5 = boardArray[x[_local3]].pieceType;
break;
}
_local3++;
}
_root.jukeBoxMC.playSound("bombExplode");
trace("piesa bombardata=" + _local5);
_local3 = 0;
while (_local3 < nPieces) {
if (pieceArray[_local3].type == _local5) {
trace("Gasit alta piesa de bombardat. valoarea =" + pieceArray[_local3].valoare);
if (pieceArray[_local3].valoare < 0) {
pieceArray[_local3].valoare = 25;
deEliminat.push(pieceArray[_local3].hex);
trace("adaugat in vectorul deEliminat Hexul:" + pieceArray[_local3].hex);
trace((("piesa din hex:" + boardArray[pieceArray[_local3].hex].piece) + " Tip:") + boardArray[pieceArray[_local3].hex].pieceType);
}
}
_local3++;
}
}
function in_row(v) {
var _local5 = 0;
while (_local5 < (v.length - 1)) {
var _local4 = _local5 + 1;
while (_local4 < v.length) {
if (compatible(boardArray[v[_local5]].pieceType, boardArray[v[_local4]].pieceType, v[_local5], v[_local4]) == false) {
return(false);
}
_local4++;
}
_local5++;
}
trace("found one line....");
_local5 = 0;
while (_local5 < v.length) {
deEliminat.push(v[_local5]);
boardArray[v[_local5]].stabilesteVloareaPiesei(getPieceValueInLine(v.length));
_local5++;
}
if (v.length >= 5) {
addDualPiece();
}
if (v.length >= 6) {
addBonusPiece(v.length - 5);
}
checkForBomb(v);
checkForKey(v);
switch (v.length) {
case 4 :
_root.jukeBoxMC.playSound("4_line");
break;
case 5 :
_root.jukeBoxMC.playSound("5_line");
break;
case 6 :
_root.jukeBoxMC.playSound("6_line");
break;
case 7 :
_root.jukeBoxMC.playSound("7_line");
}
return(true);
}
function checkRow(v) {
if (v.length == 5) {
if (in_row([v[0], v[1], v[2], v[3], v[4]])) {
return(undefined);
}
if (in_row([v[0], v[1], v[2], v[3]])) {
return(undefined);
}
if (in_row([v[1], v[2], v[3], v[4]])) {
return(undefined);
}
return(undefined);
}
if (v.length == 6) {
if (in_row([v[0], v[1], v[2], v[3], v[4], v[5]])) {
return(undefined);
}
if (in_row([v[0], v[1], v[2], v[3], v[4]])) {
return(undefined);
}
if (in_row([v[1], v[2], v[3], v[4], v[5]])) {
return(undefined);
}
if (in_row([v[0], v[1], v[2], v[3]])) {
return(undefined);
}
if (in_row([v[1], v[2], v[3], v[4]])) {
return(undefined);
}
if (in_row([v[2], v[3], v[4], v[5]])) {
return(undefined);
}
return(undefined);
}
if (v.length == 7) {
if (in_row([v[0], v[1], v[2], v[3], v[4], v[5], v[6]])) {
return(undefined);
}
if (in_row([v[0], v[1], v[2], v[3], v[4], v[5]])) {
return(undefined);
}
if (in_row([v[1], v[2], v[3], v[4], v[5], v[6]])) {
return(undefined);
}
if (in_row([v[0], v[1], v[2], v[3], v[4]])) {
return(undefined);
}
if (in_row([v[1], v[2], v[3], v[4], v[5]])) {
return(undefined);
}
if (in_row([v[2], v[3], v[4], v[5], v[6]])) {
return(undefined);
}
if (in_row([v[0], v[1], v[2], v[3]])) {
return(undefined);
}
if (in_row([v[1], v[2], v[3], v[4]])) {
return(undefined);
}
if (in_row([v[2], v[3], v[4], v[5]])) {
return(undefined);
}
if (in_row([v[3], v[4], v[5], v[6]])) {
return(undefined);
}
return(undefined);
}
}
function checkBoard(newStare) {
var _local5 = 0;
var _local9;
var _local8 = new Array();
var _local7 = new Array();
deEliminat = [];
checkRow([28, 29, 37, 38, 44]);
checkRow([21, 22, 30, 31, 39, 40, 45]);
checkRow([14, 15, 23, 24, 32, 33, 41]);
checkRow([7, 8, 16, 17, 25, 26, 34]);
checkRow([0, 1, 9, 10, 18, 19, 27]);
checkRow([2, 3, 11, 12, 20]);
checkRow([14, 8, 9, 3, 4]);
checkRow([21, 15, 16, 10, 11, 5, 6]);
checkRow([28, 22, 23, 17, 18, 12, 13]);
checkRow([35, 29, 30, 24, 25, 19, 20]);
checkRow([42, 36, 37, 31, 32, 26, 27]);
checkRow([43, 38, 39, 33, 34]);
checkRow([0, 7, 14, 21, 28, 35, 42]);
checkRow([1, 8, 15, 22, 29, 36]);
checkRow([2, 9, 16, 23, 30, 37, 43]);
checkRow([3, 10, 17, 24, 31, 38]);
checkRow([4, 11, 18, 25, 32, 39, 44]);
checkRow([5, 12, 19, 26, 33, 40]);
checkRow([6, 13, 20, 27, 34, 41, 45]);
_local5 = 0;
var _local4 = 0;
while (_local4 < deEliminat.length) {
if (boardArray[deEliminat[_local4]].getPieceValue() > 0) {
_local5 = _local5 + boardArray[deEliminat[_local4]].getPieceValue();
}
boardArray[deEliminat[_local4]].eliminaPiesa();
_local4++;
}
if (deEliminat.length > 0) {
stare = "delayAfterLine";
delayCounter = 0;
totalLines++;
score = score + (_local5 * multiply);
multiply++;
} else {
if ((newStare == "playerMove") && (_global.autoSave)) {
_global.saved.saveGame();
}
stare = newStare;
multiply = 1;
}
if (exitAfterNew) {
if (_global.autoSave) {
_global.saved.saveGame();
}
_root.link = "mainMenu";
_root.fader.gotoAndPlay(2);
exitAfterNew = false;
_global.soundSant = true;
}
updateStats();
}
function addPieceStartGameDelay() {
delayCounter++;
if (delayCounter > 8) {
stare = "addPiecesStartGame";
}
}
function restoreGameDelay() {
delayCounter++;
if (delayCounter > 2) {
restoreGame();
}
}
function startGameDelay() {
delayCounter++;
if (delayCounter > 20) {
stare = "addPiecesStartGame";
}
}
function delayStateNew() {
delayCounter++;
if (delayCounter > 8) {
stare = "checkBoardAfterNew";
}
}
function delayStateLine() {
delayCounter++;
if (delayCounter > 12) {
if (nPieces > 1) {
stare = "playerMove";
} else {
stare = "newPieces";
}
}
}
function levelUp() {
var _local3;
level++;
totalLines = 0;
lockedCounter = 0;
if (level <= 10) {
_local3 = (level * 1000) * multiply;
} else {
_local3 = 20000;
}
score = score + _local3;
levelClearAnimation.swapDepths(getNextHighestDepth());
levelClearAnimation._x = 200;
levelClearAnimation.holderMC.levelBonusField.text = String(_local3);
levelClearAnimation.holderMC.levelText.text = String(level);
levelClearAnimation.play();
_root.jukeBoxMC.playSound("nextLevel");
updateStats();
}
function updateStats() {
scoreField.text = String(score);
multiplyField.text = String(multiply) + "X";
if (level < 10) {
linesField.text = String(levelClearArray[level - 1] - totalLines);
levelField.text = String(level);
} else {
linesField.text = String(levelClearArray[8] - totalLines);
levelField.text = String(level);
}
if (Number(linesField.text) <= 0) {
levelUp();
}
}
function explodeAll() {
var _local3 = false;
trace("explode all function");
var _local2 = 0;
while (_local2 < nPieces) {
if (pieceArray[_local2]._currentframe != 25) {
trace("exploding 1 piece");
pieceArray[_local2].gotoAndStop("explode");
delayCounter = 0;
_local3 = true;
break;
}
_local2++;
}
}
function explodeDelay() {
explodeAll();
delayCounter++;
if (delayCounter > 30) {
stare = "gameOver";
}
}
function getNewDemoEnd() {
var _local3 = 0;
while (_local3 < 46) {
if (boardArray[_local3].hitTest(_root._xmouse, _root._ymouse, true)) {
return(_local3);
}
_local3++;
}
return(-1);
}
function clearHexs() {
var _local2 = 0;
while (_local2 < 46) {
boardArray[_local2].demoSelect._visible = false;
_local2++;
}
}
function selectDemoHexs() {
var _local2 = 0;
while (_local2 < nDrum) {
boardArray[drum[_local2]].demoSelect._visible = true;
_local2++;
}
}
function onEnterFrame() {
switch (stare) {
case "idle" :
break;
case "addPiecesStartGame" :
if (startPiecesNumber < 15) {
if (startPiecesNumber < 4) {
addTutPieces();
} else {
addFirstPieces(1);
}
} else {
stare = "delayAfterNew";
tutMC._visible = true;
tutMC.swapDepths(getNextHighestDepth());
}
break;
case "delayAfterNew" :
delayStateNew();
break;
case "delayAfterLine" :
delayStateLine();
break;
case "playerMove" :
if (nPieces >= 46) {
_root.jukeBoxMC.stopInGameLoop();
_root.jukeBoxMC.playSound("game_over");
_global.playerLevel = level;
delayCounter = 0;
stare = "explodePiecesDelay";
}
if (demoStart != -1) {
var _local4 = getNewDemoEnd();
if (demoEnd != _local4) {
demoEnd = _local4;
clearHexs();
if (eDrum(demoStart, demoEnd)) {
nDrum = 0;
drumIndex = 0;
gasesteDemoDrum(demoStart);
if (nDrum > 0) {
normalizeazaDrum();
selectDemoHexs();
}
}
}
}
break;
case "moving" :
movePiece();
break;
case "checkBoardAfterMove" :
checkBoard("newPieces");
break;
case "checkBoardAfterNew" :
checkBoard("playerMove");
break;
case "newPieces" :
addPiece(3);
break;
case "explodePiecesDelay" :
explodeDelay();
break;
case "startGameDelay" :
startGameDelay();
break;
case "restoreGameDelay" :
restoreGameDelay();
break;
case "addPieceStartDelay" :
addPieceStartGameDelay();
break;
case "gameOver" :
_global.saved.deleteSavedGame();
_global.playerScore = score;
_root.link = "gameOver";
_root.fader.gotoAndPlay(2);
_global.soundSant = true;
stare = "idle";
}
}
var nPieces = 0;
var hexID = 0;
var pieceID = 0;
var startHex = -1;
var endHex = -1;
var startPieceIndex = -1;
var stare = "playerMove";
var exitAfterNew = false;
var delayCounter = 0;
var startPiecesNumber = 0;
var tutVisible = true;
var tutStat = 1;
var tutLine = 0;
}
Symbol 466 MovieClip [__Packages.pieceMC] Frame 0
class pieceMC extends MovieClip
{
var valueMC, selectMC, lockedTextMC, type, gotoAndStop, piesaMC, lockedMC, filters, _currentframe;
function pieceMC () {
super();
}
function onLoad() {
valueMC._visible = false;
selectMC._visible = false;
lockedTextMC._visible = false;
}
function setType(tip, d1, d2) {
type = tip;
dual1 = d1;
dual2 = d2;
gotoAndStop(tip);
if (tip == 14) {
var _local2 = "";
_local2 = "b" + String(dual1);
_local2 = _local2 + String(dual2);
piesaMC.gotoAndStop(_local2);
}
lockedMC._visible = false;
piesaMC._xscale = 10;
piesaMC._yscale = 10;
lockedMC._xscale = 10;
lockedMC._yscale = 10;
}
function randRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
function onRollOver() {
if (pieceLocked) {
lockedTextMC._visible = true;
}
if (pieceLocked) {
return(undefined);
}
var _local3 = new flash.filters.GlowFilter(16777215, 0.4, 6, 6, 5, 3, false, false);
var _local2 = new Array();
_local2.push(_local3);
filters = _local2;
}
function onRollOut() {
lockedTextMC._visible = false;
if (pieceLocked) {
return(undefined);
}
filters = [];
}
function selectPiece() {
pieceSelected = true;
dir = 1;
}
function deselectPiece() {
pieceSelected = false;
piesaMC._xscale = 100;
piesaMC._yscale = 100;
}
function unlock() {
lockedMC.play();
pieceLocked = false;
}
function onEnterFrame() {
if (dead) {
valueMC.holderMC.valueField.text = String(valoare);
valueMC._visible = true;
if (valueMC._currentframe == 1) {
valueMC.play();
}
if (piesaMC._xscale < 130) {
piesaMC._xscale = piesaMC._xscale + 7;
piesaMC._yscale = piesaMC._yscale + 7;
lockedMC._xscale = lockedMC._xscale + 7;
lockedMC._yscale = lockedMC._yscale + 7;
} else if (_currentframe < 40) {
if (type < 10) {
(gotoAndStop(40 + type));// not popped
} else {
(gotoAndStop(40));// not popped
}
}
return(undefined);
}
if (pieceSelected) {
if (dir == 1) {
if (piesaMC._xscale < 120) {
piesaMC._xscale = piesaMC._xscale + 5;
piesaMC._yscale = piesaMC._yscale + 5;
} else {
dir = 0;
}
} else if (piesaMC._xscale > 80) {
piesaMC._xscale = piesaMC._xscale - 5;
piesaMC._yscale = piesaMC._yscale - 5;
} else {
dir = 1;
}
return(undefined);
}
if (piesaMC._xscale < 100) {
piesaMC._xscale = piesaMC._xscale + 15;
piesaMC._yscale = piesaMC._yscale + 15;
lockedMC._xscale = lockedMC._xscale + 15;
lockedMC._yscale = lockedMC._yscale + 15;
}
}
var dual1 = -1;
var dual2 = -1;
var hex = -1;
var dead = false;
var pieceLocked = false;
var valoare = -1;
var pieceSelected = false;
var dir = 1;
}
Symbol 467 MovieClip [__Packages.jukeboxMC] Frame 0
class jukeboxMC extends MovieClip
{
var sndArray;
function jukeboxMC () {
super();
}
function onLoad() {
sndArray = new Array();
sndArray[0] = new Sound();
sndArray[0].attachSound("select_good_piece.mp3");
sndArray[1] = new Sound();
sndArray[1].attachSound("next_level.mp3");
sndArray[10] = new Sound();
sndArray[10].attachSound("new_pieces.mp3");
sndArray[11] = new Sound();
sndArray[11].attachSound("four_line.mp3");
sndArray[12] = new Sound();
sndArray[12].attachSound("five_line.mp3");
sndArray[13] = new Sound();
sndArray[13].attachSound("six_line.mp3");
sndArray[14] = new Sound();
sndArray[14].attachSound("seven_line.mp3");
sndArray[15] = new Sound();
sndArray[15].attachSound("game_over.mp3");
sndArray[16] = new Sound();
sndArray[16].attachSound("select_bad_piece.mp3");
sndArray[17] = new Sound();
sndArray[17].attachSound("clickButton.mp3");
sndArray[18] = new Sound();
sndArray[18].attachSound("overButton.mp3");
sndArray[19] = new Sound();
sndArray[19].attachSound("deselectPiece.mp3");
sndArray[20] = new Sound();
sndArray[20].attachSound("bombExplode.mp3");
sndArray[23] = new Sound();
sndArray[23].attachSound("useKey.mp3");
sndArray[21] = new Sound();
sndArray[21].attachSound("menuLoop.mp3");
sndArray[22] = new Sound();
sndArray[22].attachSound("ingameLoop.mp3");
}
function stopMusic() {
trace("stoping music");
sndArray[21].stop();
sndArray[22].stop();
}
function stopSound() {
}
function playMainMenuLoop() {
if (!_global.saved.getMusic()) {
return(undefined);
}
sndArray[21].stop();
sndArray[22].stop();
sndArray[21].start(0, 9999);
}
function playInGameLoop() {
if (!_global.saved.getMusic()) {
return(undefined);
}
sndArray[21].stop();
sndArray[22].stop();
sndArray[22].start(0, 9999);
}
function stopInGameLoop() {
sndArray[22].stop();
}
function playSound(sunet) {
if (!_global.saved.getSound()) {
return(undefined);
}
switch (sunet) {
case "selectGoodPiece" :
sndArray[0].start();
break;
case "nextLevel" :
sndArray[1].start();
break;
case "addPieces" :
sndArray[10].start();
break;
case "4_line" :
sndArray[11].start();
break;
case "5_line" :
sndArray[12].start();
break;
case "6_line" :
sndArray[13].start();
break;
case "7_line" :
sndArray[14].start();
break;
case "game_over" :
sndArray[15].start();
trace("sound played");
break;
case "selectBadPiece" :
sndArray[16].start();
break;
case "mouseOver" :
sndArray[18].stop("overButton.mp3");
sndArray[18].start();
break;
case "mouseClick" :
sndArray[17].start();
break;
case "deselectPiece" :
sndArray[19].start();
break;
case "bombExplode" :
sndArray[20].start();
break;
case "useKey" :
sndArray[23].start();
}
}
}
Symbol 468 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 283 Button
on (release) {
_root.link = "logo2";
_root.fader.gotoAndPlay(2);
}
Instance of Symbol 277 MovieClip in Symbol 284 MovieClip Frame 1
on (release) {
getURL ("http://www.smileygamer.com/?gameref=2342", "_blank");
}
Symbol 284 MovieClip Frame 150
stop();
Symbol 287 MovieClip [jukeboxMC] Frame 1
#initclip 19
Object.registerClass("jukeboxMC", jukeboxMC);
#endinitclip
Symbol 293 MovieClip Frame 120
stop();
_root.link = "cpmstar";
_root.fader.play();
Symbol 299 Button
on (release) {
_root.gotoAndStop("mainMenu");
removeMovieClip(adBox);
}
Symbol 300 MovieClip Frame 1
var CPMStarContentSpotID = "413Q3093B5B3";
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + CPMStarContentSpotID);
Symbol 300 MovieClip Frame 150
stop();
Symbol 313 Button
on (release) {
getURL ("http://www.glowingeyegames.com", "_blank");
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 314 Button
on (release) {
_root.link = "game";
_global.continueMode = true;
_root.fader.gotoAndPlay(2);
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 315 Button
on (release) {
_root.link = "instruc";
_global.continueMode = false;
_root.fader.gotoAndPlay(2);
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 316 Button
on (release) {
_root.link = "highScores";
_root.fader.gotoAndPlay(2);
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 317 Button
on (release) {
_root.link = "mainInstruc";
_root.fader.gotoAndPlay(2);
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 318 Button
on (release) {
_root.link = "credits";
_root.fader.gotoAndPlay(2);
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 340 Button
on (release) {
getURL ("http://www.smileygamer.com/?gameref=2342", "_blank");
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 341 Button
on (release) {
getURL ("http://www.glowingeyegames.com/", "_blank");
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 351 Button
on (release) {
getURL ("http://www.smileygamer.com/freecontent.html?gameref=2342", "_blank");
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
var filter1 = (new flash.filters.GlowFilter(0, 0.99, 5, 5, 5, 3, false, false));
var filterArray1 = new Array();
filterArray1.push(filter1);
this.filters = filterArray1;
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 362 Button
on (release) {
_root.link = "game";
_root.fader.gotoAndPlay(2);
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 371 Button
on (release) {
_root.jukeBoxMC.playSound("mouseClick");
_root.inGameInstructionsMC._x = 1000;
_root.gameMC._x = 0;
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 382 Button
on (release) {
if (nameField.text != "") {
_global.saved.setPlayerName(nameField.text);
_global.submitScoreMode = true;
_root.link = "HighScores";
_root.fader.gotoAndPlay(2);
}
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 383 MovieClip Frame 1
function setSel() {
trace("selecting........................");
Selection.setSelection(nameField);
Selection.setSelection(0, 3);
}
Symbol 410 Button
on (release) {
Mouse.show();
mochi.MochiScores.showLeaderboard({boardID:"a0988b1dca181604", onClose:function () {
Mouse.hide();
}});
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}
Symbol 440 Button
on (release) {
_root.link = "mainMenu";
_root.fader.gotoAndPlay(2);
_root.jukeBoxMC.playSound("mouseClick");
}
on (rollOver) {
_root.jukeBoxMC.playSound("mouseOver");
}