Frame 2
function ef_go() {
progress.setprogress((this.getBytesLoaded() / this.getBytesTotal()) * 100);
if (this.getBytesLoaded() == this.getBytesTotal()) {
this.onEnterFrame = undefined;
_root.gotoAndStop("MainMenu");
}
}
if (_global.bypass == "true") {
if (_global.link != undefined) {
_root.link = _global.link;
}
if (_global.dload_f != undefined) {
_root.dload_f = _global.dload_f;
}
if (_global.close_f != undefined) {
_root.close_f = _global.close_f;
}
if (_global.alawar_f != undefined) {
_root.alawar_f = _global.alawar_f;
}
} else {
stop();
progress.init();
progress.start();
}
Stage.showMenu = false;
var so = SharedObject.getLocal("ma2");
var inf = new Object();
inf.flag = "inf";
inf.level = 0;
inf.score = 0;
inf.balls = 0;
if (so.data.content.flag == "inf") {
inf.level = so.data.content.level;
inf.score = so.data.content.score;
inf.balls = so.data.content.balls;
}
MaxLevel = inf.level;
CurrentLevel = MaxLevel;
CurrentScore = inf.score;
PayBalls = inf.balls;
Frame 3
var my_lc = new LocalConnection();
tst.text = my_lc.domain();
var MAPW5 = 43;
var MAPH5 = 15;
var OFFSETX5 = 45;
var OFFSETY5 = 125;
var TileSet5 = "_0|_1|_2|_W|_D";
var LevelMap5 = "---------------------------------------------------------*-*-*-*-*----------------------------------------------------------------------------*---*-*---*------------------------------*---*-!@!@*---*--------------------------*-------*-*-------*----------------------*----*-*-------*-*----*------------------*----*-----*-*-*-----*----*------------------*----*-*---gg--*-*----*----------------------*-------*-*-------*--------------------------*---*-----*---*------------------------------*---*-*---*------------------------------------!@!@------------------------------------*-*-*-*-*-------------------------------------------------------------------------------------------------------------------------*-*-*-*----------------------------------------------------------------------------------*------------------------------------------------------------------------------------*-*----------------------------------------------------------------------------*-*-*-*-*-*-*-*-*----------------------------------gg----------------------------------------*-*------------------------------------------------------------------------------------*----------------------------------------------------------------------------------*-*-*-*----------------------------------------------------------------";
var MAPW4 = 47;
var MAPH4 = 19;
var OFFSETX4 = -15;
var OFFSETY4 = 35;
var TileSet4 = "_0|_2|_0|_2";
var LevelMap4 = "--------------------------------------------------------------------*--------------------------------------------------------------------------------------------*-*------------------------------------------------------------------------------------------*-*-*-----------------------------------------------------------------------------------*-*-*-*-*-*-*-*-*--------------------------*-*-----1111111111----*-*------------------*-*-----*-*-*-*3*-*3*-*-*-----*-*------------------*-*-----11ggggd3!^----*-*--------------------------*-*-*-*-*-*-*-*-*----------------------------------1111111111---------------------------------------*-*-*------------------------------------------------------------------------------------------*-*--------------------------------------------------------------------------------------------*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*--------------------------------------------------------------------------------------------*-*----------------------------------------------------------------------------------------*-*-*-*-*----------------------------------*-*-1111111111*-*--------------------------*-*-----*---*---*-----*-*--------------------------*-*-11--11--11*-*----------------------------------*-*-*-*-*--------------------------------------1111111111----------------------------------------*-*--------------------------------------------------------------------------------------------*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*-----------------------------------------------------------------------------------------*-*-*-*-*--------------------------------------1917141312---------------------------------*-*-*-------*-*-*----------------------------------12------15-------------------------------------*-*-*-*-*--------------------------------------1319151714-----------------------------------------*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------";
var MAPW3 = 27;
var MAPH3 = 20;
var OFFSETX3 = 145;
var OFFSETY3 = 60;
var TileSet3 = "_1|_W|_D|_S|_F|_1|_D";
var LevelMap3 = "--------------------------------*---*-----*---*------------29--01----02--28-----------------------------------------------------------------*-------------*------------08---*-*-*----03----------------21!j21--------------------*-*-*-*--------------------22ggggd1--------------------*-*-*-----------------*----d3d1d2---*------------07------------04-----------------------------------------------------------------*---*-----*---*------------09--06----05--27-----------------------------------------------------------------------------------------------------------------------*---*-----*---*---------------------------------------------------------------------------------------------*-------------*--------------------------------------------*-*-*----------------------232224---------------------*-*-*----------------------242325----------------*-------------*---------------------------------------------------------------------------------------------*---*-----*---*---------------------------------------------------------------------------------------------------------------------------------------------------*---*-----*---*---------------------------------------------------------------------------------------------*-------------*------------------------------------------------------------------------*-*------------------------2526--------------------------------------------*-------------*---------------------------------------------------------------------------------------------*---*-----*---*---------------------------------------------------------------------------------------------------------------------------------------------------*--*-*---*-*--*------------------------------------------------------------------*-------------*---------------------------------------*-------------*------------------*-*------------------------2627-----------------------*-*------------------*-----2829----*---------------------------------------*-------------*------------------------------------------------------------------*--*-*---*-*--*---------------------------------------------------------------------------------------------------------------------------------------------------*-*-*-*-*-*-*-*---------------------------------------*-------------*---------------------------------------*-------------*-----------------*-*-*-----------------*----010203---*-----------------*-*-*-----------------*----050904---*-----------------*-*-*-----------------*----060708---*---------------------------------------*-------------*---------------------------------------*-*-*-*-*-*-*-*-------------------------------------------------------------------------------------------------------------------";
var MAPW2 = 35;
var MAPH2 = 15;
var OFFSETX2 = 90;
var OFFSETY2 = 80;
var TileSet2 = "_0|_1|_2|_W|_D|_S|_F";
var LevelMap2 = "--------------------------------------------*-*-*-*-*-*-*-------------------------------------------------------------*-*-*---------------------------------------------------------------*-*-*-*-*----------------------*-*-----------*-*----------------*-----*-*-*-*-*-----*----------------*-*---gggg!m--*-*----------------------*-*-*-*-*---------------------------------------------------------------*-*-*-------------------------------------------------------------*-*-*-*-*-*-*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*-*-*---------------------------------------------------------------*-*-*-*-*------------------------------d3-------------------------------*-*-*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*-*-*-----------------------------------------------------------------*-*1*--------------------------------d3-------------------------------*-*-*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*-*-------------------------------------------------------------------*-*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------";
var MAPW1 = 41;
var MAPH1 = 19;
var OFFSETX1 = 45;
var OFFSETY1 = 50;
var TileSet1 = "_0|_1|_2|_W|_D|_S|_F";
var LevelMap1 = "------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*-*-*-*-------------*-*-*-*-------------------------------------------------------*-*-*-*-------------*-*-*-*----------------------*-*-*-*-*-*----------------------*-*-*-*-----gggg----*-*-*-*-------------------------------------------------------*-*-*-*-------------*-*-*-*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*-*-*-*-------------*-*-*-*-------------------------------------------------------*-*-*-*-------------*-*-*-*-------------------------------------------------------*-*-*-*-------------*-*-*-*-------------------------------------------------------*-*-*-*-------------*-*-*-*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*-*-----------------*-*-----------------------------------------------------------*-*-----------------*-*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------";
var MAPW0 = 27;
var MAPH0 = 20;
var OFFSETX0 = 130;
var OFFSETY0 = 85;
var TileSet0 = "_0|_1|_2|_W|_D|_S";
var LevelMap0 = "----------------------------------------------------------------------------------------------------------------------------------------------*-*-*-*-*-*----------------22122301w103---------------*-*-*-*-*-*--------------*-1202d2022301#------------d1#-*-*-*-*-*-d1-----------*-d3!+gggg!+d2*------------d2*-*-*-*-*-*-d2-------------d32103w213f2---------------*-*-*-*-*-*----------------w111w4w31311-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*-*-*-*-*------------------w322w1w2w4-----------------------------------------------------------------------------------------------------------------------------*-*-*-*-*------------------d3f221d3w1---------------------------------------------------------------------------------------------------------------------------------------------------------------------------";
var global_sound = new Sound();
var button_click_Snd = new Sound();
button_click_Snd.attachSound("button_click.mp3");
var button_highlight_Snd = new Sound();
button_highlight_Snd.attachSound("button_highlight.mp3");
var button_push_Snd = new Sound();
button_push_Snd.attachSound("button_push.mp3");
var menu_slide_in_Snd = new Sound();
menu_slide_in_Snd.attachSound("menu_slide_in.mp3");
var start_gong_Snd = new Sound();
start_gong_Snd.attachSound("start_gong.mp3");
var level_win_Snd = new Sound();
level_win_Snd.attachSound("level_win.mp3");
var tile_deselect_Snd = new Sound();
tile_deselect_Snd.attachSound("tile_deselect.mp3");
var tile_select1_Snd = new Sound();
tile_select1_Snd.attachSound("tile_select1.mp3");
var tile_highlight_Snd = new Sound();
tile_highlight_Snd.attachSound("tile_highlight.mp3");
var tile_takeoff_Snd = new Sound();
tile_takeoff_Snd.attachSound("tile_takeoff.mp3");
var tile_cell_touchdown_Snd = new Sound();
tile_cell_touchdown_Snd.attachSound("tile_cell_touchdown.mp3");
var undo_pressed_Snd = new Sound();
undo_pressed_Snd.attachSound("undo_pressed.mp3");
var map_start_Snd = new Sound();
map_start_Snd.attachSound("map_start.mp3");
var payball_ball_collision2_Snd = new Sound();
payball_ball_collision2_Snd.attachSound("payball_ball_collision2.mp3");
var apply_add_ball_bonus_Snd = new Sound();
apply_add_ball_bonus_Snd.attachSound("apply_add_ball_bonus.mp3");
var apply_magnet_bonus_Snd = new Sound();
apply_magnet_bonus_Snd.attachSound("apply_magnet_bonus.mp3");
var apply_lift_bonus_Snd = new Sound();
apply_lift_bonus_Snd.attachSound("apply_lift_bonus.mp3");
var apply_local_shuffle_Snd = new Sound();
apply_local_shuffle_Snd.attachSound("apply_local_shuffle.mp3");
var artifact_appear_Snd = new Sound();
artifact_appear_Snd.attachSound("artifact_appear.mp3");
var PayBalls;
var CurrentScore;
var CurrentLevel;
var Lives;
var Gems;
var ComixToShow;
var MaxLevel;
var LevelMap;
var _LevelMap;
var __LevelMap;
var NumLayers;
var TileSet;
var AllPairs;
var Pairs;
var PairsHist;
var IMAPW;
var IMAPH;
var MAPOSX;
var MAPOSY;
var CapsTotal;
var WinFlag;
var FASTBONUS = [60, 120, 240, 240, 240, 360];
var SCOREFORELBONUS = 5000;
var SCORES = [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 150, 150, 150, 150, 200, 200, 200, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, 0, 0, 0, 0, 100, 100, 100, 100, 100, 100];
var CAPS = new Array();
CAPS.gg = 0;
CAPS.w1 = 28;
CAPS.w2 = 29;
CAPS.w3 = 30;
CAPS.w4 = 31;
CAPS.d1 = 32;
CAPS.d2 = 33;
CAPS.d3 = 34;
CAPS.s1 = 35;
CAPS.s2 = 36;
CAPS.s3 = 37;
CAPS.s4 = 38;
CAPS.f1 = 39;
CAPS.f2 = 40;
CAPS.f3 = 41;
CAPS.f4 = 42;
CAPS["!^"] = 52;
CAPS["!@"] = 53;
CAPS["!+"] = 55;
CAPS["!m"] = 54;
CAPS["!x"] = 50;
CAPS["!j"] = 51;
var NCAPS = new Array();
NCAPS["01"] = 1;
NCAPS["02"] = 2;
NCAPS["03"] = 3;
NCAPS["04"] = 4;
NCAPS["05"] = 5;
NCAPS["06"] = 6;
NCAPS["07"] = 7;
NCAPS["08"] = 8;
NCAPS["09"] = 9;
NCAPS["11"] = 10;
NCAPS["12"] = 11;
NCAPS["13"] = 12;
NCAPS["14"] = 13;
NCAPS["15"] = 14;
NCAPS["16"] = 15;
NCAPS["17"] = 16;
NCAPS["18"] = 17;
NCAPS["19"] = 18;
NCAPS["21"] = 19;
NCAPS["22"] = 20;
NCAPS["23"] = 21;
NCAPS["24"] = 22;
NCAPS["25"] = 23;
NCAPS["26"] = 24;
NCAPS["27"] = 25;
NCAPS["28"] = 26;
NCAPS["29"] = 27;
function newArray(obj, aname) {
if (arguments[2] == null) {
trace("Can`t create an array not enough arguments");
}
obj[aname] = new Array(arguments[2]);
var _local3;
var _local2;
if (arguments[3] != null) {
_local3 = 0;
while (_local3 < arguments[2]) {
obj[aname][_local3] = new Array(arguments[3]);
if (arguments[4] != null) {
_local2 = 0;
while (_local2 < arguments[3]) {
obj[aname][_local3][_local2] = new Array(arguments[4]);
_local2++;
}
}
_local3++;
}
}
}
function copyObj(s, d) {
for (var _local4 in s) {
var _local1 = new Object();
_local1 = s[_local4];
if (_local1 instanceof Object) {
d[_local4] = new Object();
copyobj(_local1, d[_local4]);
} else {
d[_local4] = s[_local4];
}
}
}
function copyArr(sarr, darr) {
var _local1;
var _local2;
var _local3;
_local1 = 0;
while (_local1 < sarr.length) {
if (sarr[_local1] instanceof Array) {
_local2 = 0;
while (_local2 < sarr[_local1].length) {
if (sarr[_local1][_local2] instanceof Array) {
_local3 = 0;
while (_local3 < sarr[_local1][_local2].length) {
darr[_local1][_local2][_local3] = sarr[_local1][_local2][_local3];
_local3++;
}
} else {
darr[_local1][_local2] = sarr[_local1][_local2];
}
_local2++;
}
} else {
darr[_local1] = sarr[_local1];
}
_local1++;
}
}
function gotoDownload() {
trace("dload pressed");
if (_root.link != undefined) {
getURL (link, "_blank");
} else {
getURL ("http://www.alawar.com/download/MahjonggArtifacts2.exe", "_blank");
}
if (_root.dload_f != undefined) {
cstr = ("JavaScript:" + dload_f) + "()";
getURL (cstr);
}
}
function mmplayquest() {
if (_root.CurrentLevel > 0) {
gotoAndStop ("PlayQuest");
} else {
startnewgame();
}
}
function startnewgame() {
PayBalls = 0;
CurrentScore = 0;
CurrentLevel = 0;
MaxLevel = 0;
ComixToShow = 1;
gotoAndStop ("Comix");
}
function continuegame() {
ComixToShow = MaxLevel + 1;
gotoAndStop ("Comix");
}
function nextlevel() {
CurrentLevel++;
if (CurrentLevel > MaxLevel) {
MaxLevel = CurrentLevel;
}
continuegame();
}
function endartif() {
nextlevel();
}
function endcomix() {
if (CurrentLevel == 0) {
gotoAndStop ("Game");
} else {
gotoAndStop ("Map");
}
}
function getLevelData(lev, callback) {
var _local12;
var _local4;
var _local3;
var _local5;
var _local10;
var _local11;
var _local14;
var _local9;
var _local6;
var _local13;
_root.IMAPW = _root["MAPW" + lev];
_root.IMAPH = _root["MAPH" + lev];
_root.MAPOSX = _root["OFFSETX" + lev];
_root.MAPOSY = _root["OFFSETY" + lev];
_local13 = _root["LevelMap" + lev];
_local14 = (_local13.length / IMAPW) / IMAPH;
_local10 = IMAPW;
_local11 = IMAPH;
NumLayers = _local14;
newArray(_root, "LevelMap", _local10, _local11, _local14);
_local4 = 0;
while (_local4 < _local14) {
_local3 = 0;
while (_local3 < _local11) {
_local5 = 0;
while (_local5 < _local10) {
_local9 = _local13.substr((((_local10 * _local11) * _local4) + (_local10 * _local3)) + _local5, 1);
_root.LevelMap[_local5][_local3][_local4] = _local9;
_local5++;
}
_local3++;
}
_local4++;
}
_local12 = 0;
_root.CapsTotal = 0;
_local4 = 0;
while (_local4 < _local14) {
_local3 = 0;
while (_local3 < _local11) {
_local5 = 0;
while (_local5 < _local10) {
if ((_root.LevelMap[_local5][_local3][_local4] == "*") || (_root.LevelMap[_local5][_local3][_local4] == "#")) {
_root.CapsTotal++;
if (_root.LevelMap[_local5][_local3 + 1][_local4] == "-") {
_root.LevelMap[_local5][_local3][_local4] = 9999;
_root.LevelMap[_local5 + 1][_local3][_local4] = 0;
_root.LevelMap[_local5 + 1][_local3 + 1][_local4] = 0;
_root.LevelMap[_local5][_local3 + 1][_local4] = 0;
_local12++;
} else {
_local9 = _root.LevelMap[_local5][_local3 + 1][_local4] + _root.LevelMap[_local5 + 1][_local3 + 1][_local4];
if ((((((_root.LevelMap[_local5][_local3 + 1][_local4] == "!") || (_root.LevelMap[_local5][_local3 + 1][_local4] == "g")) || (_root.LevelMap[_local5][_local3 + 1][_local4] == "w")) || (_root.LevelMap[_local5][_local3 + 1][_local4] == "d")) || (_root.LevelMap[_local5][_local3 + 1][_local4] == "s")) || (_root.LevelMap[_local5][_local3 + 1][_local4] == "f")) {
_local6 = CAPS[_local9];
} else {
_local6 = NCAPS[_local9];
}
_root.LevelMap[_local5][_local3][_local4] = _local6 + Number(((_root.LevelMap[_local5][_local3][_local4] == "#") ? 11000 : 1000));
_root.LevelMap[_local5 + 1][_local3][_local4] = _local6;
_root.LevelMap[_local5 + 1][_local3 + 1][_local4] = _local6;
_root.LevelMap[_local5][_local3 + 1][_local4] = _local6;
}
}
_local5++;
}
_local3++;
}
_local4++;
}
_local12 = Math.floor(_local12 / 2);
TileSet = _root["TileSet" + lev].split("|");
var _local8;
var _local7;
AllPairs = new Array();
_local4 = 0;
while (_local4 < TileSet.length) {
switch (TileSet[_local4]) {
case "_0" :
_local8 = 1;
_local7 = 9;
break;
case "_1" :
_local8 = 10;
_local7 = 18;
break;
case "_2" :
_local8 = 19;
_local7 = 27;
break;
case "_W" :
_local8 = 28;
_local7 = 31;
break;
case "_D" :
_local8 = 32;
_local7 = 34;
break;
case "_S" :
_local8 = 35;
_local7 = 38;
break;
case "_F" :
_local8 = 39;
_local7 = 42;
break;
case "!x" :
_local8 = 50;
_local7 = 50;
break;
case "!j" :
_local8 = 51;
_local7 = 51;
break;
case "!^" :
_local8 = 52;
_local7 = 52;
break;
case "!@" :
_local8 = 53;
_local7 = 53;
break;
case "!m" :
_local8 = 54;
_local7 = 54;
break;
case "!+" :
_local8 = 55;
_local7 = 55;
}
_local3 = _local8;
while (_local3 <= _local7) {
AllPairs.push(_local3);
_local3++;
}
_local4++;
}
if (AllPairs.length < _local12) {
_local4 = 0;
_local3 = AllPairs.length;
while (AllPairs.length < _local12) {
AllPairs.push(AllPairs[_local4]);
_local4++;
if (_local4 >= _local3) {
_local4 = 0;
}
}
}
newArray(_root, "Pairs", _local12, 2);
_local4 = 0;
while (_local4 < Pairs.length) {
_local6 = Math.floor(Math.random() * AllPairs.length);
Pairs[_local4][0] = AllPairs[_local6];
Pairs[_local4][1] = AllPairs[_local6];
AllPairs[_local6] = AllPairs[AllPairs.length - 1];
AllPairs.pop();
_local4++;
}
var _local16 = this.createEmptyMovieClip("mc_genMap", this.getNextHighestDepth());
var _local17 = new Array();
var _local19;
var _local20;
newArray(_root, "_LevelMap", _local10, _local11, _local14);
newArray(_root, "__LevelMap", _local10, _local11, _local14);
copyArr(_root.LevelMap, _root.__LevelMap);
mc_genMap.cnt = 100;
mc_genMap.callback = callback;
mc_genMap.onEnterFrame = genMap;
}
function genMap(shufflef) {
if (((this.cnt--) > 0) || (shufflef)) {
_root.copyArr(_root.LevelMap, _root._LevelMap);
m = 0;
while (m < Pairs.length) {
var _local4 = false;
var _local3 = new Array();
i = 0;
while (i < NumLayers) {
j = 0;
while (j < IMAPH) {
k = 0;
while (k < IMAPW) {
if ((_root._LevelMap[k][j][i] == 9999) && (isCapFree(_root._LevelMap, k, j, i))) {
_local3.push({i:i, j:j, k:k});
}
k++;
}
j++;
}
i++;
}
if (_local3.length < 2) {
_local4 = true;
break;
}
tmpn = Math.floor(Math.random() * _local3.length);
assignCap(Pairs[m][0], _root.__LevelMap, _local3[tmpn]);
clearCap(_root._LevelMap, _local3[tmpn]);
_local3[tmpn] = _local3[_local3.length - 1];
_local3.pop();
tmpn = Math.floor(Math.random() * _local3.length);
assignCap(Pairs[m][1], _root.__LevelMap, _local3[tmpn]);
clearCap(_root._LevelMap, _local3[tmpn]);
_local3[tmpn] = _local3[_local3.length - 1];
_local3.pop();
m++;
}
if (shufflef) {
return(undefined);
}
if (!_local4) {
this.cnt = 0;
this.onEnterFrame = null;
_root.copyArr(_root.__LevelMap, _root.LevelMap);
this.callback();
}
} else {
this.onEnterFrame = null;
_root.gotoAndStop("MainMenu");
}
}
function shuffle() {
var _local7;
var _local6;
var _local5;
var _local2 = new Array();
var _local3 = new Array();
_local7 = 0;
while (_local7 < NumLayers) {
_local6 = 0;
while (_local6 < IMAPH) {
_local5 = 0;
while (_local5 < IMAPW) {
tmp = _root.LevelMap[_local5][_local6][_local7];
if ((typeof(tmp) == "number") && (tmp >= 1000)) {
if (tmp > 2000) {
tmp = tmp - 10000;
}
_root.LevelMap[_local5][_local6][_local7] = 9999;
_root.LevelMap[_local5 + 1][_local6][_local7] = 0;
_root.LevelMap[_local5 + 1][_local6 + 1][_local7] = 0;
_root.LevelMap[_local5][_local6 + 1][_local7] = 0;
_local2.push(tmp - 1000);
}
_local5++;
}
_local6++;
}
_local7++;
}
trace("Caps total: " + _local2.length);
trace("Pairs init: " + Math.ceil(_local2.length / 2));
newArray(_root, "Pairs", Math.ceil(_local2.length / 2), 2);
var _local8;
var _local4;
_local4 = 0;
while (_local2.length > 0) {
_local8 = false;
_local6 = 1;
while (_local6 < _local2.length) {
if (_local2[_local6] == _local2[0]) {
_root.Pairs[_local4][0] = _local2[0];
_root.Pairs[_local4][1] = _local2[_local6];
_local2[_local6] = _local2[_local2.length - 1];
_local2.pop();
_local2.shift();
_local8 = true;
_local4++;
}
_local6++;
}
if (!_local8) {
_local3.push(_local2.shift());
trace(_local3[_local3.length - 1]);
}
}
_local7 = 0;
while (_local7 < Math.ceil(_local3.length / 2)) {
_root.Pairs.pop();
_local7++;
}
trace("Pairs actualy: " + _root.Pairs.length);
_local7 = 0;
while (_local7 < _root.Pairs.length) {
if (_root.Pairs[_local7][0] == 0) {
_local6 = _root.Pairs[_root.Pairs.length - 1][0];
_local5 = _root.Pairs[_root.Pairs.length - 1][1];
_root.Pairs[_root.Pairs.length - 1][0] = _root.Pairs[_local7][0];
_root.Pairs[_root.Pairs.length - 1][1] = _root.Pairs[_local7][1];
_root.Pairs[_local7][0] = _local6;
_root.Pairs[_local7][1] = _local5;
break;
}
_local7++;
}
copyArr(_root.LevelMap, _root.__LevelMap);
genMap(true);
_root.copyArr(_root.__LevelMap, _root.LevelMap);
trace("---");
_local7 = 0;
while (_local7 < NumLayers) {
_local6 = 0;
while (_local6 < IMAPH) {
_local5 = 0;
while (_local5 < IMAPW) {
if (_root.LevelMap[_local5][_local6][_local7] == 9999) {
tmp = _local3.shift();
trace(tmp);
assignCap(Number(tmp), _root.LevelMap, {k:_local5, j:_local6, i:_local7});
}
_local5++;
}
_local6++;
}
_local7++;
}
}
function isCapFree(Arr, cx, cy, cz) {
if (cz < (NumLayers - 1)) {
if (Arr[cx][cy][cz + 1] != "-") {
return(false);
}
if (Arr[cx + 1][cy][cz + 1] != "-") {
return(false);
}
if (Arr[cx + 1][cy + 1][cz + 1] != "-") {
return(false);
}
if (Arr[cx][cy + 1][cz + 1] != "-") {
return(false);
}
}
if ((Arr[cx - 1][cy][cz] == "-") && (Arr[cx - 1][cy + 1][cz] == "-")) {
return(true);
}
if ((Arr[cx + 2][cy][cz] == "-") && (Arr[cx + 2][cy + 1][cz] == "-")) {
return(true);
}
return(false);
}
function assignCap(type, Arr, cobj) {
Arr[cobj.k][cobj.j][cobj.i] = type + 1000;
Arr[cobj.k + 1][cobj.j][cobj.i] = type;
Arr[cobj.k + 1][cobj.j + 1][cobj.i] = type;
Arr[cobj.k][cobj.j + 1][cobj.i] = type;
}
function clearCap(Arr, cobj) {
Arr[cobj.k][cobj.j][cobj.i] = "-";
Arr[cobj.k + 1][cobj.j][cobj.i] = "-";
Arr[cobj.k + 1][cobj.j + 1][cobj.i] = "-";
Arr[cobj.k][cobj.j + 1][cobj.i] = "-";
}
function saveso() {
_root.inf.level = _root.MaxLevel + 1;
_root.inf.score = _root.CurrentScore;
_root.inf.balls = _root.PayBalls;
_root.so.data.content = _root.inf;
}
stop();
if (snd_firstime == undefined) {
snd_firstime = false;
var sosnd = SharedObject.getLocal("sound");
var snd = new Object();
snd.flag = "snd";
snd.volume = 50;
snd.mute = false;
if (sosnd.data.content.flag == "snd") {
snd.volume = sosnd.data.content.volume;
snd.mute = sosnd.data.content.mute;
}
}
Frame 38
stop();
Symbol 71 MovieClip Frame 1
stop();
Symbol 76 MovieClip Frame 1
stop();
Symbol 81 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 92 MovieClip [_cap_] Frame 1
function init() {
btn.useHandCursor = isfree;
this._visible = false;
if (captype != null) {
setpic(captype);
}
}
function setpic(ctype) {
if (pic != null) {
pic.removeMovieClip();
}
pic = this.createEmptyMovieClip("pic", 1);
picdata = flash.display.BitmapData.loadBitmap("pic_" + ctype);
pic.attachBitmap(picdata, 1);
mc_pearl.swapDepths(this.getNextHighestDepth() + 1);
}
function repaint() {
if (masked) {
mc_mask.gotoAndStop(2);
}
mc_shaded.gotoAndStop((ofgold ? 2 : 1));
mc_light.gotoAndStop((ofgold ? 2 : 1));
mc_back.gotoAndStop((ofgold ? 2 : 1));
mc_light._visible = lighted;
if (pearl) {
mc_pearl._visible = true;
} else {
mc_pearl._visible = false;
}
mc_shaded._alpha = (shaded ? 100 : (zorder * ZORDERSTEP));
pic._alpha = (shaded ? 30 : 100);
makecursover(cursover);
this._visible = true;
}
function makecursover(showco) {
cursover = showco;
mc_shaded._x = (showco ? (CURSOVERDIST) : 0);
mc_light._x = (showco ? (CURSOVERDIST) : 0);
mc_back._x = (showco ? (CURSOVERDIST) : 0);
pic._x = (showco ? (CURSOVERDIST) : 0);
mc_shadow._x = (showco ? (CURSOVERDIST) : 0);
mc_pearl._x = (showco ? (CURSOVERDIST + 15) : 15);
mc_shaded._y = (showco ? (CURSOVERDIST) : 0);
mc_light._y = (showco ? (CURSOVERDIST) : 0);
mc_back._y = (showco ? (CURSOVERDIST) : 0);
pic._y = (showco ? (CURSOVERDIST) : 0);
mc_shadow._y = (showco ? (CURSOVERDIST) : 0);
mc_pearl._y = (showco ? (CURSOVERDIST + 1) : 1);
}
function showpic() {
ALPHAMAX = (shaded ? 30 : 100);
this.onEnterFrame = ef_showpic;
}
function ef_showpic() {
if ((pic._alpha + ALPHASTEP) < ALPHAMAX) {
pic._alpha = pic._alpha + ALPHASTEP;
} else {
pic._alpha = ALPHAMAX;
this.onEnterFrame = null;
}
}
function hidepic() {
this.onEnterFrame = ef_hidepic;
}
function ef_hidepic() {
if ((pic._alpha - ALPHASTEP) > ALPHAMIN) {
pic._alpha = pic._alpha - ALPHASTEP;
} else {
pic._alpha = ALPHAMIN;
this.onEnterFrame = null;
}
}
var ZORDERSTEP = 10;
var CURSOVERDIST = -1;
var zorder;
var cursover;
var shaded;
var lighted;
var ofgold;
var captype;
var isfree;
var pearl;
var picdata;
var pic;
var coord;
var masked;
init();
repaint();
var ALPHAMIN = 0;
var ALPHAMAX;
var ALPHASTEP = 50;
Symbol 138 MovieClip Frame 35
_parent.removeMovieClip();
Symbol 143 MovieClip [_glassanim_] Frame 16
_parent.ballArrived();
this.removeMovieClip();
Symbol 148 MovieClip [_scoreEffect2_] Frame 1
sc.txt.text = "+" + Score;
sc.txt2.text = sc.txt.text;
Symbol 148 MovieClip [_scoreEffect2_] Frame 40
this.removeMovieClip();
Symbol 149 MovieClip [_scoreEffect_] Frame 1
sc.txt.text = "+" + Score;
sc.txt2.text = sc.txt.text;
Symbol 149 MovieClip [_scoreEffect_] Frame 40
this.removeMovieClip();
Symbol 157 MovieClip Frame 1
function init() {
this._alpha = 0;
up1._x = INITXUP;
down1._x = INITXDOWN - (1 * down1._width);
if (up2 != undefined) {
removeMovieClip(up2);
}
if (down2 != undefined) {
removeMovieClip(down2);
}
if (up3 != undefined) {
removeMovieClip(up3);
}
if (down3 != undefined) {
removeMovieClip(down3);
}
}
function start() {
duplicateMovieClip (up1, "up2", this.getNextHighestDepth());
duplicateMovieClip (up1, "up3", this.getNextHighestDepth());
duplicateMovieClip (down1, "down2", this.getNextHighestDepth());
duplicateMovieClip (down1, "down3", this.getNextHighestDepth());
up2._x = up1._width;
up3._x = up1._width * 2;
down2._x = 0;
down3._x = down1._width;
this.onEnterFrame = ef_start;
}
function ef_start() {
up1._x = up1._x - SHIFTSTEP;
up2._x = up2._x - SHIFTSTEP;
up3._x = up3._x - SHIFTSTEP;
down1._x = down1._x + SHIFTSTEP;
down2._x = down2._x + SHIFTSTEP;
down3._x = down3._x + SHIFTSTEP;
i = 1;
while (i <= 3) {
if (this["up" + i]._x < (-1 * up1._width)) {
this["up" + i]._x = up1._width * 2;
}
if (this["down" + i]._x > (2 * down1._width)) {
this["down" + i]._x = -1 * down1._width;
}
i++;
}
if (this._alpha <= (ALPHA - ALPHASTEP)) {
this._alpha = this._alpha + ALPHASTEP;
} else {
this._alpha = ALPHA;
}
}
var INITXUP = 0;
var INITXDOWN = 0;
var SHIFTSTEP = 1;
var ALPHASTEP = 0.7;
var ALPHA;
Symbol 159 MovieClip Frame 1
function init() {
text1.init();
text1.ALPHA = 75;
text2.init();
text2.ALPHA = 15;
}
function start() {
text1.start();
text2.start();
}
Symbol 163 MovieClip Frame 1
FirstTime = true;
Symbol 163 MovieClip Frame 28
if (FirstTime) {
stop();
FirstTime = false;
}
Symbol 163 MovieClip Frame 55
gotoAndPlay (2);
Symbol 183 MovieClip Frame 1
function start() {
Cnt = 0;
this.onEnterFrame = ef_start;
}
function ef_start() {
var _local3;
var _local4;
Cnt++;
if (Cnt < LFRAMES) {
i = 1;
while (i <= 10) {
_local4 = (INITAMP * Math.sin(((((Math.PI*2) / LFRAMES) / 4) * Cnt) + (Math.PI/4))) * (1 - (Cnt / LFRAMES));
_local3 = 100 - (_local4 * Math.sin((((Math.PI*2) / LFRAMES) * LPER) * ((Cnt + INITPH) + (i * LV))));
this["L" + i]._xscale = _local3;
this["L" + i]._yscale = _local3;
_local3 = this["L" + i]._xscale - 100;
if (_local3 > 0) {
if (_local3 > 19) {
this["L" + i]._alpha = (100 - (_local3 * 2.1)) - 20;
} else {
this["L" + i]._alpha = 100 - (_local3 * 2.1);
}
}
i++;
}
} else {
i = 1;
while (i <= 10) {
this["L" + i]._xscale = 100;
this["L" + i]._yscale = 100;
this["L" + i]._alpha = 100;
i++;
}
this.onEnterFrame = undefined;
_parent.dummy.onMouseMove = _parent.go;
}
}
function wave(cx) {
OldCX = CX;
CX = cx;
Cnt = 0;
startf = false;
this.onEnterFrame = ef_wave;
}
function ef_wave() {
var _local3;
var _local5;
var _local4;
Cnt++;
if ((Cnt > 1) && (!startf)) {
return(undefined);
}
if (Cnt < LFRAMES) {
i = 1;
while (i <= 10) {
_local4 = ((((Math.PI*2) * CX) / this._width) * 0.7) + 0.1;
_local5 = (INITAMP * Math.sin(((((Math.PI*2) / LFRAMES) / 4) * Cnt) + (Math.PI/4))) * (1 - (Cnt / LFRAMES));
if ((CX - OldCX) >= 0) {
_local3 = 100 - (_local5 * Math.sin(((((Math.PI*2) / LFRAMES) * LPER) * ((Cnt + INITPH) + (i * LV))) + _local4));
} else {
_local3 = 100 - (_local5 * Math.sin(((((Math.PI*2) / LFRAMES) * LPER) * ((Cnt + INITPH) - (i * LV))) + _local4));
}
if (_local3 < 100) {
_local3 = 100 - ((100 - _local3) * 0.8);
}
this["L" + i]._xscale = _local3;
this["L" + i]._yscale = _local3;
_local3 = this["L" + i]._xscale - 100;
if (_local3 > 0) {
if (_local3 > 18) {
this["L" + i]._alpha = (100 - (_local3 * 2.1)) - 20;
} else {
this["L" + i]._alpha = 100 - (_local3 * 2.1);
}
}
i++;
}
} else {
i = 1;
while (i <= 10) {
this["L" + i]._xscale = 100;
this["L" + i]._yscale = 100;
this["L" + i]._alpha = 100;
i++;
}
this.onEnterFrame = undefined;
_parent.dummy.onMouseMove = _parent.go;
}
}
var LFRAMES = 100;
var LPER = 3;
var INITAMP = 27;
var INITPH = 5;
var LV = 2;
var Cnt;
var CX;
var OldCX = 0;
var startf;
Symbol 189 MovieClip Frame 1
function go() {
if ((((dummy._xmouse < dummy._width) && (dummy._xmouse > 0)) && (dummy._ymouse < dummy._height)) && (dummy._ymouse > 0)) {
loading.wave(dummy._xmouse);
}
}
dummy.useHandCursor = false;
dummy.onRollOut = function () {
loading.startf = true;
};
Symbol 194 MovieClip Frame 1
function start() {
duplicateMovieClip (prnload, "prnload1", this.getNextHighestDepth());
duplicateMovieClip (prnload, "prnload2", this.getNextHighestDepth());
prnload._alpha = PRALPHAINIT;
prnload._xscale = PRMAGNINIT;
prnload._yscale = PRMAGNINIT;
prnload1._alpha = PRALPHAINIT1;
prnload1._xscale = PRMAGNINIT1;
prnload1._yscale = PRMAGNINIT1;
prnload2._alpha = PRALPHAINIT2;
prnload2._xscale = PRMAGNINIT2;
prnload2._yscale = PRMAGNINIT2;
this.onEnterFrame = ef1_start;
}
function ef1_start() {
if (prnload._xscale > 100) {
tmp = PRMAGNSTEP;
if ((prnload._xscale - tmp) < 0) {
tmp = prnload._xscale - 100;
}
prnload._xscale = prnload._xscale - tmp;
prnload._yscale = prnload._yscale - tmp;
prnload._alpha = prnload._alpha + (PRALPHASTEP * PRALPHASTEP);
} else {
prnload._xscale = prnload._xscale - 0.8;
prnload._yscale = prnload._yscale - 0.8;
}
if (prnload._xscale < PRSTART1) {
if (prnload1._xscale > 100) {
tmp = (PRMAGNSTEP1 * PRMAGNSTEP1) / 23;
if ((prnload1._xscale - tmp) < 100) {
tmp = prnload1._xscale - 100;
}
prnload1._xscale = prnload1._xscale - tmp;
prnload1._yscale = prnload1._yscale - tmp;
if (prnload._xscale > 100) {
prnload1._alpha = prnload1._alpha + (PRALPHASTEP1 * PRALPHASTEP1);
} else {
prnload1._alpha = prnload1._alpha - (PRALPHASTEP1 * PRALPHASTEP1);
}
} else {
removeMovieClip(prnload1);
}
}
if (prnload._xscale < PRSTART2) {
if (prnload2._xscale > 100) {
tmp = (PRMAGNSTEP2 * PRMAGNSTEP2) / 15.4;
if ((prnload2._xscale - tmp) < 100) {
tmp = prnload2._xscale - 100;
}
prnload2._xscale = prnload2._xscale - tmp;
prnload2._yscale = prnload2._yscale - tmp;
if (prnload1._xscale != 100) {
prnload2._alpha = prnload2._alpha + (PRALPHASTEP2 * PRALPHASTEP2);
} else {
prnload2._alpha = prnload2._alpha - (PRALPHASTEP2 * PRALPHASTEP2);
}
} else {
removeMovieClip(prnload2);
}
}
if (prnload2 == undefined) {
Cnt = 0;
prnload._alpha = 100;
shadow.play();
prnload.loading.start();
prnload.progress._alpha = 35;
this.onEnterFrame = ef2_start;
_root.onEnterFrame = _root.ef_go;
}
}
function ef2_start() {
Cnt++;
if (Cnt == TEXTSTART) {
text.start();
}
if (Cnt < WVFRAMES) {
tmp = 100 - ((WVINITAMP * (1 - (Cnt / WVFRAMES))) * Math.sin((((Math.PI * Cnt) / WVFRAMES) * WVPERIODS) + (Math.PI/4)));
prnload._xscale = tmp;
prnload._yscale = tmp;
maskmc._xscale = tmp;
maskmc._yscale = tmp;
filled._xscale = tmp;
filled._yscale = tmp;
} else {
this.onEnterFrame = undefined;
}
}
function init() {
text.init();
Cnt = 0;
this._alpha = 100;
htmp = maskmc.target._height;
ytmp = maskmc.target._y;
maskmc.target._height = 0;
maskmc.target._y = ytmp + htmp;
}
function setprogress(pr) {
maskmc.target._height = (pr * htmp) / 100;
maskmc.target._y = ytmp + (htmp * (1 - (pr / 100)));
}
var PRMAGNINIT = 1000;
var PRALPHAINIT = 0;
var PRMAGNSTEP = 25;
var PRALPHASTEP = 1.5;
var PRMAGNINIT1 = 1000;
var PRALPHAINIT1 = 0;
var PRMAGNSTEP1 = 25;
var PRALPHASTEP1 = 1.5;
var PRSTART1 = 700;
var PRMAGNINIT2 = 1000;
var PRALPHAINIT2 = 0;
var PRMAGNSTEP2 = 25;
var PRALPHASTEP2 = 1.6;
var PRSTART2 = 300;
var WVFRAMES = 85;
var WVINITAMP = 17;
var WVPERIODS = 3.5;
var TEXTSTART = 30;
var htmp;
var ytmp;
var Cnt;
Symbol 227 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_root.gotoDownload();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
if (_root.alawar_f == null) {
this._visible = true;
} else {
this._visible = false;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 232 MovieClip Frame 1
playquest.onRollOver = function () {
_root.button_highlight_Snd.start();
};
playquest.onRelease = function () {
_root.button_click_Snd.start();
_root.mmplayquest();
};
playquest.onPress = function () {
_root.button_push_Snd.start();
};
helpbtn.onRollOver = function () {
_root.button_highlight_Snd.start();
};
helpbtn.onRelease = function () {
_root.button_click_Snd.start();
_root.help.show();
};
helpbtn.onPress = function () {
_root.button_push_Snd.start();
_root.help.show();
};
mmexit.onPress = function () {
_root.button_push_Snd.start();
fscommand ("quit");
if (_root.close_f != null) {
cstr = ("JavaScript:" + _root.close_f) + "()";
getURL (cstr);
}
};
mmexit.onRollOver = function () {
_root.button_highlight_Snd.start();
};
if (_root.close_f == null) {
mmexit._visible = false;
} else {
mmexit._visible = true;
}
Symbol 234 MovieClip Frame 1
this.useHandCursor = false;
this.onPress = function () {
};
Symbol 244 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent.hide();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 249 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent.cont.prevFrame();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 254 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent.cont.nextFrame();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 275 MovieClip Frame 1
stop();
Symbol 275 MovieClip Frame 2
stop();
Symbol 275 MovieClip Frame 3
stop();
Symbol 276 MovieClip Frame 1
function show() {
this._visible = true;
}
function hide() {
this._visible = false;
}
function scrollup() {
trace(_currentframe);
if (_currentframe > 1) {
prevFrame();
}
}
function scrolldown() {
if (_currentframe < 3) {
nextFrame();
}
}
stop();
hide();
Symbol 283 MovieClip Frame 1
function update() {
if (_parent._parent.Mute) {
_root.global_sound.setVolume(0);
gotoAndStop (2);
} else {
_root.global_sound.setVolume(_parent._parent.Volume);
gotoAndStop (1);
}
}
update();
stop();
Symbol 283 MovieClip Frame 2
stop();
Symbol 291 MovieClip Frame 1
this.useHandCursor = false;
this.onPress = function () {
};
Symbol 302 MovieClip Frame 1
this.onRollOver = function () {
gotoAndStop (2);
_parent.hint.lshow();
_parent.hint.speaker.update();
};
this.onRollOut = function () {
gotoAndStop (1);
_parent.hint.lhide();
};
this.onMouseUp = function () {
if ((((this._xmouse > this._width) || (this._ymouse > this._height)) || (this._xmouse < 0)) || (this._ymouse < 0)) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
};
stop();
Symbol 302 MovieClip Frame 2
stop();
Symbol 302 MovieClip Frame 3
stop();
Symbol 306 MovieClip Frame 1
this.useHandCursor = false;
this.onRollOver = function () {
gotoAndStop (2);
_parent.regul.gotoAndStop(2);
};
this.onRollOut = function () {
gotoAndStop (1);
_parent.regul.gotoAndStop(1);
};
stop();
Symbol 306 MovieClip Frame 2
stop();
Symbol 306 MovieClip Frame 3
stop();
Symbol 312 MovieClip Frame 1
this.onRollOver = function () {
gotoAndStop (2);
_parent.scal.gotoAndStop(2);
};
this.onRollOut = function () {
gotoAndStop (1);
_parent.scal.gotoAndStop(1);
};
stop();
Symbol 312 MovieClip Frame 2
stop();
Symbol 312 MovieClip Frame 3
stop();
Symbol 317 MovieClip Frame 1
function update() {
if (_parent._parent._parent._parent.Mute) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
stop();
Symbol 317 MovieClip Frame 2
stop();
Symbol 318 MovieClip Frame 1
function lshow() {
this.onEnterFrame = ef_lshow;
}
function ef_lshow() {
if ((this._alpha + ALPHASTEP) < ALPHAMAX) {
this._alpha = this._alpha + ALPHASTEP;
} else {
this._alpha = ALPHAMAX;
this.onEnterFrame = undefined;
}
this._xscale = 100 + ((SCALEMAX * this._alpha) / (ALPHAMAX - ALPHAMIN));
this._yscale = _xscale;
}
function lhide() {
this.onEnterFrame = ef_lhide;
}
function ef_lhide() {
if ((this._alpha - ALPHASTEP) > ALPHAMIN) {
this._alpha = this._alpha - ALPHASTEP;
} else {
this._alpha = ALPHAMIN;
this.onEnterFrame = undefined;
}
this._xscale = 100 + ((SCALEMAX * this._alpha) / (ALPHAMAX - ALPHAMIN));
this._yscale = _xscale;
}
var ALPHAMIN = 0;
var ALPHAMAX = 100;
var ALPHASTEP = 35;
var SCALEMAX = 25;
this._alpha = ALPHAMIN;
this._xscale = 100;
this._yscale = 100;
Symbol 322 MovieClip Frame 1
function lshow() {
this.onEnterFrame = ef_lshow;
}
function ef_lshow() {
if ((this._alpha + ALPHASTEP) < ALPHAMAX) {
this._alpha = this._alpha + ALPHASTEP;
} else {
this._alpha = ALPHAMAX;
this.onEnterFrame = undefined;
}
this._xscale = 100 + ((SCALEMAX * this._alpha) / (ALPHAMAX - ALPHAMIN));
this._yscale = _xscale;
}
function lhide() {
this.onEnterFrame = ef_lhide;
}
function ef_lhide() {
if ((this._alpha - ALPHASTEP) > ALPHAMIN) {
this._alpha = this._alpha - ALPHASTEP;
} else {
this._alpha = ALPHAMIN;
this.onEnterFrame = undefined;
}
this._xscale = 100 + ((SCALEMAX * this._alpha) / (ALPHAMAX - ALPHAMIN));
this._yscale = _xscale;
}
var ALPHAMIN = 0;
var ALPHAMAX = 100;
var ALPHASTEP = 35;
var SCALEMAX = 25;
this._alpha = ALPHAMIN;
this._xscale = 100;
this._yscale = 100;
Symbol 323 MovieClip Frame 1
function setvol(vol) {
update((YMAX - ((vol / 100) * (YMAX - YMIN))) + (regul._height / 4));
}
function update(ry) {
regul._y = ry - (regul._height / 4);
if (regul._y < YMIN) {
regul._y = YMIN;
}
if (regul._y > YMAX) {
regul._y = YMAX;
}
grade.arrow._y = ((regul._y - 8.2) * 1.018) - 4.4;
_parent._parent.Volume = Math.floor(((YMAX - regul._y) / (YMAX - YMIN)) * 100);
if (!_parent._parent.Mute) {
_root.global_sound.setVolume(_parent._parent.Volume);
}
}
function mouse_handler() {
update(_ymouse);
}
var YMIN = 3;
var YMAX = 76;
setvol(_parent._parent.Volume);
mute.onPress = function () {
_parent._parent.Mute = !_parent._parent.Mute;
_parent.speaker.update();
this.gotoAndStop(3);
hint.speaker.update();
};
scal.onPress = function () {
update(_ymouse);
};
regul.onPress = function () {
grade.lshow();
regul.gotoAndStop(3);
scal.gotoAndStop(3);
scal.onMouseMove = mouse_handler;
};
regul.onMouseUp = function () {
scal.onMouseMove = undefined;
if ((((scal._xmouse > (scal._width - 14)) || (scal._ymouse > (scal._height - 1))) || (scal._xmouse < 0)) || (scal._ymouse < 0)) {
regul.gotoAndStop(1);
scal.gotoAndStop(1);
} else {
regul.gotoAndStop(2);
scal.gotoAndStop(2);
}
grade.lhide();
_parent._parent.setsosnd();
};
Symbol 330 MovieClip Frame 1
function lshow() {
this.onEnterFrame = ef_lshow;
}
function ef_lshow() {
if ((light._xscale + ALPHASTEP) < ALPHAMAX) {
light._xscale = light._xscale + ALPHASTEP;
light._yscale = light._yscale + ALPHASTEP;
} else {
light._xscale = ALPHAMAX;
light._yscale = ALPHAMAX;
this.onEnterFrame = undefined;
}
}
function lhide() {
this.onEnterFrame = ef_lhide;
}
function ef_lhide() {
if ((light._xscale - ALPHASTEP) > ALPHAMIN) {
light._xscale = light._xscale - ALPHASTEP;
light._yscale = light._yscale - ALPHASTEP;
} else {
light._xscale = ALPHAMIN;
light._yscale = ALPHAMIN;
this.onEnterFrame = undefined;
}
}
var ALPHAMIN = 100;
var ALPHAMAX = 150;
var ALPHASTEP = 18;
light._xscale = ALPHAMIN;
light._yscale = ALPHAMIN;
this.onRollOver = function () {
lshow();
};
this.onRollOut = function () {
lhide();
};
Symbol 332 MovieClip Frame 1
Symbol 333 MovieClip Frame 1
function setsosnd() {
_parent.snd.volume = Volume;
_parent.snd.mute = Mute;
_parent.sosnd.data.content = _parent.snd;
}
var Volume;
var Mute;
Volume = _parent.snd.volume;
Mute = _parent.snd.mute;
stop();
openbtn.onPress = function () {
gotoAndPlay ("Show");
};
Symbol 333 MovieClip Frame 10
stop();
closebtn.onPress = function () {
play();
};
headbtn.onPress = function () {
play();
};
headbtn.onRollOver = function () {
closebtn.lshow();
};
headbtn.onRollOut = function () {
closebtn.lhide();
};
Symbol 333 MovieClip Frame 17
gotoAndStop ("Start");
Symbol 353 MovieClip Frame 1
mmbtn.onRollOver = function () {
_root.button_highlight_Snd.start();
};
ngbtn.onRollOver = function () {
_root.button_highlight_Snd.start();
};
cgbtn.onRollOver = function () {
_root.button_highlight_Snd.start();
};
mmbtn.onRelease = function () {
_root.button_click_Snd.start();
_root.gotoAndStop("MainMenu");
};
ngbtn.onRelease = function () {
_root.button_click_Snd.start();
_root.startnewgame();
};
cgbtn.onRelease = function () {
_root.button_click_Snd.start();
_root.continuegame();
};
mmbtn.onPress = function () {
_root.button_push_Snd.start();
};
ngbtn.onPress = function () {
_root.button_push_Snd.start();
};
cgbtn.onPress = function () {
_root.button_push_Snd.start();
};
Symbol 360 MovieClip Frame 1
Symbol 360 MovieClip Frame 25
stop();
_root.artifact_appear_Snd.start();
Symbol 364 MovieClip Frame 1
Symbol 364 MovieClip Frame 25
stop();
_root.artifact_appear_Snd.start();
Symbol 368 MovieClip Frame 1
Symbol 368 MovieClip Frame 25
stop();
_root.artifact_appear_Snd.start();
Symbol 372 MovieClip Frame 1
Symbol 372 MovieClip Frame 25
stop();
_root.artifact_appear_Snd.start();
Symbol 376 MovieClip Frame 1
Symbol 376 MovieClip Frame 25
stop();
_root.artifact_appear_Snd.start();
Symbol 377 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_root.endartif();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 378 MovieClip Frame 1
stop();
artif1.stop();
artif2.stop();
artif3.stop();
artif4.stop();
artif5.stop();
this["artif" + _root.CurrentLevel].play(2);
var i = 1;
while (i < _root.MaxLevel) {
this["artif" + i].gotoAndStop("Show");
i++;
}
Symbol 394 MovieClip Frame 1
function show() {
this.onEnterFrame = ef_show;
}
function ef_show() {
if ((this._alpha + ALPHASTEP) < ALPHAMAX) {
this._alpha = this._alpha + ALPHASTEP;
} else {
this._alpha = ALPHAMAX;
this.onEnterFrame = undefined;
Key.addListener(keyListener);
area.onMouseDown = function () {
go();
};
}
}
function hide() {
this.onEnterFrame = ef_hide;
}
function ef_hide() {
if ((this._alpha - ALPHASTEP) > ALPHAMIN) {
this._alpha = this._alpha - ALPHASTEP;
} else {
this._alpha = ALPHAMIN;
this.onEnterFrame = undefined;
_root.endcomix();
}
}
function go() {
area.onMouseDown = undefined;
Key.removeListener(keyListener);
hide();
}
var ALPHAMIN = 0;
var ALPHAMAX = 100;
var ALPHASTEP = 15;
var keyListener = new Object();
keyListener.onKeyDown = function () {
go();
};
this._alpha = ALPHAMIN;
gotoAndStop(_root.ComixToShow);
show();
Symbol 415 MovieClip Frame 25
gotoAndPlay (2);
Symbol 419 MovieClip Frame 1
function init() {
frame._visible = false;
frame.gotoAndStop(1);
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = false;
btn.onPress = function () {
_root.button_push_Snd.start();
_parent.sel(Number(_name.slice(4, 5)));
};
back._visible = true;
}
function setstate(st, fl) {
switch (st) {
case 1 :
setoff();
break;
case 2 :
seton(fl);
break;
case 3 :
setbig(fl);
}
}
function setoff() {
frame._visible = false;
frame.gotoAndStop(1);
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = false;
back._visible = true;
}
function seton(fl) {
if (fl) {
frame._visible = true;
frame.gotoAndPlay(2);
} else {
frame._visible = false;
frame.gotoAndStop(1);
}
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = true;
back._visible = false;
}
function setbig(fl) {
bigframe._visible = true;
if (fl) {
bigframe.gotoAndPlay(2);
} else {
bigframe.gotoAndStop(1);
}
frame._visible = false;
frame.gotoAndStop(1);
large._visible = true;
btn._visible = false;
back._visible = false;
large.lshow();
bigframe.lshow();
}
init();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
};
btn.onReleaseOutside = function () {
_root.button_click_Snd.start();
};
Symbol 431 MovieClip Frame 1
function init() {
frame._visible = false;
frame.gotoAndStop(1);
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = false;
btn.onPress = function () {
_root.button_push_Snd.start();
_parent.sel(Number(_name.slice(4, 5)));
};
back._visible = true;
}
function setstate(st, fl) {
switch (st) {
case 1 :
setoff();
break;
case 2 :
seton(fl);
break;
case 3 :
setbig(fl);
}
}
function setoff() {
frame._visible = false;
frame.gotoAndStop(1);
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = false;
back._visible = true;
}
function seton(fl) {
if (fl) {
frame._visible = true;
frame.gotoAndPlay(2);
} else {
frame._visible = false;
frame.gotoAndStop(1);
}
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = true;
back._visible = false;
}
function setbig(fl) {
bigframe._visible = true;
if (fl) {
bigframe.gotoAndPlay(2);
} else {
bigframe.gotoAndStop(1);
}
frame._visible = false;
frame.gotoAndStop(1);
large._visible = true;
btn._visible = false;
back._visible = false;
}
init();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
};
btn.onReleaseOutside = function () {
_root.button_click_Snd.start();
};
Symbol 443 MovieClip Frame 1
function init() {
frame._visible = false;
frame.gotoAndStop(1);
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = false;
btn.onPress = function () {
_root.button_push_Snd.start();
_parent.sel(Number(_name.slice(4, 5)));
};
back._visible = true;
}
function setstate(st, fl) {
switch (st) {
case 1 :
setoff();
break;
case 2 :
seton(fl);
break;
case 3 :
setbig(fl);
}
}
function setoff() {
frame._visible = false;
frame.gotoAndStop(1);
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = false;
back._visible = true;
}
function seton(fl) {
if (fl) {
frame._visible = true;
frame.gotoAndPlay(2);
} else {
frame._visible = false;
frame.gotoAndStop(1);
}
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = true;
back._visible = false;
}
function setbig(fl) {
bigframe._visible = true;
if (fl) {
bigframe.gotoAndPlay(2);
} else {
bigframe.gotoAndStop(1);
}
frame._visible = false;
frame.gotoAndStop(1);
large._visible = true;
btn._visible = false;
back._visible = false;
}
init();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
};
btn.onReleaseOutside = function () {
_root.button_click_Snd.start();
};
Symbol 455 MovieClip Frame 1
function init() {
frame._visible = false;
frame.gotoAndStop(1);
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = false;
btn.onPress = function () {
_root.button_push_Snd.start();
_parent.sel(Number(_name.slice(4, 5)));
};
back._visible = true;
}
function setstate(st, fl) {
switch (st) {
case 1 :
setoff();
break;
case 2 :
seton(fl);
break;
case 3 :
setbig(fl);
}
}
function setoff() {
frame._visible = false;
frame.gotoAndStop(1);
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = false;
back._visible = true;
}
function seton(fl) {
if (fl) {
frame._visible = true;
frame.gotoAndPlay(2);
} else {
frame._visible = false;
frame.gotoAndStop(1);
}
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = true;
back._visible = false;
}
function setbig(fl) {
bigframe._visible = true;
if (fl) {
bigframe.gotoAndPlay(2);
} else {
bigframe.gotoAndStop(1);
}
frame._visible = false;
frame.gotoAndStop(1);
large._visible = true;
btn._visible = false;
back._visible = false;
}
init();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
};
btn.onReleaseOutside = function () {
_root.button_click_Snd.start();
};
Symbol 467 MovieClip Frame 1
function init() {
frame._visible = false;
frame.gotoAndStop(1);
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = false;
btn.onPress = function () {
_root.button_push_Snd.start();
_parent.sel(Number(_name.slice(4, 5)));
};
back._visible = true;
}
function setstate(st, fl) {
switch (st) {
case 1 :
setoff();
break;
case 2 :
seton(fl);
break;
case 3 :
setbig(fl);
}
}
function setoff() {
frame._visible = false;
frame.gotoAndStop(1);
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = false;
back._visible = true;
}
function seton(fl) {
if (fl) {
frame._visible = true;
frame.gotoAndPlay(2);
} else {
frame._visible = false;
frame.gotoAndStop(1);
}
bigframe._visible = false;
bigframe.gotoAndStop(1);
large._visible = false;
btn._visible = true;
back._visible = false;
}
function setbig(fl) {
bigframe._visible = true;
if (fl) {
bigframe.gotoAndPlay(2);
} else {
bigframe.gotoAndStop(1);
}
frame._visible = false;
frame.gotoAndStop(1);
large._visible = true;
btn._visible = false;
back._visible = false;
}
init();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
};
btn.onReleaseOutside = function () {
_root.button_click_Snd.start();
};
Symbol 468 MovieClip Frame 1
function sel(num) {
if (num == Maximum) {
this["sect" + num].setstate(3, true);
} else {
this["sect" + num].setstate(3, false);
}
if (Current == Maximum) {
this["sect" + Current].setstate(2, true);
} else {
this["sect" + Current].setstate(2, false);
}
Current = num;
_parent.curLevel = Current;
}
function init(level) {
i = 1;
while (i <= 5) {
if (i < level) {
this["sect" + i].setstate(2, false);
} else if (i == level) {
this["sect" + i].setstate(3, true);
}
i++;
}
Current = level;
Maximum = level;
}
var Current;
var Maximum;
Symbol 475 MovieClip Frame 25
stop();
Symbol 476 MovieClip Frame 1
function levtow(level) {
return(Math.ceil(level / 5));
}
function levtol(level) {
return(level - ((levtow(level) - 1) * 5));
}
var maxLevel = _root.MaxLevel;
var curLevel = maxLevel;
_root.map_start_Snd.start();
mmbtn.onRollOver = function () {
_root.button_highlight_Snd.start();
};
startbtn.onRollOver = function () {
_root.button_highlight_Snd.start();
};
mmbtn.onRelease = function () {
_root.button_click_Snd.start();
_root.gotoAndStop("MainMenu");
};
startbtn.onRelease = function () {
_root.button_click_Snd.start();
if (curLevel > 5) {
return(undefined);
}
_root.CurrentLevel = curLevel;
_root.gotoAndStop("Game");
};
mmbtn.onPress = function () {
_root.button_push_Snd.start();
};
startbtn.onPress = function () {
_root.button_push_Snd.start();
};
Symbol 476 MovieClip Frame 17
world1.init(maxLevel);
Symbol 476 MovieClip Frame 24
stop();
msg.stop();
if (maxLevel > 5) {
msg.play();
} else {
msg.gotoAndStop(1);
}
Symbol 489 MovieClip Frame 1
stop();
Symbol 498 MovieClip Frame 1
this.swapDepths(1000);
this.removeMovieClip();
Symbol 499 MovieClip Frame 1
function init() {
XOS = _root.MAPOSX;
YOS = _root.MAPOSY;
this._visible = false;
Ready = false;
CapsNum = 0;
isshowfc = false;
_root.PairsHist = new Array();
_parent.hist.refreshHist();
}
function clearMap() {
OldCap = null;
for (each in this) {
if (this[each] instanceof MovieClip) {
this[each].removeMovieClip();
}
}
}
function showMap(arr) {
var _local19;
var _local18;
var _local17;
var _local4;
var _local6;
var _local11;
var _local10;
var _local9;
var _local8;
var _local15;
var _local14;
var _local13;
var _local12;
var _local20;
AllCaps = new Array();
clearMap();
Ready = false;
_local4 = 0;
_local20 = 0;
_local19 = 0;
while (_local19 < _root.NumLayers) {
_local17 = 0;
while (_local17 < _root.IMAPW) {
_local18 = 0;
while (_local18 < _root.IMAPH) {
_local6 = arr[_local17][_local18][_local19];
if ((typeof(_local6) == "number") && (_local6 >= 1000)) {
_local11 = (typeof(arr[_local17 - 1][_local18][_local19]) == "number") || (typeof(arr[_local17 - 1][_local18 + 1][_local19]) == "number");
_local10 = (typeof(arr[_local17][_local18 - 1][_local19]) == "number") || (typeof(arr[_local17 + 1][_local18 - 1][_local19]) == "number");
_local9 = (typeof(arr[_local17 + 2][_local18][_local19]) == "number") || (typeof(arr[_local17 + 2][_local18 + 1][_local19]) == "number");
_local8 = (typeof(arr[_local17][_local18 + 2][_local19]) == "number") || (typeof(arr[_local17 + 1][_local18 + 2][_local19]) == "number");
_local15 = (typeof(arr[_local17 - 1][_local18][_local19 - 1]) == "number") || (typeof(arr[_local17 - 1][_local18 + 1][_local19 - 1]) == "number");
_local14 = (typeof(arr[_local17][_local18 - 1][_local19 - 1]) == "number") || (typeof(arr[_local17 + 1][_local18 - 1][_local19 - 1]) == "number");
_local13 = (typeof(arr[_local17 + 2][_local18][_local19 - 1]) == "number") || (typeof(arr[_local17 + 2][_local18 + 1][_local19 - 1]) == "number");
_local12 = (typeof(arr[_local17][_local18 + 2][_local19 - 1]) == "number") || (typeof(arr[_local17 + 1][_local18 + 2][_local19 - 1]) == "number");
if (((((_local19 == 0) || ((!_local11) && (_local15))) || ((!_local10) && (_local14))) || ((!_local9) && (_local13))) || ((!_local8) && (_local12))) {
this.attachMovie("_capshadow_", "sh_" + _local4, 100 + _local4);
this["sh_" + _local4]._x = ((XOS + (_local17 * XSTEP)) - (ZXOS * _local19)) - 8;
this["sh_" + _local4]._y = ((YOS + (_local18 * YSTEP)) - (ZYOS * _local19)) - 13;
if (_local19 == 0) {
this["sh_" + _local4]._alpha = 70;
} else {
this["sh_" + _local4]._alpha = 80;
}
_local4 = _local4 + 2;
}
}
_local18++;
}
_local17++;
}
_local17 = 0;
while (_local17 < _root.IMAPW) {
_local18 = 0;
while (_local18 < _root.IMAPH) {
_local6 = arr[_local17][_local18][_local19];
if ((typeof(_local6) == "number") && (_local6 >= 1000)) {
var _local7 = false;
if (_local6 > 2000) {
_local6 = _local6 - 10000;
_local7 = true;
}
_local20++;
this.attachMovie("_cap_", "cap_" + _local4, 100 + _local4, {captype:_local6 - 1000});
if (_root.isCapFree(_root.LevelMap, _local17, _local18, _local19)) {
this["cap_" + _local4].isfree = true;
AllCaps.push(this["cap_" + _local4]);
} else {
this["cap_" + _local4].isfree = false;
}
this["cap_" + _local4]._x = (XOS + (_local17 * XSTEP)) - (ZXOS * _local19);
this["cap_" + _local4]._y = (YOS + (_local18 * YSTEP)) - (ZYOS * _local19);
this["cap_" + _local4].zorder = (_root.NumLayers - 1) - _local19;
if ((typeof(arr[_local17 - 1][_local18 + 2][_local19]) == "number") && (arr[_local17 - 1][_local18 + 2][_local19] >= 1000)) {
this["cap_" + _local4].masked = true;
}
this["cap_" + _local4].cursover = false;
this["cap_" + _local4].shaded = isshowfc && (!this["cap_" + _local4].isfree);
this["cap_" + _local4].lighted = false;
this["cap_" + _local4].pearl = _local7;
this["cap_" + _local4].btn.onRollOver = onCursOver;
this["cap_" + _local4].btn.onRollOut = onCursOut;
this["cap_" + _local4].btn.onPress = onCursPress;
this["cap_" + _local4].coord = {k:_local17, j:_local18, i:_local19};
if ((_local6 - 1000) == 0) {
this["cap_" + _local4].ofgold = true;
}
_local4 = _local4 + 2;
}
_local18++;
}
_local17++;
}
_local19++;
}
CapsNum = _local4;
this._visible = true;
_parent.progr.setpr(1 - (_local20 / _root.CapsTotal));
if (_local20 == 0) {
_parent.ClearBonusFl = true;
} else {
_parent.ClearBonusFl = false;
}
_parent.doCheckMoves();
}
function togglePics(showpics) {
var _local3;
_local3 = 0;
while (_local3 < CapsNum) {
if (this["cap_" + _local3].repaint != undefined) {
if (!showpics) {
this["cap_" + _local3].hidepic();
} else {
this["cap_" + _local3].showpic();
}
}
_local3++;
}
if (!showpics) {
if (_parent.hist.cap_1 != null) {
_parent.hist.cap_1.hidepic();
}
if (_parent.hist.cap_2 != null) {
_parent.hist.cap_2.hidepic();
}
} else {
if (_parent.hist.cap_1 != null) {
_parent.hist.cap_1.showpic();
}
if (_parent.hist.cap_2 != null) {
_parent.hist.cap_2.showpic();
}
}
ispicsshowed = !ispicsshowed;
}
function toggleFreeCaps(showfc) {
i = 0;
while (i < CapsNum) {
if (this["cap_" + i].repaint != undefined) {
if (this["cap_" + i].isfree) {
this["cap_" + i].shaded = false;
this["cap_" + i].repaint();
} else {
this["cap_" + i].shaded = showfc;
this["cap_" + i].repaint();
}
}
i++;
}
isshowfc = showfc;
}
function onCursOver() {
if ((this._parent.isfree || (OldCap.captype == 52)) || (OldCap.captype == 53)) {
_root.tile_highlight_Snd.start();
this._parent.makecursover(true);
}
}
function onCursOut() {
this._parent.makecursover(false);
}
function onCursPress() {
if ((OldCap.captype == 52) && (OldCap != this._parent)) {
_root.tile_takeoff_Snd.start();
_parent.OrderBonusFl = false;
_root.apply_lift_bonus_Snd.start();
bonusLift(OldCap, this._parent);
OldCap = null;
return(undefined);
}
if ((OldCap.captype == 53) && (OldCap != this._parent)) {
_root.tile_takeoff_Snd.start();
_parent.OrderBonusFl = false;
_root.apply_local_shuffle_Snd.start();
bonusLocalShuffle(OldCap, this._parent);
OldCap = null;
return(undefined);
}
if (this._parent.isfree) {
if (!this._parent.lighted) {
if (OldCap != null) {
if (checkCaps(OldCap, this._parent)) {
_root.tile_takeoff_Snd.start();
matchCaps(OldCap, this._parent);
return(undefined);
}
OldCap.lighted = false;
OldCap.repaint();
}
_root.tile_select1_Snd.start();
this._parent.lighted = true;
this._parent.repaint();
OldCap = this._parent;
} else {
_root.tile_deselect_Snd.start();
this._parent.lighted = false;
this._parent.repaint();
OldCap = null;
}
}
}
function checkCaps(Cap1, Cap2) {
if (Cap1.captype == Cap2.captype) {
return(true);
}
if (((((((Cap1.captype == _root.CAPS["!j"]) || (Cap1.captype == _root.CAPS["!^"])) || (Cap1.captype == _root.CAPS["!@"])) || (Cap1.captype == _root.CAPS["!+"])) || (Cap1.captype == _root.CAPS["!m"])) || (Cap1.captype == _root.CAPS["!x"])) || ((((((Cap2.captype == _root.CAPS["!j"]) || (Cap2.captype == _root.CAPS["!^"])) || (Cap2.captype == _root.CAPS["!@"])) || (Cap2.captype == _root.CAPS["!+"])) || (Cap2.captype == _root.CAPS["!m"])) || (Cap2.captype == _root.CAPS["!x"]))) {
return(true);
}
if (((((Cap1.captype == _root.CAPS.s1) || (Cap1.captype == _root.CAPS.s2)) || (Cap1.captype == _root.CAPS.s3)) || (Cap1.captype == _root.CAPS.s4)) && ((((Cap2.captype == _root.CAPS.s1) || (Cap2.captype == _root.CAPS.s2)) || (Cap2.captype == _root.CAPS.s3)) || (Cap2.captype == _root.CAPS.s4))) {
return(true);
}
if (((((Cap1.captype == _root.CAPS.f1) || (Cap1.captype == _root.CAPS.f2)) || (Cap1.captype == _root.CAPS.f3)) || (Cap1.captype == _root.CAPS.f4)) && ((((Cap2.captype == _root.CAPS.f1) || (Cap2.captype == _root.CAPS.f2)) || (Cap2.captype == _root.CAPS.f3)) || (Cap2.captype == _root.CAPS.f4))) {
return(true);
}
return(false);
}
function matchCaps(Cap1, Cap2) {
if (((Cap1.captype == 51) || (Cap2.captype == 51)) && ((Cap1.captype == 0) || (Cap2.captype == 0))) {
return(undefined);
}
if (((Cap1.captype == 55) && (Cap2.captype != 55)) || ((Cap1.captype != 55) && (Cap2.captype == 55))) {
if (Cap1.captype == 55) {
_root.apply_add_ball_bonus_Snd.start();
_root.clearCap(_root.LevelMap, Cap1.coord);
_parent.dyna.fly(Cap1.captype, Cap1._x, Cap1._y, (Cap1._x - 40) + (Math.random() * 120), -50, 8);
if (_root.LevelMap[Cap2.coord.k][Cap2.coord.j][Cap2.coord.i] < 2000) {
_root.LevelMap[Cap2.coord.k][Cap2.coord.j][Cap2.coord.i] = _root.LevelMap[Cap2.coord.k][Cap2.coord.j][Cap2.coord.i] + 10000;
}
}
if (Cap2.captype == 55) {
_root.apply_add_ball_bonus_Snd.start();
_root.clearCap(_root.LevelMap, Cap2.coord);
_parent.dyna.fly(Cap2.captype, Cap2._x, Cap2._y, (Cap2._x - 40) + (Math.random() * 120), -50, 8);
if (_root.LevelMap[Cap1.coord.k][Cap1.coord.j][Cap1.coord.i] < 2000) {
_root.LevelMap[Cap1.coord.k][Cap1.coord.j][Cap1.coord.i] = _root.LevelMap[Cap1.coord.k][Cap1.coord.j][Cap1.coord.i] + 10000;
}
}
showMap(_root.LevelMap);
_parent.OrderBonusFl = false;
return(undefined);
}
if (((Cap1.captype == 54) && (Cap2.captype != 54)) || ((Cap1.captype != 54) && (Cap2.captype == 54))) {
_root.apply_magnet_bonus_Snd.start();
bonusMagnet(Cap1, Cap2);
return(undefined);
}
var _local5;
if ((Cap1.captype == 0) && (Cap2.captype == 0)) {
_local5 = true;
_parent.WINF = true;
}
_root.clearCap(_root.LevelMap, Cap1.coord);
_root.clearCap(_root.LevelMap, Cap2.coord);
addPairsHist(Cap1, Cap2);
_parent.addScore(Cap1, Cap2);
_parent.dyna.flyToHist(Cap1, Cap2);
showMap(_root.LevelMap);
if (_local5 || (Key.isDown(17))) {
_parent.winlevel();
}
}
function addPairsHist(Cap1, Cap2) {
_root.PairsHist.push({coord:((Cap1._x <= Cap2._x) ? (Cap1.coord) : (Cap2.coord)), ctype:((Cap1._x <= Cap2._x) ? (Cap1.captype) : (Cap2.captype))});
_root.PairsHist.push({coord:((Cap2._x >= Cap1._x) ? (Cap2.coord) : (Cap1.coord)), ctype:((Cap2._x > Cap1._x) ? (Cap2.captype) : (Cap1.captype))});
}
function restorePairsHist() {
var _local8;
var _local6;
var _local7;
var _local5;
if (_root.PairsHist.length == 0) {
return(undefined);
}
_root.undo_pressed_Snd.start();
_root.PayBalls = _root.PayBalls - 1;
_parent.glass.refresh();
_parent.idol.idolPlay();
var _local4 = new Object();
var _local3 = new Object();
_local4 = _root.PairsHist.pop();
_root.assignCap(_local4.ctype, _root.LevelMap, _local4.coord, true);
_root.CurrentScore = _root.CurrentScore - _root.SCORES[_local4.ctype];
_local3 = _root.PairsHist.pop();
_root.assignCap(_local3.ctype, _root.LevelMap, _local3.coord, true);
_root.CurrentScore = _root.CurrentScore - _root.SCORES[_local3.ctype];
_parent.hist.refreshHist();
_parent.score.text = _root.CurrentScore;
showMap(_root.LevelMap);
}
function checkMoves() {
var _local2;
var _local1;
_local2 = 0;
while (_local2 < (AllCaps.length - 1)) {
_local1 = _local2 + 1;
while (_local1 < AllCaps.length) {
if (checkCaps(AllCaps[_local2], AllCaps[_local1])) {
return(true);
}
_local1++;
}
_local2++;
}
return(false);
}
function makeHint() {
var _local3;
var _local2;
_local3 = 0;
while (_local3 < (AllCaps.length - 1)) {
_local2 = _local3 + 1;
while (_local2 < AllCaps.length) {
if (checkCaps(AllCaps[_local3], AllCaps[_local2])) {
_parent.dyna.showHint(AllCaps[_local3], AllCaps[_local2]);
return(undefined);
}
_local2++;
}
_local3++;
}
}
function bonusMagnet(Cap1, Cap2) {
var _local4;
var _local5;
if (Cap1.captype == 54) {
_local4 = Cap1;
_local5 = Cap2;
} else {
_local4 = Cap2;
_local5 = Cap1;
}
_parent.idol.idolPlay();
_root.clearCap(_root.LevelMap, _local5.coord);
_root.clearCap(_root.LevelMap, _local4.coord);
_parent.dyna.fly(_local5.captype, _local5._x, _local5._y, _local4._x, _local4._y, 5, refreshBonusMagnet);
_global.Magnet_captype = _local5.captype;
_global.Magnet_coord = {i:_local4.coord.i, j:_local4.coord.j, k:_local4.coord.k};
_parent.dyna.fly(_local4.captype, _local4._x, _local4._y, 40 + (Math.random() * 560), -50, 10);
showMap(_root.LevelMap);
}
function refreshBonusMagnet(obj) {
_root.assignCap(_global.Magnet_captype, _root.LevelMap, _global.Magnet_coord);
showMap(_root.LevelMap);
_global.Magnet_captype = null;
_global.Magnet_coord = null;
}
function bonusLift(Bonus, Cap) {
var _local5;
_parent.idol.idolPlay();
_root.clearCap(_root.LevelMap, Bonus.coord);
_root.assignCap(Cap.captype, _root.LevelMap, Magnet.coord);
_local5 = Cap.coord.i;
while (true) {
if ((((_root.LevelMap[Cap.coord.k][Cap.coord.j][_local5] == "-") && (_root.LevelMap[Cap.coord.k + 1][Cap.coord.j][_local5] == "-")) && (_root.LevelMap[Cap.coord.k][Cap.coord.j + 1][_local5] == "-")) && (_root.LevelMap[Cap.coord.k + 1][Cap.coord.j + 1][_local5] == "-")) {
break;
}
_local5++;
}
_root.clearCap(_root.LevelMap, Cap.coord);
_root.clearCap(_root.LevelMap, Bonus.coord);
_global.Lift_captype = Cap.captype;
_global.Lift_coord = {i:_local5, j:Cap.coord.j, k:Cap.coord.k};
_parent.dyna.fly(Cap.captype, Cap._x, Cap._y, Cap._x - (ZXOS * (_local5 - 1)), Cap._y - (ZYOS * (_local5 - 1)), 5, refreshBonusLift);
_parent.dyna.fly(Bonus.captype, Bonus._x, Bonus._y, 40 + (Math.random() * 560), -50, 10);
showMap(_root.LevelMap);
}
function refreshBonusLift(obj) {
_root.assignCap(_global.Lift_captype, _root.LevelMap, _global.Lift_coord);
showMap(_root.LevelMap);
_global.Lift_captype = null;
_global.Lift_coord = null;
}
function bonusLocalShuffle(Bonus, Cap) {
var _local5;
var _local12;
var _local11;
var _local4;
var _local14 = Cap.coord.i;
var _local9 = Cap.coord.j;
var _local13 = Cap.coord.k;
var _local6 = new Array();
var _local7 = new Array();
var _local8 = new Array();
_parent.idol.idolPlay();
_root.clearCap(_root.LevelMap, Bonus.coord);
_parent.dyna.fly(Bonus.captype, Bonus._x, Bonus._y, (Bonus._x - 40) + (Math.random() * 120), -50, 8);
_local5 = ((_local14 > 0) ? (_local14 - 1) : (_local14));
while (_local5 <= (_local14 + 1)) {
_local11 = _local13 - 4;
while (_local11 <= (_local13 + 4)) {
_local12 = _local9 - 4;
while (_local12 <= (_local9 + 4)) {
if (_root.LevelMap[_local11][_local12][_local5] != undefined) {
_local4 = _root.LevelMap[_local11][_local12][_local5];
}
if (typeof(_local4) == "number") {
if (_local4 > 2000) {
_local4 = _local4 - 10000;
}
if (_local4 >= 1000) {
_local6.push({i:_local5, j:_local12, k:_local11, ctype:_local4 - 1000});
_local7.push({i:_local5, j:_local12, k:_local11, ctype:_local4 - 1000});
}
}
_local12++;
}
_local11++;
}
_local5++;
}
while (_local6.length > 0) {
_local4 = Math.floor(Math.random() * _local6.length);
_local8.push(_local6[_local4]);
_local6[_local4] = _local6[0];
_local6.shift();
}
_local5 = 0;
while (_local5 < _local8.length) {
_root.clearCap(_root.LevelMap, _local8[_local5]);
cx1 = (XOS + (_local7[_local5].k * XSTEP)) - (ZXOS * _local7[_local5].i);
cy1 = (YOS + (_local7[_local5].j * YSTEP)) - (ZYOS * _local7[_local5].i);
cx2 = (XOS + (_local8[_local5].k * XSTEP)) - (ZXOS * _local8[_local5].i);
cy2 = (YOS + (_local8[_local5].j * YSTEP)) - (ZYOS * _local8[_local5].i);
_parent.dyna.fly(_local7[_local5].ctype, cx1, cy1, cx2, cy2, 5, refreshBonusLocalShuffle);
_local5++;
}
showMap(_root.LevelMap);
_global.LocalShuffle_fl = true;
_local5 = 0;
while (_local5 < _local8.length) {
_root.assignCap(_local7[_local5].ctype, _root.LevelMap, _local8[_local5]);
_local5++;
}
}
function refreshBonusLocalShuffle() {
if (_global.LocalShuffle_fl) {
showMap(_root.LevelMap);
_global.LocalShuffle_fl = null;
}
}
var XSTEP = 14.5;
var YSTEP = 19;
var ZXOS = 5;
var ZYOS = 5;
var Ready;
var CapsNum;
var OldCap;
var isshowfc;
var XOS;
var YOS;
var AllCaps;
Symbol 501 MovieClip Frame 1
function show() {
this.onEnterFrame = ef_show;
}
function ef_show() {
if ((this._alpha + ALPHASTEP) < ALPHAMAX) {
this._alpha = this._alpha + ALPHASTEP;
} else {
this._alpha = ALPHAMAX;
this.onEnterFrame = undefined;
}
}
function hide() {
this.onEnterFrame = ef_hide;
}
function ef_hide() {
if ((this._alpha - ALPHASTEP) > ALPHAMIN) {
this._alpha = this._alpha - ALPHASTEP;
} else {
this._alpha = ALPHAMIN;
this.onEnterFrame = undefined;
}
}
var ALPHAMIN = 0;
var ALPHAMAX = 100;
var ALPHASTEP = 50;
this._alpha = ALPHAMIN;
Symbol 518 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent._parent.hidemenu();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 525 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent._parent.showdialog("Restart");
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 532 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_root.help.show();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 539 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent._parent.showdialog("MMenu");
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 541 MovieClip Frame 1
function show() {
Status = "";
gotoAndPlay (2);
}
function hide() {
Status = "";
gotoAndPlay (15);
}
var Status;
stop();
Status = "INVISIBLE";
Symbol 541 MovieClip Frame 14
stop();
Status = "VISIBLE";
Symbol 546 MovieClip Frame 1
function startTimer() {
Time = 0;
TimerID = setInterval(updateTimer, 1000);
}
function updateTimer() {
THour = Math.floor(Time / 3600);
TMin = Math.floor((Time - (THour * 3600)) / 60);
TSec = (Time - (TMin * 60)) - (THour * 3600);
if (THour < 10) {
THour = "0" + THour;
}
if (TMin < 10) {
TMin = "0" + TMin;
}
if (TSec < 10) {
TSec = "0" + TSec;
}
txt.text = (((THour + ":") + TMin) + ":") + TSec;
Time++;
}
function stopTimer() {
clearInterval(TimerID);
}
function continueTimer() {
TimerID = setInterval(updateTimer, 1000);
}
var TimerID;
var Time;
Symbol 550 MovieClip Frame 1
this.swapDepths(1000);
this.removeMovieClip();
Symbol 551 MovieClip Frame 1
function refreshHist() {
_parent.checkBonuses();
if (_root.PairsHist.length < 2) {
cap_1.removeMovieClip();
cap_2.removeMovieClip();
return(undefined);
}
this.attachMovie("_cap_", "cap_1", 100, {captype:_root.PairsHist[_root.PairsHist.length - 2].ctype});
cap_1._x = 0;
cap_1._y = 0;
cap_1.zorder = 0;
cap_1.cursover = false;
cap_1.shaded = false;
cap_1.lighted = false;
if (_root.PairsHist[_root.PairsHist.length - 2].ctype == 0) {
cap_1.ofgold = true;
}
this.attachMovie("_cap_", "cap_2", 101, {captype:_root.PairsHist[_root.PairsHist.length - 1].ctype});
cap_2._x = 41;
cap_2._y = 0;
cap_2.zorder = 0;
cap_2.cursover = false;
cap_2.shaded = false;
cap_2.lighted = false;
if (_root.PairsHist[_root.PairsHist.length - 1].ctype == 0) {
cap_2.ofgold = true;
}
}
function checkOrderBonus() {
var _local3 = false;
var _local2 = 0;
while (_local2 < _root.PairsHist.length) {
if (_root.PairsHist[_local2].ctype != _root.PairsHist[_local2 + 1].ctype) {
return(false);
}
_local2 = _local2 + 2;
}
return(true);
}
Symbol 561 MovieClip Frame 1
stop();
Symbol 567 MovieClip Frame 1
stop();
Symbol 571 MovieClip Frame 1
stop();
Symbol 572 MovieClip Frame 1
Symbol 572 MovieClip Frame 21
_parent.swapDepths(_parent._parent.getNextHighestDepth());
_parent.removeMovieClip();
Symbol 574 MovieClip Frame 1
stop();
Symbol 575 MovieClip Frame 1
function idolPlay() {
eyes.play();
light.play();
mouth.play();
stars.play();
}
Symbol 578 MovieClip Frame 1
stop();
Symbol 581 MovieClip Frame 1
function addBall() {
if ((_root.PayBalls + 1) >= payballs._totalframes) {
return(undefined);
}
_root.payball_ball_collision2_Snd.start();
_root.PayBalls++;
if (cnt > 100) {
cnt = 0;
}
this.attachMovie("_glassanim_", "b_" + cnt, this.getNextHighestDepth());
this["b_" + cnt]._x = (BOSX + BRD) - Math.floor((Math.random() * BRD) * 2);
this["b_" + cnt]._y = BOSY;
cnt++;
}
function ballArrived() {
setBalls(_root.PayBalls);
}
function setBalls(val) {
if ((val + 1) <= payballs._totalframes) {
payballs.gotoAndStop(val + 1);
}
}
function refresh() {
setBalls(_root.PayBalls);
}
var BOSX = 605;
var BOSY = 290;
var BRD = 5;
var cnt = 0;
Symbol 587 MovieClip Frame 1
function init() {
mask._xscale = 0;
}
function setpr(pr) {
mask._xscale = pr * 100;
}
init();
Symbol 601 MovieClip Frame 1
stop();
Symbol 614 MovieClip Frame 1
function action_a() {
_parent.map.toggleFreeCaps(true);
switchst("B");
}
function action_b() {
_parent.map.toggleFreeCaps(false);
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 622 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent.showhidemenu();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 629 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent.shuffleBonus();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 636 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent.map.makeHint();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 643 MovieClip Frame 1
function action_a() {
_parent.map.restorePairsHist();
btn.onRollOver();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 645 MovieClip Frame 1
this.swapDepths(1000);
this.removeMovieClip();
Symbol 646 MovieClip Frame 1
function fly(ct, cx1, cy1, cx2, cy2, steps, callback) {
if (mcFly.cnt > 1000) {
mcFly.cnt = 0;
}
var _local10;
if (mcFly == undefined) {
this.createEmptyMovieClip("mcFly", 100);
mcFly.cnt = 0;
}
mcFly.attachMovie("_cap_", "cap_" + mcFly.cnt, mcFly.getNextHighestDepth(), {captype:ct});
mcFly["cap_" + mcFly.cnt]._x = cx1;
mcFly["cap_" + mcFly.cnt]._y = cy1;
mcFly["cap_" + mcFly.cnt].zorder = 0;
mcFly["cap_" + mcFly.cnt].cursover = false;
mcFly["cap_" + mcFly.cnt].shaded = false;
mcFly["cap_" + mcFly.cnt].lighted = false;
if (ct == 0) {
mcFly["cap_" + mcFly.cnt].ofgold = true;
}
mcFly["cap_" + mcFly.cnt].dx = (cx2 - cx1) / steps;
mcFly["cap_" + mcFly.cnt].dy = (cy2 - cy1) / steps;
mcFly["cap_" + mcFly.cnt].steps = steps;
mcFly["cap_" + mcFly.cnt].callback = callback;
mcFly["cap_" + mcFly.cnt].tid = setInterval(doFly, flyTINT, mcFly["cap_" + mcFly.cnt]);
mcFly.cnt++;
}
function doFly(obj) {
if (obj.steps > 0) {
obj._x = obj._x + obj.dx;
obj._y = obj._y + obj.dy;
obj.steps--;
} else {
clearInterval(obj.tid);
if (obj.callback != null) {
obj.callback(obj);
}
obj.removeMovieClip();
}
}
function flyToHist(Cap1, Cap2) {
fly(Cap1.captype, Cap1._x, Cap1._y, ((Cap1._x <= Cap2._x) ? (fthCAP1X) : (fthCAP2X)), fthCAPSY, fthSTEPS, doneFlyToHist);
fly(Cap2.captype, Cap2._x, Cap2._y, ((Cap2._x >= Cap1._x) ? (fthCAP2X) : (fthCAP1X)), fthCAPSY, fthSTEPS, doneFlyToHist);
}
function doneFlyToHist() {
_root.tile_cell_touchdown_Snd.start();
_parent.hist.refreshHist();
}
function flyFromHist(ct1, cx1, cy1, ct2, cx2, cy2) {
fly(ct1, ((cx1 <= cx2) ? (fthCAP1X) : (fthCAP2X)), fthCAPSY, cx1, cy1, 8, doneFlyFromHist);
fly(ct2, ((cx1 >= cx2) ? (fthCAP2X) : (fthCAP1X)), fthCAPSY, cx2, cy2, 8, doneFlyFromHist);
}
function doneFlyFromHist() {
_parent.map.showMap(_root.LevelMap);
}
function showHint(cap1, cap2) {
function doShowHint(obj) {
var _local3;
var _local2;
var _local4;
if (obj.cnt > 1000) {
obj.cnt = 0;
}
_local4 = 0;
while (_local4 < CAPENUMSTARS) {
while (true) {
_local3 = Math.floor(Math.random() * CAPEFW);
_local2 = Math.floor(Math.random() * CAPEFH);
if ((((_local3 > ((CAPEFW - CAPECW) / 2)) && (_local3 < ((CAPEFW + CAPECW) / 2))) && (_local2 > ((CAPEFH - CAPECH) / 2))) && (_local2 < ((CAPEFH + CAPECH) / 2))) {
} else {
break;
}
}
obj.attachMovie("_hintEffect_", "sc1_" + obj.cnt, obj.getNextHighestDepth());
obj["sc1_" + obj.cnt]._x = (CAPEosx + _local3) + cap1._x;
obj["sc1_" + obj.cnt]._y = (CAPEosy + _local2) + cap1._y;
obj.cnt++;
_local4++;
}
_local4 = 0;
while (_local4 < CAPENUMSTARS) {
while (true) {
_local3 = Math.floor(Math.random() * CAPEFW);
_local2 = Math.floor(Math.random() * CAPEFH);
if ((((_local3 > ((CAPEFW - CAPECW) / 2)) && (_local3 < ((CAPEFW + CAPECW) / 2))) && (_local2 > ((CAPEFH - CAPECH) / 2))) && (_local2 < ((CAPEFH + CAPECH) / 2))) {
} else {
break;
}
}
obj.attachMovie("_hintEffect_", "sc2_" + obj.cnt, obj.getNextHighestDepth());
obj["sc2_" + obj.cnt]._x = (CAPEosx + _local3) + cap2._x;
obj["sc2_" + obj.cnt]._y = (CAPEosy + _local2) + cap2._y;
obj.cnt++;
_local4++;
}
}
if (isHintShown) {
return(undefined);
}
_root.PayBalls = _root.PayBalls - 4;
_parent.glass.refresh();
_parent.idol.idolPlay();
isHintShown = true;
if (mcHint != undefined) {
mcHint.removeMovieClip();
}
this.createEmptyMovieClip("mcHint", 105);
mcHint.cnt = 0;
tidShowHint = setInterval(doShowHint, 50, mcHint);
}
function stopShowHint() {
isHintShown = false;
clearInterval(tidShowHint);
}
function showScore(cx, cy, score, fl) {
if (mcScore == undefined) {
this.createEmptyMovieClip("mcScore", 110);
mcScore.cnt = 0;
}
if (mcScore.cnt > 100) {
mcScore.cnt = 0;
}
if (fl) {
mcScore.attachMovie("_scoreEffect_", "sc_" + mcScore.cnt, mcScore.getNextHighestDepth());
} else {
mcScore.attachMovie("_scoreEffect2_", "sc_" + mcScore.cnt, mcScore.getNextHighestDepth());
}
mcScore["sc_" + mcScore.cnt].Score = score;
mcScore["sc_" + mcScore.cnt]._x = cx + SCosx;
mcScore["sc_" + mcScore.cnt]._y = cy + SCosy;
mcScore.cnt++;
}
var flyTINT = 40;
var fthCAP1X = 283;
var fthCAP2X = 324;
var fthCAPSY = 434;
var fthSTEPS = 15;
var isHintShown = false;
var CAPEosx = -15;
var CAPEosy = -15;
var CAPEFW = 40;
var CAPEFH = 50;
var CAPECW = 20;
var CAPECH = 30;
var CAPENUMSTARS = 2;
var tidShowHint;
var SCosx = 15;
var SCosy = 0;
Symbol 648 MovieClip Frame 1
this.useHandCursor = false;
this.onPress = function () {
};
Symbol 657 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent._parent._parent.restartlevel();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 664 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent._parent._parent.hidedialog(this._parent);
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 665 MovieClip Frame 1
function show() {
this._visible = true;
this._y = inity;
anim1_id = setInterval(anim1, 40, this);
}
function anim1(obj) {
if (obj._y < (yy - anim1_astep)) {
obj._y = obj._y + anim1_astep;
} else {
obj._y = yy;
clearInterval(anim1_id);
}
}
function hide() {
anim2_id = setInterval(anim2, 40, this);
}
function anim2(obj) {
if (obj._y < (((inity + 480) + obj._height) - anim2_astep)) {
obj._y = obj._y + anim2_astep;
} else {
obj._visible = false;
obj._y = yy;
clearInterval(anim2_id);
}
}
var anim1_astep = 35;
var anim2_astep = 55;
var anim1_id;
var anim2_id;
var yy;
var inity;
inity = ((-1 * _parent._y) - this._y) - this._height;
yy = this._y;
Symbol 668 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent._parent._parent.exittomainmenu();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 669 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent._parent._parent.hidedialog(this._parent);
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 670 MovieClip Frame 1
function show() {
this._visible = true;
this._y = inity;
anim1_id = setInterval(anim1, 40, this);
}
function anim1(obj) {
if (obj._y < (yy - anim1_astep)) {
obj._y = obj._y + anim1_astep;
} else {
obj._y = yy;
clearInterval(anim1_id);
}
}
function hide() {
anim2_id = setInterval(anim2, 40, this);
}
function anim2(obj) {
if (obj._y < (((inity + 480) + obj._height) - anim2_astep)) {
obj._y = obj._y + anim2_astep;
} else {
obj._visible = false;
obj._y = yy;
clearInterval(anim2_id);
}
}
var anim1_astep = 35;
var anim2_astep = 55;
var anim1_id;
var anim2_id;
var yy;
var inity;
inity = ((-1 * _parent._y) - this._y) - this._height;
yy = this._y;
Symbol 679 MovieClip Frame 1
function action_a() {
btn.onRollOver();
_parent.hide();
_parent._parent._parent.endlevelmenu();
}
function action_b() {
switchst("A");
}
function switchst(st) {
State = st;
gotoAndStop(("State" + State) + "Active");
}
function disable() {
gotoAndStop(("State" + State) + "Disabled");
Disabled = true;
btn._visible = false;
}
function enable() {
gotoAndStop("State" + State);
Disabled = false;
btn._visible = true;
}
stop();
var State = "A";
var Disabled = false;
var Bypass = false;
enable();
btn.onRollOver = function () {
_root.button_highlight_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Active");
};
btn.onRollOut = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onReleaseOutside = function () {
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop("State" + State);
};
btn.onPress = function () {
_root.button_push_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
gotoAndStop(("State" + State) + "Pressed");
};
btn.onRelease = function () {
_root.button_click_Snd.start();
if (Disabled || (Bypass)) {
return(undefined);
}
if (State == "A") {
action_a();
} else {
action_b();
}
};
Symbol 689 MovieClip Frame 1
this.onRollOver = function () {
_parent.b1hint.gotoAndPlay(2);
if (_currentframe == 1) {
_parent.b1hint._alpha = 50;
} else {
_parent.b1hint._alpha = 100;
}
};
this.onRollOut = function () {
_parent.b1hint.gotoAndStop(1);
};
stop();
Symbol 689 MovieClip Frame 25
stop();
if (_parent._parent._parent.ClearBonusFl) {
_parent.clear.play();
} else if (_parent._parent._parent.OrderBonusFl) {
_parent.order.play();
}
Symbol 693 MovieClip Frame 1
this.onRollOver = function () {
_parent.b2hint.gotoAndPlay(2);
if (_currentframe == 1) {
_parent.b2hint._alpha = 50;
} else {
_parent.b2hint._alpha = 100;
}
};
this.onRollOut = function () {
_parent.b2hint.gotoAndStop(1);
};
stop();
Symbol 693 MovieClip Frame 25
stop();
if (_parent._parent._parent.OrderBonusFl) {
_parent.order.play();
}
Symbol 697 MovieClip Frame 1
this.onRollOver = function () {
_parent.b3hint.gotoAndPlay(2);
if (_currentframe == 1) {
_parent.b3hint._alpha = 50;
} else {
_parent.b3hint._alpha = 100;
}
};
this.onRollOut = function () {
_parent.b3hint.gotoAndStop(1);
};
stop();
Symbol 697 MovieClip Frame 25
stop();
Symbol 702 MovieClip Frame 1
stop();
Symbol 702 MovieClip Frame 15
stop();
Symbol 706 MovieClip Frame 1
stop();
Symbol 706 MovieClip Frame 15
stop();
Symbol 710 MovieClip Frame 1
stop();
Symbol 710 MovieClip Frame 15
stop();
Symbol 711 MovieClip Frame 1
function showBonuses() {
if (_parent._parent.FastBonusFl) {
fast.play();
} else if (_parent._parent.ClearBonusFl) {
clear.play();
} else if (_parent._parent.OrderBonusFl) {
order.play();
}
}
function show() {
this._visible = true;
this._y = inity;
anim1_id = setInterval(anim1, 40, this);
}
function anim1(obj) {
if (obj._y < (yy - anim1_astep)) {
obj._y = obj._y + anim1_astep;
} else {
obj._y = yy;
clearInterval(anim1_id);
showBonuses();
}
}
function hide() {
this._visible = false;
this._y = yy;
}
var anim1_astep = 35;
var anim2_astep = 55;
var anim1_id;
var anim2_id;
var yy;
var inity;
inity = ((-1 * _parent._y) - this._y) - this._height;
yy = this._y;
Symbol 712 MovieClip Frame 1
function init() {
mmenu._visible = false;
restart._visible = false;
endlevel._visible = false;
}
Symbol 713 MovieClip Frame 1
function show() {
anim1_id = setInterval(anim1, 40, this);
}
function anim1(obj) {
if (obj._alpha >= anim1_astep) {
obj._alpha = obj._alpha - anim1_astep;
} else {
obj._alpha = 0;
clearInterval(anim1_id);
}
}
function hide() {
anim2_id = setInterval(anim2, 40, this);
}
function anim2(obj) {
if (obj._alpha < (100 - anim1_astep)) {
obj._alpha = obj._alpha + anim1_astep;
} else {
obj._alpha = 100;
clearInterval(anim2_id);
}
}
var anim1_astep = 25;
var anim1_id;
var anim2_id;
this._alpha = 100;
Symbol 719 MovieClip Frame 2
function startgame() {
_root.start_gong_Snd.start();
WINF = false;
TBOldTimer = 0;
TimeBonus = 0;
mc_wait._visible = false;
scr.show();
cover._visible = false;
map.init();
map.showMap(_root.LevelMap);
timer.startTimer();
OldScore = _root.CurrentScore;
OldBalls = _root.PayBalls;
}
function init() {
mc_nomoves._visible = true;
mc_wait._visible = true;
dialog.init();
FastBonusFl = false;
ClearBonusFl = false;
OrderBonusFl = true;
backpic.gotoAndStop(_root.CurrentLevel + 1);
level.gotoAndStop(_root.CurrentLevel + 1);
_root.getLevelData(_root.CurrentLevel, startgame);
if (_root.CurrentLevel < _root.MaxLevel) {
_root.CurrentScore = 0;
}
score.text = _root.CurrentScore;
glass.setBalls(_root.PayBalls);
}
function showhidemenu() {
if (igmenu.Status == "INVISIBLE") {
showmenu();
}
if (igmenu.Status == "VISIBLE") {
hidemenu();
}
}
function showmenu() {
_root.menu_slide_in_Snd.start();
igshadow.show();
igmenu.show();
eyebtn.disable();
hintbtn.disable();
shufflebtn.disable();
undobtn.disable();
clouds.stop();
map.togglePics(false);
timer.stopTimer();
dyna._visible = false;
dyna.stopShowHint();
}
function hidemenu() {
_root.menu_slide_in_Snd.start();
igshadow.hide();
igmenu.hide();
eyebtn.enable();
checkBonuses();
clouds.play();
map.togglePics(true);
timer.continueTimer();
dyna._visible = true;
}
function togglepause() {
showhidemenu();
}
function showdialog(dtype) {
cover._visible = true;
switch (dtype) {
case "MMenu" :
dialog.mmenu.show();
break;
case "Restart" :
dialog.restart.show();
}
}
function hidedialog(d) {
cover._visible = false;
d.hide();
}
function exittomainmenu() {
_root.gotoAndPlay("MainMenu");
}
function restartlevel() {
_root.CurrentScore = OldScore;
_root.PayBalls = OldBalls;
_root.gotoAndPlay("Restart");
}
function winlevel() {
_root.level_win_Snd.start();
if (timer.Time <= _root.FASTBONUS[_root.CurrentLevel]) {
FastBonusFl = true;
}
if (OrderBonusFl) {
OrderBonusFl = hist.checkOrderBonus();
}
if (FastBonusFl) {
_root.CurrentScore = _root.CurrentScore + _root.SCOREFORELBONUS;
}
if (ClearBonusFl) {
_root.CurrentScore = _root.CurrentScore + _root.SCOREFORELBONUS;
}
if (OrderBonusFl) {
_root.CurrentScore = _root.CurrentScore + _root.SCOREFORELBONUS;
}
score.text = _root.CurrentScore;
timer.stopTimer();
cover._visible = true;
dialog.endlevel.show();
dialog.endlevel.time.text = timer.txt.text;
dialog.endlevel.score.text = _root.CurrentScore - OldScore;
dialog.endlevel.tiles.text = _root.CapsTotal;
_root.saveso();
}
function endlevelmenu() {
dialog.endlevel.hide();
if (_root.CurrentLevel > 0) {
_root.gotoAndStop("Artifacts");
} else {
_root.nextlevel();
}
}
function checkBonuses() {
if ((_root.PairsHist.length >= 2) && (_root.PayBalls > 0)) {
undobtn.enable();
} else {
undobtn.disable();
}
if ((!mc_nomoves._visible) && (_root.PayBalls >= 4)) {
hintbtn.enable();
} else {
hintbtn.disable();
}
if (_root.PayBalls >= 16) {
shufflebtn.enable();
} else {
shufflebtn.disable();
}
}
function addScore(Cap1, Cap2) {
if (_root.SCORES[Cap1.captype] != null) {
_root.CurrentScore = _root.CurrentScore + _root.SCORES[Cap1.captype];
dyna.showScore(Cap1._x, Cap1._y, _root.SCORES[Cap1.captype], false);
}
if (_root.SCORES[Cap2.captype] != null) {
_root.CurrentScore = _root.CurrentScore + _root.SCORES[Cap2.captype];
dyna.showScore(Cap2._x, Cap2._y, _root.SCORES[Cap2.captype], true);
}
if ((timer.Time - OldTimer) < TIMEBONUS) {
if (TimeBonus == 1) {
dyna.showScore(320, 200, 200, true);
_root.CurrentScore = _root.CurrentScore + 200;
glass.addBall();
} else {
dyna.showScore(320, 200, 100, false);
_root.CurrentScore = _root.CurrentScore + 100;
TimeBonus = 1;
}
} else {
TimeBonus = 0;
}
OldTimer = timer.Time;
score.text = _root.CurrentScore;
if (Cap1.pearl) {
glass.addBall();
}
if (Cap2.pearl) {
glass.addBall();
}
}
function shuffleBonus() {
_root.shuffle();
_root.PayBalls = _root.PayBalls - 16;
glass.refresh();
idol.idolPlay();
map.showMap(_root.LevelMap);
}
function doCheckMoves() {
dyna.stopShowHint();
if (!WINF) {
if (!map.checkMoves()) {
mc_nomoves._visible = true;
} else {
mc_nomoves._visible = false;
}
checkBonuses();
}
}
var OldScore;
var OldBalls;
var FastBonusFl;
var ClearBonusFl;
var OrderBonusFl;
var WINF;
var TBOldTimer;
var TimeBonus;
var TIMEBONUS = 4;
stop();
init();