Frame 1
_lockroot = true;
var LANG = "en";
var Labels = new Array();
Labels.en = new Object();
Labels.ru = new Object();
Labels.ru.loading = "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430:";
Labels.en.loading = "Loading:";
var GAME_VERSION_TEST = 0;
var GAME_VERSION_MOCHI = 1;
var GAME_VERSION_MAIL_RU = 2;
var GAME_VERSION_ALAWAR_RU = 3;
var GAME_VERSION_BFG_EN = 4;
var GAME_VERSION_DAILY_FREE = 5;
var GAME_VERSION_MINDJOLT = 6;
var game_version = GAME_VERSION_MOCHI;
var get_more_games_link_select = "http://www.elefun-games.com";
var logo_enabled = true;
_root.alawar_logo._visible = false;
_root.ef_preloader.show_progress(0);
_root.ef_preloader._visible = false;
_root.bfg_logo._visible = false;
_root.dfg_logo._visible = false;
_root.daily_free._visible = false;
_root.bar._visible = false;
_root.useMochi = false;
if (game_version == GAME_VERSION_TEST) {
stop();
_root.fon._visible = false;
_root.load_text._visible = false;
_root.ef_preloader._visible = true;
_root.onEnterFrame = function () {
if ((_framesloaded > 0) && (_framesloaded == _totalframes)) {
delete _root.onEnterFrame;
play();
} else {
_root.ef_preloader.show_progress((this.getBytesLoaded() / this.getBytesTotal()) * 100);
}
};
} else if (game_version == GAME_VERSION_MOCHI) {
stop();
_root.useMochi = true;
_root.MochiAdID = "bd4ca00430c9c793";
_root.MochiAdRes = "640x480";
_root.fon._visible = false;
_root.load_text._visible = false;
_root.ef_preloader._visible = true;
_root.onEnterFrame = function () {
if ((_framesloaded > 0) && (_framesloaded == _totalframes)) {
delete _root.onEnterFrame;
play();
} else {
_root.ef_preloader.show_progress((this.getBytesLoaded() / this.getBytesTotal()) * 100);
}
};
} else if (game_version == GAME_VERSION_DAILY_FREE) {
_root.useMochi = true;
get_more_games_link_select = null;
_root.daily_free._visible = true;
_root.MochiAdID = "bd4ca00430c9c793";
_root.MochiAdRes = "640x480";
_root.fon._visible = false;
_root.load_text._visible = false;
_root.daily_free._visible = true;
_root.bar._visible = true;
stop();
_root.onEnterFrame = function () {
if ((_framesloaded > 0) && (_framesloaded == _totalframes)) {
delete _root.onEnterFrame;
play();
} else {
_root.bar.progress._xscale = (this.getBytesLoaded() / this.getBytesTotal()) * 100;
}
};
} else if (game_version == GAME_VERSION_ALAWAR_RU) {
stop();
_root.alawar_logo._visible = true;
get_more_games_link_select = "http://www.alawar.ru/game/jigsaw-deluxe/download/AlawarRuJigsawDeluxeRus_4.exe";
if (_root.alawar_f && (_root.alawar_f != false)) {
get_more_games_link_select = null;
}
_root.onEnterFrame = function () {
if ((_framesloaded > 0) && (_framesloaded == _totalframes)) {
delete _root.onEnterFrame;
play();
} else {
_root.load_text.text = ((Labels[_root.LANG].loading + " ") + Math.round((this.getBytesLoaded() / this.getBytesTotal()) * 100)) + "%";
}
};
} else if (game_version == GAME_VERSION_BFG_EN) {
stop();
_root.bfg_logo._visible = true;
get_more_games_link_select = "http://www.bigfishgames.com/online-games/";
_root.onEnterFrame = function () {
if ((_framesloaded > 0) && (_framesloaded == _totalframes)) {
delete _root.onEnterFrame;
play();
} else {
_root.load_text.text = ((Labels[_root.LANG].loading + " ") + Math.round((this.getBytesLoaded() / this.getBytesTotal()) * 100)) + "%";
}
};
} else if (game_version == GAME_VERSION_MINDJOLT) {
stop();
_root.useMochi = true;
_root.MochiAdID = "bd4ca00430c9c793";
_root.MochiAdRes = "640x480";
_root.fon._visible = false;
_root.load_text._visible = false;
_root.ef_preloader._visible = true;
_root.onEnterFrame = function () {
if ((_framesloaded > 0) && (_framesloaded == _totalframes)) {
delete _root.onEnterFrame;
play();
} else {
_root.ef_preloader.show_progress((this.getBytesLoaded() / this.getBytesTotal()) * 100);
}
};
}
Instance of Symbol 51 MovieClip "dfg_logo" in Frame 1
on (release) {
getURL ("http://www.dailyfreegames.com", "_blank");
}
Instance of Symbol 108 MovieClip "ef_preloader" in Frame 1
on (release) {
getURL ("http://www.elefun-games.com", "_blank");
}
Frame 2
if (_root.useMochi) {
stop();
_root.ef_preloader.show_progress(100);
var myOptions = {id:_root.MochiAdID, res:_root.MochiAdRes, ad_finished:function () {
_root.play();
}};
MochiAd.showInterLevelAd(myOptions);
}
Frame 3
_root.setMask(main_mask);
var FULLSCREEN = false;
var SHARED_NAME = "jigsawdeluxe";
var LOCAL = false;
var get_more_games_link = _root.get_more_games_link_select;
var SPEED_DOWN = 10;
var SPEED_RELAX = 15;
var SPEED_WIN = 10;
var SPEED_NORMAL = 1;
var SPEED_UP = 0.5;
var SPEED_HOLE = 10;
var SPEED_ROLLBACK = 10;
var TIMER_INTERVAL = 30;
var BLIZ_TIME = 50;
var NEW_BONUS_TIME = 20000;
var BONUS_LIVE_TIME = 30000;
var WIN_EFFECT_SPEED = 1;
var WIN_EFFECT_TIMES = 2;
var SCORES_X = 510;
var SCORES_Y = 80;
var COL_STARS = 10;
var MAX_TILES = 225;
var MAX_ROWS = 15;
var MAX_COLS = 15;
var MIN_ROWS = 3;
var MIN_COLS = 4;
var ROOT_W = 640;
var ROOT_H = 480;
var POINT_PERCENT = 7;
var STAR_SIZE = 16;
var BORDER_W = 49;
var BORDER_H = 47;
var LEFT = ((_root.BORDER_W / 2) - 1);
var RIGHT = ((_root.ROOT_W - (_root.BORDER_W / 2)) + 1);
var TOP = ((_root.BORDER_H / 2) - 1);
var BOTTOM = ((_root.ROOT_H - (_root.BORDER_H / 2)) + 1);
var MIN_TILE_SIZE = 40;
var TILE_DELTA = 10;
var PUZZLE_W = (ROOT_W - (2 * BORDER_W));
var PUZZLE_H = (ROOT_H - (2 * BORDER_H));
var PUZZLE_X = BORDER_W;
var PUZZLE_Y = BORDER_H;
var TOCHNOST = 30;
var CREATOR_X = -4;
var CREATOR_Y = 10;
var CREATOR_TOP_X = -4;
var CREATOR_TOP_Y = -5;
var EATER_X = ((ROOT_W - BORDER_W) + 1);
var EATER_Y = 10;
var EATER_TOP_X = ((ROOT_W - BORDER_W) + 1);
var EATER_TOP_Y = -5;
var TOP_X = -3;
var TOP_Y = -1;
var SCORE_X = 70;
var SCORE_Y = 10;
var WIN_SCORE = 2;
var TILE_SCORE = 10;
var BONUS_SCORE = 50;
var DELTA_SCORE = 40;
var BONUS_PAUSE = 200;
var COMBO_PAUSE = 50;
var BONUS_OTKAT = 400;
var sound_array = ["button_click_snd", "button_select_snd", "window_appear_snd", "window_disappear_snd", "bonus_pause_apply_snd", "bonus_rollback_apply_snd", "bonus_tip_snd", "bonus_tip_apply_snd", "charge_path_score_snd", "element_cancel_snd", "element_get_snd", "element_put_0_snd", "element_put_1_snd", "element_put_2_snd", "element_put_3_snd", "element_put_4_snd", "element_put_bad_snd", "level_begin_snd", "level_complete_snd", "level_failed_snd", "path_begin_snd", "path_end_snd", "path_warning_snd"];
var music_array = ["game1_snd"];
var FON_DEPTH = 50;
var FON_TILES = 100;
var FON_LINES = 500;
var KONV_DEPTH = 1000;
var CREATOR_DEPTH = 1001;
var EATER_DEPTH = 1002;
var BONUS_DEPTH = 1003;
var TILES_DEPTH = 1500;
var CARRIAGE_DEPTH = 1900;
var STARS_DEPTH = 1901;
var DRAG_DEPTH = 2000;
var SCORE_DEPTH = 2400;
var CREATOR_TOP_DEPTH = 2500;
var EATER_TOP_DEPTH = 2501;
var TOP_DEPTH = 2502;
var SCORE_TEXT_DEPTH = 2503;
var MENU_BTN_DEPTH = 2504;
var MENU_DEPTH = 2600;
var MENU_STARS = 10000;
var format = new TextFormat();
format.color = 16750848 /* 0xFF9900 */;
format.font = "Arial";
format.bold = true;
format.size = 16;
var cap_format = new TextFormat();
cap_format.color = 16750848 /* 0xFF9900 */;
cap_format.font = "Arial";
cap_format.bold = true;
cap_format.size = 24;
var format_rules = new TextFormat();
format_rules.color = 39270;
format_rules.font = "Arial";
format_rules.bold = true;
format_rules.size = 12;
format_rules.align = "center";
var PICTURES_IN_LINE = 6;
var COL_PICTURES = 18;
var COL_BORDERS = 6;
var COL_SIZES = 4;
var pictures = new Array();
var borders = new Array();
var sizes = new Array();
var PICTURES_X = 200;
var PICTURES_Y = 130;
var PICTURES_W = 70;
var PICTURES_H = 50;
var BORDERS_X = 200;
var BORDERS_Y = 295;
var BORDERS_W = 70;
var BORDERS_H = 50;
var SIZES_X = 200;
var SIZES_Y = 360;
var SIZES_W = 105;
var SIZES_H = 50;
var i = 0;
while (i < COL_PICTURES) {
pictures[i] = new Object();
if (i < 10) {
pictures[i].skinname = "skin0" + i;
pictures[i].thumbname = "t0" + i;
} else {
pictures[i].skinname = "skin" + i;
pictures[i].thumbname = "t" + i;
}
pictures[i].price = 200;
pictures[i].x = PICTURES_X + ((i % PICTURES_IN_LINE) * PICTURES_W);
pictures[i].y = PICTURES_Y + (Math.floor(i / PICTURES_IN_LINE) * PICTURES_H);
i++;
}
var i = 0;
while (i < COL_BORDERS) {
borders[i] = new Object();
borders[i].price = (i + 1) * 500;
borders[i].x = BORDERS_X + (i * BORDERS_W);
borders[i].y = BORDERS_Y;
i++;
}
borders[0].array = [{x:0.3, y:-0.3}, {x:0.6, y:0}, {x:32.35, y:5.3}, {x:34.15, y:-5}, {x:30.6, y:-15.6}, {x:37.35, y:-18.85}, {x:47.1, y:-22.95}, {x:55, y:-19.15}, {x:63.55, y:-14.4}, {x:59.75, y:-5.6}, {x:58.55, y:3.8}, {x:99.15, y:0.3}, {x:99.15, y:0.3}];
borders[0].isCurve = true;
borders[1].array = [{x:0, y:0}, {x:0, y:0.3}, {x:29.15, y:4.7}, {x:47.35, y:-6.2}, {x:43.85, y:-9.15}, {x:33.55, y:-10.3}, {x:53.55, y:-16.8}, {x:71.8, y:-19.45}, {x:79.75, y:-8.85}, {x:77.95, y:-4.15}, {x:69.15, y:-7.35}, {x:65, y:-5.3}, {x:60, y:-1.75}, {x:63.25, y:1.75}, {x:99.75, y:0.3}];
borders[1].isCurve = true;
borders[2].array = [{x:0.3, y:0}, {x:0.6, y:0}, {x:23.55, y:-17.35}, {x:45.9, y:-0.9}, {x:29.4, y:-5.3}, {x:32.65, y:7.05}, {x:36.5, y:15.6}, {x:48.25, y:22.65}, {x:59.15, y:15.6}, {x:63.85, y:7.65}, {x:66.5, y:-5.9}, {x:51.2, y:-0.9}, {x:71.8, y:-17.65}, {x:99.15, y:-0.6}, {x:99.45, y:0.3}];
borders[2].isCurve = true;
borders[3].array = [{x:22.65, y:2.95}, {x:25.3, y:-18.85}, {x:59.75, y:-17.95}, {x:64.45, y:10.6}, {x:35.6, y:8.25}, {x:38.25, y:-6.5}, {x:44.7, y:-6.5}, {x:45.6, y:3.25}, {x:54.45, y:1.75}, {x:53.25, y:-12.35}, {x:31.5, y:-12.05}, {x:25.9, y:13.25}, {x:72.95, y:19.1}, {x:69.75, y:-2.65}, {x:100.05, y:-0.9}];
borders[3].isCurve = false;
borders[4].array = [{x:0, y:0}, {x:0, y:0}, {x:22.65, y:2.95}, {x:25.3, y:-18.85}, {x:63.55, y:-22.65}, {x:61.2, y:7.95}, {x:32.65, y:8.5}, {x:38.85, y:-2.65}, {x:44.7, y:-6.5}, {x:45.6, y:3.25}, {x:54.45, y:1.75}, {x:49.7, y:-10.6}, {x:31.5, y:-12.05}, {x:25.9, y:13.25}, {x:72.95, y:19.1}, {x:69.75, y:-2.65}, {x:100.05, y:-0.9}];
borders[4].isCurve = true;
borders[5].array = [{x:0.3, y:-0.6}, {x:22.05, y:-0.9}, {x:18.55, y:-19.15}, {x:35.3, y:-30.3}, {x:50, y:-18.85}, {x:49.15, y:-0.3}, {x:46.8, y:20.6}, {x:62.1, y:32.35}, {x:79.15, y:20.6}, {x:75.9, y:0}, {x:99.45, y:0}];
borders[5].isCurve = true;
var i = 0;
while (i < COL_SIZES) {
sizes[i] = new Object();
sizes[i].x = SIZES_X + (i * SIZES_W);
sizes[i].y = SIZES_Y;
i++;
}
sizes[0].rows = 3;
sizes[0].cols = 4;
sizes[1].rows = 4;
sizes[1].cols = 6;
sizes[2].rows = 6;
sizes[2].cols = 8;
sizes[3].rows = 8;
sizes[3].cols = 10;
var Labels = new Array();
Labels.ru = new Object();
Labels.en = new Object();
if (game_version == GAME_VERSION_ALAWAR_RU) {
Labels.ru.get_more_games = "\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u043F\u043E\u043B\u043D\u0443\u044E \u0432\u0435\u0440\u0441\u0438\u044E!";
} else {
Labels.ru.get_more_games = "\u0411\u043E\u043B\u044C\u0448\u0435 \u0438\u0433\u0440!";
}
Labels.ru.loading = "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430";
Labels.ru.combo = "\u041A\u043E\u043C\u0431\u043E";
Labels.ru.bonus = "\u0411\u043E\u043D\u0443\u0441";
Labels.ru.hello_caption = "\u041F\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044E!";
Labels.ru.start_caption = "\u041D\u0410\u0427\u0410\u0422\u042C \u0418\u0413\u0420\u0423";
Labels.ru.options_caption = "\u041D\u0410\u0421\u0422\u0420\u041E\u0419\u041A\u0418";
Labels.ru.options_menu_caption = "\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438";
Labels.ru.play_caption = "\u0418\u0413\u0420\u0410\u0422\u042C";
Labels.ru.back_caption = "\u041D\u0410\u0417\u0410\u0414";
Labels.ru.apply_caption = "\u041F\u0420\u0418\u041C\u0415\u041D\u0418\u0422\u042C";
Labels.ru.game_menu_caption = "\u041C\u0415\u041D\u042E";
Labels.ru.default_caption = "\u0418\u0421\u0425\u041E\u0414\u041D\u042B\u0415 \u041D\u0410\u0421\u0422\u0420\u041E\u0419\u041A\u0418";
Labels.ru.cancel_caption = "\u041E\u0422\u041C\u0415\u041D\u0410";
Labels.ru.back_to_game_caption = "\u0412\u0415\u0420\u041D\u0423\u0422\u042C\u0421\u042F \u0412 \u0418\u0413\u0420\u0423";
Labels.ru.restart_caption = "\u041F\u0415\u0420\u0415\u0418\u0413\u0420\u0410\u0422\u042C \u0423\u0420\u041E\u0412\u0415\u041D\u042C";
Labels.ru.menu_caption = "\u0413\u041B\u0410\u0412\u041D\u041E\u0415 \u041C\u0415\u041D\u042E";
Labels.ru.volume_level = "\u0423\u0440\u043E\u0432\u0435\u043D\u044C \u0433\u0440\u043E\u043C\u043A\u043E\u0441\u0442\u0438";
Labels.ru.music_caption = "\u041C\u0443\u0437\u044B\u043A\u0430";
Labels.ru.sound_caption = "\u0417\u0432\u0443\u043A\u0438";
Labels.ru.game_menu_title = "\u0418\u0433\u0440\u043E\u0432\u043E\u0435 \u043C\u0435\u043D\u044E";
Labels.ru.select_level_caption = "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0443\u0440\u043E\u0432\u0435\u043D\u044C";
Labels.ru.picture_caption = "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0443";
Labels.ru.border_caption = "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u043E\u0440\u043C\u0443 \u043F\u0430\u0437\u043B\u0430";
Labels.ru.size_caption = "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043A\u0443\u0441\u043E\u0447\u043A\u043E\u0432";
Labels.ru.arcade_caption = "\u041B\u0435\u0433\u043A\u0438\u0439\n\u0440\u0435\u0436\u0438\u043C";
Labels.ru.level_complete_caption = "\u0423\u0440\u043E\u0432\u0435\u043D\u044C \u043F\u0440\u043E\u0439\u0434\u0435\u043D";
Labels.ru.cur_score_caption = "\u0417\u0430\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u043E \u0437\u0430 \u0440\u0430\u0443\u043D\u0434";
Labels.ru.total_score_caption = "\u0412\u0441\u0435\u0433\u043E";
Labels.ru.gameover_caption = "\u0418\u0433\u0440\u0430 \u0437\u0430\u043A\u043E\u043D\u0447\u0435\u043D\u0430";
Labels.ru.gameover_txt = "\u0412\u044B \u043D\u0435 \u0443\u0441\u043F\u0435\u043B\u0438 \u0441\u043E\u0431\u0440\u0430\u0442\u044C \u043F\u0430\u0437\u043B.\n\u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437.";
Labels.ru.continue_caption = "\u041F\u0420\u041E\u0414\u041E\u041B\u0416\u0418\u0422\u042C";
Labels.ru.rules_caption = "\u0427\u0435\u043C \u0431\u043E\u043B\u044C\u0448\u0435\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043A\u0443\u0441\u043E\u0447\u043A\u043E\u0432 \u0432 \u043F\u0430\u0437\u043B\u0435\n\u0412\u044B \u0441\u043E\u0431\u0435\u0440\u0435\u0442\u0435, \u0442\u0435\u043C \u0431\u043E\u043B\u044C\u0448\u0435 \u0437\u0432\u0435\u0437\u0434\u043E\u0447\u0435\u043A \u0412\u044B\n\u043F\u043E\u043B\u0443\u0447\u0438\u0442\u0435. \u0417\u0432\u0435\u0437\u0434\u043E\u0447\u043A\u0438 \u043C\u043E\u0436\u043D\u043E \u0442\u0440\u0430\u0442\u0438\u0442\u044C \u043D\u0430\n\u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0435 \u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A \u0438 \u0444\u043E\u0440\u043C \u043F\u0430\u0437\u043B\u043E\u0432.";
Labels.ru.not_enough_stars = "\u041D\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442\n\u0437\u0432\u0435\u0437\u0434\u043E\u0447\u0435\u043A";
Labels.ru.press_any_key = "\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u043A\u043D\u043E\u043F\u043A\u0443 \u043C\u044B\u0448\u0438 \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C...";
if (game_version == GAME_VERSION_ALAWAR_RU) {
Labels.en.get_more_games = "Download full version!";
} else {
Labels.en.get_more_games = "Get more games!";
}
Labels.en.loading = "Loading";
Labels.en.combo = "Combo";
Labels.en.bonus = "Bonus";
Labels.en.hello_caption = "Welcome!";
Labels.en.start_caption = "START GAME";
Labels.en.options_caption = "OPTIONS";
Labels.en.options_menu_caption = "Options";
Labels.en.play_caption = "START";
Labels.en.back_caption = "BACK";
Labels.en.apply_caption = "APPLY";
Labels.en.game_menu_caption = "MENU";
Labels.en.default_caption = "DEFAULT SETTINGS";
Labels.en.cancel_caption = "CANCEL";
Labels.en.back_to_game_caption = "BACK TO GAME";
Labels.en.restart_caption = "RESTART LEVEL";
Labels.en.menu_caption = "MAIN MENU";
Labels.en.volume_level = "Volume level";
Labels.en.music_caption = "Music";
Labels.en.sound_caption = "Sound";
Labels.en.game_menu_title = "Game menu";
Labels.en.select_level_caption = "Select level";
Labels.en.picture_caption = "Select picture";
Labels.en.border_caption = "Select shape";
Labels.en.size_caption = "Select size";
Labels.en.arcade_caption = "Relax\nmode";
Labels.en.level_complete_caption = "Level complete";
Labels.en.cur_score_caption = "Level score";
Labels.en.total_score_caption = "Total";
Labels.en.gameover_caption = "Game over";
Labels.en.gameover_txt = "You lose.\nTry again.";
Labels.en.continue_caption = "CONTINUE";
Labels.en.rules_caption = "";
Labels.en.not_enough_stars = "Not enough\nstars";
Labels.en.press_any_key = "Click mouse button to continue...";
stop();
_root.fon._visible = true;
var puzzle = new Application();
puzzle.init();
Symbol 37 Button
on (release) {
getURL ("http://www.alawar.ru");
}
Symbol 40 Button
on (release) {
getURL ("http://www.bigfishgames.com/online-games/", "_blank");
}
Symbol 51 MovieClip Frame 35
stop();
Symbol 72 MovieClip Frame 1
stop();
mLink.onRelease = function () {
getURL ("http://www.dailyfreegames.com", "_blank");
};
mb1.onRelease = function () {
getURL ("http://www.dailyfreegames.com/games/dress-up-games/iron-man-dress-up.html", "_blank");
};
mb2.onRelease = function () {
getURL ("http://www.dailyfreegames.com/games/action-games/village-defense.html", "_blank");
};
mb3.onRelease = function () {
getURL ("http://www.dailyfreegames.com/games/dress-up-games/power-rangers.html", "_blank");
};
mb4.onRelease = function () {
getURL ("http://www.dailyfreegames.com/games/dress-up-games/batman-dress-up.html", "_blank");
};
mb5.onRelease = function () {
getURL ("http://www.dailyfreegames.com/games/puzzle-games/hexiopolis.html", "_blank");
};
Symbol 72 MovieClip Frame 75
stop();
Symbol 108 MovieClip Frame 1
this.show_progress = function (val) {
if (((val == null) || (val == undefined)) || (val < 0)) {
val = 0;
}
if (val > 100) {
val = 100;
}
var _local3 = Math.round((34 * val) / 100) + 1;
this.progress_bar.gotoAndStop(_local3);
};
Symbol 367 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.6");
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local3);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
}
Symbol 368 MovieClip [__Packages.Application] Frame 0
class Application
{
var sets, eventManager, musicM, soundM, tileset, level_rows, level_cols, tileCounter, empty, bonuses, maintimer, bonustimer, gameScore, moveDistance;
function Application () {
}
function init() {
sets = new UserSettings();
gamePause = false;
levelStarted = false;
eventManager = new Object();
AsBroadcaster.initialize(eventManager);
eventManager.addListener(this);
eventManager.broadcastMessage("onInitComplete");
fscommand ("fullscreen", _root.FULLSCREEN);
musicM = new MusicManager(music_array);
soundM = new SoundManager(sound_array);
musicM.setVolume(_root.puzzle.sets.data.volume);
musicM.playSound("game1_snd");
showMainMenu();
}
function gotolink() {
getURL (_root.get_more_games_link, "_blank");
}
function showMainMenu() {
if (_root.game_version == _root.GAME_VERSION_DAILY_FREE) {
_root.dfg_logo._visible = true;
}
if (_root.game_version == _root.GAME_VERSION_BFG_EN) {
_root.bfg_logo._visible = true;
}
if (_root.game_version == _root.GAME_VERSION_ALAWAR_RU) {
_root.alawar_logo._visible = true;
}
_root.puzzle.hello_ = new Caption(_root, _root.Labels[_root.LANG].hello_caption, "window_title", _root.cap_format, _root.MENU_DEPTH, {_x:200, _y:65, _width:100, _height:100, align:"center"});
if (_root.logo_enabled) {
_root.puzzle.logo_ef_ = _root.attachMovie("logo_ef", "logo_ef", _root.MENU_DEPTH + 5, {_x:15, _y:350, _xscale:40, _yscale:40});
}
_root.puzzle.start_btn_ = new MenuButton(_root.Labels[_root.LANG].start_caption, "button_menu_mc", "button_menu_start", _root.puzzle.showStartGameMenu, _root.MENU_DEPTH + 10, {_x:-150, _y:200, _xscale:80, _yscale:80});
_root.puzzle.options_btn_ = new MenuButton(_root.Labels[_root.LANG].options_caption, "button_menu_mc", "button_menu_options", _root.puzzle.showOptionsMenu, _root.MENU_DEPTH + 11, {_x:-150, _y:240, _xscale:80, _yscale:80});
_root.puzzle.title_ = _root.attachMovie("title_" + _root.LANG, "title", _root.MENU_DEPTH + 20, {_x:100, _y:0, _xscale:80, _yscale:80});
if ((_root.get_more_games_link != null) && (_root.get_more_games_link != undefined)) {
_root.link_btn = new MenuButton(_root.Labels[_root.LANG].get_more_games, "button_link", "button_link", _root.puzzle.gotolink, _root.MENU_DEPTH + 2000, {_x:320, _y:410, _xscale:80, _yscale:80});
}
}
function hideMainMenu() {
if (_root.game_version == _root.GAME_VERSION_DAILY_FREE) {
_root.dfg_logo._visible = false;
}
if (_root.game_version == _root.GAME_VERSION_BFG_EN) {
_root.bfg_logo._visible = false;
}
if (_root.game_version == _root.GAME_VERSION_ALAWAR_RU) {
_root.alawar_logo._visible = false;
}
_root.puzzle.hello_.remove();
if (_root.logo_enabled) {
_root.puzzle.logo_ef_.removeMovieClip();
}
_root.puzzle.start_btn_.remove();
_root.puzzle.options_btn_.remove();
_root.puzzle.title_.removeMovieClip();
if ((_root.get_more_games_link != null) && (_root.get_more_games_link != undefined)) {
_root.link_btn.remove();
}
}
function showStartGameMenu() {
_root.puzzle.hideMainMenu();
if (_root.game_version == _root.GAME_VERSION_DAILY_FREE) {
_root.dfg_logo._visible = true;
}
if (_root.game_version == _root.GAME_VERSION_BFG_EN) {
_root.bfg_logo._visible = true;
}
if (_root.game_version == _root.GAME_VERSION_ALAWAR_RU) {
_root.alawar_logo._visible = true;
}
_root.puzzle.hello_ = new Caption(_root, _root.Labels[_root.LANG].select_level_caption, "window_title", _root.cap_format, _root.MENU_DEPTH, {_x:200, _y:65, _width:100, _height:100, align:"center"});
if (_root.logo_enabled) {
_root.puzzle.logo_ef_ = _root.attachMovie("logo_ef", "logo_ef_", _root.MENU_DEPTH + 5, {_x:15, _y:350, _xscale:40, _yscale:40});
}
_root.puzzle.play_btn_ = new MenuButton(_root.Labels[_root.LANG].play_caption, "button_menu_mc", "button_menu_start_", _root.puzzle.startCurrentLevel, _root.MENU_DEPTH + 10, {_x:-150, _y:200, _xscale:80, _yscale:80});
_root.puzzle.back_btn_ = new MenuButton(_root.Labels[_root.LANG].back_caption, "button_menu_mc", "button_menu_options_", _root.puzzle.startBackToMainMenu, _root.MENU_DEPTH + 11, {_x:-150, _y:240, _xscale:80, _yscale:80});
_root.puzzle.title_ = _root.attachMovie("title_" + _root.LANG, "title", _root.MENU_DEPTH + 20, {_x:100, _y:0, _xscale:80, _yscale:80});
_root.puzzle.picture_caption_ = new Caption(_root, _root.Labels[_root.LANG].picture_caption, "picture_caption_", _root.format, _root.MENU_DEPTH + 21, {_x:_root.PICTURES_X, _y:_root.PICTURES_Y - 20, _width:100, _height:100});
var _local2 = 0;
while (_local2 < _root.COL_PICTURES) {
if (_root.puzzle.sets.data.current_picture == _local2) {
_root.puzzle["checker__" + _local2] = new RadioButton(_local2, _root.pictures[_local2].price, _root.pictures[_local2].thumbname, "picture_checker", "checker__" + _local2, (_root.MENU_DEPTH + 22) + _local2, _root.pictures[_local2].x, _root.pictures[_local2].y, {}, true, _root.puzzle.sets.data.lock_pictures[_local2]);
} else {
_root.puzzle["checker__" + _local2] = new RadioButton(_local2, _root.pictures[_local2].price, _root.pictures[_local2].thumbname, "picture_checker", "checker__" + _local2, (_root.MENU_DEPTH + 22) + _local2, _root.pictures[_local2].x, _root.pictures[_local2].y, {}, false, _root.puzzle.sets.data.lock_pictures[_local2]);
}
_local2++;
}
_root.puzzle.edit_box_ = _root.attachMovie("edit_box", "edit__box", _root.MENU_DEPTH + 100, {_x:490, _y:50});
_root.puzzle.border_caption_ = new Caption(_root, _root.Labels[_root.LANG].border_caption, "border_caption_", _root.format, _root.MENU_DEPTH + 101, {_x:_root.BORDERS_X, _y:_root.BORDERS_Y - 20, _width:100, _height:100});
_local2 = 0;
while (_local2 < _root.COL_BORDERS) {
if (_root.puzzle.sets.data.current_border == _local2) {
_root.puzzle["bchecker__" + _local2] = new BorderRadioButton(_local2, _root.borders[_local2].price, "picture_checker", "bchecker__" + _local2, (_root.MENU_DEPTH + 103) + _local2, _root.borders[_local2].x, _root.borders[_local2].y, {}, true, _root.puzzle.sets.data.lock_borders[_local2]);
} else {
_root.puzzle["bchecker__" + _local2] = new BorderRadioButton(_local2, _root.borders[_local2].price, "picture_checker", "bchecker__" + _local2, (_root.MENU_DEPTH + 103) + _local2, _root.borders[_local2].x, _root.borders[_local2].y, {}, false, _root.puzzle.sets.data.lock_borders[_local2]);
}
_local2++;
}
_root.puzzle.size_caption_ = new Caption(_root, _root.Labels[_root.LANG].size_caption, "size_caption_", _root.format, _root.MENU_DEPTH + 150, {_x:_root.SIZES_X, _y:_root.SIZES_Y - 20, _width:100, _height:100});
_local2 = 0;
while (_local2 < _root.COL_SIZES) {
if (_root.puzzle.sets.data.current_size == _local2) {
_root.puzzle["schecker__" + _local2] = new ClassicRadioButton(_local2, "radio_checker", "schecker__" + _local2, (_root.MENU_DEPTH + 151) + (_local2 * 4), _root.sizes[_local2].x, _root.sizes[_local2].y, {_xscale:80, _yscale:80}, true);
} else {
_root.puzzle["schecker__" + _local2] = new ClassicRadioButton(_local2, "radio_checker", "schecker__" + _local2, (_root.MENU_DEPTH + 151) + (_local2 * 4), _root.sizes[_local2].x, _root.sizes[_local2].y, {_xscale:80, _yscale:80}, false);
}
_root.puzzle["size_caption__" + _local2] = new Caption(_root, (_root.sizes[_local2].rows + "x") + _root.sizes[_local2].cols, "size_caption_" + _local2, _root.format, (_root.MENU_DEPTH + 152) + (_local2 * 4), {_x:_root.sizes[_local2].x + 55, _y:_root.sizes[_local2].y + 5, _width:100, _height:100});
_root.puzzle["score_caption__" + _local2] = new Caption(_root, String((_root.sizes[_local2].rows * _root.sizes[_local2].cols) * _root.TILE_SCORE), "score_caption_" + _local2, _root.format, (_root.MENU_DEPTH + 153) + (_local2 * 4), {_x:_root.sizes[_local2].x + 65, _y:_root.sizes[_local2].y + 25, _width:100, _height:100});
_root.puzzle["star__" + _local2] = _root.attachMovie("star", "star_" + _local2, (_root.MENU_DEPTH + 154) + (_local2 * 4), {_x:_root.sizes[_local2].x + 50, _y:_root.sizes[_local2].y + 28});
_local2++;
}
_root.puzzle.arcade_check_ = new ClassicCheckBox("check_box", "check__box", _root.MENU_DEPTH + 200, {_x:200, _y:415, _xscale:80, _yscale:80}, _root.puzzle.sets.data.easy, _root.puzzle.setEasy);
_root.puzzle.arcade_caption_ = new Caption(_root, _root.Labels[_root.LANG].arcade_caption, "arcade_caption_", _root.format, _root.MENU_DEPTH + 201, {_x:255, _y:415, _width:100, _height:100});
if ((_root.get_more_games_link != null) && (_root.get_more_games_link != undefined)) {
_root.link_btn = new MenuButton(_root.Labels[_root.LANG].get_more_games, "button_link", "button_link", _root.puzzle.gotolink, _root.MENU_DEPTH + 2000, {_x:320, _y:410, _xscale:80, _yscale:80});
}
}
function setEasy(bool) {
_root.puzzle.sets.data.easy = bool;
_root.puzzle.sets.saveSettings();
}
function setMusic(bool) {
_root.puzzle.sets.data.isMusic = bool;
_root.puzzle.sets.saveSettings();
_root.puzzle.musicM.reset();
}
function setSound(bool) {
_root.puzzle.sets.data.isSound = bool;
_root.puzzle.sets.saveSettings();
}
function setVolume(_vol) {
_root.puzzle.sets.data.volume = _vol;
_root.puzzle.musicM.setVolume(_root.puzzle.sets.data.volume);
_root.puzzle.sets.saveSettings();
}
function hideStartGameMenu() {
if (_root.game_version == _root.GAME_VERSION_DAILY_FREE) {
_root.dfg_logo._visible = false;
}
if (_root.game_version == _root.GAME_VERSION_BFG_EN) {
_root.bfg_logo._visible = false;
}
if (_root.game_version == _root.GAME_VERSION_ALAWAR_RU) {
_root.alawar_logo._visible = false;
}
_root.puzzle.hello_.remove();
_root.puzzle.logo_ef_.removeMovieClip();
_root.puzzle.play_btn_.remove();
_root.puzzle.back_btn_.remove();
_root.puzzle.title_.removeMovieClip();
_root.puzzle.picture_caption_.remove();
var _local2 = 0;
while (_local2 < _root.COL_PICTURES) {
_root.puzzle["checker__" + _local2].remove();
_local2++;
}
_root.puzzle.edit_box_.removeMovieClip();
_root.puzzle.border_caption_.remove();
_local2 = 0;
while (_local2 < _root.COL_BORDERS) {
_root.puzzle["bchecker__" + _local2].remove();
_local2++;
}
_root.puzzle.size_caption_.remove();
_local2 = 0;
while (_local2 < _root.COL_SIZES) {
_root.puzzle["schecker__" + _local2].remove();
_root.puzzle["size_caption__" + _local2].remove();
_root.puzzle["score_caption__" + _local2].remove();
_root.puzzle["star__" + _local2].removeMovieClip();
_local2++;
}
_root.puzzle.arcade_check_.remove();
_root.puzzle.arcade_caption_.remove();
if ((_root.get_more_games_link != null) && (_root.get_more_games_link != undefined)) {
_root.link_btn.remove();
}
}
function refreshStartGameMenu() {
_root.puzzle.hideStartGameMenu();
_root.puzzle.showStartGameMenu();
}
function showOptionsMenu() {
_root.puzzle.hideMainMenu();
if (_root.game_version == _root.GAME_VERSION_DAILY_FREE) {
_root.dfg_logo._visible = true;
}
if (_root.game_version == _root.GAME_VERSION_BFG_EN) {
_root.bfg_logo._visible = true;
}
if (_root.game_version == _root.GAME_VERSION_ALAWAR_RU) {
_root.alawar_logo._visible = true;
}
_root.puzzle.hello_ = new Caption(_root, _root.Labels[_root.LANG].options_menu_caption, "window_title", _root.cap_format, _root.MENU_DEPTH, {_x:200, _y:65, _width:100, _height:100, align:"center"});
if (_root.logo_enabled) {
_root.puzzle.logo_ef_ = _root.attachMovie("logo_ef", "logo_ef", _root.MENU_DEPTH + 5, {_x:15, _y:350, _xscale:40, _yscale:40});
}
_root.puzzle.default_btn_ = new MenuButton(_root.Labels[_root.LANG].default_caption, "button_menu_mc", "button_menu_default", _root.puzzle.optionsUseDefaultSettings, _root.MENU_DEPTH + 11, {_x:-150, _y:200, _xscale:80, _yscale:80});
_root.puzzle.cancel_btn_ = new MenuButton(_root.Labels[_root.LANG].back_caption, "button_menu_mc", "button_menu_cancel", _root.puzzle.optionsBackToMainMenu, _root.MENU_DEPTH + 12, {_x:-150, _y:240, _xscale:80, _yscale:80});
_root.puzzle.title_ = _root.attachMovie("title_" + _root.LANG, "title", _root.MENU_DEPTH + 20, {_x:100, _y:0, _xscale:80, _yscale:80});
_root.puzzle.window_ = _root.attachMovie("window_big", "window_big", _root.MENU_DEPTH + 101, {_x:200, _y:120, _xscale:50, _yscale:50});
_root.puzzle.volume_caption_ = new Caption(_root, _root.Labels[_root.LANG].volume_level, "volume_caption_", _root.format, _root.MENU_DEPTH + 118, {_x:250, _y:150, _width:100, _height:100});
_root.puzzle.music_caption_ = new Caption(_root, _root.Labels[_root.LANG].music_caption, "music_caption_", _root.format, _root.MENU_DEPTH + 119, {_x:320, _y:240, _width:100, _height:100});
_root.puzzle.sound_caption_ = new Caption(_root, _root.Labels[_root.LANG].sound_caption, "sound_caption_", _root.format, _root.MENU_DEPTH + 120, {_x:320, _y:300, _width:100, _height:100});
_root.puzzle.volume_slider = new SliderBar("slider", "slider_head", "slider_mc", _root.MENU_DEPTH + 200, {_x:225, _y:180, _xscale:80, _yscale:100}, _root.puzzle.sets.data.volume, 0, 100, _root.puzzle.setVolume);
_root.puzzle.music_check_ = new ClassicCheckBox("check_box", "check__box_music", _root.MENU_DEPTH + 201, {_x:250, _y:220, _xscale:80, _yscale:80}, _root.puzzle.sets.data.isMusic, _root.puzzle.setMusic);
_root.puzzle.sound_check_ = new ClassicCheckBox("check_box", "check__box_sound", _root.MENU_DEPTH + 202, {_x:250, _y:280, _xscale:80, _yscale:80}, _root.puzzle.sets.data.isSound, _root.puzzle.setSound);
if ((_root.get_more_games_link != null) && (_root.get_more_games_link != undefined)) {
_root.link_btn = new MenuButton(_root.Labels[_root.LANG].get_more_games, "button_link", "button_link", _root.puzzle.gotolink, _root.MENU_DEPTH + 2000, {_x:320, _y:410, _xscale:80, _yscale:80});
}
}
function hideOptionsMenu() {
if (_root.game_version == _root.GAME_VERSION_DAILY_FREE) {
_root.dfg_logo._visible = false;
}
if (_root.game_version == _root.GAME_VERSION_BFG_EN) {
_root.bfg_logo._visible = false;
}
if (_root.game_version == _root.GAME_VERSION_ALAWAR_RU) {
_root.alawar_logo._visible = false;
}
_root.puzzle.hello_.removeMovieClip();
if (_root.logo_enabled) {
_root.puzzle.logo_ef_.removeMovieClip();
}
_root.puzzle.default_btn_.remove();
_root.puzzle.cancel_btn_.remove();
_root.puzzle.title_.removeMovieClip();
_root.puzzle.window_.removeMovieClip();
_root.puzzle.volume_caption_.remove();
_root.puzzle.music_caption_.remove();
_root.puzzle.sound_caption_.remove();
_root.puzzle.volume_slider.remove();
_root.puzzle.music_check_.remove();
_root.puzzle.sound_check_.remove();
if ((_root.get_more_games_link != null) && (_root.get_more_games_link != undefined)) {
_root.link_btn.remove();
}
}
function optionsUseDefaultSettings() {
_root.puzzle.sets.defaultOptions();
_root.puzzle.musicM.setVolume(_root.puzzle.sets.data.volume);
_root.puzzle.musicM.reset();
_root.puzzle.hideOptionsMenu();
_root.puzzle.showOptionsMenu();
}
function showGameMenu() {
_root.puzzle.hideToPause();
_root.puzzle.hello_ = new Caption(_root, _root.Labels[_root.LANG].game_menu_title, "window_title", _root.cap_format, _root.MENU_DEPTH + 10, {_x:200, _y:65, _width:100, _height:100, align:"center"});
_root.puzzle.window_ = _root.attachMovie("window_big", "window_big", _root.MENU_DEPTH + 11, {_x:200, _y:120, _xscale:50, _yscale:50});
_root.puzzle.back_to_game_btn_ = new MenuButton(_root.Labels[_root.LANG].back_to_game_caption, "button_menu_mc", "button_menu_default", _root.puzzle.backToGame, _root.MENU_DEPTH + 15, {_x:-150, _y:160, _xscale:80, _yscale:80});
_root.puzzle.new_level_btn_ = new MenuButton(_root.Labels[_root.LANG].restart_caption, "button_menu_mc", "button_menu_cancel", _root.puzzle.restartLevel, _root.MENU_DEPTH + 16, {_x:-150, _y:200, _xscale:80, _yscale:80});
_root.puzzle.back_to_main_btn_ = new MenuButton(_root.Labels[_root.LANG].menu_caption, "button_menu_mc", "button_menu_back", _root.puzzle.backToGameStartMenu, _root.MENU_DEPTH + 17, {_x:-150, _y:240, _xscale:80, _yscale:80});
_root.puzzle.volume_caption_ = new Caption(_root, _root.Labels[_root.LANG].volume_level, "volume_caption_", _root.format, _root.MENU_DEPTH + 18, {_x:250, _y:150, _width:100, _height:100});
_root.puzzle.music_caption_ = new Caption(_root, _root.Labels[_root.LANG].music_caption, "music_caption_", _root.format, _root.MENU_DEPTH + 19, {_x:320, _y:240, _width:100, _height:100});
_root.puzzle.sound_caption_ = new Caption(_root, _root.Labels[_root.LANG].sound_caption, "sound_caption_", _root.format, _root.MENU_DEPTH + 20, {_x:320, _y:300, _width:100, _height:100});
_root.puzzle.volume_slider = new SliderBar("slider", "slider_head", "slider_mc", _root.MENU_DEPTH + 100, {_x:225, _y:180, _xscale:80, _yscale:100}, _root.puzzle.sets.data.volume, 0, 100, _root.puzzle.setVolume);
_root.puzzle.music_check_ = new ClassicCheckBox("check_box", "check__box_music", _root.MENU_DEPTH + 101, {_x:250, _y:220, _xscale:80, _yscale:80}, _root.puzzle.sets.data.isMusic, _root.puzzle.setMusic);
_root.puzzle.sound_check_ = new ClassicCheckBox("check_box", "check__box_sound", _root.MENU_DEPTH + 102, {_x:250, _y:280, _xscale:80, _yscale:80}, _root.puzzle.sets.data.isSound, _root.puzzle.setSound);
if ((_root.get_more_games_link != null) && (_root.get_more_games_link != undefined)) {
_root.link_btn = new MenuButton(_root.Labels[_root.LANG].get_more_games, "button_link", "button_link", _root.puzzle.gotolink, _root.MENU_DEPTH + 2000, {_x:320, _y:410, _xscale:80, _yscale:80});
}
}
function hideGameMenu() {
_root.puzzle.showFromPause();
_root.puzzle.hello_.remove();
_root.puzzle.window_.removeMovieClip();
_root.puzzle.back_to_game_btn_.remove();
_root.puzzle.new_level_btn_.remove();
_root.puzzle.back_to_main_btn_.remove();
_root.puzzle.volume_caption_.remove();
_root.puzzle.music_caption_.remove();
_root.puzzle.sound_caption_.remove();
_root.puzzle.volume_slider.remove();
_root.puzzle.music_check_.remove();
_root.puzzle.sound_check_.remove();
if ((_root.get_more_games_link != null) && (_root.get_more_games_link != undefined)) {
_root.link_btn.remove();
}
}
function hideToPause() {
_root.puzzle.tileset.hideTileSet();
_root.puzzle.menu_btn_.setVisible(false);
_root.puzzle.hideLevelPause();
_root.puzzle.hideBonuses();
_root.puzzle.oldPauseCountdown = _root.puzzle.pauseCountdown;
_root.puzzle.oldGamePause = _root.puzzle.gamePause;
_root.puzzle.pauseCountdown = -1;
_root.puzzle.gamePause = true;
}
function showFromPause() {
_root.puzzle.tileset.showTileSet();
_root.puzzle.menu_btn_.setVisible(true);
_root.puzzle.showLevelPause();
_root.puzzle.showBonuses();
_root.puzzle.pauseCountdown = _root.puzzle.oldPauseCountdown;
_root.puzzle.gamePause = _root.puzzle.oldGamePause;
}
function backToGame() {
_root.puzzle.gamePause = false;
_root.puzzle.hideGameMenu();
}
function restartLevel() {
_root.puzzle.showFromPause();
_root.puzzle.finishLevel();
_root.puzzle.hideGameMenu();
_root.puzzle.startLevel(!_root.puzzle.sets.data.easy, _root.sizes[_root.puzzle.sets.data.current_size].rows, _root.sizes[_root.puzzle.sets.data.current_size].cols, _root.pictures[_root.puzzle.sets.data.current_picture].skinname, _root.borders[_root.puzzle.sets.data.current_border].array, _root.borders[_root.puzzle.sets.data.current_border].isCurve);
}
function backToGameStartMenu() {
_root.puzzle.showFromPause();
_root.puzzle.finishLevel();
_root.puzzle.tileset.head.tile.removeMovieClip();
_root.puzzle.tileset.head.remove();
_root.puzzle.hideGameMenu();
_root.puzzle.showStartGameMenu();
}
function startBackToMainMenu() {
_root.puzzle.hideStartGameMenu();
_root.puzzle.showMainMenu();
}
function optionsBackToMainMenu() {
_root.puzzle.hideOptionsMenu();
_root.puzzle.showMainMenu();
}
function showMochAd() {
var _local2 = {id:_root.MochiAdID, res:_root.MochiAdRes, ad_finished:function () {
_root.puzzle.startCurrentLevel();
}};
MochiAd.showInterLevelAd(_local2);
}
function startCurrentLevel() {
if (_root.useMochi) {
if (_root.puzzle.countLevels == 3) {
_root.puzzle.countLevels = 0;
_root.puzzle.showMochAd();
} else {
_root.puzzle.hideStartGameMenu();
_root.puzzle.startLevel(!_root.puzzle.sets.data.easy, _root.sizes[_root.puzzle.sets.data.current_size].rows, _root.sizes[_root.puzzle.sets.data.current_size].cols, _root.pictures[_root.puzzle.sets.data.current_picture].skinname, _root.borders[_root.puzzle.sets.data.current_border].array, _root.borders[_root.puzzle.sets.data.current_border].isCurve);
_root.puzzle.countLevels++;
}
} else {
_root.puzzle.hideStartGameMenu();
_root.puzzle.startLevel(!_root.puzzle.sets.data.easy, _root.sizes[_root.puzzle.sets.data.current_size].rows, _root.sizes[_root.puzzle.sets.data.current_size].cols, _root.pictures[_root.puzzle.sets.data.current_picture].skinname, _root.borders[_root.puzzle.sets.data.current_border].array, _root.borders[_root.puzzle.sets.data.current_border].isCurve);
}
}
function startLevel(arcade, r, c, skin, bord, isCurve) {
showLevelInterface();
tileset = new TileSet(r, c, skin, bord, isCurve);
levelStarted = true;
gameOver = false;
gamePause = false;
arcadeMode = arcade;
level_rows = r;
level_cols = c;
normal = false;
isBonus = false;
tip = false;
timer = 0;
counter = 0;
bliz = -1;
tileCounter = 0;
win = false;
score = 0;
_root.elementDrag = false;
empty = _root.createEmptyMovieClip("empty", _root.getNextHighestDepth());
empty.target = this;
eventManager.broadcastMessage("beginLevel");
bonuses = new Array();
}
function showGameWinMenu() {
_root.puzzle.sets.data.totalscore = _root.puzzle.sets.data.totalscore + _root.puzzle.score;
if (_root.game_version == _root.GAME_VERSION_MINDJOLT) {
ScoreAPI = new LocalConnection();
ScoreAPI.send(_root.com_mindjolt_api, "submitScore", _root.puzzle.score);
}
_root.puzzle.sets.saveSettings();
_root.puzzle.hello_ = new Caption(_root, _root.Labels[_root.LANG].level_complete_caption, "window_title", _root.format, _root.MENU_DEPTH + 11, {_x:260, _y:185, _width:100, _height:100, align:"center"});
_root.puzzle.window_ = _root.attachMovie("window_small", "window_small", _root.MENU_DEPTH + 10, {_x:180, _y:160, _xscale:60, _yscale:60});
_root.puzzle.cur_score_caption_ = new Caption(_root, _root.Labels[_root.LANG].cur_score_caption, "cur_score_caption_", _root.format, _root.MENU_DEPTH + 12, {_x:210, _y:220, _width:100, _height:100});
_root.puzzle.total_score_caption_ = new Caption(_root, _root.Labels[_root.LANG].total_score_caption, "total_score_caption_", _root.format, _root.MENU_DEPTH + 13, {_x:210, _y:260, _width:100, _height:100});
_root.puzzle.cur_score_ = new Caption(_root, String(_root.puzzle.score), "cur_score_", _root.format, _root.MENU_DEPTH + 14, {_x:410, _y:220, _width:100, _height:100});
_root.puzzle.total_score_ = new Caption(_root, String(_root.puzzle.sets.data.totalscore), "total_score_", _root.format, _root.MENU_DEPTH + 15, {_x:410, _y:260, _width:100, _height:100});
_root.puzzle.cur_star_ = _root.attachMovie("star", "cur_star_", _root.MENU_DEPTH + 16, {_x:390, _y:222});
_root.puzzle.total_star_ = _root.attachMovie("star", "total_star_", _root.MENU_DEPTH + 17, {_x:390, _y:262});
_root.puzzle.continue_btn = new MenuButton(_root.Labels[_root.LANG].continue_caption, "button_menu_mc", "button_menu_continue", _root.puzzle.continueGame, _root.MENU_DEPTH + 20, {_x:-150, _y:240, _xscale:80, _yscale:80});
}
function hideGameWinMenu() {
_root.puzzle.hello.remove();
_root.puzzle.window_.removeMovieClip();
_root.puzzle.cur_score_caption_.remove();
_root.puzzle.total_score_caption_.remove();
_root.puzzle.cur_score_.remove();
_root.puzzle.total_score_.remove();
_root.puzzle.cur_star_.removeMovieClip();
_root.puzzle.total_star_.removeMovieClip();
_root.puzzle.continue_btn.remove();
_root.puzzle.finishLevel();
}
function showGameLoseMenu() {
_root.puzzle.finishLevel();
_root.puzzle.menu_btn_.remove();
_root.puzzle.hello_ = new Caption(_root, _root.Labels[_root.LANG].gameover_caption, "window_title", _root.format, _root.MENU_DEPTH + 11, {_x:260, _y:185, _width:100, _height:100, align:"center"});
_root.puzzle.got = new Caption(_root, _root.Labels[_root.LANG].gameover_txt, "got_capt", _root.format, _root.MENU_DEPTH + 25, {_x:210, _y:220, _width:100, _height:100});
_root.puzzle.window_ = _root.attachMovie("window_small", "window_small", _root.MENU_DEPTH + 1, {_x:180, _y:160, _xscale:60, _yscale:60});
_root.puzzle.continue_btn = new MenuButton(_root.Labels[_root.LANG].continue_caption, "button_menu_mc", "button_menu_continue", _root.puzzle.continueGame, _root.MENU_DEPTH + 20, {_x:-150, _y:240, _xscale:80, _yscale:80});
}
function hideGameLoseMenu() {
_root.puzzle.got.remove();
_root.puzzle.hello.remove();
_root.puzzle.window_.removeMovieClip();
_root.puzzle.continue_btn.remove();
}
function continueGame() {
_root.puzzle.hideGameLoseMenu();
_root.puzzle.hideGameWinMenu();
_root.puzzle.showStartGameMenu();
}
function finishLevel() {
clearInterval(_root.puzzle.maintimer);
clearInterval(_root.puzzle.bonustimer);
_root.puzzle.eventManager.broadcastMessage("puzzleStop");
_root.puzzle.removeBonuses();
if (!_root.puzzle.arcadeMode) {
_root.puzzle.tileset.head.tile.removeMovieClip();
_root.puzzle.tileset.head.remove();
}
_root.puzzle.tileset.deleteSkinTiles();
_root.puzzle.tileset.removeTileSet();
_root.puzzle.levelStarted = false;
_root.puzzle.hideLevelInterface();
}
function showLevelInterface() {
_root.puzzle.menu_btn_ = new MenuButton(_root.Labels[_root.LANG].game_menu_caption, "button_game_menu_mc", "button_menu_", _root.puzzle.showGameMenu, _root.MENU_DEPTH, {_x:400, _y:10, _xscale:80, _yscale:80});
_root.attachMovie("conveer", "conveer", _root.KONV_DEPTH);
_root.attachMovie("creator_bottom", "creator_bottom", _root.CREATOR_DEPTH, {_x:_root.CREATOR_X, _y:_root.CREATOR_Y});
_root.attachMovie("creator_top", "creator_top", _root.CREATOR_TOP_DEPTH, {_x:_root.CREATOR_TOP_X, _y:_root.CREATOR_TOP_Y});
_root.attachMovie("eater_bottom", "eater_bottom", _root.EATER_DEPTH, {_x:_root.EATER_X, _y:_root.EATER_Y});
_root.attachMovie("eater_top", "eater_top", _root.EATER_TOP_DEPTH, {_x:_root.EATER_TOP_X, _y:_root.EATER_TOP_Y});
_root.attachMovie("top_board", "top_board", _root.TOP_DEPTH, {_x:_root.TOP_X, _y:_root.TOP_Y, _xscale:101, _yscale:100});
_root.attachMovie("scores", "scores", _root.SCORE_TEXT_DEPTH, {_x:_root.SCORE_X, _y:_root.SCORE_Y});
}
function hideLevelInterface() {
_root.conveer.removeMovieClip();
_root.creator_bottom.removeMovieClip();
_root.creator_top.removeMovieClip();
_root.eater_bottom.removeMovieClip();
_root.eater_top.removeMovieClip();
_root.top_board.removeMovieClip();
_root.scores.removeMovieClip();
}
function showLevelPause() {
_root.conveer._visible = true;
_root.creator_bottom._visible = true;
_root.creator_top._visible = true;
_root.eater_bottom._visible = true;
_root.eater_top._visible = true;
_root.top_board._visible = true;
_root.scores._visible = true;
}
function hideLevelPause() {
_root.conveer._visible = false;
_root.creator_bottom._visible = false;
_root.creator_top._visible = false;
_root.eater_bottom._visible = false;
_root.eater_top._visible = false;
_root.top_board._visible = false;
_root.scores._visible = false;
}
function createNewBonus() {
if (!gamePause) {
if (arcadeMode) {
switch (random(3)) {
case 0 :
bonuses.push(new BonusPause(level_rows, level_cols, tileset, "bonuspause"));
break;
case 1 :
bonuses.push(new BonusRollback(level_rows, level_cols, tileset, "bonusrollback"));
break;
case 2 :
bonuses.push(new BonusTip(level_rows, level_cols, tileset, "bonustip"));
}
} else {
bonuses.push(new BonusTip(level_rows, level_cols, tileset, "bonustip"));
}
}
}
function removeBonuses() {
for (var _local2 in _root.puzzle.bonuses) {
_root.puzzle.bonuses[_local2].removeBonus();
}
}
function hideBonuses() {
for (var _local2 in _root.puzzle.bonuses) {
_root.puzzle.bonuses[_local2]._mc._visible = false;
}
}
function showBonuses() {
for (var _local2 in _root.puzzle.bonuses) {
_root.puzzle.bonuses[_local2]._mc._visible = true;
}
}
function onMove() {
if (!gamePause) {
timer++;
counter++;
if (!normal) {
eventManager.broadcastMessage("move_down");
}
tileset.head.move();
updateAfterEvent();
} else if (pauseCountdown > 0) {
pauseCountdown--;
} else if (pauseCountdown == 0) {
_root.carriage.gotoAndStop(1);
gamePause = false;
}
}
function onMoveBack() {
tileset.head.getmoveback();
updateAfterEvent();
}
function onMoveDown() {
tileset.head.getmovedown();
updateAfterEvent();
}
function onMoveUp() {
tileset.head.getmoveup();
updateAfterEvent();
}
function startComboPause() {
gamePause = true;
_root.carriage.play();
pauseCountdown = _root.COMBO_PAUSE;
}
function starMove() {
if (!gamePause) {
eventManager.broadcastMessage("move_star");
tileset.starhead.move();
updateAfterEvent();
}
}
function winMove() {
tileset.head.winmove();
updateAfterEvent();
}
function addDeltaScore() {
curScore = _root.WIN_SCORE;
score = score + curScore;
eventManager.broadcastMessage("move_score");
eventManager.broadcastMessage("addScore");
}
function beginLevel() {
starspeed = _root.SPEED_DOWN * 2;
soundM.playSound("level_begin_snd");
clearInterval(maintimer);
maintimer = setInterval(this, "starMove", _root.TIMER_INTERVAL);
}
function puzzleStart() {
puzzleStarted = true;
if (arcadeMode) {
speed = _root.SPEED_DOWN;
} else {
speed = _root.SPEED_RELAX;
}
delete empty.onEnterFrame;
clearInterval(maintimer);
maintimer = setInterval(this, "onMove", _root.TIMER_INTERVAL);
bonustimer = setInterval(this, "createNewBonus", _root.NEW_BONUS_TIME);
}
function puzzleStop() {
puzzleStarted = false;
}
function onInitComplete() {
}
function move_down() {
_root.puzzle.soundM.playSound("path_begin_snd");
}
function move_star() {
_root.puzzle.soundM.playSound("charge_path_score_snd");
}
function move_score() {
_root.puzzle.soundM.playSound("charge_path_score_snd");
}
function element_get() {
_root.puzzle.soundM.playSound("element_get_snd");
}
function element_put() {
tileCounter++;
curScore = 0;
if (bliz < 0) {
bliz = 0;
} else if (counter <= _root.BLIZ_TIME) {
bliz++;
} else {
bliz = 0;
}
switch (bliz) {
case 0 :
curScore = curScore + _root.TILE_SCORE;
soundM.playSound("element_put_0_snd");
break;
case 1 :
curScore = curScore + (_root.TILE_SCORE * 2);
soundM.playSound("element_put_1_snd");
break;
case 2 :
curScore = curScore + (_root.TILE_SCORE * 3);
soundM.playSound("element_put_2_snd");
break;
case 3 :
curScore = curScore + (_root.TILE_SCORE * 4);
soundM.playSound("element_put_3_snd");
break;
default :
curScore = curScore + (_root.TILE_SCORE * 5);
soundM.playSound("element_put_4_snd");
}
if (bliz > 0) {
startComboPause();
}
if (isBonus) {
curScore = curScore + _root.BONUS_SCORE;
}
score = score + curScore;
eventManager.broadcastMessage("scoreChanged");
counter = 0;
if (tileCounter == tileset.colTiles) {
eventManager.broadcastMessage("game_win");
}
isBonus = false;
}
function game_win() {
win = true;
clearInterval(maintimer);
clearInterval(bonustimer);
_root.carriage.gotoAndStop(1);
_root.puzzle.menu_btn_.remove();
_root.puzzle.collectStars = false;
_root.puzzle.winEffectPlaying = false;
if (arcadeMode) {
maintimer = setInterval(this, "winMove", _root.TIMER_INTERVAL);
speed = _root.SPEED_WIN;
gameScore = score;
_root.puzzle.collectStars = true;
} else {
_root.puzzle.tileset.head.tile.removeMovieClip();
_root.puzzle.tileset.head.remove();
}
eventManager.broadcastMessage("level_complete");
tileset.removeTileSet();
removeBonuses();
tileset.createWinSkin();
_root.puzzle.winEffectPlaying = true;
}
function show_window_level_complete() {
clearInterval(_root.wintimer);
_root.puzzle.winEffectPlaying = false;
if (!_root.puzzle.collectStars) {
_root.puzzle.eventManager.broadcastMessage("gamewin");
}
}
function level_complete() {
soundM.playSound("level_complete_snd");
}
function bonus_tip() {
soundM.playSound("bonus_tip_snd");
}
function bonus_tip_apply() {
soundM.playSound("bonus_tip_apply_snd");
}
function bonus_pause_apply() {
soundM.playSound("bonus_pause_apply_snd");
gamePause = true;
_root.carriage.play();
pauseCountdown = _root.BONUS_PAUSE;
}
function bonus_rollback_apply() {
if (tileCounter != tileset.colTiles) {
moveDistance = _root.BONUS_OTKAT;
clearInterval(maintimer);
maintimer = setInterval(this, "onMoveBack", _root.TIMER_INTERVAL);
}
soundM.playSound("bonus_rollback_apply_snd");
}
function end_rollback() {
clearInterval(maintimer);
maintimer = setInterval(this, "onMove", _root.TIMER_INTERVAL);
}
function element_cancel() {
soundM.playSound("element_cancel_snd");
}
function element_bad() {
soundM.playSound("element_put_bad_snd");
}
function scoreChanged() {
_root.scores._text.text = score;
_root.attachMovie("cur_score", "cur_score", _root.SCORE_DEPTH, {_x:_xmouse, _y:_ymouse});
_root.cur_score._text.text = ("+" + curScore) + newline;
if (bliz > 0) {
_root.cur_score._text.text = _root.cur_score._text.text + (((_root.Labels[_root.LANG].combo + " x") + (bliz + 1)) + newline);
}
if (isBonus) {
_root.cur_score._text.text = _root.cur_score._text.text + (_root.Labels[_root.LANG].bonus + "!");
}
}
function addScore() {
_root.scores._text.text = score;
_root.attachMovie("cur_score", "cur_score" + colScores, _root.SCORE_DEPTH + colScores, {_x:_root.carriage._x, _y:_root.carriage._y});
_root["cur_score" + colScores]._text.text = ("+" + curScore) + newline;
colScores++;
}
function gameover() {
soundM.playSound("path_end_snd");
clearInterval(bonustimer);
speed = _root.SPEED_HOLE;
gameOver = true;
}
function button_click() {
soundM.playSound("button_click_snd");
}
function button_select() {
soundM.playSound("button_select_snd");
}
function window_appear() {
soundM.playSound("window_appear_snd");
}
function window_disappear() {
soundM.playSound("window_disappear_snd");
}
function path_warning() {
soundM.playSound("path_warning_snd");
}
function gamelose() {
soundM.playSound("level_failed_snd");
clearInterval(maintimer);
clearInterval(bonustimer);
_root.puzzle.tileset.head.tile.removeMovieClip();
_root.puzzle.tileset.head.remove();
tileset.removeTileSet();
removeBonuses();
_root.puzzle.showGameLoseMenu();
}
function gamewin() {
clearInterval(_root.puzzle.maintimer);
_root.puzzle.menu_btn_.remove();
_root.puzzle.hello_ = new Caption(_root, _root.Labels[_root.LANG].press_any_key, "window_title", _root.format, _root.MENU_DEPTH + 1000, {_x:150, _y:445, _width:100, _height:100, align:"center"});
_root.onMouseDown = function () {
_root.puzzle.hello_.remove();
_root.puzzle.showGameWinMenu();
delete _root.onMouseDown;
};
}
var timer = 0;
var pauseCountdown = -1;
var counter = 0;
var bliz = -1;
var gamePause = false;
var gameOver = false;
var normal = false;
var levelStarted = false;
var puzzleStarted = false;
var speed = 0;
var starspeed = 0;
var total_score = 400;
var score = 0;
var isBonus = false;
var curScore = 0;
var arcadeMode = true;
var win = false;
var colScores = 0;
var tip = false;
}
Symbol 369 MovieClip [__Packages.MusicManager] Frame 0
class MusicManager
{
var sound_effects, ss, volume;
function MusicManager (s_array) {
sound_effects = new Array();
ss = new Array();
ss = s_array;
for (var _local3 in s_array) {
sound_effects[s_array[_local3]] = new Sound();
sound_effects[s_array[_local3]].attachSound(s_array[_local3]);
}
}
function setVolume(val) {
volume = val;
setAllVolume();
}
function getVolume() {
return(volume);
}
function setAllVolume() {
for (var _local2 in sound_effects) {
sound_effects[_local2].setVolume(volume);
}
}
function reset() {
if (_root.puzzle.sets.data.isMusic) {
for (var _local3 in ss) {
stopSound(ss[_local3]);
playSound(ss[_local3]);
}
} else {
for (var _local3 in ss) {
stopSound(ss[_local3]);
}
}
}
function playSound(effect) {
if (_root.puzzle.sets.data.isMusic) {
sound_effects[effect].start();
sound_effects[effect].onSoundComplete = function () {
this.start();
};
}
}
function stopSound(effect) {
sound_effects[effect].stop(effect);
}
}
Symbol 370 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager
{
var sound_effects, volume;
function SoundManager (s_array) {
sound_effects = new Array();
for (var _local3 in s_array) {
sound_effects[s_array[_local3]] = new Sound();
sound_effects[s_array[_local3]].attachSound(s_array[_local3]);
}
}
function setVolume(val) {
volume = val;
setAllVolume();
}
function getVolume() {
return(volume);
}
function setAllVolume() {
for (var _local2 in sound_effects) {
sound_effects[_local2].setVolume(volume);
}
}
function playSound(effect) {
if (_root.puzzle.sets.data.isSound) {
if ((sound_effects[effect].position > 0) and (sound_effects[effect].position < (sound_effects[effect].duration / 2))) {
} else {
sound_effects[effect].start();
}
}
}
function stopSound(effect) {
sound_effects[effect].stop(effect);
}
}
Symbol 371 MovieClip [__Packages.UserSettings] Frame 0
class UserSettings
{
var data, def, set_so;
function UserSettings () {
data = new Object();
def = new Object();
set_so = SharedObject.getLocal(_root.SHARED_NAME);
defaultSettings();
useSettings();
}
function defaultOptions() {
set_so.data.volume = def.volume;
set_so.data.isMusic = def.isMusic;
set_so.data.isSound = def.isSound;
useSettings();
}
function defaultSettings() {
def.volume = 50;
def.isMusic = true;
def.isSound = true;
def.easy = false;
def.totalscore = 400;
def.current_size = 0;
def.current_picture = 0;
def.current_border = 0;
def.lock_pictures = new Array();
def.lock_borders = new Array();
var _local3 = 0;
while (_local3 < _root.COL_PICTURES) {
if (_local3 == 0) {
def.lock_pictures[_local3] = false;
} else {
def.lock_pictures[_local3] = true;
}
_local3++;
}
_local3 = 0;
while (_local3 < _root.COL_BORDERS) {
if (_local3 == 0) {
def.lock_borders[_local3] = false;
} else {
def.lock_borders[_local3] = true;
}
_local3++;
}
}
function useSettings() {
for (var _local2 in def) {
if ((set_so.data[_local2] == null) or (set_so.data[_local2] == undefined)) {
set_so.data[_local2] = def[_local2];
}
data[_local2] = set_so.data[_local2];
}
saveSettings();
}
function show_settings() {
for (var _local2 in set_so.data) {
trace((_local2 + ": ") + set_so.data[_local2]);
}
}
function saveSettings() {
for (var _local2 in data) {
set_so.data[_local2] = data[_local2];
}
set_so.flush();
}
}
Symbol 372 MovieClip [__Packages.Caption] Frame 0
class Caption
{
var _txt, shad;
function Caption (obj, txt, id, format, depth, initObj) {
_txt = obj.createTextField(id, depth, initObj._x, initObj._y, intObj._width, initObj._height);
shad = new flash.filters.DropShadowFilter(1, 45, 0, 100, 2, 2, 1, 3, false, false, false);
_txt.filters = [shad];
_txt.embedFonts = true;
_txt.text = txt;
_txt.type = "dynamic";
_txt.autoSize = true;
_txt.selectable = false;
_txt.setTextFormat(format);
_txt.setNewTextFormat(format);
if (initObj.align == "center") {
_txt._x = (_root.ROOT_W - _txt.textWidth) / 2;
}
}
function setFormat(format) {
_txt.setTextFormat(format);
_txt.setNewTextFormat(format);
}
function show(bool) {
_txt._visible = bool;
}
function remove() {
_txt.removeTextField();
}
}
Symbol 373 MovieClip [__Packages.MenuButton] Frame 0
class MenuButton
{
var _btn;
function MenuButton (txt, id, new_id, _funct, depth, initObj) {
_btn = _root.attachMovie(id, new_id, depth, initObj);
_btn.btn.onRollOver = function () {
_root.puzzle.button_select();
};
_btn.btn.onPress = function () {
_root.puzzle.button_click();
};
_btn.btn.onRelease = _funct;
_btn._text.text = txt;
}
function setVisible(bool) {
_btn._visible = bool;
}
function remove() {
_btn.removeMovieClip();
}
}
Symbol 374 MovieClip [__Packages.RadioButton] Frame 0
class RadioButton
{
var formatYes, formatNo, x, y, number, checked, locked, price, _mc, capt_price, counter, timer;
function RadioButton (_number, _price, pic, id, new_id, depth, x, y, initObj, _checked, _locked) {
formatYes = new TextFormat();
formatYes.color = 16776960 /* 0xFFFF00 */;
formatYes.font = "Arial";
formatYes.bold = true;
formatYes.size = 12;
formatNo = new TextFormat();
formatNo.color = 10027008 /* 0x990000 */;
formatNo.font = "Arial";
formatNo.bold = true;
formatNo.size = 12;
this.x = x;
this.y = y;
_root.puzzle.eventManager.addListener(this);
number = _number;
checked = _checked;
locked = _locked;
price = _price;
_mc = _root.createEmptyMovieClip(new_id, depth);
_mc._x = x;
_mc._y = y;
_mc.picture = _mc.attachMovie(pic, "picture", _mc.getNextHighestDepth());
_mc.checker = _mc.attachMovie(id, "checker", _mc.getNextHighestDepth(), initObj);
_mc.picture._x = _mc.checker.mask._x;
_mc.picture._y = _mc.checker.mask._y;
_mc.picture.setMask(_mc.checker.mask);
if (locked) {
_mc.lock = _mc.attachMovie("lock", "lock", _mc.getNextHighestDepth());
_mc.lock.setMask(_mc.checker.mask);
_mc.star = _mc.attachMovie("star", "star", _mc.getNextHighestDepth(), {_x:4, _y:28});
capt_price = new Caption(_mc, price.toString(), "capt_price", formatYes, _mc.getNextHighestDepth(), {_x:20, _y:28, _width:100, _height:100});
_mc.star._visible = false;
_mc.capt_price._visible = false;
}
_mc.hint = new Caption(_mc, _root.Labels[_root.LANG].not_enough_stars, "_hint", formatYes, _mc.getNextHighestDepth(), {_x:0, _y:0, _width:100, _height:100});
_mc.hint.show(false);
if (checked) {
_mc.checker.unchecked_btn._visible = false;
_mc.checker.checked_btn._visible = true;
} else {
_mc.checker.unchecked_btn._visible = true;
_mc.checker.checked_btn._visible = false;
}
_mc.checker.papa = this;
_mc.checker.unchecked_btn.papa = this;
_mc.checker.checked_btn.papa = this;
_mc.checker.unchecked_btn.onRollOver = function () {
_root.puzzle.button_select();
if (this.papa.locked) {
if (this.papa.price <= _root.puzzle.sets.data.totalscore) {
this.papa._mc.lock.gotoAndStop(2);
this.papa._mc.star.gotoAndStop(1);
this.papa._mc.star._visible = true;
this.papa.capt_price.setFormat(this.papa.formatYes);
this.papa._mc.capt_price._visible = true;
} else {
this.papa._mc.lock.gotoAndStop(3);
this.papa._mc.star.gotoAndStop(2);
this.papa._mc.star._visible = true;
this.papa.capt_price.setFormat(this.papa.formatNo);
this.papa._mc.capt_price._visible = true;
}
}
};
_mc.checker.unchecked_btn.onRollOut = function () {
if (this.papa.locked) {
this.papa._mc.lock.gotoAndStop(1);
this.papa._mc.star._visible = false;
this.papa._mc.capt_price._visible = false;
this.papa._mc.hint.show(false);
}
};
_mc.checker.unchecked_btn.onDragOver = _mc.checker.unchecked_btn.onRollOver;
_mc.checker.unchecked_btn.onDragOut = _mc.checker.unchecked_btn.onRollOut;
_mc.checker.unchecked_btn.onRelease = function () {
if (this.papa.locked) {
this.papa.locked = this.papa.unlock();
}
if (!this.papa.locked) {
_root.puzzle.eventManager.broadcastMessage("uncheck");
this.papa.check();
clearInterval(this.papa.timer);
this.papa.counter = 0;
this.papa.timer = setInterval(this.papa, "tik", 100);
}
};
_mc.checker.checked_btn.onRelease = function () {
_root.puzzle.button_click();
if ((this.papa.counter > 0) and (this.papa.counter < 3)) {
clearInterval(this.papa.timer);
this.papa.counter = 0;
_root.puzzle.startCurrentLevel();
} else {
clearInterval(this.papa.timer);
this.papa.counter = 0;
this.papa.timer = setInterval(this.papa, "tik", 100);
}
};
}
function tik() {
counter++;
}
function unlock() {
if (locked) {
if (price <= _root.puzzle.sets.data.totalscore) {
_root.puzzle.sets.data.totalscore = _root.puzzle.sets.data.totalscore - price;
_root.puzzle.sets.data.lock_pictures[number] = false;
locked = false;
_mc.lock._visible = false;
capt_price._visible = false;
_root.puzzle.refreshStartGameMenu();
var _local3 = Math.sqrt(((_root.SCORES_X - (x + 30)) * (_root.SCORES_X - (x + 30))) + ((_root.SCORES_Y - (y + 20)) * (_root.SCORES_Y - (y + 20))));
_root.newstars = new Particle(_root.SCORES_X, _root.SCORES_Y, x + 30, y + 20, 5, "star", _root.MENU_STARS, 90, 30, 20, _local3 / 10);
return(false);
}
_mc.hint.show(true);
_root.puzzle.element_bad();
return(true);
}
_root.puzzle.button_click();
return(false);
}
function uncheck() {
checked = false;
clearInterval(timer);
counter = 0;
_mc.checker.unchecked_btn._visible = true;
_mc.checker.checked_btn._visible = false;
}
function check() {
checked = true;
_root.puzzle.sets.data.current_picture = number;
_root.puzzle.sets.saveSettings();
_mc.checker.unchecked_btn._visible = false;
_mc.checker.checked_btn._visible = true;
}
function remove() {
_mc.removeMovieClip();
}
}
Symbol 375 MovieClip [__Packages.Particle] Frame 0
class Particle
{
var x1, y1, x2, y2, col, id, depth, max_scale, min_scale, interval, steps, l_x, l_y, ds, counter, timer, elements;
function Particle (_x1, _y1, _x2, _y2, _col, _id, _depth, _max_scale, _min_scale, _interval, _steps) {
x1 = _x1;
y1 = _y1;
x2 = _x2;
y2 = _y2;
col = _col;
id = _id;
depth = _depth;
max_scale = _max_scale;
min_scale = _min_scale;
interval = Math.round(_interval);
steps = Math.round(_steps);
l_x = x2 - x1;
l_y = y2 - y1;
ds = 1 / steps;
counter = 0;
create();
timer = setInterval(this, "move", interval);
}
function create() {
elements = new Array();
var _local3 = 0;
while (_local3 < col) {
var _local4 = min_scale + ((((col - 1) - _local3) * (max_scale - min_scale)) / (col - 1));
elements[_local3] = _root.attachMovie(id, (id + "_particle_") + _local3, depth + _local3, {_x:x1, _y:y1, _xscale:_local4, _yscale:_local4, _alpha:80});
if (_local3 == 0) {
elements[_local3].gotoAndStop(1);
} else {
elements[_local3].gotoAndStop(2);
}
_local3++;
}
}
function move() {
if (counter < steps) {
elements[0].x0 = elements[0]._x;
elements[0].y0 = elements[0]._y;
elements[0]._x = x1 + ((counter * ds) * l_x);
elements[0]._y = y1 + ((((counter * counter) * ds) * ds) * l_y);
elements[0]._rotation = elements[0]._rotation + 5;
var _local3 = 1;
while (_local3 < col) {
elements[_local3].x0 = elements[_local3]._x;
elements[_local3].y0 = elements[_local3]._y;
elements[_local3]._x = elements[_local3 - 1].x0;
elements[_local3]._y = elements[_local3 - 1].y0;
elements[_local3]._rotation = elements[_local3]._rotation + 5;
_local3++;
}
} else {
clearInterval(timer);
remove();
}
_root.puzzle.soundM.playSound("charge_path_score_snd");
counter++;
updateAfterEvent();
}
function remove() {
var _local2 = 0;
while (_local2 < col) {
elements[_local2].removeMovieClip();
_local2++;
}
delete elements;
}
}
Symbol 376 MovieClip [__Packages.BorderRadioButton] Frame 0
class BorderRadioButton
{
var formatYes, formatNo, x, y, number, checked, locked, price, _mc, borderset, capt_price, counter, timer;
function BorderRadioButton (_number, _price, id, new_id, depth, x, y, initObj, _checked, _locked) {
formatYes = new TextFormat();
formatYes.color = 16776960 /* 0xFFFF00 */;
formatYes.font = "Arial";
formatYes.bold = true;
formatYes.size = 12;
formatNo = new TextFormat();
formatNo.color = 10027008 /* 0x990000 */;
formatNo.font = "Arial";
formatNo.bold = true;
formatNo.size = 12;
this.x = x;
this.y = y;
_root.puzzle.eventManager.addListener(this);
number = _number;
checked = _checked;
locked = _locked;
price = _price;
_mc = _root.createEmptyMovieClip(new_id, depth);
_mc._x = x;
_mc._y = y;
_mc.picture = _mc.createEmptyMovieClip("picture", _mc.getNextHighestDepth());
borderset = new BorderThumbnail(_mc.picture, number);
_mc.checker = _mc.attachMovie(id, "checker", _mc.getNextHighestDepth(), initObj);
_mc.picture._xscale = (_mc.checker.mask._width / _mc.picture._width) * 100;
_mc.picture._yscale = (_mc.checker.mask._height / _mc.picture._height) * 100;
_mc.picture._x = _mc.checker.mask._x;
_mc.picture._y = _mc.checker.mask._y;
_mc.picture.setMask(_mc.checker.mask);
if (locked) {
_mc.lock = _mc.attachMovie("lock", "lock", _mc.getNextHighestDepth());
_mc.lock.setMask(_mc.checker.mask);
_mc.star = _mc.attachMovie("star", "star", _mc.getNextHighestDepth(), {_x:4, _y:28});
capt_price = new Caption(_mc, price.toString(), "capt_price", formatYes, _mc.getNextHighestDepth(), {_x:20, _y:28, _width:100, _height:100});
_mc.star._visible = false;
_mc.capt_price._visible = false;
}
_mc.hint = new Caption(_mc, _root.Labels[_root.LANG].not_enough_stars, "_hint", formatYes, _mc.getNextHighestDepth(), {_x:0, _y:0, _width:100, _height:100});
_mc.hint.show(false);
if (checked) {
_mc.checker.unchecked_btn._visible = false;
_mc.checker.checked_btn._visible = true;
} else {
_mc.checker.unchecked_btn._visible = true;
_mc.checker.checked_btn._visible = false;
}
_mc.checker.papa = this;
_mc.checker.unchecked_btn.papa = this;
_mc.checker.checked_btn.papa = this;
_mc.checker.unchecked_btn.onRollOver = function () {
_root.puzzle.button_select();
if (this.papa.locked) {
if (this.papa.price <= _root.puzzle.sets.data.totalscore) {
this.papa._mc.lock.gotoAndStop(2);
this.papa._mc.star.gotoAndStop(1);
this.papa._mc.star._visible = true;
this.papa.capt_price.setFormat(this.papa.formatYes);
this.papa._mc.capt_price._visible = true;
} else {
this.papa._mc.lock.gotoAndStop(3);
this.papa._mc.star.gotoAndStop(2);
this.papa._mc.star._visible = true;
this.papa.capt_price.setFormat(this.papa.formatNo);
this.papa._mc.capt_price._visible = true;
}
}
};
_mc.checker.unchecked_btn.onRollOut = function () {
if (this.papa.locked) {
this.papa._mc.lock.gotoAndStop(1);
this.papa._mc.star._visible = false;
this.papa._mc.capt_price._visible = false;
this.papa._mc.hint.show(false);
}
};
_mc.checker.unchecked_btn.onDragOver = _mc.checker.unchecked_btn.onRollOver;
_mc.checker.unchecked_btn.onDragOut = _mc.checker.unchecked_btn.onRollOut;
_mc.checker.unchecked_btn.onRelease = function () {
if (this.papa.locked) {
this.papa.locked = this.papa.unlock();
}
if (!this.papa.locked) {
_root.puzzle.eventManager.broadcastMessage("uncheck_border");
this.papa.check();
clearInterval(this.papa.timer);
this.papa.counter = 0;
this.papa.timer = setInterval(this.papa, "tik", 100);
}
};
_mc.checker.checked_btn.onRelease = function () {
_root.puzzle.button_click();
if ((this.papa.counter > 0) and (this.papa.counter < 3)) {
clearInterval(this.papa.timer);
this.papa.counter = 0;
_root.puzzle.startCurrentLevel();
} else {
clearInterval(this.papa.timer);
this.papa.counter = 0;
this.papa.timer = setInterval(this.papa, "tik", 100);
}
};
}
function tik() {
counter++;
}
function unlock() {
if (locked) {
if (price <= _root.puzzle.sets.data.totalscore) {
_root.puzzle.sets.data.totalscore = _root.puzzle.sets.data.totalscore - price;
_root.puzzle.sets.data.lock_borders[number] = false;
locked = false;
_mc.lock._visible = false;
capt_price._visible = false;
_root.puzzle.refreshStartGameMenu();
var _local3 = Math.sqrt(((_root.SCORES_X - (x + 30)) * (_root.SCORES_X - (x + 30))) + ((_root.SCORES_Y - (y + 20)) * (_root.SCORES_Y - (y + 20))));
_root.newstars = new Particle(_root.SCORES_X, _root.SCORES_Y, x + 30, y + 20, 5, "star", _root.MENU_STARS, 90, 30, 20, _local3 / 10);
return(false);
}
_mc.hint.show(true);
_root.puzzle.element_bad();
return(true);
}
_root.puzzle.button_click();
return(false);
}
function uncheck_border() {
checked = false;
clearInterval(timer);
counter = 0;
_mc.checker.unchecked_btn._visible = true;
_mc.checker.checked_btn._visible = false;
}
function check() {
checked = true;
_root.puzzle.sets.data.current_border = number;
_root.puzzle.sets.saveSettings();
_mc.checker.unchecked_btn._visible = false;
_mc.checker.checked_btn._visible = true;
}
function remove() {
_mc.removeMovieClip();
}
}
Symbol 377 MovieClip [__Packages.BorderThumbnail] Frame 0
class BorderThumbnail
{
var targ, num, border, isCurve, points, edges, borderTiles;
function BorderThumbnail (_targ, _num) {
targ = _targ;
num = _num;
border = new Array();
border = _root.borders[num].array;
isCurve = _root.borders[num].isCurve;
createPoints();
createEdges();
createBorderTiles();
}
function createPoints() {
points = new Array();
var _local3 = 0;
while (_local3 <= rows) {
points[_local3] = new Array();
var _local2 = 0;
while (_local2 <= cols) {
points[_local3][_local2] = new Object();
points[_local3][_local2].y = (height / rows) * _local3;
points[_local3][_local2].x = (width / cols) * _local2;
_local2++;
}
_local3++;
}
}
function createEdges() {
edges = new Array();
var _local3 = 0;
while (_local3 <= rows) {
edges[_local3] = new Array();
var _local2 = 0;
while (_local2 <= cols) {
edges[_local3][_local2] = new Object();
if ((_local3 == 0) or (_local3 == rows)) {
edges[_local3][_local2].top = 0;
} else {
edges[_local3][_local2].top = (random(2) * 2) - 1;
}
if ((_local2 == 0) or (_local2 == cols)) {
edges[_local3][_local2].left = 0;
} else {
edges[_local3][_local2].left = (random(2) * 2) - 1;
}
_local2++;
}
_local3++;
}
}
function createBorderTiles() {
borderTiles = new Array();
var _local3 = 0;
while (_local3 < rows) {
borderTiles[_local3] = new Array();
var _local2 = 0;
while (_local2 < cols) {
var _local4 = (_local3 * cols) + _local2;
borderTiles[_local3][_local2] = new BorderTile(targ, _local4, 0, 0, width, height, (("skinTile_" + _local3) + "_") + _local2, "border_skin", isCurve, [points[_local3][_local2], points[_local3][_local2 + 1], points[_local3 + 1][_local2 + 1], points[_local3 + 1][_local2]], border, [edges[_local3][_local2].top, edges[_local3][_local2 + 1].left, -edges[_local3 + 1][_local2].top, -edges[_local3][_local2].left]);
_local2++;
}
_local3++;
}
}
function deleteBorderTiles() {
var _local3 = 0;
while (_local3 < rows) {
var _local2 = 0;
while (_local2 < cols) {
borderTiles[_local3][_local2].removeBorderTile();
_local2++;
}
_local3++;
}
}
var rows = 2;
var cols = 2;
var width = 100;
var height = 100;
}
Symbol 378 MovieClip [__Packages.BorderTile] Frame 0
class BorderTile
{
var targ, x0, y0, skinW, skinH, number, tile_id, skinID, isCurve, points, edges, border, tile_mc, cx, cy, antiborder;
function BorderTile (_targ, num, x0, y0, w, h, id, skin, curve, p, b, e) {
targ = _targ;
this.x0 = x0;
this.y0 = y0;
skinW = w;
skinH = h;
number = num;
tile_id = id;
skinID = skin;
isCurve = curve;
points = p;
edges = e;
border = b;
createAntiBorder();
tile_mc = targ.createEmptyMovieClip(tile_id, targ.getNextHighestDepth());
tile_mc.attachMovie(skinID, "skin", tile_mc.getNextHighestDepth());
if ((skinW != -1) and (skinH != -1)) {
tile_mc.skin._xscale = (skinW / tile_mc.skin._width) * 100;
tile_mc.skin._yscale = (skinH / tile_mc.skin._height) * 100;
} else {
skinW = tile_mc.skin._width;
skinH = tile_mc.skin._height;
}
tile_mc.createEmptyMovieClip("mask", tile_mc.getNextHighestDepth());
tile_mc.createEmptyMovieClip("gran", tile_mc.getNextHighestDepth());
drawEdges(tile_mc.mask, 5);
drawEdges(tile_mc.gran, 0);
tile_mc.skin.setMask(tile_mc.mask);
tile_mc.cacheAsBitmap = true;
calcCenter();
moveCenter();
tile_mc.parent = this;
}
function removeBorderTile() {
tile_mc.removeMovieClip();
}
function moveCenter() {
tile_mc.x = x0 + cx;
tile_mc.y = y0 + cy;
tile_mc._x = tile_mc.x;
tile_mc._y = tile_mc.y;
tile_mc.skin._x = -cx;
tile_mc.skin._y = -cy;
tile_mc.mask._x = -cx;
tile_mc.mask._y = -cy;
tile_mc.gran._x = -cx;
tile_mc.gran._y = -cy;
}
function createAntiBorder() {
antiborder = new Array();
var _local2 = 0;
while (_local2 < border.length) {
antiborder[_local2] = new Object();
antiborder[_local2].x = 100 - border[(border.length - _local2) - 1].x;
antiborder[_local2].y = -border[(border.length - _local2) - 1].y;
_local2++;
}
}
function calcCenter() {
var _local2 = tile_mc.gran.getBounds(targ);
cx = (_local2.xMax + _local2.xMin) / 2;
cy = (_local2.yMax + _local2.yMin) / 2;
}
function drawEdges(targ_mc, alpha) {
targ_mc.lineStyle(0, 52275, 100);
targ_mc.beginFill(0, alpha);
targ_mc.moveTo(points[0].x, points[0].y);
var _local2 = 0;
while (_local2 < 4) {
if (edges[_local2] == 0) {
targ_mc.lineTo(points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y);
} else if (isCurve) {
if (edges[_local2] > 0) {
drawCurve(targ_mc, points[_local2].x, points[_local2].y, points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y, border);
} else {
drawCurve(targ_mc, points[_local2].x, points[_local2].y, points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y, antiborder);
}
} else if (edges[_local2] > 0) {
drawPolyLine(targ_mc, points[_local2].x, points[_local2].y, points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y, border);
} else {
drawPolyLine(targ_mc, points[_local2].x, points[_local2].y, points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y, antiborder);
}
_local2++;
}
targ_mc.endFill();
}
function drawCurve(targ_mc, x1, y1, x2, y2, p) {
var _local3 = Math.sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
var _local11 = Math.atan2(y2 - y1, x2 - x1);
var _local5 = Math.cos(_local11);
var _local4 = Math.sin(_local11);
var _local1 = 1;
while (_local1 < p.length) {
targ_mc.curveTo((x1 + (((_local3 * _local5) * p[_local1 - 1].x) / 100)) - (((_local3 * _local4) * p[_local1 - 1].y) / 100), (y1 + (((_local3 * _local4) * p[_local1 - 1].x) / 100)) + (((_local3 * _local5) * p[_local1 - 1].y) / 100), (x1 + (((_local3 * _local5) * p[_local1].x) / 100)) - (((_local3 * _local4) * p[_local1].y) / 100), (y1 + (((_local3 * _local4) * p[_local1].x) / 100)) + (((_local3 * _local5) * p[_local1].y) / 100));
_local1 = _local1 + 2;
}
targ_mc.lineTo(x2, y2);
}
function drawPolyLine(targ_mc, x1, y1, x2, y2, p) {
var _local3 = Math.sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
var _local11 = Math.atan2(y2 - y1, x2 - x1);
var _local5 = Math.cos(_local11);
var _local4 = Math.sin(_local11);
var _local1 = 0;
while (_local1 < p.length) {
targ_mc.lineTo((x1 + (((_local3 * _local5) * p[_local1].x) / 100)) - (((_local3 * _local4) * p[_local1].y) / 100), (y1 + (((_local3 * _local4) * p[_local1].x) / 100)) + (((_local3 * _local5) * p[_local1].y) / 100));
_local1++;
}
targ_mc.lineTo(x2, y2);
}
}
Symbol 379 MovieClip [__Packages.ClassicRadioButton] Frame 0
class ClassicRadioButton
{
var checked, number, _mc;
function ClassicRadioButton (_number, id, new_id, depth, x, y, initObj, _checked) {
_root.puzzle.eventManager.addListener(this);
checked = _checked;
number = _number;
_mc = _root.attachMovie(id, new_id, depth, initObj);
_mc._x = x;
_mc._y = y;
if (checked) {
_mc.unchecked_btn._visible = false;
_mc.checked_btn._visible = true;
} else {
_mc.unchecked_btn._visible = true;
_mc.checked_btn._visible = false;
}
_mc.papa = this;
_mc.unchecked_btn.papa = this;
_mc.checked_btn.papa = this;
_mc.unchecked_btn.onRollOver = function () {
_root.puzzle.button_select();
};
_mc.unchecked_btn.onPress = function () {
_root.puzzle.button_click();
};
_mc.checked_btn.onRollOver = function () {
_root.puzzle.button_select();
};
_mc.checked_btn.onPress = function () {
_root.puzzle.button_click();
};
_mc.unchecked_btn.onRelease = function () {
_root.puzzle.eventManager.broadcastMessage("uncheck_size");
this.papa.check();
};
}
function uncheck_size() {
checked = false;
_mc.unchecked_btn._visible = true;
_mc.checked_btn._visible = false;
}
function check() {
checked = true;
_root.puzzle.sets.data.current_size = number;
_root.puzzle.sets.saveSettings();
_mc.unchecked_btn._visible = false;
_mc.checked_btn._visible = true;
}
function remove() {
_mc.removeMovieClip();
}
}
Symbol 380 MovieClip [__Packages.ClassicCheckBox] Frame 0
class ClassicCheckBox
{
var checked, funct, _mc;
function ClassicCheckBox (id, new_id, depth, initObj, _checked, _funct) {
checked = _checked;
funct = _funct;
_mc = _root.attachMovie(id, new_id, depth, initObj);
if (checked) {
_mc.unchecked_btn._visible = false;
_mc.checked_btn._visible = true;
} else {
_mc.unchecked_btn._visible = true;
_mc.checked_btn._visible = false;
}
_mc.papa = this;
_mc.unchecked_btn.papa = this;
_mc.checked_btn.papa = this;
_mc.unchecked_btn.onRollOver = function () {
_root.puzzle.button_select();
};
_mc.unchecked_btn.onPress = function () {
_root.puzzle.button_click();
};
_mc.checked_btn.onRollOver = function () {
_root.puzzle.button_select();
};
_mc.checked_btn.onPress = function () {
_root.puzzle.button_click();
};
_mc.unchecked_btn.onRelease = function () {
this.papa.check();
};
_mc.checked_btn.onRelease = function () {
this.papa.uncheck();
};
}
function uncheck() {
checked = false;
funct(checked);
_mc.unchecked_btn._visible = true;
_mc.checked_btn._visible = false;
}
function check() {
checked = true;
funct(checked);
_mc.unchecked_btn._visible = false;
_mc.checked_btn._visible = true;
}
function remove() {
_mc.removeMovieClip();
}
}
Symbol 381 MovieClip [__Packages.SliderBar] Frame 0
class SliderBar
{
var value, min, max, funct, _mc;
function SliderBar (slider_id, head_id, new_id, depth, initObj, _value, _min, _max, _funct) {
value = _value;
min = _min;
max = _max;
funct = _funct;
_mc = _root.createEmptyMovieClip(new_id, depth);
_mc._x = initObj._x;
_mc._y = initObj._y;
_mc._xscale = initObj._xscale;
_mc._yscale = initObj._yscale;
_mc.attachMovie(slider_id, "slider", _mc.getNextHighestDepth());
_mc.attachMovie(head_id, "head", _mc.getNextHighestDepth());
_mc.head.btn.onPress = function () {
this._parent.startDrag(false, 10, 0, this._parent._parent.slider._width - 10, 0);
};
_mc.head.btn.onRelease = function () {
this._parent.stopDrag();
v = this._parent._parent.papa.min + ((this._parent._x / (this._parent._parent.slider._width - 20)) * (this._parent._parent.papa.max - this._parent._parent.papa.min));
this._parent._parent.papa.setValue(v);
};
_mc.head.btn.onReleaseOutside = _mc.head.btn.onRelease;
_mc.papa = this;
move_head();
}
function setValue(_val) {
value = _val;
funct(value);
}
function move_head() {
_mc.head._x = ((value - min) * (_mc.slider._width - 20)) / (max - min);
}
function remove() {
_mc.removeMovieClip();
}
}
Symbol 382 MovieClip [__Packages.TileSet] Frame 0
class TileSet
{
var rows, cols, colTiles, skinID, isCurve, border, width, height, points, dy, dx, edges, fon_mc, x, y, skinTiles, tiles, star_items, starhead, head, list_items;
function TileSet (r, c, skin, bord, curve) {
if ((r != null) and (r != undefined)) {
if (r <= _root.MAX_ROWS) {
rows = r;
} else {
rows = _root.MAX_ROWS;
}
} else {
rows = 3;
}
if ((c != null) and (c != undefined)) {
if (c <= _root.MAX_COLS) {
cols = c;
} else {
cols = _root.MAX_COLS;
}
} else {
cols = 4;
}
colTiles = rows * cols;
if (((skin != null) and (skin != undefined)) and (skin != "")) {
skinID = skin;
} else {
skinID = "skin00";
}
if ((curve != null) and (curve != undefined)) {
isCurve = curve;
} else {
isCurve = false;
}
border = bord;
setPosition(_root.PUZZLE_X, _root.PUZZLE_Y);
setSize(_root.PUZZLE_W, _root.PUZZLE_H);
setDelta(width / (_root.POINT_PERCENT * cols), height / (_root.POINT_PERCENT * rows));
createPoints();
createEdges();
createTiles();
createSkinTiles();
createStars();
}
function removeTileSet() {
deleteTiles();
deleteSkinTiles();
deleteStars();
}
function hideTileSet() {
hideTiles();
hideSkinTiles();
hideStars();
}
function showTileSet() {
showTiles();
showSkinTiles();
showStars();
}
function createPoints() {
points = new Array();
var _local3 = 0;
while (_local3 <= rows) {
points[_local3] = new Array();
var _local2 = 0;
while (_local2 <= cols) {
points[_local3][_local2] = new Object();
if ((_local3 == 0) or (_local3 == rows)) {
points[_local3][_local2].y = (height / rows) * _local3;
} else {
points[_local3][_local2].y = (((height / rows) * _local3) + random((2 * dy) + 1)) - dy;
}
if ((_local2 == 0) or (_local2 == cols)) {
points[_local3][_local2].x = (width / cols) * _local2;
} else {
points[_local3][_local2].x = (((width / cols) * _local2) + random((2 * dx) + 1)) - dx;
}
_local2++;
}
_local3++;
}
}
function createEdges() {
edges = new Array();
var _local3 = 0;
while (_local3 <= rows) {
edges[_local3] = new Array();
var _local2 = 0;
while (_local2 <= cols) {
edges[_local3][_local2] = new Object();
if ((_local3 == 0) or (_local3 == rows)) {
edges[_local3][_local2].top = 0;
} else {
edges[_local3][_local2].top = (random(2) * 2) - 1;
}
if ((_local2 == 0) or (_local2 == cols)) {
edges[_local3][_local2].left = 0;
} else {
edges[_local3][_local2].left = (random(2) * 2) - 1;
}
_local2++;
}
_local3++;
}
}
function createWinSkin() {
fon_mc = _root.createEmptyMovieClip("fon", _root.FON_DEPTH);
fon_mc.attachMovie(skinID, "skin", fon_mc.getNextHighestDepth());
fon_mc.skin._xscale = (width / fon_mc.skin._width) * 100;
fon_mc.skin._yscale = (height / fon_mc.skin._height) * 100;
fon_mc._x = x;
fon_mc._y = y;
addWinEffect(fon_mc);
}
function addWinEffect(obj) {
obj.count = 0;
obj.direct = _root.WIN_EFFECT_SPEED;
obj.times = 0;
obj.col = 10;
clearInterval(_root.effecttimer);
_root.effecttimer = setInterval(_root.puzzle.tileset, "win_effect_mov", 30, obj);
}
function win_effect_mov(obj) {
obj.count = obj.count + obj.direct;
if (((obj.count <= 0) and (obj.direct <= 0)) or ((obj.count >= obj.col) and (obj.direct >= 0))) {
obj.direct = obj.direct * -1;
obj.times++;
}
if (obj.times == _root.WIN_EFFECT_TIMES) {
clearInterval(_root.effecttimer);
clearInterval(_root.wintimer);
_root.wintimer = setInterval(_root.puzzle, "show_window_level_complete", 1000);
}
obj.d = Math.round(10 * Math.sin(((obj.count / obj.col) * Math.PI) / 2));
var _local3 = new flash.filters.BlurFilter(obj.d, obj.d, 3);
obj.filters = [_local3];
updateAfterEvent();
}
function createSkinTiles() {
fon_mc = _root.createEmptyMovieClip("fon", _root.FON_DEPTH);
fon_mc.attachMovie(skinID + "_transform", "skin", fon_mc.getNextHighestDepth());
fon_mc.skin._xscale = (width / fon_mc.skin._width) * 100;
fon_mc.skin._yscale = (height / fon_mc.skin._height) * 100;
fon_mc._x = x;
fon_mc._y = y;
skinTiles = new Array();
var _local4 = 0;
while (_local4 < rows) {
skinTiles[_local4] = new Array();
var _local3 = 0;
while (_local3 < cols) {
var _local5 = (_local4 * cols) + _local3;
skinTiles[_local4][_local3] = new SkinTile(_local5, x, y, width, height, (("skinTile_" + _local4) + "_") + _local3, "skin_blink", isCurve, [points[_local4][_local3], points[_local4][_local3 + 1], points[_local4 + 1][_local3 + 1], points[_local4 + 1][_local3]], border, [edges[_local4][_local3].top, edges[_local4][_local3 + 1].left, -edges[_local4 + 1][_local3].top, -edges[_local4][_local3].left]);
tiles[_local4][_local3].skintilelink = skinTiles[_local4][_local3];
_local3++;
}
_local4++;
}
}
function deleteSkinTiles() {
fon_mc.removeMovieClip();
var _local3 = 0;
while (_local3 < rows) {
var _local2 = 0;
while (_local2 < cols) {
skinTiles[_local3][_local2].removeSkinTile();
_local2++;
}
_local3++;
}
}
function hideSkinTiles() {
fon_mc._visible = false;
var _local3 = 0;
while (_local3 < rows) {
var _local2 = 0;
while (_local2 < cols) {
skinTiles[_local3][_local2].tile_mc._visible = false;
_local2++;
}
_local3++;
}
}
function showSkinTiles() {
fon_mc._visible = true;
var _local3 = 0;
while (_local3 < rows) {
var _local2 = 0;
while (_local2 < cols) {
skinTiles[_local3][_local2].tile_mc._visible = true;
_local2++;
}
_local3++;
}
}
function hideTiles() {
_root.carriage._visible = false;
var _local4 = 0;
while (_local4 < rows) {
var _local3 = 0;
while (_local3 < cols) {
tiles[_local4][_local3].tile_mc._visible = false;
_local3++;
}
_local4++;
}
}
function showTiles() {
_root.carriage._visible = true;
var _local4 = 0;
while (_local4 < rows) {
var _local3 = 0;
while (_local3 < cols) {
tiles[_local4][_local3].tile_mc._visible = true;
_local3++;
}
_local4++;
}
}
function hideStars() {
var _local2 = 0;
while (_local2 < _root.COL_STARS) {
_root["star_" + _local2]._visible = false;
_local2++;
}
}
function showStars() {
var _local2 = 0;
while (_local2 < _root.COL_STARS) {
_root["star_" + _local2]._visible = true;
_local2++;
}
}
function deleteTiles() {
var _local3 = 0;
while (_local3 < rows) {
var _local2 = 0;
while (_local2 < cols) {
tiles[_local3][_local2].removeTile();
_local2++;
}
_local3++;
}
}
function createStars() {
star_items = new Array();
var _local3 = 0;
while (_local3 < _root.COL_STARS) {
_root.attachMovie("starz", "star_" + _local3, _root.STARS_DEPTH + _local3);
_root["star_" + _local3]._xscale = (_root["star_" + _local3]._yscale = (_local3 * 5) + 100);
_root["star_" + _local3].cacheAsBitmap = true;
if (_local3 == 0) {
starhead = new Star(_root["star_" + _local3]);
}
if (_local3 == 1) {
star_items[_local3] = new Star(_root["star_" + _local3]);
starhead.insertToNext(star_items[_local3]);
} else {
star_items[_local3] = new Star(_root["star_" + _local3]);
star_items[_local3 - 1].insertToNext(star_items[_local3]);
}
_local3++;
}
starhead.arrangeList();
}
function deleteStars() {
var _local2 = 0;
while (_local2 < _root.COL_STARS) {
_root["star_" + _local2].removeMovieClip();
_local2++;
}
}
function createTiles() {
tiles = new Array();
_root.attachMovie("carriage", "carriage", _root.CARRIAGE_DEPTH);
var _local6 = (_root.MIN_TILE_SIZE / _root.carriage._width) * 100;
_root.carriage._xscale = (_root.carriage._yscale = _local6);
head = new List(_root.carriage);
list_items = new Array();
var _local4 = 0;
while (_local4 < rows) {
tiles[_local4] = new Array();
var _local3 = 0;
while (_local3 < cols) {
var _local5 = (_local4 * cols) + _local3;
tiles[_local4][_local3] = new Tile(_local5, x, y, width, height, (("tile_" + _local4) + "_") + _local3, skinID, isCurve, [points[_local4][_local3], points[_local4][_local3 + 1], points[_local4 + 1][_local3 + 1], points[_local4 + 1][_local3]], border, [edges[_local4][_local3].top, edges[_local4][_local3 + 1].left, -edges[_local4 + 1][_local3].top, -edges[_local4][_local3].left]);
list_items[_local5] = new List(_root[(("tile_" + _local4) + "_") + _local3]);
if (_local5 == 0) {
head.insertToNext(list_items[_local5]);
} else {
list_items[_local5 - 1].insertToNext(list_items[_local5]);
}
_local3++;
}
_local4++;
}
mixList(colTiles);
head.arrangeList();
}
function mixList(n) {
var _local4;
var _local3;
var _local2 = 0;
while (_local2 < colTiles) {
_local4 = random(n);
_local3 = random(n);
list_items[_local4].swap(list_items[_local3]);
_local2++;
}
}
function setPosition(x, y) {
this.x = x;
this.y = y;
}
function setSize(w, h) {
width = w;
height = h;
}
function setDelta(dx, dy) {
this.dx = dx;
this.dy = dy;
}
function setX(value) {
x = value;
}
function getX() {
return(x);
}
function setY(value) {
y = value;
}
function getY() {
return(y);
}
function setW(value) {
width = value;
}
function getW() {
return(width);
}
function setH(value) {
height = value;
}
function getH() {
return(height);
}
function setDX(value) {
dx = value;
}
function getDX() {
return(dx);
}
function setDY(value) {
dy = value;
}
function getDY() {
return(dy);
}
}
Symbol 383 MovieClip [__Packages.List] Frame 0
class List
{
var next, prev, tile, cur;
function List (targ) {
next = null;
prev = null;
tile = targ;
targ.link = this;
}
function insertToNext(targ, isReArrange) {
if (next != null) {
targ.next = next;
targ.prev = this;
next.prev = targ;
next = targ;
} else {
next = targ;
targ.next = null;
targ.prev = this;
}
if (isReArrange) {
_root.puzzle.tileset.head.reArrange();
}
}
function remove() {
cur = this;
while (cur != null) {
cur.friz = false;
cur = cur.prev;
}
if (next != null) {
prev.next = next;
next.prev = prev;
} else {
prev.next = null;
}
prev = null;
next = null;
}
function swap(targ) {
if ((prev != targ) and (next != targ)) {
var _local3 = new List();
_local3.prev = prev;
_local3.next = next;
prev = targ.prev;
next = targ.next;
targ.prev = _local3.prev;
targ.next = _local3.next;
targ.prev.next = targ;
targ.next.prev = targ;
prev.next = this;
next.prev = this;
}
}
function show() {
trace("start list");
cur = this;
while (cur != null) {
trace("tile " + cur.tile.number);
cur = cur.next;
}
trace("end list");
}
function arrangeList() {
cur = next;
var _local3 = 0;
while (cur.next != null) {
cur = cur.next;
}
while (cur != null) {
cur.tile._x = _root.LEFT + ((_root.MIN_TILE_SIZE + _root.TILE_DELTA) * _local3);
cur.tile._y = _root.TOP;
cur.tile.parent.setFilter(false);
cur = cur.prev;
_local3++;
}
}
function reArrange() {
var _local4 = _root.MIN_TILE_SIZE + _root.TILE_DELTA;
var _local3 = 0;
if (_root.puzzle.arcadeMode) {
while (cur.next != null) {
if (cur.tile._y >= _root.TOP) {
cur.tile.parent.setFilter(false);
} else {
cur.tile.parent.setFilter(true);
}
if ((((cur.tile._y >= _root.TOP) and (cur.tile._y <= _root.BOTTOM)) and (cur.tile._x <= _root.BORDER_W)) and ((cur.tile._y + _local4) > cur.next.tile._y)) {
cur.next.tile._y = cur.tile._y + _local4;
cur.next.tile._x = _root.LEFT;
_local3 = cur.next.tile._y - _root.BOTTOM;
if (_local3 > 0) {
cur.next.tile._y = _root.BOTTOM;
cur.next.tile._x = _root.LEFT + _local3;
}
} else if ((((cur.tile._x >= _root.LEFT) and (cur.tile._x <= _root.RIGHT)) and (cur.tile._y >= (_root.ROOT_H - _root.BORDER_H))) and ((cur.tile._x + _local4) > cur.next.tile._x)) {
cur.next.tile._x = cur.tile._x + _local4;
cur.next.tile._y = _root.BOTTOM;
_local3 = cur.next.tile._x - _root.RIGHT;
if (_local3 > 0) {
cur.next.tile._x = _root.RIGHT;
cur.next.tile._y = _root.BOTTOM - _local3;
}
} else if ((((cur.tile._y >= _root.TOP) and (cur.tile._y <= _root.BOTTOM)) and (cur.tile._x >= (_root.ROOT_W - _root.BORDER_W))) and ((cur.tile._y - _local4) < cur.next.tile._y)) {
cur.next.tile._y = cur.tile._y - _local4;
cur.next.tile._x = _root.RIGHT;
}
if (cur.tile._y > _root.TOP) {
cur.tile.parent.setFilter(true);
} else {
cur.tile.parent.setFilter(false);
}
cur = cur.next;
}
} else {
cur = this;
while (cur.next != null) {
cur = cur.next;
}
while (cur.prev != null) {
if (((cur.tile._x >= _root.LEFT) and (cur.tile._y <= _root.TOP)) and ((cur.tile._x + _local4) > cur.prev.tile._x)) {
cur.prev.tile._x = cur.tile._x + _local4;
cur.prev.tile._y = _root.TOP;
}
if ((((cur.tile._y >= _root.TOP) and (cur.tile._y <= _root.BOTTOM)) and (cur.tile._x <= _root.LEFT)) and ((cur.tile._y - _local4) < cur.prev.tile._y)) {
cur.prev.tile._y = cur.tile._y - _local4;
cur.prev.tile._x = _root.LEFT;
_local3 = cur.prev.tile._y - _root.TOP;
if (_local3 < 0) {
cur.prev.tile._y = _root.TOP;
cur.prev.tile._x = _root.LEFT - _local3;
}
} else if ((((cur.tile._x >= _root.LEFT) and (cur.tile._x <= _root.RIGHT)) and (cur.tile._y >= _root.BOTTOM)) and ((cur.tile._x - _local4) < cur.prev.tile._x)) {
cur.prev.tile._x = cur.tile._x - _local4;
cur.prev.tile._y = _root.BOTTOM;
_local3 = cur.prev.tile._x - _root.LEFT;
if (_local3 < 0) {
cur.prev.tile._x = _root.LEFT;
cur.prev.tile._y = _root.BOTTOM + _local3;
}
} else if ((((cur.tile._y > _root.TOP) and (cur.tile._y <= _root.BOTTOM)) and (cur.tile._x >= _root.RIGHT)) and ((cur.tile._y + _local4) > cur.prev.tile._y)) {
cur.prev.tile._y = cur.tile._y + _local4;
cur.prev.tile._x = _root.RIGHT;
_local3 = cur.prev.tile._y - _root.BOTTOM;
if (_local3 > 0) {
cur.prev.tile._y = _root.BOTTOM;
cur.prev.tile._x = _root.RIGHT - _local3;
}
}
if (cur.tile._y > _root.TOP) {
cur.tile.parent.setFilter(true);
} else {
cur.tile.parent.setFilter(false);
}
cur = cur.prev;
}
}
}
function placeFinded(x, y) {
cur = this;
while (cur.next != null) {
if (cur.less(x, y) and cur.next.great(x, y)) {
return(cur);
}
cur = cur.next;
}
if ((cur.next == null) and cur.less(x, y)) {
return(cur);
}
return(null);
}
function great(x, y) {
var _local5 = _root.MIN_TILE_SIZE + _root.TILE_DELTA;
if ((((y >= _root.TOP) and (y <= _root.BOTTOM)) and (x == _root.LEFT)) and (y <= tile._y)) {
return(true);
}
if ((((x >= _root.LEFT) and (x <= _root.RIGHT)) and (y == _root.BOTTOM)) and (x <= tile._x)) {
return(true);
}
if ((((y >= _root.TOP) and (y <= _root.BOTTOM)) and (x == _root.RIGHT)) and (y >= tile._y)) {
return(true);
}
return(false);
}
function less(x, y) {
var _local5 = _root.MIN_TILE_SIZE + _root.TILE_DELTA;
if ((((y >= _root.TOP) and (y <= _root.BOTTOM)) and (x == _root.LEFT)) and (y >= tile._y)) {
return(true);
}
if ((((x >= _root.LEFT) and (x <= _root.RIGHT)) and (y == _root.BOTTOM)) and (x >= tile._x)) {
return(true);
}
if ((((y >= _root.TOP) and (y <= _root.BOTTOM)) and (x == _root.RIGHT)) and (y <= tile._y)) {
return(true);
}
return(false);
}
function getmoveback() {
cur = this;
while (cur.next != null) {
cur = cur.next;
}
if (_root.puzzle.moveDistance > 0) {
_root.puzzle.moveDistance = _root.puzzle.moveDistance - _root.SPEED_ROLLBACK;
cur.moveback();
} else {
_root.puzzle.eventManager.broadcastMessage("end_rollback");
}
}
function moveback() {
ds = (_root.MIN_TILE_SIZE + _root.TILE_DELTA) + _root.SPEED_ROLLBACK;
if ((prev != null) && (tile.dist(prev.tile) <= (_root.MIN_TILE_SIZE + _root.TILE_DELTA))) {
prev.moveback();
}
if (((tile._x >= _root.RIGHT) && (tile._y < _root.BOTTOM)) && (tile._y > _root.TOP)) {
if (tile == _root.carriage) {
_root.carriage._rotation = 180;
}
tile._y = tile._y + _root.SPEED_ROLLBACK;
if (tile._y > _root.BOTTOM) {
tile._y = _root.BOTTOM;
}
} else if ((tile._y >= _root.BOTTOM) && (tile._x > _root.LEFT)) {
if (tile == _root.carriage) {
_root.carriage._rotation = -90;
}
tile._x = tile._x - _root.SPEED_ROLLBACK;
if (tile._x < _root.LEFT) {
tile._x = _root.LEFT;
}
} else if ((tile._x <= _root.LEFT) && (tile._y > _root.TOP)) {
if (tile == _root.carriage) {
_root.carriage._rotation = 0;
}
tile._y = tile._y - _root.SPEED_ROLLBACK;
if (tile._y < _root.TOP) {
tile._y = _root.TOP;
}
} else if (tile._y <= _root.TOP) {
tile._x = tile._x + _root.SPEED_ROLLBACK;
}
if ((next == null) && (tile._y <= ds)) {
_root.puzzle.moveDistance = 0;
}
}
function move() {
if (tile._y > _root.TOP) {
tile.parent.setFilter(true);
} else {
tile.parent.setFilter(false);
}
if (!_root.puzzle.normal) {
lightmove();
} else {
ds = (_root.MIN_TILE_SIZE + _root.TILE_DELTA) + _root.puzzle.speed;
if ((next != null) && (next.tile.dist(tile) <= ds)) {
if (!next.friz) {
next.move();
friz = false;
} else {
friz = true;
}
} else {
if (tile._y >= _root.BOTTOM) {
_root.puzzle.normal = true;
}
if ((((next == null) && (!_root.puzzle.gameOver)) && (_root.puzzle.arcadeMode)) && (!_root.puzzle.win)) {
if ((tile._y <= _root.TOP) && (_root.puzzle.speed < _root.SPEED_DOWN)) {
_root.puzzle.speed = _root.SPEED_DOWN;
} else {
if ((tile._y >= _root.BOTTOM) && (_root.puzzle.speed > _root.SPEED_NORMAL)) {
_root.puzzle.speed = _root.SPEED_NORMAL;
}
if ((tile._x >= _root.RIGHT) && (_root.puzzle.speed > _root.SPEED_UP)) {
_root.puzzle.speed = _root.SPEED_UP;
}
}
}
}
if ((!friz) && ((next == null) || ((next != null) && (next.tile.dist(tile) > ds)))) {
if ((tile._y <= _root.TOP) && (tile._x > _root.LEFT)) {
tile._x = tile._x - _root.puzzle.speed;
if (tile._x < _root.LEFT) {
tile._x = _root.LEFT;
}
} else if ((tile._x <= _root.LEFT) && (tile._y < _root.BOTTOM)) {
tile._y = tile._y + _root.puzzle.speed;
if (tile._y > _root.BOTTOM) {
tile._y = _root.BOTTOM;
}
} else if ((tile._y >= _root.BOTTOM) && (tile._x < _root.RIGHT)) {
if (tile == _root.carriage) {
_root.carriage._rotation = -90;
}
tile._x = tile._x + _root.puzzle.speed;
if (tile._x > _root.RIGHT) {
tile._x = _root.RIGHT;
}
} else if ((tile._x >= _root.RIGHT) && (tile._y >= (_root.BORDER_W + (_root.MIN_TILE_SIZE / 2)))) {
if (tile == _root.carriage) {
_root.carriage._rotation = 180;
}
tile._y = tile._y - _root.puzzle.speed;
if (_root.puzzle.arcadeMode && (tile._y <= (_root.BOTTOM / 3))) {
_root.puzzle.eventManager.broadcastMessage("path_warning");
}
if ((!_root.puzzle.arcadeMode) && (tile._y <= (_root.BORDER_W + _root.MIN_TILE_SIZE))) {
friz = true;
}
} else if (_root.puzzle.arcadeMode) {
if (!_root.puzzle.gameOver) {
_root.puzzle.eventManager.broadcastMessage("gameover");
}
if (tile == _root.carriage) {
tile.removeMovieClip();
remove();
_root.puzzle.eventManager.broadcastMessage("gamelose");
} else {
tile.removeMovieClip();
remove();
}
}
}
}
}
function lightmove() {
ds = (_root.MIN_TILE_SIZE + _root.TILE_DELTA) + _root.puzzle.speed;
if ((next != null) && (next.tile.dist(tile) <= ds)) {
next.move();
} else if (next == null) {
if (tile._y >= _root.BOTTOM) {
_root.puzzle.normal = true;
}
}
if ((tile._y <= _root.TOP) && (tile._x > _root.LEFT)) {
tile._x = tile._x - _root.puzzle.speed;
if (tile._x < _root.LEFT) {
tile._x = _root.LEFT;
}
} else if ((tile._x <= _root.LEFT) && (tile._y < _root.BOTTOM)) {
tile._y = tile._y + _root.puzzle.speed;
if (tile._y > _root.BOTTOM) {
tile._y = _root.BOTTOM;
}
} else if ((tile._y >= _root.BOTTOM) && (tile._x < _root.RIGHT)) {
if (tile == _root.carriage) {
_root.carriage._rotation = -90;
}
tile._x = tile._x + _root.puzzle.speed;
if (tile._x > _root.RIGHT) {
tile._x = _root.RIGHT;
}
}
if (tile._y > _root.TOP) {
tile.parent.setFilter(true);
} else {
tile.parent.setFilter(false);
}
}
function winmove() {
if ((tile._y <= _root.TOP) && (tile._x > _root.LEFT)) {
tile._x = tile._x - _root.puzzle.speed;
d = d + _root.puzzle.speed;
if (d > _root.DELTA_SCORE) {
d = 0;
_root.puzzle.addDeltaScore();
}
if (tile._x < _root.LEFT) {
tile._x = _root.LEFT;
}
} else if ((tile._x <= _root.LEFT) && (tile._y < _root.BOTTOM)) {
tile._y = tile._y + _root.puzzle.speed;
d = d + _root.puzzle.speed;
if (d > _root.DELTA_SCORE) {
d = 0;
_root.puzzle.addDeltaScore();
}
if (tile._y > _root.BOTTOM) {
tile._y = _root.BOTTOM;
}
} else if ((tile._y >= _root.BOTTOM) && (tile._x < _root.RIGHT)) {
_root.carriage._rotation = -90;
tile._x = tile._x + _root.puzzle.speed;
d = d + _root.puzzle.speed;
if (d > _root.DELTA_SCORE) {
d = 0;
_root.puzzle.addDeltaScore();
}
if (tile._x > _root.RIGHT) {
tile._x = _root.RIGHT;
}
} else if ((tile._x >= _root.RIGHT) && (tile._y >= _root.BORDER_W)) {
_root.carriage._rotation = 180;
tile._y = tile._y - _root.puzzle.speed;
d = d + _root.puzzle.speed;
if (d > _root.DELTA_SCORE) {
d = 0;
_root.puzzle.addDeltaScore();
}
} else if (_root.puzzle.arcadeMode) {
tile.removeMovieClip();
remove();
_root.puzzle.collectStars = false;
if (!_root.puzzle.winEffectPlaying) {
_root.puzzle.eventManager.broadcastMessage("gamewin");
}
}
}
var friz = false;
var d = 0;
}
Symbol 384 MovieClip [__Packages.Star] Frame 0
class Star
{
var next, prev, tile, cur, remove;
function Star (targ) {
next = null;
prev = null;
tile = targ;
targ.link = this;
}
function insertToNext(targ) {
if (next != null) {
targ.next = next;
targ.prev = this;
next.prev = targ;
next = targ;
} else {
next = targ;
targ.next = null;
targ.prev = this;
}
}
function arrangeList() {
cur = next;
var _local3 = 0;
while (cur.next != null) {
cur = cur.next;
}
while (cur != null) {
cur.tile._x = _root.LEFT + (_root.STAR_SIZE * _local3);
cur.tile._y = _root.TOP;
cur = cur.prev;
_local3++;
}
}
function show() {
trace("start list");
cur = this;
while (cur != null) {
trace("tile " + cur.tile);
cur = cur.next;
}
trace("end list");
}
function move() {
if (next != null) {
next.move();
}
if ((tile._y <= _root.TOP) && (tile._x > _root.LEFT)) {
tile._x = tile._x - _root.puzzle.starspeed;
if (tile._x < _root.LEFT) {
tile._x = _root.LEFT;
}
} else if ((tile._x <= _root.LEFT) && (tile._y < _root.BOTTOM)) {
tile._y = tile._y + _root.puzzle.starspeed;
if (tile._y > _root.BOTTOM) {
tile._y = _root.BOTTOM;
}
} else if ((tile._y >= _root.BOTTOM) && (tile._x < _root.RIGHT)) {
tile._x = tile._x + _root.puzzle.starspeed;
if (tile._x > _root.RIGHT) {
tile._x = _root.RIGHT;
}
} else if ((tile._x >= _root.RIGHT) && (tile._y >= _root.BORDER_W)) {
tile._y = tile._y - _root.puzzle.starspeed;
} else if (this == _root.puzzle.tileset.starhead) {
tile.removeMovieClip();
remove();
_root.puzzle.eventManager.broadcastMessage("puzzleStart");
} else {
tile.removeMovieClip();
remove();
}
}
}
Symbol 385 MovieClip [__Packages.SkinTile] Frame 0
class SkinTile
{
var x0, y0, skinW, skinH, number, tile_id, skinID, isCurve, isBonus, isTile, points, edges, border, tile_mc, cx, cy, antiborder;
function SkinTile (num, x0, y0, w, h, id, skin, curve, p, b, e) {
if ((x0 != null) and (x0 != undefined)) {
this.x0 = x0;
} else {
this.x0 = 0;
}
if ((y0 != null) and (y0 != undefined)) {
this.y0 = y0;
} else {
this.y0 = 0;
}
if ((w != null) and (w != undefined)) {
skinW = w;
} else {
skinW = -1;
}
if ((h != null) and (h != undefined)) {
skinH = h;
} else {
skinH = -1;
}
if ((num != null) and (num != undefined)) {
number = num;
} else {
number = 0;
}
if (((id != null) and (id != undefined)) and (id != "")) {
tile_id = id;
} else {
tile_id = "tile_" + number;
}
if (((skin != null) and (skin != undefined)) and (skin != "")) {
skinID = skin;
} else {
skinID = "skin_blink";
}
if ((curve != null) and (curve != undefined)) {
isCurve = curve;
} else {
isCurve = false;
}
isBonus = false;
isTile = false;
points = p;
edges = e;
border = b;
createAntiBorder();
tile_mc = _root.createEmptyMovieClip(tile_id, _root.FON_TILES + number);
tile_mc.number = number;
tile_mc.attachMovie(skinID, "skin", tile_mc.getNextHighestDepth());
if ((skinW != -1) and (skinH != -1)) {
tile_mc.skin._xscale = (skinW / tile_mc.skin._width) * 100;
tile_mc.skin._yscale = (skinH / tile_mc.skin._height) * 100;
} else {
skinW = tile_mc.skin._width;
skinH = tile_mc.skin._height;
}
tile_mc.createEmptyMovieClip("mask", tile_mc.getNextHighestDepth());
tile_mc.createEmptyMovieClip("gran", tile_mc.getNextHighestDepth());
drawEdges(tile_mc.mask, 5);
drawEdges(tile_mc.gran, 0);
tile_mc.skin.setMask(tile_mc.mask);
tile_mc.cacheAsBitmap = true;
calcCenter();
moveCenter();
tile_mc.parent = this;
}
function removeSkinTile() {
tile_mc.removeMovieClip();
}
function moveCenter() {
tile_mc.x = x0 + cx;
tile_mc.y = y0 + cy;
tile_mc._x = tile_mc.x;
tile_mc._y = tile_mc.y;
tile_mc.skin._x = -cx;
tile_mc.skin._y = -cy;
tile_mc.mask._x = -cx;
tile_mc.mask._y = -cy;
tile_mc.gran._x = -cx;
tile_mc.gran._y = -cy;
}
function createAntiBorder() {
antiborder = new Array();
var _local2 = 0;
while (_local2 < border.length) {
antiborder[_local2] = new Object();
antiborder[_local2].x = 100 - border[(border.length - _local2) - 1].x;
antiborder[_local2].y = -border[(border.length - _local2) - 1].y;
_local2++;
}
}
function calcCenter() {
var _local3 = tile_mc.gran.getBounds(_root);
cx = (_local3.xMax + _local3.xMin) / 2;
cy = (_local3.yMax + _local3.yMin) / 2;
}
function drawEdges(targ_mc, alpha) {
targ_mc.lineStyle(0, 16777215, 50);
targ_mc.beginFill(0, alpha);
targ_mc.moveTo(points[0].x, points[0].y);
var _local2 = 0;
while (_local2 < 4) {
if (edges[_local2] == 0) {
targ_mc.lineTo(points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y);
} else if (isCurve) {
if (edges[_local2] > 0) {
drawCurve(targ_mc, points[_local2].x, points[_local2].y, points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y, border);
} else {
drawCurve(targ_mc, points[_local2].x, points[_local2].y, points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y, antiborder);
}
} else if (edges[_local2] > 0) {
drawPolyLine(targ_mc, points[_local2].x, points[_local2].y, points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y, border);
} else {
drawPolyLine(targ_mc, points[_local2].x, points[_local2].y, points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y, antiborder);
}
_local2++;
}
targ_mc.endFill();
}
function drawCurve(targ_mc, x1, y1, x2, y2, p) {
var _local3 = Math.sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
var _local11 = Math.atan2(y2 - y1, x2 - x1);
var _local5 = Math.cos(_local11);
var _local4 = Math.sin(_local11);
var _local1 = 1;
while (_local1 < p.length) {
targ_mc.curveTo((x1 + (((_local3 * _local5) * p[_local1 - 1].x) / 100)) - (((_local3 * _local4) * p[_local1 - 1].y) / 100), (y1 + (((_local3 * _local4) * p[_local1 - 1].x) / 100)) + (((_local3 * _local5) * p[_local1 - 1].y) / 100), (x1 + (((_local3 * _local5) * p[_local1].x) / 100)) - (((_local3 * _local4) * p[_local1].y) / 100), (y1 + (((_local3 * _local4) * p[_local1].x) / 100)) + (((_local3 * _local5) * p[_local1].y) / 100));
_local1 = _local1 + 2;
}
targ_mc.lineTo(x2, y2);
}
function drawPolyLine(targ_mc, x1, y1, x2, y2, p) {
var _local3 = Math.sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
var _local11 = Math.atan2(y2 - y1, x2 - x1);
var _local5 = Math.cos(_local11);
var _local4 = Math.sin(_local11);
var _local1 = 0;
while (_local1 < p.length) {
targ_mc.lineTo((x1 + (((_local3 * _local5) * p[_local1].x) / 100)) - (((_local3 * _local4) * p[_local1].y) / 100), (y1 + (((_local3 * _local4) * p[_local1].x) / 100)) + (((_local3 * _local5) * p[_local1].y) / 100));
_local1++;
}
targ_mc.lineTo(x2, y2);
}
function blink() {
tile_mc.skin.play();
}
}
Symbol 386 MovieClip [__Packages.Tile] Frame 0
class Tile
{
var x0, y0, skinW, skinH, number, tile_id, skinID, isCurve, filter, points, edges, border, tile_mc, cx, cy, antiborder;
function Tile (num, x0, y0, w, h, id, skin, curve, p, b, e) {
if ((x0 != null) and (x0 != undefined)) {
this.x0 = x0;
} else {
this.x0 = 0;
}
if ((y0 != null) and (y0 != undefined)) {
this.y0 = y0;
} else {
this.y0 = 0;
}
if ((w != null) and (w != undefined)) {
skinW = w;
} else {
skinW = -1;
}
if ((h != null) and (h != undefined)) {
skinH = h;
} else {
skinH = -1;
}
if ((num != null) and (num != undefined)) {
number = num;
} else {
number = 0;
}
if (((id != null) and (id != undefined)) and (id != "")) {
tile_id = id;
} else {
tile_id = "tile_" + number;
}
if (((skin != null) and (skin != undefined)) and (skin != "")) {
skinID = skin;
} else {
skinID = "skin00";
}
if ((curve != null) and (curve != undefined)) {
isCurve = curve;
} else {
isCurve = false;
}
filter = new flash.filters.DropShadowFilter(5, 45, 0, 80, 5, 5, 1, 3, false, false, false);
points = p;
edges = e;
border = b;
createAntiBorder();
tile_mc = _root.createEmptyMovieClip(tile_id, _root.TILES_DEPTH + number);
tile_mc.number = number;
tile_mc.attachMovie(skinID, "skin", tile_mc.getNextHighestDepth());
if ((skinW != -1) and (skinH != -1)) {
tile_mc.skin._xscale = (skinW / tile_mc.skin._width) * 100;
tile_mc.skin._yscale = (skinH / tile_mc.skin._height) * 100;
} else {
skinW = tile_mc.skin._width;
skinH = tile_mc.skin._height;
}
tile_mc.createEmptyMovieClip("mask", tile_mc.getNextHighestDepth());
tile_mc.createEmptyMovieClip("gran", tile_mc.getNextHighestDepth());
drawEdges(tile_mc.mask);
drawEdges(tile_mc.gran);
tile_mc.skin.setMask(tile_mc.mask);
setFilter(true);
tile_mc.cacheAsBitmap = true;
tile_mc.setMiniSize = function () {
var _local4 = this.mask._width;
var _local3 = this.mask._height;
var _local5 = 100;
if ((_local4 >= _local3) and (_local4 >= _root.MIN_TILE_SIZE)) {
_local5 = (_root.MIN_TILE_SIZE / _local4) * 100;
} else if ((_local3 > _local4) and (_local3 >= _root.MIN_TILE_SIZE)) {
_local5 = (_root.MIN_TILE_SIZE / _local3) * 100;
}
this._xscale = (this._yscale = _local5);
};
tile_mc.setRealSize = function () {
this._xscale = (this._yscale = 100);
};
tile_mc.dist = function (_mc) {
return(Math.abs(this._x - _mc._x) + Math.abs(this._y - _mc._y));
};
_root.puzzle.eventManager.addListener(this);
calcCenter();
moveCenter();
tile_mc.parent = this;
tile_mc.setMiniSize();
tile_mc.isDrag = false;
tile_mc.inCenter = function () {
if (Math.sqrt(((this._x - this.x) * (this._x - this.x)) + ((this._y - this.y) * (this._y - this.y))) <= _root.TOCHNOST) {
return(true);
}
return(false);
};
tile_mc.onPress = function () {
if (this._y > _root.BORDER_H) {
this.x0 = _root._xmouse;
this.y0 = _root._ymouse;
this.onMouseMove = function () {
if ((Math.abs(this.x0 - _root._xmouse) + Math.abs(this.y0 - _root._ymouse)) > 10) {
if (((!this.isDrag) and (!_root.elementDrag)) and (this._y > _root.BORDER_H)) {
this.link.remove();
this.startDrag(true, 0, _root.BORDER_H * 1.2, _root.ROOT_W, _root.ROOT_H);
if (_root.puzzle.tip) {
_root.puzzle.tip = false;
_root.puzzle.tip_link.applyBonus();
this.parent.skintilelink.tile_mc.skin.play();
}
_root.puzzle.eventManager.broadcastMessage("element_get");
this.swapDepths(_root.DRAG_DEPTH);
this.isDrag = true;
_root.elementDrag = true;
delete this.onMouseMove;
this.onMouseMove = function () {
if ((((this._x > _root.BORDER_W) and (this._x < (_root.ROOT_W - _root.BORDER_W))) and (this._y > _root.BORDER_H)) and (this._y < (_root.ROOT_H - _root.BORDER_H))) {
this.setRealSize();
} else {
this.setMiniSize();
}
};
} else {
delete this.onMouseMove;
this.onMouseMove = function () {
if ((((this._x > _root.BORDER_W) and (this._x < (_root.ROOT_W - _root.BORDER_W))) and (this._y > _root.BORDER_H)) and (this._y < (_root.ROOT_H - _root.BORDER_H))) {
this.setRealSize();
} else {
this.setMiniSize();
}
};
}
}
};
}
};
tile_mc.onRelease = function () {
if (((!this.isDrag) and (!_root.elementDrag)) and (this._y > _root.BORDER_H)) {
this.link.remove();
this.startDrag(true, 0, _root.BORDER_H * 1.2, _root.ROOT_W, _root.ROOT_H);
if (_root.puzzle.tip) {
_root.puzzle.tip = false;
_root.puzzle.tip_link.applyBonus();
this.parent.skintilelink.tile_mc.skin.play();
}
_root.puzzle.eventManager.broadcastMessage("element_get");
this.swapDepths(_root.DRAG_DEPTH);
this.isDrag = true;
_root.elementDrag = true;
this.onMouseMove = function () {
if ((((this._x > _root.BORDER_W) and (this._x < (_root.ROOT_W - _root.BORDER_W))) and (this._y > _root.BORDER_H)) and (this._y < (_root.ROOT_H - _root.BORDER_H))) {
this.setRealSize();
} else {
this.setMiniSize();
}
};
} else if (this.isDrag and _root.elementDrag) {
if (this.inCenter()) {
this.parent.skintilelink.isTile = true;
if (this.parent.skintilelink.isBonus) {
_root.puzzle.isBonus = true;
_root.puzzle.bonusType = _root["bonus_" + this.parent.skintilelink.number].papa.bonusType;
_root["bonus_" + this.parent.skintilelink.number].papa.getBonus();
}
_root.puzzle.eventManager.broadcastMessage("element_put");
this.isDrag = false;
_root.elementDrag = false;
this.stopDrag();
this.swapDepths(_root.TILES_DEPTH + this.number);
this._x = this.x;
this._y = this.y;
this.parent.setFilter(false);
delete this.onPress;
delete this.onRelease;
delete this.onReleaseOutside;
delete this.onMouseMove;
} else if (!((((this._x > _root.BORDER_W) and (this._x < (_root.ROOT_W - _root.BORDER_W))) and (this._y > _root.BORDER_H)) and (this._y < (_root.ROOT_H - _root.BORDER_H)))) {
this.correctPosition();
if ((abc = _root.puzzle.tileset.head.placeFinded(this._x, this._y))) {
this.isDrag = false;
_root.elementDrag = false;
this.stopDrag();
abc.insertToNext(this.link, true);
this.swapDepths(_root.TILES_DEPTH + this.number);
delete this.onMouseMove;
this.setMiniSize();
_root.puzzle.eventManager.broadcastMessage("element_cancel");
} else {
_root.puzzle.eventManager.broadcastMessage("element_bad");
}
} else {
_root.puzzle.eventManager.broadcastMessage("element_bad");
}
}
};
tile_mc.onReleaseOutside = tile_mc.onRelease;
tile_mc.correctPosition = function () {
if (((this._y >= _root.TOP) and (this._y <= _root.BOTTOM)) and (this._x <= _root.BORDER_W)) {
this._x = _root.LEFT;
} else if (((this._x >= _root.LEFT) and (this._x <= _root.RIGHT)) and (this._y >= (_root.ROOT_H - _root.BORDER_H))) {
this._y = _root.BOTTOM;
} else if (((this._y >= _root.TOP) and (this._y <= _root.BOTTOM)) and (this._x >= (_root.ROOT_W - _root.BORDER_W))) {
this._x = _root.RIGHT;
} else if ((this._y <= _root.BOTTOM) and (this._x <= _root.LEFT)) {
this._x = _root.LEFT;
this._y = _root.BOTTOM;
} else if ((this._y <= _root.BOTTOM) and (this._x >= _root.RIGHT)) {
this._x = _root.RIGHT;
this._y = _root.BOTTOM;
}
};
}
function setFilter(bool) {
if (bool) {
tile_mc.filters = [filter];
} else {
tile_mc.filters = [];
}
}
function removeTile() {
tile_mc.removeMovieClip();
}
function moveCenter() {
tile_mc._x = x0 / 2;
tile_mc._y = y0 / 2;
tile_mc.x = x0 + cx;
tile_mc.y = y0 + cy;
tile_mc.skin._x = -cx;
tile_mc.skin._y = -cy;
tile_mc.mask._x = -cx;
tile_mc.mask._y = -cy;
tile_mc.gran._x = -cx;
tile_mc.gran._y = -cy;
}
function createAntiBorder() {
antiborder = new Array();
var _local2 = 0;
while (_local2 < border.length) {
antiborder[_local2] = new Object();
antiborder[_local2].x = 100 - border[(border.length - _local2) - 1].x;
antiborder[_local2].y = -border[(border.length - _local2) - 1].y;
_local2++;
}
}
function calcCenter() {
var _local3 = tile_mc.gran.getBounds(_root);
cx = (_local3.xMax + _local3.xMin) / 2;
cy = (_local3.yMax + _local3.yMin) / 2;
}
function drawEdges(targ_mc) {
targ_mc.lineStyle(0, 0, 50);
targ_mc.beginFill(0, 5);
targ_mc.moveTo(points[0].x, points[0].y);
var _local2 = 0;
while (_local2 < 4) {
if (edges[_local2] == 0) {
targ_mc.lineTo(points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y);
} else if (isCurve) {
if (edges[_local2] > 0) {
drawCurve(targ_mc, points[_local2].x, points[_local2].y, points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y, border);
} else {
drawCurve(targ_mc, points[_local2].x, points[_local2].y, points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y, antiborder);
}
} else if (edges[_local2] > 0) {
drawPolyLine(targ_mc, points[_local2].x, points[_local2].y, points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y, border);
} else {
drawPolyLine(targ_mc, points[_local2].x, points[_local2].y, points[(_local2 + 1) % 4].x, points[(_local2 + 1) % 4].y, antiborder);
}
_local2++;
}
targ_mc.endFill();
}
function drawCurve(targ_mc, x1, y1, x2, y2, p) {
var _local3 = Math.sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
var _local11 = Math.atan2(y2 - y1, x2 - x1);
var _local5 = Math.cos(_local11);
var _local4 = Math.sin(_local11);
var _local1 = 1;
while (_local1 < p.length) {
targ_mc.curveTo((x1 + (((_local3 * _local5) * p[_local1 - 1].x) / 100)) - (((_local3 * _local4) * p[_local1 - 1].y) / 100), (y1 + (((_local3 * _local4) * p[_local1 - 1].x) / 100)) + (((_local3 * _local5) * p[_local1 - 1].y) / 100), (x1 + (((_local3 * _local5) * p[_local1].x) / 100)) - (((_local3 * _local4) * p[_local1].y) / 100), (y1 + (((_local3 * _local4) * p[_local1].x) / 100)) + (((_local3 * _local5) * p[_local1].y) / 100));
_local1 = _local1 + 2;
}
targ_mc.lineTo(x2, y2);
}
function drawPolyLine(targ_mc, x1, y1, x2, y2, p) {
var _local3 = Math.sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
var _local11 = Math.atan2(y2 - y1, x2 - x1);
var _local5 = Math.cos(_local11);
var _local4 = Math.sin(_local11);
var _local1 = 0;
while (_local1 < p.length) {
targ_mc.lineTo((x1 + (((_local3 * _local5) * p[_local1].x) / 100)) - (((_local3 * _local4) * p[_local1].y) / 100), (y1 + (((_local3 * _local4) * p[_local1].x) / 100)) + (((_local3 * _local5) * p[_local1].y) / 100));
_local1++;
}
targ_mc.lineTo(x2, y2);
}
}
Symbol 387 MovieClip [__Packages.Bonus] Frame 0
class Bonus
{
var rows, cols, papa, place, placeFinded, _mc, id, timer;
function Bonus (_rows, _cols, _papa, mc) {
rows = _rows;
cols = _cols;
papa = _papa;
place = new Object();
placeFinded = false;
findPlace();
_mc = _root.attachMovie(mc, "bonus_" + id, _root.BONUS_DEPTH + id);
_mc._x = papa.skinTiles[place.r][place.c].tile_mc._x;
_mc._y = papa.skinTiles[place.r][place.c].tile_mc._y;
_mc.papa = this;
timer = setInterval(this, "bonusTimeout", _root.BONUS_LIVE_TIME);
}
function findPlace() {
var _local3 = 0;
do {
_local3++;
place.r = random(rows);
place.c = random(cols);
if ((!papa.skinTiles[place.r][place.c].isBonus) and (!papa.skinTiles[place.r][place.c].isTile)) {
placeFinded = true;
}
} while ((!placeFinded) and (_local3 < (_root.MAX_TILES * 10)));
if (placeFinded) {
papa.skinTiles[place.r][place.c].isBonus = true;
id = (place.r * cols) + place.c;
}
}
function bonusTimeout() {
clearInterval(timer);
removeBonus();
}
function removeBonus() {
papa.skinTiles[place.r][place.c].isBonus = false;
_mc.removeMovieClip();
}
}
Symbol 388 MovieClip [__Packages.BonusPause] Frame 0
class BonusPause extends Bonus
{
var removeBonus;
function BonusPause (_rows, _cols, _papa, mc) {
super(_rows, _cols, _papa, mc);
}
function getBonus() {
applyBonus();
}
function applyBonus() {
_root.puzzle.eventManager.broadcastMessage("bonus_pause_apply");
removeBonus();
}
var bonusType = "pause";
}
Symbol 389 MovieClip [__Packages.BonusRollback] Frame 0
class BonusRollback extends Bonus
{
var removeBonus;
function BonusRollback (_rows, _cols, _papa, mc) {
super(_rows, _cols, _papa, mc);
}
function getBonus() {
applyBonus();
}
function applyBonus() {
_root.puzzle.eventManager.broadcastMessage("bonus_rollback_apply");
removeBonus();
}
var bonusType = "rollback";
}
Symbol 390 MovieClip [__Packages.BonusTip] Frame 0
class BonusTip extends Bonus
{
var _mc, removeBonus;
function BonusTip (_rows, _cols, _papa, mc) {
super(_rows, _cols, _papa, mc);
}
function getBonus() {
_root.puzzle.eventManager.broadcastMessage("bonus_tip");
_root.puzzle.tip = true;
_root.puzzle.tip_link = this;
_mc._visible = false;
}
function applyBonus() {
_root.puzzle.eventManager.broadcastMessage("bonus_tip_apply");
removeBonus();
}
var bonusType = "tip";
}
Symbol 122 MovieClip [star] Frame 1
stop();
Symbol 122 MovieClip [star] Frame 2
stop();
Symbol 126 MovieClip [lock] Frame 1
stop();
Symbol 126 MovieClip [lock] Frame 2
stop();
Symbol 126 MovieClip [lock] Frame 3
stop();
Symbol 176 MovieClip Frame 1
stop();
Symbol 233 MovieClip [skin_blink] Frame 1
stop();
Symbol 333 MovieClip [cur_score] Frame 1
_text.setTextFormat(_root.format);
Symbol 333 MovieClip [cur_score] Frame 50
this.removeMovieClip();
Symbol 344 MovieClip [scores] Frame 1
star1.gotoAndStop(1);
star2.gotoAndStop(1);
star3.gotoAndStop(1);
_text.setTextFormat(_root.format);
_text.setNewTextFormat(_root.format);
Symbol 345 MovieClip [starz] Frame 1
star.stop();
gotoAndPlay(random(48) + 2);
Symbol 345 MovieClip [starz] Frame 50
gotoAndPlay (2);
Symbol 354 MovieClip [carriage] Frame 1
stop();
Symbol 354 MovieClip [carriage] Frame 15
gotoAndPlay (2);