Frame 1
function Loading() {
var _local3 = (0 + Number(seconds)) * 1000;
loadline._visible = true;
clearInterval(SSS);
Load = _root.getBytesLoaded();
Total = _root.getBytesTotal();
var _local4 = getTimer() - GlobalTime;
if (Load >= ((Total * _local4) / _local3)) {
Load = (Total * _local4) / _local3;
}
if (_global.language == "en") {
KB.text = ("Loading... (" + Math.round((100 * Load) / Total)) + "%)";
} else if (_global.language == "de") {
KB.text = ("Laden ... (" + Math.round((100 * Load) / Total)) + "%)";
} else if (_global.language == "es") {
KB.text = ("Cargando... (" + Math.round((100 * Load) / Total)) + "%)";
} else if (_global.language == "fr") {
KB.text = ("Chargement... (" + Math.round((100 * Load) / Total)) + "%)";
} else if (_global.language == "it") {
KB.text = ("Caricamento... (" + Math.round((100 * Load) / Total)) + "%)";
} else if (_global.language == "nl") {
KB.text = ("Laden... (" + Math.round((100 * Load) / Total)) + "%)";
} else if (_global.language == "pt") {
KB.text = ("Carregando... (" + Math.round((100 * Load) / Total)) + "%)";
} else if (_global.language == "sv") {
KB.text = ("Laddar... (" + Math.round((100 * Load) / Total)) + "%)";
}
if (Total <= Load) {
loadline._xscale = (100 * Load) / Total;
gotoAndStop (3);
} else {
loadline._xscale = (100 * Load) / Total;
SSS = setInterval(Loading, 50);
}
updateAfterEvent();
}
function initoptXML() {
var _local9 = this.firstChild;
var _local8 = _local9.firstChild;
seconds = _local8.firstChild.firstChild.toString();
nagtime = _local8.firstChild.nextSibling.firstChild.toString();
linklogo1 = _local8.firstChild.nextSibling.nextSibling.firstChild.toString();
linklogo2 = _local8.lastChild.firstChild.toString();
var _local10 = _local8.nextSibling;
var _local7 = _local10.childNodes;
j = 0;
while (j < 6) {
er = _local7[j].firstChild.toString();
_root["menubutton" + j] = er;
j++;
}
var _local11 = _local10.nextSibling;
var _local6 = _local11.childNodes;
j = 0;
while (j < _local6.length) {
er = _local6[j].firstChild.toString();
_root["hint" + j] = er;
j++;
}
var _local5 = 3;
var _local4 = _local9.childNodes;
downloadlink = _local4[_local5++].firstChild.toString();
if (_global.adUrl != undefined) {
downloadlink = adUrl;
}
savemode = _local4[_local5++].firstChild.toString();
menuTEXT = _local4[_local5++].firstChild.toString();
statisticsTEXT = _local4[_local5++].firstChild.toString();
charged = _local4[_local5++].firstChild.toString();
outoftime = _local4[_local5++].firstChild.toString();
nomoremoves = _local4[_local5++].firstChild.toString();
nolife = _local4[_local5++].firstChild.toString();
onelife = _local4[_local5++].firstChild.toString();
manylives = _local4[_local5++].firstChild.toString();
fast = _local4[_local5++].firstChild.toString();
normal = _local4[_local5++].firstChild.toString();
slow = _local4[_local5++].firstChild.toString();
texttiles = _local4[_local5++].firstChild.toString();
textmatches = _local4[_local5++].firstChild.toString();
textchain = _local4[_local5++].firstChild.toString();
texttime = _local4[_local5++].firstChild.toString();
textbonus = _local4[_local5++].firstChild.toString();
textscore = _local4[_local5++].firstChild.toString();
textseconds = _local4[_local5++].firstChild.toString();
nagdownload = _local4[_local5++].firstChild.toString();
nagmore = _local4[_local5++].firstChild.toString();
nagcontinue = _local4[_local5++].firstChild.toString();
nagrestart = _local4[_local5++].firstChild.toString();
textcontinue = _local4[_local5++].firstChild.toString();
texthelpclick = _local4[_local5++].firstChild.toString();
textgameover = _local4[_local5++].firstChild.toString();
nagtextnext = _local4[_local5++].firstChild.toString();
nagtextover = _local4[_local5++].firstChild.toString();
nagtextend = _local4[_local5++].firstChild.toString();
loadMovie (linklogo1, l1);
loadMovie (linklogo2, l2);
help = _local9.lastChild;
ahelp = help.childNodes;
j = 0;
while (j < ahelp.length) {
er = ahelp[j].firstChild.toString();
_root["helping" + j] = er;
j++;
}
}
function initcountXML() {
var _local7 = this.firstChild;
if (_local7 != undefined) {
loadbar._visible = true;
map = new Array();
var _local6 = _local7.childNodes;
i = 0;
while (i < _local6.length) {
var _local5 = new Array();
_local5.name = _local6[i].attributes.name;
_local5.Art = _local6[i].attributes.Art;
_local5.description = _local6[i].attributes.description;
var _local3 = _local6[i].childNodes;
j = 0;
while (j < _local3.length) {
var _local2 = new Array();
_local2.name = _local3[j].attributes.name;
_local2.description = _local3[j].attributes.description;
_local2.time = _local3[j].attributes.time;
_local2.SunInc = _local3[j].attributes.sun_inc4;
_local2.chips = _local3[j].attributes.chips.toString().split("");
_local2.art = _local3[j].attributes.artefact_begin;
var _local4 = _local3[j].childNodes;
k = 0;
while (k < _local4.length) {
aline = _local4[k].firstChild.toString().split("");
_local2[k] = aline;
k++;
}
_local5[j] = _local2;
j++;
}
map[i] = _local5;
i++;
}
GlobalTime = getTimer();
Loading();
} else {
KB.text = "Unable to init game";
}
}
function LoadMapXML() {
MAPP = new Array();
var _local9 = this.firstChild;
var _local8 = _local9.childNodes;
var _local5 = 0;
while (_local5 < _local8.length) {
var _local6 = new Array();
var _local7 = _local8[_local5].attributes.name;
_local6.name = _local7;
_local6.x = Number(_local8[_local5].attributes.x_t);
_local6.y = Number(_local8[_local5].attributes.y_t);
var _local4 = _local8[_local5].childNodes;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = {};
_local7 = _local4[_local2].attributes.name;
_local3.name = _local7;
_local3.x = _local4[_local2].attributes.x;
_local3.y = _local4[_local2].attributes.y;
_local3.size = _local4[_local2].attributes.size;
_local6[_local2] = _local3;
_local2++;
}
MAPP[_local5] = _local6;
_local5++;
}
}
function LoadARTXML() {
ART = new Array();
var _local8 = this.firstChild;
var _local7 = _local8.childNodes;
var _local5 = 0;
while (_local5 < _local7.length) {
var _local6 = new Array();
var _local4 = _local7[_local5].childNodes;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = {};
_local3.x = 0.65 * Number(_local4[_local2].attributes.x);
_local3.y = 390 - (0.65 * Number(_local4[_local2].attributes.y));
_local3.W = 0.65 * Number(_local4[_local2].attributes.width);
_local3.H = 0.65 * Number(_local4[_local2].attributes.height);
_local6[_local2] = _local3;
_local2++;
}
ART[_local5] = _local6;
_local5++;
}
}
function LoadXML() {
var _local1 = new XML();
_local1.load(mmap);
_local1.ignoreWhite = true;
_local1.onLoad = LoadMapXML;
var _local3 = new XML();
_local3.load(mart);
_local3.ignoreWhite = true;
_local3.onLoad = LoadARTXML;
var _local4 = new XML();
_local4.ignoreWhite = true;
_local4.load(opt);
_local4.onLoad = initoptXML;
var _local2 = new XML();
_local2.ignoreWhite = true;
_local2.load(cntr);
_local2.onLoad = initcountXML;
}
stop();
Stage.showMenu = false;
Stage.scaleMode = "noScale";
Stage.align = "CM";
fscommand ("trapallkeys", true);
loadline._visible = false;
loadbar._visible = false;
_global.country = "ES";
_global.language = "en";
if (Path == undefined) {
Path = "";
}
cntr = Path + "level.xml";
opt = Path + "option.xml";
mmap = "map.xml";
mart = "artefact.xml";
LoadXML();
this._lockroot = true;
oKey = {};
oKey.onKeyDown = function () {
if (Key.isDown(9)) {
} else if (Key.isDown(13)) {
} else if (Key.isDown(17)) {
}
};
Key.addListener(oKey);
_global.GameSwitch = false;
Frame 2
_root.gotoAndPlay(1);
Frame 3
function TextShow(Inside, Str, l, W, H, C, WT, HT, SC, EC) {
function Attach(STR) {
if (att) {
STR = STR.toUpperCase();
Inside.TEXT.attachMovie(STR + l, U, Inside.TEXT.getNextHighestDepth());
} else {
Inside.TEXT.createEmptyMovieClip(U, Inside.TEXT.getNextHighestDepth());
AttachLetter(Inside.TEXT[U], STR);
}
var mc = Inside.TEXT[U];
mc._x = X;
mc._y = Y;
if (eval ((String(Inside) + ".TEXT.") + U)._width != undefined) {
wid = eval ((String(Inside) + ".TEXT.") + U)._width;
X = X + (wid + W);
Len++;
}
}
function AttachLetter(InS, Str) {
InS.createTextField("TEXT", InS.getNextHighestDepth(), 0, -10, 0, 0);
InS.TEXT.multiline = true;
InS.TEXT.embedFonts = true;
InS.TEXT.autoSize = "left";
InS.TEXT.selectable = false;
var format = new TextFormat();
format.font = l;
format.size = WT;
format.bold = true;
format.color = HT;
format.align = "left";
format.leftMargin = 0;
format.rightMargin = 0;
InS.TEXT.text = Str;
InS.TEXT.setTextFormat(format);
if (InS.TEXT._width < 10) {
format.font = "GameFont";
InS.TEXT.text = Str;
InS.TEXT.setTextFormat(format);
}
if (l == "gradient") {
var Wi = InS.TEXT._width;
var He = InS.TEXT._height;
InS.createEmptyMovieClip("s", 100);
with (InS.s) {
colors = [SC, EC];
alphas = [100, 100];
ratios = [0, 255];
lineStyle(1, 0);
matrix = {matrixType:"box", x:0, y:0, w:Wi, h:He, r:(Math.PI/4)};
beginGradientFill("linear", colors, alphas, ratios, matrix);
moveTo(0, 0);
lineTo(0, He);
lineTo(Wi, He);
lineTo(Wi, 0);
lineTo(0, 0);
endFill();
}
InS.s._y = InS.s._y - 10;
InS.s.setMask(InS.TEXT);
}
}
if ((l == undefined) || (l == "t")) {
l = "GameFont";
W = -4;
WT = 16;
HT = 7353626 /* 0x70351A */;
}
l = l.toLowerCase();
Letter = 0;
var Lines = 0;
var Len = 0;
Str = Str.split("'").join("'");
Str = Str.split(""").join("\"");
var X = 0;
var Y = 0;
var L = 0;
var wid = 0;
var mc = Inside.attachMovie(Str.substr(0, 1).toUpperCase() + l, "AAA", Inside.getNextHighestDepth(), {_x:-1000});
var att = (mc._name != undefined);
mc.removeMovieClip();
Inside.TEXT.removeMovieClip();
Inside.TEXT.removeTextField();
Inside.createEmptyMovieClip("TEXT", Inside.getNextHighestDepth());
var i = 0;
while (i < Str.length) {
var j = Str.substr(i, 1);
if (j == "|") {
if (Len > Letter) {
Letter = Len;
}
Len = 0;
if (C == 1) {
X = X / 2;
var k = 0;
while (k < Str.length) {
eval (((String(Inside) + ".TEXT.t") + k) + L)._x = eval (((String(Inside) + ".TEXT.t") + k) + L)._x - X;
k++;
}
} else if (C == 2) {
var k = 0;
while (k < Str.length) {
eval (((String(Inside) + ".TEXT.t") + k) + L)._x = eval (((String(Inside) + ".TEXT.t") + k) + L)._x - X;
k++;
}
}
L++;
X = 0;
if ((H == 0) || (H == undefined)) {
H == 12;
}
Y = Y + H;
} else {
var U = (("t" + i) + L);
if ((j == " ") && (att)) {
if (eval (String(Inside) + ".TEXT.t00")._width > 0) {
X = X + ((eval (String(Inside) + ".TEXT.t00")._width * 3) / 4);
Len++;
}
} else {
Attach(String(j));
}
}
i++;
}
if (C == 1) {
X = X / 2;
var k = 0;
while (k < Str.length) {
eval (((String(Inside) + ".TEXT.t") + k) + L)._x = eval (((String(Inside) + ".TEXT.t") + k) + L)._x - X;
k++;
}
} else if (C == 2) {
var k = 0;
while (k < Str.length) {
eval (((String(Inside) + ".TEXT.t") + k) + L)._x = eval (((String(Inside) + ".TEXT.t") + k) + L)._x - X;
k++;
}
} else if (C == 3) {
X = X - (X / 3);
var k = 0;
while (k < Str.length) {
eval (((String(Inside) + ".TEXT.t") + k) + L)._x = eval (((String(Inside) + ".TEXT.t") + k) + L)._x - X;
k++;
}
}
if (Len > Letter) {
Letter = Len;
}
return(L);
}
function ConvertText(hint) {
Lines = 0;
var _local4 = "";
var _local2 = 0;
var _local1 = 0;
while (_local1 < hint.length) {
var _local3 = hint.substr(_local1, 1);
if (_local3 == "|") {
if (_local2 > Letter) {
Letter = _local2;
}
_local2 = 0;
_local4 = _local4 + newline;
Lines++;
} else {
_local4 = _local4 + _local3;
_local2++;
}
_local1++;
}
if (_local2 > Letter) {
Letter = _local2;
}
return(_local4);
}
function InitRound() {
if (savemode == "true") {
Saving.SaveInfo();
}
DrawMap();
}
function PrepareRound() {
Sun = 0;
SunInc = Math.round(Number(map[RoundCountry][RoundSity].SunInc) * 20);
lowtime_s = new GameSound("lowtime", this);
notBlock = false;
Mouse.removeListener(oMouse);
_root.attachMovie(("c" + RoundCountry) + "f", "gamepanel", _root.getNextHighestDepth());
_root.attachMovie("timeline", "TIME", _root.getNextHighestDepth());
_root.attachMovie("Text", "SCORE", _root.getNextHighestDepth());
_root.attachMovie("menubutton", "button", _root.getNextHighestDepth(), {_x:453, _y:4});
_root.attachMovie("Text", "country1", _root.getNextHighestDepth());
_root.attachMovie("Text", "sity1", _root.getNextHighestDepth());
TextShow(country1, map[RoundCountry].name, "s", 0, 0, 1);
if (_global.language == "en") {
TextShow(sity1, "level " + Number(RoundSity + 1), "s", 0, 0, 1);
} else if (_global.language == "de") {
TextShow(sity1, "Level " + Number(RoundSity + 1), "s", 0, 0, 1);
} else if (_global.language == "es") {
TextShow(sity1, "nivel " + Number(RoundSity + 1), "s", 0, 0, 1);
} else if (_global.language == "fr") {
TextShow(sity1, "niveau " + Number(RoundSity + 1), "s", 0, 0, 1);
} else if (_global.language == "it") {
TextShow(sity1, "livello " + Number(RoundSity + 1), "s", 0, 0, 1);
} else if (_global.language == "nl") {
TextShow(sity1, "level " + Number(RoundSity + 1), "s", 0, 0, 1);
} else if (_global.language == "pt") {
TextShow(sity1, "n\u00EDvel " + Number(RoundSity + 1), "s", 0, 0, 1);
} else if (_global.language == "sv") {
TextShow(sity1, "niv\u00E5 " + Number(RoundSity + 1), "s", 0, 0, 1);
}
country1._x = 95;
country1._y = 15;
sity1._x = 95;
sity1._y = 35;
TIME._x = TimeX;
TIME._y = TimeY;
SCORE._y = 227;
SCORE._x = 110;
shadow._x = ArtX;
shadow._y = ArtY;
button.onPress = bRel;
button.onRelease = (button.onReleaseOutside = MenuShow);
TextShow(SCORE, String(score), "sc", 0, 0, 1);
delete Matrix;
Matrix = new Array();
generateMatrix(RoundCountry, RoundSity, Matrix);
GlobalX = (257 - ((Size - 29) * 7)) - ((Matrix[0].length - 7) * (Size / 2));
GlobalY = (103 - ((Size - 29) * 7)) - ((Matrix.length - 7) * (Size / 2));
_root.createEmptyMovieClip("fon", _root.getNextHighestDepth());
_root.createEmptyMovieClip("FLY", _root.getNextHighestDepth());
_root.attachMovie("Text", "BombText", _root.getNextHighestDepth(), {_x:BombX, _y:BombY + 30});
_root.attachMovie("Text", "LiText", _root.getNextHighestDepth(), {_x:LightningX, _y:LightningY + 30});
_root.attachMovie("Text", "WatchText", _root.getNextHighestDepth(), {_x:WatX, _y:WatY + 30});
_root.attachMovie("Text", "ShuText", _root.getNextHighestDepth(), {_x:ShufleX, _y:ShufleY + 30});
if (Bombc) {
FLY.attachMovie("Bomb", "Bomb", FLY.getNextHighestDepth());
FLY.Bomb._x = BombX;
FLY.Bomb._y = BombY;
FLY.Bomb.onPress = onBombClick;
TextShow(BombText, "x" + Bombc, "sl", 0, 0, 0, 100);
}
if (Watchc) {
FLY.attachMovie("watch", "watch", FLY.getNextHighestDepth());
FLY.watch._x = WatX;
FLY.watch._y = WatY;
FLY.watch.onPress = onWatchClick;
TextShow(WatchText, "x" + Watchc, "sl", 0, 0, 0, 100);
}
if (Lightningc) {
FLY.attachMovie("Lightning", "Lightning", FLY.getNextHighestDepth());
FLY.Lightning._x = LightningX;
FLY.Lightning._y = LightningY;
FLY.Lightning.onPress = onLightningClick;
TextShow(LiText, "x" + Lightningc, "sl", 0, 0, 0, 100);
}
if (Shuflec) {
FLY.attachMovie("Shufle", "Shufle", FLY.getNextHighestDepth());
FLY.Shufle._x = ShufleX;
FLY.Shufle._y = ShufleY;
FLY.Shufle.onPress = onShufleClick;
TextShow(ShuText, "x" + Shuflec, "sl", 0, 0, 0, 100);
}
ResetTimer();
StopTimer();
Add = (Matches = (Chain = (MaxChain = (Tiles = (EndX = 0)))));
Blink = "no";
Mouse.show();
DrawLife();
DrawArt();
PreDraw();
}
function CallFall() {
clearInterval(ifall);
ifall = setInterval(function () {
clearInterval(ifall);
FallDown(Matrix);
}, 100);
}
function bRel() {
if ((notBlock && (redytoend)) && (!moveart)) {
inMenu = true;
button_s.start(SoundOn);
button.gotoAndStop(2);
}
}
function ClearRound(Matrix) {
StopHint();
BombText.removeMovieClip();
ShuText.removeMovieClip();
LiText.removeMovieClip();
WatchText.removeMovieClip();
country1.removeMovieClip();
sity1.removeMovieClip();
clearInterval(DD);
clearInterval(HHH);
clearInterval(SunEn);
clearInterval(blinking);
SCORE.removeMovieClip();
TIME.removeMovieClip();
gamepanel.removeMovieClip();
shadow.removeMovieClip();
panelleft.removeMovieClip();
Bomb.removeMovieClip();
Lightning.removeMovieClip();
watch.removeMovieClip();
Shufle.removeMovieClip();
ham.removeMovieClip();
sum.removeMovieClip();
lam.removeMovieClip();
button.removeMovieClip();
bl.removeMovieClip();
mainmenu.removeMovieClip();
var i = 0;
while (i < Matrix.length) {
var j = 0;
while (j < Matrix[i].length) {
var temp = FindName(i, j);
eval (temp).removeMovieClip();
eval ("s" + j).removeMovieClip();
eval (temp + "fon").removeMovieClip();
clearInterval(_root["m" + temp]);
clearInterval(_root["b" + temp]);
clearInterval(_root[MATP + Name]);
clearInterval(_root[("m" + i) + j]);
clearInterval(_root["m" + String(eval (("s" + i) + j))]);
j++;
}
i++;
}
i = 0;
fon.removeMovieClip();
FLY.removeMovieClip();
while (i < 200) {
var r = 0;
while (r < 3) {
var Name = (("c" + r) + i);
eval (Name).removeMovieClip();
r++;
}
eval ("heart" + Number(i)).removeMovieClip();
eval ("border" + Number(i)).removeMovieClip();
eval ("corner" + Number(i)).removeMovieClip();
i++;
}
ClearMovie(_root, 1, 1);
}
function InitSound() {
SoundMatch.removeMovieClip();
_root.createEmptyMovieClip("SoundMatch", _root.getNextHighestDepth());
Art_s = new GameSound("Art.mp3", this);
unlock_s = new GameSound("unlock_s", this);
art_s = new GameSound("artefact", this);
SunRay_s = new GameSound("SunRay", this);
bonus_s = new GameSound("bonus", this);
Lightning_s = new GameSound("Lightnings", this);
hint_s = new GameSound("hint_ss", this);
tosun_s = new GameSound("tosun", this);
Shufle_s = new GameSound("Shufles", this);
lowtime_s = new GameSound("lowtime", this);
match1_s = new GameSound("match1", SoundMatch);
match2_s = new GameSound("match2", SoundMatch);
match3_s = new GameSound("match3_s", SoundMatch);
match4_s = new GameSound("match4_s", SoundMatch);
match5_s = new GameSound("match5_s", SoundMatch);
match6_s = new GameSound("match6_s", SoundMatch);
match6_s.setVolume(70);
stats_s = new GameSound("stats", this);
time_s = new GameSound("time", this);
no_s = new GameSound("no", this);
yes_s = new GameSound("yes", this);
click_s = new GameSound("Click", this);
Bomb_s = new GameSound("Bombs", this);
scores_s = new GameSound("Scores", this);
start_s = new GameSound("start", this);
watch_s = new GameSound("watchs", this);
map_s = new GameSound("MapWaypoint", this);
button_s = new GameSound("ButtonClick", this);
sunc_s = new GameSound("SunComplete", this);
}
function PreDraw() {
_root.attachMovie("black", "bl", _root.getNextHighestDepth());
bl._width = 520;
bl._height = 390;
bl._alpha = 50;
bl.useHandCursor = false;
yes_s.start(SoundOn);
start_s = new GameSound("start", this);
bl.onPress = function () {
TIME.time1._x = 0;
clearInterval(showing);
clearInterval(showing1);
clearInterval(showing2);
bigtext.removeMovieClip();
var Done = true;
var i = 0;
while (i < Matrix.length) {
if (eval (("s" + i) + "0") != undefined) {
Done = false;
}
i++;
}
delete start_s;
if (Done) {
DrawFon(GlobalX + 2, GlobalY + 2, Matrix);
}
var i = 0;
while (i < Matrix.length) {
clearInterval(_root["Fallb" + i]);
var j = 0;
while (j < Matrix[0].length) {
eval (("s" + i) + j)._x = GlobalX + (Size * j);
eval (("s" + i) + j)._y = GlobalY + (i * Size);
if ((Matrix[i][j].substr(0, 1) == "s") || (Matrix[i][j].substr(5, 1) == "s")) {
eval (("s" + i) + j)._x = eval (("s" + i) + j)._x + ((Size / 2) - (eval (("s" + i) + j)._width / 2));
eval (("s" + i) + j)._y = eval (("s" + i) + j)._y + ((Size / 2) - (eval (("s" + i) + j)._height / 2));
}
eval (("s" + i) + j)._alpha = 100;
j++;
}
i++;
}
bl.removeMovieClip();
};
var str = ((map[RoundCountry].name + "|Stage ") + Number(RoundSity + 1));
if (_global.language == "en") {
str = (map[RoundCountry].name + "|level ") + Number(RoundSity + 1);
} else if (_global.language == "de") {
str = (map[RoundCountry].name + "|Level ") + Number(RoundSity + 1);
} else if (_global.language == "es") {
str = (map[RoundCountry].name + "|nivel ") + Number(RoundSity + 1);
} else if (_global.language == "fr") {
str = (map[RoundCountry].name + "|niveau ") + Number(RoundSity + 1);
} else if (_global.language == "it") {
str = (map[RoundCountry].name + "|livello ") + Number(RoundSity + 1);
} else if (_global.language == "nl") {
str = (map[RoundCountry].name + "|level ") + Number(RoundSity + 1);
} else if (_global.language == "pt") {
str = (map[RoundCountry].name + "|n\u00EDvel ") + Number(RoundSity + 1);
} else if (_global.language == "sv") {
str = (map[RoundCountry].name + "|niv\u00E5 ") + Number(RoundSity + 1);
}
_root.attachMovie("Text", "bigtext", _root.getNextHighestDepth(), {_x:360, _y:180, _alpha:0});
TextShow(bigtext, str, "B", 0, 30, 1);
showing = setInterval(ShowBeginText, 10, 1);
showing1 = setInterval(function () {
clearInterval(showing1);
clearInterval(showing);
bigtext._alpha = 0;
if (Life == 0) {
str = nolife;
} else if (Life == 1) {
str = onelife;
} else {
str = Life + manylives;
}
TextShow(bigtext, str, "B", -3, 30, 1);
bigtext._x = 350;
showing = setInterval(ShowBeginText, 10, 1);
}, 2500);
showing2 = setInterval(function () {
clearInterval(showing);
clearInterval(showing2);
bigtext.removeMovieClip();
DrawFon(GlobalX + 2, GlobalY + 2, Matrix);
}, 5000);
}
function ShowBeginText(l) {
if (l == 1) {
if (bigtext._alpha >= 100) {
clearInterval(showing);
showing = setInterval(ShowBeginText, 10, -1);
} else {
bigtext._alpha = bigtext._alpha + 2;
}
} else if (bigtext._alpha <= 3) {
clearInterval(showing);
} else {
bigtext._alpha = bigtext._alpha - 2;
}
}
function ScoreAdd(chk) {
var _local1 = 5;
if (chk == "y") {
_local1 = 20;
}
if (Add > 0) {
score = score + _local1;
Add = Add - _local1;
TextShow(SCORE, String(score), "sc", 0, 0, 1);
if (score >= NextLife) {
life_s.start(SoundOn);
NextLife = NextLife + 50000;
}
} else {
clearInterval(scoring);
redytoend = true;
}
}
function Score(ADD, chk) {
Add = Add + ADD;
var _local1 = 0;
if (Add < 30) {
_local1 = 200;
} else if (Add < 100) {
_local1 = 20;
} else if (Add > 300) {
chk = "y";
}
clearInterval(scoring);
scoring = setInterval(ScoreAdd, _local1, chk);
}
function MenuShow() {
button.gotoAndStop(1);
if (inMenu) {
inMenu = false;
StopHint();
StartTimer();
StopTimer();
notBlock = false;
_root.attachMovie("black", "bl", _root.getNextHighestDepth());
bl._alpha = 50;
bl._width = 520;
bl._height = 390;
_root.attachMovie("mainmenu", "mainmenu", _root.getNextHighestDepth(), {_x:200, _y:20});
TextShow(mainmenu.headtext, menuTEXT, "s", 2, 15, 1);
mainmenu.b1.onPress = FunctionHelp;
mainmenu.b2.onPress = FunctionSound;
mainmenu.b3.onPress = FunctionDownload;
mainmenu.b4.onPress = FunctionNew;
mainmenu.b5.onPress = FunctionResume;
mainmenu.b1.onRollOver = function () {
mainmenu.b1.gotoAndStop(3);
};
mainmenu.b1.onRollOut = function () {
mainmenu.b1.gotoAndStop(1);
};
TextShow(mainmenu.txt1, _root.menubutton0, "s", -3, 15, 1);
mainmenu.b2.onRollOver = function () {
mainmenu.b2.gotoAndStop(3);
};
mainmenu.b2.onRollOut = function () {
mainmenu.b2.gotoAndStop(1);
};
if (SoundOn) {
TextShow(mainmenu.txt2, _root.menubutton1, "s", -3, 15, 1);
} else {
TextShow(mainmenu.txt2, _root.menubutton5, "s", -3, 15, 1);
}
TextShow(mainmenu.txt3, _root.menubutton2, "s", -3, 15, 1);
mainmenu.b3.onRollOver = function () {
mainmenu.b3.gotoAndStop(3);
};
mainmenu.b3.onRollOut = function () {
mainmenu.b3.gotoAndStop(1);
};
TextShow(mainmenu.txt4, _root.menubutton3, "s", -3, 15, 1);
mainmenu.b4.onRollOver = function () {
mainmenu.b4.gotoAndStop(3);
};
mainmenu.b4.onRollOut = function () {
mainmenu.b4.gotoAndStop(1);
};
TextShow(mainmenu.txt5, _root.menubutton4, "s", -3, 15, 1);
mainmenu.b5.onRollOver = function () {
mainmenu.b5.gotoAndStop(3);
};
mainmenu.b5.onRollOut = function () {
mainmenu.b5.gotoAndStop(1);
};
}
}
function FunctionHelp(chk) {
if (chk != 1) {
button_s.start(SoundOn);
this.gotoAndStop(2);
} else {
StopHint();
StartTimer();
StopTimer();
clearInterval(delays);
clearInterval(blinking);
}
this._parent.txt1._y = this._parent.txt1._y + By;
this._parent.txt1._x = this._parent.txt1._x + Bx;
clearInterval(LLL);
LLL = setInterval(function () {
clearInterval(LLL);
_root.attachMovie("helppanel", "help", _root.getNextHighestDepth());
}, 300);
}
function FunctionSound(chk) {
if (chk != 1) {
button_s.start(SoundOn);
this.gotoAndStop(2);
}
this._parent.txt2._y = this._parent.txt2._y + By;
this._parent.txt2._x = this._parent.txt2._x + Bx;
SoundOn = !SoundOn;
if (SoundOn) {
TextShow(mainmenu.txt2, _root.menubutton1, "s", -3, 15, 1);
} else {
TextShow(mainmenu.txt2, _root.menubutton5, "s", -3, 15, 1);
}
}
function FunctionDownload(chk) {
if (chk != 1) {
button_s.start(SoundOn);
this.gotoAndStop(2);
}
this._parent.txt3._y = this._parent.txt3._y + By;
this._parent.txt3._x = this._parent.txt3._x + Bx;
getURL (downloadlink, "_blank");
}
function FunctionNew(chk) {
if (chk != 1) {
button_s.start(SoundOn);
this.gotoAndStop(2);
}
this._parent.txt4._y = this._parent.txt4._y + By;
this._parent.txt4._x = this._parent.txt4._x + Bx;
RoundCountry = (RoundSity = (Bombc = (Shuflec = (Lightningc = (Watchc = (Chain = (Matches = (MaxChain = (Tiles = (EndX = (score = (WinC = (WinR = 0)))))))))))));
Life = 3;
totalTime = totalTime + levelTime;
levelTime = 0;
delete ArtPos;
ArtPos = new Array();
InitArt(RoundCountry, RoundSity);
clearInterval(LLL);
LLL = setInterval(function () {
clearInterval(LLL);
ClearRound(Matrix);
InitRound();
}, 300);
_global.GameSwitch = true;
}
function FunctionResume() {
button_s.start(SoundOn);
this.gotoAndStop(2);
this._parent.txt5._y = this._parent.txt5._y + By;
this._parent.txt5._x = this._parent.txt5._x + Bx;
clearInterval(LLL);
LLL = setInterval(function () {
clearInterval(LLL);
notBlock = true;
StartTimer();
bl.removeMovieClip();
mainmenu.removeMovieClip();
nag.removeMovieClip();
RedyToPlay = true;
StartHint();
}, 300);
}
function DrawArt() {
var i = 0;
while (i < Number(map[RoundCountry][RoundSity].art)) {
var Name = (("c" + RoundCountry) + i);
var X = ArtPos[i].x;
var Y = ArtPos[i].y;
eval (Name).removeMovieClip();
_root.attachMovie(Name, Name, _root.getNextHighestDepth());
eval (Name)._x = X;
eval (Name)._y = Y;
i++;
}
}
function FGameOver() {
if (score > 0) {
_global.GameSwitch = false;
}
Life = 3;
RoundCountry = (RoundSity = (Bombc = (Shuflec = (Lightningc = (Watchc = (Chain = (Matches = (MaxChain = (Tiles = (EndX = (score = 0)))))))))));
totalTime = 0;
delete ArtPos;
ArtPos = new Array();
InitArt(RoundCountry, RoundSity);
ClearRound(Matrix);
InitRound();
}
function GameOver(msg) {
bigtext.removeMovieClip();
bl.removeMovieClip();
_root.attachMovie("black", "bl", _root.getNextHighestDepth(), {_width:520, _height:390, _alpha:0});
bl.onPress = AAA;
bl.useHandCursor = false;
if ((msg == nomoremoves) && ((Bombc || (Shuflec)) || (Lightningc))) {
bl.removeMovieClip();
_root.createEmptyMovieClip("bigtext", _root.getNextHighestDepth());
TextShow(bigtext, msg, "B", -5, 20, 3);
bigtext._x = 360;
bigtext._y = 180;
clearing = setInterval(function () {
clearInterval(clearing);
bigtext.removeMovieClip();
}, 3000);
} else {
Life--;
StopTimer();
if (Life == -1) {
if (score > 0) {
_global.GameSwitch = false;
}
clearInterval(ER);
RoundCountry = MaxC + 1;
RoundSity = 99;
ER = setInterval(EndRound, 20, Matrix);
} else {
bigtext.removeMovieClip();
totalTime = totalTime + levelTime;
levelTime = 0;
_root.createEmptyMovieClip("bigtext", _root.getNextHighestDepth());
TextShow(bigtext, msg, "B", -5, 20, 3);
bigtext._x = 360;
bigtext._y = 180;
clearing = setInterval(function () {
if (!Fall) {
bigtext.removeMovieClip();
clearInterval(clearing);
ClearRound(Matrix);
InitRound();
}
}, 2000);
}
}
}
function ClearMovie(mc, CI, CM) {
for (var _local4 in mc) {
if (CI) {
clearInterval(mc[_local4]);
}
if ((CM && (typeof(mc[_local4]) == "movieclip")) && (_local4 != "SoundMatch")) {
mc[_local4].swapDepths(999);
mc[_local4].removeMovieClip();
}
}
}
function Timing() {
levelTime = getTimer() - BeginTime;
var _local2 = (100 * (EndTime - getTimer())) / totaltime;
TIME.time1._x = ((_local2 - 100) * (-TimeLength)) / 100;
if ((_local2 < 1) && ((redytoend && (notBlock)) && (!moveart))) {
zylomfixoutoftime = true;
GameOver(outoftime);
} else if (_local2 < 20) {
lowtime_s.start(SoundOn && (lowtime_s.position == 0));
if (warningtime) {
warningtime = false;
_root.attachMovie("timewarn", "warn", _root.getNextHighestDepth());
warn._xscale = _local2;
warn._x = TimeX;
warn._y = TimeY - 0.5;
} else {
warn.removeMovieClip();
warningtime = true;
}
if (htime) {
htime = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, "htime");
}
} else {
zylomfixoutoftime = false;
}
}
function DrawLife() {
var i = 0;
while (i < 3) {
eval ("heart" + i).removeMovieClip;
i++;
}
var i = 0;
while ((i < Life) && (i < 3)) {
var X = 15;
var Y = 230;
_root.attachMovie("heart", "heart" + i, _root.getNextHighestDepth());
eval ("heart" + i)._x = X + (i * 10);
eval ("heart" + i)._y = Y;
i++;
}
}
function ResetTimer() {
clearInterval(TI);
totaltime = Number(map[RoundCountry][RoundSity].time) * 1000;
EndTime = Number(getTimer()) + totaltime;
stopped = 0;
}
function StartTimer() {
if (stopped) {
EndTime = EndTime + (getTimer() - stopped);
BeginTime = BeginTime + (getTimer() - stopped);
stopped = 0;
}
clearInterval(TI);
TI = setInterval(Timing, 100);
}
function StopTimer() {
StopHint();
stopped = getTimer();
clearInterval(TI);
}
function gen(Matrix) {
var _local4 = new Array("slide2", "slide2", "slide1", "slide2", "slide2");
var _local3 = new Array("slide1", "slide1", "slide2", "slide1", "slide3");
var _local2 = new Array("slide2", "slide2", "slide3", "slide2", "slide1");
Matrix.push(_local4);
Matrix.push(_local3);
Matrix.push(_local2);
}
function InitArt(Country, Sity) {
function PUSH(x, y, h, w) {
var _local1 = new Array();
_local1 = new Array("x", "y", "H", "W", "is");
_local1.x = x;
_local1.y = y;
_local1.H = h;
_local1.W = w;
ArtPos.push(_local1);
}
if (Country == 0) {
var _local1 = 0;
while (_local1 < ART[0].length) {
PUSH(ART[0][_local1].x + 17, ART[0][_local1].y - 218, ART[0][_local1].H, ART[0][_local1].W);
_local1++;
}
} else if (Country == 1) {
var _local1 = 0;
while (_local1 < ART[1].length) {
PUSH(ART[1][_local1].x + 10, ART[1][_local1].y - 230, ART[1][_local1].H, ART[1][_local1].W);
_local1++;
}
} else {
var _local1 = 0;
while (_local1 < ART[2].length) {
PUSH(ART[2][_local1].x + 6, ART[2][_local1].y - 224, ART[2][_local1].H, ART[2][_local1].W);
_local1++;
}
}
}
function SetBlow(Name, temp, chk) {
if (chk == 1) {
Name.attachMovie("blow30", "b", Name.getNextHighestDepth());
} else if (chk == 2) {
Name.b0._x = 7;
Name.b0._y = 7;
Name.b1._x = 15;
Name.b1._y = 15;
Name.b._alpha = 70;
Name.b0._width = 10;
Name.b0._height = 10;
var _local2 = new Color(Name.b);
var _local3 = new Color(Name.b0);
temp = Number(temp.substr(5, 1));
switch (temp) {
case 1 :
_local2.setRGB(16763904);
_local3.setRGB(16764006);
break;
case 2 :
_local2.setRGB(6724095);
_local3.setRGB(3381759);
break;
case 3 :
_local2.setRGB(16763904);
_local3.setRGB(16764006);
}
Name.b._rotation = Math.random() * 180;
} else if (chk == undefined) {
Name.attachMovie("blow", "b0", Name.getNextHighestDepth(), {_x:-15, _y:-15, _alpha:50});
}
}
function BlowTile(i, j, chk) {
var temp = Matrix[i][j];
var slide = eval (FindName(i, j));
if (temp.substr(0, 5) == "lock1") {
Matrix[i][j] = temp.substr(5, 10);
slide.l.removeMovieClip();
BlowLock(i, j);
} else if (temp.substr(0, 5) == "lock2") {
Matrix[i][j] = "lock1" + temp.substr(5, 10);
slide.l.removeMovieClip();
slide.attachMovie("lock1", "l", slide.getNextHighestDepth());
BlowLock(i, j);
} else {
var Depth = slide.getDepth();
slide.removeMovieClip();
var Name = FindName(i, j);
FLY[Name + "b"].removeMovieClip();
var temp = ("blow" + Matrix[i][j].substr(5, 1));
_root.attachMovie(temp, Name + "b", _root.getNextHighestDepth());
SetBlow(_root[Name + "b"], temp, chk);
_root[Name + "b"]._x = (GlobalX + (j * Size)) + (Size / 2);
_root[Name + "b"]._y = (GlobalY + (i * Size)) + (Size / 2);
Matrix[i][j] = "no";
}
}
function Blow(i, j, chk) {
var temp = Matrix[i][j];
var slide = eval (FindName(i, j));
if (temp.substr(0, 5) == "lock1") {
Matrix[i][j] = temp.substr(5, 10);
slide.l.removeMovieClip();
BlowLock(i, j);
} else if (temp.substr(0, 5) == "lock2") {
Matrix[i][j] = "lock1" + temp.substr(5, 10);
slide.l.removeMovieClip();
slide.attachMovie("lock1", "l", _root.getNextHighestDepth());
BlowLock(i, j);
} else {
var Name = FindName(i, j);
var slide = Matrix[i][j];
var X = eval (Name)._x;
var Y = eval (Name)._y;
var x1 = ((X + (Math.random() * 20)) - 10);
var y1 = ((Y + (Math.random() * 20)) + 150);
var r = 1;
if (Math.random() > 0.5) {
r = -1;
}
Matrix[i][j] = "no";
eval (Name).removeMovieClip();
var T = getTimer();
FLY[(("ms" + i) + j) + T].removeMovieClip();
FLY.attachMovie(slide, (("ms" + i) + j) + T, FLY.getNextHighestDepth(), {_x:X, _y:Y});
clearInterval(_root[(("mms" + i) + j) + T]);
_root[(("mms" + i) + j) + T] = setInterval(function () {
MovingToSun(i, j, T, X, Y, x1, y1, "no", r, FlySpeed);
}, Speed);
}
}
function BlowLock(i, j) {
unlock_s.start(SoundOn);
var x = ((j * Size) + GlobalX);
var y = ((i * Size) + GlobalY);
var T = getTimer();
var x1 = ((x + (Math.random() * 20)) - 10);
var y1 = ((y + (Math.random() * 20)) + 150);
FLY.attachMovie("lock1", (("ms" + i) + j) + T, FLY.getNextHighestDepth(), {_x:x, _y:y});
_root[(("mms" + i) + j) + T] = setInterval(function () {
MovingToSun(i, j, T, x, y, x1, y1, "no", 1, FlySpeed);
}, Speed);
}
function SunOver() {
FLY.ramka.removeMovieClip();
FLY.attachMovie("ramka", "ramka", FLY.getNextHighestDepth(), {_x:_xmouse - 13, _y:_ymouse - 13, _alpha:70});
TextShow(FLY.ramka.txt, (String(Sun) + "% ") + charged, "t", 0, 0, 1);
FLY.ramka.onMouseMove = Follow;
}
function SunOut() {
FLY.ramka.onMouseMove = null;
FLY.ramka.removeMovieClip();
Mouse.show();
}
function DSUN(T) {
var _local1 = getTimer();
var _local2 = 1500;
if (_local1 >= (T + _local2)) {
clearInterval(disSUN);
FLY.dSUN.removeMovieClip();
} else {
FLY.dSUN._xscale = (FLY.dSUN._yscale = 250 - ((150 * (_local1 - T)) / _local2));
FLY.dSUN._alpha = 80 - ((80 * (_local1 - T)) / _local2);
}
}
function MovingToSun(i, j, T, x, y, EndX, EndY, chk, rr, FlySpeed) {
redytoend = false;
var _local5 = getTimer();
if (_local5 >= (T + FlySpeed)) {
FillSun();
delete _root[(("Sx" + i) + j) + T];
delete _root[(("Sy" + i) + j) + T];
redytoend = true;
clearInterval(_root[(("mms" + i) + j) + T]);
FLY[(("ms" + i) + j) + T].removeMovieClip();
if (chk != "no") {
if ((hSun2 && (RoundCountry == 0)) && (RoundSity > 0)) {
hSun2 = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, "hSun2");
}
if ((Sun < SunM) && ((Sun + SunInc) >= SunM)) {
clearInterval(SunEn);
SunEn = setInterval(function () {
fon.attachMovie("sunen", "SE", fon.getNextHighestDepth(), {_x:SunX, _y:SunY, _rotation:Math.random() * 360, _alpha:(Math.random() * 30) + 70, _width:29, _height:15});
}, 4000);
sunc_s.start(SoundOn);
FLY.attachMovie("SUN", "dSUN", FLY.getNextHighestDepth(), {_x:SunX, _y:SunY, _alpha:20, _xscale:200, _yscale:200});
T = getTimer();
clearInterval(disSUN);
disSUN = setInterval(DSUN, 0, T);
}
Sun = Sun + SunInc;
fon.SUN.s.clear();
if (Sun >= SunM) {
Sun = SunM;
} else {
Circle(fon.SUN.s, 0, 0, 0.28 * Sun);
}
fon.SUNm._xscale = (Sun * 100) / SunM;
fon.SUNm._yscale = (Sun * 100) / SunM;
if (Sun == SunM) {
if ((hSUN && (RoundCountry == 0)) && (RoundSity > 0)) {
hSUN = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, "hSUN");
}
fon.SUNm.removeMovieClip();
fon.attachMovie("SUNm", "SUNm", fon.getNextHighestDepth(), {_x:SunX, _y:SunY});
fon.SUN.setMask(fon.SUNm);
fon.SUNm.onPress = OnSunClick;
fon.SUNm.onRollOver = SunOver;
fon.SUNm.onRollOut = SunOut;
}
fon.SUNb.removeMovieClip();
fon.attachMovie("SUNb", "SUNb", fon.getNextHighestDepth(), {_x:SunX, _y:SunY});
}
} else {
var _local10 = x + (((_local5 - T) * (EndX - x)) / FlySpeed);
var _local9 = y + (((_local5 - T) * (EndY - y)) / FlySpeed);
var _local8 = Math.round(2 + (((12 * (_local5 - T)) / FlySpeed) % 12));
if (rr == -1) {
_local8 = 14 - _local8;
}
if (chk != "no") {
_local10 = _root[(("Sx" + i) + j) + T].getPoint((_local5 - T) / FlySpeed);
_local9 = _root[(("Sy" + i) + j) + T].getPoint((_local5 - T) / FlySpeed);
var _local11 = ((-(_local5 - T)) * 90) / FlySpeed;
if (rr == -1) {
_local11 = -_local11;
}
var _local6 = (_local5 - T) / FlySpeed;
FLY[(("ms" + i) + j) + T]._rotation = _local11;
FLY[(("ms" + i) + j) + T]._xscale = 30 + (70 * (1 - (((_local6 * _local6) * _local6) * _local6)));
FLY[(("ms" + i) + j) + T]._yscale = 30 + (70 * (1 - (((_local6 * _local6) * _local6) * _local6)));
} else {
var _local11 = (100 * (_local5 - T)) / FlySpeed;
FLY[(("ms" + i) + j) + T]._alpha = 100 - _local11;
}
FLY[(("ms" + i) + j) + T]._x = _local10;
FLY[(("ms" + i) + j) + T]._y = _local9;
FLY[(("ms" + i) + j) + T].gotoAndStop(_local8);
}
}
function GoToSun(i, j) {
var Name = FindName(i, j);
var slide = Matrix[i][j];
var X = eval (Name)._x;
var Y = eval (Name)._y;
Matrix[i][j] = "no";
eval (Name).removeMovieClip();
var T = getTimer();
var T1 = (FlySpeed - (Math.random() * 500));
FLY[(("ms" + i) + j) + T].removeMovieClip();
FLY.attachMovie(slide, (("ms" + i) + j) + T, FLY.getNextHighestDepth(), {_x:X, _y:Y});
clearInterval(_root[(("mms" + i) + j) + T]);
_root[(("Sx" + i) + j) + T] = new Spline();
_root[(("Sy" + i) + j) + T] = new Spline();
InitSpline(_root[(("Sx" + i) + j) + T], _root[(("Sy" + i) + j) + T], X, Y, ((X - SunX) * 1.05) + SunX, ((Y - SunY) * 1.05) + SunY, SunX, SunY);
var r = 1;
if (Math.random() > 0.5) {
r = -1;
}
_root[(("mms" + i) + j) + T] = setInterval(function () {
MovingToSun(i, j, T, X, Y, SunX, SunY, 0, r, T1);
}, Speed);
}
function ShowScore(i, j, k) {
tosun_s.start((k > 3) && (SoundOn));
Score((5 * k) * (Chain + 1));
Tiles = Tiles + k;
var _local5 = GlobalX + ((Size * j) / k);
var _local4 = GlobalY + ((Size * i) / k);
FLY[(("s" + i) + j) + k].removeMovieClip();
FLY.attachMovie("ShowT", (("s" + i) + j) + k, FLY.getNextHighestDepth(), {_x:_local5, _y:_local4});
TextShow(FLY[(("s" + i) + j) + k].txt, "+" + Number((5 * k) * (Chain + 1)), "sl", 0, 0, 0);
}
function FindChain(Matrix, chk) {
function FindBlow() {
var i = 0;
while (i < Matrix.length) {
var j = 0;
while (j < Matrix[0].length) {
if (_root[("Ms" + i) + j] != undefined) {
var M = _root[("Ms" + i) + j];
var iN = 0;
var jN = 0;
var k = 0;
while (k < M.length) {
i1 = Number(M[k].i);
j1 = Number(M[k].j);
iN = iN + i1;
jN = jN + j1;
clearInterval(_root["m" + String(eval (("s" + i1) + j1))]);
if (M.length < 4) {
Blow(i1, j1);
} else if (Matrix[i1][j1].substr(0, 4) == "lock") {
Blow(i1, j1);
} else {
GoToSun(i1, j1);
}
k++;
}
ShowScore(iN, jN, M.length);
delete M;
delete _root[("Ms" + i) + j];
}
j++;
}
i++;
}
}
function FindMatch(i, j, M) {
function ClearM(i, j, M) {
Matrix1[i][j] = "no";
var _local1 = new Array("i", "j");
_local1.i = i;
_local1.j = j;
M.push(_local1);
}
var _local4 = Matrix[i][j];
if (_local4.substr(0, 4) == "lock") {
_local4 = _local4.substr(5, 10);
} else {
_local4 = Matrix[i][j].substr(0, 6);
}
if (_local4.substr(0, 1) == "s") {
if (((Matrix[i - 1][j].substr(0, 6) == _local4) || (Matrix[i - 1][j].substr(5, 10) == _local4)) && ((Matrix[i + 1][j].substr(0, 6) == _local4) || (Matrix[i + 1][j].substr(5, 10) == _local4))) {
if (Matrix1[i - 1][j] != "no") {
ClearM(i - 1, j, M);
FindMatch(i - 1, j, M);
}
if (Matrix1[i][j] != "no") {
ClearM(i, j, M);
FindMatch(i, j, M);
}
if (Matrix1[i + 1][j] != "no") {
ClearM(i + 1, j, M);
FindMatch(i + 1, j, M);
}
done = true;
}
if (((Matrix[i + 2][j].substr(0, 6) == _local4) || (Matrix[i + 2][j].substr(5, 10) == _local4)) && ((Matrix[i + 1][j].substr(0, 6) == _local4) || (Matrix[i + 1][j].substr(5, 10) == _local4))) {
if (Matrix1[i + 2][j] != "no") {
ClearM(i + 2, j, M);
FindMatch(i + 2, j, M);
}
if (Matrix1[i][j] != "no") {
ClearM(i, j, M);
FindMatch(i, j, M);
}
if (Matrix1[i + 1][j] != "no") {
ClearM(i + 1, j, M);
FindMatch(i + 1, j, M);
}
done = true;
}
if (((Matrix[i - 2][j].substr(0, 6) == _local4) || (Matrix[i - 2][j].substr(5, 10) == _local4)) && ((Matrix[i - 1][j].substr(0, 6) == _local4) || (Matrix[i - 1][j].substr(5, 10) == _local4))) {
if (Matrix1[i - 2][j] != "no") {
ClearM(i - 2, j, M);
FindMatch(i - 2, j, M);
}
if (Matrix1[i][j] != "no") {
ClearM(i, j, M);
FindMatch(i, j, M);
}
if (Matrix1[i - 1][j] != "no") {
ClearM(i - 1, j, M);
FindMatch(i - 1, j, M);
}
done = true;
}
if (((Matrix[i][j + 2].substr(0, 6) == _local4) || (Matrix[i][j + 2].substr(5, 10) == _local4)) && ((Matrix[i][j + 1].substr(0, 6) == _local4) || (Matrix[i][j + 1].substr(5, 10) == _local4))) {
if (Matrix1[i][j + 2] != "no") {
ClearM(i, j + 2, M);
FindMatch(i, j + 2, M);
}
if (Matrix1[i][j] != "no") {
ClearM(i, j, M);
FindMatch(i, j, M);
}
if (Matrix1[i][j + 1] != "no") {
ClearM(i, j + 1, M);
FindMatch(i, j + 1, M);
}
done = true;
}
if (((Matrix[i][j - 1].substr(0, 6) == _local4) || (Matrix[i][j - 1].substr(5, 10) == _local4)) && ((Matrix[i][j + 1].substr(0, 6) == _local4) || (Matrix[i][j + 1].substr(5, 10) == _local4))) {
if (Matrix1[i][j - 1] != "no") {
ClearM(i, j - 1, M);
FindMatch(i, j - 1, M);
}
if (Matrix1[i][j] != "no") {
ClearM(i, j, M);
FindMatch(i, j, M);
}
if (Matrix1[i][j + 1] != "no") {
ClearM(i, j + 1, M);
FindMatch(i, j + 1, M);
}
done = true;
}
if (((Matrix[i][j - 2].substr(0, 6) == _local4) || (Matrix[i][j - 2].substr(5, 10) == _local4)) && ((Matrix[i][j - 1].substr(0, 6) == _local4) || (Matrix[i][j - 1].substr(5, 10) == _local4))) {
if (Matrix1[i][j - 2] != "no") {
ClearM(i, j - 2, M);
FindMatch(i, j - 2, M);
}
if (Matrix1[i][j] != "no") {
ClearM(i, j, M);
FindMatch(i, j, M);
}
if (Matrix1[i][j - 1] != "no") {
ClearM(i, j - 1, M);
FindMatch(i, j - 1, M);
}
done = true;
}
}
return(done);
}
var done = false;
Matrix1 = new Array();
var i = 0;
while (i < Matrix.length) {
var c = new Array();
var j = 0;
while (j < Matrix[i].length) {
c[j] = 0;
j++;
}
Matrix1[i] = c;
i++;
}
var i = 0;
while (i < Matrix.length) {
var j = 0;
while (j < Matrix[i].length) {
if (Matrix1[i][j] != "no") {
_root[("Ms" + i) + j] = new Array();
done = FindMatch(i, j, _root[("Ms" + i) + j]);
if (_root[("Ms" + i) + j].length < 3) {
delete _root[("Ms" + i) + j];
}
}
j++;
}
i++;
}
if (done && (chk != "no")) {
FindBlow();
}
return(done);
}
function FallBegin(x, j, Matrix) {
var l = 5;
var k = 0;
mmm = mmm + (((-TimeLength) * l) / (Matrix[0].length * 100));
while (eval (FindName(k, j)) == undefined) {
k++;
}
if (eval (FindName(k, j))._y >= (GlobalY + (k * Size))) {
clearInterval(_root["Flallb" + j]);
AdjustSlides(j);
j++;
mmm = (((-TimeLength) * j) / Matrix[0].length) + TimeLength;
if (j != Matrix[0].length) {
start_s.start(SoundOn && (x != GlobalY));
_root["Flallb" + j] = setInterval(FallBegin, Speed, x, j, Matrix);
} else {
bl.removeMovieClip();
BeginTime = getTimer();
notStop = (redytoend = true);
notBlock = true;
ShowBlink(1);
if (((RoundSity == 0) && (RoundCountry == 0)) && (hbegin)) {
hbegin = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, "hbegin");
} else if (((RoundSity == 3) && (RoundCountry == 0)) && (hTimer)) {
hTimer = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, "hTimer");
}
Fall = (moveart = (Bombuse = (LiUse = (ShUse = false))));
}
} else {
var i = 0;
while (i < Matrix.length) {
if (mmm < (-TimeLength)) {
TIME.time1._x = mmm;
}
eval (FindName(i, j))._y = eval (FindName(i, j))._y + l;
eval (FindName(i, j))._alpha = 100 - ((GlobalY + (k * Size)) - eval (FindName(k, j))._y);
i++;
}
}
}
function AdjustSlides(j) {
var i = 0;
while (i <= Matrix.length) {
if ((Matrix[i][j].substr(0, 1) == "s") || (Matrix[i][j].substr(5, 1) == "s")) {
eval (("s" + i) + j)._x = ((GlobalX + (Size * j)) + (Size / 2)) - (eval (("s" + i) + j)._width / 2);
eval (("s" + i) + j)._y = ((GlobalY + (Size * i)) + (Size / 2)) - (eval (("s" + i) + j)._height / 2);
}
i++;
}
}
function ShowBlink(chk) {
if ((chk == 1) || (notBlock)) {
var k = 0;
clearInterval(delays);
delays = setInterval(function () {
var i = 0;
while (i <= k) {
var j = 0;
while (j <= k) {
if (((i + j) == k) && (Matrix[i][j].substr(0, 1) == "s")) {
_root[("si" + i) + j].removeMovieClip();
_root.attachMovie("shine1", ("si" + i) + j, _root.getNextHighestDepth(), {_x:GlobalX + (j * Size), _y:GlobalY + (i * Size)});
if (eval (("s" + i) + j).hitTest(hints) || (!notBlock)) {
eval (("si" + i) + j).removeMovieClip();
}
}
j++;
}
i++;
}
if (k == ((Matrix.length + Matrix[0].length) - 2)) {
clearInterval(delays);
clearInterval(blinking);
blinking = setInterval(ShowBlink, (Math.random() * 10000) + 5000);
} else {
k++;
}
}, 100);
}
}
function FillArt(Name, i, j, slide, X, Y, W) {
Name.attachMovie("art", "art0", Name.getNextHighestDepth(), {_y:((Size / 2) - 5) + Y, _x:((Size / 2) - 5) + X});
Name.art0.b.attachMovie(slide, "n", 1);
Name.art0.b.n._width = W;
Name.art0.b.n._height = W;
Name.art0.gotoAndPlay(Math.round(Math.random() * 35));
var _local2 = new Color(Name.art0.b.n);
if (RoundCountry != 1) {
_local2.setRGB(16776960);
} else {
_local2.setRGB(26367);
}
Name.attachMovie("black", "m1", Name.getNextHighestDepth(), {_x:-5, _y:-5, _width:Size + 10, _height:Size + 10});
Name.art0.setMask(Name.m1);
Name.attachMovie(slide, "art", Name.getNextHighestDepth(), {_y:(Size / 2) + Y, _x:(Size / 2) + X});
Name.attachMovie("black", "m", Name.getNextHighestDepth(), {_x:-5, _y:-5, _width:Size + 10, _height:Size + 10});
Name.art.setMask(Name.m);
}
function DrawBonus(i, j, d, chk) {
eval (("s" + i) + j).removeMovieClip();
_root.createEmptyMovieClip(("s" + i) + j, d);
eval (("s" + i) + j)._x = (Size * j) + GlobalX;
eval (("s" + i) + j)._y = (Size * i) + GlobalY;
if (chk == "b") {
FillArt(eval (("s" + i) + j), i, j, Matrix[i][j], -11, -11, 32);
} else {
FillArt(eval (("s" + i) + j), i, j, Matrix[i][j], (-ArtPos[Matrix[i][j].substr(2, 2)].W) / 2, (ArtPos[Matrix[i][j].substr(2, 2)].H / 2) - 42, 52);
}
}
function DrawLock(i, j, x, y) {
var Lock = Matrix[i][j].substr(0, 5);
var slide = Matrix[i][j].substr(5, 10);
_root.attachMovie(slide, ("s" + i) + j, _root.getNextHighestDepth());
eval (("s" + i) + j).attachMovie(Lock, "l", eval (("s" + i) + j).getNextHighestDepth(), {_width:Size1, _height:Size1});
eval (("s" + i) + j)._alpha = 0;
eval (("s" + i) + j)._x = ((x + (j * Size)) + (Size / 2)) - (eval (("s" + i) + j)._width / 2);
eval (("s" + i) + j)._y = y + (i * Size);
}
function DrawMatrix(x, y, Matrix) {
var i = 0;
while (i < Matrix.length) {
j = 0;
while (j < Matrix[i].length) {
if (Matrix[i][j].substr(0, 4) != "lock") {
switch (Matrix[i][j].substr(0, 1)) {
case "c" :
eval (("s" + i) + j).removeMovieClip();
DrawBonus(i, j, _root.getNextHighestDepth());
break;
case "B" :
case "S" :
case "w" :
case "L" :
eval (("s" + i) + j).removeMovieClip();
DrawBonus(i, j, _root.getNextHighestDepth(), "b");
break;
default :
_root.attachMovie(Matrix[i][j], ("s" + i) + j, _root.getNextHighestDepth());
eval (("s" + i) + j)._x = ((x + (j * Size)) + (Size / 2)) - (eval (("s" + i) + j)._width / 2);
}
eval (("s" + i) + j)._y = y + (i * Size);
eval (("s" + i) + j)._alpha = 0;
if ((Matrix[i][j] == "Bomb") && (hBomb)) {
hBomb = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, "hBomb");
} else if ((Matrix[i][j] == "Lightning") && (hLightning)) {
hLightning = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, "hLightning");
} else if ((Matrix[i][j] == "watch") && (hwatch)) {
hwatch = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, "hwatch");
} else if ((Matrix[i][j] == "Shufle") && (hShufle)) {
hShufle = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, "hShufle");
}
} else {
DrawLock(i, j, x, y);
if (hLock) {
hLock = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, "hLock");
}
}
InitSlide(("s" + i) + j);
j++;
}
i++;
}
mmm = TimeLength;
start_s.start(SoundOn && (y != GlobalY));
Flallb0 = setInterval(FallBegin, Speed, y, 0, Matrix);
}
function InitSlide(slide) {
eval (slide).onPress = Press;
eval (slide).onRelease = Release;
eval (slide).onReleaseOutside = Release;
eval (slide).onRollOver = OverMove;
eval (slide).onRollOut = OutMove;
eval (slide).useHandCursor = false;
eval (slide).tabEnabled = false;
}
function DrawFon(x, y, Matrix) {
var _local4 = 0;
var _local7 = 0;
var _local2;
var _local1;
fon.attachMovie("SUN", "SUN", fon.getNextHighestDepth(), {_x:SunX, _y:SunY});
fon.attachMovie("SUNm", "SUNm", fon.getNextHighestDepth(), {_x:SunX, _y:SunY, _xscale:(Sun * 100) / SunM, _yscale:(Sun * 100) / SunM});
fon.SUN.setMask(fon.SUNm);
if (Sun == SunM) {
fon.SUNm.removeMovieClip();
fon.attachMovie("SUNm", "SUNm", fon.getNextHighestDepth(), {_x:SunX, _y:SunY});
fon.attachMovie("SUNb", "SUNb", fon.getNextHighestDepth(), {_x:SunX, _y:SunY});
fon.SUN.setMask(fon.SUNm);
fon.SUNm.onPress = OnSunClick;
}
fon.attachMovie("SUN", "SUNN", fon.getNextHighestDepth(), {_x:SunX, _y:SunY, _alpha:0});
fon.SUNN.useHandCursor = false;
fon.SUNN.onRollOver = SunOver;
fon.SUNN.onRollOut = SunOut;
_local2 = 0;
while (_local2 < Matrix.length) {
_local1 = 0;
while (_local1 < Matrix[_local2].length) {
if (Matrix[_local2][_local1] != "0") {
fon.attachMovie("fon" + RoundCountry, (("s" + _local2) + _local1) + "fon", fon.getNextHighestDepth());
fon[(("s" + _local2) + _local1) + "fon"]._x = (_local1 * Size) + x;
fon[(("s" + _local2) + _local1) + "fon"]._y = (_local2 * Size) + y;
fon[(("s" + _local2) + _local1) + "fon"].gotoAndStop(1);
fon[(("s" + _local2) + _local1) + "fon"]._width = Size;
fon[(("s" + _local2) + _local1) + "fon"]._height = Size;
if ((Matrix[_local2 - 1][_local1] == "0") || (Matrix[_local2 - 1][_local1] == undefined)) {
fon.attachMovie("border", "border" + _local4, fon.getNextHighestDepth(), {_height:Size});
fon["border" + _local4]._rotation = -90;
fon["border" + _local4]._x = ((_local1 * Size) + x) + 1;
fon["border" + _local4]._y = ((_local2 * Size) + y) - 2;
_local4++;
if (((Matrix[_local2][_local1 - 1] == "0") || (Matrix[_local2][_local1 - 1] == undefined)) && ((Matrix[_local2 - 1][_local1 - 1] == "0") || (Matrix[_local2 - 1][_local1 - 1] == undefined))) {
fon.attachMovie("corner", "corner" + _local7, fon.getNextHighestDepth(), {_x:((_local1 * Size) + x) - 5, _y:((_local2 * Size) + y) - 5});
_local7++;
}
if (((Matrix[_local2][_local1 + 1] == "0") || (Matrix[_local2][_local1 + 1] == undefined)) && ((Matrix[_local2 - 1][_local1 + 1] == "0") || (Matrix[_local2 - 1][_local1 + 1] == undefined))) {
fon.attachMovie("corner", "corner" + _local7, fon.getNextHighestDepth(), {_x:(((_local1 + 1) * Size) + x) + 3.5, _y:((_local2 * Size) + y) - 5, _rotation:90});
_local7++;
}
}
if ((Matrix[_local2 + 1][_local1] == "0") || (Matrix[_local2 + 1][_local1] == undefined)) {
fon.attachMovie("border", "border" + _local4, fon.getNextHighestDepth(), {_height:Size});
fon["border" + _local4]._rotation = -90;
fon["border" + _local4]._x = ((_local1 * Size) + x) + 1;
fon["border" + _local4]._y = (((_local2 + 1) * Size) + y) + 2;
_local4++;
if (((Matrix[_local2][_local1 - 1] == "0") || (Matrix[_local2][_local1 - 1] == undefined)) && ((Matrix[_local2 + 1][_local1 - 1] == "0") || (Matrix[_local2 + 1][_local1 - 1] == undefined))) {
fon.attachMovie("corner", "corner" + _local7, fon.getNextHighestDepth(), {_x:((_local1 * Size) + x) + 0, _y:((_local2 + 1) * Size) + y, _rotation:90});
_local7++;
}
if (((Matrix[_local2][_local1 + 1] == "0") || (Matrix[_local2][_local1 + 1] == undefined)) && ((Matrix[_local2 + 1][_local1 + 1] == "0") || (Matrix[_local2 + 1][_local1 + 1] == undefined))) {
fon.attachMovie("corner", "corner" + _local7, fon.getNextHighestDepth(), {_x:(((_local1 + 1) * Size) + x) - 1, _y:((_local2 + 1) * Size) + y});
_local7++;
}
}
if ((Matrix[_local2][_local1 - 1] == "0") || (Matrix[_local2][_local1 - 1] == undefined)) {
fon.attachMovie("border", "border" + _local4, fon.getNextHighestDepth(), {_height:Size});
fon["border" + _local4]._x = ((_local1 * Size) + x) - 3;
fon["border" + _local4]._y = (_local2 * Size) + y;
_local4++;
}
if ((Matrix[_local2][_local1 + 1] == "0") || (Matrix[_local2][_local1 + 1] == undefined)) {
fon.attachMovie("border", "border" + _local4, fon.getNextHighestDepth(), {_height:Size});
fon["border" + _local4]._x = (((_local1 + 1) * Size) + x) + 1;
fon["border" + _local4]._y = (_local2 * Size) + y;
_local4++;
}
}
_local1++;
}
_local2++;
}
bl._alpha = 0;
DrawMatrix(GlobalX, GlobalY - 100, Matrix);
}
function generateMatrix(country, sity, Matrix) {
Line = new Array();
agame = map[country][sity];
var art = Number(map[country][sity].art);
var i = 0;
while (i < agame.length) {
j = 0;
while (j < agame[i].length) {
do {
var done = true;
var temp1 = Math.round(Math.random() * (map[country][sity].chips.length - 1));
var temp = ("slide" + Number(Number(map[country][sity].chips[temp1]) + 1));
if (((i > 1) && ((Matrix[i - 1][j] == temp) || (Matrix[i - 1][j].substr(5, 10) == temp))) && ((Matrix[i - 2][j] == temp) || (Matrix[i - 2][j].substr(5, 10) == temp))) {
done = false;
}
if (((j > 1) && ((Line[j - 1] == temp) || (Line[j - 1].substr(5, 10) == temp))) && ((Line[j - 2] == temp) || (Line[j - 2].substr(5, 10) == temp))) {
done = false;
}
} while (!done);
switch (agame[i][j]) {
case "1" :
Line[j] = temp;
break;
case "-" :
temp = "lock1" + temp;
break;
case "+" :
temp = "lock2" + temp;
break;
case "*" :
temp = "lock2" + temp;
break;
case "B" :
temp = "Bomb";
agame[i][j] = "1";
break;
case "L" :
temp = "Lightning";
agame[i][j] = "1";
break;
case "T" :
temp = "watch";
agame[i][j] = "1";
break;
case "R" :
temp = "Shufle";
agame[i][j] = "1";
break;
case "A" :
temp = ("c" + country) + art;
art++;
eval (temp).removeMovieClip();
break;
default :
temp = "0";
}
Line[j] = temp;
j++;
}
Matrix[i] = Line;
Line = new Array();
i++;
}
}
function FindIndexX(name) {
if ((name.substr(name.length - 5, 1) == "s") || ((name.substr(name.length - 4, 1) == "s") && (name.substr(name.length - 2, 1) == "0"))) {
var _local2 = Number(substring(name, name.indexOf("s") + 2, 2));
} else {
var _local2 = Number(substring(name, name.indexOf("s") + 2, 1));
}
return(_local2);
}
function FindIndexY(name) {
if ((name.substr(name.length - 5, 1) == "s") || ((name.substr(name.length - 4, 1) == "s") && (name.substr(name.length - 2, 1) == "0"))) {
var _local2 = Number(substring(name, name.indexOf("s") + 4, 2));
} else {
var _local2 = Number(substring(name, name.indexOf("s") + 3, 2));
}
return(_local2);
}
function FindName(x, y) {
return(("s" + x) + y);
}
function CheckClick(name) {
Release();
if (Blink == "no") {
return(true);
}
notBlock = false;
var _local4 = FindIndexX(String(name));
var _local3 = FindIndexY(String(name));
var _local5 = String(Blink);
var _local2 = FindIndexX(_local5);
var _local1 = FindIndexY(_local5);
if (((_local4 - _local2) == 1) && ((_local3 - _local1) == 0)) {
CheckSuccess(_local4, _local3, _local2, _local1);
MoveDown(_local5);
} else if (((_local4 - _local2) == -1) && ((_local3 - _local1) == 0)) {
CheckSuccess(_local4, _local3, _local2, _local1);
MoveUp(_local5);
} else if (((_local4 - _local2) == 0) && ((_local3 - _local1) == -1)) {
CheckSuccess(_local4, _local3, _local2, _local1);
MoveLeft(_local5);
} else if (((_local4 - _local2) == 0) && ((_local3 - _local1) == 1)) {
CheckSuccess(_local4, _local3, _local2, _local1);
MoveRight(_local5);
} else {
if (((_local4 - _local2) == 0) && ((_local3 - _local1) == 0)) {
notBlock = true;
return(true);
}
notBlock = true;
Blink.gotoAndStop(1);
return(true);
}
}
function MovingDown(slide, y, chk, T) {
var _local1 = getTimer();
var _local7 = y + Size;
if (_local1 < (T + MoveTime)) {
var _local5 = y + ((Size * (_local1 - T)) / MoveTime);
slide._y = _local5;
} else {
slide._y = _local7;
if (chk == "0") {
notBlock = true;
}
Fall = false;
var _local4 = FindIndexX(String(slide));
var _local3 = FindIndexY(String(slide));
var _local6 = FindName(_local4++, _local3);
var _local8 = FindName(_local4, _local3);
RemoveSlides(_local6, _local8, chk);
}
}
function MovingRight(slide, x, chk, T) {
var _local1 = getTimer();
var _local7 = x + Size;
if (_local1 < (T + MoveTime)) {
var _local6 = x + ((Size * (_local1 - T)) / MoveTime);
slide._x = _local6;
} else {
slide._x = _local7;
if (chk == "0") {
notBlock = true;
}
var _local4 = FindIndexX(String(slide));
var _local3 = FindIndexY(String(slide));
var _local5 = FindName(_local4, _local3++);
var _local8 = FindName(_local4, _local3);
RemoveSlides(_local5, _local8, chk);
}
}
function MovingLeft(slide, x, chk, T) {
var _local1 = getTimer();
var _local7 = x - Size;
if (_local1 < (T + MoveTime)) {
var _local6 = x - ((Size * (_local1 - T)) / MoveTime);
slide._x = _local6;
} else {
slide._x = _local7;
if (chk == "0") {
notBlock = true;
}
var _local4 = FindIndexX(String(slide));
var _local3 = FindIndexY(String(slide));
var _local5 = FindName(_local4, _local3--);
var _local8 = FindName(_local4, _local3);
RemoveSlides(_local5, _local8, chk);
}
}
function MovingUp(slide, y, chk, T) {
var _local1 = getTimer();
var _local7 = y - Size;
if (_local1 < (T + MoveTime)) {
var _local5 = y - ((Size * (_local1 - T)) / MoveTime);
slide._y = _local5;
} else {
slide._y = _local7;
if (chk == "0") {
notBlock = true;
}
var _local4 = FindIndexX(String(slide));
var _local3 = FindIndexY(String(slide));
var _local6 = FindName(_local4--, _local3);
var _local8 = FindName(_local4, _local3);
RemoveSlides(_local6, _local8, chk);
}
}
function RemoveSlides(slide, slide1, chk) {
Release();
StopHint();
redytoend = false;
Blink = "no";
var s = eval (slide);
var s1 = eval (slide1);
clearInterval(_root["m" + String(s)]);
clearInterval(_root["m" + String(s1)]);
var i = FindIndexX(String(s));
var j = FindIndexY(String(s));
var d1 = s.getDepth();
var d2 = s1.getDepth();
var i1 = FindIndexX(String(s1));
var j1 = FindIndexY(String(s1));
var newname = Matrix[i1][j1];
Matrix[i1][j1] = Matrix[i][j];
Matrix[i][j] = newname;
newname = s._name;
s._name = s1._name;
s1._name = newname;
s.gotoAndStop(1);
s1.gotoAndStop(1);
s1._x = GlobalX + (j * Size);
s1._y = GlobalY + (i * Size);
s._x = GlobalX + (j1 * Size);
s._y = GlobalY + (i1 * Size);
if (Matrix[i1][j1].substr(0, 1) == "s") {
s._x = s._x + ((Size / 2) - (s._width / 2));
s._y = s._y + ((Size / 2) - (s._height / 2));
}
if (Matrix[i][j].substr(0, 1) == "s") {
s1._x = s1._x + ((Size / 2) - (s1._width / 2));
s1._y = s1._y + ((Size / 2) - (s1._height / 2));
}
if (chk != "0") {
var done = FindChain(Matrix);
if (!done) {
if ((hswap && (RoundCountry == 0)) && (RoundSity == 0)) {
hswap = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, "hswap");
}
i = Number(i);
i1 = Number(i1);
j = Number(j);
j1 = Number(j1);
if (i > i1) {
MoveUp(s1, 0);
} else if (i1 > i) {
MoveUp(s, 0);
} else if (j1 > j) {
MoveLeft(s, 0);
} else {
MoveLeft(s1, 0);
}
} else {
match1_s.start(SoundOn);
Matches++;
fallnext = setInterval(function () {
clearInterval(fallnext);
fall = setInterval(FallDown, Speed, Matrix);
}, 100);
if (hart && (RoundSity == 0)) {
hart = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, "hart");
}
}
} else {
redytoend = true;
}
StartHint();
}
function StopHint() {
clearInterval(stopping);
sh1.removeMovieClip();
sh2.removeMovieClip();
}
function GoHint(i1, j1, i2, j2) {
StopHint();
_root.attachMovie("shine", "sh1", _root.getNextHighestDepth());
_root.attachMovie("shine", "sh2", _root.getNextHighestDepth());
sh1._x = GlobalX + (j1 * Size);
sh1._y = GlobalY + (i1 * Size);
sh2._x = GlobalX + (j2 * Size);
sh2._y = GlobalY + (i2 * Size);
}
function CHECK(i, j, i0, j0, i1, j1, i2, j2, chk) {
var _local4 = false;
var _local1 = Matrix[i][j];
if ((((((Matrix[i][j] != "0") && (Matrix[i0][j0] != "0")) && (Matrix[i0][j0] != undefined)) && (Matrix[i0][j0].substr(0, 1) != "l")) && ((Matrix[i1][j1] == _local1) || (Matrix[i1][j1].substr(5, 10) == _local1))) && ((Matrix[i2][j2] == _local1) || (Matrix[i2][j2].substr(5, 10) == _local1))) {
_local4 = true;
if (chk == undefined) {
GoHint(i, j, i0, j0);
}
}
return(_local4);
}
function Finding(i, j, i1, j1) {
var _local3 = false;
if ((!_local3) && (((i1 == i) && (j1 == (j + 1))) || (i1 == undefined))) {
_local3 = CHECK(i, j, i, j + 1, i + 1, j + 1, i + 2, j + 1);
}
if ((!_local3) && (((i1 == i) && (j1 == (j - 1))) || (i1 == undefined))) {
_local3 = CHECK(i, j, i, j - 1, i + 1, j - 1, i + 2, j - 1);
}
if ((!_local3) && (((i1 == i) && (j1 == (j + 1))) || (i1 == undefined))) {
_local3 = CHECK(i, j, i, j + 1, i - 1, j + 1, i - 2, j + 1);
}
if ((!_local3) && (((i1 == i) && (j1 == (j - 1))) || (i1 == undefined))) {
_local3 = CHECK(i, j, i, j - 1, i - 1, j - 1, i - 2, j - 1);
}
if ((!_local3) && (((i1 == (i + 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, j, i + 1, j, i + 1, j + 1, i + 1, j + 2);
}
if ((!_local3) && (((i1 == (i + 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, j, i + 1, j, i + 1, j - 1, i + 1, j - 2);
}
if ((!_local3) && (((i1 == (i - 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, j, i - 1, j, i - 1, j + 1, i - 1, j + 2);
}
if ((!_local3) && (((i1 == (i - 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, j, i - 1, j, i - 1, j - 1, i - 1, j - 2);
}
if ((!_local3) && (((i1 == i) && (j1 == (j + 1))) || (i1 == undefined))) {
_local3 = CHECK(i, j, i, j + 1, i - 1, j + 1, i + 1, j + 1);
}
if ((!_local3) && (((i1 == i) && (j1 == (j - 1))) || (i1 == undefined))) {
_local3 = CHECK(i, j, i, j - 1, i - 1, j - 1, i + 1, j - 1);
}
if ((!_local3) && (((i1 == (i + 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, j, i + 1, j, i + 1, j + 1, i + 1, j - 1);
}
if ((!_local3) && (((i1 == (i - 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, j, i - 1, j, i - 1, j + 1, i - 1, j - 1);
}
if ((!_local3) && (((i1 == (i - 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, j, i - 1, j, i - 2, j, i - 3, j);
}
if ((!_local3) && (((i1 == (i + 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, j, i + 1, j, i + 2, j, i + 3, j);
}
if ((!_local3) && (((i1 == i) && (j1 == (j - 1))) || (i1 == undefined))) {
_local3 = CHECK(i, j, i, j - 1, i, j - 2, i, j - 3);
}
if ((!_local3) && (((i1 == i) && (j1 == (j + 1))) || (i1 == undefined))) {
_local3 = CHECK(i, j, i, j + 1, i, j + 2, i, j + 3);
}
return(_local3);
}
function StartHint() {
clearInterval(stopping);
stopping = setInterval(FindStop, HintHelpTime, Matrix);
}
function FindStop(Matrix, chk) {
if (notBlock) {
clearInterval(stopping);
var _local7 = 0;
var _local6 = 0;
notStop = false;
_local7 = Math.round(Math.random() * (Matrix.length - 1));
_local6 = Math.round(Math.random() * (Matrix[0].length - 1));
var _local5 = 0;
while (_local5 < Matrix.length) {
var _local3 = (_local7 + _local5) % Matrix.length;
var _local1 = 0;
while (_local1 < Matrix[_local3].length) {
var _local2 = (_local6 + _local1) % Matrix[0].length;
notStop = Finding(Number(_local3), Number(_local2));
if (notStop) {
return(Math.max(_local3, _local2));
}
_local1++;
}
_local5++;
}
if (!notStop) {
GameOver(nomoremoves);
}
}
}
function FALL1(Name, y, l, y0, T) {
var time = getTimer();
var ttt = (100 + (Math.random() * 50));
var r = (y - (((y - y0) * 2) / Size));
if (l == 1) {
if (time >= (T + ttt)) {
eval (Name)._y = y;
clearInterval(_root["m" + String(eval (Name))]);
_root["m" + String(eval (Name))] = setInterval(FALL1, 0, Name, y, -1, y0, T);
} else {
eval (Name)._y = y + (((y - r) * (T - time)) / ttt);
}
} else if (time >= (T + (ttt * 2))) {
Name._y = y;
clearInterval(_root["m" + String(eval (Name))]);
} else {
eval (Name)._y = r + (((((-y) + r) * (T - time)) / ttt) / 2);
}
}
function FALL(Name, y0, Y, t0) {
Fall = true;
var time = getTimer();
var T = GameSpeed;
Name._y = y0 - (((time - t0) * (y0 - Y)) / T);
if (Name._alpha < 100) {
Name._alpha = ((time - t0) * 100) / T;
}
if (time > (t0 + T)) {
Fall = false;
Name._y = Y;
Name._alpha = 100;
var T = getTimer();
clearInterval(_root["m" + String(eval (Name))]);
_root["m" + String(eval (Name))] = setInterval(FALL1, 0, Name, Y, 1, y0, T);
}
}
function CheckFall() {
clearInterval(fall);
clearInterval(refreshing);
if (zylomfixoutoftime == false) {
Chain++;
if (FindChain(Matrix)) {
if (SoundOn) {
var _local2 = "match6_s";
if (Chain < 5) {
_local2 = ("match" + Number(Chain + 1)) + "_s";
}
_root[_local2].start(SoundOn);
}
fall = setInterval(FallDown, 200, Matrix);
} else if (LastArt()) {
fall = setInterval(FallDown, 200, Matrix);
} else {
Fall = false;
if (Chain > MaxChain) {
MaxChain = Chain;
}
Chain = 0;
notBlock = true;
redytoend = true;
StartHint();
}
}
}
function LastArt() {
var _local2 = false;
j = 0;
while (j < Matrix[0].length) {
var _local1 = Matrix.length - 1;
temp = Matrix[_local1][j];
while (temp == "0") {
_local1--;
temp = Matrix[_local1][j];
}
if (((((temp.substr(0, 1) == "c") || (temp == "Shufle")) || (temp == "Bomb")) || (temp == "watch")) || (temp == "Lightning")) {
_local2 = true;
}
j++;
}
return(_local2);
}
function LastIsArt(i, j) {
var _local2 = true;
var _local1 = i + 1;
while (_local1 < Matrix.length) {
if (Matrix[_local1][j] != "0") {
_local2 = false;
return(_local2);
}
_local1++;
}
return(_local2);
}
function LastSlide(i, j) {
var _local1 = 0;
while (_local1 < i) {
if (Matrix[_local1][j] != "0") {
return(false);
}
_local1++;
}
return(true);
}
function FallDown(Matrix) {
function FallColomn(j) {
var N = 0;
var Z = -1;
var S = 0;
var i = (Matrix.length - 1);
while (i >= 0) {
Z--;
if (Matrix[i][j] == "0") {
if ((N != 0) && (!LastSlide(i, j))) {
Z = ++N;
S++;
}
} else if (Matrix[i][j] == "no") {
N++;
if (Z > 0) {
Z++;
}
} else {
if (Z == 0) {
N--;
}
if (((((((Matrix[i][j].substr(0, 1) == "c") || (Matrix[i][j] == "Bomb")) || (Matrix[i][j] == "Lightning")) || (Matrix[i][j] == "watch")) || (Matrix[i][j] == "Shufle")) && ((Matrix[i + 1][j] == undefined) || (Matrix[i + 1][j] == "0"))) && (LastIsArt(i, j))) {
Falling = true;
N++;
var temp = Matrix[i][j];
MoveArt(i, j, temp);
Matrix[i][j] = "no";
} else if (N) {
var slide = eval (FindName(i, j));
var k = (i + N);
var t = 0;
while (t < Matrix.length) {
if ((Matrix[t][j] == "no") && (Matrix[t + 1][j] != "no")) {
k = t;
}
t++;
}
slide._name = FindName(k, j);
var X = slide._x;
var Y = slide._y;
clearInterval(_root["m" + String(slide)]);
_root["m" + String(slide)] = setInterval(FALL, 0, slide, Y, Y + ((k - i) * Size), getTimer());
Matrix[k][j] = Matrix[i][j];
Matrix[i][j] = "no";
}
}
i--;
}
var l = 0;
while (Matrix[l][j] == "0") {
l++;
}
if (Z > 0) {
N = N - (S - 1);
}
var i = N;
while (i > 0) {
i--;
var k = (i + l);
var temp111 = Math.round(Math.random() * (map[RoundCountry][RoundSity].chips.length - 1));
var Name = ("slide" + Number(Number(map[RoundCountry][RoundSity].chips[temp111]) + 1));
var X = (GlobalX + (j * Size));
var Y = (GlobalY - ((N - k) * Size));
var t = 0;
while (t < Matrix.length) {
if ((Matrix[t][j] == "no") && (Matrix[t + 1][j] != "no")) {
k = t;
}
t++;
}
Matrix[k][j] = Name;
eval (("s" + k) + j).removeMovieClip();
_root.attachMovie(Name, ("s" + k) + j, _root.getNextHighestDepth(), {_x:X, _y:Y, _alpha:0});
eval (("s" + k) + j)._x = eval (("s" + k) + j)._x + ((Size / 2) - (eval (("s" + k) + j)._width / 2));
Name = ("s" + k) + j;
clearInterval(_root["m" + String(eval (Name))]);
InitSlide(Name);
_root["m" + String(eval (Name))] = setInterval(FALL, 0, eval (Name), eval (Name)._y, ((GlobalY + (k * Size)) + (Size / 2)) - (eval (Name)._height / 2), getTimer());
}
FLY.swapDepths(_root.getNextHighestDepth());
}
clearInterval(fall);
notBlock = false;
Fall = true;
clearInterval(refreshing);
refreshing = setInterval(function () {
if (!Fall) {
clearInterval(refreshing);
CheckFall();
}
}, 3);
StopHint();
var j = 0;
while (j < Matrix[0].length) {
FallColomn(j);
j++;
}
}
function MoveArt(i, j, Name) {
var temp = Name;
if ((Name == "Bomb") && (Bombc)) {
Name = "a" + Name;
} else if ((Name == "Lightning") && (Lightningc)) {
Name = "a" + Name;
} else if ((Name == "watch") && (Watchc)) {
Name = "a" + Name;
} else if ((Name == "Shufle") && (Shuflec)) {
Name = "a" + Name;
}
moveart = true;
var End = (GlobalY + ((i + 2.5) * Size));
var slide = FindName(i, j);
FLY.attachMovie(temp, Name + "s", FLY.getNextHighestDepth(), {_alpha:50});
FLY[Name + "s"]._x = (eval (slide)._x + (Size / 2)) - (FLY[Name + "s"]._width / 2);
FLY[Name + "s"]._y = (eval (slide)._y + (Size / 2)) - (FLY[Name + "s"]._height / 2);
_root[Name + "s"] = new Color(FLY[Name + "s"]);
_root[Name + "s"].setRGB(0);
FLY.attachMovie(temp, Name, FLY.getNextHighestDepth());
if (Name.substr(0, 1) == "c") {
FLY[Name]._x = (eval (slide)._x + (Size / 2)) - (ArtPos[Matrix[i][j].substr(2, 2)].W / 2);
FLY[Name]._y = ((eval (slide)._y + (Size / 2)) + (ArtPos[Matrix[i][j].substr(2, 2)].H / 2)) - 42;
} else {
FLY[Name]._x = ((eval (slide)._x + (Size / 2)) - (FLY[Name]._width / 2)) + 2;
FLY[Name]._y = ((eval (slide)._y + (Size / 2)) - (FLY[Name]._height / 2)) + 2;
}
eval (slide).removeMovieClip();
if (Name.substr(0, 1) == "c") {
var EndX = ArtPos[Number(Name.substr(2, 2))].x;
var EndY = ArtPos[Number(Name.substr(2, 2))].y;
} else if (temp == "Bomb") {
var EndX = BombX;
var EndY = BombY;
Bombc++;
hmove = setInterval(function () {
clearInterval(hmove);
TextShow(BombText, "x" + Bombc, "sl", 0, 0, 0, 100);
FLY[Name].onPress = onBombClick;
}, bonus_s.duration - 1400);
} else if (temp == "Lightning") {
Lightningc++;
var EndX = LightningX;
var EndY = LightningY;
dmove = setInterval(function () {
clearInterval(dmove);
TextShow(LiText, "x" + Lightningc, "sl", 0, 0, 0, 100);
FLY[Name].onPress = onLightningClick;
}, bonus_s.duration - 1400);
} else if (temp == "watch") {
Watchc++;
var EndX = WatX;
var EndY = WatY;
wmove = setInterval(function () {
clearInterval(wmove);
TextShow(WatchText, "x" + Watchc, "sl", 0, 0, 0, 100);
FLY[Name].onPress = onWatchClick;
}, bonus_s.duration - 1400);
} else if (temp == "Shufle") {
Shuflec++;
var EndX = ShufleX;
var EndY = ShufleY;
lmove = setInterval(function () {
clearInterval(lmove);
TextShow(ShuText, "x" + Shuflec, "sl", 0, 0, 0, 100);
FLY[Name].onPress = onShufleClick;
}, bonus_s.duration - 1400);
}
var a;
var b;
var c;
var x1;
var x2;
var x3;
var x4;
var y1;
var y2;
var y3;
var y4 = 0;
x1 = FLY[Name]._x;
y1 = FLY[Name]._y;
x0 = FLY[Name]._x;
y0 = FLY[Name]._y + 50;
a = (140 * Math.random()) - 70;
b = 7;
c = 2;
x2 = FLY[Name]._x - a;
y2 = FLY[Name]._y + a;
x4 = EndX;
y4 = EndY;
if (temp.substr(0, 1) == "c") {
a = (200 * Math.random()) - 100;
} else {
a = 100;
}
x5 = 300 - a;
y5 = 200 + a;
x3 = EndX - (20 * Math.random());
y3 = EndY - (50 * Math.random());
_root["Sx" + Name] = new Spline();
_root["Sy" + Name] = new Spline();
_root["Ssx" + Name] = new Spline();
_root["Ssy" + Name] = new Spline();
InitSpline(_root["Sx" + Name], _root["Sy" + Name], x1, y1, x0, y0, x5, y5, x3, y3, x4, y4);
InitSpline(_root["Ssx" + Name], _root["Ssy" + Name], x1, y1, x0 + c, y0 + b, x5 + c, y5 + b, x3 + c, y3 + b, x4, y4);
if (temp.substr(0, 1) == "c") {
art_s.start(SoundOn);
watch_s.start(SoundOn);
snd = 3000;
} else {
snd = bonus_s.duration - 1400;
bonus_s.start(SoundOn);
}
var i = 10;
_root["TAIL" + Name] = setInterval(function () {
if (i < NumTail) {
_root.attachMovie("tail", ("tail" + i) + Name, _root.getNextHighestDepth(), {_x:FLY[Name]._x + (Math.random() * 20), _y:FLY[Name]._y + (Math.random() * 20)});
i++;
} else {
clearInterval(_root["TAIL" + Name]);
}
}, TailPeriod);
AddingTime = 0;
clearInterval(AddT);
AddT = setInterval(AddTime, 50, snd / 20);
_root[MATP + Name] = setInterval(MoveArtToPosition, Speed, Name, temp, x4, y4, a, b, c, getTimer(), x1, snd);
}
function MoveArtToPosition(Name, temp, EndX, EndY, a, b, c, Time, x2, snd) {
moveart = true;
var Done = false;
var Time1 = getTimer();
if ((Time1 - Time) >= snd) {
Done = true;
} else {
var l = ((Time1 - Time) / snd);
FLY[Name]._x = _root["Sx" + Name].getPoint(l);
FLY[Name]._y = _root["Sy" + Name].getPoint(l);
FLY[Name + "s"]._x = _root["Ssx" + Name].getPoint(l);
FLY[Name + "s"]._y = _root["Ssy" + Name].getPoint(l);
}
if (Done) {
clearInterval(_root[MATP + Name]);
var i = 10;
while (i < NumTail) {
eval (("tail" + i) + Name).removeMovieClip();
i++;
}
clearInterval(TAIL);
FLY[Name]._x = EndX;
FLY[Name]._y = EndY;
moveart = false;
FLY["a" + temp].removeMovieClip();
FLY[Name].fon.removeMovieClip();
FLY[Name + "s"].removeMovieClip();
ArtPos[Number(Name.substr(2, 2))].is = true;
delete _root["Sx" + Name];
delete _root["Sy" + Name];
delete _root["Ssx" + Name];
delete _root["Ssy" + Name];
CheckEnd(Matrix);
if (_root[("h" + temp) + "2"]) {
_root[("h" + temp) + "2"] = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, ("h" + temp) + "2");
}
}
}
function CheckEnd(Matrix) {
zylomfixwin = true;
var _local4 = true;
var _local2 = 0;
while (_local2 < Matrix.length) {
var _local1 = 0;
while (_local1 < Matrix[_local2].length) {
if (Matrix[_local2][_local1].substr(0, 1) == "c") {
_local4 = false;
break;
}
_local1++;
}
_local2++;
}
zylomfixwin = false;
if (_local4) {
zylomfixwin = true;
clearInterval(ER);
ER = setInterval(EndRound, 20, Matrix);
} else if (hart2) {
hart2 = false;
clearInterval(HHH);
HHH = setInterval(Hints, 500, "hart2");
}
}
function EndRound(Matrix) {
if (moveart && (!notBlock)) {
clearInterval(ER);
} else if (zylomfixoutoftime || ((redytoend && (notBlock)) && (!moveart))) {
time_s.start(SoundOn);
fon.SUNN.removeMovieClip();
SunOut();
notBlock = false;
clearInterval(ER);
clearInterval(stopping);
clearInterval(SunEn);
RoundSity++;
if (RoundSity == map[RoundCountry].length) {
RoundSity = 0;
}
FromHint();
clearInterval(blinking);
StopTimer();
bl.removeMovieClip();
inMenu = false;
mainmenu.removeMovieClip();
EEE = getTimer();
EndTime = Math.abs(Math.round((EndTime - EEE) / 1000));
TimeBonus = 0;
endstring = Matrix.length;
bl.removeMovieClip();
_root.attachMovie("black", "bl", _root.getNextHighestDepth());
bl._width = 520;
bl._height = 390;
bl._alpha = 0;
bl.useHandCursor = false;
bl.onPress = function () {
clearInterval(endinground);
endinground = setInterval(function () {
clearInterval(endinground);
var i = 0;
while (i < Matrix.length) {
var j = 0;
while (j < Matrix[0].length) {
clearInterval(_root[("b" + i) + j]);
eval (("s" + i) + j).removeMovieClip();
eval (("si" + i) + j).removeMovieClip();
j++;
}
i++;
}
clearInterval(ending);
bigtext.removeMovieClip();
endstring = 0;
TIME.time1._x = TimeLength;
score = score + ((EndTime * 10) + Add);
TextShow(SCORE, String(score), "sc", 0, 0, 1);
if (score >= NextLife) {
life_s.start(SoundOn);
NextLife = NextLife + 50000;
}
TimeBonus = TimeBonus + (Add + (EndTime * 10));
Add = 0;
ShowStats();
}, 800);
};
clearInterval(ending);
var str = normal;
if (EndTime >= ((4 * totaltime) / 5000)) {
str = fast;
} else if (EndTime <= (totaltime / 5000)) {
str = slow;
}
if (RoundSity == 100) {
str = textgameover;
}
bigtext.removeMovieClip();
_root.attachMovie("Text", "bigtext", _root.getNextHighestDepth(), {_x:360, _y:180});
TextShow(bigtext, str, "B", -5, 20, 3);
ending = setInterval(Ending, 200, "r");
}
}
function Ending(chk) {
notBlock = false;
if (chk == "r") {
endstring--;
if (endstring == -1) {
clearInterval(ending);
ending = setInterval(Ending, 0);
} else {
var j = 0;
while (j < Matrix[0].length) {
if (eval (("s" + endstring) + j) != undefined) {
var temp = ("blow" + Matrix[endstring][j].substr(5, 1));
var T = getTimer();
_root[("b" + endstring) + j] = setInterval(DissapearSlide, 0, endstring, j, T);
}
eval (("si" + endstring) + j).removeMovieClip();
fon[(("s" + endstring) + j) + "fon"].gotoAndStop(1);
j++;
}
}
} else if (EndTime <= 0) {
clearInterval(ending);
bigtext.removeMovieClip();
time_s.stop();
clearInterval(endinground);
stats1 = setInterval(ShowStats, 100);
} else {
EndTime = EndTime - 2;
var temp = ((100 * (EndTime * 1000)) / totaltime);
TIME.time1._x = ((temp - 100) * (-TimeLength)) / 100;
TimeBonus = TimeBonus + 20;
scores_s.start(SoundOn);
Score(20, "y");
}
}
function DissapearSlide(i, j, T) {
var _local2 = getTimer();
var _local3 = 1000;
if (_local2 > (T + _local3)) {
clearInterval(_root[("b" + i) + j]);
_root[("s" + i) + j].removeMovieClip();
} else {
var _local7 = 2 + Math.round((13 * (_local2 - T)) / _local3);
var _local8 = 100 - ((100 * (_local2 - T)) / _local3);
_root[("s" + i) + j].gotoAndStop(_local7);
_root[("s" + i) + j]._alpha = _local8;
}
}
function ShowStats() {
if (Add == 0) {
clearInterval(stats1);
bl.removeMovieClip();
_root.attachMovie("black", "bl", _root.getNextHighestDepth(), {_x:0, _y:0, _alpha:50, _width:520, _height:390});
bl.onPress = AAA;
bl.useHandCursor = false;
stats.removeMovieClip();
_root.attachMovie("statspanel", "stats", _root.getNextHighestDepth());
bl._alpha = 50;
bl._width = 520;
bl._height = 390;
stats._x = 200;
stats._y = 50;
TextShow(stats.headtext, statisticsTEXT, "s", 0, 15, 1);
var _local2 = new Array({}, {L:texttiles, R:String(Tiles)}, {L:textmatches, R:String(Matches)}, {L:textchain, R:String(MaxChain)}, {L:texttime, R:String(Math.round(levelTime / 1000) + textseconds)}, {L:textbonus, R:String(TimeBonus)}, {L:textscore, R:String(score)});
totalTime = totalTime + levelTime;
clearInterval(scoring);
scoring = setInterval(GetScoreString, 100, 1, _local2);
levelTime = 0;
}
}
function GetScoreString(i, SA) {
stats_s.start(SoundOn);
clearInterval(scoring);
TextShow(stats["txt0" + i], SA[i].L, "s", -3, 0, 0);
TextShow(stats["txt" + i], SA[i].R, "s", -2, 0, 2);
i++;
if (i != SA.length) {
scoring = setInterval(GetScoreString, 200, i, SA);
}
}
function ShowNag() {
clearInterval(scoring);
if ((numTrialLevel != null) && (Number(GetCurrentRound(RoundCountry, RoundSity)) >= Number(numTrialLevel))) {
RoundSity = 5;
RoundCountry = 3;
}
ClearRound(Matrix);
if (RoundSity > 90) {
Nag();
} else if (RoundSity == 0) {
CompleteArtefact();
} else if (nagtime && ((NagCounter % nagtime) == 0)) {
NagCounter = 0;
Nag();
} else {
InitRound();
}
}
function Nag() {
nag.removeMovieClip();
_root.attachMovie("nag", "nag", _root.getNextHighestDepth());
TextShow(nag.txt1, nagdownload, "s", -1, 12, 1);
TextShow(nag.texting, nagmore, "t", -1, 12, 0);
if (RoundCountry <= MaxC) {
TextShow(nag.txt3, nagcontinue, "s", -1, 12, 1);
TextShow(nag.podp, nagtextnext, "t", -1, 12, 1);
} else if (RoundSity > 90) {
if (score > 0) {
_global.GameSwitch = false;
score = 0;
}
TextShow(nag.txt3, nagrestart, "s", -1, 12, 1);
TextShow(nag.podp, nagtextover, "t", -1, 12, 1);
} else {
if (score > 0) {
_global.GameSwitch = false;
score = 0;
}
TextShow(nag.txt3, nagrestart, "s", -1, 12, 1);
TextShow(nag.podp, nagtextend, "t", -1, 12, 1);
nag.podp._y = nag.podp._y - 10;
}
}
function CompleteArtefact() {
var Xs = 40;
var Ys = 70;
if (RoundCountry == 0) {
var temp = "slide1";
var _local9 = 17;
var _local8 = 47;
} else if (RoundCountry == 1) {
var temp = "slide2";
var _local9 = 10;
var _local8 = 35;
} else {
var temp = "slide3";
var _local9 = 6;
var _local8 = 41;
}
Art_s.start(SoundOn);
MovieClip.prototype.onLoad;
_root.createEmptyMovieClip("FLY", _root.getNextHighestDepth());
FLY.attachMovie("svitok", "m1", FLY.getNextHighestDepth());
TextShow(FLY.m1.textb, textcontinue, "s", 0, 0, 1);
TextShow(FLY.m1.desc0, map[RoundCountry].Art, "b", 0, 20, 1);
TextShow(FLY.m1.desc, map[RoundCountry].description, "s", -1, 20, 0);
FLY.m1.bbb.attachMovie("luchi", "eff", 0, {_x:(_local9 + Xs) + 80, _y:(_local8 + Ys) + 80});
FLY.attachMovie("c" + RoundCountry, "full", FLY.getNextHighestDepth(), {_x:_local9 + Xs, _y:_local8 + Ys});
var _local4 = 0;
while (_local4 < 45) {
var _local3 = ("c" + RoundCountry) + _local4;
var _local7 = ArtPos[_local4].x;
var _local6 = ArtPos[_local4].y;
FLY.attachMovie(_local3, _local3, FLY.getNextHighestDepth());
FLY[_local3]._x = _local7 + Xs;
FLY[_local3]._y = _local6 + Ys;
_local4++;
}
clearInterval(disapear);
disapear = setInterval(function () {
var _local1 = Math.round(Math.random() * 44);
var _local3 = 0;
while (FLY[("c" + RoundCountry) + _local1] == undefined) {
_local1++;
if (_local1 == 45) {
if (_local3 == 0) {
_local1 = 0;
_local3 = 1;
} else {
_local3 = 2;
break;
}
}
}
if (_local3 != 2) {
var _local2 = 0;
while (_local2 < 1) {
FLY.attachMovie("blow", ("b" + _local1) + _local2, FLY.getNextHighestDepth(), {_x:(Xs + 30) + (Math.random() * 100), _y:(Ys + 50) + (Math.random() * 100), _xscale:150, _yscale:150});
SetBlow(FLY[("b" + _local1) + _local2], temp, 2);
_local2++;
}
FLY.attachMovie("blow", "b" + _local1, FLY.getNextHighestDepth(), {_x:FLY[("c" + RoundCountry) + _local1]._x + 5, _y:FLY[("c" + RoundCountry) + _local1]._y + 10, _xscale:150, _yscale:150});
SetBlow(FLY["b" + _local1], temp, 2);
FLY[("c" + RoundCountry) + _local1].removeMovieClip();
} else {
clearInterval(disapear);
FLY.m1.bbb.eff.removeMovieClip();
}
}, 100);
}
function MoveUp(slide, chk) {
var i = FindIndexX(String(slide));
var j = FindIndexY(String(slide));
i--;
if (((Matrix[i][j] != "0") && (Matrix[i][j] != undefined)) && (Matrix[i][j].substr(0, 4) != "lock")) {
slide1 = FindName(i, j);
eval (slide1).gotoAndPlay(2);
var T = getTimer();
clearInterval(_root["m" + String(eval (slide))]);
clearInterval(_root["m" + String(eval (slide1))]);
_root["m" + String(eval (slide))] = setInterval(MovingUp, Speed, eval (slide), eval (slide)._y, chk, T);
_root["m" + String(eval (slide1))] = setInterval(MovingDown, Speed, eval (slide1), eval (slide1)._y, chk, T);
} else {
notBlock = true;
}
}
function MoveDown(slide, chk) {
var i = FindIndexX(String(slide));
var j = FindIndexY(String(slide));
i++;
if (((Matrix[i][j] != "0") && (Matrix[i][j] != undefined)) && (Matrix[i][j].substr(0, 4) != "lock")) {
slide1 = FindName(i, j);
eval (slide1).gotoAndPlay(2);
var T = getTimer();
clearInterval(_root["m" + String(eval (slide))]);
clearInterval(_root["m" + String(eval (slide1))]);
_root["m" + String(eval (slide))] = setInterval(MovingDown, Speed, eval (slide), eval (slide)._y, chk, T);
_root["m" + String(eval (slide1))] = setInterval(MovingUp, Speed, eval (slide1), eval (slide1)._y, chk, T);
} else {
notBlock = true;
}
}
function MoveLeft(slide, chk) {
var i = FindIndexX(String(slide));
var j = FindIndexY(String(slide));
j--;
if (((Matrix[i][j] != "0") && (Matrix[i][j] != undefined)) && (Matrix[i][j].substr(0, 4) != "lock")) {
slide1 = FindName(i, j);
eval (slide1).gotoAndPlay(2);
var T = getTimer();
clearInterval(_root["m" + String(eval (slide))]);
clearInterval(_root["m" + String(eval (slide1))]);
_root["m" + String(eval (slide))] = setInterval(MovingLeft, Speed, eval (slide), eval (slide)._x, chk, T);
_root["m" + String(eval (slide1))] = setInterval(MovingRight, Speed, eval (slide1), eval (slide1)._x, chk, T);
} else {
notBlock = true;
}
}
function MoveRight(slide, chk) {
var i = FindIndexX(String(slide));
var j = FindIndexY(String(slide));
j++;
if (((Matrix[i][j] != "0") && (Matrix[i][j] != undefined)) && (Matrix[i][j].substr(0, 4) != "lock")) {
slide1 = FindName(i, j);
eval (slide1).gotoAndPlay(2);
var T = getTimer();
clearInterval(_root["m" + String(eval (slide))]);
clearInterval(_root["m" + String(eval (slide1))]);
_root["m" + String(eval (slide))] = setInterval(MovingRight, Speed, eval (slide), eval (slide)._x, chk, T);
_root["m" + String(eval (slide1))] = setInterval(MovingLeft, Speed, eval (slide1), eval (slide1)._x, chk, T);
} else {
notBlock = true;
}
}
function Follow() {
this._x = _root._xmouse - 13;
this._y = _root._ymouse - 13;
if (this._name != "ramka") {
Mouse.hide();
}
}
function onBombClick() {
if ((!moveart) && (notBlock)) {
if (!Bombuse) {
Bombuse = true;
Bombc--;
FLY.Bomb._alpha = 50;
notBlock = false;
Mouse.hide();
_root.attachMovie("Bomb", "ham", _root.getNextHighestDepth());
ham._x = BombX;
ham._y = BombY;
ham.onMouseMove = Follow;
}
} else if (Bombuse) {
FLY.Bomb._alpha = 100;
ham.removeMovieClip();
Bombc++;
Bombuse = false;
Mouse.show();
notBlock = true;
}
}
function onLightningClick() {
if ((!moveart) && (notBlock)) {
if (!LiUse) {
LiUse = true;
Lightningc--;
FLY.Lightning._alpha = 50;
notBlock = false;
Mouse.hide();
_root.attachMovie("Lightning", "lam", _root.getNextHighestDepth());
lam._x = LightningX;
lam._y = LightningY;
lam.onMouseMove = Follow;
}
} else if (LiUse) {
FLY.Lightning._alpha = 100;
lam.removeMovieClip();
Lightningc++;
LiUse = false;
Mouse.show();
notBlock = true;
}
}
function onWatchClick() {
if (notBlock && (!moveart)) {
warn.removeMovieClip();
watch_s.start(SoundOn);
Watchc--;
TextShow(WatchText, "x" + Watchc, "sl", 0, 0, 0, 100);
if (!Watchc) {
FLY.watch.removeMovieClip();
WatchText.TEXT.removeMovieClip();
}
var _local1 = EndTime;
AddingTime = 0;
_local1 = _local1 + (totaltime / 5);
if (_local1 > (totaltime + getTimer())) {
_local1 = totaltime + getTimer();
}
clearInterval(AddT);
AddT = setInterval(AddTime, 50, (_local1 - EndTime) / 20);
}
}
function AddTime(times) {
AddingTime++;
EndTime = EndTime + times;
Timing();
if (AddingTime == 20) {
clearInterval(AddT);
}
}
function onShufleClick() {
Blink.gotoAndStop(1);
Blink = "no";
eval (shufle1).gotoAndStop(1);
delete shufle1;
if ((!moveart) && (notBlock)) {
if (!ShUse) {
ShUse = true;
Shuflec--;
FLY.Shufle._alpha = 50;
notBlock = false;
Mouse.hide();
_root.attachMovie("Shufle", "sum", _root.getNextHighestDepth());
sum._x = ShufleX;
sum._y = ShufleY;
sum.onMouseMove = Follow;
}
} else if (ShUse) {
FLY.Shufle._alpha = 100;
sum.removeMovieClip();
Shuflec++;
ShUse = false;
Mouse.show();
notBlock = true;
}
}
function Shufle1(N1, N2) {
var x1 = eval (N1)._x;
var x2 = eval (N2)._x;
var y1 = eval (N1)._y;
var y2 = eval (N2)._y;
var i1 = FindIndexX(N1);
var i2 = FindIndexX(N2);
var j1 = FindIndexY(N1);
var j2 = FindIndexY(N2);
var d1 = _root.getNextHighestDepth();
var d2 = (d1 + 1);
var temp = Matrix[i1][j1];
Matrix[i1][j1] = Matrix[i2][j2];
Matrix[i2][j2] = temp;
if (N1 != N2) {
delete shufle1;
delete shufle2;
sum.removeMovieClip();
if (!Shuflec) {
FLY.Shufle.removeMovieClip();
ShuText.TEXT.removeMovieClip();
} else {
FLY.Shufle._alpha = 100;
TextShow(ShuText, "x" + Shuflec, "sl", 0, 0, 0, 100);
}
Mouse.show();
ShUse = false;
eval (N1).removeMovieClip();
eval (N2).removeMovieClip();
_root.attachMovie(Matrix[i1][j1], N1, d1, {_x:x2, _y:y2});
_root.attachMovie(Matrix[i2][j2], N2, d2, {_x:x1, _y:y1});
InitSlide(N1);
InitSlide(N2);
var T = getTimer();
clearInterval(shufling);
Shufle_s.start(SoundOn);
shufling = setInterval(Shufling, Speed, T, x1, x2, y1, y2, N1, N2);
} else {
var temp = Matrix[i1][j1];
Matrix[i1][j1] = Matrix[i2][j2];
Matrix[i2][j2] = temp;
}
}
function Shufling(T, x1, x2, y1, y2, N1, N2) {
var time = getTimer();
var ST = 1700;
if (time >= (T + ST)) {
eval (N1)._x = x1;
eval (N1)._y = y1;
eval (N2)._x = x2;
eval (N2)._y = y2;
eval (N2).gotoAndStop(1);
eval (N1).gotoAndStop(1);
clearInterval(shufling);
if (FindChain(Matrix)) {
fall = setInterval(FallDown, 200, Matrix);
} else {
notBlock = true;
}
} else {
var x = (x1 + (((x2 - x1) * (time - T)) / ST));
var y = (y1 + (((y2 - y1) * (time - T)) / ST));
var r = (2 + Math.round((12 * (time - T)) / ST));
eval (N2)._x = x;
eval (N2)._y = y;
eval (N2).gotoAndStop(r);
var x = ((x2 + x1) - x);
var y = ((y2 + y1) - y);
eval (N1)._x = x;
eval (N1)._y = y;
eval (N1).gotoAndStop(14 - r);
}
}
function DragSlide(x, x1, y, y1, slide) {
notBlock = false;
var _local1 = String(slide);
if ((x > (x1 + Step)) && (Math.abs(x - x1) >= Math.abs(y - y1))) {
CheckSuccess(FindIndexX(_local1), FindIndexY(_local1), FindIndexX(_local1), FindIndexY(_local1) - 1);
MoveLeft(slide);
} else if (((x + Step) < x1) && (Math.abs(x - x1) >= Math.abs(y - y1))) {
CheckSuccess(FindIndexX(_local1), FindIndexY(_local1), FindIndexX(_local1), Number(FindIndexY(_local1)) + 1);
MoveRight(slide);
} else if (((y + Step) < y1) && (Math.abs(x - x1) < Math.abs(y - y1))) {
CheckSuccess(FindIndexX(_local1), FindIndexY(_local1), Number(FindIndexX(_local1)) + 1, FindIndexY(_local1));
MoveDown(slide);
} else if ((y > (y1 + Step)) && (Math.abs(x - x1) < Math.abs(y - y1))) {
CheckSuccess(FindIndexX(_local1), FindIndexY(_local1), FindIndexX(_local1) - 1, FindIndexY(_local1));
MoveUp(slide);
} else {
notBlock = true;
}
}
function OverMove() {
var _local5 = IsNotLock(this._name);
if (((notBlock && (!OnMouse)) && (!hinting)) && (_local5)) {
OnMouse = true;
if (Blink != this) {
var _local4 = FindIndexX(this._name);
var _local3 = FindIndexY(this._name);
_root[("si" + _local4) + _local3].removeMovieClip();
_root.attachMovie("shine", ("si" + _local4) + _local3, _root.getNextHighestDepth(), {_x:GlobalX + (_local3 * Size), _y:GlobalY + (_local4 * Size)});
}
}
if (Bombuse) {
OnMouse = true;
BombAction(this._name, "over");
}
if (LiUse) {
OnMouse = false;
LiAction(this._name, "over");
}
}
function OutMove() {
var _local3 = IsNotLock(this._name);
if (notBlock && (_local3)) {
if ((Blink != this) && (OnMouse)) {
OnMouse = false;
var _local5 = FindIndexX(this._name);
var _local4 = FindIndexY(this._name);
_root[("si" + _local5) + _local4].removeMovieClip();
} else if (Blink == this) {
OnMouse = false;
}
}
if (Bombuse) {
OnMouse = false;
BombAction(this._name, "out");
}
if (LiUse) {
OnMouse = false;
LiAction(this._name, "out");
}
}
function LiAction(Name, chk) {
LA = new Array();
var _local6 = Number(FindIndexX(Name));
var _local5 = Number(FindIndexY(Name));
var _local4 = Matrix[_local6][_local5];
if (_local4.substr(5, 3) == "sli") {
_local4 = _local4.substr(5, 8);
}
if (_local4.substr(0, 3) == "sli") {
Lightning_s.start((chk == "click") && (SoundOn));
var _local3 = 0;
while (_local3 < Matrix.length) {
var _local2 = 0;
while (_local2 < Matrix[0].length) {
switch (chk) {
case "over" :
if ((Matrix[_local3][_local2] == _local4) || (Matrix[_local3][_local2].substr(5, 8) == _local4)) {
fon[(("s" + _local3) + _local2) + "fon"].gotoAndPlay(1);
}
break;
case "out" :
if ((Matrix[_local3][_local2] == _local4) || (Matrix[_local3][_local2].substr(5, 8) == _local4)) {
fon[(("s" + _local3) + _local2) + "fon"].gotoAndStop(1);
}
break;
case "click" :
LiUse = false;
if (!((Matrix[_local3][_local2] == _local4) || (Matrix[_local3][_local2].substr(5, 8) == _local4))) {
break;
}
fon[(("s" + _local3) + _local2) + "fon"].gotoAndStop(1);
if ((_local3 != _local6) || (_local2 != _local5)) {
LightFill(_local3, _local2);
}
lam.removeMovieClip();
if (!Lightningc) {
FLY.Lightning.removeMovieClip();
LiText.TEXT.removeMovieClip();
} else {
FLY.Lightning._alpha = 100;
TextShow(LiText, "x" + Lightningc, "sl", 0, 0, 0, 100);
}
}
_local2++;
}
_local3++;
}
if (LA.length > 0) {
LA1 = new Array(LA.length);
LightFill(_local6, _local5);
_root.createEmptyMovieClip("lightt", _root.getNextHighestDepth());
LAuse(Math.round(((_local5 + 0.5) * Size) + GlobalX), Math.round(((_local6 + 0.5) * Size) + GlobalY));
}
}
}
function LAuse(x, y, chk) {
var _local1 = Math.round(Math.random() * (LA1.length - 1));
if (LA1[_local1] == undefined) {
if (chk == "no") {
LaunchSun(_local1, x, y);
} else {
Launch(_local1, x, y, chk);
}
} else {
var _local2 = 0;
while (LA1[_local1] != undefined) {
_local1++;
if (_local1 == LA1.length) {
if (_local2 == 0) {
_local1 = 0;
_local2 = 1;
} else {
_local2 = 2;
break;
}
}
}
if (_local2 != 2) {
if (chk == "no") {
LaunchSun(_local1, x, y);
} else {
Launch(_local1, x, y, chk);
}
} else {
clearInterval(fall);
fall = setInterval(function () {
clearInterval(fall);
if (chk != "no") {
BlowLight(LA);
fall = setInterval(function () {
clearInterval(fall);
Mouse.show();
FallDown(Matrix);
}, 200);
} else {
fall = setInterval(function () {
if (!SUNA) {
BlowLight(LA, 1);
clearInterval(fall);
Mouse.show();
FallDown(Matrix);
}
}, 200);
}
}, 200);
}
}
}
function ZZR(i, j, x, y) {
_root[("s" + i) + j]._x = ((GlobalX + (Size * j)) + Math.random()) + 0.5;
_root[("s" + i) + j]._y = ((GlobalY + (Size * i)) + Math.random()) + 0.5;
lightt[("e" + x) + y].q._x = (-Math.random()) * 50;
lightt[("e" + x) + y].q._y = (Math.random() * 10) - 5;
}
function Launch(t, x, y, chk) {
LA1[t] = 1;
var x1 = LA[t].x;
var y1 = LA[t].y;
clearInterval(_root[("l" + x1) + y1]);
_root[("l" + x1) + y1] = setInterval(function () {
clearInterval(_root[("l" + x1) + y1]);
var _local3 = Math.sqrt(((x - x1) * (x - x1)) + ((y - y1) * (y - y1)));
var _local2 = (y1 - y) / (x1 - x);
_local2 = Math.atan(_local2);
_local2 = (_local2 * 180) / Math.PI;
if (x1 < x) {
_local2 = _local2 + 180;
}
if ((x == x1) && (y > y1)) {
_local2 = -90;
}
if ((x == x1) && (y < y1)) {
_local2 = 90;
}
if (_local3 >= 5) {
Lightning_s.start(SoundOn);
lightt[("e" + x1) + y1].removeMovieClip();
lightt.createEmptyMovieClip(("e" + x1) + y1, lightt.getNextHighestDepth());
lightt[("e" + x1) + y1]._x = x;
lightt[("e" + x1) + y1]._y = y;
lightt[("e" + x1) + y1].attachMovie("energy", "q", lightt[("e" + x1) + y1].getNextHighestDepth());
lightt[("e" + x1) + y1].attachMovie("LIM", "m", lightt[("e" + x1) + y1].getNextHighestDepth());
lightt[("e" + x1) + y1].q.setMask(lightt[("e" + x1) + y1].m);
lightt[("e" + x1) + y1].m._width = _local3;
lightt[("e" + x1) + y1]._rotation = _local2;
clearInterval(_root[("l" + x1) + y1]);
_root[("ls" + x1) + y1] = setInterval(ZZR, Speed, LA[t].i, LA[t].j, LA[t].x, LA[t].y);
}
if (chk != "no") {
LAuse(x1, y1);
} else {
LAuse(SunX, SunY, chk);
}
}, 100);
}
function LaunchSun(t, x, y) {
function FromSun(t, q) {
var _local2 = getTimer();
if (_local2 >= _root["LT" + t]) {
clearInterval(_root[("mSS" + t) + q]);
_root[("mSS" + t) + q] = setInterval(SunAction, Speed, _local2, t, q);
q++;
clearInterval(_root["mmSS" + t]);
if (q != SunP) {
if (q == 1) {
_root["LT" + t] = _root["LT" + t] + 50;
} else {
_root["LT" + t] = _root["LT" + t] + 20;
}
_root["mmSS" + t] = setInterval(function () {
FromSun(t, q);
}, 0);
}
}
}
_root["SSx" + t] = new Spline();
_root["SSy" + t] = new Spline();
var _local3 = 0;
var _local2 = 0;
while (_local2 < LA1.length) {
if (LA1[_local2] == 1) {
_local3 = 200 + (Math.random() * 300);
break;
}
_local2++;
}
LA1[t] = 1;
var _local5 = LA[t].x;
var _local4 = LA[t].y;
var _local7 = ((Math.random() * 300) - 150) * 0.65;
var _local10 = (_local4 - y) / (_local5 - x);
var _local9 = ((_local5 + x) / 2) - (_local7 * _local10);
var _local8 = ((_local4 + y) / 2) + _local7;
InitSpline(_root["SSx" + t], _root["SSy" + t], x, y, _local9, _local8, _local5, _local4);
clearInterval(_root[("l" + x) + y]);
_root[("l" + x) + y] = setInterval(function () {
clearInterval(_root[("l" + x) + y]);
SunRay_s.start(SoundOn);
var q = 1;
while (q < SunP) {
lightt[("e" + t) + q].removeMovieClip();
lightt.attachMovie("star112", ("e" + t) + q, lightt.getNextHighestDepth());
lightt[("e" + t) + q]._x = -1000;
lightt[("e" + t) + q]._alpha = ((31 - q) * 100) / 30;
lightt[("e" + t) + q]._y = -1000;
q++;
}
var q = 0;
lightt.attachMovie("star111", ("e" + t) + q, lightt.getNextHighestDepth());
lightt[("e" + t) + q]._x = -1000;
_root["LT" + t] = getTimer();
clearInterval(_root["mmSS" + t]);
_root["mmSS" + t] = setInterval(function () {
FromSun(t, q);
}, 0);
LAuse(SunX, SunY, "no");
}, _local3);
}
function SunAction(T1, t, q) {
SUNA = true;
var _local2 = getTimer();
var _local3 = 500;
if (_local2 >= (T1 + _local3)) {
clearInterval(_root[("mSS" + t) + q]);
if (q == (SunP - 1)) {
delete _root["SSx" + t];
delete _root["SSy" + t];
clearInterval(_root[("sss" + q) + t]);
_root[("sss" + q) + t] = setInterval(function () {
clearInterval(_root[("sss" + q) + t]);
SUNA = false;
}, 300);
} else if (q == 0) {
SunRay_s.start(SoundOn);
BlowTile(LA[t].i, LA[t].j, 1);
}
lightt[("e" + t) + q].removeMovieClip();
} else {
var _local9 = _root["SSx" + t].getPoint((_local2 - T1) / _local3);
var _local8 = _root["SSy" + t].getPoint((_local2 - T1) / _local3);
lightt[("e" + t) + q]._x = (_local9 + (Math.random() * 2)) - 1;
lightt[("e" + t) + q]._y = (_local8 + (Math.random() * 2)) - 1;
var _local7 = _root["SSx" + t].getGlobalGradient(((_local2 - T1) / _local3) + 0.05);
var _local6 = _root["SSy" + t].getGlobalGradient(((_local2 - T1) / _local3) + 0.05);
var _local5 = Math.atan2(_local6, _local7);
_local5 = (_local5 * 180) / Math.PI;
lightt[("e" + t) + q]._rotation = _local5;
if (q == 0) {
lightt[("e" + t) + q]._xscale = (lightt[("e" + t) + q]._yscale = 50 + (Math.random() * 100));
}
}
}
function BlowLight(LA, chk) {
if (chk == undefined) {
var _local2 = 0;
while (_local2 < LA.length) {
clearInterval(_root[("ls" + LA[_local2].x) + LA[_local2].y]);
BlowTile(LA[_local2].i, LA[_local2].j);
_local2++;
}
}
lightt.removeMovieClip();
}
function LightFill(i, j) {
var _local1 = new Array("x", "y");
_local1.x = Math.round(((j + 0.5) * Size) + GlobalX);
_local1.y = Math.round(((i + 0.5) * Size) + GlobalY);
_local1.i = i;
_local1.j = j;
LA.push(_local1);
}
function BombAction(Name, chk) {
var _local4 = Number(FindIndexX(Name));
var _local3 = Number(FindIndexY(Name));
var _local7 = Matrix[_local4][_local3];
Bomb_s.start((chk == "click") && (SoundOn));
var _local2 = 0;
while (_local2 < Matrix.length) {
var _local1 = 0;
while (_local1 < Matrix[0].length) {
switch (chk) {
case "over" :
if ((Math.abs(_local2 - _local4) + Math.abs(_local1 - _local3)) < 3) {
fon[(("s" + _local2) + _local1) + "fon"].gotoAndPlay(1);
}
break;
case "out" :
if ((Math.abs(_local2 - _local4) + Math.abs(_local1 - _local3)) < 3) {
fon[(("s" + _local2) + _local1) + "fon"].gotoAndStop(1);
}
break;
case "click" :
Bombuse = false;
if ((Math.abs(_local2 - _local4) + Math.abs(_local1 - _local3)) < 3) {
fon[(("s" + _local2) + _local1) + "fon"].gotoAndStop(1);
}
if (((_local2 == _local4) && (_local1 == _local3)) && ((Matrix[_local2][_local1].substr(0, 3) == "sli") || (Matrix[_local2][_local1].substr(5, 3) == "sli"))) {
fon[(("s" + _local2) + _local1) + "fon"].gotoAndStop(1);
BlowTile(_local4, _local3, 1);
} else if (((Math.abs(_local2 - _local4) + Math.abs(_local1 - _local3)) < 3) && ((Matrix[_local2][_local1].substr(0, 3) == "sli") || (Matrix[_local2][_local1].substr(5, 3) == "sli"))) {
fon[(("s" + _local2) + _local1) + "fon"].gotoAndStop(1);
BlowTile(_local2, _local1, 0);
}
ham.removeMovieClip();
if (!Bombc) {
FLY.Bomb.removeMovieClip();
BombText.TEXT.removeMovieClip();
} else {
FLY.Bomb._alpha = 100;
TextShow(BombText, "x" + Bombc, "sl", 0, 0, 0, 100);
}
clearInterval(fall);
fall = setInterval(function () {
clearInterval(fall);
Mouse.show();
FallDown(Matrix);
}, 500);
}
_local1++;
}
_local2++;
}
}
function ThisS(N) {
var _local2 = FindIndexX(N);
var _local1 = FindIndexY(N);
if (Matrix[_local2][_local1].substr(0, 1) == "s") {
return(true);
}
return(false);
}
function IsNotLock(N) {
var _local3 = FindIndexX(N);
var _local2 = FindIndexY(N);
var _local1 = Matrix[_local3][_local2];
return(_local1.substr(0, 1) != "l");
}
function Press() {
StartTimer();
Mouse.removeListener(oMouse);
var _local3 = IsNotLock(this._name);
if (ShUse && (_local3)) {
if ((shufle1 == undefined) && (ThisS(this._name))) {
shufle1 = this._name;
this.gotoAndPlay(2);
} else if (shufle1 == this._name) {
this.gotoAndStop(1);
delete shufle1;
} else if (ThisS(this._name)) {
shufle2 = this._name;
Shufle1(shufle1, shufle2);
}
} else if (notBlock && (_local3)) {
OnMouse = false;
click_s.start(SoundOn);
var _local5 = FindIndexX(this._name);
var _local4 = FindIndexY(this._name);
_root[("si" + _local5) + _local4].removeMovieClip();
OnMouse = false;
if (Blink == this) {
this.gotoAndPlay(1);
Blink = "no";
} else if (CheckClick(this)) {
this.gotoAndPlay(2);
Blink = this;
}
x = _root._xmouse;
y = _root._ymouse;
var temp = String(this);
oMouse = {};
oMouse.onMouseMove = function () {
Dragging(temp);
};
Mouse.addListener(oMouse);
value = this;
}
if (Bombuse) {
OnMouse = false;
BombAction(this._name, "click");
}
if (LiUse) {
OnMouse = false;
LiAction(this._name, "click");
}
}
function Dragging(str) {
var x1 = _root._xmouse;
var y1 = _root._ymouse;
if ((Math.abs(x - x1) > 10) || (Math.abs(y - y1) > 10)) {
Mouse.removeListener(oMouse);
if (notBlock) {
DragSlide(x, x1, y, y1, eval (str));
}
}
}
function OnSunClick() {
if (notBlock) {
clearInterval(SunEn);
SunOut();
var _local5 = 10;
Sun = 0;
notBlock = false;
fon.SUNm.removeMovieClip();
fon.SUNb.removeMovieClip();
fon.attachMovie("SUNm", "SUNm", fon.getNextHighestDepth(), {_x:SunX, _y:SunY, _xscale:0, _yscale:0});
fon.attachMovie("SUNd", "SUNd", fon.getNextHighestDepth(), {_x:SunX, _y:SunY});
fon.SUN.setMask(fon.SUNm);
LA = new Array();
var _local6 = 0;
while (_local6 < Matrix.length) {
var _local3 = 0;
while (_local3 < Matrix[0].length) {
if (((Matrix[_local6][_local3].substr(0, 1) != "s") && (Matrix[_local6][_local3].substr(0, 1) != "l")) && (Matrix[_local6][_local3].substr(0, 1) != "0")) {
var _local2 = 1;
var _local4 = false;
while (!_local4) {
if ((Matrix[_local6 + _local2][_local3].substr(0, 1) == "s") || (Matrix[_local6 + _local2][_local3].substr(0, 1) == "l")) {
_local4 = true;
LightFill(_local6 + _local2, _local3);
_local5--;
} else if (Matrix[_local6 + _local2][_local3] == "0") {
_local2++;
} else {
_local4 = true;
}
}
}
_local3++;
}
_local6++;
}
_local6 = 0;
while (_local6 < _local5) {
var _local4 = false;
while (!_local4) {
i1 = Math.round(Math.random() * (Matrix.length - 1));
j1 = Math.round(Math.random() * (Matrix[0].length - 1));
if (Matrix[i1][j1].substr(0, 1) == "s") {
_local4 = true;
if (LA.length == 0) {
LightFill(i1, j1);
} else {
var _local3 = 0;
while (_local3 < LA.length) {
if ((LA[_local3].i == i1) && (LA[_local3].j == j1)) {
_local4 = false;
}
_local3++;
}
if (_local4) {
LightFill(i1, j1);
}
}
}
}
_local6++;
}
FromHint();
LA1 = new Array(LA.length);
_root.createEmptyMovieClip("lightt", _root.getNextHighestDepth());
LAuse(SunX, SunY, "no");
}
}
function Release() {
Mouse.removeListener(oMouse);
}
function FromHint() {
hints.removeMovieClip();
_root[("si" + FindIndexX(Blink)) + FindIndexY(Blink)].removeMovieClip();
hints.HH.removeMovieClip();
hints.buttonhelp.removeMovieClip();
hints.removeMovieClip();
Mouse.removeListener(ooMouse);
hinting = false;
StopHint();
StartHint();
StartTimer();
}
function GoHints(x, y) {
_root.attachMovie("hints", "hints", _root.getNextHighestDepth(), {_x:x, _y:y});
}
function Hints(hint) {
function FindSlide(slide) {
var _local2 = 0;
while (_local2 < Matrix.length) {
var _local1 = 0;
while (_local1 < Matrix[_local2].length) {
if (Matrix[_local2][_local1].substr(0, slide.length) == slide) {
GoHints((GlobalX + (_local1 * Size)) + 4, GlobalY + (Size * (_local2 - 1)));
return(GlobalY + (Size * (_local2 - 1)));
}
_local1++;
}
_local2++;
}
}
function ConvertText1(hint) {
var _local4 = "";
var _local2 = 0;
var _local1 = 0;
while (_local1 < hint.length) {
var _local3 = hint.substr(_local1, 1);
if (_local3 == "|") {
if (_local2 > Letter) {
Letter = _local2;
}
_local2 = 0;
_local4 = _local4 + newline;
Lines++;
} else {
_local4 = _local4 + _local3;
_local2++;
}
_local1++;
}
if (_local2 > Letter) {
Letter = _local2;
}
return(_local4);
}
if (notBlock && (!moveart)) {
if (lasthint == hint) {
_root[lasthint] = false;
lasthint = "";
}
FromHint();
hint_s.start(SoundOn);
hinting = true;
StopHint();
clearInterval(HHH);
bla.removeMovieClip();
var _local6 = 190;
var _local5 = 280;
var Lines = 1;
delete hints;
StopTimer();
_root.createEmptyMovieClip("hints", _root.getNextHighestDepth());
hints.attachMovie("help", "hints", hints.getNextHighestDepth());
hints.createEmptyMovieClip("HH", hints.getNextHighestDepth());
hints.attachMovie("buttonhelp", "buttonhelp", hints.getNextHighestDepth());
hints.hints._width = 330;
switch (hint) {
case "hbegin" :
_local5 = (FindStop(Matrix) * Size) + GlobalY;
_local6 = 0;
Lines = TextShow(hints.HH, hint0, "t", 0, 15, 1);
break;
case "hart" :
_local5 = FindSlide("c00");
_local5 = 10;
_local6 = 100;
Lines = TextShow(hints.HH, hint1, "t", 0, 15, 1);
break;
case "hLock" :
_local5 = FindSlide("lock") - 100;
_local6 = 50;
Lines = TextShow(hints.HH, hint14, "t", 0, 15, 1);
break;
case "hswap" :
_local5 = (FindStop(Matrix) * Size) + GlobalY;
_local6 = 0;
Lines = TextShow(hints.HH, hint2, "t", 0, 15, 1);
break;
case "hart2" :
FindSlide("c");
_local5 = 10;
_local6 = 150;
Lines = TextShow(hints.HH, hint3, "t", 0, 15, 1);
break;
case "htime" :
GoHints(235, 340);
_local5 = 250;
Lines = TextShow(hints.HH, hint4, "t", 0, 15, 1);
break;
case "hTimer" :
GoHints(325, 340);
_local5 = 250;
Lines = TextShow(hints.HH, hint15, "t", 0, 15, 1);
break;
case "hBomb" :
FindSlide("Bomb");
_local6 = 220;
_local5 = 100;
Lines = TextShow(hints.HH, hint5, "t", 0, 15, 1);
break;
case "hLightning" :
FindSlide("Lightning");
_local6 = 170;
_local5 = 100;
Lines = TextShow(hints.HH, hint6, "t", 0, 15, 1);
break;
case "hwatch" :
FindSlide("watch");
_local6 = 200;
_local5 = 150;
Lines = TextShow(hints.HH, hint7, "t", 0, 15, 1);
break;
case "hShufle" :
FindSlide("Shufle");
_local6 = 150;
_local5 = 150;
Lines = TextShow(hints.HH, hint8, "t", 0, 15, 1);
break;
case "hBomb2" :
_local5 = 150;
_local6 = 50;
GoHints(BombX, BombY - 35);
Lines = TextShow(hints.HH, hint9, "t", 0, 15, 1);
break;
case "hLightning2" :
_local5 = 200;
_local6 = 50;
GoHints(LightningX, LightningY - 35);
Lines = TextShow(hints.HH, hint10, "t", 0, 15, 1);
break;
case "hwatch2" :
_local5 = 200;
_local6 = 50;
GoHints(WatX, WatY - 35);
Lines = TextShow(hints.HH, hint11, "t", 0, 15, 1);
break;
case "hShufle2" :
_local5 = 150;
_local6 = 50;
GoHints(ShufleX, ShufleY - 35);
Lines = TextShow(hints.HH, hint12, "t", 0, 15, 1);
break;
case "hSUN" :
_local5 = 150;
_local6 = 70;
GoHints(SunX - 10, SunY - 65);
Lines = TextShow(hints.HH, hint13, "t", 0, 15, 1);
break;
case "hSun2" :
_local6 = 70;
_local5 = 150;
GoHints(SunX - 10, SunY - 65);
Lines = TextShow(hints.HH, hint16, "t", 0, 15, 1);
}
hints.HH.hinttext.setTextFormat(format);
hints.hints._height = hints.HH._height + 40;
hints.hints._width = hints.HH._width + 30;
hints._x = _local6;
hints._y = _local5;
if (hints.hitTest(sh1) || (hints.hitTest(sh2))) {
hints._y = hints._y + (2 * Size);
_local6 = hints._x;
_local5 = hints._y;
}
if (hints.hitTest(sh1) || (hints.hitTest(sh2))) {
hints._x = 520 - hints._width;
_local6 = hints._x;
_local5 = hints._y;
}
if ((hints._y + hints._height) > 390) {
hints._y = 100;
_local5 = 100;
}
hints.HH._x = hints.hints._width / 2;
hints.HH._y = 20;
hints.buttonhelp._x = (hints.hints._width / 2) - 20;
hints.buttonhelp._y = hints.hints._height - 30;
hints._alpha = 0;
var _local10 = 800;
var _local9 = getTimer();
notBlock = false;
clearInterval(appH);
appH = setInterval(HintAppear, 0, _local9, _local10);
} else {
_root[lasthint] = true;
if (lasthint != hint) {
lasthint = hint;
}
}
}
function HintAppear(T, TT) {
var _local1 = getTimer();
if (_local1 >= (T + TT)) {
notBlock = true;
clearInterval(appH);
hints._alpha = 100;
hints.buttonhelp.onPress = FromHint;
ooMouse = {};
ooMouse.onMouseDown = FromHint;
Mouse.addListener(ooMouse);
} else {
hints._alpha = (100 * (_local1 - T)) / TT;
}
}
function CheckSuccess(i1, j1, i2, j2) {
if (((((Matrix[i1][j1] != undefined) && (Matrix[i1][j1] != "0")) && (Matrix[i2][j2] != "0")) && (Matrix[i2][j2] != undefined)) && (Matrix[i2][j2].substr(0.1) != "l")) {
if (SoundOn) {
var _local1 = false;
_local1 = Finding(Number(i1), Number(j1), Number(i2), Number(j2));
if (!_local1) {
_local1 = Finding(Number(i2), Number(j2), Number(i1), Number(j1));
}
if (_local1) {
} else {
no_s.start(SoundOn);
}
}
}
}
function DrawMap() {
function A() {
RoundCountry = Number(this._name.substr(1, 1));
RoundSity = Number(this._name.substr(2, 1));
if (this._name.length == 4) {
RoundSity = Number(this._name.substr(2, 2));
}
clearInterval(flag9);
if ((Cl != RoundCountry) || (Sl != RoundSity)) {
MAP1[("p" + Cl) + Sl].removeMovieClip();
MAP1.flag.removeMovieClip();
var _local2 = getTimer();
MAP1[("p" + RoundCountry) + RoundSity].removeMovieClip();
MAP1.attachMovie("point0" + Cl, ("p" + Cl) + Sl, MAP1.getNextHighestDepth(), {_x:MAPP[Cl][Sl].x * ko, _y:390 - (MAPP[Cl][Sl].y * ko), _xscale:(100 * MAPP[Cl][Sl].size) / 2, _yscale:(100 * MAPP[Cl][Sl].size) / 2});
MAP1.attachMovie("point2", ("p" + RoundCountry) + RoundSity, MAP1.getNextHighestDepth(), {_x:MAPP[RoundCountry][RoundSity].x * ko, _y:390 - (MAPP[RoundCountry][RoundSity].y * ko), _xscale:(100 * MAPP[RoundCountry][RoundSity].size) / 2, _yscale:(100 * MAPP[RoundCountry][RoundSity].size) / 2});
MAP1[("p" + Cl) + Sl].onPress = A;
MAP1[("p" + RoundCountry) + RoundSity].onPress = A;
Cl = RoundCountry;
Sl = RoundSity;
MAP1.desc._y = 48 - (2 * TextShow(MAP1.desc, (((map[RoundCountry].name + " - ") + Number(RoundSity + 1)) + "|") + map[RoundCountry][RoundSity].description, "t", -1, 12, 1));
MAP1.attachMovie("flag", "flag", MAP1.getNextHighestDepth(), {_x:MAPP[RoundCountry][RoundSity].x * ko, _y:390 - (MAPP[RoundCountry][RoundSity].y * ko)});
}
}
function B() {
button_s.start(SoundOn);
this.gotoAndStop(1);
this._parent.text1._x = this._parent.text1._x - Bx;
this._parent.text1._y = this._parent.text1._y - By;
delete ArtPos;
ArtPos = new Array();
InitArt(RoundCountry, RoundSity);
MAP1.removeMovieClip();
PrepareRound();
}
function C() {
button_s.start(SoundOn);
this.gotoAndStop(1);
this._parent.text2._x = this._parent.text2._x - Bx;
this._parent.text2._y = this._parent.text2._y - By;
getURL (downloadlink, "_blank");
}
function AttachFlag(C1, S1) {
var _local1 = C1;
var _local2 = S1;
if (_local2 > 0) {
_local2--;
} else if (_local1 > 0) {
_local1--;
_local2 = map[_local1].length - 1;
}
MAP1.attachMovie("flag", "flag", MAP1.getNextHighestDepth(), {_x:MAPP[_local1][_local2].x * ko, _y:390 - (MAPP[_local1][_local2].y * ko)});
var _local3 = getTimer();
clearInterval(flag9);
map_s.start(SoundOn);
flag9 = setInterval(MoveFlag, 0, MAP1.flag, _local3, MAP1.flag._x, MAP1.flag._y, MAPP[C1][S1].x * ko, 390 - (MAPP[C1][S1].y * ko));
}
function MoveFlag(flag, T, x1, y1, x2, y2) {
var _local1 = getTimer();
var _local2 = 1000;
if (_local1 >= (T + _local2)) {
clearInterval(flag9);
flag._x = x2;
flag._y = y2;
} else {
var _local6 = x1 + (((x2 - x1) * (_local1 - T)) / _local2);
var _local5 = y1 + (((y2 - y1) * (_local1 - T)) / _local2);
flag._x = _local6;
flag._y = _local5;
}
}
clearInterval(ScreenRefreshing);
ScreenRefreshing = setInterval(function () {
updateAfterEvent();
}, 0);
MAP1.removeMovieClip();
NagCounter++;
if (RoundCountry > WinC) {
WinC = RoundCountry;
WinR = 0;
}
if ((RoundSity > WinR) && (RoundCountry == WinC)) {
WinR = RoundSity;
}
var _local18 = RoundCountry;
var _local12 = RoundSity;
var Cl = RoundCountry;
var Sl = RoundSity;
var ko = 0.65;
_root.createEmptyMovieClip("MAP1", _root.getNextHighestDepth());
MAP1.attachMovie("map1", "map1", MAP1.getNextHighestDepth());
TextShow(MAP1.map1.text1, texthelpclick, "s", 0, 0, 1);
TextShow(MAP1.map1.text2, nagdownload, "s", -1, 0, 1);
MAP1.map1.button1.onPress = function () {
this.gotoAndStop(2);
this._parent.text1._x = this._parent.text1._x + Bx;
this._parent.text1._y = this._parent.text1._y + By;
};
MAP1.map1.button2.onPress = function () {
this.gotoAndStop(2);
this._parent.text2._x = this._parent.text2._x + Bx;
this._parent.text2._y = this._parent.text2._y + By;
};
MAP1.map1.button2.onRelease = C;
MAP1.map1.button2.onReleaseOutside = C;
MAP1.map1.button1.onRelease = B;
MAP1.map1.button1.onReleaseOutside = B;
if (_local12 == -1) {
Sl = (RoundSity = 0);
}
var _local3 = 0;
while (_local3 < MAPP.length) {
var _local6 = MAP1.createEmptyMovieClip("NameCountry" + _local3, MAP1.getNextHighestDepth());
_local6._x = (Number(MAPP[_local3].x) + Number(MAPP[_local3][0].x)) * ko;
_local6._y = 385 - ((Number(MAPP[_local3].y) + Number(MAPP[_local3][0].y)) * ko);
TextShow(_local6, map[_local3].name, "t", -1, 12, 1);
var _local4 = 0;
while (_local4 < MAPP[_local3].length) {
if (((!_local3) && (!_local4)) && (RoundSity == -1)) {
} else {
var _local5 = "point0" + _local3;
if ((RoundSity == _local4) && (RoundCountry == _local3)) {
_local5 = "point2";
}
if (_local3 > WinC) {
_local5 = "point3";
}
if ((_local3 == WinC) && (_local4 > WinR)) {
_local5 = "point3";
}
MAP1.attachMovie(_local5, ("p" + _local3) + _local4, MAP1.getNextHighestDepth(), {_x:MAPP[_local3][_local4].x * ko, _y:390 - (MAPP[_local3][_local4].y * ko), _xscale:(100 * MAPP[_local3][_local4].size) / 2, _yscale:(100 * MAPP[_local3][_local4].size) / 2});
if (_local5 != "point3") {
MAP1[("p" + _local3) + _local4].onPress = A;
} else if (_local3 > MaxC) {
MAP1[("p" + _local3) + _local4]._alpha = 50;
}
}
_local4++;
}
_local3++;
}
AttachFlag(RoundCountry, RoundSity);
MAP1.createEmptyMovieClip("desc", MAP1.getNextHighestDepth());
MAP1.desc._y = 48 - (2 * TextShow(MAP1.desc, (((map[RoundCountry].name + " - ") + Number(RoundSity + 1)) + "|") + map[RoundCountry][RoundSity].description, "t", -1, 12, 1));
MAP1.desc._x = 370;
}
function InitSpline() {
var _local4 = arguments[0];
var _local3 = arguments[1];
var _local2 = 1;
while (_local2 < (arguments.length / 2)) {
_local4.addKey(arguments[_local2 * 2]);
_local3.addKey(arguments[(_local2 * 2) + 1]);
_local2++;
}
_local4.Calculate();
_local3.Calculate();
}
function AddItemToMenu(c, F) {
var _local1 = new ContextMenuItem();
_local1.caption = c;
_local1.onSelect = function () {
if (notBlock) {
F(1);
}
};
MainMenu.customItems.push(_local1);
}
function Circle(mc, x, y, r) {
with (mc) {
var r1 = (r * 0.93);
lineStyle(2, 16777215, 100);
moveTo(x, y - r);
curveTo(x + r1, y - r1, x + r, y);
curveTo(x + r1, y + r1, x, y + r);
curveTo(x - r1, y + r1, x - r, y);
curveTo(x - r1, y - r1, x, y - r);
}
}
function GetCurrentRound(C, S) {
var _local2 = 0;
var _local1 = 0;
while (_local1 < C) {
_local2 = _local2 + Number(map[_local1].length);
_local1++;
}
_local2 = _local2 + S;
return(_local2);
}
stop();
var zylomfixoutoftime = false;
var zylomfixwin = false;
this._lockroot = true;
ClearRound();
if (Matrix != undefined) {
delete Matrix;
_root.gotoAndPlay(1);
}
var MainMenu = new ContextMenu();
MainMenu.hideBuiltInItems();
AddItemToMenu("HowToPLay", FunctionHelp);
AddItemToMenu("NewGame", FunctionNew);
AddItemToMenu("Sound", FunctionSound);
AddItemToMenu("Download", FunctionDownload);
Stage.showMenu = true;
this.menu = MainMenu;
Stage.scaleMode = "noScale";
By = 3;
Bx = 1;
NagCounter = 0;
Sun = 0;
SunX = 91;
SunY = 313;
SunM = 100;
SunP = 30;
SunInc = 4;
WinC = 0;
WinR = 0;
RedyToPlay = (redytoend = false);
fromhint = true;
MaxC = 2;
N = 3;
Life = 3;
NextLife = 50000;
NumTail = 20;
TailPeriod = 100;
RoundCountry = 0;
RoundSity = -1;
mmm = (Add = (score = (levelTime = (totalTime = 0))));
Bombc = (Shuflec = (Lightningc = (Watchc = 0)));
SoundOn = (hbegin = (hart = (hart2 = (htime = (hswap = (hBomb = (hBomb2 = (hwatch = (hwatch2 = (hShufle = (hShufle2 = (hLightning = (hLightning2 = (hSUN = (hSun2 = (hTimer = (hLock = true)))))))))))))))));
lasthint = "hbegin";
Speed = 0;
Step = 5;
Size = 32;
Size1 = 31;
BombX = 134;
BombY = 271;
ShufleX = 22;
ShufleY = 271;
LightningX = 136;
LightningY = 331;
WatX = 21;
WatY = 330;
TimeX = 196;
TimeY = 374.5;
MoveTime = 200;
FlySpeed = 1000;
GameSpeed = 400;
TimeLength = -306;
HintHelpTime = 7000;
oKey = {};
oKey.onKeyDown = function () {
if (_global.cheats == 1) {
delete ArtPos;
ArtPos = new Array();
if (Key.isDown(38)) {
WinR = map[2].length - 1;
WinC = 2;
EndRound();
Bombc = (Shuflec = (Lightningc = (Watchc = 999)));
}
if (Key.isDown(40)) {
GameOver(nomoremoves);
}
if (Key.isDown(37)) {
Life = 0;
if (zylomfixwin == false) {
zylomfixoutoftime = true;
}
GameOver(outoftime);
}
if (Key.isDown(39)) {
EndRound();
}
InitArt(RoundCountry, RoundSity);
}
if (Key.isDown(9)) {
} else if (Key.isDown(13)) {
} else if (Key.isDown(17)) {
} else if (Key.getAscii() == String("c").charCodeAt()) {
}
};
Key.addListener(oKey);
this.attachMovie("helppanel", "help", this.getNextHighestDepth());
if (savemode == "true") {
var LoadArray = new Array("RoundCountry", "RoundSity", "Bombc", "Lightningc", "Watchc", "Shuflec", "score", "WinC", "WinR", "Life", "SoundOn", "hbegin", "hart", "hart2", "htime", "hswap", "hBomb", "hBomb2", "hwatch", "hwatch2", "hShufle", "hShufle2", "hLightning", "hLightning2", "hSUN", "hSun2", "hTimer", "hLock");
var Saving = new SaveGame(this, LoadArray, "TheRiseOfAtlantis");
Saving.LoadInfo();
NextLife = (Life + 1) * 50000;
}
InitSound();
Symbol 1555 MovieClip [__Packages.Spline] Frame 0
class Spline
{
var keys;
function Spline () {
keys = new Array();
if (arguments.length > 0) {
InitSpline(arguments);
}
}
function GetKeys() {
return(keys);
}
function addKey(key) {
var _local2 = new Array(2);
_local2[0] = key;
_local2[1] = key;
keys.push(_local2);
}
function getFrame(i, t) {
return(SplineInterpolation(keys[i][0], keys[i + 1][0], keys[i][1], keys[i + 1][1], t));
}
function getGradient(i, t) {
return(GetGradient(keys[i][0], keys[i + 1][0], keys[i][1], keys[i + 1][1], t));
}
function getPoint(t) {
var _local3 = 1 / getSectors();
var _local2 = Math.floor(t / _local3);
if (_local2 >= getSectors()) {
return(keys[keys.length - 1][0]);
}
var _local4 = (t - (_local2 * _local3)) / _local3;
return(getFrame(_local2, _local4));
}
function getGlobalGradient(t) {
var _local3 = 1 / getSectors();
var _local2 = Math.floor(t / _local3);
if (_local2 >= getSectors()) {
return(keys[keys.length - 1][0]);
}
var _local4 = (t - (_local2 * _local3)) / _local3;
return(getGradient(_local2, _local4));
}
function getSectors() {
return(keys.length - 1);
}
function Calculate(cycled) {
if (cycled) {
keys.push(keys[0]);
}
var _local3;
var _local5;
var _local4;
if (cycled) {
_local3 = keys[0][0] - keys[keys.length - 2][0];
_local5 = keys[1][0] - keys[0][0];
_local4 = _local5 - _local3;
keys[0][1] = _local3 + (0.5 * _local4);
keys[keys.length - 1][1] = keys[0][1];
} else if (keys.length > 1) {
keys[0][1] = keys[1][0] - keys[0][0];
keys[keys.length - 1][1] = keys[keys.length - 1][0] - keys[keys.length - 2][0];
}
var _local2 = 1;
while (_local2 < (keys.length - 1)) {
_local3 = keys[_local2][0] - keys[_local2 - 1][0];
_local5 = keys[_local2 + 1][0] - keys[_local2][0];
_local4 = _local5 - _local3;
keys[_local2][1] = _local3 + (0.5 * _local4);
_local2++;
}
}
function SplineInterpolation(x1, x2, r1, r2, t) {
var _local1 = t * t;
var _local2 = _local1 * t;
var _local4 = (((x1 * (((2 * _local2) - (3 * _local1)) + 1)) + (r1 * ((_local2 - (2 * _local1)) + t))) + (x2 * ((-2 * _local2) + (3 * _local1)))) + (r2 * (_local2 - _local1));
return(_local4);
}
function GetGradient(x1, x2, r1, r2, t) {
var _local2 = t * t;
var _local3 = ((((6 * x1) * (_local2 - t)) + (r1 * (((3 * _local2) - (4 * t)) + 1))) + ((6 * x2) * (t - _local2))) + (r2 * ((3 * _local2) - (2 * t)));
return(_local3);
}
function InitSpline(A) {
var _local2 = 0;
while (_local2 < A.length) {
addKey(A[_local2]);
_local2++;
}
Calculate();
}
}
Symbol 1556 MovieClip [__Packages.SaveGame] Frame 0
class SaveGame
{
var DataMC, DataArr, SO;
function SaveGame (MC, AR, Name) {
DataMC = MC;
DataArr = AR;
SO = SharedObject.getLocal(Name);
}
function LoadInfo() {
for (var _local3 in DataArr) {
var _local2 = SO.data[DataArr[_local3]];
if (_local2 == undefined) {
DataMC[DataArr[_local3]] = 0;
if (DataArr[_local3] == "Life") {
DataMC[DataArr[_local3]] = 3;
} else if (DataArr[_local3] == "SoundOn") {
DataMC[DataArr[_local3]] = true;
} else if (DataArr[_local3].substr(0, 1) == "h") {
DataMC[DataArr[_local3]] = true;
}
} else {
DataMC[DataArr[_local3]] = SO.data[DataArr[_local3]];
}
}
}
function SaveInfo() {
for (var _local2 in DataArr) {
SO.data[DataArr[_local2]] = DataMC[DataArr[_local2]];
}
SO.flush();
}
}
Symbol 1557 MovieClip [__Packages.GameSound] Frame 0
class GameSound extends Sound
{
function GameSound (s, MC) {
super(MC);
super.attachSound(s);
}
function start(SoundOn, s, l) {
if (SoundOn) {
super.start(s, l);
}
}
function stop() {
super.stop();
}
}
Symbol 64 MovieClip [slide1] Frame 1
stop();
Symbol 64 MovieClip [slide1] Frame 13
this.gotoAndPlay(2);
Symbol 89 MovieClip [slide2] Frame 1
stop();
Symbol 89 MovieClip [slide2] Frame 13
this.gotoAndPlay(2);
Symbol 114 MovieClip [slide3] Frame 1
stop();
Symbol 114 MovieClip [slide3] Frame 13
this.gotoAndPlay(2);
Symbol 139 MovieClip [slide4] Frame 1
stop();
Symbol 139 MovieClip [slide4] Frame 13
this.gotoAndPlay(2);
Symbol 164 MovieClip [slide5] Frame 1
stop();
Symbol 164 MovieClip [slide5] Frame 13
this.gotoAndPlay(2);
Symbol 189 MovieClip [slide6] Frame 1
stop();
Symbol 189 MovieClip [slide6] Frame 13
this.gotoAndPlay(2);
Symbol 198 MovieClip [bigbutton] Frame 1
stop();
Symbol 198 MovieClip [bigbutton] Frame 2
stop();
Symbol 198 MovieClip [bigbutton] Frame 3
stop();
Symbol 248 MovieClip Frame 1
stop();
Symbol 248 MovieClip Frame 2
stop();
Symbol 248 MovieClip Frame 3
stop();
Symbol 265 MovieClip [helppanel] Frame 1
function MoveStar(i, Name) {
if (Name == "a") {
this[("tail" + i) + "slicehelp"]._x = -3000;
this[("tail" + i) + "slicehelp"].gotoAndStop(1);
} else {
this[("tail" + i) + "slicehelp"]._x = (eval (Name)._x + 10) + (Math.random() * 10);
this[("tail" + i) + "slicehelp"]._y = (eval (Name)._y + 10) + (Math.random() * 10);
this[("tail" + i) + "slicehelp"].gotoAndPlay(1);
}
}
function Init(l) {
Matrix = this["Matrix" + l];
var alpha = 0;
var i = 0;
while (i < Matrix.length) {
var j = 0;
while (j < Matrix[i].length) {
eval ((("s" + l) + i) + j)._alpha = eval ((("s" + l) + i) + j)._alpha - 1;
j++;
}
i++;
}
alpha = eval ((("s" + l) + 0) + 0)._alpha;
if (alpha <= 0) {
clearInterval(_root["doh" + l]);
var aaa = this["Init" + l];
aaa();
}
}
function Init4() {
var _local2 = 2000;
if (_root.doh4 == 0) {
_local2 = 14000;
}
if (_root.notexit) {
clearInterval(_root.doh4);
_root.doh4 = setInterval(function () {
clearInterval(_root.doh4);
b4._alpha = 0;
}, _local2);
}
}
function MoveCursor(a, b, c, l, endx) {
if (!_root.notexit) {
clearInterval(_root["c" + l]);
}
if (eval ("cur" + l)._x == endx) {
clearInterval(_root["c" + l]);
_root["c" + l] = setInterval(MovingLeft, 0, "cur" + l, eval ("cur" + l)._x, l, "cur");
if (l == 1) {
Action1();
}
if (l == 2) {
Action2();
}
if (l == 3) {
Action3();
}
} else {
eval ("cur" + l)._x = eval ("cur" + l)._x - 1;
var x = eval ("cur" + l)._x;
eval ("cur" + l)._y = (((x * x) * a) + (b * x)) + c;
}
updateAfterEvent();
}
function Init1() {
h1 = 1;
delete Matrix1;
Matrix1 = new Array(3);
var _local4 = new Array("slide5", "slide4", "slide2", "slide3", "slide1");
Matrix1[0] = _local4;
_local4 = new Array("slide3", "slide2", "slide1", "slide5", "slide4");
Matrix1[1] = _local4;
_local4 = new Array("slide1", "slide2", "slide2", "slide4", "slide5");
Matrix1[2] = _local4;
DrawMatrix(Matrix1, X1, Y1, 1);
var _local11 = 2000;
if (_root.notexit) {
clearInterval(_root.doh1);
_root.doh1 = setInterval(function () {
clearInterval(_root.doh1);
CURSOR(1);
var _local6;
var _local9;
var _local10;
var _local2;
var _local3;
var _local4;
var _local5;
var _local8;
var _local7 = 0;
_local4 = 120;
_local7 = 60;
_local3 = 210;
_local8 = 150;
_local2 = _local3 - _local4;
_local5 = _local7;
_local6 = (((_local8 - _local5) / (_local3 - _local2)) - ((_local7 - _local5) / (_local4 - _local2))) / (_local3 - _local4);
_local9 = ((_local8 - _local5) / (_local3 - _local2)) - (_local6 * (_local3 + _local2));
_local10 = (_local5 - ((_local6 * _local2) * _local2)) - (_local9 * _local2);
_root.c1 = setInterval(MoveCursor, 0, _local6, _local9, _local10, 1, _local4);
b1._alpha = 0;
}, _local11);
}
}
function Action1() {
if (_root.notexit) {
this["m" + FindName(0, 2, 1)] = setInterval(MovingLeft, 0, FindName(0, 2, 1), eval (FindName(0, 2, 1))._x, 1);
}
if (_root.notexit) {
this["m" + FindName(0, 1, 1)] = setInterval(MovingRight, 0, FindName(0, 1, 1), eval (FindName(0, 1, 1))._x, 1);
}
}
function Action2() {
if (_root.notexit) {
this["m" + FindName(2, 2, 2)] = setInterval(MovingRight, 0, FindName(2, 2, 2), eval (FindName(2, 2, 2))._x, 2);
}
if (_root.notexit) {
this["m" + FindName(2, 3, 2)] = setInterval(MovingLeft, 0, FindName(2, 3, 2), eval (FindName(2, 3, 2))._x, 2);
}
}
function Action3() {
if (_root.notexit) {
this["m" + FindName(2, 2, 3)] = setInterval(MovingRight, 0, FindName(2, 2, 3), eval (FindName(2, 2, 3))._x, 3);
}
if (_root.notexit) {
this["m" + FindName(2, 3, 3)] = setInterval(MovingLeft, 0, FindName(2, 3, 3), eval (FindName(2, 3, 3))._x, 3);
}
}
function Init2() {
h2 = 1;
delete Matrix2;
Matrix2 = new Array(3);
Line = new Array("slide4", "slide1", "slide4", "slide2", "slide3");
Matrix2[0] = Line;
Line = new Array("slide3", "slide3", "slide4", "slide5", "slide1");
Matrix2[1] = Line;
Line = new Array("slide4", "slide4", "slide2", "slide4", "slide1");
Matrix2[2] = Line;
DrawMatrix(Matrix2, X2, Y2, 2);
var _local9 = 2000;
if (_root.doh2 == 0) {
_local9 = 6000;
}
if (_root.notexit) {
clearInterval(_root.doh2);
_root.doh2 = setInterval(function () {
clearInterval(_root.doh2);
CURSOR(2);
var _local6;
var _local9;
var _local10;
var _local2;
var _local3;
var _local4;
var _local5;
var _local8;
var _local7 = 0;
_local4 = 420;
_local7 = 120;
_local3 = 495;
_local8 = 60;
_local2 = _local3 - _local4;
_local5 = _local7;
_local6 = (((_local8 - _local5) / (_local3 - _local2)) - ((_local7 - _local5) / (_local4 - _local2))) / (_local3 - _local4);
_local9 = ((_local8 - _local5) / (_local3 - _local2)) - (_local6 * (_local3 + _local2));
_local10 = (_local5 - ((_local6 * _local2) * _local2)) - (_local9 * _local2);
_root.c2 = setInterval(MoveCursor, 0, _local6, _local9, _local10, 2, _local4);
b2._alpha = 0;
}, _local9);
}
}
function Init3() {
h3 = 1;
delete Matrix3;
Matrix3 = new Array(4);
Line = new Array("slide1", "slide4", "slide2", "slide4");
Matrix3[0] = Line;
Line = new Array("slide3", "slicehelp", "slide5", "slide5");
Matrix3[1] = Line;
Line = new Array("slide3", "slide3", "slide2", "slide3");
Matrix3[2] = Line;
Line = new Array("", "", "", "");
Matrix3[3] = Line;
DrawMatrix(Matrix3, X3, Y3, 3);
var _local9 = 2000;
if (_root.doh3 == 0) {
_local9 = 10000;
}
if (_root.notexit) {
clearInterval(_root.doh3);
_root.doh3 = setInterval(function () {
clearInterval(_root.doh3);
CURSOR(3);
var _local6;
var _local9;
var _local10;
var _local2;
var _local3;
var _local4;
var _local5;
var _local8;
var _local7 = 0;
_local4 = 210;
_local7 = 290;
_local3 = 245;
_local8 = 210;
_local2 = _local3 - _local4;
_local5 = _local7;
_local6 = (((_local8 - _local5) / (_local3 - _local2)) - ((_local7 - _local5) / (_local4 - _local2))) / (_local3 - _local4);
_local9 = ((_local8 - _local5) / (_local3 - _local2)) - (_local6 * (_local3 + _local2));
_local10 = (_local5 - ((_local6 * _local2) * _local2)) - (_local9 * _local2);
_root.c3 = setInterval(MoveCursor, 0, _local6, _local9, _local10, 3, _local4);
b3._alpha = 0;
}, _local9);
}
}
function DrawMatrix(Matrix, x, y, l) {
var i = 0;
while (i < 3) {
var j = 0;
while (j < Matrix[i].length) {
eval (((("s" + l) + i) + j) + "f").removeMovieClip();
this.attachMovie("fon", ((("s" + l) + i) + j) + "f", this.getNextHighestDepth());
eval (((("s" + l) + i) + j) + "f").stop();
eval (((("s" + l) + i) + j) + "f")._x = x + (j * Size);
eval (((("s" + l) + i) + j) + "f")._y = y + (i * Size);
j++;
}
i++;
}
var i = 0;
while (i < 3) {
var j = 0;
while (j < Matrix[i].length) {
eval ((("s" + l) + i) + j).removeMovieClip();
this.attachMovie(Matrix[i][j], (("s" + l) + i) + j, this.getNextHighestDepth());
eval ((("s" + l) + i) + j)._x = x + (j * Size1);
eval ((("s" + l) + i) + j)._y = y + (i * Size1);
j++;
}
i++;
}
this["b" + l].swapDepths(this.getNextHighestDepth());
}
function CURSOR(l) {
if (l == 1) {
this.attachMovie("cursor", "cur1", this.getNextHighestDepth(), {_x:220, _y:150});
}
if (l == 2) {
this.attachMovie("cursor", "cur2", this.getNextHighestDepth(), {_x:490, _y:60});
}
if (l == 3) {
this.attachMovie("cursor", "cur3", this.getNextHighestDepth(), {_x:240, _y:210});
}
}
function MovingLeft(slide, x, l, chk) {
var End = (x - Size);
if (eval (slide)._x > (End + 2)) {
eval (slide)._x = eval (slide)._x - 0.5;
} else {
var i = FindIndexX(slide);
var j = FindIndexY(slide);
var temp = FindName(i, j, l);
j--;
var temp1 = FindName(i, j, l);
if (chk != "cur") {
RemoveSlides(temp, temp1, l);
} else {
clearInterval(_root["c" + l]);
eval ("cur" + l).removeMovieClip();
}
}
updateAfterEvent();
}
function MovingRight(slide, x, l) {
var End = (x + Size);
if (eval (slide)._x < (End - 2)) {
eval (slide)._x = eval (slide)._x + 0.5;
} else {
var i = FindIndexX(slide);
var j = FindIndexY(slide);
var temp = FindName(i, j++, l);
var temp1 = FindName(i, j, l);
RemoveSlides(temp, temp1, l, chk);
}
updateAfterEvent();
}
function MovingDown(slide, y, l, chk) {
var End = (y + Size);
if (eval (slide)._y < (End - 2)) {
eval (slide)._y = eval (slide)._y + 1;
} else {
if (chk != "apear") {
var i = FindIndexX(slide);
var j = FindIndexY(slide);
var temp = FindName(i++, j, l);
var temp1 = FindName(i, j, l);
} else {
var temp = slide;
}
RemoveSlides(temp, temp1, l, chk);
}
updateAfterEvent();
}
function FindIndexX(name) {
var _local1 = substring(name, name.indexOf("s") + 3, 1);
return(_local1);
}
function FindIndexY(name) {
var _local1 = substring(name, name.indexOf("s") + 4, 1);
return(_local1);
}
function RemoveSlides(slide, slide1, l, chk) {
Matrix = this["Matrix" + l];
clearInterval(this["m" + slide]);
clearInterval(this["m" + slide1]);
removeMovieClip(eval (slide));
removeMovieClip(eval (slide1));
var i = FindIndexX(String(slide));
var j = FindIndexY(String(slide));
var i1 = FindIndexX(String(slide1));
var j1 = FindIndexY(String(slide1));
if (chk == "fall") {
i++;
var slide = FindName(i, j, l);
this.attachMovie(Matrix[i][j], slide, this.getNextHighestDepth());
eval (slide)._x = this["X" + l] + (j * Size);
eval (slide)._y = this["Y" + l] + (i * Size);
} else if (chk == "apear") {
i = 0;
j = slide.substr(3, 1);
var slide = FindName(i, j, l);
this.attachMovie(Matrix[i][j], slide, this.getNextHighestDepth());
eval (slide)._x = this["X" + l] + (j * Size);
eval (slide)._y = this["Y" + l] + (i * Size);
if ((l == 1) && (h1 == 2)) {
h1 = 3;
Matrix[1][1] = Matrix[0][1];
Matrix[0][1] = "slide1";
this.attachMovie(Matrix[0][1], ("sm" + l) + 1, this.getNextHighestDepth());
eval (("sm" + l) + 1)._y = Y1 - Size;
eval (("sm" + l) + 1)._x = X1 + Size;
if (_root.notexit) {
this["m" + FindName(0, 1, 1)] = setInterval(MovingDown, 0, FindName(0, 1, 1), eval (FindName(0, 1, 1))._y, 1, "fall");
}
if (_root.notexit) {
this[("msm" + l) + 1] = setInterval(MovingDown, 0, ("sm" + l) + 1, eval (("sm" + l) + 1)._y, 1, "apear");
}
} else if ((l == 1) && (h1 == 3)) {
h1 = 4;
Matrix[2][1] = Matrix[1][1];
Matrix[1][1] = Matrix[0][1];
Matrix[0][1] = "slide2";
this.attachMovie(Matrix[0][1], ("sm" + l) + 1, this.getNextHighestDepth());
eval (("sm" + l) + 1)._y = Y1 - Size;
eval (("sm" + l) + 1)._x = X1 + Size;
if (_root.notexit) {
this["m" + FindName(1, 1, 1)] = setInterval(MovingDown, 0, FindName(1, 1, 1), eval (FindName(1, 1, 1))._y, 1, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, 1, 1)] = setInterval(MovingDown, 0, FindName(0, 1, 1), eval (FindName(0, 1, 1))._y, 1, "fall");
}
if (_root.notexit) {
this[("msm" + l) + 1] = setInterval(MovingDown, 0, ("sm" + l) + 1, eval (("sm" + l) + 1)._y, 1, "apear");
}
} else if ((l == 1) && (h1 == 4)) {
clearInterval(_root.doh1);
if (_root.notexit) {
_root.doh1 = setInterval(function () {
Init(1);
}, 10);
}
} else if (((l == 2) && (h2 == 2)) && (j == 2)) {
h2 = 3;
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide3";
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y2 - Size;
eval (("sm" + l) + j)._x = X2 + (j * Size);
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
} else if (((l == 2) && (h2 == 3)) && (j == 2)) {
h2 = 4;
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide1";
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y2 - Size;
eval (("sm" + l) + j)._x = X2 + (j * Size);
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
} else if ((l == 2) && (h2 == 4)) {
clearInterval(_root.doh2);
if (_root.notexit) {
_root.doh2 = setInterval(function () {
Init(2);
}, 10);
}
} else if (((l == 3) && (h3 == 2)) && (j == 1)) {
h3 = 3;
Matrix[3][j] = Matrix[2][j];
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide2";
if (_root.notexit) {
this["m" + FindName(2, j, l)] = setInterval(MovingDown, 0, FindName(2, j, l), eval (FindName(2, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y3 - Size;
eval (("sm" + l) + j)._x = X3 + (j * Size);
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
} else if (((l == 3) && (h3 == 3)) && (j == 1)) {
h3 = 4;
var a;
var b;
var c;
var x1;
var x2;
var x3;
var y1;
var y2;
var y3 = 0;
x3 = EndX;
y3 = EndY;
x2 = eval (FindName(3, 1, 3))._x;
y2 = eval (FindName(3, 1, 3))._y;
x1 = x2 + (((50 + (Math.random() * 50)) * (x2 - x3)) / Math.abs(x3 - x2));
y1 = y2 - (((50 + (Math.random() * 50)) * (y2 - y3)) / Math.abs(y3 - y2));
a = (((y2 - y1) / (x2 - x1)) - ((y3 - y1) / (x3 - x1))) / (x2 - x3);
b = ((y2 - y1) / (x2 - x1)) - (a * (x2 + x1));
c = (y1 - ((a * x1) * x1)) - (b * x1);
if (_root.notexit) {
var i = 10;
_root.TAIL = setInterval(function () {
if ((i < 30) && _root.notexit) {
MoveStar(i, FindName(3, 1, 3));
i++;
} else {
clearInterval(_root.TAIL);
}
}, 150);
_root.doh3 = setInterval(MoveArtToPosition, 0, FindName(3, 1, 3), a, b, c);
}
}
} else {
this.attachMovie(Matrix[i1][j1], slide, this.getNextHighestDepth());
this.attachMovie(Matrix[i][j], slide1, this.getNextHighestDepth());
eval (slide)._x = this["X" + l] + (j * Size);
eval (slide)._y = this["Y" + l] + (i * Size);
eval (slide1)._x = this["X" + l] + (j1 * Size);
eval (slide1)._y = this["Y" + l] + (i1 * Size);
var newname = Matrix[i1][j1];
Matrix[i1][j1] = Matrix[i][j];
Matrix[i][j] = newname;
if ((l == 1) && (h1 == 1)) {
h1 = 2;
Blow(0, 1, 1);
Blow(1, 1, 1);
Blow(2, 1, 1);
Matrix[0][1] = "slide1";
this.attachMovie(Matrix[0][1], ("sm" + l) + 1, this.getNextHighestDepth());
eval (("sm" + l) + 1)._y = Y1 - Size;
eval (("sm" + l) + 1)._x = X1 + Size;
if (_root.notexit) {
this[("msm" + l) + 1] = setInterval(MovingDown, 0, ("sm" + l) + 1, eval (("sm" + l) + 1)._y, 1, "apear");
}
} else if ((l == 2) && (h2 == 1)) {
h2 = 2;
Blow(2, 0, 2);
Blow(2, 1, 2);
Blow(2, 2, 2);
Blow(0, 2, 2);
Blow(1, 2, 2);
j = 0;
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide2";
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y2 - Size;
eval (("sm" + l) + j)._x = X2 + (j * Size);
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
j = 1;
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide3";
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y2 - Size;
eval (("sm" + l) + j)._x = X2 + (j * Size);
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
j = 2;
Matrix[0][j] = "slide1";
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y2 - Size;
eval (("sm" + l) + j)._x = X2 + (j * Size);
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
j--;
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
j--;
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
} else if ((l == 3) && (h3 == 1)) {
h3 = 2;
Blow(2, 0, 3);
Blow(2, 1, 3);
Blow(2, 2, 3);
j = 0;
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide2";
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y3 - Size;
eval (("sm" + l) + j)._x = X3 + (j * Size);
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
j = 1;
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide3";
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y3 - Size;
eval (("sm" + l) + j)._x = X3 + (j * Size);
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
j = 2;
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide1";
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y3 - Size;
eval (("sm" + l) + j)._x = X3 + (j * Size);
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
}
}
this["Matrix" + l] = Matrix;
}
function MoveArtToPosition(Name, a, b, c) {
if (!_root.notexit) {
clearInterval(_root.doh3);
}
var Done = false;
var x = eval (Name)._x;
var y = eval (Name)._y;
var l = ((x - EndX) / Math.abs(x - EndX));
eval (Name)._x = eval (Name)._x - l;
x = eval (Name)._x;
eval (Name)._y = (((a * x) * x) + (b * x)) + c;
if (x == EndX) {
Done = true;
}
if (Done) {
clearInterval(_root.TAIL);
var i = 10;
while (i < 30) {
MoveStar(i, "a");
i++;
}
clearInterval(_root.doh3);
if (_root.notexit) {
_root.doh3 = setInterval(function () {
Init(3);
}, 10);
}
}
updateAfterEvent();
}
function Blow(i, j, l) {
Matrix = this["Matrix" + l];
var Name = FindName(i, j, l);
var slide = eval (Name);
var Depth = slide.getDepth();
slide.removeMovieClip();
eval (Name + "b")._x = this["X" + l] + (j * Size);
eval (Name + "b")._y = this["Y" + l] + (i * Size);
Matrix[i][j] = "no";
this["Matrix" + l] = Matrix;
}
function FindName(x, y, l) {
return((("s" + l) + x) + y);
}
stop();
ok.onRollOver = null;
ok.useHandCursor = false;
var i = 10;
while (i < 30) {
this.attachMovie("tail", ("tail" + i) + "slicehelp", this.getNextHighestDepth(), {_x:-3000});
this[("tail" + i) + "slicehelp"].gotoAndStop(1);
i++;
}
_root.TextShow(txt, _root.texthelpclick, "s", 0, 0, 1);
_root.notexit = true;
EndX = 58;
EndY = 245;
X1 = (Y1 = (Y2 = 42));
X2 = 310;
Y3 = 217;
X3 = 100;
Size = 31;
Size1 = 31;
_root.TextShow(help1, _root.helping0, "t", -1, 12, 1);
_root.TextShow(help2, _root.helping1, "t", -1, 12, 1);
_root.TextShow(help3, _root.helping2, "t", -1, 12, 1);
_root.TextShow(help4, _root.helping3, "t", -1, 12, 1);
clearInterval(_root.doh1);
clearInterval(_root.doh2);
clearInterval(_root.doh3);
clearInterval(_root.doh4);
_root.doh1 = (_root.doh2 = (_root.doh3 = (_root.doh4 = 0)));
Init1();
Init2();
Init3();
Init4();
Instance of Symbol 248 MovieClip in Symbol 265 MovieClip [helppanel] Frame 1
on (press) {
_root.button_s.start(_root.SoundOn);
this.gotoAndStop(2);
this._parent.txt._y = this._parent.txt._y + _root.By;
this._parent.txt._x = this._parent.txt._x + _root.Bx;
_root.notexit = false;
clearInterval(LLL);
LLL = setInterval(function () {
clearInterval(LLL);
_root.help.H1.removeMovieClip();
if (_root.Matrix == undefined) {
_root.fromhint = false;
_root.InitRound();
}
_parent.removeMovieClip();
}, 1000);
if (_global.GameSwitch == false) {
_global.GameSwitch = true;
}
}
on (release, releaseOutside) {
this._parent.txt._y = this._parent.txt._y - _root.By;
this._parent.txt._x = this._parent.txt._x - _root.Bx;
this.gotoAndStop(1);
}
Instance of Symbol 248 MovieClip "b1" in Symbol 272 MovieClip [mainmenu] Frame 1
on (release, releaseOutside) {
this.gotoAndStop(1);
this._parent.txt1._y = this._parent.txt1._y - _root.By;
this._parent.txt1._x = this._parent.txt1._x - _root.Bx;
}
Instance of Symbol 248 MovieClip "b2" in Symbol 272 MovieClip [mainmenu] Frame 1
on (release, releaseOutside) {
this.gotoAndStop(1);
this._parent.txt2._y = this._parent.txt2._y - _root.By;
this._parent.txt2._x = this._parent.txt2._x - _root.Bx;
}
Instance of Symbol 248 MovieClip "b3" in Symbol 272 MovieClip [mainmenu] Frame 1
on (release, releaseOutside) {
this.gotoAndStop(1);
this._parent.txt3._y = this._parent.txt3._y - _root.By;
this._parent.txt3._x = this._parent.txt3._x - _root.Bx;
}
Instance of Symbol 248 MovieClip "b4" in Symbol 272 MovieClip [mainmenu] Frame 1
on (release, releaseOutside) {
this.gotoAndStop(1);
this._parent.txt4._y = this._parent.txt4._y - _root.By;
this._parent.txt4._x = this._parent.txt4._x - _root.Bx;
}
Instance of Symbol 248 MovieClip "b5" in Symbol 272 MovieClip [mainmenu] Frame 1
on (release, releaseOutside) {
this.gotoAndStop(1);
this._parent.txt5._y = this._parent.txt5._y - _root.By;
this._parent.txt5._x = this._parent.txt5._x - _root.Bx;
}
Symbol 277 MovieClip [menubutton] Frame 1
stop();
Symbol 277 MovieClip [menubutton] Frame 2
stop();
Symbol 282 MovieClip [shine1] Frame 5
this.removeMovieClip();
Instance of Symbol 248 MovieClip in Symbol 292 MovieClip [statspanel] Frame 1
on (press) {
this.gotoAndStop(2);
_parent.OK._y = _parent.OK._y + _root.By;
_parent.OK._x = _parent.OK._x + _root.Bx;
clearInterval(LLL);
LLL = setInterval(function () {
clearInterval(LLL);
_root.RedyToPlay = true;
_root.bl.removeMovieClip();
_root.ShowNag();
_root.stats.removeMovieClip();
}, 300);
}
on (release, releaseOutside) {
_parent.OK._y = _parent.OK._y - _root.By;
_parent.OK._x = _parent.OK._x - _root.Bx;
this.gotoAndStop(1);
}
Symbol 293 MovieClip [tail] Frame 8
var Name = String(this).substr(String(this).indexOf("il") + 4, 50);
this._x = -30;
this._x = _root.FLY[Name]._x + (Math.random() * 20);
this._y = _root.FLY[Name]._y + (Math.random() * 20);
Instance of Symbol 248 MovieClip in Symbol 303 MovieClip [Nag] Frame 1
on (release, releaseOutside) {
this.gotoAndStop(1);
this._parent.txt3._y = this._parent.txt3._y - _root.By;
this._parent.txt3._x = this._parent.txt3._x - _root.Bx;
if (_root.RoundCountry == (_root.MaxC + 1)) {
_root.RoundCountry = (_root.RoundSity = 0);
_root.Life = 0;
_root.FGameOver();
} else {
_root.InitRound();
}
_root.nag.removeMovieClip();
}
on (press) {
if (_global.GameSwitch == false) {
if (_global.showComNow()) {
_global.restartPage();
}
trace("Z? - indicateGameStart");
_global.zdata.indicateGameStart();
_global.GameSwitch = true;
}
_root.button_s.start(_root.SoundOn);
this.gotoAndStop(2);
this._parent.txt3._y = this._parent.txt3._y + _root.By;
this._parent.txt3._x = this._parent.txt3._x + _root.Bx;
}
Instance of Symbol 248 MovieClip in Symbol 303 MovieClip [Nag] Frame 1
on (release, releaseOutside) {
this.gotoAndStop(1);
this._parent.txt1._y = this._parent.txt1._y - _root.By;
this._parent.txt1._x = this._parent.txt1._x - _root.Bx;
getURL (_root.downloadlink, "_blank");
}
on (press) {
_root.button_s.start(_root.SoundOn);
this.gotoAndStop(2);
this._parent.txt1._y = this._parent.txt1._y + _root.By;
this._parent.txt1._x = this._parent.txt1._x + _root.Bx;
}
Symbol 332 MovieClip Frame 1
stop();
Symbol 670 MovieClip [ShowT] Frame 10
this.removeMovieClip();
Symbol 678 MovieClip [SUNb] Frame 10
if (_root.Sun != _root.SunM) {
this.removeMovieClip();
}
Symbol 679 MovieClip [SUNd] Frame 31
this.removeMovieClip();
Symbol 681 MovieClip Frame 7
this._parent.removeMovieClip();
Instance of Symbol 198 MovieClip [bigbutton] in Symbol 779 MovieClip [svitok] Frame 1
on (press) {
this.gotoAndStop(2);
this._parent.textb._x = this._parent.textb._x + _root.Bx;
this._parent.textb._y = this._parent.textb._y + _root.By;
}
on (release, releaseOutside) {
this.gotoAndStop(2);
this._parent.textb._x = this._parent.textb._x - _root.Bx;
this._parent.textb._y = this._parent.textb._y - _root.By;
clearInterval(_root.disapear);
_root.RoundCountry++;
if (_root.RoundCountry <= _root.MaxC) {
_root.InitRound();
} else {
_root.Nag();
}
_root.FLY.removeMovieClip();
}
Symbol 815 MovieClip [blow1] Frame 7
this.removeMovieClip();
Symbol 848 MovieClip [blow2] Frame 7
this.removeMovieClip();
Symbol 881 MovieClip [blow3] Frame 7
this.removeMovieClip();
Symbol 914 MovieClip [blow4] Frame 7
this.removeMovieClip();
Symbol 947 MovieClip [blow5] Frame 7
this.removeMovieClip();
Symbol 980 MovieClip [blow6] Frame 7
this.removeMovieClip();
Symbol 983 MovieClip [sunen] Frame 1
_root.Lightning_s.start(_root.SoundOn);
Symbol 983 MovieClip [sunen] Frame 10
stop();
this.removeMovieClip();