Frame 1
function func_url() {
getURL (sponsorurl, "_blank");
}
function create_clouds() {
all_m.createEmptyMovieClip("menu_clouds", all_m.getNextHighestDepth());
all_m.menu_clouds.attachMovie("o_preloader_gr", "o_mountains_3", 3);
all_m.menu_clouds.o_mountains_3._x = 320;
all_m.menu_clouds.o_mountains_3._y = 557;
all_m.menu_clouds.o_mountains_3.gotoAndStop(1);
all_m.menu_clouds.attachMovie("o_vint", "o_mountains_4", 4);
all_m.menu_clouds.o_mountains_4._x = 327;
all_m.menu_clouds.o_mountains_4._y = 365;
all_m.createEmptyMovieClip("clouds_1", all_m.getNextHighestDepth());
all_m.createEmptyMovieClip("clouds_2", all_m.getNextHighestDepth());
all_m.createEmptyMovieClip("clouds_3", all_m.getNextHighestDepth());
var _local1 = 0;
while (_local1 < 4) {
all_m.clouds_1.attachMovie("o_cloud", "o_cloud_" + _local1, _local1);
all_m.clouds_1["o_cloud_" + _local1]._x = 135 + (_local1 * 300);
all_m.clouds_1["o_cloud_" + _local1]._y = 45 + (_local1 * 110);
all_m.clouds_1["o_cloud_" + _local1]._xscale = 100 - (_local1 * 5);
all_m.clouds_1["o_cloud_" + _local1]._yscale = all_m.clouds_1["o_cloud_" + _local1]._xscale;
all_m.clouds_1["o_cloud_" + _local1].gotoAndStop(random(4));
_local1 = _local1 + 1;
}
all_m.clouds_1.o_cloud_2._x = 270;
all_m.clouds_1.o_cloud_2._y = 305;
all_m.clouds_1.o_cloud_3._x = 80;
all_m.clouds_1.o_cloud_3._y = 195;
all_m.clouds_2._x = 320;
_local1 = 0;
while (_local1 < 3) {
all_m.clouds_2.attachMovie("o_cloud", "o_cloud_" + _local1, _local1);
all_m.clouds_2["o_cloud_" + _local1]._x = 45 + (_local1 * 380);
all_m.clouds_2["o_cloud_" + _local1]._y = 35 + (_local1 * 80);
all_m.clouds_2["o_cloud_" + _local1]._xscale = 100 - (_local1 * 10);
all_m.clouds_2["o_cloud_" + _local1]._yscale = all_m.clouds_2["o_cloud_" + _local1]._xscale;
all_m.clouds_2["o_cloud_" + _local1].gotoAndStop(random(4));
_local1 = _local1 + 1;
}
all_m.clouds_2.o_cloud_2._x = 170;
all_m.clouds_2.o_cloud_2._y = 205;
all_m.clouds_3._x = -320;
_local1 = 0;
while (_local1 < 3) {
all_m.clouds_3.attachMovie("o_cloud", "o_cloud_" + _local1, _local1);
all_m.clouds_3["o_cloud_" + _local1]._x = 255 + (_local1 * 180);
all_m.clouds_3["o_cloud_" + _local1]._y = 75 + (_local1 * 55);
all_m.clouds_3["o_cloud_" + _local1]._xscale = 100 - (_local1 * 7);
all_m.clouds_3["o_cloud_" + _local1]._yscale = clouds_3["o_cloud_" + _local1]._xscale;
all_m.clouds_3["o_cloud_" + _local1].gotoAndStop(random(4));
_local1 = _local1 + 1;
}
all_m.clouds_3.o_cloud_2._x = 140;
all_m.clouds_3.o_cloud_2._y = 275;
all_m.menu_clouds.attachMovie("o_preloader_gr", "o_mountains_5", 5);
all_m.menu_clouds.o_mountains_5.gotoAndStop(3);
all_m.menu_clouds.o_mountains_5._x = 320;
all_m.menu_clouds.o_mountains_5._y = 240;
}
function clouds_move() {
all_m.clouds_1._x = all_m.clouds_1._x + 0.5;
all_m.clouds_2._x = all_m.clouds_2._x + 0.75;
all_m.clouds_3._x = all_m.clouds_3._x + 1;
if (all_m.clouds_1._x > 625) {
all_m.clouds_1._x = -500;
}
if (all_m.clouds_2._x > 640) {
all_m.clouds_2._x = -520;
}
if (all_m.clouds_3._x > 550) {
all_m.clouds_3._x = -500;
}
}
function visible_st(x) {
alarm_0 = alarm_0 + 1;
if (alarm_0 == x) {
all_m.preloader_all.loading1._visible = 1 - all_m.preloader_all.loading1._visible;
alarm_0 = 0;
}
}
function alpha_st(x, y) {
if (x._alpha >= 120) {
a = 1;
} else if (x._alpha <= 0) {
a = 0;
}
if (a == 0) {
x._alpha = x._alpha + y;
} else if (a == 1) {
x._alpha = x._alpha - y;
}
}
function PlaySound(x) {
if (sound_enable == 1) {
x.start();
}
}
function PlayMusic(x) {
if (music_enable == 1) {
pre_music.stop();
x.start(0, 999);
pre_music = x;
}
}
function create_panel() {
all_m.createEmptyMovieClip("panel_mm", all_m.getNextHighestDepth());
all_m.panel_mm.createTextField("credits1", 17, 50, 50, 300, 300);
all_m.panel_mm.credits1.text = "Authors: Nonamez, .\r inspired by Talesworth Adventure";
all_m.panel_mm.credits1.setTextFormat(format_credits);
all_m.panel_mm.credits1.setNewTextFormat(format_credits);
all_m.panel_mm.credits1.embedFonts = true;
all_m.panel_mm.credits1.selectable = false;
all_m.panel_mm.credits1._x = 175;
all_m.panel_mm.credits1._y = 440;
all_m.panel_mm.createTextField("credits2", 18, 50, 50, 300, 300);
all_m.panel_mm.credits2.text = "SilenGames";
all_m.panel_mm.credits2.setTextFormat(format_credits);
all_m.panel_mm.credits2.setNewTextFormat(format_credits);
all_m.panel_mm.credits2.embedFonts = true;
all_m.panel_mm.credits2.selectable = false;
all_m.panel_mm.credits2._x = 233;
all_m.panel_mm.credits2._y = 440;
all_m.panel_mm.attachMovie("o_panel", "o_panel_0", 300);
all_m.panel_mm.o_panel_0._x = 615;
all_m.panel_mm.o_panel_0._y = 15;
all_m.panel_mm.o_panel_0.gotoAndStop(1);
all_m.panel_mm.attachMovie("o_but_music", "o_panel_1", 301);
all_m.panel_mm.o_panel_1._x = all_m.panel_mm.o_panel_0._x - 55;
all_m.panel_mm.o_panel_1._y = all_m.panel_mm.o_panel_0._y - 11;
if (music_enable == 0) {
all_m.panel_mm.o_panel_1.gotoAndStop(3);
all_m.panel_mm.o_panel_1.curr = 3;
} else if (music_enable == 1) {
all_m.panel_mm.o_panel_1.gotoAndStop(1);
all_m.panel_mm.o_panel_1.curr = 1;
}
all_m.panel_mm.attachMovie("o_but_sound", "o_panel_2", 302);
all_m.panel_mm.o_panel_2._x = all_m.panel_mm.o_panel_0._x - 80;
all_m.panel_mm.o_panel_2._y = all_m.panel_mm.o_panel_0._y - 10;
if (sound_enable == 0) {
all_m.panel_mm.o_panel_2.gotoAndStop(3);
all_m.panel_mm.o_panel_2.curr = 3;
} else if (sound_enable == 1) {
all_m.panel_mm.o_panel_2.gotoAndStop(1);
all_m.panel_mm.o_panel_2.curr = 1;
}
}
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
stop();
_root.createEmptyMovieClip("all_m", 1);
all_m = _root.all_m;
_global.sponsorurl = "http://www.MoFunZone.com/";
_global.morepuzzlegames = "http://www.mofunzone.com/online_puzzles_games.shtml";
_global.sponsorachi = "http://www.mofunzone.com/online_games/save_the_princess.shtml";
_global.walkurl = "http://www.mofunzone.com/game_cheats/pc_cheats/save_the_princess_walkthrough.shtml";
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
_root.menu = myMenu;
var myMenuItem1 = new ContextMenuItem("More Games", func_url, true);
myMenu.customItems.push(myMenuItem1);
var s_flourish = new Sound();
s_flourish.attachSound("s_flourish");
var s_click = new Sound();
s_click.attachSound("click_1");
var fl_played = 0;
var achieve_played = 0;
var try_number = 0;
var cur_try = 0;
var sound_enable = 1;
var music_enable = 1;
var tool_after_restart = 0;
var sData_so = SharedObject.getLocal("save_the_princess", "/");
var distance = 0;
var angleInDegrees = 0;
var color = 1465255;
var alpha = 1;
var blurX = 2;
var blurY = 2;
var strength = 5;
var quality = 3;
var inner = false;
var knockout = false;
var hideObject = false;
var format_credits = new TextFormat();
format_credits.font = "Berlin Sans FB 1";
format_credits.color = 9014946 /* 0x898EA2 */;
format_credits.size = 15;
format_credits.bold = false;
format_credits.align = "center";
var go_menuu = 0;
var current_loaded = 0;
var all_loaded = _root.getBytesTotal();
var alarm_0 = 0;
var format_preload = new TextFormat();
format_preload.font = "Luvable";
format_preload.color = 15790320 /* 0xF0F0F0 */;
format_preload.size = 18;
if (sData_so.data.sound_enable != undefined) {
sound_enable = sData_so.data.sound_enable;
}
if (sData_so.data.music_enable != undefined) {
music_enable = sData_so.data.music_enable;
}
var a = 1;
__com_mochibot__("57c39bd4", this, 10301, true);
Instance of Symbol 98 MovieClip [API Connector (NewgroundsAPI)] "ngapiobj" in Frame 1
//component parameters
onClipEvent (construct) {
api_id = "18123:f5gGFXqE";
encryption_key = "m15Q8IiwXhQYBUv9YrLZiZRTB2zSVTgc";
version = "";
fake_session = false;
debug = true;
error_screens = true;
medal_popups = true;
}
Frame 2
function Play_xscale(x, y) {
if ((x._xscale < 100) and (y == 0)) {
x._xscale = x._xscale + 10;
x._yscale = x._xscale;
x._rotation = x._rotation + 45;
} else if ((x._xscale >= 100) and (y == 0)) {
main_menu_xscale = 2;
levels_xscale = 2;
}
}
function rePlay_xscale(x, y, z) {
if ((x._xscale > 0) and (y == 1)) {
x._xscale = x._xscale - 10;
x._yscale = x._xscale;
x._rotation = x._rotation + 45;
} else if ((x._xscale <= 0) and (y == 1)) {
main_menu_xscale = 2;
gotoAndStop(z);
}
}
stop();
all_m.make_black_2.removeMovieClip();
all_m.square_mc_3.removeMovieClip();
all_m.levels_2.removeMovieClip();
all_m.levels.removeMovieClip();
all_m.preloader_all.removeMovieClip();
all_m.menu_clouds.removeMovieClip();
all_m.clouds_1.removeMovieClip();
all_m.clouds_2.removeMovieClip();
all_m.clouds_3.removeMovieClip();
all_m.panel_mm.removeMovieClip();
var main_menu_xscale = 0;
var go_to_level = 0;
var go_to_achieve = 0;
var open_levels = 1;
var return_to_levels = 0;
var stars_count = 0;
var hero_speed = 0;
var stars = new Array();
stars = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var cake_count = 0;
var kong_cake_count = 0;
var purple_count = 0;
var ach_count = 0;
var p_xspeed = 0;
var p_yspeed = 0;
var achiev_array = new Array();
achiev_array = [[0, "Genius", "Pass first level", 1], [0, "Princess lover", "Save 5 princesses", 5], [0, "Maybe enought?", "Save 15 princesses", 15], [0, "Philanderer", "Save 20 princesses", 20], [0, "Lucky number", "Get 7 stars", 7], [0, "Hang on the ceiling", "Get 14 stars", 14], [0, "Stargazer", "Get 21 stars", 21], [0, "Green suits you", "Kiss cursed princess", 1], [0, "Fat prince", "Eat 50 cakes", 50], [0, "Da KING", "Get all achievements", 9]];
if (sData_so.data.hero_speed != undefined) {
hero_speed = sData_so.data.hero_speed;
}
if (hero_speed == 0) {
p_xspeed = 4;
p_yspeed = 3;
} else if (hero_speed == 1) {
p_xspeed = 13;
p_yspeed = 7;
}
if (sData_so.data.achiev_array != undefined) {
achiev_array = sData_so.data.achiev_array;
}
if (sData_so.data.stars != undefined) {
stars = sData_so.data.stars;
}
if (sData_so.data.levels != undefined) {
open_levels = sData_so.data.levels + 1;
}
if (sData_so.data.cake_count != undefined) {
cake_count = sData_so.data.cake_count;
}
if (sData_so.data.kong_cake_count != undefined) {
kong_cake_count = sData_so.data.kong_cake_count;
}
if (sData_so.data.purple_count != undefined) {
purple_count = sData_so.data.purple_count;
}
var cur_level_number = 0;
var starz = new Sound();
starz.attachSound("s_starz");
var s_menu_back = new Sound();
s_menu_back.attachSound("s_menu_back");
var s_click = new Sound();
s_click.attachSound("click_1");
var s_bul = new Sound();
s_bul.attachSound("s_bul");
var magic = new Sound();
magic.attachSound("magic");
var s_bubles = new Sound();
s_bubles.attachSound("s_bubles");
var s_door = new Sound();
s_door.attachSound("s_door");
var s_snowball = new Sound();
s_snowball.attachSound("s_snowball");
var s_teleport = new Sound();
s_teleport.attachSound("s_teleport");
var s_yohoho = new Sound();
s_yohoho.attachSound("s_yohoho");
var s_eat = new Sound();
s_eat.attachSound("s_eat");
var s_flourish = new Sound();
s_flourish.attachSound("s_flourish");
var s_magic_boom = new Sound();
s_magic_boom.attachSound("s_magic_boom");
var s_pain = new Sound();
s_pain.attachSound("s_pain");
var music_back = new Sound();
music_back.attachSound("music_back");
var s_fail = new Sound();
s_fail.attachSound("s_fail");
create_clouds();
all_m.createEmptyMovieClip("main_menu", all_m.getNextHighestDepth());
all_m.main_menu.attachMovie("o_after_level_menu", "o_after_level_menu1", 1);
all_m.main_menu.o_after_level_menu1.gotoAndStop(1);
all_m.main_menu.o_after_level_menu1._xscale = 120;
all_m.main_menu.o_after_level_menu1._yscale = 120;
all_m.main_menu._y = 240;
all_m.main_menu._x = 320;
all_m.main_menu.attachMovie("o_main_menu_logo", "o_after_level_menu2", 2);
all_m.main_menu.o_after_level_menu2._x = 0;
all_m.main_menu.o_after_level_menu2._y = -93;
all_m.main_menu.attachMovie("but_main_menu_start_game", "o_after_level_menu3", 3);
all_m.main_menu.o_after_level_menu3._x = 0;
all_m.main_menu.o_after_level_menu3._y = -10;
all_m.main_menu.attachMovie("but_main_menu_achievements", "o_after_level_menu4", 4);
all_m.main_menu.o_after_level_menu4._x = 0;
all_m.main_menu.o_after_level_menu4._y = 38;
all_m.main_menu.attachMovie("but_main_menu_walkthrough", "o_after_level_menu5", 5);
all_m.main_menu.o_after_level_menu5._x = 0;
all_m.main_menu.o_after_level_menu5._y = 88;
all_m.main_menu.attachMovie("but_main_menu_moregames", "o_after_level_menu6", 6);
all_m.main_menu.o_after_level_menu6._x = 0;
all_m.main_menu.o_after_level_menu6._y = 133;
all_m.main_menu._visible = 0;
all_m.main_menu._rotation = -90;
create_panel();
all_m.createEmptyMovieClip("make_black_2", all_m.getNextHighestDepth());
all_m.make_black_2.aaa = 0;
all_m.make_black_2.beginFill(723723);
all_m.make_black_2.moveTo(0, 0);
all_m.make_black_2.lineTo(640, 0);
all_m.make_black_2.lineTo(640, 480);
all_m.make_black_2.lineTo(0, 480);
all_m.make_black_2.lineTo(0, 0);
all_m.make_black_2.endFill();
all_m.make_black_2._alpha = 0;
all_m.make_black_2._visible = 1;
all_m.createEmptyMovieClip("square_mc_3", all_m.getNextHighestDepth());
all_m.square_mc_3.beginFill(723723);
all_m.square_mc_3.moveTo(0, 0);
all_m.square_mc_3.lineTo(640, 0);
all_m.square_mc_3.lineTo(640, 480);
all_m.square_mc_3.lineTo(0, 480);
all_m.square_mc_3.lineTo(0, 0);
all_m.square_mc_3.endFill();
all_m.square_mc_3._alpha = 80;
all_m.square_mc_3._visible = 1;
all_m.square_mc_3.bbb = 0;
setTimeout(function () {
all_m.main_menu._xscale = 0;
all_m.main_menu._yscale = 0;
PlayMusic(s_menu_back);
}, 1000);
onEnterFrame = function () {
if (all_m.square_mc_3._alpha > 0) {
all_m.square_mc_3._alpha = all_m.square_mc_3._alpha - 15;
}
if ((all_m.square_mc_3._alpha <= 0) and (all_m.square_mc_3.bbb == 0)) {
all_m.square_mc_3.bbb = 1;
}
if (go_to_level == 1) {
if (all_m.make_black_2._alpha < 85) {
all_m.make_black_2._alpha = all_m.make_black_2._alpha + 15;
} else if ((all_m.make_black_2._alpha >= 85) and (all_m.make_black_2.aaa == 0)) {
all_m.make_black_2.aaa = 1;
setTimeout(function () {
all_m.square_mc_3.removeMovieClip();
all_m.make_black_2.removeMovieClip();
all_m.main_menu.removeMovieClip();
gotoAndStop(_currentframe + 1);
}, 200);
}
}
if (go_to_achieve == 1) {
if (all_m.make_black_2._alpha < 85) {
all_m.make_black_2._alpha = all_m.make_black_2._alpha + 15;
} else if ((all_m.make_black_2._alpha >= 85) and (all_m.make_black_2.aaa == 0)) {
all_m.make_black_2.aaa = 1;
setTimeout(function () {
all_m.square_mc_3.removeMovieClip();
all_m.make_black_2.removeMovieClip();
all_m.main_menu.removeMovieClip();
gotoAndStop(_currentframe + 7);
}, 200);
}
}
clouds_move();
setTimeout(function () {
all_m.main_menu._visible = 1;
Play_xscale(all_m.main_menu, main_menu_xscale);
}, 1000);
all_m.main_menu.o_after_level_menu3.onRelease = function () {
go_to_level = 1;
main_menu_xscale = 1;
PlaySound(s_click);
};
all_m.main_menu.o_after_level_menu4.onRelease = function () {
getURL (sponsorachi, "_blank");
PlaySound(s_click);
};
all_m.main_menu.o_after_level_menu5.onRelease = function () {
getURL (walkurl, "_blank");
PlaySound(s_click);
};
all_m.main_menu.o_after_level_menu6.onRelease = function () {
getURL (sponsorurl, "_blank");
PlaySound(s_click);
};
};
all_m.main_menu.o_after_level_menu3.onRollOver = function () {
PlaySound(s_bul);
};
all_m.main_menu.o_after_level_menu4.onRollOver = function () {
PlaySound(s_bul);
};
all_m.main_menu.o_after_level_menu5.onRollOver = function () {
PlaySound(s_bul);
};
all_m.main_menu.o_after_level_menu6.onRollOver = function () {
PlaySound(s_bul);
};
all_m.panel_mm.o_panel_1.onRelease = function () {
if (music_enable == 1) {
music_back.stop();
music_enable = 0;
sData_so.data.music_enable = 0;
sData_so.flush();
all_m.panel_mm.o_panel_1.gotoAndStop(3);
all_m.panel_mm.o_panel_1.curr = 3;
} else if (music_enable == 0) {
music_enable = 1;
sData_so.data.music_enable = 1;
sData_so.flush();
PlayMusic(s_menu_back);
all_m.panel_mm.o_panel_1.gotoAndStop(1);
all_m.panel_mm.o_panel_1.curr = 1;
}
};
all_m.panel_mm.o_panel_2.onRelease = function () {
if (sound_enable == 1) {
sound_enable = 0;
sData_so.data.sound_enable = 0;
sData_so.flush();
all_m.panel_mm.o_panel_2.gotoAndStop(3);
all_m.panel_mm.o_panel_2.curr = 3;
} else if (sound_enable == 0) {
sound_enable = 1;
sData_so.data.sound_enable = 1;
sData_so.flush();
all_m.panel_mm.o_panel_2.gotoAndStop(1);
all_m.panel_mm.o_panel_2.curr = 1;
}
};
all_m.panel_mm.attachMovie("but_sponsor_logo_1", "o_sponsor_logo_1", all_m.panel_mm.getNextHighestDepth());
all_m.panel_mm.o_sponsor_logo_1.gotoAndStop(1);
all_m.panel_mm.o_sponsor_logo_1._x = 75;
all_m.panel_mm.o_sponsor_logo_1._y = 415;
all_m.panel_mm.o_sponsor_logo_1.onRelease = function () {
getURL (sponsorurl, "_blank");
};
Frame 3
function draw_levels() {
all_m.levels.createTextField("t_star1", 2000, 50, 50, 200, 100);
all_m.levels.t_star1.setTextFormat(format_stars);
all_m.levels.t_star1.setNewTextFormat(format_stars);
all_m.levels.t_star1.text = (("stars " + stars_count) + "/") + "21";
all_m.levels.t_star1.selectable = false;
all_m.levels.t_star1.embedFonts = true;
all_m.levels.t_star1.filters = [new flash.filters.DropShadowFilter(distance, angleInDegrees, color, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject)];
all_m.levels.t_star1._x = -42;
all_m.levels.t_star1._y = 95;
all_m.levels.createTextField("t_star2", 2001, 50, 50, 200, 100);
all_m.levels.t_star2.setTextFormat(format_stars);
all_m.levels.t_star2.setNewTextFormat(format_stars);
all_m.levels.t_star2.text = (("levels " + open_levels) + "/") + "21";
all_m.levels.t_star2.selectable = false;
all_m.levels.t_star2.embedFonts = true;
all_m.levels.t_star2.filters = [new flash.filters.DropShadowFilter(distance, angleInDegrees, color, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject)];
all_m.levels.t_star2._x = -42;
all_m.levels.t_star2._y = 115;
}
stop();
all_m.main_menu.removeMovieClip();
all_m.panel_mm.removeMovieClip();
tool_after_restart = 0;
stars_count = 0;
var i = 0;
while (i < 42) {
if (stars[i] == 1) {
stars_count++;
}
i = i + 1;
}
var tools_stand = new Array();
var ii = 0;
while (ii < 12) {
var jj = 0;
while (jj < 12) {
tools_stand[(ii * 12) + jj] = 10;
jj = jj + 1;
}
ii = ii + 1;
}
var lvlArray = new Array();
lvlArray = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 6, 11, 1, 2, 1, 2, 1, 2, 1, 2, 1, 11, 2, 12, 26, 13, 13, 179, 13, 13, 181, 1, 5, 1, 1, 7, 1, 13, 4, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 13, 13, 13, 13, 1, 2, 12, 2, 1, 1, 2, 1, 2, 1, 3, 13, 2, 12, 2, 1, 2, 100, 13, 13, 180, 13, 13, 13, 1, 2, 1, 11, 1, 1, 2, 1, 2, 1, 2, 1, 2, 4, 11, 27, 2, 26, 1, 5, 12, 2, 12, 2, 6, 7, 1, 2, 1, 1, 2, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 26, 1, 11, 1, 11, 1, 2, 1, 5, 27, 2, 2, 1, 5, 1, 2, 27, 11, 8, 11, 1, 11, 12, 100, 13, 13, 180, 13, 13, 13, 183, 1, 2, 12, 2, 2, 1, 7, 1, 12, 13, 2, 1, 2, 6, 2, 1, 1, 2, 1, 3, 1, 28, 12, 2, 1, 2, 1, 2, 2, 27, 2, 1, 2, 13, 13, 179, 13, 181, 2, 1, 4, 11, 12, 2, 1, 2, 10, 2, 1, 2, 26, 2, 2, 1, 26, 12, 2, 12, 3, 1, 2, 12, 11, 1, 1, 2, 1, 2, 1, 2, 1, 7, 1, 2, 1, 2], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 36, 30, 33, 41, 29, 32, 33, 30, 29, 30, 40, 35, 30, 31, 30, 29, 32, 29, 13, 13, 13, 181, 30, 29, 29, 30, 29, 30, 29, 30, 179, 30, 29, 30, 29, 30, 100, 13, 13, 13, 13, 28, 13, 13, 13, 29, 30, 40, 29, 30, 29, 38, 29, 30, 29, 35, 13, 30, 33, 30, 30, 40, 30, 29, 180, 29, 32, 36, 13, 29, 39, 33, 29, 30, 31, 30, 13, 13, 13, 13, 13, 30, 33, 30, 30, 40, 30, 33, 30, 29, 35, 29, 30, 40, 32, 29, 29, 30, 29, 30, 29, 41, 29, 30, 33, 30, 29, 30], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 29, 39, 33, 30, 29, 30, 29, 30, 29, 30, 29, 30, 30, 33, 39, 40, 13, 13, 180, 13, 20, 13, 13, 100, 40, 35, 33, 30, 13, 9, 9, 9, 13, 35, 29, 30, 32, 29, 30, 29, 179, 9, 9, 9, 13, 29, 32, 29, 29, 30, 29, 35, 13, 9, 9, 9, 13, 30, 29, 30, 30, 181, 28, 13, 14, 13, 13, 13, 13, 29, 30, 29, 29, 30, 29, 30, 29, 30, 36, 30, 29, 30, 33, 39, 39, 29, 37, 29, 39, 29, 30, 29, 35, 31, 39, 29, 29, 30, 29, 30, 33, 39, 29, 30, 29, 30, 29, 30], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 1, 2, 12, 2, 12, 2, 27, 2, 1, 12, 2, 1, 2, 12, 2, 27, 2, 12, 2, 12, 2, 26, 100, 2, 3, 2, 13, 179, 13, 13, 12, 2, 27, 1, 13, 1, 5, 1, 13, 9, 9, 13, 2, 27, 2, 7, 13, 28, 13, 13, 17, 9, 9, 13, 12, 2, 27, 1, 2, 3, 13, 8, 13, 9, 9, 13, 2, 12, 2, 2, 12, 2, 13, 2, 13, 180, 13, 13, 27, 2, 27, 27, 2, 27, 13, 1, 2, 1, 2, 1, 2, 12, 2, 2, 12, 2, 13, 13, 181, 2, 27, 2, 12, 2, 27, 1, 2, 1, 2, 1, 2, 12, 2, 12, 2, 27, 2], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 27, 11, 27, 2, 1, 1, 1, 1, 1, 2, 100, 20, 183, 1, 1, 26, 1, 1, 11, 2, 1, 1, 1, 13, 1, 2, 26, 1, 1, 2, 1, 27, 1, 11, 2, 13, 13, 13, 183, 6, 181, 13, 13, 2, 1, 1, 12, 183, 3, 13, 1, 2, 1, 1, 13, 1, 1, 11, 2, 1, 2, 13, 179, 13, 183, 26, 15, 13, 180, 1, 1, 2, 1, 183, 5, 13, 1, 2, 13, 3, 1, 27, 2, 1, 2, 1, 26, 13, 13, 13, 19, 183, 2, 1, 12, 26, 12, 2, 1, 183, 10, 2, 13, 2, 12, 2, 2, 1, 2, 1, 11, 1, 2, 1, 2, 1, 2, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, 29, 30, 32, 30, 29, 30, 29, 30, 29, 30, 35, 29, 30, 33, 32, 29, 13, 179, 41, 29, 32, 29, 33, 30, 36, 30, 13, 13, 17, 30, 29, 32, 40, 30, 39, 33, 30, 29, 13, 29, 13, 29, 35, 29, 30, 29, 29, 39, 40, 30, 13, 37, 15, 13, 13, 13, 13, 30, 30, 29, 30, 29, 13, 29, 13, 29, 30, 29, 180, 29, 100, 13, 13, 30, 21, 13, 16, 13, 181, 30, 29, 30, 30, 29, 13, 29, 13, 29, 30, 29, 30, 29, 37, 33, 33, 30, 13, 13, 13, 30, 29, 39, 36, 30, 40, 32, 35, 40, 41, 29, 30, 29, 39, 29, 30, 33, 39, 29], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 29, 39, 33, 30, 29, 100, 29, 30, 40, 39, 29, 30, 39, 29, 35, 29, 39, 13, 37, 29, 30, 29, 30, 29, 29, 30, 29, 30, 29, 13, 29, 39, 29, 30, 40, 30, 30, 181, 28, 107, 13, 17, 30, 29, 32, 33, 30, 29, 29, 30, 29, 30, 29, 13, 29, 108, 13, 179, 29, 30, 30, 29, 30, 29, 39, 13, 35, 29, 30, 13, 30, 33, 29, 39, 32, 30, 29, 13, 13, 180, 13, 19, 29, 30, 39, 33, 30, 40, 30, 29, 30, 30, 30, 30, 29, 30, 29, 30, 29, 30, 36, 30, 39, 29, 30, 29, 30, 29], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 29, 32, 33, 30, 29, 30, 31, 30, 29, 100, 29, 30, 37, 29, 39, 29, 30, 33, 30, 29, 35, 13, 32, 29, 29, 13, 113, 115, 18, 13, 116, 20, 13, 16, 13, 30, 30, 13, 30, 29, 13, 36, 30, 13, 30, 29, 114, 29, 29, 181, 29, 30, 13, 30, 33, 179, 33, 30, 13, 30, 32, 29, 30, 36, 13, 33, 39, 13, 30, 40, 180, 29, 31, 39, 29, 30, 13, 30, 31, 15, 13, 116, 13, 30, 30, 33, 114, 13, 14, 116, 13, 13, 30, 38, 30, 33, 29, 30, 29, 35, 29, 30, 29, 30, 29, 30, 40, 30], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 11, 2, 1, 100, 1, 2, 11, 27, 1, 2, 2, 27, 11, 1, 1, 15, 13, 13, 1, 1, 154, 1, 4, 11, 1, 13, 13, 17, 8, 179, 10, 2, 13, 2, 2, 1, 3, 13, 2, 13, 10, 13, 1, 1, 13, 1, 10, 2, 1, 15, 13, 16, 1, 13, 181, 13, 13, 10, 2, 1, 1, 13, 1, 1, 4, 1, 2, 7, 2, 1, 11, 152, 13, 13, 1, 2, 1, 2, 1, 2, 27, 2, 1, 1, 2, 1, 1, 154, 13, 180, 13, 152, 3, 11, 1, 27, 11, 2, 6, 2, 1, 2, 1, 2, 1, 2], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 11, 1, 2, 1, 2, 1, 26, 1, 2, 1, 1, 27, 1, 11, 1, 100, 27, 2, 1, 11, 1, 11, 11, 1, 26, 13, 13, 14, 13, 13, 11, 1, 26, 1, 1, 11, 1, 13, 1, 2, 1, 13, 1, 11, 1, 11, 26, 1, 11, 13, 13, 156, 13, 13, 26, 1, 27, 1, 1, 27, 1, 2, 10, 2, 1, 2, 1, 11, 1, 11, 11, 1, 26, 13, 13, 156, 180, 13, 11, 1, 26, 1, 1, 11, 1, 183, 1, 2, 1, 13, 1, 11, 1, 11, 11, 1, 11, 13, 13, 181, 13, 179, 11, 1, 11, 1, 1, 26, 1, 2, 8, 2, 1, 2, 1, 27, 1, 11], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 29, 39, 33, 30, 29, 32, 29, 30, 29, 30, 29, 39, 32, 40, 30, 36, 32, 29, 181, 13, 13, 13, 32, 29, 29, 13, 180, 13, 29, 37, 29, 35, 29, 13, 33, 41, 30, 13, 35, 15, 13, 13, 30, 13, 183, 13, 30, 29, 100, 17, 29, 13, 29, 21, 102, 17, 29, 101, 39, 30, 30, 13, 41, 13, 34, 13, 30, 13, 37, 13, 30, 33, 29, 13, 20, 13, 29, 13, 179, 13, 29, 154, 29, 39, 32, 29, 154, 29, 30, 29, 30, 29, 39, 29, 32, 29, 29, 39, 29, 32, 40, 30, 38, 32, 29, 41, 29, 30], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 11, 27, 2, 1, 11, 1, 2, 1, 2, 1, 1, 9, 9, 9, 9, 26, 12, 2, 1, 2, 27, 2, 11, 9, 9, 9, 9, 2, 1, 13, 179, 104, 2, 12, 27, 2, 8, 2, 12, 104, 1, 13, 1, 2, 1, 2, 104, 20, 13, 13, 2, 13, 7, 21, 13, 18, 13, 181, 1, 13, 10, 15, 13, 13, 1, 13, 10, 13, 1, 2, 2, 102, 2, 13, 2, 10, 2, 13, 2, 180, 2, 1, 183, 16, 18, 14, 103, 13, 13, 16, 101, 19, 12, 2, 2, 2, 100, 1, 2, 1, 2, 1, 2, 183, 2, 27, 1, 2, 1, 2, 8, 2, 27, 2, 12, 2, 1, 2], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 33, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 33, 13, 13, 20, 13, 20, 13, 20, 13, 13, 40, 30, 30, 13, 30, 13, 30, 13, 30, 13, 35, 13, 39, 40, 29, 13, 33, 179, 29, 13, 29, 13, 29, 13, 36, 30, 100, 17, 35, 13, 30, 13, 39, 180, 30, 15, 182, 29, 36, 13, 29, 13, 40, 183, 29, 13, 29, 13, 29, 30, 30, 13, 30, 181, 30, 13, 30, 13, 30, 13, 35, 29, 29, 13, 13, 14, 13, 16, 13, 14, 13, 13, 29, 30, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 33, 33, 30, 33, 30, 38, 30, 40, 30, 29, 30, 40, 30], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, 29, 30, 29, 30, 29, 30, 29, 32, 29, 30, 30, 100, 184, 13, 20, 13, 18, 13, 13, 185, 30, 29, 29, 37, 29, 30, 13, 35, 13, 30, 184, 30, 33, 30, 39, 29, 32, 40, 13, 13, 13, 29, 15, 13, 13, 40, 29, 181, 13, 32, 29, 30, 29, 32, 13, 37, 179, 30, 30, 29, 13, 29, 13, 180, 13, 40, 21, 13, 13, 40, 33, 41, 13, 30, 13, 36, 13, 30, 13, 30, 29, 41, 39, 185, 13, 13, 16, 13, 14, 184, 13, 29, 32, 29, 29, 30, 29, 30, 29, 30, 29, 30, 185, 30, 40, 39, 30, 29, 39, 29, 39, 31, 41, 29, 30, 33, 30, 29], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 29, 39, 29, 156, 29, 30, 29, 30, 29, 30, 29, 40, 35, 40, 30, 14, 180, 184, 18, 105, 13, 13, 185, 30, 29, 30, 33, 30, 29, 30, 13, 30, 29, 13, 29, 33, 156, 13, 13, 40, 106, 29, 13, 13, 35, 154, 30, 30, 29, 35, 13, 30, 13, 37, 29, 30, 29, 30, 40, 29, 30, 13, 16, 18, 14, 13, 30, 29, 30, 33, 30, 30, 154, 17, 29, 13, 29, 15, 13, 18, 105, 105, 29, 40, 30, 13, 13, 13, 13, 13, 30, 13, 30, 181, 30, 30, 33, 30, 29, 100, 36, 30, 40, 13, 179, 13, 33, 40, 30, 40, 30, 29, 30, 33, 30, 29, 30, 40, 30], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 13, 13, 13, 1, 26, 12, 182, 13, 13, 1, 2, 2, 13, 2, 27, 2, 12, 2, 13, 3, 180, 2, 12, 100, 102, 13, 13, 107, 20, 101, 13, 13, 13, 12, 26, 2, 13, 9, 13, 9, 13, 9, 101, 2, 1, 2, 12, 27, 13, 9, 108, 9, 13, 9, 179, 12, 2, 1, 2, 12, 13, 9, 13, 13, 17, 9, 21, 13, 13, 181, 1, 27, 13, 9, 9, 9, 13, 9, 13, 1, 2, 1, 26, 2, 13, 13, 13, 13, 14, 13, 13, 2, 26, 12, 1, 12, 26, 2, 8, 2, 1, 7, 1, 27, 1, 2, 12], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 12, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 11, 27, 13, 108, 13, 2, 13, 158, 13, 11, 1, 11, 27, 11, 13, 1, 13, 11, 104, 2, 180, 13, 154, 1, 11, 1, 14, 18, 13, 2, 1, 2, 1, 2, 1, 2, 1, 179, 2, 13, 2, 27, 13, 156, 13, 27, 13, 100, 1, 13, 156, 13, 11, 11, 13, 2, 13, 3, 13, 2, 2, 4, 2, 1, 2, 1, 13, 20, 16, 18, 13, 1, 11, 154, 13, 107, 103, 2, 1, 107, 1, 13, 1, 27, 27, 1, 2, 1, 13, 181, 2, 13, 158, 13, 11, 11, 5, 11, 1, 11, 1, 2, 11, 2, 1, 6, 27, 2], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 12, 1, 2, 12, 2, 1, 27, 1, 2, 1, 1, 13, 13, 18, 13, 13, 13, 18, 105, 107, 13, 2, 27, 13, 1, 13, 2, 1, 2, 13, 2, 1, 13, 1, 1, 13, 13, 13, 1, 27, 1, 13, 1, 104, 180, 2, 11, 108, 2, 13, 12, 7, 12, 13, 2, 1, 2, 27, 1, 13, 13, 19, 1, 183, 18, 16, 13, 20, 183, 2, 2, 105, 183, 103, 2, 1, 13, 8, 2, 13, 2, 1, 1, 2, 1, 13, 1, 2, 106, 2, 1, 100, 1, 12, 181, 13, 13, 16, 13, 179, 2, 12, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 27, 2, 12, 2], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 100, 2, 12, 26, 11, 2, 27, 11, 1, 2, 1, 27, 21, 13, 114, 18, 114, 18, 13, 113, 13, 181, 2, 2, 13, 3, 1, 13, 1, 107, 1, 2, 1, 2, 12, 183, 14, 13, 13, 17, 2, 13, 2, 12, 2, 27, 26, 2, 1, 2, 1, 15, 179, 13, 13, 13, 183, 2, 12, 1, 180, 107, 20, 13, 2, 13, 2, 1, 2, 1, 2, 26, 1, 2, 13, 2, 1, 15, 13, 108, 1, 2, 12, 12, 26, 1, 15, 13, 13, 13, 2, 1, 2, 12, 26, 2, 12, 11, 183, 2, 1, 2, 1, 2, 12, 26, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 100, 2, 1, 2, 1, 2, 1, 11, 27, 181, 179, 13, 14, 13, 13, 13, 13, 13, 13, 13, 26, 2, 1, 2, 1, 11, 1, 2, 4, 2, 1, 13, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 2, 13, 2, 2, 13, 2, 1, 7, 27, 2, 1, 13, 1, 13, 1, 27, 13, 1, 180, 1, 11, 27, 2, 13, 5, 13, 2, 7, 13, 3, 13, 13, 13, 13, 13, 13, 1, 13, 1, 1, 13, 1, 5, 1, 2, 1, 2, 1, 3, 13, 2, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 27, 1, 26, 1, 2, 1, 2, 6, 2, 1, 2, 12, 2]];
var tools_array = new Array();
tools_array = [[0, 0, 1], [0, 1, 0], [1, 0, 2], [0, 1, 2], [2, 0, 1], [0, 7, 0], [2, 1, 2], [0, 1, 2], [1, 2, 2], [1, 1, 0], [0, 1, 1], [1, 2, 2], [0, 4, 1], [2, 1, 2], [0, 3, 2], [1, 5, 2], [0, 3, 1], [1, 3, 0], [1, 4, 1], [1, 5, 0], [0, 43, 1]];
var hints_array = new Array();
hints_array = [[319, 219, "Welcome to \"Save the princess\".\r Wicked witch cursed all the\r princesses. You must save them!"], [151, 255, "The Prince can walk only along\r the road. He will move forward\r until he reached the end of it."], [366, 241, "If he reaches the end of the\r road, he will turn left or right,\r or turn back."], [207, 235, "To ruin the curse, prince must\r take the potion, and give it to\r the princess."], [315, 71, "Try to get the star on each level\r but it isn't necessary. \rNow click 'GO' or press SPACE\r to start moving."], [418, 132, "Avoid spikes.\r If the Prince touches them\r he will die."], [312, 201, "Click pink icon or press 2 to choose\r cake, and then click on the\r marked piece of the road."], [312, 201, "If the Prince sees the cake,\r he will turn to it.\r Now press 'GO'."], [315, 160, "Also you have One-way block.\r It will block up the way after \r the Prince step on it."], [315, 160, "Now click purple icon or press 1\rto choose it and then place it\r on the road."], [261, 244, "If Prince has two available \rdirections, he will turn\r in the direction of the arrow.\r Every intersection has an arrow."], [156, 244, "Place a cake to help the Prince\r make a right choice.\r Press arrow button on panel \rto increase/decrease speed."], [517, 372, "You always have a limited\r number of cakes and blocks.\r Try to pass this level\r using two blocks."], [158, 164, "Place the first block here,\r and try to understand where\r the second one must be placed."], [158, 164, "To remove block or cake just click\r on it again. To return the Prince\r on the start press GO or SPACE\r again. "], [340, 217, "Now try to pass this level\r using only cakes."], [422, 221, "Prince must press red button to \rremove the door of the \rcorresponding color. After that \rprince will be able to see the cake."], [157, 158, "Now place a cake and press GO."], [184, 139, "Let's see how you will cope\r with two colors of doors.\rNow, no hints."], [124, 256, "Well done. Here you can see few\rteleports. Enter one of them \rand look what will happen next."], [315, 164, "Upon exiting the teleport the\r prince will continue to move\r in the same direction as he was\r moving before he had entered it."], [516, 140, "Be careful, avoid the pirate. \rHe moves along the road as the\r Prince and can also press \rthe buttons and one-way blocks."], [156, 62, "This button is a magic trap. \rAfter the prince will push her,\r snowball will fly in his side.\r Avoid snowballs."]];
if (return_to_levels == 1) {
create_clouds();
PlayMusic(s_menu_back);
return_to_levels = 0;
}
all_m.createEmptyMovieClip("levels", all_m.getNextHighestDepth());
all_m.createEmptyMovieClip("levels_2", all_m.getNextHighestDepth());
create_panel();
all_m.createEmptyMovieClip("make_black_2", all_m.getNextHighestDepth());
var format_stars = new TextFormat();
format_stars.font = "Luvable";
format_stars.color = 7715025 /* 0x75B8D1 */;
format_stars.size = 18;
var distance = 0;
var angleInDegrees = 0;
var color = 15463162;
var alpha = 1;
var blurX = 2;
var blurY = 2;
var strength = 5;
var quality = 3;
var inner = false;
var knockout = false;
var hideObject = false;
if (open_levels > 21) {
open_levels = 21;
}
draw_levels();
var level_depth = 0;
var tool_a1 = 0;
var tool_a2 = 0;
var back_a = 0;
var type_page = 0;
var lvlArray1 = new Array();
var been_restart = 0;
var go_level = 0;
var levels_done = 0;
var sizee = 7;
var format = new TextFormat();
all_m.levels.attachMovie("but_level_main_menu", "o_after_level_menu1", 1);
all_m.levels.o_after_level_menu1._x = 260;
all_m.levels.o_after_level_menu1._y = -80;
all_m.levels.attachMovie("but_level_walk", "o_after_level_menu2", 2);
all_m.levels.o_after_level_menu2._x = 275;
all_m.levels.o_after_level_menu2._y = -20;
all_m.levels.attachMovie("but_level_ach", "o_after_level_menu3", 3);
all_m.levels.o_after_level_menu3._x = 275;
all_m.levels.o_after_level_menu3._y = 37;
all_m.levels.attachMovie("but_level_more", "o_after_level_menu4", 4);
all_m.levels.o_after_level_menu4._x = 269;
all_m.levels.o_after_level_menu4._y = 94;
all_m.levels.attachMovie("o_after_level_menu", "o_after_level_menu11", 11);
all_m.levels.o_after_level_menu11.gotoAndStop(1);
all_m.levels.o_after_level_menu11._rotation = -270;
all_m.levels.o_after_level_menu11._xscale = 130;
all_m.levels.o_after_level_menu11._yscale = 130;
all_m.levels.attachMovie("o_main_menu_logo", "o_after_level_menu12", 12);
all_m.levels.o_after_level_menu12.gotoAndStop(2);
all_m.levels.o_after_level_menu12._x = 5;
all_m.levels.o_after_level_menu12._y = -123;
all_m.levels.attachMovie("o_main_menu_logo", "o_after_level_menu13", 13);
all_m.levels.o_after_level_menu13.gotoAndStop(3);
all_m.levels.o_after_level_menu13._x = 65;
all_m.levels.o_after_level_menu13._y = 120;
all_m.levels.o_after_level_menu13._xscale = 90;
all_m.levels.o_after_level_menu13._yscale = 90;
all_m.levels.o_after_level_menu13._visible = false;
all_m.levels.o_after_level_menu13.onRollOver = function () {
all_m.levels.o_after_level_menu13._xscale = 100;
all_m.levels.o_after_level_menu13._yscale = 100;
};
all_m.levels.o_after_level_menu13.onRollOut = function () {
all_m.levels.o_after_level_menu13._xscale = 90;
all_m.levels.o_after_level_menu13._yscale = 90;
};
all_m.levels.o_after_level_menu1.onRollOver = function () {
PlaySound(s_bul);
};
all_m.levels.o_after_level_menu2.onRollOver = function () {
PlaySound(s_bul);
};
all_m.levels.o_after_level_menu3.onRollOver = function () {
PlaySound(s_bul);
};
all_m.levels.o_after_level_menu4.onRollOver = function () {
PlaySound(s_bul);
};
all_m.levels.o_after_level_menu2.onRelease = function () {
getURL (walkurl, "_blank");
PlaySound(s_click);
};
all_m.levels.o_after_level_menu4.onRelease = function () {
getURL (sponsorurl, "_blank");
PlaySound(s_click);
};
all_m.levels.o_after_level_menu13.onRelease = function () {
PlaySound(s_click);
if (type_page == 0) {
level_depth = all_m.levels_2.getDepth();
levels_done = 0;
type_page = 1;
all_m.levels.o_after_level_menu13.gotoAndStop(4);
all_m.levels_2.removeMovieClip();
all_m.createEmptyMovieClip("levels_2", level_depth);
all_m.levels_2._x = all_m.levels._x + 8;
all_m.levels_2._y = all_m.levels._y - 200;
if (((all_m.levels._visible == 1) and (all_m.levels._xscale >= 100)) and (levels_done == 0)) {
var _local2 = 3;
while (_local2 < 6) {
var _local1 = 1;
while (_local1 <= 7) {
all_m.levels_2.attachMovie("o_level", ("o_level" + (_local2 * sizee)) + _local1, (5 + (_local2 * sizee)) + _local1);
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1]._x = -203 + (_local1 * 50);
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1]._y = -50 + (_local2 * 60);
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1]._alpha = -((((_local2 * sizee) + _local1) - 21) * 4);
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1].i = _local2;
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1].j = _local1;
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1].gotoAndStop(2);
if (((_local2 * sizee) + _local1) <= open_levels) {
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1].gotoAndStop(1);
all_m.levels_2.createTextField(("t_level" + (_local2 * sizee)) + _local1, (1000 + (_local2 * sizee)) + _local1, 50, 50, 200, 100);
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1].setTextFormat(format);
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1].setNewTextFormat(format);
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1].text = (_local2 * sizee) + _local1;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1].selectable = false;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1].embedFonts = true;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._x = (-203 + (_local1 * 50)) - 14;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._y = (-50 + (_local2 * 60)) - 15;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._alpha = -((((_local2 * sizee) + _local1) - 21) * 4);
}
_local1 = _local1 + 1;
}
_local2 = _local2 + 1;
}
levels_done = 1;
}
} else if (type_page == 1) {
level_depth = all_m.levels_2.getDepth();
type_page = 0;
all_m.levels.o_after_level_menu13.gotoAndStop(3);
levels_done = 0;
all_m.levels_2.removeMovieClip();
all_m.createEmptyMovieClip("levels_2", level_depth);
all_m.levels_2._x = all_m.levels._x + 8;
all_m.levels_2._y = all_m.levels._y - 20;
if (((all_m.levels._visible == 1) and (all_m.levels._xscale >= 100)) and (levels_done == 0)) {
var _local2 = 0;
while (_local2 < 3) {
var _local1 = 1;
while (_local1 <= 7) {
all_m.levels_2.attachMovie("o_level", ("o_level" + (_local2 * sizee)) + _local1, (5 + (_local2 * sizee)) + _local1);
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1]._x = -203 + (_local1 * 50);
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1]._y = -50 + (_local2 * 60);
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1]._alpha = -(((_local2 * sizee) + _local1) * 4);
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1].i = _local2;
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1].j = _local1;
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1].gotoAndStop(2);
if (((_local2 * sizee) + _local1) <= open_levels) {
all_m.levels_2[("o_level" + (_local2 * sizee)) + _local1].gotoAndStop(1);
all_m.levels_2.createTextField(("t_level" + (_local2 * sizee)) + _local1, (1000 + (_local2 * sizee)) + _local1, 50, 50, 200, 100);
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1].setTextFormat(format);
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1].setNewTextFormat(format);
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1].text = (_local2 * sizee) + _local1;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1].selectable = false;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1].embedFonts = true;
if (((_local2 * sizee) + _local1) == 1) {
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._x = (-203 + (_local1 * 50)) - 5;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._y = (-50 + (_local2 * 60)) - 15;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._alpha = -(((_local2 * sizee) + _local1) * 4);
} else if ((((_local2 * sizee) + _local1) > 1) and (((_local2 * sizee) + _local1) < 10)) {
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._x = (-203 + (_local1 * 50)) - 9;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._y = (-50 + (_local2 * 60)) - 15;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._alpha = -(((_local2 * sizee) + _local1) * 4);
} else if (((((_local2 * sizee) + _local1) >= 10) and (((_local2 * sizee) + _local1) != 11)) and (((_local2 * sizee) + _local1) != 20)) {
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._x = (-203 + (_local1 * 50)) - 12;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._y = (-50 + (_local2 * 60)) - 15;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._alpha = -(((_local2 * sizee) + _local1) * 4);
} else if (((_local2 * sizee) + _local1) == 11) {
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._x = (-203 + (_local1 * 50)) - 8;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._y = (-50 + (_local2 * 60)) - 15;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._alpha = -(((_local2 * sizee) + _local1) * 4);
} else if (((_local2 * sizee) + _local1) == 20) {
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._x = (-203 + (_local1 * 50)) - 16;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._y = (-50 + (_local2 * 60)) - 15;
all_m.levels_2[("t_level" + (_local2 * sizee)) + _local1]._alpha = -(((_local2 * sizee) + _local1) * 4);
}
}
_local1 = _local1 + 1;
}
_local2 = _local2 + 1;
}
levels_done = 1;
}
}
};
all_m.levels._y = 220;
all_m.levels._x = 280;
all_m.levels._visible = 1;
all_m.levels_2._x = all_m.levels._x + 8;
all_m.levels_2._y = all_m.levels._y - 20;
all_m.make_black_2.aaa = 0;
all_m.make_black_2.beginFill(723723);
all_m.make_black_2.moveTo(0, 0);
all_m.make_black_2.lineTo(640, 0);
all_m.make_black_2.lineTo(640, 480);
all_m.make_black_2.lineTo(0, 480);
all_m.make_black_2.lineTo(0, 0);
all_m.make_black_2.endFill();
all_m.make_black_2._alpha = 0;
all_m.make_black_2._visible = 1;
all_m.createEmptyMovieClip("square_mc_3", all_m.getNextHighestDepth());
all_m.square_mc_3.beginFill(723723);
all_m.square_mc_3.moveTo(0, 0);
all_m.square_mc_3.lineTo(640, 0);
all_m.square_mc_3.lineTo(640, 480);
all_m.square_mc_3.lineTo(0, 480);
all_m.square_mc_3.lineTo(0, 0);
all_m.square_mc_3.endFill();
all_m.square_mc_3._alpha = 80;
all_m.square_mc_3._visible = 1;
all_m.square_mc_3.bbb = 0;
format.font = "Luvable";
format.color = 16777215 /* 0xFFFFFF */;
format.size = 25;
all_m.levels.o_after_level_menu1.onRelease = function () {
PlaySound(s_click);
go_level = 2;
};
all_m.levels.o_after_level_menu3.onRelease = function () {
PlaySound(s_click);
getURL (sponsorachi, "_blank");
};
onEnterFrame = function () {
if (all_m.square_mc_3._alpha > 0) {
all_m.square_mc_3._alpha = all_m.square_mc_3._alpha - 15;
}
if ((all_m.square_mc_3._alpha <= 0) and (all_m.square_mc_3.bbb == 0)) {
all_m.square_mc_3.bbb = 1;
}
clouds_move();
if (go_level == 1) {
if (all_m.make_black_2._alpha < 85) {
all_m.make_black_2._alpha = all_m.make_black_2._alpha + 15;
} else if ((all_m.make_black_2._alpha >= 85) and (all_m.make_black_2.aaa == 0)) {
all_m.make_black_2.aaa = 1;
setTimeout(function () {
all_m.square_mc_3.removeMovieClip();
all_m.make_black_2.removeMovieClip();
gotoAndStop(_currentframe + 1);
}, 200);
}
} else if (go_level == 2) {
if (all_m.make_black_2._alpha < 85) {
all_m.make_black_2._alpha = all_m.make_black_2._alpha + 15;
} else if ((all_m.make_black_2._alpha >= 85) and (all_m.make_black_2.aaa == 0)) {
all_m.make_black_2.aaa = 1;
setTimeout(function () {
all_m.make_black_2.removeMovieClip();
all_m.square_mc_3.removeMovieClip();
all_m.levels_2.removeMovieClip();
all_m.levels.removeMovieClip();
all_m.menu_clouds.removeMovieClip();
all_m.clouds_1.removeMovieClip();
all_m.clouds_2.removeMovieClip();
all_m.clouds_3.removeMovieClip();
gotoAndStop(_root._currentframe - 1);
}, 200);
}
} else if (go_level == 3) {
if (all_m.make_black_2._alpha < 85) {
all_m.make_black_2._alpha = all_m.make_black_2._alpha + 15;
} else if ((all_m.make_black_2._alpha >= 85) and (all_m.make_black_2.aaa == 0)) {
all_m.make_black_2.aaa = 1;
setTimeout(function () {
all_m.make_black_2.removeMovieClip();
all_m.square_mc_3.removeMovieClip();
all_m.levels_2.removeMovieClip();
all_m.levels.removeMovieClip();
all_m.clouds_1.removeMovieClip();
gotoAndStop(_currentframe + 6);
}, 200);
}
}
if (((all_m.levels._visible == 1) and (all_m.levels._xscale >= 100)) and (levels_done == 0)) {
var _local3 = 0;
while (_local3 < 3) {
var _local2 = 1;
while (_local2 <= 7) {
all_m.levels_2.attachMovie("o_level", ("o_level" + (_local3 * sizee)) + _local2, (5 + (_local3 * sizee)) + _local2);
all_m.levels_2[("o_level" + (_local3 * sizee)) + _local2]._x = -203 + (_local2 * 50);
all_m.levels_2[("o_level" + (_local3 * sizee)) + _local2]._y = -50 + (_local3 * 60);
all_m.levels_2[("o_level" + (_local3 * sizee)) + _local2]._alpha = -(((_local3 * sizee) + _local2) * 4);
all_m.levels_2[("o_level" + (_local3 * sizee)) + _local2].i = _local3;
all_m.levels_2[("o_level" + (_local3 * sizee)) + _local2].j = _local2;
all_m.levels_2[("o_level" + (_local3 * sizee)) + _local2].gotoAndStop(2);
if (((_local3 * sizee) + _local2) <= open_levels) {
all_m.levels_2[("o_level" + (_local3 * sizee)) + _local2].gotoAndStop(1);
all_m.levels_2.createTextField(("t_level" + (_local3 * sizee)) + _local2, (1000 + (_local3 * sizee)) + _local2, 50, 50, 200, 100);
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2].setTextFormat(format);
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2].setNewTextFormat(format);
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2].text = (_local3 * sizee) + _local2;
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2].selectable = false;
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2].embedFonts = true;
if (((_local3 * sizee) + _local2) == 1) {
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._x = (-203 + (_local2 * 50)) - 5;
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._y = (-50 + (_local3 * 60)) - 15;
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._alpha = -(((_local3 * sizee) + _local2) * 4);
} else if ((((_local3 * sizee) + _local2) > 1) and (((_local3 * sizee) + _local2) < 10)) {
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._x = (-203 + (_local2 * 50)) - 9;
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._y = (-50 + (_local3 * 60)) - 15;
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._alpha = -(((_local3 * sizee) + _local2) * 4);
} else if (((((_local3 * sizee) + _local2) >= 10) and (((_local3 * sizee) + _local2) != 11)) and (((_local3 * sizee) + _local2) != 20)) {
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._x = (-203 + (_local2 * 50)) - 12;
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._y = (-50 + (_local3 * 60)) - 15;
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._alpha = -(((_local3 * sizee) + _local2) * 4);
} else if (((_local3 * sizee) + _local2) == 11) {
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._x = (-203 + (_local2 * 50)) - 8;
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._y = (-50 + (_local3 * 60)) - 15;
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._alpha = -(((_local3 * sizee) + _local2) * 4);
} else if (((_local3 * sizee) + _local2) == 20) {
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._x = (-203 + (_local2 * 50)) - 16;
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._y = (-50 + (_local3 * 60)) - 15;
all_m.levels_2[("t_level" + (_local3 * sizee)) + _local2]._alpha = -(((_local3 * sizee) + _local2) * 4);
}
}
_local2 = _local2 + 1;
}
_local3 = _local3 + 1;
}
levels_done = 1;
}
};
all_m.panel_mm.o_panel_1.onRelease = function () {
if (music_enable == 1) {
music_back.stop();
music_enable = 0;
sData_so.data.music_enable = 0;
sData_so.flush();
all_m.panel_mm.o_panel_1.gotoAndStop(3);
all_m.panel_mm.o_panel_1.curr = 3;
} else if (music_enable == 0) {
music_enable = 1;
sData_so.data.music_enable = 1;
sData_so.flush();
PlayMusic(s_menu_back);
all_m.panel_mm.o_panel_1.gotoAndStop(1);
all_m.panel_mm.o_panel_1.curr = 1;
}
};
all_m.panel_mm.o_panel_2.onRelease = function () {
if (sound_enable == 1) {
sound_enable = 0;
sData_so.data.sound_enable = 0;
sData_so.flush();
all_m.panel_mm.o_panel_2.gotoAndStop(3);
all_m.panel_mm.o_panel_2.curr = 3;
} else if (sound_enable == 0) {
sound_enable = 1;
sData_so.data.sound_enable = 1;
sData_so.flush();
all_m.panel_mm.o_panel_2.gotoAndStop(1);
all_m.panel_mm.o_panel_2.curr = 1;
}
};
all_m.panel_mm.attachMovie("but_sponsor_logo_1", "o_sponsor_logo_1", all_m.panel_mm.getNextHighestDepth());
all_m.panel_mm.o_sponsor_logo_1.gotoAndStop(1);
all_m.panel_mm.o_sponsor_logo_1._x = 75;
all_m.panel_mm.o_sponsor_logo_1._y = 415;
all_m.panel_mm.o_sponsor_logo_1.onRelease = function () {
getURL (sponsorurl, "_blank");
};
Frame 4
function add_achieve(x) {
ach_queue[ach_queue_number] = x;
ach_queue_number++;
up_dn = 0;
saveAchi(x);
}
function show_achieve(x) {
if (ach_queue_cur < ach_queue_number) {
if (ach_stars == 0) {
var _local1 = 0;
while (_local1 < 9) {
all_m.achieve_hint.attachMovie("o_up_star", "o_up_star" + _local1, 5001 + _local1);
all_m.achieve_hint["o_up_star" + _local1]._x = (all_m.achieve_hint.o_achieve_hint_1._x - 109) + (24 * _local1);
all_m.achieve_hint["o_up_star" + _local1]._y = all_m.achieve_hint.o_achieve_hint_1._y - 30;
_local1 = _local1 + 1;
}
ach_stars = 1;
}
textt1 = ach_queue[ach_queue_cur];
all_m.achieve_hint.t_ach1.text = achiev_array[textt1][1];
all_m.achieve_hint.t_ach2.text = achiev_array[textt1][2];
all_m.achieve_hint.o_achieve_hint_1.onEnterFrame = function () {
if (all_m.achieve_hint.o_achieve_hint_1._y >= 533) {
ach_done = 1;
all_m.achieve_hint.o_achieve_hint_1._y = 440 + all_m.achieve_hint.o_achieve_hint_1._height;
ach_done = 0;
ach_queue_cur++;
up_dn = 0;
ach_stars = 0;
}
if (ach_done == 0) {
if ((all_m.achieve_hint.o_achieve_hint_1._y == 527) and (up_dn == 0)) {
up_dn = 1;
} else if ((all_m.achieve_hint.o_achieve_hint_1._y <= 440) and (up_dn == 1)) {
all_m.achieve_hint.o_achieve_hint_1._y = 440;
setTimeout(function () {
if (up_dn == 1) {
up_dn = 0;
}
}, 1500);
}
if (up_dn == 1) {
all_m.achieve_hint.o_achieve_hint_1._y = all_m.achieve_hint.o_achieve_hint_1._y - x;
all_m.achieve_hint.t_ach1._x = all_m.achieve_hint.o_achieve_hint_1._x - 38;
all_m.achieve_hint.t_ach1._y = all_m.achieve_hint.o_achieve_hint_1._y - 20;
all_m.achieve_hint.t_ach2._x = all_m.achieve_hint.o_achieve_hint_1._x - 38;
all_m.achieve_hint.t_ach2._y = all_m.achieve_hint.o_achieve_hint_1._y;
} else if (up_dn == 0) {
all_m.achieve_hint.o_achieve_hint_1._y = all_m.achieve_hint.o_achieve_hint_1._y + x;
all_m.achieve_hint.t_ach1._x = all_m.achieve_hint.o_achieve_hint_1._x - 38;
all_m.achieve_hint.t_ach1._y = all_m.achieve_hint.o_achieve_hint_1._y - 20;
all_m.achieve_hint.t_ach2._x = all_m.achieve_hint.o_achieve_hint_1._x - 38;
all_m.achieve_hint.t_ach2._y = all_m.achieve_hint.o_achieve_hint_1._y;
}
}
};
} else if (ach_queue_cur == ach_queue_number) {
up_dn = 0;
}
}
function stand_block() {
i = cell_i + 1;
j = cell_j;
k = ((i - 2) * size) + j;
PlaySound(magic);
way_obj[(i * size) + j] = 7;
tools_stand[(i * size) + j] = 1;
all_m.tiles.attachMovie("o_obj", "o_noexit_" + noexit_number, (10 * k) + 3);
all_m.tiles["o_noexit_" + noexit_number]._x = 2 + (53 * j);
all_m.tiles["o_noexit_" + noexit_number]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles["o_noexit_" + noexit_number].gotoAndStop(13);
all_m.tiles["o_noexit_" + noexit_number].number = noexit_number;
all_m.tiles["o_noexit_" + noexit_number].coord = k;
all_m.tiles.attachMovie("o_shadow", "o_shadow2_" + (3 * noexit_number), (10 * ((((i - 2) * size) + j) - 1)) + 1);
all_m.tiles["o_shadow2_" + (3 * noexit_number)].gotoAndStop(2);
all_m.tiles["o_shadow2_" + (3 * noexit_number)]._x = 2 + (53 * (j - 1));
all_m.tiles["o_shadow2_" + (3 * noexit_number)]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles["o_shadow2_" + (3 * noexit_number)]._visible = 0;
all_m.tiles.attachMovie("o_shadow", ("o_shadow2_" + (3 * noexit_number)) + 1, (10 * ((((i - 2) * size) + j) + 1)) + 1);
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 1].gotoAndStop(3);
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 1]._x = 2 + (53 * (j + 1));
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 1]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 1]._visible = 0;
all_m.tiles.attachMovie("o_shadow", ("o_shadow2_" + (3 * noexit_number)) + 2, (10 * ((((i + 1) - 2) * size) + j)) + 1);
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 2].gotoAndStop(1);
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 2]._x = 2 + (53 * j);
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 2]._y = ((-dx) + (41 * (i + 1))) - 50;
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 2]._visible = 0;
noexit_number++;
tool_noexit_count--;
all_m.inter.inter_text_1.text = tool_noexit_count;
if (tool_noexit_count == 1) {
all_m.inter.inter_text_1._x = all_m.inter.o_inter_0._x + 44;
} else {
all_m.inter.inter_text_1._x = all_m.inter.o_inter_0._x + 40;
}
if ((tool_noexit_count == 0) and (tool_come_count > 0)) {
tool_number = 2;
all_m.inter.o_inter_2.gotoAndStop(2);
all_m.inter.o_inter_2.curr = 2;
all_m.inter.o_inter_1.gotoAndStop(1);
all_m.inter.o_inter_1.curr = 1;
} else if ((tool_noexit_count == 0) and (tool_come_count == 0)) {
all_m.inter.o_inter_1.gotoAndStop(1);
all_m.inter.o_inter_1.curr = 1;
all_m.inter.o_inter_2.gotoAndStop(1);
all_m.inter.o_inter_2.curr = 1;
}
}
function stand_cake() {
i = cell_i + 1;
j = cell_j;
k = ((i - 2) * size) + j;
PlaySound(magic);
tools_stand[(i * size) + j] = 2;
way_obj[(i * size) + j] = 8;
all_m.tiles.attachMovie("o_wood_princess", "o_comehere_" + (2 * comehere_number), (10 * k) + 7);
all_m.tiles["o_comehere_" + (2 * comehere_number)].gotoAndStop(1);
all_m.tiles["o_comehere_" + (2 * comehere_number)]._x = 2 + (53 * j);
all_m.tiles["o_comehere_" + (2 * comehere_number)]._y = ((-dx) + (41 * i)) - 78;
all_m.tiles["o_comehere_" + (2 * comehere_number)].coord = k;
all_m.tiles.attachMovie("o_key_shadow", "o_comehere_" + ((2 * comehere_number) + 1), (10 * k) + 6);
all_m.tiles["o_comehere_" + ((2 * comehere_number) + 1)].gotoAndStop(1);
all_m.tiles["o_comehere_" + ((2 * comehere_number) + 1)]._x = (2 + (53 * j)) + 27;
all_m.tiles["o_comehere_" + ((2 * comehere_number) + 1)]._y = ((-dx) + (41 * i)) + 23;
all_m.tiles["o_comehere_" + ((2 * comehere_number) + 1)]._xscale = 130;
all_m.tiles["o_comehere_" + ((2 * comehere_number) + 1)]._yscale = 130;
comehere_number++;
tool_come_count--;
all_m.inter.inter_text_2.text = tool_come_count;
if (tool_come_count == 1) {
all_m.inter.inter_text_2._x = all_m.inter.o_inter_0._x + 98;
} else {
all_m.inter.inter_text_2._x = all_m.inter.o_inter_0._x + 94;
}
if ((tool_come_count == 0) and (tool_noexit_count > 0)) {
tool_number = 1;
all_m.inter.o_inter_1.gotoAndStop(2);
all_m.inter.o_inter_1.curr = 2;
all_m.inter.o_inter_2.gotoAndStop(1);
all_m.inter.o_inter_2.curr = 1;
} else if ((tool_noexit_count == 0) and (tool_come_count == 0)) {
all_m.inter.o_inter_1.gotoAndStop(1);
all_m.inter.o_inter_1.curr = 1;
all_m.inter.o_inter_2.gotoAndStop(1);
all_m.inter.o_inter_2.curr = 1;
}
}
function change_noexit(x) {
all_m.tiles["o_noexit_" + x].gotoAndStop(14);
all_m.tiles["o_shadow2_" + (3 * x)]._visible = 1;
all_m.tiles[("o_shadow2_" + (3 * x)) + 1]._visible = 1;
all_m.tiles[("o_shadow2_" + (3 * x)) + 2]._visible = 1;
PlaySound(s_click);
}
function kill_prince() {
go = 0;
all_m.tiles.o_prince_12.gotoAndStop(1);
PlaySound(s_magic_boom);
boom(all_m.tiles.o_prince_3._x + 15, all_m.tiles.o_prince_3._y - 40);
all_m.tiles.o_prince_2._visible = 0;
all_m.tiles.o_prince_3._visible = 0;
all_m.tiles["o_!_1"].removeMovieClip();
}
function tool_aft_srt() {
tool_number = tool_after_restart;
if (tool_number == 1) {
all_m.inter.o_inter_1.gotoAndStop(2);
all_m.inter.o_inter_1.curr = 2;
all_m.inter.o_inter_2.gotoAndStop(1);
all_m.inter.o_inter_2.curr = 1;
} else if (tool_number == 2) {
all_m.inter.o_inter_2.gotoAndStop(2);
all_m.inter.o_inter_2.curr = 2;
all_m.inter.o_inter_1.gotoAndStop(1);
all_m.inter.o_inter_1.curr = 1;
}
}
function show_light(x) {
x.a = 0;
x._alpha = 0;
x.onEnterFrame = function () {
if (x._alpha >= 80) {
x.a = 1;
} else if (x._alpha < 0) {
x.removeMovieClip();
}
if (x.a == 0) {
x._alpha = x._alpha + 5;
} else if (x.a == 1) {
x._alpha = x._alpha - 5;
}
if (x._alpha > 0) {
x._rotation = x._rotation + 15;
}
};
}
function get_hint() {
all_m.hints.hint1._x = hints_array[hints_count][0];
all_m.hints.hint1._y = hints_array[hints_count][1];
all_m.hints.t_hint1._x = hints_array[hints_count][0] - 99;
all_m.hints.t_hint1._y = hints_array[hints_count][1] - 50;
all_m.hints.t_hint1.text = hints_array[hints_count][2];
all_m.hints.t_hint2._x = all_m.hints.hint1._x - 35;
all_m.hints.t_hint2._y = all_m.hints.hint1._y + 14;
all_m.hints.hint1.a = 0;
}
function boom(x, y) {
var _local1 = 0;
while (_local1 < 9) {
all_m.tiles.attachMovie("o_boom_part", "o_boom_part" + (2 + _local1), 5001 + _local1);
all_m.tiles["o_boom_part" + (2 + _local1)]._x = (x - (Math.random() * 25)) + (Math.random() * 50);
all_m.tiles["o_boom_part" + (2 + _local1)]._y = (y - (Math.random() * 25)) + (Math.random() * 50);
_local1 = _local1 + 1;
}
}
function bubles(x, y) {
var _local1 = 0;
while (_local1 < 6) {
all_m.tiles.attachMovie("o_buble", "o_buble" + _local1, 5001 + _local1);
all_m.tiles["o_buble" + _local1]._x = (x - (Math.random() * 20)) + (Math.random() * 40);
all_m.tiles["o_buble" + _local1]._y = (y - (Math.random() * 10)) + (Math.random() * 20);
_local1 = _local1 + 1;
}
}
function starss(x, y) {
var _local1 = 0;
while (_local1 < 12) {
all_m.tiles.attachMovie("o_little_star", "o_little_star" + _local1, 5001 + _local1);
all_m.tiles["o_little_star" + _local1]._x = (x - (Math.random() * 20)) + (Math.random() * 40);
all_m.tiles["o_little_star" + _local1]._y = (y - (Math.random() * 10)) + (Math.random() * 20);
all_m.tiles["o_little_star" + _local1].dir = 15 + (30 * _local1);
_local1 = _local1 + 1;
}
}
function starss2(x, y) {
var _local1 = 0;
while (_local1 < 12) {
all_m.tiles.attachMovie("o_little_star", "o_little_star" + _local1, 6001 + _local1);
all_m.tiles["o_little_star" + _local1]._x = ((x - (Math.random() * 20)) + (Math.random() * 40)) + (Math.cos((Math.PI * (15 + (30 * _local1))) / 180) * 140);
all_m.tiles["o_little_star" + _local1]._y = ((y - (Math.random() * 10)) + (Math.random() * 20)) + (Math.sin((Math.PI * (15 + (30 * _local1))) / 180) * 140);
all_m.tiles["o_little_star" + _local1].dir = (15 + (30 * _local1)) + 180;
_local1 = _local1 + 1;
}
}
function starss3(x, y) {
var _local1 = 0;
while (_local1 < 4) {
all_m.tiles.attachMovie("o_little_star", "o_little_star" + _local1, 5001 + _local1);
all_m.tiles["o_little_star" + _local1].gotoAndStop(2);
all_m.tiles["o_little_star" + _local1]._x = x + (Math.cos((Math.PI * (15 + (60 * _local1))) / 180) * ((10 + (Math.random() * 20)) - (Math.random() * 10)));
all_m.tiles["o_little_star" + _local1]._y = (y + (Math.sin((Math.PI * (15 + (60 * _local1))) / 180) * ((10 + (Math.random() * 20)) - (Math.random() * 10)))) - 5;
all_m.tiles["o_little_star" + _local1].dir = (15 + (30 * _local1)) + 180;
_local1 = _local1 + 1;
}
}
function snowy(x, y, z) {
var _local1 = 0;
while (_local1 < 6) {
all_m.tiles.attachMovie("o_snowy", ("o_snowy" + (z * 10)) + _local1, (5000 + (100 * z)) + _local1);
all_m.tiles[("o_snowy" + (z * 10)) + _local1]._x = (x - (Math.random() * 20)) + (Math.random() * 40);
all_m.tiles[("o_snowy" + (z * 10)) + _local1]._y = (y - (Math.random() * 10)) + (Math.random() * 20);
_local1 = _local1 + 1;
}
}
function cake_p(x, y) {
var _local1 = 0;
while (_local1 < 4) {
all_m.tiles.attachMovie("o_cake_piece", "o_cake_piece_" + _local1, 5001 + _local1);
all_m.tiles["o_cake_piece_" + _local1].gotoAndStop(_local1 + 1);
all_m.tiles["o_cake_piece_" + _local1]._x = x + Math.cos((Math.PI * (15 + (60 * _local1))) / 180);
all_m.tiles["o_cake_piece_" + _local1]._y = y + Math.sin((Math.PI * (15 + (60 * _local1))) / 180);
all_m.tiles["o_cake_piece_" + _local1].dir = (30 + (40 * _local1)) + 180;
_local1 = _local1 + 1;
}
}
function show_blick(x) {
x._alpha = 90;
x.onEnterFrame = function () {
if (x._alpha >= 80) {
x.a = 1;
} else if (x._alpha <= -200) {
x.a = 0;
}
if (x.a == 0) {
x._alpha = x._alpha + 3;
} else if (x.a == 1) {
x._alpha = x._alpha - 3;
}
if (x._alpha > 0) {
x._rotation = x._rotation + 12;
}
x._x = all_m.tiles.o_key_3._x + 33;
x._y = all_m.tiles.o_key_3._y + 52;
};
}
function show_blick3(x) {
x._alpha = 100;
x.onEnterFrame = function () {
if (x._alpha >= 80) {
x.a = 1;
} else if (x._alpha <= -200) {
x.a = 0;
}
if (x.a == 0) {
x._alpha = x._alpha + 3;
} else if (x.a == 1) {
x._alpha = x._alpha - 3;
}
if (x._alpha > 0) {
x._rotation = x._rotation + 12;
}
};
}
function show_blick_2(x) {
x._alpha = -125;
x.onEnterFrame = function () {
if (x._alpha >= 80) {
x.a = 1;
} else if (x._alpha <= -125) {
x.a = 0;
}
if (x.a == 0) {
x._alpha = x._alpha + 3;
} else if (x.a == 1) {
x._alpha = x._alpha - 3;
}
if (x._alpha > 0) {
x._rotation = x._rotation + 12;
}
x._x = all_m.tiles.o_key_1._x + 29;
x._y = all_m.tiles.o_key_1._y + 57;
};
}
function Play_xxscale(x) {
if (x._xscale < 100) {
x._xscale = x._xscale + 10;
x._yscale = x._xscale;
x._rotation = x._rotation + 45;
}
}
function Play_alpha(x) {
if (x._alpha < 35) {
x._alpha = x._alpha + 2;
}
}
function move_p(x) {
if (x.side_prev != 0) {
if (((go == 1) and (((x._x + 26) % 52) == 0)) and ((x._y % 42) == 0)) {
x.h_j = Math.floor(x._x / 52);
x.h_i = Math.floor(x._y / 42);
current_cell = (x.h_i * size) + x.h_j;
right = current_cell + 1;
up = current_cell - 12;
left = current_cell - 1;
down = current_cell + 12;
if ((way[current_cell] == 2) and (x.side_prev == 4)) {
if (way[right] == 0) {
x.side_prev = 3;
} else {
x.side_prev = 1;
}
} else if ((way[current_cell] == 7) and (x.side_prev == 2)) {
if (way[right] == 0) {
x.side_prev = 3;
} else {
x.side_prev = 1;
}
} else if ((way[current_cell] == 3) and (x.side_prev == 3)) {
if (way[up] == 0) {
x.side_prev = 4;
} else {
x.side_prev = 2;
}
} else if ((way[current_cell] == 8) and (x.side_prev == 1)) {
if (way[up] == 0) {
x.side_prev = 4;
} else {
x.side_prev = 2;
}
} else if ((way[current_cell] == 4) and (x.side_prev == 4)) {
if (way[left] == 0) {
x.side_prev = 1;
} else {
x.side_prev = 3;
}
} else if ((way[current_cell] == 9) and (x.side_prev == 2)) {
if (way[left] == 0) {
x.side_prev = 1;
} else {
x.side_prev = 3;
}
} else if ((way[current_cell] == 5) and (x.side_prev == 1)) {
if (way[down] == 0) {
x.side_prev = 2;
} else {
x.side_prev = 4;
}
} else if ((way[current_cell] == 10) and (x.side_prev == 3)) {
if (way[down] == 0) {
x.side_prev = 2;
} else {
x.side_prev = 4;
}
}
if (x.side_prev == 1) {
if ((way[right] >= 1) and (way[right] != undefined)) {
x.x_next = x._x + 52;
x.side = 1;
} else if ((((way[right] == 0) or (way[right] == undefined)) and (way[up] >= 1)) and ((way[down] == 0) or (way[down] == undefined))) {
x.y_next = x._y - 42;
x.side = 2;
} else if ((((way[right] == 0) or (way[right] == undefined)) and (way[down] >= 1)) and (way[up] == 0)) {
x.y_next = x._y + 42;
x.side = 4;
} else if (((way[right] == 0) or (way[right] == undefined)) and (way[left] >= 1)) {
x.x_next = x._x - 52;
x.side = 3;
}
} else if (x.side_prev == 2) {
if (way[up] >= 1) {
x.y_next = x._y - 42;
x.side = 2;
} else if (((way[up] == 0) and (way[left] >= 1)) and (way[right] == 0)) {
x.x_next = x._x - 52;
x.side = 3;
} else if (((way[up] == 0) and (way[right] >= 1)) and (way[left] == 0)) {
x.x_next = x._x + 52;
x.side = 1;
} else if (((way[up] == 0) and (way[down] >= 1)) and (way[up] == 0)) {
x.y_next = x._y + 42;
x.side = 4;
}
} else if (x.side_prev == 3) {
if (((way[left] >= 1) and (way[left] < 200)) and (way[left] != undefined)) {
x.x_next = x._x - 52;
x.side = 3;
} else if ((((way[left] == 0) or (way[left] == undefined)) and (way[up] >= 1)) and ((way[down] == 0) or (way[down] == undefined))) {
x.y_next = x._y - 42;
x.side = 2;
} else if ((((way[left] == 0) or (way[left] == undefined)) and (way[down] >= 1)) and (way[up] == 0)) {
x.y_next = x._y + 42;
x.side = 4;
} else if (((way[left] == 0) or (way[left] == undefined)) and (way[right] >= 1)) {
x.x_next = x._x + 52;
x.side = 1;
}
} else if (x.side_prev == 4) {
if ((way[down] >= 1) and (way[down] != undefined)) {
x.y_next = x._y + 42;
x.side = 4;
} else if ((((way[down] == 0) or (way[down] == undefined)) and (way[left] >= 1)) and ((way[right] == 0) or (way[right] == undefined))) {
x.x_next = x._x - 52;
x.side = 3;
} else if ((((way[down] == 0) or (way[down] == undefined)) and (way[right] >= 1)) and (way[left] == 0)) {
x.x_next = x._x + 52;
x.side = 1;
} else if ((((way[down] == 0) or (way[down] == undefined)) and (way[up] >= 1)) and (way[down] == 0)) {
x.y_next = x._y - 42;
x.side = 2;
}
}
}
}
if (x.side != 0) {
if (x.side == 1) {
if (x._x < x.x_next) {
x._x = x._x + p_xspeed;
if (x == all_m.tiles.o_prince_1) {
current_cell = (x.h_i * size) + x.h_j;
depth = (10 * (current_cell - 23)) + 4;
all_m.tiles.o_prince_2.swapDepths(depth);
all_m.tiles.o_prince_3.swapDepths(depth + 1);
all_m.tiles.o_prince_2._xscale = 100;
all_m.tiles.o_prince_3._xscale = 100;
} else if (x == all_m.tiles.o_prince_11) {
current_cell = (x.h_i * size) + x.h_j;
depth = (10 * (current_cell - 23)) + 4;
all_m.tiles.o_prince_12.swapDepths(depth);
all_m.tiles.o_prince_13.swapDepths(depth + 1);
all_m.tiles.o_prince_12._xscale = 100;
all_m.tiles.o_prince_13._xscale = 100;
}
}
} else if (x.side == 2) {
if (x._y > x.y_next) {
x._y = x._y - p_yspeed;
if (x == all_m.tiles.o_prince_1) {
current_cell = (x.h_i * size) + x.h_j;
depth = (10 * (current_cell - 24)) + 4;
all_m.tiles.o_prince_2.swapDepths(depth);
all_m.tiles.o_prince_3.swapDepths(depth + 1);
} else if (x == all_m.tiles.o_prince_11) {
current_cell = (x.h_i * size) + x.h_j;
depth = (10 * (current_cell - 23)) + 4;
all_m.tiles.o_prince_12.swapDepths(depth);
all_m.tiles.o_prince_13.swapDepths(depth + 1);
all_m.tiles.o_prince_12._xscale = 100;
all_m.tiles.o_prince_13._xscale = 100;
}
}
} else if (x.side == 3) {
if (x._x > x.x_next) {
x._x = x._x - p_xspeed;
if (x == all_m.tiles.o_prince_1) {
current_cell = (x.h_i * size) + x.h_j;
depth = (10 * (current_cell - 23)) + 4;
all_m.tiles.o_prince_2.swapDepths(depth);
all_m.tiles.o_prince_3.swapDepths(depth + 1);
all_m.tiles.o_prince_2._xscale = -100;
all_m.tiles.o_prince_3._xscale = -100;
} else if (x == all_m.tiles.o_prince_11) {
current_cell = (x.h_i * size) + x.h_j;
depth = (10 * (current_cell - 23)) + 4;
all_m.tiles.o_prince_12.swapDepths(depth);
all_m.tiles.o_prince_13.swapDepths(depth + 1);
all_m.tiles.o_prince_12._xscale = 100;
all_m.tiles.o_prince_13._xscale = 100;
}
}
} else if (x.side == 4) {
if (x._y < x.y_next) {
x._y = x._y + p_yspeed;
if (x == all_m.tiles.o_prince_1) {
current_cell = (x.h_i * size) + x.h_j;
depth = (10 * (current_cell - 12)) + 4;
all_m.tiles.o_prince_2.swapDepths(depth);
all_m.tiles.o_prince_3.swapDepths(depth + 1);
} else if (x == all_m.tiles.o_prince_11) {
current_cell = (x.h_i * size) + x.h_j;
depth = (10 * current_cell) + 4;
all_m.tiles.o_prince_12.swapDepths(depth);
all_m.tiles.o_prince_13.swapDepths(depth + 1);
all_m.tiles.o_prince_12._xscale = 100;
all_m.tiles.o_prince_13._xscale = 100;
}
}
}
}
x.side_prev = x.side;
h_j = Math.floor(x._x / 52);
h_i = Math.floor(x._y / 42);
side = x.side;
side_prev = x.side_prev;
if (x == all_m.tiles.o_prince_1) {
hero_j = h_j;
hero_i = h_i;
}
if (all_m.tiles.o_prince_4.hitTest(all_m.tiles.o_prince_14) and (go == 1)) {
PlaySound(s_yohoho);
kill_prince();
all_m.inter.o_inter_21.removeMovieClip();
all_m.inter.o_inter_20.removeMovieClip();
cur_try = try_number;
setTimeout(function () {
if (cur_try == try_number) {
all_m.after_level._xscale = 0;
all_m.after_level._yscale = 0;
all_m.after_level.o_after_level_menu7._visible = 1;
all_m.after_level.o_after_level_menu5.gotoAndStop(5);
all_m.after_level.o_after_level_menu5._y = -194;
all_m.after_level.o_after_level_menu5._x = -144;
all_m.after_level.o_after_level_menu5._visible = 1;
all_m.panel.o_panel_4._visible = 0;
all_m.panel.o_panel_3._visible = 0;
all_m.after_level._visible = 1;
all_m.square_mc._alpha = 0;
all_m.square_mc._visible = 1;
music_back.stop();
go = 3;
PlaySound(s_fail);
}
}, 1000);
}
}
function move_one_side(x) {
if (x.side_prev != 0) {
if (((x.go == 1) and (((x._x + 26) % 52) == 0)) and ((x._y % 42) == 0)) {
x.h_j = Math.floor(x._x / 52);
x.h_i = Math.floor(x._y / 42);
current_cell = (x.h_i * size) + x.h_j;
right = current_cell + 1;
up = current_cell - 12;
left = current_cell - 1;
down = current_cell + 12;
if (x.side_prev == 1) {
if (way[right] >= 1) {
x.x_next = x._x + 52;
x.side = 1;
}
} else if (x.side_prev == 2) {
if (way[up] >= 1) {
x.y_next = x._y - 42;
x.side = 2;
}
} else if (x.side_prev == 3) {
if (way[left] >= 1) {
x.x_next = x._x - 52;
x.side = 3;
}
} else if (x.side_prev == 4) {
if (way[down] >= 1) {
x.y_next = x._y + 42;
x.side = 4;
}
}
}
}
if (x.side != 0) {
if (x.side == 1) {
if (x._x < x.x_next) {
x._x = x._x + p_xspeed;
current_cell = (x.h_i * size) + x.h_j;
all_m.tiles[("o_iceball_" + x.number) + 1].swapDepths((10 * (current_cell - 23)) + 8);
} else if (x._x >= x.x_next) {
snowy(x._x, x._y - 25, x.number);
all_m.tiles[("o_iceball_" + x.number) + 2].removeMovieClip();
all_m.tiles[("o_iceball_" + x.number) + 1].removeMovieClip();
all_m.tiles["o_iceball_" + x.number].removeMovieClip();
}
} else if (x.side == 2) {
if (x._y > x.y_next) {
x._y = x._y - p_yspeed;
current_cell = (x.h_i * size) + x.h_j;
all_m.tiles[("o_iceball_" + x.number) + 1].swapDepths((10 * (current_cell - 12)) + 8);
} else if (x._y <= x.y_next) {
snowy(x._x, x._y - 25, x.number);
all_m.tiles[("o_iceball_" + x.number) + 2].removeMovieClip();
all_m.tiles[("o_iceball_" + x.number) + 1].removeMovieClip();
all_m.tiles["o_iceball_" + x.number].removeMovieClip();
}
} else if (x.side == 3) {
if (x._x > x.x_next) {
x._x = x._x - p_xspeed;
current_cell = (x.h_i * size) + x.h_j;
all_m.tiles[("o_iceball_" + x.number) + 1].swapDepths((10 * (current_cell - 23)) + 8);
} else if (x._x <= x.x_next) {
snowy(x._x, x._y - 25, x.number);
all_m.tiles[("o_iceball_" + x.number) + 2].removeMovieClip();
all_m.tiles[("o_iceball_" + x.number) + 1].removeMovieClip();
all_m.tiles["o_iceball_" + x.number].removeMovieClip();
}
} else if (x.side == 4) {
if (x._y < x.y_next) {
x._y = x._y + p_yspeed;
current_cell = (x.h_i * size) + x.h_j;
all_m.tiles[("o_iceball_" + x.number) + 1].swapDepths((10 * (current_cell - 12)) + 8);
} else if (x._y >= x.y_next) {
snowy(x._x, x._y - 25, x.number);
all_m.tiles[("o_iceball_" + x.number) + 2].removeMovieClip();
all_m.tiles[("o_iceball_" + x.number) + 1].removeMovieClip();
all_m.tiles["o_iceball_" + x.number].removeMovieClip();
}
}
}
if (all_m.tiles[("o_iceball_" + x.number) + 2].hitTest(all_m.tiles.o_prince_4) and (go == 1)) {
kill_prince();
cur_try = try_number;
all_m.inter.o_inter_21.removeMovieClip();
all_m.inter.o_inter_20.removeMovieClip();
setTimeout(function () {
if (cur_try == try_number) {
all_m.after_level._xscale = 0;
all_m.after_level._yscale = 0;
all_m.after_level.o_after_level_menu7._visible = 1;
all_m.after_level.o_after_level_menu5._y = -194;
all_m.after_level.o_after_level_menu5._x = -144;
all_m.after_level.o_after_level_menu5.gotoAndStop(4);
all_m.after_level.o_after_level_menu5._visible = 1;
all_m.panel.o_panel_4._visible = 0;
all_m.panel.o_panel_3._visible = 0;
all_m.after_level._visible = 1;
all_m.square_mc._alpha = 0;
all_m.square_mc._visible = 1;
music_back.stop();
go = 3;
PlaySound(s_fail);
}
}, 1000);
all_m.tiles[("o_iceball_" + x.number) + 2].removeMovieClip();
all_m.tiles[("o_iceball_" + x.number) + 1].removeMovieClip();
all_m.tiles["o_iceball_" + x.number].removeMovieClip();
}
if (all_m.tiles[("o_iceball_" + x.number) + 2].hitTest(all_m.tiles.o_prince_14) and (go == 1)) {
snowy(x._x, x._y - 25, x.number);
boom(all_m.tiles.o_prince_13._x + 15, all_m.tiles.o_prince_13._y - 40);
all_m.tiles.o_prince_14.removeMovieClip();
all_m.tiles.o_prince_13.removeMovieClip();
all_m.tiles.o_prince_12.removeMovieClip();
all_m.tiles.o_prince_11.removeMovieClip();
all_m.tiles[("o_iceball_" + x.number) + 2].removeMovieClip();
all_m.tiles[("o_iceball_" + x.number) + 1].removeMovieClip();
all_m.tiles["o_iceball_" + x.number].removeMovieClip();
}
}
var distance = 0;
var angleInDegrees = 0;
var color = 15463162;
var alpha = 1;
var blurX = 2;
var blurY = 2;
var strength = 5;
var quality = 3;
var inner = false;
var knockout = false;
var hideObject = false;
var format_stars3 = new TextFormat();
format_stars3.font = "Luvable";
format_stars3.color = 5019888 /* 0x4C98F0 */;
format_stars3.size = 18;
var format_hint_arr = new TextFormat();
format_hint_arr.font = "Luvable";
format_hint_arr.color = 5019888 /* 0x4C98F0 */;
format_hint_arr.size = 14;
format_hint_arr.align = "center";
stop();
var ach_done = 0;
var up_dn = 0;
var ach_queue = new Array();
ach_queue = [-1, -1, -1, -1, -1];
var ach_queue_number = 0;
var ach_queue_cur = 0;
var ach_stars = 0;
var wave_count = 0;
var bfly_count = 0;
var blck_count = 0;
try_number++;
all_m.levels_2.removeMovieClip();
all_m.levels.removeMovieClip();
all_m.menu_clouds.removeMovieClip();
all_m.clouds_1.removeMovieClip();
all_m.clouds_2.removeMovieClip();
all_m.clouds_3.removeMovieClip();
all_m.hints.removeMovieClip();
all_m.achiev_menu.removeMovieClip();
all_m.panel_mm.removeMovieClip();
var format_inter = new TextFormat();
format_inter.font = "Luvable";
format_inter.color = 16777215 /* 0xFFFFFF */;
format_inter.size = 25;
var tool_come_count = 0;
var tool_noexit_count = 0;
var back_count = 0;
var in_cell_now = 0;
var no_exit_curr = 0;
var hints_count = 0;
tool_noexit_count = tool_a1;
tool_come_count = tool_a2;
back_count = back_a;
var backBuffer = (new flash.display.BitmapData(640, 480, false));
var tiles_bmp = (new flash.display.BitmapData(640, 480, true, 0));
var size = 12;
var tool_number = 0;
var go = 0;
var cellcount = 0;
var ice_button_number = 0;
var current_cell = 0;
var iceball_number = 0;
var key = 0;
var cellcell = 0;
var right = 0;
var up = 0;
var left = 0;
var down = 0;
var h_i = 0;
var h_j = 0;
var hero_i = 0;
var hero_j = 0;
var x_next = 0;
var y_next = 0;
var side = 0;
var side_prev = 1;
var hero_side = 0;
var hero_side_prev = 1;
var doors = 0;
var btn_number = 0;
var noexit_number = 0;
var comehere_number = 0;
var teleports = 0;
var got_star = 0;
var cell_number = 0;
var cell_i = 0;
var cell_j = 0;
var k = 0;
var kk = 0;
var dx = 10;
var depth = 0;
var way = new Array();
var way_obj = new Array();
var was_in = new Array();
var space_pressed = 0;
var one_pressed = 0;
var two_pressed = 0;
var r_pressed = 0;
var keyListener = new Object();
keyListener.onKeyDown = function () {
if ((Key.getCode() == 32) and (space_pressed == 0)) {
if (go == 0) {
go = 1;
space_pressed = 1;
side_prev = 1;
go = 1;
all_m.tiles.o_prince_2.gotoAndPlay(2);
all_m.tiles.o_prince_12.gotoAndPlay(2);
all_m.inter.o_inter_3.gotoAndStop(3);
all_m.inter.o_inter_3.curr = 3;
all_m.inter.o_inter_22._visible = 0;
all_m.inter.o_inter_23._visible = 0;
all_m.inter.o_inter_2._visible = 0;
all_m.inter.o_inter_1._visible = 0;
all_m.inter.inter_text_2._visible = 0;
all_m.inter.inter_text_1._visible = 0;
all_m.inter.o_inter_20._visible = 0;
all_m.inter.o_inter_21._visible = 0;
} else if (go == 1) {
space_pressed = 1;
backBuffer.draw(all_m.clouds);
backBuffer.draw(all_m.tiles_back);
backBuffer.draw(all_m.tiles);
all_m.all_m.snow.removeMovieClip();
all_m.inter.removeMovieClip();
all_m.clouds.removeMovieClip();
all_m.tiles_back.removeMovieClip();
all_m.tiles.removeMovieClip();
all_m.panel.removeMovieClip();
all_m.after_level.removeMovieClip();
all_m.square_mc.removeMovieClip();
all_m.square_mc_2.removeMovieClip();
all_m.hints.removeMovieClip();
all_m.achieve_hint.removeMovieClip();
been_restart = 1;
all_m.screen.attachBitmap(backBuffer, all_m.getNextHighestDepth());
gotoAndPlay(_currentframe + 1);
}
} else if ((Key.getCode() == 49) and (one_pressed == 0)) {
up_dn = 0;
if (tool_noexit_count != 0) {
PlaySound(s_click);
tool_number = 1;
all_m.inter.o_inter_1.gotoAndStop(2);
all_m.inter.o_inter_1.curr = 2;
all_m.inter.o_inter_2.gotoAndStop(1);
all_m.inter.o_inter_2.curr = 1;
}
one_pressed = 1;
} else if ((Key.getCode() == 50) and (two_pressed == 0)) {
if (tool_come_count != 0) {
PlaySound(s_click);
tool_number = 2;
all_m.inter.o_inter_2.gotoAndStop(2);
all_m.inter.o_inter_2.curr = 2;
all_m.inter.o_inter_1.gotoAndStop(1);
all_m.inter.o_inter_1.curr = 1;
}
two_pressed = 1;
} else if ((Key.getCode() == 82) and (r_pressed == 0)) {
backBuffer.draw(all_m.clouds);
backBuffer.draw(all_m.tiles_back);
backBuffer.draw(all_m.tiles);
all_m.snow.removeMovieClip();
all_m.inter.removeMovieClip();
all_m.clouds.removeMovieClip();
all_m.tiles_back.removeMovieClip();
all_m.tiles.removeMovieClip();
all_m.panel.removeMovieClip();
all_m.after_level.removeMovieClip();
all_m.square_mc.removeMovieClip();
all_m.square_mc_2.removeMovieClip();
all_m.hints.removeMovieClip();
all_m.achieve_hint.removeMovieClip();
been_restart = 1;
all_m.screen.attachBitmap(backBuffer, all_m.getNextHighestDepth());
gotoAndPlay(_currentframe + 1);
r_pressed = 1;
}
};
keyListener.onKeyUp = function () {
if ((Key.getCode() == 32) and (space_pressed == 1)) {
space_pressed = 0;
} else if ((Key.getCode() == 49) and (one_pressed == 1)) {
one_pressed = 0;
} else if ((Key.getCode() == 50) and (two_pressed == 1)) {
two_pressed = 0;
}
};
Key.addListener(keyListener);
var format_achieve = new TextFormat();
format_achieve.font = "Berlin Sans FB 1";
format_achieve.color = 4605510 /* 0x464646 */;
format_achieve.size = 15;
format_achieve.bold = true;
format_achieve.align = "center";
var format_achieve_2 = new TextFormat();
format_achieve_2.font = "Berlin Sans FB 1";
format_achieve_2.color = 4605510 /* 0x464646 */;
format_achieve_2.size = 13;
format_achieve_2.bold = false;
format_achieve_2.align = "center";
init = function () {
width = 640;
height = 480;
max_snowsize = 7;
snowflakes = 75;
i = 0;
while (i < snowflakes) {
St = all_m.snow.attachMovie("o_snow", "snow" + i, 6000 + i);
St._alpha = 20 + (Math.random() * 60);
St._rotation = Math.random() * 360;
St._x = (-(width / 2)) + (Math.random() * (1.5 * width));
St._y = (-(height / 2)) + (Math.random() * (1.5 * height));
St._xscale = (t._yscale = 50 + (Math.random() * (max_snowsize * 10)));
St.k = 1 + (Math.random() * 2);
St.wind = -1.5 + (Math.random() * 4.2);
St.onEnterFrame = mover;
i++;
}
};
mover = function () {
this._y = this._y + this.k;
this._x = this._x + this.wind;
if (this._y > (height + 10)) {
this._y = -20;
}
if (this._x > (width + 20)) {
this._x = (-(width / 2)) + (Math.random() * (1.5 * width));
this._y = -20;
} else if (this._x < -20) {
this._x = (-(width / 2)) + (Math.random() * (1.5 * width));
this._y = -20;
}
};
all_m.createEmptyMovieClip("screen", all_m.getNextHighestDepth());
all_m.createEmptyMovieClip("clouds", all_m.getNextHighestDepth());
all_m.clouds.attachMovie("o_backgrounds", "o_backgrounds_0", 0);
all_m.clouds.attachMovie("o_cloud", "o_cloud_0", 1);
all_m.clouds.attachMovie("o_cloud", "o_cloud_1", 2);
all_m.clouds.attachMovie("o_cloud", "o_cloud_2", 3);
all_m.clouds.attachMovie("o_mountains", "o_mountains_3", 4);
all_m.clouds.attachMovie("o_vint", "o_mountains_4", 5);
all_m.clouds.o_mountains_3._x = 320;
all_m.clouds.o_mountains_3._y = 225;
all_m.clouds.o_cloud_0.gotoAndStop(1);
all_m.clouds.o_cloud_1.gotoAndStop(2);
all_m.clouds.o_cloud_2.gotoAndStop(3);
all_m.clouds.o_cloud_0._y = 40;
all_m.clouds.o_cloud_0._x = 40;
all_m.clouds.o_cloud_1._y = 50;
all_m.clouds.o_cloud_1._x = 240;
all_m.clouds.o_cloud_2._y = 30;
all_m.clouds.o_cloud_2._x = 540;
if (back_count == 0) {
all_m.clouds.o_mountains_4._visible = 1;
all_m.clouds.o_mountains_3.gotoAndStop(1);
all_m.clouds.o_backgrounds_0.gotoAndStop(1);
} else if (back_count == 1) {
all_m.clouds.o_mountains_4._visible = 0;
all_m.clouds.o_mountains_3.gotoAndStop(3);
all_m.clouds.o_backgrounds_0.gotoAndStop(2);
all_m.clouds.o_cloud_1._y = 35;
all_m.clouds.o_cloud_0._y = 25;
} else if (back_count == 2) {
all_m.clouds.o_mountains_4._visible = 0;
all_m.clouds.o_mountains_3.gotoAndStop(4);
all_m.clouds.o_backgrounds_0.gotoAndStop(3);
all_m.clouds.o_cloud_1._y = 35;
all_m.clouds.o_cloud_0._y = 25;
}
all_m.clouds.o_mountains_4._x = 327;
all_m.clouds.o_mountains_4._y = 33;
all_m.createEmptyMovieClip("tiles_back", all_m.getNextHighestDepth());
all_m.createEmptyMovieClip("tiles_2", all_m.getNextHighestDepth());
all_m.createEmptyMovieClip("tiles", all_m.getNextHighestDepth());
all_m.createEmptyMovieClip("snow", all_m.getNextHighestDepth());
all_m.createEmptyMovieClip("hints", all_m.getNextHighestDepth());
if (((((cur_level_number >= 0) and (cur_level_number < 11)) and (cur_level_number != 6)) or (cur_level_number == 13)) or (cur_level_number == 14)) {
if ((cur_level_number == 1) and (been_restart == 0)) {
hints_count = 5;
}
if ((cur_level_number == 2) and (been_restart == 0)) {
hints_count = 8;
}
if ((cur_level_number == 3) and (been_restart == 0)) {
hints_count = 10;
}
if ((cur_level_number == 4) and (been_restart == 0)) {
hints_count = 12;
}
if ((cur_level_number == 5) and (been_restart == 0)) {
hints_count = 15;
}
if ((cur_level_number == 7) and (been_restart == 0)) {
hints_count = 16;
}
if ((cur_level_number == 8) and (been_restart == 0)) {
hints_count = 18;
}
if ((cur_level_number == 9) and (been_restart == 0)) {
hints_count = 19;
}
if ((cur_level_number == 10) and (been_restart == 0)) {
hints_count = 20;
}
if ((cur_level_number == 13) and (been_restart == 0)) {
hints_count = 21;
}
if ((cur_level_number == 14) and (been_restart == 0)) {
hints_count = 22;
}
all_m.hints.attachMovie("o_hint_arrow", "hint5", 5);
all_m.hints.hint5._visible = 0;
all_m.hints.hint5._x = 680;
all_m.hints.hint5._y = 435;
all_m.hints.attachMovie("o_hint_message", "hint1", 1);
all_m.hints.hint1._alpha = 70;
var format_hints = new TextFormat();
format_hints.font = "Luvable";
format_hints.color = 16777215 /* 0xFFFFFF */;
format_hints.size = 16;
format_hints.bold = false;
var format_hints_2 = new TextFormat();
format_hints_2.font = "Berlin Sans FB 1";
format_hints_2.color = 4605510 /* 0x464646 */;
format_hints_2.size = 14;
format_hints_2.bold = true;
all_m.hints.attachMovie("o_hint_!", "hint!1", 26);
all_m.hints["hint!1"]._x = 2;
all_m.hints["hint!1"]._y = 20;
all_m.hints.createTextField("t_hint5", 25, 200, 200, 600, 600);
all_m.hints.t_hint5._xscale = 100;
all_m.hints.t_hint5._yscale = 100;
if (cur_level_number == 0) {
all_m.hints.t_hint5.text = "click 'GO' or press SPACE to start moving.\rThe Prince can walk only along the road.\rTake the potion, and give it to the princess.";
} else if (cur_level_number == 1) {
all_m.hints.t_hint5.text = "avoid spikes, if Prince touches them he will die.\ruse cakes to change prince's direction.\rtry to get the star, but it isn't necessary.";
} else if (cur_level_number == 2) {
all_m.hints.t_hint5.text = "Also you have One-way block.\rIt will block up the way\rafter the Prince step on it.";
} else if (cur_level_number == 3) {
all_m.hints.t_hint5.text = "If Prince has two available directions,\rhe will turn in the direction of the arrow.\rif you want you can increase/decrease speed.";
} else if (cur_level_number == 4) {
all_m.hints.t_hint5.text = "Try to pass this level using two blocks.\rTo remove block from the road just click\ron it again.To restart press 'GO' or SPACE again. ";
} else if (cur_level_number == 5) {
all_m.hints.t_hint5.text = " \rNow try to pass this level using only cakes.";
} else if (cur_level_number == 7) {
all_m.hints.t_hint5.text = "Prince must press red button to remove\rthe door of the corresponding color.\rAfter that prince will be able to see the cake.";
} else if (cur_level_number == 8) {
all_m.hints.t_hint5.text = "Let's see how you will cope with\rtwo colors of doors. \rNow no hints.";
} else if (cur_level_number == 9) {
all_m.hints.t_hint5.text = "Here you can see few teleports.\rEnter one of them and look \rwhat will happen next.";
} else if (cur_level_number == 10) {
all_m.hints.t_hint5.text = "Upon exiting the teleport the prince will \rcontinue to move in the same direction as \rhe was moving before he had entered it.";
} else if (cur_level_number == 13) {
all_m.hints.t_hint5.text = "avoid the pirate. He moves along the\rroad as the Prince and can also press \rthe buttons and one-way blocks.";
} else if (cur_level_number == 14) {
all_m.hints.t_hint5.text = "This button is a magic trap. After the prince\r will push her, snowball will fly in his side.\r Avoid snowballs or they will kill prince.";
} else {
all_m.hints.t_hint5._visible = 0;
all_m.hints["hint!1"]._visible = 0;
}
all_m.hints.t_hint5.setTextFormat(format_hints);
all_m.hints.t_hint5.setNewTextFormat(format_hints);
all_m.hints.t_hint5.embedFonts = true;
all_m.hints.t_hint5._x = 75;
all_m.hints.t_hint5._y = 25;
all_m.hints.t_hint5.filters = [new flash.filters.DropShadowFilter(distance, angleInDegrees, 1797318, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject)];
all_m.hints.t_hint5.selectable = false;
all_m.hints.createTextField("t_hint1", 2, 50, 50, 200, 200);
all_m.hints.t_hint1._xscale = 0;
all_m.hints.t_hint1._yscale = 0;
all_m.hints.t_hint1.text = "Welcome to the game \r bla-bla-bla";
all_m.hints.t_hint1.setTextFormat(format_hints);
all_m.hints.t_hint1.setNewTextFormat(format_hints);
all_m.hints.t_hint1.embedFonts = true;
all_m.hints.t_hint1._x = hints_array[hints_count][0] - 99;
all_m.hints.t_hint1._y = hints_array[hints_count][1] - 50;
all_m.hints.hint1._xscale = 80;
all_m.hints.hint1._yscale = 80;
all_m.hints.t_hint1.selectable = false;
all_m.hints.hint1._x = hints_array[hints_count][0];
all_m.hints.hint1._y = hints_array[hints_count][1];
all_m.hints.t_hint1.text = hints_array[hints_count][2];
all_m.hints.createTextField("t_hint2", 3, 50, 50, 200, 100);
all_m.hints.t_hint2.text = "click to close";
all_m.hints.t_hint2.setTextFormat(format_hints_2);
all_m.hints.t_hint2.setNewTextFormat(format_hints_2);
all_m.hints.t_hint2._x = all_m.hints.hint1._x - 35;
all_m.hints.t_hint2._y = all_m.hints.hint1._y + 14;
all_m.hints.t_hint2.selectable = false;
all_m.hints.t_hint2.embedFonts = true;
all_m.hints.createTextField("t_hint3", 40, 100, 100, 70, 70);
all_m.hints.t_hint3.text = "click to \rstart \rmoving";
all_m.hints.t_hint3.setTextFormat(format_hint_arr);
all_m.hints.t_hint3.setNewTextFormat(format_hint_arr);
all_m.hints.t_hint3._x = 680;
all_m.hints.t_hint3._y = all_m.hints.hint5._y - 34;
all_m.hints.t_hint3.selectable = false;
all_m.hints.t_hint3.embedFonts = true;
all_m.hints.t_hint3.filters = [new flash.filters.DropShadowFilter(distance, angleInDegrees, color, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject)];
if ((hints_count == 0) and (cur_level_number != 0)) {
all_m.hints.hint1._visible = 0;
all_m.hints.t_hint1._visible = 0;
all_m.hints.t_hint2._visible = 0;
all_m.hints.hint5._visible = 1;
} else if ((hints_count == 0) and (cur_level_number == 0)) {
all_m.hints.hint5._x = 609;
if (been_restart == 1) {
all_m.hints.hint1._visible = 0;
all_m.hints.t_hint1._visible = 0;
all_m.hints.t_hint2._visible = 0;
all_m.hints.hint5._visible = 1;
}
}
all_m.hints.hint1._visible = 0;
all_m.hints.t_hint1._visible = 0;
all_m.hints.t_hint2._visible = 0;
all_m.hints.hint5._visible = 1;
if (cur_level_number == 0) {
all_m.hints.hint5._x = 609;
} else if (cur_level_number == 1) {
all_m.hints.hint5._x = 690;
} else if (cur_level_number == 2) {
all_m.hints.hint5._x = 690;
} else if (cur_level_number == 3) {
all_m.hints.hint5._x = 567;
all_m.hints.t_hint3.text = "click to\rincrease\rspeed";
}
hints_count++;
all_m.hints.hint1.onRelease = function () {
all_m.hints.hint1.a = 3;
trace((_xmouse + " ") + _ymouse);
PlaySound(s_bul);
if (cur_level_number == 0) {
if ((hints_count < 5) and (been_restart == 0)) {
get_hint();
hints_count++;
} else {
all_m.hints.t_hint1._visible = 0;
all_m.hints.t_hint2._visible = 0;
all_m.hints.hint5._visible = 1;
all_m.hints.hint5._x = 609;
}
} else if (cur_level_number == 1) {
if ((hints_count < 8) and (been_restart == 0)) {
get_hint();
hints_count++;
} else {
hints.t_hint1._visible = 0;
hints.t_hint2._visible = 0;
hints.hint5._visible = 1;
hints.hint5._x = 520;
}
}
if (cur_level_number == 2) {
if ((hints_count < 10) and (been_restart == 0)) {
get_hint();
hints_count++;
} else {
hints.t_hint1._visible = 0;
hints.t_hint2._visible = 0;
hints.hint5._visible = 1;
hints.hint5._x = 470;
}
} else if (cur_level_number == 3) {
if ((hints_count < 12) and (been_restart == 0)) {
get_hint();
hints_count++;
} else {
hints.t_hint1._visible = 0;
hints.t_hint2._visible = 0;
hints.hint5._visible = 1;
hints.hint5._x = 567;
hints.t_hint3.text = "click to\rincrease\rspeed";
}
} else if (cur_level_number == 4) {
if ((hints_count < 15) and (been_restart == 0)) {
get_hint();
hints_count++;
} else {
hints.t_hint1._visible = 0;
hints.t_hint2._visible = 0;
}
} else if (cur_level_number == 5) {
if ((hints_count < 16) and (been_restart == 0)) {
get_hint();
hints_count++;
} else {
hints.t_hint1._visible = 0;
hints.t_hint2._visible = 0;
}
} else if (cur_level_number == 7) {
if ((hints_count < 18) and (been_restart == 0)) {
get_hint();
hints_count++;
} else {
hints.t_hint1._visible = 0;
hints.t_hint2._visible = 0;
}
} else if (cur_level_number == 8) {
if ((hints_count < 19) and (been_restart == 0)) {
get_hint();
hints_count++;
} else {
hints.t_hint1._visible = 0;
hints.t_hint2._visible = 0;
}
} else if (cur_level_number == 9) {
if ((hints_count < 20) and (been_restart == 0)) {
get_hint();
hints_count++;
} else {
hints.t_hint1._visible = 0;
hints.t_hint2._visible = 0;
}
} else if (cur_level_number == 10) {
if ((hints_count < 21) and (been_restart == 0)) {
get_hint();
hints_count++;
} else {
hints.t_hint1._visible = 0;
hints.t_hint2._visible = 0;
}
} else if (cur_level_number == 13) {
if ((hints_count < 22) and (been_restart == 0)) {
get_hint();
hints_count++;
} else {
hints.t_hint1._visible = 0;
hints.t_hint2._visible = 0;
}
} else if (cur_level_number == 14) {
if ((hints_count < 23) and (been_restart == 0)) {
get_hint();
hints_count++;
} else {
hints.t_hint1._visible = 0;
hints.t_hint2._visible = 0;
}
}
};
}
all_m.createEmptyMovieClip("square_mc", all_m.getNextHighestDepth());
all_m.square_mc.beginFill(0);
all_m.square_mc.moveTo(0, 0);
all_m.square_mc.lineTo(640, 0);
all_m.square_mc.lineTo(640, 480);
all_m.square_mc.lineTo(0, 480);
all_m.square_mc.lineTo(0, 0);
all_m.square_mc.endFill();
all_m.square_mc._alpha = 100;
all_m.square_mc._visible = 0;
all_m.createEmptyMovieClip("after_level", all_m.getNextHighestDepth());
all_m.after_level.attachMovie("o_after_level_menu", "o_after_level_menu1", 6000);
all_m.after_level.o_after_level_menu1.gotoAndStop(1);
all_m.after_level.attachMovie("but_after_level_next", "o_after_level_menu2", 6001);
all_m.after_level.o_after_level_menu2._y = 65;
all_m.after_level.o_after_level_menu2._visible = 0;
all_m.after_level.attachMovie("but_after_level_games", "o_after_level_menu3", 6002);
all_m.after_level.o_after_level_menu3._y = 109;
all_m.after_level.o_after_level_menu3._x = 60;
all_m.after_level.attachMovie("but_after_level_menu", "o_after_level_menu4", 6003);
all_m.after_level.o_after_level_menu4._y = 109;
all_m.after_level.o_after_level_menu4._x = -60;
all_m.after_level.attachMovie("but_after_level_retry", "o_after_level_menu7", 6006);
all_m.after_level.o_after_level_menu7._y = 65;
all_m.after_level.o_after_level_menu7._visible = 0;
all_m.after_level.attachMovie("o_after_level_menu", "o_after_level_menu5", 6004);
all_m.after_level.o_after_level_menu5._y = -184;
all_m.after_level.o_after_level_menu5._x = -150;
all_m.after_level.o_after_level_menu5.gotoAndStop(2);
all_m.after_level.o_after_level_menu5._visible = 0;
all_m.after_level._x = 320;
all_m.after_level._y = 210;
all_m.after_level._rotation = -90;
all_m.after_level._visible = 0;
all_m.createEmptyMovieClip("achieve_hint", all_m.getNextHighestDepth());
all_m.achieve_hint.attachMovie("o_achieve_hint", "o_achieve_hint_1", 6000);
all_m.achieve_hint.o_achieve_hint_1._x = 320;
all_m.achieve_hint.o_achieve_hint_1._y = 440 + all_m.achieve_hint.o_achieve_hint_1._height;
all_m.achieve_hint.createTextField("t_ach1", 60001, 50, 50, 125, 125);
all_m.achieve_hint.t_ach1.text = "Welcome to the game \r bla-bla-bla";
all_m.achieve_hint.t_ach1.setTextFormat(format_achieve);
all_m.achieve_hint.t_ach1.setNewTextFormat(format_achieve);
all_m.achieve_hint.t_ach1._x = all_m.achieve_hint.o_achieve_hint_1._x - 40;
all_m.achieve_hint.t_ach1._y = all_m.achieve_hint.o_achieve_hint_1._y - 20;
all_m.achieve_hint.t_ach1.selectable = false;
all_m.achieve_hint.t_ach1.embedFonts = true;
all_m.achieve_hint.createTextField("t_ach2", 60002, 50, 50, 125, 125);
all_m.achieve_hint.t_ach2.text = "Welcome to the game \r bla-bla-bla";
all_m.achieve_hint.t_ach2.setTextFormat(format_achieve_2);
all_m.achieve_hint.t_ach2.setNewTextFormat(format_achieve_2);
all_m.achieve_hint.t_ach2._x = all_m.achieve_hint.o_achieve_hint_1._x - 40;
all_m.achieve_hint.t_ach2._y = all_m.achieve_hint.o_achieve_hint_1._y;
all_m.achieve_hint.t_ach2.selectable = false;
all_m.achieve_hint.t_ach2.embedFonts = true;
all_m.tiles.attachMovie("o_prince", "o_prince_1", 544);
all_m.tiles.attachMovie("o_!", "o_!_1", 7000);
all_m.tiles.attachMovie("o_prince_f", "o_prince_2", 3546);
all_m.tiles.attachMovie("o_prince_b", "o_prince_3", 3547);
all_m.tiles.attachMovie("o_cell_mask", "o_prince_4", 3545);
all_m.tiles["o_!_1"]._visible = 0;
all_m.tiles.o_prince_1.was_in = 0;
all_m.tiles.o_prince_1._visible = 0;
all_m.tiles.o_prince_2._visible = 1;
all_m.tiles.o_prince_3._visible = 1;
all_m.tiles.o_prince_4._visible = 0;
all_m.tiles.o_prince_1.side_prev = 4;
all_m.tiles.o_prince_1.side = 4;
if (cur_level_number == 20) {
var i = 0;
while (i < size) {
var j = 0;
while (j < size) {
if ((lvlArray1[(i * size) + j] == 13) and (((i * size) + j) != 38)) {
tools_stand[(i * size) + j] = 2;
}
j = j + 1;
}
i = i + 1;
}
}
var i = 0;
while (i < size) {
var j = 0;
while (j < size) {
way[(i * size) + j] = 0;
was_in[(i * size) + j] = 0;
way_obj[(i * size) + j] = 0;
if ((lvlArray1[(i * size) + j] != 0) and (lvlArray1[(i * size) + j] < 100)) {
if (lvlArray1[(i * size) + j] == 13) {
way[(i * size) + j] = 1;
if (tools_stand[(i * size) + j] == 10) {
tools_stand[(i * size) + j] = 0;
}
} else if (lvlArray1[(i * size) + j] == 14) {
way[(i * size) + j] = 2;
if (tools_stand[(i * size) + j] == 10) {
tools_stand[(i * size) + j] = 0;
}
} else if (lvlArray1[(i * size) + j] == 15) {
way[(i * size) + j] = 3;
if (tools_stand[(i * size) + j] == 10) {
tools_stand[(i * size) + j] = 0;
}
} else if (lvlArray1[(i * size) + j] == 16) {
way[(i * size) + j] = 4;
if (tools_stand[(i * size) + j] == 10) {
tools_stand[(i * size) + j] = 0;
}
} else if (lvlArray1[(i * size) + j] == 17) {
way[(i * size) + j] = 5;
if (tools_stand[(i * size) + j] == 10) {
tools_stand[(i * size) + j] = 0;
}
} else if (lvlArray1[(i * size) + j] == 18) {
way[(i * size) + j] = 7;
if (tools_stand[(i * size) + j] == 10) {
tools_stand[(i * size) + j] = 0;
}
} else if (lvlArray1[(i * size) + j] == 19) {
way[(i * size) + j] = 8;
if (tools_stand[(i * size) + j] == 10) {
tools_stand[(i * size) + j] = 0;
}
} else if (lvlArray1[(i * size) + j] == 20) {
way[(i * size) + j] = 9;
if (tools_stand[(i * size) + j] == 10) {
tools_stand[(i * size) + j] = 0;
}
} else if (lvlArray1[(i * size) + j] == 21) {
way[(i * size) + j] = 10;
if (tools_stand[(i * size) + j] == 10) {
tools_stand[(i * size) + j] = 0;
}
} else if (lvlArray1[(i * size) + j] == 28) {
way[(i * size) + j] = 1;
if (tools_stand[(i * size) + j] == 10) {
tools_stand[(i * size) + j] = 0;
}
} else {
way[(i * size) + j] = 0;
}
if ((((((((((((lvlArray1[(i * size) + j] == 11) or (lvlArray1[(i * size) + j] == 12)) or (lvlArray1[(i * size) + j] == 26)) or (lvlArray1[(i * size) + j] == 27)) or (lvlArray1[(i * size) + j] == 31)) or (lvlArray1[(i * size) + j] == 32)) or (lvlArray1[(i * size) + j] == 33)) or (lvlArray1[(i * size) + j] == 34)) or (lvlArray1[(i * size) + j] == 39)) or (lvlArray1[(i * size) + j] == 40)) or (lvlArray1[(i * size) + j] == 41)) or ((lvlArray1[(i * size) + j] > 13) and (lvlArray1[(i * size) + j] <= 21))) {
if ((lvlArray1[(i * size) + j] == 11) or (lvlArray1[(i * size) + j] == 26)) {
all_m.tiles_2.attachMovie("o_tiles", "o_tiles_" + k, 10 * k);
all_m.tiles_2["o_tiles_" + k].gotoAndStop(2);
all_m.tiles_2["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles_2["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
} else if ((lvlArray1[(i * size) + j] == 12) or (lvlArray1[(i * size) + j] == 27)) {
all_m.tiles_2.attachMovie("o_tiles", "o_tiles_" + k, 10 * k);
all_m.tiles_2["o_tiles_" + k].gotoAndStop(1);
all_m.tiles_2["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles_2["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
} else if (((lvlArray1[(i * size) + j] == 31) or (lvlArray1[(i * size) + j] == 33)) or (lvlArray1[(i * size) + j] == 40)) {
all_m.tiles_2.attachMovie("o_tiles", "o_tiles_" + k, 10 * k);
all_m.tiles_2["o_tiles_" + k].gotoAndStop(29);
all_m.tiles_2["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles_2["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
} else if (((lvlArray1[(i * size) + j] == 32) or (lvlArray1[(i * size) + j] == 34)) or (lvlArray1[(i * size) + j] == 39)) {
all_m.tiles_2.attachMovie("o_tiles", "o_tiles_" + k, 10 * k);
all_m.tiles_2["o_tiles_" + k].gotoAndStop(30);
all_m.tiles_2["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles_2["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
}
kk = ((i - 2) * size) + j;
all_m.tiles.attachMovie("o_tiles", "o_tiles_" + k, 10 * kk);
all_m.tiles["o_tiles_" + k].gotoAndStop(lvlArray1[(i * size) + j]);
all_m.tiles["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
if (lvlArray1[(i * size) + j] == 41) {
all_m.tiles.attachMovie("o_blick", "o_blck_" + blck_count, (10 * kk) + 7);
all_m.tiles["o_blck_" + blck_count].gotoAndStop(1);
all_m.tiles["o_blck_" + blck_count]._x = (2 + (53 * j)) + 18;
all_m.tiles["o_blck_" + blck_count]._y = ((-dx) + (41 * i)) - 18;
blck_count++;
}
k++;
} else if (lvlArray1[(i * size) + j] == 9) {
all_m.tiles_2.attachMovie("o_tiles", "o_tiles_" + k, 10 * k);
all_m.tiles_2["o_tiles_" + k].gotoAndStop(9);
all_m.tiles_2["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles_2["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles.attachMovie("o_wave", "o_wave_" + wave_count, (10 * k) + 7);
all_m.tiles["o_wave_" + wave_count].gotoAndPlay(Math.round(Math.random() * 35));
all_m.tiles["o_wave_" + wave_count]._alpha = 30;
all_m.tiles["o_wave_" + wave_count]._x = ((2 + (53 * j)) + 25) + (Math.random() * 15);
all_m.tiles["o_wave_" + wave_count]._y = ((-dx) + (41 * i)) + 30;
all_m.tiles["o_wave_" + wave_count]._i = i;
all_m.tiles["o_wave_" + wave_count]._j = j;
wave_count = wave_count + 1;
k++;
} else {
all_m.tiles_2.attachMovie("o_tiles", "o_tiles_" + k, 10 * k);
all_m.tiles_2["o_tiles_" + k].gotoAndStop(lvlArray1[(i * size) + j]);
all_m.tiles_2["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles_2["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
k++;
}
} else if (lvlArray1[(i * size) + j] == 100) {
way[(i * size) + j] = 1;
all_m.tiles.o_prince_1._x = (0 + (52 * j)) + 26;
all_m.tiles.o_prince_1._y = 0 + (i * 42);
all_m.tiles_2.attachMovie("o_tiles", "o_tiles_" + k, 10 * k);
all_m.tiles_2["o_tiles_" + k].gotoAndStop(13);
all_m.tiles_2["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles_2["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
k++;
} else if ((((lvlArray1[(i * size) + j] == 101) or (lvlArray1[(i * size) + j] == 103)) or (lvlArray1[(i * size) + j] == 105)) or (lvlArray1[(i * size) + j] == 107)) {
kk = ((i - 2) * size) + j;
way[(i * size) + j] = 0;
all_m.tiles.attachMovie("o_tiles", "o_tiles_" + k, 10 * kk);
all_m.tiles["o_tiles_" + k].gotoAndStop(21 + ((lvlArray1[(i * size) + j] - 99) / 2));
all_m.tiles["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles.attachMovie("o_obj", "o_doors_" + doors, (10 * kk) + 3);
all_m.tiles["o_doors_" + doors]._x = 2 + (53 * j);
all_m.tiles["o_doors_" + doors]._y = ((-dx) + (41 * i)) - 65;
all_m.tiles["o_doors_" + doors].tp = (lvlArray1[(i * size) + j] - 99) / 2;
all_m.tiles["o_doors_" + doors].gotoAndStop(1 + ((all_m.tiles["o_doors_" + doors].tp - 1) * 3));
all_m.tiles["o_doors_" + doors].cell = (i * size) + j;
all_m.tiles.attachMovie("o_shadow", "o_shadow_" + (3 * doors), (10 * ((((i - 2) * size) + j) - 1)) + 1);
all_m.tiles["o_shadow_" + (3 * doors)].gotoAndStop(2);
all_m.tiles["o_shadow_" + (3 * doors)]._x = 2 + (53 * (j - 1));
all_m.tiles["o_shadow_" + (3 * doors)]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles.attachMovie("o_shadow", ("o_shadow_" + (3 * doors)) + 1, (10 * ((((i - 2) * size) + j) + 1)) + 1);
all_m.tiles[("o_shadow_" + (3 * doors)) + 1].gotoAndStop(3);
all_m.tiles[("o_shadow_" + (3 * doors)) + 1]._x = 2 + (53 * (j + 1));
all_m.tiles[("o_shadow_" + (3 * doors)) + 1]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles.attachMovie("o_shadow", ("o_shadow_" + (3 * doors)) + 2, (10 * ((((i + 1) - 2) * size) + j)) + 1);
all_m.tiles[("o_shadow_" + (3 * doors)) + 2].gotoAndStop(1);
all_m.tiles[("o_shadow_" + (3 * doors)) + 2]._x = 2 + (53 * j);
all_m.tiles[("o_shadow_" + (3 * doors)) + 2]._y = ((-dx) + (41 * (i + 1))) - 50;
k++;
doors++;
} else if ((((lvlArray1[(i * size) + j] == 109) or (lvlArray1[(i * size) + j] == 111)) or (lvlArray1[(i * size) + j] == 113)) or (lvlArray1[(i * size) + j] == 115)) {
kk = ((i - 2) * size) + j;
way[(i * size) + j] = 1;
all_m.tiles.attachMovie("o_tiles", "o_tiles_" + k, 10 * kk);
all_m.tiles["o_tiles_" + k].gotoAndStop(21 + ((lvlArray1[(i * size) + j] - 107) / 2));
all_m.tiles["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles.attachMovie("o_obj", "o_doors_" + doors, (10 * kk) + 3);
all_m.tiles["o_doors_" + doors]._x = 2 + (53 * j);
all_m.tiles["o_doors_" + doors]._y = ((-dx) + (41 * i)) - 65;
all_m.tiles["o_doors_" + doors].tp = (lvlArray1[(i * size) + j] - 107) / 2;
all_m.tiles["o_doors_" + doors].gotoAndStop(1 + ((all_m.tiles["o_doors_" + doors].tp - 1) * 3));
all_m.tiles["o_doors_" + doors].cell = (i * size) + j;
all_m.tiles["o_doors_" + doors]._visible = 0;
all_m.tiles.attachMovie("o_shadow", "o_shadow_" + (3 * doors), (10 * ((((i - 2) * size) + j) - 1)) + 1);
all_m.tiles["o_shadow_" + (3 * doors)].gotoAndStop(2);
all_m.tiles["o_shadow_" + (3 * doors)]._x = 2 + (53 * (j - 1));
all_m.tiles["o_shadow_" + (3 * doors)]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles["o_shadow_" + (3 * doors)]._visible = 0;
all_m.tiles.attachMovie("o_shadow", ("o_shadow_" + (3 * doors)) + 1, (10 * ((((i - 2) * size) + j) + 1)) + 1);
all_m.tiles[("o_shadow_" + (3 * doors)) + 1].gotoAndStop(3);
all_m.tiles[("o_shadow_" + (3 * doors)) + 1]._x = 2 + (53 * (j + 1));
all_m.tiles[("o_shadow_" + (3 * doors)) + 1]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles[("o_shadow_" + (3 * doors)) + 1]._visible = 0;
all_m.tiles.attachMovie("o_shadow", ("o_shadow_" + (3 * doors)) + 2, (10 * ((((i + 1) - 2) * size) + j)) + 1);
all_m.tiles[("o_shadow_" + (3 * doors)) + 2].gotoAndStop(1);
all_m.tiles[("o_shadow_" + (3 * doors)) + 2]._x = 2 + (53 * j);
all_m.tiles[("o_shadow_" + (3 * doors)) + 2]._y = ((-dx) + (41 * (i + 1))) - 50;
all_m.tiles[("o_shadow_" + (3 * doors)) + 2]._visible = 0;
k++;
doors++;
} else if ((((lvlArray1[(i * size) + j] == 102) or (lvlArray1[(i * size) + j] == 104)) or (lvlArray1[(i * size) + j] == 106)) or (lvlArray1[(i * size) + j] == 108)) {
kk = ((i - 2) * size) + j;
way[(i * size) + j] = 6;
all_m.tiles.attachMovie("o_obj", "o_button_" + btn_number, (10 * kk) + 3);
all_m.tiles["o_button_" + btn_number]._x = 2 + (53 * j);
all_m.tiles["o_button_" + btn_number]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles["o_button_" + btn_number].tp = (lvlArray1[(i * size) + j] - 100) / 2;
all_m.tiles["o_button_" + btn_number].gotoAndStop(all_m.tiles["o_button_" + btn_number].tp * 3);
all_m.tiles["o_button_" + btn_number].ind = 2;
all_m.tiles["o_button_" + btn_number].coord = k;
k++;
btn_number++;
} else if ((((lvlArray1[(i * size) + j] == 110) or (lvlArray1[(i * size) + j] == 112)) or (lvlArray1[(i * size) + j] == 114)) or (lvlArray1[(i * size) + j] == 116)) {
kk = ((i - 2) * size) + j;
way[(i * size) + j] = 6;
all_m.tiles.attachMovie("o_obj", "o_button_" + btn_number, (10 * kk) + 3);
all_m.tiles["o_button_" + btn_number]._x = 2 + (53 * j);
all_m.tiles["o_button_" + btn_number]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles["o_button_" + btn_number].tp = (lvlArray1[(i * size) + j] - 108) / 2;
all_m.tiles["o_button_" + btn_number].gotoAndStop((all_m.tiles["o_button_" + btn_number].tp * 3) - 1);
all_m.tiles["o_button_" + btn_number].ind = 3;
all_m.tiles["o_button_" + btn_number].coord = k;
k++;
btn_number++;
} else if ((((lvlArray1[(i * size) + j] == 152) or (lvlArray1[(i * size) + j] == 154)) or (lvlArray1[(i * size) + j] == 156)) or (lvlArray1[(i * size) + j] == 158)) {
kk = ((i - 2) * size) + j;
way[(i * size) + j] = 1;
way_obj[(i * size) + j] = lvlArray1[(i * size) + j];
all_m.tiles.attachMovie("o_obj", "o_teleport_" + teleports, (10 * kk) + 3);
all_m.tiles["o_teleport_" + teleports]._x = 2 + (53 * j);
all_m.tiles["o_teleport_" + teleports]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles["o_teleport_" + teleports].tp = (lvlArray1[(i * size) + j] - 150) / 2;
all_m.tiles["o_teleport_" + teleports].gotoAndStop(18 + all_m.tiles["o_teleport_" + teleports].tp);
all_m.tiles["o_teleport_" + teleports].coord = k;
all_m.tiles["o_teleport_" + teleports].i = i;
all_m.tiles["o_teleport_" + teleports].j = j;
all_m.tiles.attachMovie("o_tel", "o_tel_" + (2 * teleports), 4000 + (2 * teleports));
all_m.tiles["o_tel_" + (2 * teleports)].gotoAndStop(all_m.tiles["o_teleport_" + teleports].tp);
all_m.tiles["o_tel_" + (2 * teleports)]._x = (2 + (53 * (j - 1))) + 80;
all_m.tiles["o_tel_" + (2 * teleports)]._y = ((-dx) + (41 * i)) - 20;
all_m.tiles.attachMovie("o_tel", ("o_tel_" + (2 * teleports)) + 1, (4000 + (2 * teleports)) + 1);
all_m.tiles[("o_tel_" + (2 * teleports)) + 1].gotoAndStop(all_m.tiles["o_teleport_" + teleports].tp);
all_m.tiles[("o_tel_" + (2 * teleports)) + 1]._x = (2 + (53 * (j - 1))) + 80;
all_m.tiles[("o_tel_" + (2 * teleports)) + 1]._y = ((-dx) + (41 * i)) - 20;
k++;
teleports++;
} else if (lvlArray1[(i * size) + j] == 180) {
way[(i * size) + j] = 1;
way_obj[(i * size) + j] = 180;
all_m.tiles_2.attachMovie("o_tiles", "o_tiles_" + k, 10 * k);
all_m.tiles_2["o_tiles_" + k].gotoAndStop(13);
all_m.tiles_2["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles_2["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
kk = ((i - 2) * size) + j;
all_m.tiles.attachMovie("o_key", "o_key_1", (10 * kk) + 6);
all_m.tiles.o_key_1.gotoAndStop(1);
all_m.tiles.o_key_1._x = (2 + (53 * j)) + 2;
all_m.tiles.o_key_1._y = ((-dx) + (41 * i)) - 63;
all_m.tiles.attachMovie("o_key_shadow", "o_key_2", (10 * kk) + 5);
all_m.tiles.o_key_2.gotoAndStop(1);
all_m.tiles.o_key_2._x = (2 + (53 * j)) + 27;
all_m.tiles.o_key_2._y = ((-dx) + (41 * i)) + 18;
all_m.tiles.attachMovie("o_blick", "o_blick_2", (10 * kk) + 7);
all_m.tiles.o_blick_2._x = all_m.tiles.o_key_1._x + 3;
all_m.tiles.o_blick_2._y = all_m.tiles.o_key_1._y + 63;
k++;
} else if (lvlArray1[(i * size) + j] == 179) {
way[(i * size) + j] = 1;
all_m.tiles_2.attachMovie("o_tiles", "o_tiles_" + k, 10 * k);
all_m.tiles_2["o_tiles_" + k].gotoAndStop(13);
all_m.tiles_2["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles_2["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
if (stars[cur_level_number] == 0) {
way_obj[(i * size) + j] = 179;
all_m.tiles.attachMovie("o_key", "o_key_3", (10 * k) + 6);
all_m.tiles.o_key_3.gotoAndStop(2);
all_m.tiles.o_key_3._x = (2 + (53 * j)) + 2;
all_m.tiles.o_key_3._y = ((-dx) + (41 * i)) - 63;
all_m.tiles.attachMovie("o_key_shadow", "o_key_4", (10 * k) + 5);
all_m.tiles.o_key_4.gotoAndStop(1);
all_m.tiles.o_key_4._x = (2 + (53 * j)) + 27;
all_m.tiles.o_key_4._y = ((-dx) + (41 * i)) + 18;
all_m.tiles.attachMovie("o_blick", "o_blick_1", (10 * k) + 7);
all_m.tiles.o_blick_1._x = all_m.tiles.o_key_3._x + 3;
all_m.tiles.o_blick_1._y = all_m.tiles.o_key_3._y + 63;
}
k++;
} else if (lvlArray1[(i * size) + j] == 181) {
way[(i * size) + j] = 0;
way_obj[(i * size) + j] = 181;
all_m.tiles_2.attachMovie("o_tiles", "o_tiles_" + k, 10 * k);
all_m.tiles_2["o_tiles_" + k].gotoAndStop(13);
all_m.tiles_2["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles_2["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
kk = ((i - 2) * size) + j;
all_m.tiles.attachMovie("o_frog_blick", "o_finish_3", (10 * kk) + 5);
all_m.tiles.o_finish_3.gotoAndStop(1);
all_m.tiles.o_finish_3._x = (2 + (53 * j)) + 24;
all_m.tiles.o_finish_3._y = (41 * i) - 20;
all_m.tiles.attachMovie("o_princess_b", "o_finish_1", (10 * kk) + 7);
all_m.tiles.o_finish_1.gotoAndStop(2);
all_m.tiles.o_finish_1._x = 2 + (53 * j);
all_m.tiles.o_finish_1._y = (41 * i) + 9;
all_m.tiles.attachMovie("o_princess_f", "o_finish_2", (10 * kk) + 6);
all_m.tiles.o_finish_2.gotoAndStop(2);
all_m.tiles.o_finish_2._x = (2 + (53 * j)) + 26;
all_m.tiles.o_finish_2._y = 41 * i;
k++;
} else if (lvlArray1[(i * size) + j] == 182) {
way[(i * size) + j] = 1;
all_m.tiles.attachMovie("o_prince", "o_prince_11", 5989);
all_m.tiles.o_prince_11.side_prev = 4;
all_m.tiles.o_prince_11.side = 4;
all_m.tiles.o_prince_11.was_in = 0;
all_m.tiles.attachMovie("o_prince_f", "o_prince_12", 5990);
all_m.tiles.attachMovie("o_pirate_b", "o_prince_13", 5991);
all_m.tiles.attachMovie("o_cell_mask", "o_prince_14", 5988);
all_m.tiles.o_prince_11._visible = 0;
all_m.tiles.o_prince_12._visible = 1;
all_m.tiles.o_prince_13._visible = 1;
all_m.tiles.o_prince_14._visible = 0;
all_m.tiles.o_prince_11._x = (0 + (52 * j)) + 26;
all_m.tiles.o_prince_11._y = 0 + (i * 42);
all_m.tiles_2.attachMovie("o_tiles", "o_tiles_" + k, 10 * k);
all_m.tiles_2["o_tiles_" + k].gotoAndStop(13);
all_m.tiles_2["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles_2["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
k++;
} else if (lvlArray1[(i * size) + j] == 183) {
way[(i * size) + j] = 1;
way_obj[(i * size) + j] = 183;
all_m.tiles.attachMovie("o_obj", "o_tiles_" + k, 10 * k);
all_m.tiles["o_tiles_" + k].gotoAndStop(15);
all_m.tiles["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
k++;
} else if (lvlArray1[(i * size) + j] == 184) {
way[(i * size) + j] = 1;
way_obj[(i * size) + j] = 184;
all_m.tiles.attachMovie("o_obj", "o_ice_button" + ice_button_number, 10 * k);
all_m.tiles["o_ice_button" + ice_button_number].gotoAndStop(16);
all_m.tiles["o_ice_button" + ice_button_number]._x = 2 + (53 * j);
all_m.tiles["o_ice_button" + ice_button_number]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles["o_ice_button" + ice_button_number].number = ice_button_number;
all_m.tiles["o_ice_button" + ice_button_number].coord = k;
k++;
ice_button_number++;
} else if (lvlArray1[(i * size) + j] == 185) {
way[(i * size) + j] = 0;
way_obj[(i * size) + j] = 195;
all_m.tiles.attachMovie("o_obj", "o_tiles_" + k, 10 * k);
all_m.tiles["o_tiles_" + k].gotoAndStop(18);
all_m.tiles["o_tiles_" + k]._x = 2 + (53 * j);
all_m.tiles["o_tiles_" + k]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles.attachMovie("o_prince", "o_iceball_" + (3 * iceball_number), (10 * k) + 7);
all_m.tiles["o_iceball_" + (3 * iceball_number)]._x = (0 + (52 * j)) + 26;
all_m.tiles["o_iceball_" + (3 * iceball_number)]._y = 0 + (i * 42);
all_m.tiles["o_iceball_" + (3 * iceball_number)]._visible = 0;
all_m.tiles["o_iceball_" + (3 * iceball_number)].coord = k;
all_m.tiles["o_iceball_" + (3 * iceball_number)].number = 3 * iceball_number;
all_m.tiles["o_iceball_" + (3 * iceball_number)].side_prev = 1;
all_m.tiles["o_iceball_" + (3 * iceball_number)].side = 0;
all_m.tiles["o_iceball_" + (3 * iceball_number)].go = 0;
all_m.tiles.attachMovie("o_iceball", ("o_iceball_" + (3 * iceball_number)) + 1, (10 * k) + 8);
all_m.tiles[("o_iceball_" + (3 * iceball_number)) + 1].go = 0;
all_m.tiles.attachMovie("o_cell_mask", ("o_iceball_" + (3 * iceball_number)) + 2, (10 * k) + 9);
all_m.tiles[("o_iceball_" + (3 * iceball_number)) + 2]._visible = 0;
k++;
iceball_number++;
}
if (tools_stand[(i * size) + j] == 1) {
tool_noexit_count--;
kk = ((i - 2) * size) + j;
way_obj[(i * size) + j] = 7;
all_m.tiles.attachMovie("o_obj", "o_noexit_" + noexit_number, (10 * kk) + 3);
all_m.tiles["o_noexit_" + noexit_number]._x = 2 + (53 * j);
all_m.tiles["o_noexit_" + noexit_number]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles["o_noexit_" + noexit_number].gotoAndStop(13);
all_m.tiles["o_noexit_" + noexit_number].number = noexit_number;
all_m.tiles["o_noexit_" + noexit_number].coord = kk;
all_m.tiles.attachMovie("o_shadow", "o_shadow2_" + (3 * noexit_number), (10 * (kk - 1)) + 1);
all_m.tiles["o_shadow2_" + (3 * noexit_number)].gotoAndStop(2);
all_m.tiles["o_shadow2_" + (3 * noexit_number)]._x = 2 + (53 * (j - 1));
all_m.tiles["o_shadow2_" + (3 * noexit_number)]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles["o_shadow2_" + (3 * noexit_number)]._visible = 0;
all_m.tiles.attachMovie("o_shadow", ("o_shadow2_" + (3 * noexit_number)) + 1, (10 * (kk + 1)) + 1);
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 1].gotoAndStop(3);
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 1]._x = 2 + (53 * (j + 1));
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 1]._y = ((-dx) + (41 * i)) - 50;
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 1]._visible = 0;
all_m.tiles.attachMovie("o_shadow", ("o_shadow2_" + (3 * noexit_number)) + 2, (10 * kk) + 1);
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 2].gotoAndStop(1);
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 2]._x = 2 + (53 * j);
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 2]._y = ((-dx) + (41 * (i + 1))) - 50;
all_m.tiles[("o_shadow2_" + (3 * noexit_number)) + 2]._visible = 0;
noexit_number++;
} else if (tools_stand[(i * size) + j] == 2) {
tool_come_count--;
kk = ((i - 2) * size) + j;
way_obj[(i * size) + j] = 8;
all_m.tiles.attachMovie("o_wood_princess", "o_comehere_" + (2 * comehere_number), (10 * kk) + 7);
all_m.tiles["o_comehere_" + (2 * comehere_number)].gotoAndStop(1);
all_m.tiles["o_comehere_" + (2 * comehere_number)]._x = 2 + (53 * j);
all_m.tiles["o_comehere_" + (2 * comehere_number)]._y = ((-dx) + (41 * i)) - 78;
all_m.tiles["o_comehere_" + (2 * comehere_number)].coord = kk;
all_m.tiles.attachMovie("o_key_shadow", "o_comehere_" + ((2 * comehere_number) + 1), (10 * kk) + 6);
all_m.tiles["o_comehere_" + ((2 * comehere_number) + 1)].gotoAndStop(1);
all_m.tiles["o_comehere_" + ((2 * comehere_number) + 1)]._x = (2 + (53 * j)) + 27;
all_m.tiles["o_comehere_" + ((2 * comehere_number) + 1)]._y = ((-dx) + (41 * i)) + 23;
all_m.tiles["o_comehere_" + ((2 * comehere_number) + 1)]._xscale = 130;
all_m.tiles["o_comehere_" + ((2 * comehere_number) + 1)]._yscale = 130;
comehere_number++;
}
j = j + 1;
}
i = i + 1;
}
tiles_bmp.draw(all_m.tiles_2);
all_m.tiles_back.attachBitmap(tiles_bmp, all_m.getNextHighestDepth());
all_m.tiles_2.removeMovieClip();
show_blick(all_m.tiles.o_blick_1);
show_blick_2(all_m.tiles.o_blick_2);
var i = 0;
while (i < blck_count) {
show_blick3(all_m.tiles["o_blck_" + i]);
i = i + 1;
}
all_m.tiles.attachMovie("o_chosen_cell", "o_chosen_cell_99", 10000);
all_m.tiles.o_chosen_cell_99._alpha = 35;
all_m.createEmptyMovieClip("panel", all_m.getNextHighestDepth());
all_m.panel.attachMovie("o_panel", "o_panel_0", 0);
all_m.panel.o_panel_0._x = 615;
all_m.panel.o_panel_0._y = 15;
all_m.panel.o_panel_0.gotoAndStop(1);
all_m.panel.attachMovie("o_but_music", "o_panel_1", 1);
all_m.panel.o_panel_1._x = all_m.panel.o_panel_0._x - 55;
all_m.panel.o_panel_1._y = all_m.panel.o_panel_0._y - 11;
if (music_enable == 0) {
all_m.panel.o_panel_1.gotoAndStop(3);
all_m.panel.o_panel_1.curr = 3;
} else if (music_enable == 1) {
all_m.panel.o_panel_1.curr = 1;
}
all_m.panel.attachMovie("o_but_sound", "o_panel_2", 2);
all_m.panel.o_panel_2._x = all_m.panel.o_panel_0._x - 80;
all_m.panel.o_panel_2._y = all_m.panel.o_panel_0._y - 10;
if (sound_enable == 0) {
all_m.panel.o_panel_2.gotoAndStop(3);
all_m.panel.o_panel_2.curr = 3;
} else if (sound_enable == 1) {
all_m.panel.o_panel_2.curr = 1;
}
all_m.panel.attachMovie("but_menu", "o_panel_3", 3);
all_m.panel.o_panel_3._x = all_m.panel.o_panel_0._x - 4;
all_m.panel.o_panel_3._y = all_m.panel.o_panel_0._y - 9;
all_m.panel.attachMovie("but_restart", "o_panel_4", 4);
all_m.panel.o_panel_4._x = all_m.panel.o_panel_0._x - 29;
all_m.panel.o_panel_4._y = all_m.panel.o_panel_0._y - 10;
all_m.createEmptyMovieClip("inter", all_m.getNextHighestDepth());
all_m.inter.attachMovie("o_inter", "o_inter_0", 0);
all_m.inter.o_inter_0._x = -30;
all_m.inter.attachMovie("inter_but_speed_1", "o_inter_22", 22);
all_m.inter.o_inter_22._x = all_m.inter.o_inter_0._x + 118;
all_m.inter.o_inter_22._y = all_m.inter.o_inter_0._y + 10;
if (hero_speed == 1) {
all_m.inter.o_inter_22._visible = 0;
}
all_m.inter.attachMovie("inter_but_speed_2", "o_inter_23", 23);
all_m.inter.o_inter_23._x = all_m.inter.o_inter_0._x + 118;
all_m.inter.o_inter_23._y = all_m.inter.o_inter_0._y + 10;
if (hero_speed == 0) {
all_m.inter.o_inter_23._visible = 0;
}
all_m.inter.o_inter_22.onRelease = function () {
if (go != 1) {
hero_speed = 1;
p_xspeed = 13;
p_yspeed = 7;
all_m.inter.o_inter_22._visible = 0;
all_m.inter.o_inter_23._visible = 1;
sData_so.data.hero_speed = hero_speed;
sData_so.flush();
}
};
all_m.inter.o_inter_23.onRelease = function () {
if (go != 1) {
hero_speed = 0;
p_xspeed = 4;
p_yspeed = 3;
all_m.inter.o_inter_22._visible = 1;
all_m.inter.o_inter_23._visible = 0;
sData_so.data.hero_speed = hero_speed;
sData_so.flush();
}
};
all_m.inter.attachMovie("o_but_inter_noexit", "o_inter_1", 1);
all_m.inter.o_inter_1._x = all_m.inter.o_inter_0._x + 11;
all_m.inter.o_inter_1.curr = 1;
all_m.inter.attachMovie("o_but_inter_come", "o_inter_2", 2);
all_m.inter.o_inter_2._x = all_m.inter.o_inter_0._x + 64;
all_m.inter.o_inter_2.curr = 1;
all_m.inter.attachMovie("o_inter_grey", "o_inter_20", 20);
all_m.inter.o_inter_20._x = all_m.inter.o_inter_0._x + 11;
all_m.inter.o_inter_20.gotoAndStop(1);
all_m.inter.o_inter_20._visible = 0;
all_m.inter.attachMovie("o_inter_grey", "o_inter_21", 21);
all_m.inter.o_inter_21._x = all_m.inter.o_inter_0._x + 64;
all_m.inter.o_inter_21.gotoAndStop(2);
all_m.inter.o_inter_21._visible = 0;
all_m.inter.attachMovie("o_inter_but_go", "o_inter_3", 3);
all_m.inter.o_inter_3._x = all_m.inter.o_inter_0._x + 146;
all_m.inter.attachMovie("but_inter_walk", "o_inter_10", 10);
all_m.inter.o_inter_10._x = -149;
all_m.inter.o_inter_10._y = 29;
all_m.inter.createTextField("inter_text_1", 4, 50, 50, 200, 100);
all_m.inter.inter_text_1.setTextFormat(format_inter);
all_m.inter.inter_text_1.setNewTextFormat(format_inter);
all_m.inter.inter_text_1.text = tool_noexit_count;
all_m.inter.inter_text_1.selectable = false;
all_m.inter.inter_text_1.embedFonts = true;
if (tool_noexit_count == 1) {
all_m.inter.inter_text_1._x = all_m.inter.o_inter_0._x + 44;
} else {
all_m.inter.inter_text_1._x = all_m.inter.o_inter_0._x + 40;
}
all_m.inter.inter_text_1._y = 5;
all_m.inter.createTextField("inter_text_2", 5, 50, 50, 200, 100);
all_m.inter.inter_text_2.setTextFormat(format_inter);
all_m.inter.inter_text_2.setNewTextFormat(format_inter);
all_m.inter.inter_text_2.text = tool_come_count;
all_m.inter.inter_text_2.selectable = false;
all_m.inter.inter_text_2.embedFonts = true;
if (tool_come_count == 1) {
all_m.inter.inter_text_2._x = all_m.inter.o_inter_0._x + 98;
} else {
all_m.inter.inter_text_2._x = all_m.inter.o_inter_0._x + 94;
}
all_m.inter.inter_text_2._y = 5;
all_m.inter.createTextField("t_star1", 15, 50, 50, 200, 100);
all_m.inter.t_star1.setTextFormat(format_stars3);
all_m.inter.t_star1.setNewTextFormat(format_stars3);
all_m.inter.t_star1.text = (("Level " + (cur_level_number + 1)) + "/") + "21";
all_m.inter.t_star1.selectable = false;
all_m.inter.t_star1.embedFonts = true;
all_m.inter.t_star1.filters = [new flash.filters.DropShadowFilter(distance, angleInDegrees, color, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject)];
all_m.inter.t_star1._x = -455;
all_m.inter.t_star1._y = 18;
all_m.inter._x = 468;
all_m.inter._y = 435;
all_m.createEmptyMovieClip("square_mc_2", all_m.getNextHighestDepth());
all_m.square_mc_2.beginFill(723723);
all_m.square_mc_2.moveTo(0, 0);
all_m.square_mc_2.lineTo(640, 0);
all_m.square_mc_2.lineTo(640, 480);
all_m.square_mc_2.lineTo(0, 480);
all_m.square_mc_2.lineTo(0, 0);
all_m.square_mc_2.endFill();
all_m.square_mc_2.bbb = 0;
all_m.square_mc_2._alpha = 80;
all_m.square_mc_2._visible = 1;
if (been_restart == 0) {
if (back_count == 0) {
PlayMusic(music_back);
} else if (back_count == 1) {
PlayMusic(s_menu_back);
} else if (back_count == 2) {
PlayMusic(music_back);
}
}
tool_aft_srt();
y0 = all_m.tiles.o_prince_3._y;
t = 0;
tt = 0;
ttt = 0;
onEnterFrame = function () {
show_achieve(4);
if (((tool_noexit_count == 0) and (all_m.inter.o_inter_20._visible == 0)) and (go == 0)) {
all_m.inter.o_inter_20._visible = 1;
} else if (((tool_noexit_count != 0) and (all_m.inter.o_inter_20._visible == 1)) and (go == 0)) {
all_m.inter.o_inter_20._visible = 0;
}
if (((tool_come_count == 0) and (all_m.inter.o_inter_21._visible == 0)) and (go == 0)) {
all_m.inter.o_inter_21._visible = 1;
} else if (((tool_come_count != 0) and (all_m.inter.o_inter_21._visible == 1)) and (go == 0)) {
all_m.inter.o_inter_21._visible = 0;
}
if ((((cur_level_number == 1) and (tool_number != 2)) and (tool_come_count != 0)) and (all_m.hints.hint5._x != 520)) {
trace(1);
all_m.hints.hint5._y = 435;
all_m.hints.hint5.y0 = 425;
all_m.hints.hint5._x = 520;
all_m.hints.t_hint3._x = all_m.hints.hint5._x - 36;
all_m.hints.t_hint3._y = all_m.hints.hint5._y - 104;
all_m.hints.t_hint3.text = "click to \rchoose \rcake";
} else if ((((cur_level_number == 1) and (tool_number == 2)) and (tool_come_count != 0)) and (all_m.hints.hint5._x != 295)) {
all_m.hints.hint5._y = 260;
all_m.hints.hint5.y0 = 260;
all_m.hints.hint5._x = 295;
all_m.hints.t_hint3._x = all_m.hints.hint5._x - 36;
all_m.hints.t_hint3._y = all_m.hints.hint5._y - 104;
all_m.hints.t_hint3.text = "click to \rplace \rcake";
} else if (((cur_level_number == 1) and (tool_come_count == 0)) and (all_m.hints.hint5._x != 609)) {
all_m.hints.hint5._y = 435;
all_m.hints.hint5.y0 = 435;
all_m.hints.hint5._x = 609;
all_m.hints.t_hint3._x = all_m.hints.hint5._x - 36;
all_m.hints.t_hint3._y = all_m.hints.hint5._y - 104;
all_m.hints.t_hint3.text = "click to \rstart \rmoving";
}
all_m.hints.t_hint3._visible = all_m.hints.hint5._visible;
all_m.hints.t_hint3._x = all_m.hints.hint5._x - 36;
all_m.hints.t_hint3._y = all_m.hints.hint5._y - 104;
if ((((cur_level_number == 2) and (tool_number != 1)) and (tool_noexit_count != 0)) and (all_m.hints.hint5._x != 470)) {
all_m.hints.hint5._y = 435;
all_m.hints.hint5.y0 = 435;
all_m.hints.hint5._x = 470;
all_m.hints.t_hint3.text = "click to \rchoose \rblock";
} else if ((((cur_level_number == 2) and (tool_number == 1)) and (tool_noexit_count != 0)) and (all_m.hints.hint5._x != 295)) {
all_m.hints.hint5._y = 220;
all_m.hints.hint5.y0 = 220;
all_m.hints.hint5._x = 295;
all_m.hints.t_hint3.text = "click to \rplace \rblock";
} else if (((cur_level_number == 2) and (tool_noexit_count == 0)) and (all_m.hints.hint5._x != 609)) {
all_m.hints.hint5._y = 435;
all_m.hints.hint5.y0 = 435;
all_m.hints.hint5._x = 609;
all_m.hints.t_hint3.text = "click to \rstart \rmoving";
}
if (cur_level_number > 3) {
all_m.hints.t_hint3._visible = 0;
all_m.hints.hint5._visible = 0;
}
if (all_m.square_mc_2._alpha > 0) {
all_m.square_mc_2._alpha = all_m.square_mc_2._alpha - 15;
} else if ((all_m.square_mc_2._alpha <= 0) and (all_m.square_mc_2.bbb == 0)) {
all_m.square_mc_2.bbb = 1;
}
all_m.clouds.o_cloud_0._x = all_m.clouds.o_cloud_0._x + 0.5;
all_m.clouds.o_cloud_1._x = all_m.clouds.o_cloud_1._x + 0.75;
all_m.clouds.o_cloud_2._x = all_m.clouds.o_cloud_2._x + 1;
all_m.tiles["o_!_1"]._x = all_m.tiles.o_prince_1._x - 20;
all_m.tiles["o_!_1"]._y = all_m.tiles.o_prince_1._y - 145;
all_m.tiles.o_prince_2._x = all_m.tiles.o_prince_1._x + 4;
all_m.tiles.o_prince_2._y = all_m.tiles.o_prince_1._y - 6;
all_m.tiles.o_prince_3._x = all_m.tiles.o_prince_1._x + 4;
all_m.tiles.o_prince_3._y = all_m.tiles.o_prince_1._y - 6;
all_m.tiles.o_prince_3._y = all_m.tiles.o_prince_3._y + (y0 + (Math.sin((t = t + 0.35)) * 0.75));
all_m.tiles.o_prince_4._x = all_m.tiles.o_prince_1._x;
all_m.tiles.o_prince_4._y = all_m.tiles.o_prince_1._y + 1;
all_m.tiles.o_prince_12._x = all_m.tiles.o_prince_11._x + 4;
all_m.tiles.o_prince_12._y = all_m.tiles.o_prince_11._y - 6;
all_m.tiles.o_prince_13._x = all_m.tiles.o_prince_11._x + 4;
all_m.tiles.o_prince_13._y = all_m.tiles.o_prince_11._y - 6;
all_m.tiles.o_prince_13._y = all_m.tiles.o_prince_13._y + (y0 + (Math.sin((ttt = ttt + 0.35)) * 0.75));
all_m.tiles.o_prince_14._x = all_m.tiles.o_prince_11._x + 2;
all_m.tiles.o_prince_14._y = all_m.tiles.o_prince_11._y + 1;
var _local2 = 0;
while (_local2 < 3) {
if (all_m.clouds["o_cloud_" + _local2]._x > 715) {
all_m.clouds["o_cloud_" + _local2]._x = -75;
}
_local2 = _local2 + 1;
}
cell_j = Math.floor(_xmouse / 53);
cell_i = Math.floor((_ymouse - 30) / 41);
all_m.tiles.o_chosen_cell_99._x = 2 + (cell_j * 53);
if (_ymouse > 88) {
all_m.tiles.o_chosen_cell_99._y = ((0 + (cell_i * 41)) - 10) - dx;
} else {
all_m.tiles.o_chosen_cell_99._y = 31 - dx;
cell_i = 1;
}
if ((((((((((lvlArray1[((cell_i + 1) * size) + cell_j] == 11) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 12)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 26)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 27)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 31)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 32)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 33)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 34)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 39)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 40)) {
all_m.tiles.o_chosen_cell_99.gotoAndStop(2);
} else {
all_m.tiles.o_chosen_cell_99.gotoAndStop(1);
}
all_m.tiles.o_chosen_cell_99.swapDepths((10 * (((cell_i - 1) * size) + cell_j)) + 2);
if ((tool_number == 1) and (tools_stand[((cell_i + 1) * size) + cell_j] == 0)) {
all_m.tiles.o_chosen_cell_99.gotoAndStop(5);
} else if ((tool_number == 1) and (tools_stand[((cell_i + 1) * size) + cell_j] == 10)) {
all_m.tiles.o_chosen_cell_99.gotoAndStop(6);
} else if ((tool_number == 2) and (tools_stand[((cell_i + 1) * size) + cell_j] == 0)) {
all_m.tiles.o_chosen_cell_99.gotoAndStop(3);
} else if ((tool_number == 2) and (tools_stand[((cell_i + 1) * size) + cell_j] == 10)) {
all_m.tiles.o_chosen_cell_99.gotoAndStop(4);
}
if ((tool_number == 1) and (((tool_noexit_count == 0) or (go == 3)) or (go == 1))) {
all_m.tiles.o_chosen_cell_99.gotoAndStop(6);
} else if ((tool_number == 2) and (((tool_come_count == 0) or (go == 3)) or (go == 1))) {
all_m.tiles.o_chosen_cell_99.gotoAndStop(4);
}
if ((tool_come_count == 0) and (tool_noexit_count == 0)) {
all_m.tiles.o_chosen_cell_99.gotoAndStop(1);
if ((((((((((lvlArray1[((cell_i + 1) * size) + cell_j] == 11) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 12)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 26)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 27)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 31)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 32)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 33)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 34)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 39)) or (lvlArray1[((cell_i + 1) * size) + cell_j] == 40)) {
all_m.tiles.o_chosen_cell_99.gotoAndStop(2);
}
all_m.inter.o_inter_1.curr = 1;
all_m.inter.o_inter_2.curr = 1;
}
if ((way[(hero_i * size) + hero_j] == 6) and (was_in[(hero_i * size) + hero_j] == 0)) {
btn = 0;
cell_number = ((hero_i - 2) * size) + hero_j;
var i = 0;
while (i < btn_number) {
if (all_m.tiles["o_button_" + i].coord == cell_number) {
btn = all_m.tiles["o_button_" + i];
break;
}
i = i + 1;
}
if (btn != 0) {
if (btn.ind == 2) {
var _local5 = 0;
while (_local5 < btn_number) {
if (all_m.tiles["o_button_" + _local5].tp == btn.tp) {
all_m.tiles["o_button_" + _local5].ind = 3;
all_m.tiles["o_button_" + _local5].gotoAndStop((all_m.tiles["o_button_" + _local5].tp * 3) - 1);
}
_local5 = _local5 + 1;
}
was_in[(hero_i * size) + hero_j] = 1;
PlaySound(click_1);
PlaySound(s_door);
_local2 = 0;
while (_local2 < doors) {
if (all_m.tiles["o_doors_" + _local2].tp == btn.tp) {
all_m.tiles["o_doors_" + _local2]._visible = 0;
way[all_m.tiles["o_doors_" + _local2].cell] = 1;
all_m.tiles["o_shadow_" + (3 * _local2)]._visible = 0;
all_m.tiles[("o_shadow_" + (3 * _local2)) + 1]._visible = 0;
all_m.tiles[("o_shadow_" + (3 * _local2)) + 2]._visible = 0;
}
_local2 = _local2 + 1;
}
} else if (btn.ind == 3) {
var _local5 = 0;
while (_local5 < btn_number) {
if (all_m.tiles["o_button_" + _local5].tp == btn.tp) {
all_m.tiles["o_button_" + _local5].ind = 2;
all_m.tiles["o_button_" + _local5].gotoAndStop(all_m.tiles["o_button_" + _local5].tp * 3);
}
_local5 = _local5 + 1;
}
was_in[(hero_i * size) + hero_j] = 1;
PlaySound(click_1);
PlaySound(s_door);
_local2 = 0;
while (_local2 < doors) {
if (all_m.tiles["o_doors_" + _local2].tp == btn.tp) {
all_m.tiles["o_doors_" + _local2]._visible = 1;
way[all_m.tiles["o_doors_" + _local2].cell] = 0;
all_m.tiles["o_shadow_" + (3 * _local2)]._visible = 1;
all_m.tiles[("o_shadow_" + (3 * _local2)) + 1]._visible = 1;
all_m.tiles[("o_shadow_" + (3 * _local2)) + 2]._visible = 1;
}
_local2 = _local2 + 1;
}
}
}
}
if ((way[(h_i * size) + h_j] == 6) and (was_in[(h_i * size) + h_j] == 0)) {
btn = 0;
cell_number = ((h_i - 2) * size) + h_j;
var i = 0;
while (i < btn_number) {
if (all_m.tiles["o_button_" + i].coord == cell_number) {
btn = all_m.tiles["o_button_" + i];
break;
}
i = i + 1;
}
if (btn != 0) {
if (btn.ind == 2) {
var _local5 = 0;
while (_local5 < btn_number) {
if (all_m.tiles["o_button_" + _local5].tp == btn.tp) {
all_m.tiles["o_button_" + _local5].ind = 3;
all_m.tiles["o_button_" + _local5].gotoAndStop((all_m.tiles["o_button_" + _local5].tp * 3) - 1);
}
_local5 = _local5 + 1;
}
was_in[(h_i * size) + h_j] = 1;
PlaySound(click_1);
PlaySound(s_door);
_local2 = 0;
while (_local2 < doors) {
if (all_m.tiles["o_doors_" + _local2].tp == btn.tp) {
all_m.tiles["o_doors_" + _local2]._visible = 0;
way[all_m.tiles["o_doors_" + _local2].cell] = 1;
all_m.tiles["o_shadow_" + (3 * _local2)]._visible = 0;
all_m.tiles[("o_shadow_" + (3 * _local2)) + 1]._visible = 0;
all_m.tiles[("o_shadow_" + (3 * _local2)) + 2]._visible = 0;
}
_local2 = _local2 + 1;
}
} else if (btn.ind == 3) {
var _local5 = 0;
while (_local5 < btn_number) {
if (all_m.tiles["o_button_" + _local5].tp == btn.tp) {
all_m.tiles["o_button_" + _local5].ind = 2;
all_m.tiles["o_button_" + _local5].gotoAndStop(all_m.tiles["o_button_" + _local5].tp * 3);
}
_local5 = _local5 + 1;
}
was_in[(h_i * size) + h_j] = 1;
PlaySound(click_1);
PlaySound(s_door);
_local2 = 0;
while (_local2 < doors) {
if (all_m.tiles["o_doors_" + _local2].tp == btn.tp) {
all_m.tiles["o_doors_" + _local2]._visible = 1;
way[all_m.tiles["o_doors_" + _local2].cell] = 0;
all_m.tiles["o_shadow_" + (3 * _local2)]._visible = 1;
all_m.tiles[("o_shadow_" + (3 * _local2)) + 1]._visible = 1;
all_m.tiles[("o_shadow_" + (3 * _local2)) + 2]._visible = 1;
}
_local2 = _local2 + 1;
}
}
}
}
if ((way_obj[(hero_i * size) + hero_j] == 7) and (was_in[(hero_i * size) + hero_j] == 0)) {
cell_number = ((hero_i - 2) * size) + hero_j;
if (in_cell_now == 0) {
in_cell_now = ((hero_i - 2) * size) + hero_j;
} else if (in_cell_now != 0) {
change_noexit(no_exit_curr);
way[in_cell_now + 24] = 0;
in_cell_now = 0;
no_exit_curr = 0;
in_cell_now = ((hero_i - 2) * size) + hero_j;
}
var i = 0;
while (i < noexit_number) {
if (all_m.tiles["o_noexit_" + i].coord == cell_number) {
no_exit_curr = i;
break;
}
i = i + 1;
}
cellcell = (hero_i * size) + hero_j;
was_in[(hero_i * size) + hero_j] = 1;
}
if ((way_obj[(h_i * size) + h_j] == 7) and (was_in[(h_i * size) + h_j] == 0)) {
cell_number = ((h_i - 2) * size) + h_j;
if (in_cell_now == 0) {
in_cell_now = ((h_i - 2) * size) + h_j;
} else if (in_cell_now != 0) {
change_noexit(no_exit_curr);
way[in_cell_now + 24] = 0;
in_cell_now = 0;
no_exit_curr = 0;
in_cell_now = ((h_i - 2) * size) + h_j;
}
var i = 0;
while (i < noexit_number) {
if (all_m.tiles["o_noexit_" + i].coord == cell_number) {
no_exit_curr = i;
break;
}
i = i + 1;
}
cellcell = (h_i * size) + h_j;
was_in[(h_i * size) + h_j] = 1;
}
if ((way_obj[(h_i * size) + h_j] == 183) and (was_in[(h_i * size) + h_j] == 0)) {
PlaySound(s_magic_boom);
boom(all_m.tiles.o_prince_13._x + 15, all_m.tiles.o_prince_13._y - 40);
all_m.tiles.o_prince_14.removeMovieClip();
all_m.tiles.o_prince_13.removeMovieClip();
all_m.tiles.o_prince_12.removeMovieClip();
all_m.tiles.o_prince_11.removeMovieClip();
}
if ((way_obj[(hero_i * size) + hero_j] == 183) and (was_in[(hero_i * size) + hero_j] == 0)) {
was_in[(hero_i * size) + hero_j] = 1;
kill_prince();
cur_try = try_number;
all_m.inter.o_inter_21.removeMovieClip();
all_m.inter.o_inter_20.removeMovieClip();
setTimeout(function () {
if (cur_try == try_number) {
all_m.after_level._xscale = 0;
all_m.after_level._yscale = 0;
all_m.after_level.o_after_level_menu7._visible = 1;
all_m.after_level.o_after_level_menu5._y = -184;
all_m.after_level.o_after_level_menu5._x = -144;
all_m.after_level.o_after_level_menu5.gotoAndStop(3);
all_m.after_level.o_after_level_menu5._visible = 1;
all_m.panel.o_panel_4._visible = 0;
all_m.panel.o_panel_3._visible = 0;
all_m.after_level._visible = 1;
all_m.square_mc._alpha = 0;
all_m.square_mc._visible = 1;
music_back.stop();
go = 3;
PlaySound(s_fail);
}
}, 1000);
} else if ((way_obj[(hero_i * size) + hero_j] == 184) and (was_in[(hero_i * size) + hero_j] == 0)) {
PlaySound(s_click);
PlaySound(s_snowball);
cell_number = ((hero_i - 2) * size) + hero_j;
var i = 0;
while (i < ice_button_number) {
if (all_m.tiles["o_ice_button" + i].coord == cell_number) {
all_m.tiles["o_ice_button" + i].gotoAndStop(17);
break;
}
i = i + 1;
}
cellcell = (hero_i * size) + hero_j;
was_in[(hero_i * size) + hero_j] = 1;
way_obj[(hero_i * size) + hero_j] = 0;
_local2 = 0;
while (_local2 < 12) {
if (way_obj[(hero_i * size) + _local2] == 195) {
if (_local2 < hero_j) {
trace("left");
var i = 0;
while (i < (3 * iceball_number)) {
if (all_m.tiles["o_iceball_" + i].coord == (((hero_i - 2) * size) + _local2)) {
trace("!!");
all_m.tiles["o_iceball_" + i].go = 1;
all_m.tiles[("o_iceball_" + i) + 1].go = 1;
all_m.tiles["o_iceball_" + i].side_prev = 1;
}
i = i + 3;
}
} else if (_local2 > hero_j) {
trace("right");
var i = 0;
while (i < (3 * iceball_number)) {
if (all_m.tiles["o_iceball_" + i].coord == (((hero_i - 2) * size) + _local2)) {
all_m.tiles["o_iceball_" + i].go = 1;
all_m.tiles[("o_iceball_" + i) + 1].go = 1;
all_m.tiles["o_iceball_" + i].side_prev = 3;
}
i = i + 3;
}
}
}
if (way_obj[(_local2 * size) + hero_j] == 195) {
if (_local2 < hero_i) {
trace("up");
var i = 0;
while (i < (3 * iceball_number)) {
if (all_m.tiles["o_iceball_" + i].coord == (((_local2 - 2) * size) + hero_j)) {
all_m.tiles["o_iceball_" + i].go = 1;
all_m.tiles[("o_iceball_" + i) + 1].go = 1;
all_m.tiles["o_iceball_" + i].side_prev = 4;
}
i = i + 3;
}
} else if (_local2 > hero_i) {
trace("down");
var i = 0;
while (i < (3 * iceball_number)) {
if (all_m.tiles["o_iceball_" + i].coord == (((_local2 - 2) * size) + hero_j)) {
all_m.tiles["o_iceball_" + i].go = 1;
all_m.tiles[("o_iceball_" + i) + 1].go = 1;
all_m.tiles["o_iceball_" + i].side_prev = 2;
}
i = i + 3;
}
}
}
_local2 = _local2 + 1;
}
}
if ((way_obj[(h_i * size) + h_j] == 184) and (was_in[(h_i * size) + h_j] == 0)) {
cell_number = ((h_i - 2) * size) + h_j;
var i = 0;
while (i < ice_button_number) {
if (all_m.tiles["o_ice_button" + i].coord == cell_number) {
all_m.tiles["o_ice_button" + i].gotoAndStop(17);
break;
}
i = i + 1;
}
cellcell = (h_i * size) + h_j;
was_in[(h_i * size) + h_j] = 1;
way_obj[(h_i * size) + h_j] = 0;
PlaySound(click_1);
PlaySound(s_snowball);
_local2 = 0;
while (_local2 < 12) {
if (way_obj[(h_i * size) + _local2] == 195) {
if (_local2 < h_j) {
cellcount = 0;
var _local3 = 0;
while (_local3 < Math.abs(h_j - _local2)) {
if (way[((h_i * size) + _local2) + _local3] > 0) {
cellcount = cellcount + 1;
}
_local3 = _local3 + 1;
}
if (cellcount == Math.abs((h_j - _local2) - 1)) {
trace("left");
var i = 0;
while (i < (3 * iceball_number)) {
if (all_m.tiles["o_iceball_" + i].coord == (((h_i - 2) * size) + _local2)) {
trace("!!");
all_m.tiles["o_iceball_" + i].go = 1;
all_m.tiles[("o_iceball_" + i) + 1].go = 1;
all_m.tiles["o_iceball_" + i].side_prev = 1;
}
i = i + 3;
}
}
} else if (_local2 > h_j) {
cellcount = 0;
var _local3 = 0;
while (_local3 < Math.abs(h_j - _local2)) {
if (way[((h_i * size) + h_j) + _local3] > 0) {
cellcount = cellcount + 1;
}
_local3 = _local3 + 1;
}
if (cellcount == Math.abs(h_j - _local2)) {
trace("right");
var i = 0;
while (i < (3 * iceball_number)) {
if (all_m.tiles["o_iceball_" + i].coord == (((h_i - 2) * size) + _local2)) {
all_m.tiles["o_iceball_" + i].go = 1;
all_m.tiles[("o_iceball_" + i) + 1].go = 1;
all_m.tiles["o_iceball_" + i].side_prev = 3;
}
i = i + 3;
}
}
}
}
if (way_obj[(_local2 * size) + h_j] == 195) {
if (_local2 < h_i) {
cellcount = 0;
var _local4 = 0;
while (_local4 < Math.abs(h_i - _local2)) {
if (way[((_local2 + _local4) * size) + h_j] > 0) {
cellcount = cellcount + 1;
}
_local4 = _local4 + 1;
}
if (cellcount == Math.abs((h_i - _local2) - 1)) {
trace("up");
var i = 0;
while (i < (3 * iceball_number)) {
if (all_m.tiles["o_iceball_" + i].coord == (((_local2 - 2) * size) + h_j)) {
all_m.tiles["o_iceball_" + i].go = 1;
all_m.tiles[("o_iceball_" + i) + 1].go = 1;
all_m.tiles["o_iceball_" + i].side_prev = 4;
}
i = i + 3;
}
}
} else if (_local2 > h_i) {
cellcount = 0;
var _local4 = 0;
while (_local4 < Math.abs(h_i - _local2)) {
if (way[((h_i + _local4) * size) + h_j] > 0) {
cellcount = cellcount + 1;
}
_local4 = _local4 + 1;
}
if (cellcount == Math.abs(h_i - _local2)) {
trace("down");
var i = 0;
while (i < (3 * iceball_number)) {
if (all_m.tiles["o_iceball_" + i].coord == (((_local2 - 2) * size) + h_j)) {
all_m.tiles["o_iceball_" + i].go = 1;
all_m.tiles[("o_iceball_" + i) + 1].go = 1;
all_m.tiles["o_iceball_" + i].side_prev = 2;
}
i = i + 3;
}
}
}
}
_local2 = _local2 + 1;
}
}
if (((all_m.tiles.o_prince_1.side == 1) or (all_m.tiles.o_prince_1.side == 3)) and (go == 1)) {
var i = 0;
while (i < 12) {
if (way_obj[(i * size) + hero_j] == 8) {
if (i < hero_i) {
cellcount = 0;
var _local4 = 0;
while (_local4 < Math.abs(hero_i - i)) {
if (way[((i + _local4) * size) + hero_j] > 0) {
cellcount = cellcount + 1;
}
_local4 = _local4 + 1;
}
if (cellcount == Math.abs(hero_i - i)) {
all_m.tiles["o_!_1"]._visible = 1;
setTimeout(function () {
all_m.tiles["o_!_1"]._visible = 0;
}, 100);
all_m.tiles.o_prince_1.side_prev = 2;
}
} else if (i > hero_i) {
cellcount = 0;
var _local4 = 0;
while (_local4 < Math.abs(hero_i - i)) {
if (way[((hero_i + _local4) * size) + hero_j] > 0) {
cellcount = cellcount + 1;
}
_local4 = _local4 + 1;
}
if (cellcount == Math.abs(hero_i - i)) {
all_m.tiles["o_!_1"]._visible = 1;
setTimeout(function () {
all_m.tiles["o_!_1"]._visible = 0;
}, 100);
all_m.tiles.o_prince_1.side_prev = 4;
}
}
}
i = i + 1;
}
} else if (((all_m.tiles.o_prince_1.side == 2) or (all_m.tiles.o_prince_1.side == 4)) and (go == 1)) {
_local2 = 0;
while (_local2 < 12) {
if (way_obj[(hero_i * size) + _local2] == 8) {
if (_local2 < hero_j) {
cellcount = 0;
var _local3 = 0;
while (_local3 < Math.abs(hero_j - _local2)) {
if (way[((hero_i * size) + _local2) + _local3] > 0) {
cellcount = cellcount + 1;
}
_local3 = _local3 + 1;
}
if (cellcount == Math.abs(hero_j - _local2)) {
all_m.tiles["o_!_1"]._visible = 1;
setTimeout(function () {
all_m.tiles["o_!_1"]._visible = 0;
}, 100);
all_m.tiles.o_prince_1.side_prev = 3;
}
} else if (_local2 > hero_j) {
cellcount = 0;
var _local3 = 0;
while (_local3 < Math.abs(hero_j - _local2)) {
if (way[((hero_i * size) + hero_j) + _local3] > 0) {
cellcount = cellcount + 1;
}
_local3 = _local3 + 1;
}
if (cellcount == Math.abs(hero_j - _local2)) {
all_m.tiles["o_!_1"]._visible = 1;
setTimeout(function () {
all_m.tiles["o_!_1"]._visible = 0;
}, 100);
all_m.tiles.o_prince_1.side_prev = 1;
}
}
}
_local2 = _local2 + 1;
}
}
if (way_obj[(hero_i * size) + hero_j] == 8) {
way_obj[(hero_i * size) + hero_j] = 0;
cell_number = ((hero_i - 2) * size) + hero_j;
var i = 0;
while (i < comehere_number) {
if (all_m.tiles["o_comehere_" + (2 * i)].coord == cell_number) {
cake_p(all_m.tiles["o_comehere_" + (2 * i)]._x + 28, all_m.tiles["o_comehere_" + (2 * i)]._y + 70);
PlaySound(s_eat);
all_m.tiles["o_comehere_" + (2 * i)].removeMovieClip();
all_m.tiles["o_comehere_" + ((2 * i) + 1)].removeMovieClip();
kong_cake_count++;
sData_so.data.kong_cake_count = kong_cake_count;
kongsend("cakes", kong_cake_count);
if (cake_count < 50) {
cake_count++;
sData_so.data.cake_count = cake_count;
} else if ((cake_count == 50) and (achiev_array[8][0] == 0)) {
achiev_array[8][0] = 1;
add_achieve(8);
}
sData_so.flush();
break;
}
i = i + 1;
}
} else if (((((way_obj[(hero_i * size) + hero_j] == 152) or (way_obj[(hero_i * size) + hero_j] == 154)) or (way_obj[(hero_i * size) + hero_j] == 156)) or (way_obj[(hero_i * size) + hero_j] == 158)) and (was_in[(hero_i * size) + hero_j] == 0)) {
PlaySound(s_teleport);
cell_number = ((hero_i - 2) * size) + hero_j;
curr_tp = 0;
var i = 0;
while (i < teleports) {
if (all_m.tiles["o_teleport_" + i].coord == cell_number) {
curr_tp = all_m.tiles["o_teleport_" + i].tp;
_local2 = 0;
while (_local2 < teleports) {
if ((all_m.tiles["o_teleport_" + _local2].tp == curr_tp) and (all_m.tiles["o_teleport_" + _local2].coord != cell_number)) {
all_m.tiles.o_prince_1._x = (0 + (52 * all_m.tiles["o_teleport_" + _local2].j)) + 26;
all_m.tiles.o_prince_1._y = 0 + (all_m.tiles["o_teleport_" + _local2].i * 42);
all_m.tiles.o_prince_1.side = 0;
hero_j = Math.floor(all_m.tiles.o_prince_1._x / 52);
hero_i = Math.floor(all_m.tiles.o_prince_1._y / 42);
was_in[(hero_i * size) + hero_j] = 1;
}
_local2 = _local2 + 1;
}
}
i = i + 1;
}
} else if (way_obj[(hero_i * size) + hero_j] == 179) {
way_obj[(hero_i * size) + hero_j] = 0;
starss3(all_m.tiles.o_key_3._x + 25, all_m.tiles.o_key_3._y + 63);
PlaySound(starz);
got_star = 1;
all_m.tiles.o_key_3.removeMovieClip();
all_m.tiles.o_key_4.removeMovieClip();
all_m.tiles.o_blick_1.removeMovieClip();
} else if (way_obj[(hero_i * size) + hero_j] == 180) {
way_obj[(hero_i * size) + hero_j] = 0;
key = 1;
bubles(all_m.tiles.o_key_1._x + 20, all_m.tiles.o_key_1._y + 40);
PlaySound(s_bubles);
all_m.tiles.o_key_1.removeMovieClip();
all_m.tiles.o_key_2.removeMovieClip();
all_m.tiles.o_blick_2.removeMovieClip();
} else if (((((way_obj[((hero_i * size) + hero_j) + 1] == 181) or (way_obj[((hero_i - 1) * size) + hero_j] == 181)) or (way_obj[((hero_i * size) + hero_j) - 1] == 181)) or (way_obj[((hero_i + 1) * size) + hero_j] == 181)) and (key == 0)) {
if (purple_count < 1) {
purple_count++;
sData_so.data.purple_count = purple_count;
} else if ((purple_count == 1) and (achiev_array[7][0] == 0)) {
achiev_array[7][0] = 1;
add_achieve(7);
}
sData_so.flush();
} else if (((((way_obj[((hero_i * size) + hero_j) + 1] == 181) or (way_obj[((hero_i - 1) * size) + hero_j] == 181)) or (way_obj[((hero_i * size) + hero_j) - 1] == 181)) or (way_obj[((hero_i + 1) * size) + hero_j] == 181)) and (key == 1)) {
if (way_obj[((hero_i * size) + hero_j) + 1] == 181) {
coord = ((hero_i * size) + hero_j) + 1;
} else if (way_obj[((hero_i - 1) * size) + hero_j] == 181) {
coord = ((hero_i - 1) * size) + hero_j;
} else if (way_obj[((hero_i * size) + hero_j) - 1] == 181) {
coord = ((hero_i * size) + hero_j) - 1;
} else if (way_obj[((hero_i + 1) * size) + hero_j] == 181) {
coord = ((hero_i + 1) * size) + hero_j;
}
PlaySound(s_magic_boom);
boom(all_m.tiles.o_finish_1._x + 15, all_m.tiles.o_finish_1._y - 40);
all_m.tiles.o_finish_1.gotoAndStop(1);
all_m.tiles.o_finish_2.gotoAndStop(1);
way[coord] = 1;
way_obj[coord] = 0;
go = 3;
all_m.tiles.o_prince_2.gotoAndStop(1);
all_m.tiles.o_prince_12.gotoAndPlay(1);
cur_try = try_number;
setTimeout(function () {
if (cur_try == try_number) {
all_m.tiles.o_chosen_cell_99._visible = 0;
all_m.after_level._xscale = 0;
all_m.after_level._yscale = 0;
all_m.after_level.o_after_level_menu5._y = -184;
all_m.after_level.o_after_level_menu5._x = -150;
all_m.after_level.o_after_level_menu5.gotoAndStop(2);
all_m.after_level.o_after_level_menu5._visible = 1;
if (cur_level_number != 20) {
all_m.after_level.o_after_level_menu2._visible = 1;
}
all_m.panel.o_panel_4._visible = 0;
all_m.panel.o_panel_3._visible = 0;
all_m.inter.o_inter_3._visible = 0;
all_m.inter.o_inter_0._visible = 0;
all_m.hints.hint5._visible = 0;
been_restart = 0;
all_m.after_level._visible = 1;
all_m.square_mc._alpha = 0;
all_m.square_mc._visible = 1;
PlaySound(s_flourish);
if (cur_level_number == (open_levels - 1)) {
sData_so.data.levels = _root.cur_level_number + 1;
open_levels = sData_so.data.levels + 1;
sData_so.flush();
kongsend("levels", cur_level_number + 1);
if ((cur_level_number == 4) and (achiev_array[1][0] == 0)) {
achiev_array[1][0] = 1;
add_achieve(1);
sData_so.data.achiev_array = achiev_array;
sData_so.flush();
} else if ((cur_level_number == 14) and (achiev_array[2][0] == 0)) {
achiev_array[2][0] = 1;
add_achieve(2);
sData_so.data.achiev_array = achiev_array;
sData_so.flush();
} else if ((cur_level_number == 19) and (achiev_array[3][0] == 0)) {
achiev_array[3][0] = 1;
add_achieve(3);
sData_so.data.achiev_array = achiev_array;
sData_so.flush();
}
}
if ((cur_level_number == 0) and (achiev_array[0][0] == 0)) {
achiev_array[0][0] = 1;
add_achieve(0);
sData_so.data.achiev_array = achiev_array;
sData_so.flush();
}
if (got_star == 1) {
stars[cur_level_number] = 1;
}
stars_count = 0;
var _local2 = 0;
while (_local2 < 42) {
if (stars[_local2] == 1) {
stars_count++;
}
_local2 = _local2 + 1;
}
sData_so.data.stars = stars;
sData_so.flush();
kongsend("stars", stars_count);
if ((stars_count == 7) and (achiev_array[4][0] == 0)) {
add_achieve(4);
achiev_array[4][0] = 1;
sData_so.data.achiev_array = achiev_array;
sData_so.flush();
} else if ((stars_count == 14) and (achiev_array[5][0] == 0)) {
add_achieve(5);
achiev_array[5][0] = 1;
sData_so.data.achiev_array = achiev_array;
sData_so.flush();
} else if ((stars_count == 21) and (achiev_array[6][0] == 0)) {
add_achieve(6);
achiev_array[6][0] = 1;
sData_so.data.achiev_array = achiev_array;
sData_so.flush();
}
_local2 = 0;
while (_local2 < 9) {
if (achiev_array[_local2][0] == 1) {
ach_count++;
}
_local2 = _local2 + 1;
}
}
}, 1000);
}
Play_xxscale(all_m.after_level);
if (after_level._xscale >= 100) {
Play_alpha(all_m.square_mc);
}
var i = 0;
while (i < size) {
_local2 = 0;
while (_local2 < size) {
was_in[(i * size) + _local2] = 0;
_local2 = _local2 + 1;
}
i = i + 1;
}
was_in[(h_i * size) + h_j] = 1;
was_in[(hero_i * size) + hero_j] = 1;
if ((in_cell_now != 0) and (in_cell_now != (((hero_i - 2) * size) + hero_j))) {
change_noexit(no_exit_curr);
way[in_cell_now + 24] = 0;
in_cell_now = 0;
no_exit_curr = 0;
}
move_p(all_m.tiles.o_prince_1);
move_p(all_m.tiles.o_prince_11);
ach_count = 0;
var i = 0;
while (i < 9) {
if (achiev_array[i][0] == 1) {
ach_count++;
}
i = i + 1;
}
var i = 0;
while (i < (3 * iceball_number)) {
if (all_m.tiles["o_iceball_" + i].go == 1) {
move_one_side(all_m.tiles["o_iceball_" + i]);
}
i = i + 3;
}
if (((ach_count / achiev_array[9][3]) * 100) == 100) {
if (achiev_array[9][0] == 0) {
achiev_array[9][0] = 1;
saveAchi(9);
}
}
all_m.inter.o_inter_3.onPress = function () {
if (all_m.inter.o_inter_3.curr == 1) {
PlaySound(s_click);
side_prev = 1;
go = 1;
all_m.tiles.o_prince_2.gotoAndPlay(2);
all_m.tiles.o_prince_12.gotoAndPlay(2);
all_m.inter.o_inter_3.gotoAndStop(3);
all_m.inter.o_inter_3.curr = 3;
all_m.inter.o_inter_22._visible = 0;
all_m.inter.o_inter_2._visible = 0;
all_m.inter.o_inter_1._visible = 0;
all_m.inter.o_inter_23._visible = 0;
all_m.inter.inter_text_2._visible = 0;
all_m.inter.inter_text_1._visible = 0;
all_m.inter.o_inter_20._visible = 0;
all_m.inter.o_inter_21._visible = 0;
} else if (all_m.inter.o_inter_3.curr == 3) {
PlaySound(s_click);
backBuffer.draw(all_m.clouds);
backBuffer.draw(all_m.tiles_back);
backBuffer.draw(all_m.tiles);
var _local2 = new flash.geom.Matrix();
_local2.tx = 468;
_local2.ty = 435;
backBuffer.draw(all_m.inter, _local2);
all_m.snow.removeMovieClip();
all_m.inter.removeMovieClip();
all_m.clouds.removeMovieClip();
all_m.tiles_back.removeMovieClip();
all_m.tiles.removeMovieClip();
all_m.panel.removeMovieClip();
all_m.after_level.removeMovieClip();
all_m.square_mc.removeMovieClip();
all_m.square_mc_2.removeMovieClip();
all_m.hints.removeMovieClip();
all_m.achieve_hint.removeMovieClip();
been_restart = 1;
all_m.screen.attachBitmap(backBuffer, _root.getNextHighestDepth());
gotoAndPlay(_currentframe + 1);
}
};
all_m.panel.o_panel_3.onPress = function () {
backBuffer.draw(all_m.clouds);
backBuffer.draw(all_m.tiles_back);
backBuffer.draw(all_m.tiles);
backBuffer.draw(all_m.panel);
var _local2 = new flash.geom.Matrix();
_local2.tx = 468;
_local2.ty = 435;
backBuffer.draw(all_m.inter, _local2);
all_m.snow.removeMovieClip();
all_m.inter.removeMovieClip();
all_m.clouds.removeMovieClip();
all_m.tiles_back.removeMovieClip();
all_m.tiles.removeMovieClip();
all_m.panel.removeMovieClip();
all_m.after_level.removeMovieClip();
all_m.square_mc.removeMovieClip();
all_m.square_mc_2.removeMovieClip();
all_m.hints.removeMovieClip();
all_m.achieve_hint.removeMovieClip();
music_back.stop();
been_restart = 0;
all_m.screen.attachBitmap(backBuffer, _root.getNextHighestDepth());
gotoAndPlay(_currentframe + 3);
};
all_m.after_level.o_after_level_menu2.onRelease = function () {
backBuffer.draw(all_m.clouds);
backBuffer.draw(all_m.tiles_back);
backBuffer.draw(all_m.tiles);
var _local4 = new flash.geom.Matrix();
_local4.tx = 468;
_local4.ty = 435;
backBuffer.draw(all_m.inter, _local4);
var _local5 = new flash.geom.Matrix();
_local5.tx = 320;
_local5.ty = 210;
backBuffer.draw(all_m.after_level, _local5);
var _local3 = 0;
while (_local3 < 12) {
var _local2 = 0;
while (_local2 < 12) {
tools_stand[(_local3 * 12) + _local2] = 10;
_local2 = _local2 + 1;
}
_local3 = _local3 + 1;
}
all_m.snow.removeMovieClip();
all_m.inter.removeMovieClip();
all_m.clouds.removeMovieClip();
all_m.tiles_back.removeMovieClip();
all_m.tiles.removeMovieClip();
all_m.panel.removeMovieClip();
all_m.after_level.removeMovieClip();
all_m.square_mc.removeMovieClip();
all_m.square_mc_2.removeMovieClip();
all_m.hints.removeMovieClip();
all_m.achieve_hint.removeMovieClip();
all_m.screen.attachBitmap(backBuffer, _root.getNextHighestDepth());
been_restart = 0;
gotoAndPlay(_currentframe + 2);
};
all_m.after_level.o_after_level_menu4.onRelease = function () {
backBuffer.draw(all_m.clouds);
backBuffer.draw(all_m.tiles_back);
backBuffer.draw(all_m.tiles);
var _local2 = new flash.geom.Matrix();
_local2.tx = 468;
_local2.ty = 435;
backBuffer.draw(all_m.inter, _local2);
all_m.snow.removeMovieClip();
all_m.inter.removeMovieClip();
all_m.clouds.removeMovieClip();
all_m.tiles_back.removeMovieClip();
all_m.tiles.removeMovieClip();
all_m.panel.removeMovieClip();
all_m.after_level.removeMovieClip();
all_m.square_mc.removeMovieClip();
all_m.square_mc_2.removeMovieClip();
all_m.hints.removeMovieClip();
all_m.achieve_hint.removeMovieClip();
music_back.stop();
been_restart = 0;
all_m.screen.attachBitmap(backBuffer, _root.getNextHighestDepth());
gotoAndPlay(_currentframe + 4);
};
all_m.panel.o_panel_4.onPress = function () {
trace("BINGO!");
var _local3 = 0;
while (_local3 < 12) {
var _local2 = 0;
while (_local2 < 12) {
tools_stand[(_local3 * 12) + _local2] = 10;
_local2 = _local2 + 1;
}
_local3 = _local3 + 1;
}
backBuffer.draw(all_m.clouds);
backBuffer.draw(all_m.tiles_back);
backBuffer.draw(all_m.tiles);
backBuffer.draw(all_m.panel);
var _local4 = new flash.geom.Matrix();
_local4.tx = 468;
_local4.ty = 435;
backBuffer.draw(all_m.inter, _local4);
all_m.snow.removeMovieClip();
all_m.inter.removeMovieClip();
all_m.clouds.removeMovieClip();
all_m.tiles_back.removeMovieClip();
all_m.tiles.removeMovieClip();
all_m.panel.removeMovieClip();
all_m.after_level.removeMovieClip();
all_m.square_mc.removeMovieClip();
all_m.square_mc_2.removeMovieClip();
all_m.hints.removeMovieClip();
all_m.achieve_hint.removeMovieClip();
been_restart = 1;
all_m.screen.attachBitmap(backBuffer, _root.getNextHighestDepth());
gotoAndPlay(_currentframe + 1);
};
all_m.after_level.o_after_level_menu7.onRelease = function () {
backBuffer.draw(all_m.clouds);
backBuffer.draw(all_m.tiles_back);
backBuffer.draw(all_m.tiles);
var _local3 = new flash.geom.Matrix();
_local3.tx = 320;
_local3.ty = 210;
backBuffer.draw(all_m.after_level, _local3);
var _local2 = new flash.geom.Matrix();
_local2.tx = 468;
_local2.ty = 435;
backBuffer.draw(all_m.inter, _local2);
all_m.snow.removeMovieClip();
all_m.tiles_back.removeMovieClip();
all_m.inter.removeMovieClip();
all_m.clouds.removeMovieClip();
all_m.tiles.removeMovieClip();
all_m.panel.removeMovieClip();
all_m.after_level.removeMovieClip();
all_m.square_mc.removeMovieClip();
all_m.square_mc_2.removeMovieClip();
all_m.hints.removeMovieClip();
all_m.achieve_hint.removeMovieClip();
been_restart = 0;
all_m.screen.attachBitmap(backBuffer, _root.getNextHighestDepth());
gotoAndPlay(_currentframe);
};
all_m.after_level.o_after_level_menu3.onRelease = function () {
getURL (sponsorurl, "_blank");
};
all_m.inter.o_inter_2.onPress = function () {
if (tool_come_count != 0) {
PlaySound(s_click);
tool_number = 2;
all_m.inter.o_inter_2.gotoAndStop(2);
all_m.inter.o_inter_2.curr = 2;
all_m.inter.o_inter_1.gotoAndStop(1);
all_m.inter.o_inter_1.curr = 1;
}
};
all_m.inter.o_inter_1.onPress = function () {
if (tool_noexit_count != 0) {
PlaySound(s_click);
tool_number = 1;
all_m.inter.o_inter_1.gotoAndStop(2);
all_m.inter.o_inter_1.curr = 2;
all_m.inter.o_inter_2.gotoAndStop(1);
all_m.inter.o_inter_2.curr = 1;
}
};
all_m.inter.o_inter_10.onRelease = function () {
getURL (walkurl, "_blank");
};
all_m.panel.o_panel_1.onRelease = function () {
if (music_enable == 1) {
music_back.stop();
music_enable = 0;
sData_so.data.music_enable = 0;
sData_so.flush();
all_m.panel.o_panel_1.gotoAndStop(3);
all_m.panel.o_panel_1.curr = 3;
} else if (music_enable == 0) {
music_enable = 1;
sData_so.data.music_enable = 1;
sData_so.flush();
if (back_count == 0) {
PlayMusic(music_back);
} else if (back_count == 1) {
PlayMusic(s_menu_back);
} else if (back_count == 2) {
PlayMusic(music_back);
}
all_m.panel.o_panel_1.gotoAndStop(1);
all_m.panel.o_panel_1.curr = 1;
}
};
all_m.panel.o_panel_2.onRelease = function () {
if (sound_enable == 1) {
sound_enable = 0;
sData_so.data.sound_enable = 0;
sData_so.flush();
all_m.panel.o_panel_2.gotoAndStop(3);
all_m.panel.o_panel_2.curr = 3;
} else if (sound_enable == 0) {
sound_enable = 1;
sData_so.data.sound_enable = 1;
sData_so.flush();
all_m.panel.o_panel_2.gotoAndStop(1);
all_m.panel.o_panel_2.curr = 1;
}
};
var i = 0;
while (i < (3 * iceball_number)) {
all_m.tiles[("o_iceball_" + i) + 1]._x = all_m.tiles["o_iceball_" + i]._x - 18;
all_m.tiles[("o_iceball_" + i) + 1]._y = all_m.tiles["o_iceball_" + i]._y - 70;
all_m.tiles[("o_iceball_" + i) + 1]._y = all_m.tiles[("o_iceball_" + i) + 1]._y + (Math.sin((tt = tt + 0.075)) * 4);
all_m.tiles[("o_iceball_" + i) + 2]._x = all_m.tiles["o_iceball_" + i]._x + 2;
all_m.tiles[("o_iceball_" + i) + 2]._y = all_m.tiles["o_iceball_" + i]._y - 1;
i = i + 3;
}
all_m.tiles.o_chosen_cell_99.onPress = function () {
if (go == 0) {
if (((((tool_number == 0) or (tool_number == 1)) or (tool_number == 2)) and (tools_stand[((cell_i + 1) * size) + cell_j] != 0)) and (tools_stand[((cell_i + 1) * size) + cell_j] != 10)) {
if (tools_stand[((cell_i + 1) * size) + cell_j] == 2) {
var _local1 = 0;
while (_local1 < comehere_number) {
if (all_m.tiles["o_comehere_" + (2 * _local1)].coord == (((cell_i - 1) * size) + cell_j)) {
PlaySound(s_eat);
all_m.tiles["o_comehere_" + (2 * _local1)].removeMovieClip();
all_m.tiles["o_comehere_" + ((2 * _local1) + 1)].removeMovieClip();
way_obj[((cell_i + 1) * size) + cell_j] = 0;
tool_come_count++;
all_m.inter.inter_text_2.text = tool_come_count;
if (tool_come_count == 1) {
all_m.inter.inter_text_2._x = all_m.tiles["o_iceball_" + i]._x + 98;
} else {
all_m.inter.inter_text_2._x = all_m.tiles["o_iceball_" + i]._x + 94;
}
tools_stand[((cell_i + 1) * size) + cell_j] = 0;
tool_number = 2;
all_m.inter.o_inter_2.gotoAndStop(2);
all_m.inter.o_inter_2.curr = 2;
all_m.inter.o_inter_1.gotoAndStop(1);
all_m.inter.o_inter_1.curr = 1;
break;
}
_local1 = _local1 + 1;
}
} else if (tools_stand[((cell_i + 1) * size) + cell_j] == 1) {
var _local1 = 0;
while (_local1 < noexit_number) {
if (all_m.tiles["o_noexit_" + _local1].coord == (((cell_i - 1) * size) + cell_j)) {
PlaySound(s_eat);
all_m.tiles["o_noexit_" + _local1].removeMovieClip();
all_m.tiles["o_shadow2_" + (3 * _local1)].removeMovieClip();
all_m.tiles[("o_shadow2_" + (3 * _local1)) + 1].removeMovieClip();
all_m.tiles[("o_shadow2_" + (3 * _local1)) + 2].removeMovieClip();
way_obj[((cell_i + 1) * size) + cell_j] = 0;
tool_noexit_count++;
all_m.inter.inter_text_1.text = tool_noexit_count;
if (tool_noexit_count == 1) {
all_m.inter.inter_text_1._x = all_m.tiles["o_iceball_" + i]._x + 44;
} else {
all_m.inter.inter_text_1._x = all_m.tiles["o_iceball_" + i]._x + 40;
}
tools_stand[((cell_i + 1) * size) + cell_j] = 0;
tool_number = 1;
all_m.inter.o_inter_1.gotoAndStop(2);
all_m.inter.o_inter_1.curr = 2;
all_m.inter.o_inter_2.gotoAndStop(1);
all_m.inter.o_inter_2.curr = 1;
break;
}
_local1 = _local1 + 1;
}
}
} else if (((tool_number == 1) and (tool_noexit_count > 0)) and (tools_stand[((cell_i + 1) * size) + cell_j] == 0)) {
if (((cur_level_number == 2) and (cell_i == 5)) and (cell_j == 5)) {
stand_block();
} else if (cur_level_number != 2) {
stand_block();
}
} else if (((tool_number == 2) and (tool_come_count > 0)) and (tools_stand[((cell_i + 1) * size) + cell_j] == 0)) {
if (((cur_level_number == 1) and (cell_i == 6)) and (cell_j == 5)) {
stand_cake();
} else if (cur_level_number != 1) {
stand_cake();
}
}
}
};
};
if (back_count == 2) {
init();
}
Frame 5
stop();
all_m.createEmptyMovieClip("make_black", all_m.getNextHighestDepth());
all_m.make_black.aaa = 0;
all_m.make_black.beginFill(723723);
all_m.make_black.moveTo(0, 0);
all_m.make_black.lineTo(640, 0);
all_m.make_black.lineTo(640, 480);
all_m.make_black.lineTo(0, 480);
all_m.make_black.lineTo(0, 0);
all_m.make_black.endFill();
all_m.make_black._alpha = 0;
all_m.make_black._visible = 1;
tool_after_restart = tool_number;
onEnterFrame = function () {
if (all_m.make_black._alpha < 85) {
all_m.make_black._alpha = all_m.make_black._alpha + 15;
}
if ((all_m.make_black._alpha >= 85) and (all_m.make_black.aaa == 0)) {
all_m.make_black.aaa = 1;
setTimeout(function () {
all_m.screen.removeMovieClip();
all_m.make_black.removeMovieClip();
gotoAndStop(_currentframe - 1);
}, 200);
}
};
Frame 6
stop();
all_m.createEmptyMovieClip("make_black", all_m.getNextHighestDepth());
all_m.make_black.aaa = 0;
all_m.make_black.beginFill(723723);
all_m.make_black.moveTo(0, 0);
all_m.make_black.lineTo(640, 0);
all_m.make_black.lineTo(640, 480);
all_m.make_black.lineTo(0, 480);
all_m.make_black.lineTo(0, 0);
all_m.make_black.endFill();
all_m.make_black._alpha = 0;
all_m.make_black._visible = 1;
onEnterFrame = function () {
if (all_m.make_black._alpha < 85) {
all_m.make_black._alpha = all_m.make_black._alpha + 15;
}
if ((all_m.make_black._alpha >= 85) and (all_m.make_black.aaa == 0)) {
all_m.make_black.aaa = 1;
setTimeout(function () {
all_m.screen.removeMovieClip();
all_m.make_black.removeMovieClip();
var _local3 = 0;
while (_local3 < 12) {
var _local2 = 0;
while (_local2 < 12) {
_root.lvlArray1[(_local3 * 12) + _local2] = _root.lvlArray[cur_level_number + 1][(_local3 * 12) + _local2];
_local2 = _local2 + 1;
}
_local3 = _local3 + 1;
}
_root.tool_a1 = _root.tools_array[cur_level_number + 1][0];
_root.tool_a2 = _root.tools_array[cur_level_number + 1][1];
_root.back_a = _root.tools_array[cur_level_number + 1][2];
if (got_star == 1) {
stars[cur_level_number] = 1;
}
_root.cur_level_number++;
_root.tool_after_restart = 0;
gotoAndStop(_currentframe - 2);
}, 200);
}
};
Frame 7
stop();
all_m.createEmptyMovieClip("make_black", all_m.getNextHighestDepth());
all_m.make_black.aaa = 0;
all_m.make_black.beginFill(723723);
all_m.make_black.moveTo(0, 0);
all_m.make_black.lineTo(640, 0);
all_m.make_black.lineTo(640, 480);
all_m.make_black.lineTo(0, 480);
all_m.make_black.lineTo(0, 0);
all_m.make_black.endFill();
all_m.make_black._alpha = 0;
all_m.make_black._visible = 1;
onEnterFrame = function () {
if (all_m.make_black._alpha < 85) {
all_m.make_black._alpha = all_m.make_black._alpha + 15;
}
if ((all_m.make_black._alpha >= 85) and (all_m.make_black.aaa == 0)) {
all_m.make_black.aaa = 1;
setTimeout(function () {
all_m.screen.removeMovieClip();
all_m.make_black.removeMovieClip();
return_to_levels = 1;
cur_level_number = 0;
gotoAndStop(_currentframe - 4);
}, 200);
}
};
Frame 8
stop();
all_m.createEmptyMovieClip("make_black", all_m.getNextHighestDepth());
all_m.make_black.aaa = 0;
all_m.make_black.beginFill(723723);
all_m.make_black.moveTo(0, 0);
all_m.make_black.lineTo(640, 0);
all_m.make_black.lineTo(640, 480);
all_m.make_black.lineTo(0, 480);
all_m.make_black.lineTo(0, 0);
all_m.make_black.endFill();
all_m.make_black._alpha = 0;
all_m.make_black._visible = 1;
onEnterFrame = function () {
if (all_m.make_black._alpha < 85) {
all_m.make_black._alpha = all_m.make_black._alpha + 15;
}
if ((all_m.make_black._alpha >= 85) and (all_m.make_black.aaa == 0)) {
all_m.make_black.aaa = 1;
setTimeout(function () {
all_m.screen.removeMovieClip();
all_m.make_black.removeMovieClip();
return_to_levels = 1;
if (got_star == 1) {
stars[cur_level_number] = 1;
}
_root.cur_level_number++;
_root.tool_after_restart = 0;
gotoAndStop(_currentframe - 5);
}, 200);
}
};
Frame 9
function angle_difference(x1, x2) {
return(((((x1 - x2) % 360) + 540) % 360) - 180);
}
function point_distance(x1, y1, x2, y2) {
return(Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2)));
}
function point_direction(x1, y1, x2, y2) {
return((Math.atan2(y2 - y1, x2 - x1) / Math.PI) * 180);
}
function lengthdir_x(len, dir) {
return(Math.cos((dir * Math.PI) / 180) * len);
}
function lengthdir_y(len, dir) {
return((-Math.sin((dir * Math.PI) / 180)) * len);
}
function draw_levels() {
all_m.levels.createTextField("t_star1", 2000, 50, 50, 500, 500);
all_m.levels.t_star1.setTextFormat(format_stars);
all_m.levels.t_star1.setNewTextFormat(format_stars);
all_m.levels.t_star1.text = ((((("cakes " + cake_count) + " stars ") + stars_count) + " levels") + " ") + open_levels;
all_m.levels.t_star1.selectable = false;
all_m.levels.t_star1.embedFonts = true;
all_m.levels.t_star1._x = -286;
all_m.levels.t_star1._y = 200;
}
stop();
all_m.main_menu.removeMovieClip();
all_m.panel_mm.removeMovieClip();
stars_count = 0;
var i = 0;
while (i < 42) {
if (stars[i] == 1) {
stars_count++;
}
i = i + 1;
}
var distance = 0;
var angleInDegrees = 0;
var color = 15463162;
var alpha = 1;
var blurX = 2;
var blurY = 2;
var strength = 5;
var quality = 3;
var inner = false;
var knockout = false;
var hideObject = false;
if (return_to_levels == 1) {
create_clouds();
PlayMusic(s_menu_back);
return_to_levels = 0;
}
all_m.createEmptyMovieClip("levels", all_m.getNextHighestDepth());
all_m.createEmptyMovieClip("levels_2", all_m.getNextHighestDepth());
all_m.createEmptyMovieClip("achiev_menu", all_m.getNextHighestDepth());
create_panel();
all_m.createEmptyMovieClip("make_black_2", all_m.getNextHighestDepth());
var rolled = 0;
var sselected = 0;
var rot = 0;
var item = 0;
var achiev_number = 10;
var menu_x = 282;
var menu_y = 180;
var menu_width = 285;
var menu_height = 80;
var button_pressed = 0;
var keyListener = new Object();
ach_count = 0;
var i = 0;
while (i < achiev_number) {
all_m.achiev_menu.attachMovie("o_achiev_point", "o_achiev_point_" + i, i);
if (achiev_array[i][0] == 0) {
all_m.achiev_menu["o_achiev_point_" + i].gotoAndStop(1);
} else if (achiev_array[i][0] == 1) {
all_m.achiev_menu["o_achiev_point_" + i].gotoAndStop(2 + i);
ach_count++;
}
all_m.achiev_menu["o_achiev_point_" + i]._x = menu_x + lengthdir_x(menu_width / 2, (rot - 90) + (i * (360 / achiev_number)));
all_m.achiev_menu["o_achiev_point_" + i]._y = menu_y + lengthdir_y(menu_height / 2, (rot - 90) + (i * (360 / achiev_number)));
all_m.achiev_menu["o_achiev_point_" + i].swapDepths(achiev_menu["o_achiev_point_" + i]._y);
all_m.achiev_menu["o_achiev_point_" + i]._xscale = Math.round((1 + (lengthdir_y(menu_height / 2, (rot - 90) + (i * (360 / achiev_number))) / (menu_height * 2))) * 100) - 25;
all_m.achiev_menu["o_achiev_point_" + i]._yscale = Math.round((1 + (lengthdir_y(menu_height / 2, (rot - 90) + (i * (360 / achiev_number))) / (menu_height * 2))) * 100) - 25;
all_m.achiev_menu["o_achiev_point_" + i].ii = i;
i = i + 1;
}
if (((ach_count / achiev_array[9][3]) * 100) == 100) {
all_m.achiev_menu.o_achiev_point_9.gotoAndStop(11);
}
var format_pr = new TextFormat();
format_pr.font = "Luvable";
format_pr.color = 16777215 /* 0xFFFFFF */;
format_pr.size = 18;
format_pr.align = "center";
all_m.achiev_menu.createTextField("achieve_hint3", 3002, 50, 50, 100, 100);
all_m.achiev_menu.achieve_hint3.setTextFormat(format_pr);
all_m.achiev_menu.achieve_hint3.setNewTextFormat(format_pr);
all_m.achiev_menu.achieve_hint3.text = achiev_array[0][2] + " %";
all_m.achiev_menu.achieve_hint3.selectable = false;
all_m.achiev_menu.achieve_hint3.embedFonts = true;
all_m.achiev_menu.achieve_hint3._x = 242;
all_m.achiev_menu.achieve_hint3._y = 332;
all_m.achiev_menu.achieve_hint3.filters = [new flash.filters.DropShadowFilter(distance, angleInDegrees, 9158175, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject)];
var format_stars = new TextFormat();
format_stars.font = "Luvable";
format_stars.color = 7715025 /* 0x75B8D1 */;
format_stars.size = 18;
format_stars.align = "center";
all_m.achiev_menu.createTextField("achieve_hint1", 3000, 50, 50, 200, 200);
all_m.achiev_menu.achieve_hint1.setTextFormat(format_stars);
all_m.achiev_menu.achieve_hint1.setNewTextFormat(format_stars);
all_m.achiev_menu.achieve_hint1.text = achiev_array[0][2];
all_m.achiev_menu.achieve_hint1.selectable = false;
all_m.achiev_menu.achieve_hint1.embedFonts = true;
all_m.achiev_menu.achieve_hint1._x = 185;
all_m.achiev_menu.achieve_hint1._y = 310;
all_m.achiev_menu.achieve_hint1.filters = [new flash.filters.DropShadowFilter(distance, angleInDegrees, color, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject)];
var format_achieve_name = new TextFormat();
format_achieve_name.font = "Luvable";
format_achieve_name.color = 6459837 /* 0x6291BD */;
format_achieve_name.size = 24;
format_achieve_name.align = "center";
all_m.achiev_menu.createTextField("achieve_hint2", 3001, 50, 50, 250, 250);
all_m.achiev_menu.achieve_hint2.setTextFormat(format_achieve_name);
all_m.achiev_menu.achieve_hint2.setNewTextFormat(format_achieve_name);
all_m.achiev_menu.achieve_hint2.text = achiev_array[0][1];
all_m.achiev_menu.achieve_hint2.selectable = false;
all_m.achiev_menu.achieve_hint2.embedFonts = true;
all_m.achiev_menu.achieve_hint2._x = 160;
all_m.achiev_menu.achieve_hint2._y = 280;
all_m.achiev_menu.achieve_hint2.filters = [new flash.filters.DropShadowFilter(distance, angleInDegrees, color, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject)];
all_m.achiev_menu.attachMovie("o_ach_pr_bar", "o_ach_pr_bar1", 101);
all_m.achiev_menu.o_ach_pr_bar1._x = 215;
all_m.achiev_menu.o_ach_pr_bar1._y = 345;
all_m.achiev_menu.attachMovie("o_ach_pr_bar", "o_ach_pr_bar2", 102);
all_m.achiev_menu.o_ach_pr_bar2._x = 221;
all_m.achiev_menu.o_ach_pr_bar2._y = 345;
all_m.achiev_menu.o_ach_pr_bar2.gotoAndStop(2);
all_m.achiev_menu.o_ach_pr_bar2._xscale = 0;
var level_depth = 0;
var tool_a1 = 0;
var tool_a2 = 0;
var back_a = 0;
var type_page = 0;
var lvlArray1 = new Array();
var been_restart = 0;
var go_level = 0;
var levels_done = 0;
var sizee = 7;
var format = new TextFormat();
all_m.levels.attachMovie("but_level_main_menu", "o_after_level_menu1", 1);
all_m.levels.o_after_level_menu1._x = 260;
all_m.levels.o_after_level_menu1._y = -80;
all_m.levels.attachMovie("but_level_walk", "o_after_level_menu2", 2);
all_m.levels.o_after_level_menu2._x = 275;
all_m.levels.o_after_level_menu2._y = -20;
all_m.levels.attachMovie("but_level_level_select", "o_after_level_menu3", 3);
all_m.levels.o_after_level_menu3._x = 275;
all_m.levels.o_after_level_menu3._y = 37;
all_m.levels.attachMovie("but_level_more", "o_after_level_menu4", 4);
all_m.levels.o_after_level_menu4._x = 269;
all_m.levels.o_after_level_menu4._y = 94;
all_m.levels.attachMovie("o_after_level_menu", "o_after_level_menu11", 11);
all_m.levels.o_after_level_menu11.gotoAndStop(1);
all_m.levels.o_after_level_menu11._rotation = -270;
all_m.levels.o_after_level_menu11._xscale = 130;
all_m.levels.o_after_level_menu11._yscale = 130;
all_m.levels.attachMovie("o_main_menu_logo", "o_after_level_menu12", 12);
all_m.levels.o_after_level_menu12.gotoAndStop(5);
all_m.levels.o_after_level_menu12._x = 2;
all_m.levels.o_after_level_menu12._y = -123;
all_m.levels.o_after_level_menu1.onRollOver = function () {
PlaySound(s_bul);
};
all_m.levels.o_after_level_menu2.onRollOver = function () {
PlaySound(s_bul);
};
all_m.levels.o_after_level_menu3.onRollOver = function () {
PlaySound(s_bul);
};
all_m.levels.o_after_level_menu4.onRollOver = function () {
PlaySound(s_bul);
};
all_m.levels.o_after_level_menu2.onRelease = function () {
getURL (walkurl, "_blank");
PlaySound(s_click);
};
all_m.levels.o_after_level_menu4.onRelease = function () {
getURL (sponsorurl, "_blank");
PlaySound(s_click);
};
all_m.levels._y = 220;
all_m.levels._x = 280;
all_m.levels._visible = 1;
all_m.levels_2._x = all_m.levels._x + 8;
all_m.levels_2._y = all_m.levels._y - 20;
all_m.make_black_2.aaa = 0;
all_m.make_black_2.beginFill(723723);
all_m.make_black_2.moveTo(0, 0);
all_m.make_black_2.lineTo(640, 0);
all_m.make_black_2.lineTo(640, 480);
all_m.make_black_2.lineTo(0, 480);
all_m.make_black_2.lineTo(0, 0);
all_m.make_black_2.endFill();
all_m.make_black_2._alpha = 0;
all_m.make_black_2._visible = 1;
all_m.createEmptyMovieClip("square_mc_3", all_m.getNextHighestDepth());
all_m.square_mc_3.beginFill(723723);
all_m.square_mc_3.moveTo(0, 0);
all_m.square_mc_3.lineTo(640, 0);
all_m.square_mc_3.lineTo(640, 480);
all_m.square_mc_3.lineTo(0, 480);
all_m.square_mc_3.lineTo(0, 0);
all_m.square_mc_3.endFill();
all_m.square_mc_3._alpha = 80;
all_m.square_mc_3._visible = 1;
all_m.square_mc_3.bbb = 0;
format.font = "Luvable";
format.color = 16777215 /* 0xFFFFFF */;
format.size = 25;
all_m.levels.o_after_level_menu1.onRelease = function () {
PlaySound(s_click);
go_level = 2;
};
all_m.levels.o_after_level_menu3.onRelease = function () {
PlaySound(s_click);
go_level = 3;
};
onEnterFrame = function () {
if (all_m.square_mc_3._alpha > 0) {
all_m.square_mc_3._alpha = all_m.square_mc_3._alpha - 15;
}
if ((all_m.square_mc_3._alpha <= 0) and (all_m.square_mc_3.bbb == 0)) {
all_m.square_mc_3.bbb = 1;
}
clouds_move();
if (go_level == 1) {
if (all_m.make_black_2._alpha < 85) {
all_m.make_black_2._alpha = all_m.make_black_2._alpha + 15;
} else if ((all_m.make_black_2._alpha >= 85) and (all_m.make_black_2.aaa == 0)) {
all_m.make_black_2.aaa = 1;
setTimeout(function () {
all_m.square_mc_3.removeMovieClip();
all_m.make_black_2.removeMovieClip();
all_m.achiev_menu.removeMovieClip();
gotoAndStop(_currentframe - 5);
}, 200);
}
} else if (go_level == 2) {
if (all_m.make_black_2._alpha < 85) {
all_m.make_black_2._alpha = all_m.make_black_2._alpha + 15;
} else if ((all_m.make_black_2._alpha >= 85) and (all_m.make_black_2.aaa == 0)) {
all_m.make_black_2.aaa = 1;
setTimeout(function () {
all_m.make_black_2.removeMovieClip();
all_m.square_mc_3.removeMovieClip();
all_m.levels_2.removeMovieClip();
all_m.levels.removeMovieClip();
all_m.achiev_menu.removeMovieClip();
all_m.menu_clouds.removeMovieClip();
all_m.clouds_1.removeMovieClip();
all_m.clouds_2.removeMovieClip();
all_m.clouds_3.removeMovieClip();
gotoAndStop(_root._currentframe - 7);
}, 200);
}
} else if (go_level == 3) {
if (all_m.make_black_2._alpha < 85) {
all_m.make_black_2._alpha = all_m.make_black_2._alpha + 15;
} else if ((all_m.make_black_2._alpha >= 85) and (all_m.make_black_2.aaa == 0)) {
all_m.make_black_2.aaa = 1;
setTimeout(function () {
all_m.make_black_2.removeMovieClip();
all_m.square_mc_3.removeMovieClip();
all_m.levels_2.removeMovieClip();
all_m.levels.removeMovieClip();
all_m.achiev_menu.removeMovieClip();
all_m.clouds_1.removeMovieClip();
gotoAndStop(_currentframe - 6);
}, 200);
}
}
rot = rot - (angle_difference(rot, sselected * (360 / achiev_number)) / 4.8);
item = (-sselected) % achiev_number;
if (item < 0) {
item = item + achiev_number;
}
all_m.achiev_menu.achieve_hint1.text = achiev_array[item][2];
all_m.achiev_menu.achieve_hint2.text = achiev_array[item][1];
var _local2 = 0;
while (_local2 < achiev_number) {
all_m.achiev_menu["o_achiev_point_" + _local2]._x = menu_x + lengthdir_x(menu_width / 2, (rot - 90) + (_local2 * (360 / achiev_number)));
all_m.achiev_menu["o_achiev_point_" + _local2]._y = menu_y + lengthdir_y(menu_height / 2, (rot - 90) + (_local2 * (360 / achiev_number)));
all_m.achiev_menu["o_achiev_point_" + _local2].swapDepths(all_m.achiev_menu["o_achiev_point_" + _local2]._y);
all_m.achiev_menu["o_achiev_point_" + _local2]._xscale = Math.round((1 + (lengthdir_y(menu_height / 2, (rot - 90) + (_local2 * (360 / achiev_number))) / (menu_height * 2))) * 100) - 25;
all_m.achiev_menu["o_achiev_point_" + _local2]._yscale = Math.round((1 + (lengthdir_y(menu_height / 2, (rot - 90) + (_local2 * (360 / achiev_number))) / (menu_height * 2))) * 100) - 25;
_local2 = _local2 + 1;
}
if (item == 0) {
if (achiev_array[0][0] == 1) {
all_m.achiev_menu.o_ach_pr_bar2._xscale = 100;
} else if (achiev_array[0][0] == 0) {
all_m.achiev_menu.o_ach_pr_bar2._xscale = 0;
}
} else if ((item > 0) and (item < 4)) {
all_m.achiev_menu.o_ach_pr_bar2._xscale = ((open_levels - 1) / achiev_array[item][3]) * 100;
if (all_m.achiev_menu.o_ach_pr_bar2._xscale > 100) {
all_m.achiev_menu.o_ach_pr_bar2._xscale = 100;
}
} else if ((item > 3) and (item < 7)) {
all_m.achiev_menu.o_ach_pr_bar2._xscale = (stars_count / achiev_array[item][3]) * 100;
if (all_m.achiev_menu.o_ach_pr_bar2._xscale > 100) {
all_m.achiev_menu.o_ach_pr_bar2._xscale = 100;
}
} else if (item == 7) {
all_m.achiev_menu.o_ach_pr_bar2._xscale = (purple_count / achiev_array[item][3]) * 100;
if (all_m.achiev_menu.o_ach_pr_bar2._xscale > 100) {
all_m.achiev_menu.o_ach_pr_bar2._xscale = 100;
}
} else if (item == 8) {
all_m.achiev_menu.o_ach_pr_bar2._xscale = (cake_count / achiev_array[item][3]) * 100;
if (all_m.achiev_menu.o_ach_pr_bar2._xscale > 100) {
all_m.achiev_menu.o_ach_pr_bar2._xscale = 100;
}
} else if (item == 9) {
trace((((("ach_count= " + ach_count) + " achiev_array[item][3]= ") + achiev_array[item][3]) + " ach_count/achiev_array[item][3]= ") + (ach_count / achiev_array[item][3]));
all_m.achiev_menu.o_ach_pr_bar2._xscale = (ach_count / achiev_array[item][3]) * 100;
if (all_m.achiev_menu.o_ach_pr_bar2._xscale > 100) {
all_m.achiev_menu.o_ach_pr_bar2._xscale = 100;
}
}
if (Math.round(all_m.achiev_menu.o_ach_pr_bar2._xscale) < 100) {
all_m.achiev_menu.achieve_hint3.text = Math.round(all_m.achiev_menu.o_ach_pr_bar2._xscale) + " %";
all_m.achiev_menu.achieve_hint3._x = 242;
} else if (Math.round(all_m.achiev_menu.o_ach_pr_bar2._xscale) >= 100) {
all_m.achiev_menu.achieve_hint3.text = "DONE!";
all_m.achiev_menu.achieve_hint3._x = 235;
}
};
keyListener.onKeyDown = function () {
if ((Key.getCode() == 37) and (button_pressed == 0)) {
button_pressed = 1;
sselected = sselected + 1;
item = (-sselected) % achiev_number;
trace(sselected);
trace(item);
} else if ((Key.getCode() == 39) and (button_pressed == 0)) {
button_pressed = 1;
sselected = sselected - 1;
item = (-sselected) % achiev_number;
trace(sselected);
trace(item);
}
};
keyListener.onKeyUp = function () {
if (button_pressed == 1) {
button_pressed = 0;
}
};
Key.addListener(keyListener);
all_m.panel_mm.o_panel_1.onRelease = function () {
if (music_enable == 1) {
music_back.stop();
music_enable = 0;
sData_so.data.music_enable = 0;
sData_so.flush();
all_m.panel_mm.o_panel_1.gotoAndStop(3);
all_m.panel_mm.o_panel_1.curr = 3;
} else if (music_enable == 0) {
music_enable = 1;
sData_so.data.music_enable = 1;
sData_so.flush();
PlayMusic(s_menu_back);
all_m.panel_mm.o_panel_1.gotoAndStop(1);
all_m.panel_mm.o_panel_1.curr = 1;
}
};
all_m.panel_mm.o_panel_2.onRelease = function () {
if (sound_enable == 1) {
sound_enable = 0;
sData_so.data.sound_enable = 0;
sData_so.flush();
all_m.panel_mm.o_panel_2.gotoAndStop(3);
all_m.panel_mm.o_panel_2.curr = 3;
} else if (sound_enable == 0) {
sound_enable = 1;
sData_so.data.sound_enable = 1;
sData_so.flush();
all_m.panel_mm.o_panel_2.gotoAndStop(1);
all_m.panel_mm.o_panel_2.curr = 1;
}
};
all_m.panel_mm.attachMovie("but_sponsor_logo_1", "o_sponsor_logo_1", all_m.panel_mm.getNextHighestDepth());
all_m.panel_mm.o_sponsor_logo_1.gotoAndStop(1);
all_m.panel_mm.o_sponsor_logo_1._x = 75;
all_m.panel_mm.o_sponsor_logo_1._y = 415;
all_m.panel_mm.o_sponsor_logo_1.onRelease = function () {
getURL (sponsorurl, "_blank");
};
Symbol 34 MovieClip Frame 1
onEnterFrame = function () {
if (_visible) {
_rotation = (_rotation + 30);
} else {
delete onEnterFrame;
}
};
Symbol 36 MovieClip Frame 10
stop();
Symbol 38 MovieClip Frame 37
_parent.setGotoFrame("done");
stop();
Symbol 50 MovieClip [NewgroundsAPIAsset_Medal_Popup] Frame 1
function endDelay() {
clearInterval(pop_delay);
gotoAndPlay ("closeme");
}
_visible = true;
icon._visible = false;
pop_delay = setInterval(endDelay, 3000);
Symbol 50 MovieClip [NewgroundsAPIAsset_Medal_Popup] Frame 2
medal.attachIcon(icon);
Symbol 50 MovieClip [NewgroundsAPIAsset_Medal_Popup] Frame 10
icon._visible = true;
medal_name = medal.getName();
medal_value = medal.getValue() + "pts";
stop();
Symbol 50 MovieClip [NewgroundsAPIAsset_Medal_Popup] Frame 21
this.removeMovieClip();
_visible = false;
stop();
Symbol 56 MovieClip [NewgroundsAPIAsset_Login_Warning] Frame 1
function endDelay() {
clearInterval(pop_delay);
gotoAndPlay ("closeme");
}
_x = 0;
_y = 0;
_visible = true;
pop_delay = setInterval(endDelay, 6000);
Symbol 56 MovieClip [NewgroundsAPIAsset_Login_Warning] Frame 10
stop();
Symbol 56 MovieClip [NewgroundsAPIAsset_Login_Warning] Frame 21
this.removeMovieClip();
_visible = false;
stop();
Symbol 59 MovieClip [NewgroundsAPIAsset_Connection_Error] Frame 1
function endDelay() {
clearInterval(pop_delay);
gotoAndPlay ("closeme");
}
_x = 0;
_y = 0;
_visible = true;
pop_delay = setInterval(endDelay, 6000);
Symbol 59 MovieClip [NewgroundsAPIAsset_Connection_Error] Frame 10
stop();
Symbol 59 MovieClip [NewgroundsAPIAsset_Connection_Error] Frame 21
this.removeMovieClip();
_visible = false;
stop();
Symbol 80 MovieClip [NewgroundsAPIAsset_big_popup_background] Frame 1
var w = Math.round(this._width);
var h = Math.round(this._height);
if (w < 80) {
w = 80;
}
if (h < 80) {
h = 80;
}
this._width = 350;
this._height = 120;
t._width = w - 2;
t._x = 1;
b._width = w - 2;
b._x = 1;
c._width = w - 2;
c._x = 1;
c._height = h - 2;
c._y = 1;
l._height = h - 2;
l._y = 1;
r._height = h - 2;
r._y = 1;
tr._x = w - 7;
r._x = w - 7;
br._x = w - 7;
b._y = h - 7;
bl._y = h - 7;
br._y = h - 7;
shadow._width = w + 10;
shadow._height = h + 10;
Symbol 84 Button
on (release) {
this._visible = false;
this.removeMovieClip();
}
Symbol 90 Button
on (release) {
getURL (official_version_url, "_blank");
}
Symbol 92 MovieClip [NewgroundsAsset_New_Version_Available] Frame 1
_x = (Stage.width / 2);
_y = (Stage.height / 2);
background._width = Stage.width + 200;
background._height = Stage.height + 200;
background._x = -(_x + 100);
background._y = -(_y + 100);
Symbol 93 Button
on (release) {
getURL (official_version_url, "_blank");
}
Symbol 97 MovieClip [NewgroundsAsset_Illegal_Host] Frame 1
_x = (Stage.width / 2);
_y = (Stage.height / 2);
background._width = Stage.width + 200;
background._height = Stage.height + 200;
background._x = -(_x + 100);
background._y = -(_y + 100);
Symbol 98 MovieClip [API Connector (NewgroundsAPI)] Frame 1
#initclip 23
Object.registerClass("API Connector (NewgroundsAPI)", com.newgrounds.components.APIConnector);
#endinitclip
Symbol 98 MovieClip [API Connector (NewgroundsAPI)] Frame 20
_visible = false;
Symbol 152 MovieClip Frame 11
_parent.gotoAndStop(2);
Symbol 162 MovieClip Frame 1
this.onEnterFrame = function () {
bytesloaded = Math.round(_root.getBytesLoaded());
bytestotal = Math.round(_root.getBytesTotal());
percent = bytesloaded / bytestotal;
barmask._xscale = percent * 100;
};
Symbol 194 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 194 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 205 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 205 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 213 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 213 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 221 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 221 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 229 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 229 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 237 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 237 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 245 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 245 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 253 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 253 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.gotoAndStop(2);
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 260 MovieClip Frame 133
_root.play();
Symbol 261 MovieClip Frame 1
stop();
_root.stop();
shiftamt = 17;
isloaded = false;
this.onEnterFrame = function () {
bytesloaded = Math.round(_root.getBytesLoaded());
bytestotal = Math.round(_root.getBytesTotal());
percent = bytesloaded / bytestotal;
if (bytesloaded == bytestotal) {
isloaded = true;
}
};
this.onRelease = function () {
getURL ("http://www.mofunzone.com/", "_blank");
};
Symbol 26 MovieClip [__Packages.com.newgrounds.components.APIConnector] Frame 0
class com.newgrounds.components.APIConnector extends MovieClip
{
var _x, _y, fake_session, api_id, nextFrame, _visible, error_screens, medal_popups, debug, version, local_data, encryption_key, stop, gotoframe_interval, _totalframes, _framesloaded, gotoAndStop;
function APIConnector () {
super();
_x = Math.round(_x);
_y = Math.round(_y);
if (fake_session and (com.newgrounds.API.getHost() == "localhost")) {
com.newgrounds.API.setFakeSession(true);
}
if (api_id && (!com.newgrounds.API.isConnected())) {
nextFrame();
_visible = false;
setGotoFrame("connecting");
if (error_screens) {
com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.NEW_VERSION_AVAILABLE, onNewVersion, this);
com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.HOST_BLOCKED, onBadHost, this);
}
if (medal_popups) {
com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.UNLOCK_MEDAL, doUnlock, this);
}
com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, onConnected, this);
if (com.newgrounds.API.isPublishedHost()) {
debug = false;
}
if (version) {
com.newgrounds.API.setVersion(version);
}
if (!com.newgrounds.API.hasUserSession()) {
var _local3 = com.newgrounds.API.loadLocal("api_connector_data");
if (_local3) {
local_data = _local3;
} else {
local_data = {medals_unlocked:new Array()};
}
}
com.newgrounds.API.setPreload(true);
com.newgrounds.API.connect(api_id, encryption_key, debug);
} else if (api_id && (com.newgrounds.API.isConnected())) {
_visible = false;
setGotoFrame("done");
}
stop();
}
function doUnlock(e) {
var _local5 = _root.attachMovie("NewgroundsAPIAsset_Medal_Popup", "medal_pop_" + e.data.medal.getID(), _root.getNextHighestDepth());
if (e.data.x != undefined) {
_local5._x = e.data.x + 254;
} else {
_local5._x = Stage.width;
}
if (e.data.x != undefined) {
_local5._y = e.data.y + 73;
} else {
_local5._y = Stage.height;
}
_local5.medal = e.data.medal;
var _local3 = com.newgrounds.API.getMedals();
var _local2 = 0;
while (_local2 < _local3.length) {
if ((_local3[_local2].getID() != e.data.medal.getID()) && (_root["medal_pop_" + _local3[_local2].getID()])) {
_root["medal_pop_" + _local3[_local2].getID()]._y = _root["medal_pop_" + _local3[_local2].getID()]._y - 70;
}
_local2++;
}
}
function onLoginError() {
var _local2 = _root.attachMovie("Asset_Login_Warning", "Asset_Login_Warning", _root.getNextHighestDepth());
}
function onConnectionError() {
var _local3 = _root.attachMovie("Asset_Connection_Error", "Asset_Connection_Error", _root.getNextHighestDepth());
setGotoFrame("done");
}
function onConnected(event, params) {
if (event.success) {
setGotoFrame("connected");
if (((error_screens && (com.newgrounds.API.isPublishedHost())) && (com.newgrounds.API.hasPublisher())) && (!com.newgrounds.API.hasUserSession())) {
onLoginError();
}
} else if (error_screens) {
onConnectionError();
}
}
function onNewVersion() {
var _local2 = _root.attachMovie("NewgroundsAsset_New_Version_Available", "NewgroundsAsset_New_Version_Available", _root.getNextHighestDepth());
_local2.official_version_url = com.newgrounds.API.getOfficialURL();
}
function onBadHost() {
var _local2 = _root.attachMovie("NewgroundsAsset_Illegal_Host", "NewgroundsAsset_Illegal_Host", _root.getNextHighestDepth());
_local2.official_version_url = com.newgrounds.API.getOfficialURL();
}
function setGotoFrame(frame) {
if (goto_frame == null) {
goto_frame = frame;
gotoframe_interval = setInterval(this, "gotoFrameIfLoaded", 50);
}
}
function gotoFrameIfLoaded() {
if ((goto_frame != null) && (_framesloaded == _totalframes)) {
_visible = true;
gotoAndStop(goto_frame);
goto_frame = null;
clearInterval(gotoframe_interval);
}
}
var goto_frame = null;
}
Symbol 99 MovieClip [__Packages.com.newgrounds.APIError] Frame 0
class com.newgrounds.APIError
{
var message, name, alias;
function APIError (error, msg) {
if (Number(error).toString() == String(error)) {
error = Number(error);
} else if (error_codes[String(error)]) {
error = error_codes[String(error)];
} else {
error = 0;
}
code = error;
message = msg;
name = error_names[error];
alias = aliases[error];
}
static function init_codes() {
var _local2 = new Object();
var _local1 = 0;
while (_local1 < aliases.length) {
_local2[aliases[_local1]] = _local1;
_local1++;
}
return(_local2);
}
static function init_names() {
var _local5 = new Array();
var _local3 = 0;
while (_local3 < aliases.length) {
var _local2 = aliases[_local3].toLowerCase().split("_");
var _local1 = 0;
while (_local1 < _local2.length) {
_local2[_local1] = _local2[_local1].substr(0, 1).toUpperCase() + _local2[_local1].substr(1, _local2[_local1].length);
for (var _local4 in always_caps) {
if (_local2[_local1].toUpperCase() == always_caps[_local4]) {
_local2[_local1] = _local2[_local1].toUpperCase();
}
}
_local1++;
}
_local5[_local3] = _local2.join(" ");
_local3++;
}
return(_local5);
}
function isError() {
return(true);
}
static var aliases = new Array("UNKNOWN_ERROR", "INVALID_API_ID", "MISSING_PARAM", "INVALID_STAT_ID", "INVALID_COMMAND_ID", "FLASH_ADS_NOT_APPROVED", "PERMISSION_DENIED", "IDENTIFICATION_REQUIRED", "INVALID_EMAIL_ADDRESS", "BANNED_USER", "SESSION_EXPIRED", "INVALID_SCORE", "INVALID_MEDAL", "INVALID_SAVE_GROUP", "FILE_NOT_FOUND", "SITE_ID_REQUIRED", "UPLOAD_IN_PROGRESS", "USER_CANCELLED", "CONFIRM_REQUEST", "ILLEGAL_REQUEST", "CONNECTION_FAILED", "QUERY_INCOMPLETE", "SAVE_FILE_ERROR", "INVALID_VALUE", "SERVER_ERROR", "INVALID_SCOREBOARD");
static var always_caps = new Array("API", "URL", "ID");
static var error_codes = init_codes();
static var error_names = init_names();
var code = 0;
}
Symbol 100 MovieClip [__Packages.com.newgrounds.API] Frame 0
class com.newgrounds.API
{
static var version, user_email, movie_id, debug, session_id, connected, tracker_id, user_id, user_name, timeout, encryption_key, host, remote_auth, ad_url, eventDispatcher, last_command, ad_swf_url;
function API () {
}
static function setVersion(v) {
version = v;
}
static function setUserEmail(e) {
user_email = e;
}
static function setFakeSession(fake) {
fake_session = fake;
}
static function setPreload(p) {
preload = p;
}
static function getPercentLoaded() {
var _local2;
if (preload && (preload_items > 0)) {
_local2 = 80;
var _local4 = Math.round((preload_items_loaded / preload_items) * 20);
var _local3 = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * _local2) + _local4;
} else {
_local2 = 100;
var _local3 = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * _local2);
}
return(_local3);
}
static function reportNewAsset() {
if (preload) {
preload_items++;
}
}
static function reportAssetLoaded() {
if (preload) {
preload_items_loaded++;
}
}
static function populateMedals(medal_list) {
if (medals === null) {
medals = new Array();
var _local2 = 0;
while (_local2 < medal_list.length) {
var _local1 = medal_list[_local2];
medals.push(new com.newgrounds.Medal(_local1.medal_id, _local1.medal_name, _local1.medal_value, _local1.medal_difficulty, _local1.medal_unlocked, _local1.medal_icon));
_local2++;
}
}
}
static function populateSaveGroups(save_group_list, file_path, image_path) {
com.newgrounds.SaveFile.setFilePath(file_path);
com.newgrounds.SaveFile.setImagePath(image_path);
save_groups = new Array();
var _local6 = 0;
while (_local6 < save_group_list.length) {
var _local2 = save_group_list[_local6];
var _local5 = new com.newgrounds.SaveGroup(_local2.group_id, _local2.group_name, _local2.group_type);
var _local4 = 0;
while (_local4 < _local2.keys.length) {
var _local3 = _local2.keys[_local4];
_local5.addKey(_local3.id, _local3.name, _local3.type);
_local4++;
}
_local4 = 0;
while (_local4 < _local2.ratings.length) {
var _local1 = _local2.ratings[_local4];
_local5.addRating(_local1.id, _local1.name, _local1.min, _local1.max, _local1.float);
_local4++;
}
save_groups.push(_local5);
_local6++;
}
}
static function populateScoreBoards(score_boards) {
scoreboards = new Array();
var _local1 = 0;
while (_local1 < score_boards.length) {
scoreboards.push(new com.newgrounds.ScoreBoard(score_boards[_local1].id, score_boards[_local1].name));
_local1++;
}
}
static function getOfficialURL() {
var _local1 = (((GATEWAY_URL + "?tracker_id=") + movie_id) + "&command_id=loadOfficalVersion&seed=") + Math.random();
if (debug) {
_local1 = _local1 + "&debug=1";
}
return(_local1);
}
static function loadOfficialURL() {
getURL (getOfficialURL(), "_blank");
}
static function hasUserSession() {
if (session_id && (publisher_id)) {
return(true);
}
if (_root.NewgroundsAPI_PublisherID && (_root.NewgroundsAPI_SessionID)) {
return(true);
}
return(false);
}
static function hostIsCompatible() {
return(!(_root.NewgroundsAPI_PublisherID === undefined));
}
static function isNewgrounds() {
return((((publisher_id == 1) || (_root.NewgroundsAPI_PublisherID == 1)) || (getHost().toLowerCase().indexOf("ungrounded.net") > -1)) || (getHost().toLowerCase().indexOf("newgrounds.com") > -1));
}
static function hasPublisher() {
return(publisher_id || (_root.NewgroundsAPI_PublisherID));
}
static function hasUserEmail() {
if (user_email) {
return(true);
}
return(false);
}
static function isConnected() {
return(connected);
}
static function getID() {
return(getTrackerID());
}
static function getTrackerID() {
return(tracker_id);
}
static function getUserID() {
return(user_id);
}
static function getUserName() {
return(user_name);
}
static function connectionTimeOut() {
reportAssetLoaded();
clearInterval(timeout);
callListener(com.newgrounds.APIEvent.API_CONNECTED, false, new com.newgrounds.APIError("CONNECTION_FAILED", "Connection to API gateway timed out."));
}
static function connect(m_id, encrypt_key, debug_mode) {
if (connected) {
return(undefined);
}
sendMessage("Connecting to the Newgrounds API Gateway...");
var _local2 = function () {
com.newgrounds.API.connectionTimeOut();
};
timeout = setInterval(_local2, 10000, null);
if (!m_id) {
fatalError("API.connect() - missing required movie_id parameter", "connect");
}
movie_id = String(m_id);
tracker_id = Number(movie_id.substring(0, movie_id.indexOf(":")));
encryption_key = encrypt_key;
debug = debug_mode;
user_id = 0;
user_name = "Guest";
if (_root.NewgroundsAPI_PublisherID) {
publisher_id = _root.NewgroundsAPI_PublisherID;
if (_root.NewgroundsAPI_SessionID) {
session_id = _root.NewgroundsAPI_SessionID;
}
} else if (fake_session) {
publisher_id = 1;
session_id = "D3bu64p1U53R";
user_id = 10;
user_name = "API-Debugger";
} else {
if (debug) {
publisher_id = 1;
}
session_id = null;
}
if (_root.NewgroundsAPI_UserName) {
user_name = _root.NewgroundsAPI_UserName;
}
if (_root.NewgroundsAPI_UserID) {
user_id = _root.NewgroundsAPI_UserID;
}
if (_root.NewgroundsAPI_UserpageFormat) {
userpage_format = _root.NewgroundsAPI_UserpageFormat;
}
reportNewAsset();
connected = true;
sendCommand("connectMovie", {host:getHost(), movie_version:version});
}
static function getHost() {
if (!host) {
var _local1 = _url;
if ((_local1.toLowerCase().indexOf("http://") > -1) or (_local1.toLowerCase().indexOf("https://") > -1)) {
if (_local1.toLowerCase().indexOf(NEWGROUNDS_PREVIEW) > -1) {
host = NEWGROUNDS_PREVIEW;
} else {
host = _local1.split("/")[2].toLowerCase();
}
} else {
host = LOCAL_HOST;
}
}
return(host);
}
static function isPublishedHost() {
for (var _local1 in PREVIEW_HOSTS) {
if (getHost() == PREVIEW_HOSTS[_local1]) {
return(false);
}
}
return(true);
}
static function loadUserPage(u_id, u_name) {
if ((u_id == undefined) && (u_name == undefined)) {
if (hasUserSession()) {
u_id = user_id;
u_name = user_name;
} else {
return(false);
}
}
if (publisher_id == 1) {
var _local1 = ("http://" + user_name.toLowerCase()) + ".newgrounds.com";
getURL (_local1, "_blank");
return(true);
}
if (userpage_format) {
var _local1 = userpage_format;
_local1 = _local1.split(":user_id:").join(u_id.toString());
_local1 = _local1.split(":user_name:").join(escape(u_name));
getURL (_local1, "_blank");
return(true);
}
return(false);
}
static function loadNewgrounds() {
sendCommand("loadNewgrounds", {host:getHost()}, true);
}
static function loadMySite() {
sendCommand("loadMySite", {host:getHost()}, true);
}
static function loadCustomLink(link) {
sendCommand("loadCustomLink", {host:getHost(), link:link}, true);
}
static function logCustomEvent(event) {
sendCommand("logCustomEvent", {host:getHost(), event:event});
}
static function getScoreBoard(board) {
if ((!scoreboards) || (scoreboards.length < 1)) {
sendWarning("You do not have any scoreboards configured in your API setup.");
return(null);
}
for (var _local2 in scoreboards) {
if ((typeof(board) == "string") && (scoreboards[_local2].name == board)) {
return(scoreboards[_local2]);
}
if ((typeof(board) == "number") && (scoreboards[_local2].id == board)) {
return(scoreboards[_local2]);
}
}
sendWarning(("Could not find any scoreboards named '" + board) + "'.");
return(null);
}
static function postScore(board_name, value, tag) {
var _local3 = getScoreBoard(board_name);
if (tag === undefined) {
tag = "";
}
if (!_local3) {
sendError({command_id:"postScore"}, new com.newgrounds.APIError("INVALID_SCOREBOARD", "Failed to post score. Check the spelling of your board name."));
return(undefined);
}
if (value == undefined) {
sendError({command_id:"postScore"}, new com.newgrounds.APIError("MISSING_PARAM", "Missing score value"));
return(undefined);
}
sendSecureCommand("postScore", {user_name:user_name, board:_local3.id, value:value, tag:tag, publisher_id:publisher_id});
}
static function loadScores(board_name, period, tag) {
var _local3 = "loadScores";
var _local2 = getScoreBoard(board_name);
if (!_local2) {
sendError({command_id:_local3}, new com.newgrounds.APIError("INVALID_SCOREBOARD", "Failed to load scores. Check the spelling of your board name."));
return(undefined);
}
var _local1 = {};
_local1.publisher_id = publisher_id;
_local1.board = _local2.id;
_local1.num_results = _local2.num_results;
_local1.page = _local2.page;
if (period === undefined) {
_local1.period = _local2.period;
} else {
_local1.period = period;
}
if (tag === undefined) {
_local1.tag = _local2.tag;
} else {
_local1.tag = tag;
}
sendCommand(_local3, _local1);
}
static function unlockMedal(medal, x, y) {
if (!medal) {
sendError({command_id:"unlockMedal"}, new com.newgrounds.APIError("MISSING_PARAM", "missing required medal name"));
return(undefined);
}
if (typeof(medal) != "object") {
medal = getMedal(medal);
}
if (!medal) {
sendError({command_id:"unlockMedal"}, new com.newgrounds.APIError("INVALID_MEDAL", "medal unlock failed, check your medal name for correct spelling."));
return(undefined);
}
callListener(com.newgrounds.APIEvent.UNLOCK_MEDAL, true, {medal:medal, x:x, y:y});
if (hasUserSession() or debug) {
sendMessage(("Attempting to unlock '" + medal.getName()) + "'");
var _local3 = new Object();
_local3.medal_id = medal.getID();
sendSecureCommand("unlockMedal", _local3);
} else {
sendMessage(("Unlocking '" + medal.getName()) + "'");
medal.setUnlocked(true);
var _local2 = loadLocal("medals_unlocked");
if (!_local2) {
_local2 = new Object();
}
_local2[medal.getID()] = true;
saveLocal("medals_unlocked", _local2);
}
}
static function loadMedals() {
if (medals) {
callListener(com.newgrounds.APIEvent.MEDALS_LOADED, true, {medals:medals});
return(undefined);
}
var _local1 = new Object();
if (hasUserSession()) {
_local1.publisher_id = publisher_id;
_local1.user_id = user_id;
}
sendCommand("getMedals", _local1);
}
static function getMedals() {
return(medals);
}
static function getMedal(identifier) {
if ((!medals) || (medals.length < 1)) {
sendWarning("You do not have any medals configured on your API setup!");
return(false);
}
for (var _local3 in medals) {
var _local1 = medals[_local3];
if ((typeof(identifier) == "string") && (_local1.getName() == identifier)) {
return(_local1);
}
if (_local1.getID() == identifier) {
return(_local1);
}
}
sendWarning(("Could not find any medals named '" + identifier) + "'.");
return(false);
}
static function saveLocal(save_id, save_data, size_allocation) {
if (!sharedObjects[save_id]) {
sharedObjects[save_id] = SharedObject.getLocal((("ng_ap_secure_" + movie_id) + "_") + save_id);
}
sharedObjects[save_id].data[save_id] = encodeData(save_data);
sharedObjects[save_id].flush();
}
static function loadLocal(save_id) {
if (!sharedObjects[save_id]) {
sharedObjects[save_id] = SharedObject.getLocal((("ng_ap_secure_" + movie_id) + "_") + save_id);
}
sharedObjects[save_id].flush();
echo((("sharedobject " + save_id) + " is: ") + sharedObjects[save_id].data[save_id]);
if (sharedObjects[save_id].data[save_id]) {
echo("decoded: " + decodeData(sharedObjects[save_id].data[save_id]));
return(decodeData(sharedObjects[save_id].data[save_id]));
}
return(null);
}
static function encodeData(data) {
return(compressHex(com.newgrounds.encoders.RC4.encrypt(com.newgrounds.encoders.JSON.encode(data), encryption_key)));
}
static function decodeData(base) {
return(com.newgrounds.encoders.JSON.decode(com.newgrounds.encoders.RC4.decrypt(uncompressHex(base), encryption_key)));
}
static function compressHex(hex_value) {
var _local6 = hex_value.length % 6;
var _local4 = "";
var _local5 = new com.newgrounds.encoders.BaseN(compression_radix);
var _local1 = 0;
while (_local1 < hex_value.length) {
var _local2 = Number("0x" + hex_value.substr(_local1, 6));
_local4 = _local4 + _local5.encode(_local2, 4);
_local1 = _local1 + 6;
}
return(_local6 + _local4);
}
static function uncompressHex(base_value) {
var _local9 = Number(base_value.charAt(0));
var _local7 = "";
var _local3;
var _local8 = new com.newgrounds.encoders.BaseN(compression_radix);
var _local2 = 1;
while (_local2 < base_value.length) {
var _local6 = base_value.substr(_local2, 4);
var _local5 = _local8.decode(_local6);
var _local1 = dec2hex(_local5);
if ((_local2 + 4) < base_value.length) {
_local3 = 6;
} else {
_local3 = _local9;
}
while (_local1.length < _local3) {
_local1 = "0" + _local1;
}
_local7 = _local7 + _local1;
_local2 = _local2 + 4;
}
return(_local7);
}
static function dec2hex(dec) {
var _local4 = "0123456789ABCDEF";
var _local3 = "";
while (dec > 0) {
var _local2 = dec % 16;
_local3 = _local4.charAt(_local2) + _local3;
dec = (dec - _local2) / 16;
}
return(_local3);
}
static function getSaveGroup(group) {
if ((save_groups == null) || (save_groups.length < 1)) {
sendWarning("You do not have any save groups configured in your API setup!");
return(null);
}
var _local1 = 0;
while (_local1 <= save_groups.length) {
if ((typeof(group) == "number") or (Number(group).toString() == String(group))) {
if (save_groups[_local1].getID() == Number(group)) {
return(save_groups[_local1]);
}
} else if (typeof(group) == "string") {
if (save_groups[_local1].getName().toLowerCase() == group.toLowerCase()) {
return(save_groups[_local1]);
}
}
_local1++;
}
sendWarning(("Could not find any save groups named '" + group) + "'.");
return(null);
}
static function getCurrentSaveFile() {
return(save_file);
}
static function setCurrentSaveFile(current) {
save_file = current;
}
static function loadSaveFile(save_id, get_contents) {
if (get_contents === undefined) {
get_contents = true;
}
var _local1 = "loadSaveFile";
var _local2 = {publisher_id:publisher_id, save_id:save_id, get_contents:get_contents};
save_file = null;
sendCommand(_local1, _local2);
}
static function loadFilesByDate(group_name, sort_descending, key_name, key_value) {
if (sort_descending === undefined) {
sort_descending = true;
}
var _local2 = getSaveGroup(group_name);
if (!_local2) {
var _local3 = new com.newgrounds.APIError("QUERY_INCOMPLETE", "The query could not be preformed, check the spelling of your save group name.");
sendError({command_id:"loadFilesByDate"}, _local3);
return(undefined);
}
var _local1 = new com.newgrounds.SaveGroupQuery(_local2);
if (key_name) {
_local1.addKeyCondition(key_name, "=", key_value);
}
_local1.sortOn("CREATED_ON", (sort_descending ? "DESC" : "ASC"));
_local1.execute();
}
static function loadFilesByViews(group_name, sort_descending, key_name, key_value) {
if (sort_descending === undefined) {
sort_descending = true;
}
var _local2 = getSaveGroup(group_name);
if (!_local2) {
var _local3 = new com.newgrounds.APIError("QUERY_INCOMPLETE", "The query could not be preformed, check the spelling of your save group name.");
sendError({command_id:"loadFilesByViews"}, _local3);
return(undefined);
}
var _local1 = new com.newgrounds.SaveGroupQuery(_local2);
if (key_name) {
_local1.addKeyCondition(key_name, "=", key_value);
}
_local1.sortOn("TOTAL_VIEWS", (sort_descending ? "DESC" : "ASC"));
_local1.execute();
}
static function loadFilesByRating(group_name, rating_name, sort_descending, key_name, key_value) {
if (sort_descending === undefined) {
sort_descending = true;
}
var _local2 = getSaveGroup(group_name);
if (!_local2) {
var _local3 = new com.newgrounds.APIError("QUERY_INCOMPLETE", "The query could not be preformed, check the spelling of your save group name.");
sendError({command_id:"loadFilesByRating"}, _local3);
return(undefined);
}
var _local1 = new com.newgrounds.SaveGroupQuery(_local2);
if (key_name) {
_local1.addKeyCondition(key_name, "=", key_value);
}
_local1.sortOnRating(rating_name, (sort_descending ? "DESC" : "ASC"), "score");
_local1.execute();
}
static function lookupSaveFiles(save_group) {
var _local1 = "lookupSaveFiles";
var _local2 = {publisher_id:publisher_id, group_id:save_group.getID(), query:com.newgrounds.encoders.JSON.encode(save_group.getQuery(true))};
sendCommand(_local1, _local2);
}
static function newSaveFile(group) {
var _local1 = getSaveGroup(group);
if (_local1) {
return(_local1.newFile());
}
var _local2 = new com.newgrounds.APIError("INVALID_SAVE_GROUP", "You can not create new files in invalid groups.");
sendError({command_id:"newSaveFile"}, _local2);
}
static function newSaveQuery(group) {
var _local1 = getSaveGroup(group);
if (_local1) {
return(_local1.newQuery());
}
var _local2 = new com.newgrounds.APIError("INVALID_SAVE_GROUP", ("'" + group) + "' is not a valid save group.");
sendError({command_id:"newSaveQuery"}, _local2);
}
static function checkFilePrivs(file) {
if (user_id) {
var _local1 = user_id;
} else {
var _local1 = 0;
}
var _local2 = {group:file.getGroup().getID(), filename:file.getName(), user_id:_local1, publisher_id:publisher_id};
sendCommand("checkFilePrivs", _local2);
}
static function saveFile(file, overwrite) {
var _local1;
_local1 = {group:file.getGroup().getID(), filename:file.getName(), description:file.getDescription(), draft:file.__get__draft(), user_name:user_name};
if (overwrite) {
_local1.overwrite = overwrite;
}
if (file.getDuplicateID()) {
_local1.save_id = file.getDuplicateID();
}
if (file.getKeys().length > 0) {
_local1.keys = file.getKeys();
}
var _local3;
_local3 = {file:file.getRawContents()};
if (file.getThumbnailImageScan()) {
_local3.thumbnail = file.getThumbnailImageScan();
}
save_file = file;
sendSecureCommand("saveFile", _local1, null, _local3);
}
static function rateSaveFile(file, rating, vote) {
var _local1 = {group:file.getGroup().getID(), save_id:file.getID(), rating_id:rating.rating_id, vote:vote, user_id:user_id};
sendSecureCommand("rateSaveFile", _local1);
}
static function getConfirmation(command_name, event, msg, target, confirm, cancel) {
var _local1 = new com.newgrounds.APIError("CONFIRM_REQUEST", msg);
_local1.confirm = function () {
target[confirm]();
};
_local1.cancel = function () {
target[cancel]();
};
_local1.command = command_name;
callListener(event, false, _local1);
}
static function onRemoteAuthentication(auth_result) {
var _local1 = com.newgrounds.encoders.JSON.decode(com.newgrounds.encoders.RC4.decrypt(auth_result, encryption_key));
delete remote_auth;
user_id = _local1.NewgroundsAPI_UserID;
user_name = _local1.NewgroundsAPI_UserName;
session_id = _local1.NewgroundsAPI_SessionID;
publisher_id = _local1.NewgroundsAPI_PublisherID;
}
static function doEvent(e) {
switch (e.command_id) {
case "connectMovie" :
clearInterval(timeout);
sendMessage("You have successfully connected to the Newgrounds API Gateway");
sendMessage(("Movie identified as \"" + e.movie_name) + "\"");
callListener(com.newgrounds.APIEvent.API_CONNECTED, e.success, {title:e.movie_name});
var _local7 = false;
if (e.ad_status === -1) {
var _local11 = "This movie was not approved to run Flash Ads.";
sendWarning(_local11);
sendWarning(("visit " + AD_TERMS_URL) + " to view our approval guidelines");
if (!e.ad_url) {
callListener(com.newgrounds.APIEvent.ADS_APPROVED, false, new com.newgrounds.APIError("FLASH_ADS_NOT_APPROVED", _local11));
} else {
_local7 = true;
}
} else if (e.ad_status === 0) {
var _local11 = "Flash Ads are currently awaiting approval.";
sendNotice(_local11);
if (!e.ad_url) {
callListener(com.newgrounds.APIEvent.ADS_APPROVED, false, new com.newgrounds.APIError("FLASH_ADS_NOT_APPROVED", _local11));
} else {
_local7 = true;
}
}
if (e.ad_url) {
ad_url = unescape(e.ad_url);
if (!_local7) {
sendMessage("This movie has been approved to run Flash Ads!");
}
callListener(com.newgrounds.APIEvent.ADS_APPROVED, true);
}
if (e.deny_host) {
var _local11 = getHost() + " does not have permission to run this movie!";
sendWarning(_local11);
sendWarning("\tUpdate your API configuration to unblock " + getHost());
callListener(com.newgrounds.APIEvent.HOST_BLOCKED, true, {real_url:unescape(e.movie_url), url:getOfficialURL()});
} else if (e.movie_version) {
sendWarning("According to your API Configuration, this version is out of date.");
if (version) {
sendWarning("\tThe this movie is version " + version);
}
sendWarning("\tThe most current version is " + e.movie_version);
callListener(com.newgrounds.APIEvent.NEW_VERSION_AVAILABLE, true, {version:e.movie_version, real_url:unescape(e.movie_url), url:getOfficialURL()});
}
if (e.request_portal_url) {
sendCommand("setPortalID", {portal_url:_url});
}
if (preload) {
reportNewAsset();
var _local8 = {};
if (hasUserSession()) {
_local8.publisher_id = publisher_id;
_local8.user_id = user_id;
}
sendCommand("preloadSettings", _local8);
}
reportAssetLoaded();
break;
case "preloadSettings" :
if (e.medals) {
populateMedals(e.medals);
if ((!hasUserSession()) and (!debug)) {
echo("checking for sharedobject medals...");
var _local4 = loadLocal("medals_unlocked");
if (_local4) {
for (var _local32 in _local4) {
var _local32 = Number(_local32);
if (_local4[_local32]) {
var _local3 = getMedal(_local32);
echo("now unlocking " + _local3.getName());
_local3.setUnlocked(true);
}
}
}
}
}
if (e.save_groups) {
populateSaveGroups(e.save_groups, e.save_file_path);
}
if (e.score_boards) {
populateScoreBoards(e.score_boards);
}
if (_root.NewgroundsAPI_SaveFileID && (_root.NewgroundsAPI_SaveGroupID)) {
callListener(com.newgrounds.APIEvent.FILE_REQUESTED, true, {save_id:_root.NewgroundsAPI_SaveFileID, group:getSaveGroup(_root.NewgroundsAPI_SaveGroupID)});
}
callListener(com.newgrounds.APIEvent.METADATA_LOADED, true);
reportAssetLoaded();
break;
case "logCustomEvent" :
if (e.success) {
sendMessage(("Event '" + e.event) + "' was logged.");
}
callListener(com.newgrounds.APIEvent.EVENT_LOGGED, e.success, {event:e.event});
break;
case "postScore" :
var _local9;
if (e.success) {
var _local5 = "User";
if (user_email) {
_local5 = user_email;
} else if (user_name) {
_local5 = user_name;
}
var _local19 = getScoreBoard(e.board);
sendMessage(((((_local5 + " posted ") + e.value) + " to '") + _local19.name) + "'");
_local9 = {board:_local19, value:e.value, username:_local5};
}
callListener(com.newgrounds.APIEvent.SCORE_POSTED, e.success, _local9);
break;
case "loadScores" :
_local9 = new Object();
var _local19 = getScoreBoard(e.board);
if (_local19.exists()) {
_local19.setScores(e.scores, e.period, e.page, e.num_results);
}
callListener(com.newgrounds.APIEvent.SCORES_LOADED, e.success, {board:_local19});
break;
case "unlockMedal" :
var _local24 = getMedal(e.medal_name);
_local24.setUnlocked(true);
sendMessage(("Successfuly unlocked '" + _local24.getName()) + "'");
callListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, e.success, {medal_id:_local24.id, medal:_local24});
break;
case "getMedals" :
populateMedals(e.medals);
callListener(com.newgrounds.APIEvent.MEDALS_LOADED, e.success, {medals:medals});
break;
case "loadSaveFile" :
var _local16 = getSaveGroup(e.group_id);
var _local14 = new com.newgrounds.SaveFile(_local16);
_local14.id = e.file.save_id;
_local14.name = e.file.filename;
_local14.fileUrl = e.file.file;
_local14.thumbnailUrl = e.file.thumb;
_local14.authorName = e.file.user_name;
_local14.authorId = e.file.user_id;
_local14.description = e.file.description;
_local14.setPermissions(e.file.status, e.file.locked);
for (var _local6 in e.file.keys) {
_local14.setKey(e.file.keys[_local6].id, e.file.keys[_local6].value);
}
for (var _local6 in e.file.ratings) {
_local14.setRating(e.file.ratings[_local6].id, e.file.ratings[_local6].votes, e.file.ratings[_local6].score);
}
if (e.get_contents) {
_local14.loadContents();
}
callListener(com.newgrounds.APIEvent.FILE_INITIALIZED, e.success, {save_id:_local14.id, file:_local14});
save_file = _local14;
break;
case "lookupSaveFiles" :
var _local12 = getSaveGroup(e.group_id).getQuery();
_local12.onExecuted(e.files);
break;
case "rateSaveFile" :
_local16 = getSaveGroup(e.group_id);
_local14 = _local16.getFile(e.save_id);
if (e.already_voted) {
var _local27 = new com.newgrounds.APIError("PERMISSION_DENIED", "You have already voted on this item today");
callListener(com.newgrounds.APIEvent.VOTE_COMPLETE, false, {error:_local27, file:_local14, save_id:_local14.id});
return(undefined);
}
if (e.success) {
var _local10 = _local14.onVoted(e);
callListener(com.newgrounds.APIEvent.VOTE_COMPLETE, e.success, {rating:_local10, file:_local14, save_id:_local14.id});
} else {
callListener(com.newgrounds.APIEvent.VOTE_COMPLETE, e.success, {file:_local14, save_id:_local14.id});
sendError("Your vote was not accepted.");
}
break;
case "saveFile" :
if (save_file) {
if (!save_file.exists()) {
save_file.setID(e.save_id, true);
}
save_file.onSaved(e);
callListener(com.newgrounds.APIEvent.FILE_SAVED, e.success, {save_id:save_file.__get__id(), file:save_file});
if (e.success) {
sendMessage(((("You just saved a new file (id #" + e.save_id) + ") to the '") + save_file.__get__group().__get__name()) + "' save group.");
}
}
save_file = null;
break;
case "checkFilePrivs" :
_local9 = {file:save_file, filename:e.filename, group:e.group, exists:e.exists, can_write:e.can_write};
if (e.duplicate_id) {
_local9.duplicate_id = e.duplicate_id;
}
if (!e.success) {
sendWarning("You do not have permission to save this file!");
}
callListener(com.newgrounds.APIEvent.FILE_PRIVS_LOADED, e.success, _local9);
}
}
static function getDispatcher() {
if (!eventDispatcher) {
eventDispatcher = new com.newgrounds.APIEventDispatcher();
}
return(eventDispatcher);
}
static function hasEventListener(event) {
return(getDispatcher().hasEventListener(event));
}
static function addEventListener(event, listener, target) {
echo(("Adding a listener for '" + event) + "'");
getDispatcher().addEventListener(event, listener, target);
}
static function removeEventListener(event, target) {
getDispatcher().removeEventListener(event, target);
}
static function callListener(event, success, data, target) {
echo("Fired Event: " + event);
var _local2 = new com.newgrounds.APIEvent(event, success, data);
getDispatcher().dispatchEvent(_local2);
if ((event == com.newgrounds.APIEvent.API_CONNECTED) && (!success)) {
connected = false;
}
bridge.sendEvent(event, {success:success, data:data});
}
static function sendError(c, e) {
switch (c.command_id) {
case "connectMovie" :
clearInterval(timeout);
callListener(com.newgrounds.APIEvent.API_CONNECTED, false, {error:e, response:c});
break;
case "saveFile" :
callListener(com.newgrounds.APIEvent.FILE_SAVED, false, {error:e, file:save_file, response:c});
save_file = null;
}
var _local3 = (((((("[Newgrounds API ERROR] :: " + c.command_id) + "() - ") + e.name) + ":") + newline) + "\t\t\t\t") + e.message;
trace(_local3);
bridge.sendEvent("trace", {data:_local3});
}
static function sendWarning(m, c) {
if (c) {
m = m + ((("\r[Newgrounds API WARNING] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
var _local1 = "[Newgrounds API WARNING] :: " + m;
trace(_local1);
bridge.sendEvent("trace", {data:_local1});
}
static function sendNotice(m, c) {
if (c) {
m = m + ((("\r[Newgrounds API NOTICE] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
trace("[Newgrounds API NOTICE] :: " + m);
}
static function fatalError(m, c) {
if (c) {
m = m + ((("\r\tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
throw (((("***ERROR*** frame=" + _root._currentframe) + ", class=API") + newline) + newline) + m;
}
static function openLoginPage() {
if (hasUserSession()) {
return(undefined);
}
if (!remote_auth) {
var _local1 = com.newgrounds.encoders.MD5.calculate((Math.random() + "a") + movie_id);
_local1 = "POOPYPANTS";
remote_auth = new com.newgrounds.RemoteAuth(_local1);
}
var _local2 = com.newgrounds.encoders.RC4.encrypt(remote_auth.__get__token(), encryption_key);
trace(_local2);
getURL ((((LOGIN_URL + "?api_auth_id=") + movie_id) + "&api_auth_key=") + _local2, "_blank");
}
static function sendSecureCommand(command, secure_params, unsecure_params, files) {
if (((!debug) && (!hasUserSession())) && (!hasUserEmail())) {
sendError({command_id:command}, new com.newgrounds.APIError("IDENTIFICATION_REQUIRED", ("You must be logged in, or provide an e-mail address using 'API.setUserEmail(\"name@domain.com\");' to use " + command) + "()."));
return(undefined);
}
if (!command) {
fatalError("Missing command", "sendSecureCommand");
}
if (!secure_params) {
fatalError("Missing secure_params", "sendSecureCommand");
}
if (!unsecure_params) {
unsecure_params = new Object();
}
var _local2 = "";
var _local1 = 0;
while (_local1 < 16) {
_local2 = _local2 + compression_radix.charAt(Math.floor(Math.random() * compression_radix.length));
_local1++;
}
if ((debug && (!fake_session)) && (!session_id)) {
secure_params.session_id = "";
} else {
secure_params.session_id = session_id;
}
secure_params.as_version = 2;
secure_params.user_email = user_email;
secure_params.publisher_id = publisher_id;
secure_params.seed = _local2;
secure_params.command_id = command;
var _local6 = com.newgrounds.encoders.JSON.encode(secure_params);
trace(("JSON: " + _local6) + newline);
var _local9 = com.newgrounds.encoders.MD5.calculate(_local2);
var _local7 = com.newgrounds.encoders.RC4.encrypt(_local6, encryption_key);
var _local8 = _local9 + _local7;
unsecure_params.secure = compressHex(_local8);
sendCommand("securePacket", unsecure_params, false, files);
}
static function sendCommand(command, params, open_browser, files) {
if ((!connected) and (command != "connectMovie")) {
var _local12 = (("API." + command) + "() - API.connect() must be called before this command can be called") + newline;
fatalError(_local12, "connect");
}
if (open_browser) {
var _local2 = new Object();
} else {
var _local2 = new LoadVars();
}
_local2.command_id = command;
_local2.tracker_id = movie_id;
if (debug) {
_local2.debug = debug;
}
if (params) {
for (var _local9 in params) {
_local2[_local9] = params[_local9];
}
}
if (files) {
for (var _local9 in files) {
_local2[_local9] = files[_local9];
}
}
if (open_browser) {
var _local6 = (GATEWAY_URL + "?seed=") + Math.random();
for (var _local9 in _local2) {
_local6 = _local6 + ((("&" + escape(_local9)) + "=") + escape(_local2[_local9]));
}
trace("OPENING " + _local6);
getURL (_local6, "_blank");
_local2.removeMovieClip();
} else {
var _local10 = new LoadVars();
_local10.remember_command_id = _local2.command_id;
_local10.onData = function (data) {
com.newgrounds.API.echo(("INPUT: \r" + data) + newline);
if (data) {
var _local2 = com.newgrounds.encoders.JSON.decode(data);
} else {
var _local2 = {success:false};
}
if (!_local2.success) {
if ((!_local2.error_code) && (!_local2.error_msg)) {
_local2.error_code = "CONNECTION_FAILED";
_local2.error_msg = "Could not contact the API Gateway";
_local2.command_id = this.remember_command_id;
}
var _local4 = new com.newgrounds.APIError(_local2.error_code, _local2.error_msg);
com.newgrounds.API.sendError(_local2, _local4);
} else {
com.newgrounds.API.doEvent(_local2);
}
};
var _local7 = new Array();
for (var _local8 in _local2) {
_local7.push((_local8 + "=") + escape(_local2[_local8]));
}
echo((("POST " + GATEWAY_URL) + "?") + _local7.join("&"));
_local2.sendAndLoad((GATEWAY_URL + "?seed=") + Math.random(), _local10, "POST");
last_command = _local2.command_id;
}
}
static function renderAd(target) {
if (ad_swf_url) {
target.background = target.createEmptyMovieClip("background", 100);
target.background.beginFill(0);
target.background.moveTo(0, 0);
target.background.lineTo(300, 0);
target.background.lineTo(300, 250);
target.background.lineTo(0, 250);
target.background.lineTo(0, 0);
target.background.endFill();
target.mask = target.createEmptyMovieClip("mask", 101);
target.mask.beginFill(0);
target.mask.moveTo(0, 0);
target.mask.lineTo(300, 0);
target.mask.lineTo(300, 250);
target.mask.lineTo(0, 250);
target.mask.lineTo(0, 0);
target.mask.endFill();
target.clip = target.createEmptyMovieClip("clip", 102);
target.clip.ad = target.clip.createEmptyMovieClip("ad", 100);
target.clip.setMask(target.mask);
target.clip.ad._lockroot = true;
loadMovie (ad_swf_url, target.clip.ad);
callListener(com.newgrounds.APIEvent.AD_ATTACHED, true, {target:target});
} else {
callListener(com.newgrounds.APIEvent.AD_ATTACHED, false, new com.newgrounds.APIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad"));
}
}
static function attachFlashAd(target) {
if (checkAdFlood()) {
ad_swf_url = null;
} else if (checkAdCache()) {
reportNewAsset();
var _local1 = new LoadVars();
_local1.onData = function (data) {
if (data) {
com.newgrounds.API.ad_swf_url = data;
} else {
com.newgrounds.API.ad_swf_url = null;
}
com.newgrounds.API.reportAssetLoaded();
com.newgrounds.API.renderAd(target);
};
if (ad_url.indexOf("?") > -1) {
_local1.load((ad_url + "&random=") + Math.random());
} else {
_local1.load((ad_url + "?random=") + Math.random());
}
if (!ad_warning) {
ad_warning = true;
sendMessage("You may get a security sandbox violation from this ad. This is nothing to worry about!");
}
} else if (ad_swf_url) {
renderAd(target);
}
}
static function checkAdFlood() {
if (!ad_url) {
return(false);
}
var _local2 = new Date();
var _local1 = _local2.getTime();
if (_local1 >= ad_flood) {
if ((_local1 - ad_flood) > 1000) {
ad_flood = _local1 + 1000;
} else {
ad_flood = _local1;
sendWarning("This movie is attempting to load multiple ads at too high of a frequency; you may have a bad preloader loop.");
return(true);
}
}
return(false);
}
static function checkAdCache() {
if (!ad_url) {
return(false);
}
var _local2 = new Date();
var _local1 = _local2.getTime();
if (_local1 >= ad_url_cache) {
ad_url_cache = _local1 + 300000;
return(true);
}
return(false);
}
static function sendMessage(m, r) {
var _local1 = "[Newgrounds API] :: " + m;
if (r) {
return(_local1);
}
trace(_local1);
bridge.sendEvent("trace", {data:_local1});
}
static function echo(m) {
if (do_echo) {
trace(m);
}
}
static var LOGIN_URL = "http://ng-local.newgrounds.com/apilogin/";
static var do_echo = true;
static var GATEWAY_URL = "http://www.ngads.com/gateway_v2.php";
static var NEWGROUNDS_PREVIEW = "uploads.ungrounded.net/previews";
static var AD_TERMS_URL = "http://www.newgrounds.com/wiki/using-the-site/terms-of-use/flash-ads/";
static var COMMANDS_WIKI_URL = "http://www.newgrounds.com/wiki/developer-resources/flash-api/commands/";
static var LOCAL_HOST = "localhost";
static var NEWGROUNDS_WWW = "www.newgrounds.com";
static var PREVIEW_HOSTS = new Array(LOCAL_HOST, NEWGROUNDS_PREVIEW);
static var ad_url_cache = 0;
static var ad_flood = 0;
static var ad_warning = false;
static var save_file = null;
static var publisher_id = 1;
static var fake_session = false;
static var medals = null;
static var userpage_format = null;
static var scoreboards = new Array();
static var save_groups = null;
static var compression_radix = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
static var errors = com.newgrounds.APIError.init_codes();
static var sharedObjects = new Object();
static var bridge = new com.newgrounds.Bridge(_root.NewgroundsAPI_SandboxID);
static var preload = true;
static var preload_items = 0;
static var preload_items_loaded = 0;
}
Symbol 101 MovieClip [__Packages.com.newgrounds.Bridge] Frame 0
class com.newgrounds.Bridge
{
var widget_id, receiver, transmitter;
function Bridge (id) {
widget_id = id;
receiver = new LocalConnection();
transmitter = new LocalConnection();
receiver.receiveEvent = function (event, params) {
com.newgrounds.API.callListener(event, params.success, params.data);
};
try {
receiver.connect("rec_" + widget_id);
} catch(error:Error) {
}
}
function sendEvent(event, params) {
if (widget_id) {
transmitter.send(widget_id, "sendEvent", event, validateParams(params));
}
}
function sendCommand(command, params) {
if (widget_id) {
transmitter.send(widget_id, "sendCommand", command, validateParams(params));
}
}
function validateParams(params) {
var _local2 = {};
for (var _local3 in params) {
if ((typeof(params[_local3]) == "string") || (typeof(params[_local3]) == "number")) {
_local2[_local3] = params[_local3];
}
}
return(_local2);
}
}
Symbol 102 MovieClip [__Packages.com.newgrounds.SaveFile] Frame 0
class com.newgrounds.SaveFile
{
static var file_path, image_path;
var _group, _filename, _file_id, _contents, _thumbnail, _thumbnail_url, raw, img, _file_url, _description, scanner;
function SaveFile (_group) {
this._group = _group;
_filename = null;
_file_id = null;
_contents = null;
_thumbnail = null;
_thumbnail_url = null;
raw = null;
img = null;
_draft = false;
_keys = new Array();
_ratings = new Array();
_file_url = null;
com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.FILE_PRIVS_LOADED, checkPrivs, this);
}
static function setFilePath(path) {
file_path = path + "/";
}
static function setImagePath(path) {
image_path = path + "/";
}
function get name() {
return(_filename);
}
function set name(s) {
_filename = s;
//return(name);
}
function get id() {
return(_file_id);
}
function get description() {
return(_description);
}
function set description(s) {
_description = s;
//return(description);
}
function get contents() {
return(_contents);
}
function set contents(o) {
_contents = o;
//return(contents);
}
function get thumbnailUrl() {
return(image_path + _thumbnail_url);
}
function set thumbnailUrl(s) {
_thumbnail_url = s;
//return(thumbnailUrl);
}
function get fileUrl() {
return(file_path + _file_url);
}
function set fileUrl(s) {
_file_url = s;
//return(fileUrl);
}
function get authorID() {
return(_author_id);
}
function set authorID(i) {
_author_id = i;
//return(authorID);
}
function get authorName() {
return(_author_name);
}
function set authorName(n) {
_author_name = n;
//return(authorName);
}
function get views() {
return(_views);
}
function get draft() {
return(_draft);
}
function set draft(d) {
_draft = d;
//return(draft);
}
function get group() {
return(_group);
}
function get groupId() {
return(_group.getID());
}
function get groupName() {
return(_group.getName());
}
function get groupType() {
return(_group.getType());
}
function get locked() {
return(_locked);
}
function get shared() {
return(_isShared());
}
function get isPrivate() {
return(_isPrivate());
}
function get isPublic() {
return(_isPublic());
}
function get approved() {
return(_isApproved());
}
function get keys() {
return(_keys);
}
function get ratings() {
return(_ratings);
}
function loadAuthorPage() {
com.newgrounds.API.loadUserPage(_author_id, _author_name);
}
function getID() {
return(_file_id);
}
function exists() {
return(!(_file_id === null));
}
function getGroup() {
return(_group);
}
function getName() {
return(_filename);
}
function _isPrivate() {
return(status == STATUS.PRIVATE);
}
function _isShared() {
return(status > STATUS.PRIVATE);
}
function _isApproved() {
return(status > STATUS.UNAPPROVED);
}
function _isPublic() {
if (_isPrivate()) {
return(false);
}
if (_group.isType("SYSTEM") or _group.isType("PRIVATE")) {
return(false);
}
if (_group.isType("PUBLIC")) {
return(true);
}
if (_isApproved()) {
return(true);
}
return(false);
}
function isLocked() {
return(_locked);
}
function getDescription() {
return(_description);
}
function getShared() {
return(_draft);
}
function getThumbnailImageScan() {
return(img);
}
function getRawContents() {
return(raw);
}
function getDuplicateID() {
return(duplicate_id);
}
function getKeys() {
return(_keys);
}
function getKey(key) {
var _local3 = getGroup().getKey(key);
var _local2 = 0;
while (_local2 < _keys.length) {
if (_keys[_local2].id == _local3.key_id) {
return(_keys[_local2].value);
}
_local2++;
}
}
function getRating(rating) {
var _local2 = getGroup().getRating(rating);
if (_ratings[_local2.rating_id]) {
return(_ratings[_local2.rating_id]);
}
return(null);
}
function overwriteAllowed() {
return(overwrite);
}
function getFileURL() {
return(file_path + _file_url);
}
function getThumbnailURL() {
return(image_path + _thumbnail_url);
}
function overwriteExisting() {
overwrite = true;
}
function setID(id, add_to_group) {
_file_id = id;
if (add_to_group) {
getGroup().addFile(this);
}
}
function setName(filename, locked) {
_filename = filename;
_locked = locked;
}
function setDescription(description) {
_description = description;
}
function setDraft(draft) {
_draft = draft;
}
function setContents(_contents) {
this._contents = _contents;
}
function setThumbnail(thumb) {
if (thumb) {
_thumbnail = thumb;
} else {
_thumbnail = null;
}
}
function setThumbnailURL(url) {
_thumbnail_url = url;
}
function setFileURL(url) {
_file_url = url;
}
function setPermissions(status, _locked) {
this._locked = _locked;
this.status = status;
}
function setKey(key, val) {
var _local4 = getGroup().getKeyID(key);
var _local2;
if (!_local4) {
onError(((("'" + key) + "' is not a valid key for the '") + _group.__get__name()) + "' save group", "setKey", "INVALID_VALUE", true);
return(undefined);
}
if ((!_group.keyValueIsValid(key, val)) && (!(val === null))) {
onError((("'" + val) + "' is not a valid ") + _group.getKeyType(key, true), "setKey", "INVALID_VALUE", true);
return(undefined);
}
switch (_group.getKeyType(key, true)) {
case "string" :
if (val) {
val = String(val);
} else {
val = undefined;
}
break;
default :
val = Number(val);
}
var _local5 = {id:_local4, value:val};
for (var _local6 in _keys) {
_local2 = _keys[_local6];
if (_local2.id == _local4) {
_keys[_local6] = _local5;
return(undefined);
}
}
_keys.push(_local5);
}
function setRating(rating, votes, score) {
var _local2 = getGroup().getRating(rating);
if (!votes) {
votes = 0;
}
if (!score) {
score = 0;
}
if (!_local2.is_float) {
score = Math.round(Number(score));
}
_ratings[_local2.rating_id] = {id:Number(_local2.rating_id), name:_local2.rating_name, votes:Number(votes), score:Number(score)};
return(_ratings[_local2.rating_id]);
}
function clearBuffer() {
_contents = null;
raw = null;
img = null;
scanner = null;
overwrite = false;
duplicate_id = null;
}
function onError(msg, funct, code) {
busy = false;
if (!code) {
code = "SAVE_FILE_ERROR";
}
if (!funct) {
funct = "unknown_function";
}
var _local3 = ("getSaveGroup('" + _group.getName()) + "')";
if (exists()) {
funct = (((_local3 + ".getFile('") + getName()) + "').") + funct;
} else {
funct = (_local3 + ".getNewFile().") + funct;
}
var _local5 = new com.newgrounds.APIError(code, msg);
com.newgrounds.API.sendError({command_id:funct}, _local5);
}
function onSaved(p) {
busy = false;
if (!exists()) {
setID(p.save_id, true);
}
setName(p.filename);
setFileURL(p.file_url);
if (p.thumbnail) {
_thumbnail_url = p.thumbnail;
}
}
function onVoted(p) {
trace("ONVOTED WAS CALLED");
return(setRating(p.rating_id, p.votes, p.score));
}
function sendRating(rating, vote) {
var _local6 = null;
if (!com.newgrounds.API.hasUserSession()) {
_local6 = new com.newgrounds.APIError("PERMISSION_DENIED", "You must be logged in to vote on save files");
}
var _local2 = _group.getRating(rating);
if (!_local2) {
_local6 = new com.newgrounds.APIError("PERMISSION_DENIED", ((("'" + rating) + "' is not a valid rating for the '") + _group.getName()) + "' save group");
}
if (voted === true) {
_local6 = new com.newgrounds.APIError("PERMISSION_DENIED", "You have already voted on this item today");
}
if ((vote < _local2.min_value) or (vote > _local2.max_value)) {
_local6 = new com.newgrounds.APIError("PERMISSION_DENIED", (((("'" + rating) + "' votes must be between ") + _local2.min_value) + " and ") + _local2.max_value);
}
if (_local6) {
com.newgrounds.API.callListener(com.newgrounds.APIEvent.VOTE_COMPLETE, false, {error:_local6, file:this});
return(undefined);
}
voted = true;
com.newgrounds.API.rateSaveFile(this, _local2, vote);
}
function replace() {
if (busy) {
onError("Another file is currently being saved, please try again later", "replace");
return(undefined);
}
overwriteExisting();
save();
}
function save() {
if ((com.newgrounds.API.hasUserSession() && (!_author_id)) && (!_author_name)) {
_author_id = com.newgrounds.API.getUserID();
_author_name = com.newgrounds.API.getUserName();
}
if (busy) {
onError("Another file is currently being saved, please try again later", "save", "UPLOAD_IN_PROGRESS");
return(undefined);
}
busy = true;
if (isLocked()) {
onError("This file is _locked and cannot be overwritten.", "save", "PERMISSION_DENIED");
return(undefined);
}
if (!_filename) {
onError("Please provide a name for your file.", "save", "MISSING_PARAM");
return(undefined);
}
if (!_contents) {
onError("The file is empty.", "save", "MISSING_PARAM");
return(undefined);
}
img = null;
com.newgrounds.API.checkFilePrivs(this);
}
function checkPrivs(e) {
if (e.data.file.id != id) {
return(undefined);
}
if (e.success) {
if (e.data.can_write) {
can_write = e.data.can_write;
if (e.data.duplicate_id) {
duplicate_id = e.data.duplicate_id;
}
if (e.data.exists && (!overwriteAllowed())) {
onError(("You already have a file named '" + getName()) + "'", "save", "CONFIRM_REQUEST");
} else {
startFile();
}
} else {
onError("This file is _locked and cannot be overwritten", "save", "PERMISSION_DENIED");
}
} else {
onError("There was a problem looking up your file's details. The server may be down.", "save", "UNKNOWN_ERROR");
}
}
function startFile() {
if (can_write) {
if (_thumbnail) {
scanner = new com.newgrounds.encoders.ImageScanner(_thumbnail);
scanner.setCallback(this, "encodeFile");
scanner.startScan(100, 100, true);
} else {
encodeFile();
}
} else {
onError("You do not have permission to save this file.", "save", "PERMISSION_DENIED");
}
}
function encodeFile(img) {
this.img = img;
raw = com.newgrounds.encoders.SerialXML.encode(_contents).toString();
compressFile();
}
function compressFile() {
com.newgrounds.encoders.LZW2.compress(raw, function (s, p) {
p.file.onCompressed(s);
}, {file:this});
}
function onCompressed(compressed) {
raw = escape(compressed);
writeFile();
}
function getProgress() {
}
function writeFile() {
getGroup().getQuery().clearCache();
com.newgrounds.API.saveFile(this);
clearBuffer();
}
function loadContents() {
if (_contents) {
com.newgrounds.API.setCurrentSaveFile(this);
com.newgrounds.API.callListener(com.newgrounds.APIEvent.FILE_LOADED, true, {file:this});
return(undefined);
}
if (!getFileURL()) {
var _local4 = new com.newgrounds.APIError("FILE_NOT_FOUND", "Attempted to load contents of an unsaved file.");
com.newgrounds.API.callListener(com.newgrounds.APIEvent.FILE_LOADED, false, {file:this, error:_local4});
return(undefined);
}
var _local2 = new LoadVars();
_local2.target = this;
var target = this;
_local2.onData = function (encoded) {
target.onLoaded(encoded);
};
_local2.load(getFileURL());
}
function onLoaded(encoded) {
if (encoded == undefined) {
var _local3 = new com.newgrounds.APIError("FILE_NOT_FOUND", "We could not find the contents for this file. It may have been deleted.");
com.newgrounds.API.callListener(com.newgrounds.APIEvent.FILE_LOADED, false, {file:this, error:_local3});
return(undefined);
}
com.newgrounds.encoders.LZW.setXMLSafe(true);
_contents = com.newgrounds.encoders.SerialXML.decode(com.newgrounds.encoders.LZW.decompress(encoded));
com.newgrounds.API.callListener(com.newgrounds.APIEvent.FILE_LOADED, true, {file:this});
}
function setViews(n) {
_views = n;
}
static var busy = false;
var can_write = false;
var _draft = false;
var status = 0;
var voted = false;
var _views = 0;
var _locked = false;
var overwrite = false;
var duplicate_id = null;
var _keys = null;
var _ratings = null;
var _author_id = null;
var _author_name = null;
static var STATUS = {PRIVATE:1, PUBLIC:2, UNAPPROVED:3, APPROVED:4};
}
Symbol 103 MovieClip [__Packages.com.newgrounds.SaveGroup] Frame 0
class com.newgrounds.SaveGroup
{
var group_name, group_id, group_type, query, ratings, keys, files;
function SaveGroup (group_id, group_name, group_type) {
this.group_name = group_name;
this.group_id = group_id;
this.group_type = group_type;
query = new com.newgrounds.SaveGroupQuery(this);
ratings = new Array();
keys = new Array();
files = new Array();
}
function get id() {
return(group_id);
}
function get name() {
return(group_name);
}
function get type() {
return(group_type);
}
function addFile(file) {
var _local2 = 0;
while (_local2 < files.length) {
if (files[_local2].getID() == file.getID()) {
files[_local2] = file;
return(undefined);
}
_local2++;
}
files.push(file);
}
function getFile(file_id) {
trace("getting the file " + file_id);
var _local2 = 0;
while (_local2 < files.length) {
trace((((("Looking up " + file_id) + " :: ") + files[_local2].getID()) + " || ") + files[_local2].getName());
if (isNumeric(file_id) and (files[_local2].getID() == Number(file_id))) {
return(files[_local2]);
}
if (files[_local2].getName() == file_id) {
return(files[_local2]);
}
_local2++;
}
return(null);
}
function addRating(rating_id, rating_name, min_value, max_value, is_float) {
var _local3 = {rating_id:rating_id, rating_name:rating_name, min_value:min_value, max_value:max_value, is_float:is_float};
if (!getRatingID(rating_name)) {
ratings.push(_local3);
}
}
function getRating(rating_id) {
var _local2 = 0;
while (_local2 < ratings.length) {
if (isNumeric(rating_id) and (ratings[_local2].rating_id == rating_id)) {
return(ratings[_local2]);
}
if (ratings[_local2].rating_name == rating_id) {
return(ratings[_local2]);
}
_local2++;
}
return(null);
}
function getRatingID(rating_id) {
var _local2 = getRating(rating_id);
if (_local2) {
return(_local2.rating_id);
}
return(null);
}
function getRatingName(rating_id) {
var _local2 = getRating(rating_id);
if (_local2) {
return(_local2.rating_name);
}
return(null);
}
function addKey(key_id, key_name, key_type) {
trace(((((">>>>>>>>>>> ADDING KEY " + key_id) + " ") + key_name) + " ") + key_type);
var _local2 = {key_id:key_id, key_name:key_name, key_type:key_type};
if (!getKey(key_name)) {
keys.push(_local2);
}
}
function getKey(key_id) {
var _local2 = 0;
while (_local2 < keys.length) {
if (isNumeric(key_id) and (keys[_local2].key_id == key_id)) {
return(keys[_local2]);
}
if (keys[_local2].key_name == key_id) {
return(keys[_local2]);
}
_local2++;
}
return(null);
}
function getKeyType(key_name, as_string) {
var _local2 = getKey(key_name);
if (_local2) {
return((as_string ? (KEY_TYPES[_local2.key_type]) : (_local2.key_type)));
}
return(null);
}
function getKeyID(key_id) {
var _local2 = getKey(key_id);
if (_local2) {
return(_local2.key_id);
}
return(null);
}
function getKeyName(key_id) {
var _local2 = getKey(key_id);
if (_local2) {
return(_local2.key_name);
}
return(null);
}
function keyValueIsValid(key, value) {
var _local4;
var _local7;
if ((typeof(value) == "number") or (Number(value).toString() == String(value))) {
value = Number(value);
_local4 = ((Math.round(value) === value) ? "integer" : "float");
} else {
_local4 = typeof(value);
if (_local4 == "string") {
var _local6 = "01234567890.-";
var _local5 = true;
var _local2 = 0;
while (_local2 < value.length) {
if (_local6.indexOf(value.charAt(_local2)) < 0) {
_local5 = false;
break;
}
_local2++;
}
if (_local5) {
value = Number(value);
_local4 = "float";
}
}
}
switch (getKeyType(key, true)) {
case "integer" :
_local7 = (_local4 == "integer") or (_local4 == "boolean");
break;
case "float" :
_local7 = ((_local4 == "float") or (_local4 == "integer")) or (_local4 == "boolean");
break;
case "string" :
_local7 = (((_local4 == "string") or (_local4 == "float")) or (_local4 == "integer")) or (_local4 == "boolean");
break;
case "boolean" :
_local7 = (((_local4 == "boolean") or (value == 1)) or (value == 0)) or (value == "");
break;
default :
_local7 = false;
}
return(_local7);
}
function isType(type) {
return(group_type == TYPES[type.toUpperCase()]);
}
function getID() {
return(group_id);
}
function getName() {
return(group_name);
}
function getType() {
return(group_type);
}
function isSystem() {
return(undefined);
}
function getQuery(as_object) {
if (as_object) {
return(query.toObject());
}
return(query);
}
function newQuery() {
query.reset();
return(query);
}
function clearQuery() {
query.reset();
}
function newFile() {
var _local2 = new com.newgrounds.SaveFile(this);
return(_local2);
}
static function isNumeric(value) {
return((typeof(value) == "number") or (Number(value).toString() == String(value)));
}
static var KEY_TYPES = [null, "float", "integer", "string", "boolean"];
static var TYPES = {SYSTEM:0, PRIVATE:1, PUBLIC:2, MODERATED:3};
}
Symbol 104 MovieClip [__Packages.com.newgrounds.ValidationTools] Frame 0
class com.newgrounds.ValidationTools
{
function ValidationTools () {
}
static function isNumber(v) {
if (typeof(v) == "number") {
return(true);
}
if ((typeof(v) == "string") and (Number(v).toString() == v)) {
return(true);
}
return(false);
}
static function isInteger(v) {
if (isNumber(v)) {
v = Number(v);
return(Math.floor(v) == v);
}
return(false);
}
static function isFloat(v) {
return(isNumber(v));
}
static function isString(v) {
if ((typeof(v) == "string") or (typeof(v) == "number")) {
return(true);
}
return(false);
}
static function isEmpty(o) {
for (var _local2 in o) {
return(false);
}
return(true);
}
}
Symbol 105 MovieClip [__Packages.com.newgrounds.APIEvent] Frame 0
class com.newgrounds.APIEvent
{
var _type, _success, _error, data;
function APIEvent (type, success, data) {
_type = type;
_success = success;
if (data.isError()) {
_error = data;
this.data = null;
} else if (data.error && (data.error.isError())) {
_error = data.error;
this.data = data;
} else {
this.data = data;
_error = null;
}
}
function get error() {
return(_error);
}
function get type() {
return(_type);
}
function get success() {
return(_success);
}
static var API_CONNECTED = "apiConnected";
static var ADS_APPROVED = "adsApproved";
static var AD_ATTACHED = "adAttached";
static var HOST_BLOCKED = "hostBlocked";
static var NEW_VERSION_AVAILABLE = "newVersionAvailable";
static var EVENT_LOGGED = "eventLogged";
static var SCORE_POSTED = "scorePosted";
static var SCORES_LOADED = "scoresLoaded";
static var UNLOCK_MEDAL = "unlockMedal";
static var MEDAL_UNLOCKED = "medalUnlocked";
static var MEDALS_LOADED = "medalsLoaded";
static var METADATA_LOADED = "metadataLoaded";
static var FILE_PRIVS_LOADED = "filePrivsLoaded";
static var FILE_SAVED = "fileSaved";
static var FILE_LOADED = "fileLoaded";
static var FILE_INITIALIZED = "fileInitialized";
static var FILE_REQUESTED = "fileRequested";
static var QUERY_COMPLETE = "queryComplete";
static var VOTE_COMPLETE = "voteComplete";
static var API_ERROR = "apiError";
static var UNCAUGHT_EVENT = "uncaughtEvent";
}
Symbol 106 MovieClip [__Packages.com.newgrounds.SaveGroupQuery] Frame 0
class com.newgrounds.SaveGroupQuery
{
var _group, _num_results, _pages, _page, _randomize_results, file_conditions, key_conditions, rating_conditions, sort_conditions, lookup_keys, lookup_ratings, _group_by;
function SaveGroupQuery (_group) {
this._group = _group;
reset();
}
function get group() {
return(_group);
}
function get groupId() {
return(_group.getID());
}
function get resultsPerPage() {
return(_num_results);
}
function set resultsPerPage(n) {
_num_results = n;
//return(resultsPerPage);
}
function get pages() {
return(_pages);
}
function get page() {
return(_page);
}
function set page(n) {
_page = n;
//return(page);
}
function get randomize() {
return(_randomize_results);
}
function set randomize(b) {
_randomize_results = b;
//return(randomize);
}
function get results() {
return(_results);
}
function clearCache() {
_results = [];
}
function reset() {
file_conditions = new Array();
key_conditions = new Array();
rating_conditions = new Array();
sort_conditions = new Array();
lookup_keys = new Object();
lookup_ratings = new Object();
_num_results = 20;
_page = 1;
_randomize_results = false;
_group_by = new Array();
clearCache();
}
function getGroup() {
return(_group);
}
function getGroupID() {
return(_group.getID());
}
function isRandomized() {
return(_randomize_results);
}
function toObject() {
var _local2;
var _local11 = {page:_page, num_results:_num_results};
if (_randomize_results) {
_local11.randomize = 1;
}
if (!com.newgrounds.ValidationTools.isEmpty(file_conditions)) {
var _local12 = [];
_local2 = 0;
while (_local2 < file_conditions.length) {
var _local6 = file_conditions[_local2];
_local12.push({field:file_fields[_local6.field.toUpperCase()].id, operator:_local6.operator, value:_local6.value});
_local2++;
}
_local11.file_conditions = _local12;
}
if (!com.newgrounds.ValidationTools.isEmpty(key_conditions)) {
_local11.key_conditions = key_conditions;
}
if (!com.newgrounds.ValidationTools.isEmpty(rating_conditions)) {
_local11.rating_conditions = rating_conditions;
}
if (!com.newgrounds.ValidationTools.isEmpty(sort_conditions)) {
var _local14 = [];
_local2 = 0;
while (_local2 < sort_conditions.length) {
var _local3 = sort_conditions[_local2];
if (_local3.table == TABLE_FILES) {
var _local8 = file_fields[_local3.field.toUpperCase()].id;
} else {
var _local8 = _local3.field;
}
var _local5 = {field:_local8, table:_local3.table};
if (_local3.desc) {
_local5.desc = 1;
}
if (_local3.extra) {
_local5.extra = _local3.extra;
}
_local14.push(_local5);
_local2++;
}
_local11.sort_conditions = _local14;
}
if (!com.newgrounds.ValidationTools.isEmpty(lookup_keys)) {
var _local15 = [];
for (_local2 in lookup_keys) {
_local15.push(_local2);
}
_local11.lookup_keys = _local15;
}
if (!com.newgrounds.ValidationTools.isEmpty(lookup_ratings)) {
var _local13 = [];
for (_local2 in lookup_ratings) {
_local13.push(_local2);
}
_local11.lookup_ratings = _local13;
}
if (!com.newgrounds.ValidationTools.isEmpty(_group_by)) {
var _local16 = [];
_local2 = 0;
while (_local2 < _group_by.length) {
var _local4 = _group_by[_local2];
if (_local4.table == TABLE_FILES) {
var _local8 = file_fields[_local4.field.toUpperCase()].id;
} else {
var _local8 = _local4.field;
}
_local16.push({field:_local8, table:_local4.table});
_local2++;
}
_local11.group_by = _local16;
}
return(_local11);
}
function toString() {
var _local9;
var _local2;
var _local11 = [];
_local9 = "Lookup:\r";
var _local14 = [];
for (var _local6 in file_fields) {
_local14.push(" " + _local6);
_local2 = true;
}
_local9 = _local9 + _local14.join(newline);
_local11.push(_local9);
_local9 = "";
_local2 = false;
var _local16 = [];
for (var _local6 in lookup_keys) {
_local16.push((" KEY '" + _group.getKeyName(_local6)) + "'");
_local2 = true;
}
if (_local2) {
_local9 = _local9 + _local16.join(newline);
_local11.push(_local9);
}
_local9 = "";
_local2 = false;
var _local15 = [];
for (var _local6 in lookup_ratings) {
_local15.push((" RATING '" + _group.getRatingName(_local6)) + "'");
_local2 = true;
}
if (_local2) {
_local9 = _local9 + _local15.join(newline);
_local11.push(_local9);
}
_local9 = "Where:\r";
_local2 = false;
var _local8 = [];
var _local6 = 0;
while (_local6 < file_conditions.length) {
var _local7 = file_conditions[_local6];
var _local10 = ((((" " + _local7.field) + " ") + _local7.operator) + " ") + _local7.value;
_local8.push(_local10);
_local2 = true;
_local6++;
}
_local6 = 0;
while (_local6 < key_conditions.length) {
var _local7 = key_conditions[_local6];
var _local10 = ((((" KEY '" + _group.getKeyName(_local7.key_id)) + "' ") + _local7.operator) + " ") + _local7.value;
_local8.push(_local10);
_local2 = true;
_local6++;
}
_local6 = 0;
while (_local6 < rating_conditions.length) {
var _local7 = rating_conditions[_local6];
var _local10 = ((((" RATING '" + _group.getRatingName(_local7.rating_id)) + "' ") + _local7.operator) + " ") + _local7.value;
_local8.push(_local10);
_local2 = true;
_local6++;
}
if (_local2) {
_local9 = _local9 + _local8.join(newline);
_local11.push(_local9);
}
_local9 = "Group By:\r";
_local2 = false;
var _local13 = [];
_local6 = 0;
while (_local6 < _group_by.length) {
var _local4 = _group_by[_local6];
var _local5;
if (_local4.table == TABLE_KEYS) {
_local5 = (" KEY '" + _group.getKeyName(_local4.field)) + "'";
} else if (_local4.table == TABLE_RATINGS) {
_local5 = (" RATING '" + _group.getRatingName(_local4.field)) + "'";
} else {
_local5 = " " + _local4.field;
}
_local13.push(_local5);
_local2 = true;
_local6++;
}
if (_local2) {
_local9 = _local9 + _local13.join(newline);
_local11.push(_local9);
}
_local9 = "Order By:\r";
_local2 = false;
var _local12 = [];
if (isRandomized()) {
_local12.push(" RANDOM");
_local2 = true;
}
_local6 = 0;
while (_local6 < sort_conditions.length) {
var _local3 = sort_conditions[_local6];
if (_local3.table == TABLE_KEYS) {
var _local5 = (" KEY '" + _group.getKeyName(_local3.field)) + "'";
} else if (_local3.table == TABLE_RATINGS) {
var _local5 = ((" RATING '" + _group.getRatingName(_local3.field)) + "' ") + ((_local3.extra == "votes") ? "VOTES" : "SCORE");
} else {
var _local5 = " " + _local3.field;
}
var _local5 = _local5 + (_local3.desc ? " (DESCENDING)" : "");
_local12.push(_local5);
_local2 = true;
_local6++;
}
if (_local2) {
_local9 = _local9 + _local12.join(newline);
_local11.push(_local9);
}
_local11.push("Page:\r " + _page);
_local11.push("Results Per Page:\r " + _num_results);
return(_local11.join(newline));
}
function setResultsPerPage(r) {
_num_results = r;
clearCache();
}
function setPage(p) {
_page = p;
clearCache();
}
function setRandomize(bool) {
_randomize_results = ((bool === false) ? false : true);
}
function includeKey(key) {
if (!_group.getKeyID(key)) {
trace(((("[SaveGroupQuery Error] :: '" + key) + "' is not a valid key for the '") + _group.__get__name()) + "' group.");
return(undefined);
}
lookup_keys[_group.getKeyID(key)] = 1;
clearCache();
}
function includeRating(rating) {
if (!_group.getRatingID(rating)) {
trace(((("[SaveGroupQuery Error] :: '" + rating) + "' is not a valid rating for the '") + _group.__get__name()) + "' group.");
return(undefined);
}
lookup_ratings[_group.getRatingID(rating)] = 1;
clearCache();
}
function groupBy(field) {
addGroupItem(TABLE_FILES, field);
}
function groupByKey(key) {
if (!_group.getKeyID(key)) {
error(((("'" + key) + "' is not a valid key for the '") + _group.getName()) + "' _group");
return(undefined);
}
addGroupItem(TABLE_KEYS, _group.getKeyID(key));
}
function groupByRating(rating) {
if (!_group.getRatingID(rating)) {
error(((("'" + rating) + "' is not a valid rating for the '") + _group.getName()) + "' _group");
return(undefined);
}
addGroupItem(TABLE_RATINGS, _group.getRatingID(rating));
}
function addGroupItem(table, field) {
_group_by.push({table:table, field:field});
clearCache();
}
function excludeKey(key) {
delete lookup_keys[_group.getKeyID(key)];
clearCache();
}
function excludeRating(rating) {
delete lookup_ratings[_group.getRatingID(rating)];
clearCache();
}
function addCondition(field, operator, value) {
if (((field == "FILE_STATUS") && (typeof(value) == "string")) && (!(com.newgrounds.SaveFile.STATUS[value.toUpperCase()] === undefined))) {
value = com.newgrounds.SaveFile.STATUS[value.toUpperCase()];
}
if (operator == "==") {
operator = "=";
}
if ((!validateOperator(operator)) or (!validateValue(field, value))) {
return(undefined);
}
file_conditions.push({field:field, operator:operator, value:value});
clearCache();
}
function addKeyCondition(key, operator, value) {
if (!_group.getKeyID(key)) {
error(((("'" + key) + "' is not a valid key for the '") + _group.getName()) + "' save _group");
} else if ((!validateOperator(operator)) or (!validateKeyValue(key, value))) {
return(undefined);
}
key_conditions.push({key_id:_group.getKeyID(key), operator:operator, value:value});
clearCache();
}
function addRatingCondition(rating, operator, value, column) {
if (!column) {
column = "SCORE";
}
if (!_group.getRatingID(rating)) {
error(((("'" + rating) + "' is not a valid rating for the '") + _group.getName()) + "' save _group");
} else {
if (!validateOperator(operator)) {
return(undefined);
}
if (!com.newgrounds.ValidationTools.isNumber(value)) {
error(("Expected numeric value for rating '" + rating) + "'");
return(undefined);
}
}
if (!rating_columns[column]) {
var _local2 = [];
for (var _local3 in rating_columns) {
_local2.push(_local3);
}
error((("Invalid rating column '" + column) + "'. Valid columns are ") + _local2.join(", "));
return(undefined);
}
rating_conditions.push({rating_id:_group.getRatingID(rating), operator:operator, value:value, column:rating_columns[column]});
clearCache();
}
function sortOn(field, order) {
if (!file_fields[field]) {
var _local2 = [];
for (var _local3 in file_fields) {
_local2.push(_local3);
}
error((("'" + field) + "' is not a valid sort field. Valid fields are: ") + _local2.join(", "));
return(undefined);
}
addSortCondition(TABLE_FILES, field, order);
}
function sortOnKey(key, order) {
if (!_group.getKeyID(key)) {
error(((("'" + key) + "' is not a valid key for the '") + _group.getName()) + "' _group");
return(undefined);
}
addSortCondition(TABLE_KEYS, _group.getKeyID(key), order);
}
function sortOnRating(rating, order, column) {
if (!_group.getRatingID(rating)) {
error(((("'" + rating) + "' is not a valid rating for the '") + _group.getName()) + "' _group");
return(undefined);
}
if (!column) {
column = "score";
}
addSortCondition(TABLE_RATINGS, _group.getRatingID(rating), order, column);
}
function sortOnRatingScore(rating, order) {
sortOnRating(rating, order, "score");
}
function sortOnRatingVotes(rating, order) {
sortOnRating(rating, order, "votes");
}
function addSortCondition(table, field, order, extra) {
var _local7;
if (((!order) or (order == "")) or (order.toUpperCase() == "ASC")) {
_local7 = false;
} else if (order.toUpperCase() == "DESC") {
_local7 = true;
} else {
error(("'" + order) + "' is not a valid sort order!");
return(undefined);
}
var _local3 = {table:table, field:field, desc:_local7};
if (extra) {
_local3.extra = extra;
}
sort_conditions.push(_local3);
clearCache();
}
function onExecuted(results) {
_results = [];
var _local6 = 0;
while (_local6 < results.length) {
var _local2 = results[_local6];
var _local3 = new com.newgrounds.SaveFile(_group);
_local3.setName(_local2.filename);
_local3.setID(_local2.save_id);
_local3.setDescription(_local2.description);
_local3.setThumbnailURL(_local2.thumb);
_local3.setFileURL(_local2.file);
if (_local2.views) {
_local3.setViews(_local2.views);
}
_local3.setPermissions(_local2.status, _local2.locked);
_local3.authorName = _local2.user_name;
_local3.authorID = _local2.user_id;
var _local5 = 0;
while (_local5 < _local2.keys.length) {
_local3.setKey(_local2.keys[_local5].id, _local2.keys[_local5].value);
_local5++;
}
var _local4 = 0;
while (_local4 < _local2.ratings.length) {
_local3.setRating(_local2.ratings[_local4].id, _local2.ratings[_local4].votes, _local2.ratings[_local4].score);
_local4++;
}
getGroup().addFile(_local3);
_results.push(_local3);
_local6++;
}
callEventDispatcher();
}
function hasResults() {
return(_results && (_results.length > 0));
}
function callEventDispatcher() {
com.newgrounds.API.callListener(com.newgrounds.APIEvent.QUERY_COMPLETE, true, {query:this});
}
function execute() {
if (hasResults() && (!isRandomized())) {
callEventDispatcher();
return(undefined);
}
_group.query = this;
com.newgrounds.API.lookupSaveFiles(_group);
}
function processResults(files) {
return(null);
}
function validateKeyValue(key, value) {
var _local3 = _group.getKeyType(key);
if (_local3) {
var _local2 = com.newgrounds.SaveGroup.KEY_TYPES[_local3];
if ((_local2 == "float") and com.newgrounds.ValidationTools.isFloat(value)) {
return(true);
}
if ((_local2 == "integer") and com.newgrounds.ValidationTools.isInteger(value)) {
return(true);
}
if ((_local2 == "string") and com.newgrounds.ValidationTools.isString(value)) {
return(true);
}
error(((("Expected type " + _local2) + " for key '") + key) + "'");
}
return(false);
}
function validateValue(field, value) {
if (file_fields[field]) {
if ((file_fields[field].type == "integer") and com.newgrounds.ValidationTools.isInteger(value)) {
return(true);
}
if ((file_fields[field].type == "float") and com.newgrounds.ValidationTools.isFloat(value)) {
return(true);
}
if ((file_fields[field].type == "string") and com.newgrounds.ValidationTools.isString(value)) {
return(true);
}
error(((("Expecting " + file_fields[field].type) + " value on '") + field) + "' condition");
} else {
var _local2 = [];
for (var _local4 in file_fields) {
_local2.push(_local4);
}
error((("'" + field) + "' is not a searchable field. Valid fields are: ") + _local2.join(", "));
}
return(false);
}
function validateOperator(operator) {
var _local2 = 0;
while (_local2 < valid_operators.length) {
if (operator == valid_operators[_local2]) {
return(true);
}
_local2++;
}
error((("'" + operator) + "' is not a valid lookup operation. Valid operations are: ") + valid_operators.join(", "));
return(false);
}
function error(msg) {
trace("[QUERY ERROR] :: " + msg);
}
static var TABLE_FILES = 1;
static var TABLE_KEYS = 2;
static var TABLE_RATINGS = 3;
var _results = [];
static var file_fields = {FILE_ID:{id:0, field:"file_id", type:"integer"}, AUTHOR_ID:{id:1, field:"user_id", type:"integer"}, AUTHOR_NAME:{id:2, field:"user_name", type:"string"}, FILE_NAME:{id:3, field:"file_name", type:"string"}, CREATED_ON:{id:4, field:"created", type:"string"}, UPDATED_ON:{id:5, field:"last_update", type:"string"}, TOTAL_VIEWS:{id:6, field:"views", type:"integer"}, FILE_STATUS:{id:7, field:"status", type:"integer"}};
static var rating_columns = {TOTAL_VOTES:"votes", SCORE:"score"};
static var valid_operators = ["=", "<", ">", "!=", "<>", "<=", ">=", "*", "!*", "!*=", "!=*", "*=", "=*"];
}
Symbol 107 MovieClip [__Packages.com.newgrounds.encoders.BaseN] Frame 0
class com.newgrounds.encoders.BaseN
{
var ceiling, hashIndex, bitSize, hashVal, i;
function BaseN (hash) {
ceiling = 100000000000000;
if (hash) {
hashIndex = hash;
} else {
hashIndex = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
}
bitSize = hashIndex.length;
hashVal = new Object();
i = 0;
while (i < bitSize) {
hashVal[hashIndex.charAt(i)] = i;
i++;
}
}
function verify(s) {
if (hashVal[s] != undefined) {
return(true);
}
return(false);
}
function encode(n, minchars) {
debug.lastencode = "";
if (typeof(i) != "string") {
n = n.toString();
}
if (n.charAt(0) == "-") {
var _local3 = "-";
n = n.substring(1);
} else {
var _local3 = "";
}
if (String(n).indexOf(".") > -1) {
var _local4 = String(n).split(".", 2);
return(((_local3 + baseNEncoder(_local4[0], minchars)) + ".") + baseNEncoder(_local4[1]));
}
debug.lastencode = debug.lastencode + "\tNo decimal\r";
return(_local3 + baseNEncoder(n, minchars));
}
function decode(s) {
var _local4 = 1;
if (s.charAt(0) == "-") {
_local4 = -1;
s = s.substring(1, s.length);
}
var _local3 = s.indexOf(".");
if (_local3 > -1) {
var _local5 = Math.pow(10, baseNDecoder(s.substring(_local3 + 1, s.length)));
return((baseNDecoder(s.substring(0, _local3)) / _local5) * _local4);
}
return(baseNDecoder(s) * _local4);
}
function baseNEncoder(n, minchars) {
if (!minchars) {
minchars = 1;
}
var _local4 = "";
while (n != 0) {
n = Math.round(n);
var _local3 = n % bitSize;
if (Math.round(_local3) != _local3) {
trace((((((((("BaseN failed on " + n) + "%") + bitSize) + " = ") + _local3) + " ") + int(n)) + " ") + int(bitSize));
}
_local4 = hashIndex.charAt(_local3) + _local4;
debug.lastencode = debug.lastencode + (((((((("\t-> n:" + n) + " % bitSize:") + bitSize) + " = ") + _local3) + ", final char=") + _local4) + newline);
n = n - _local3;
n = n / bitSize;
}
if (minchars) {
while (_local4.length < minchars) {
_local4 = hashIndex.charAt(0) + _local4;
}
}
return(_local4);
}
function baseNDecoder(s) {
var _local2 = 0;
var _local6 = 0;
i = 0;
while (i < s.length) {
var _local3 = s.charAt((s.length - i) - 1);
if (_local3 == hashIndex.charAt(0)) {
var _local5 = 0;
} else {
var _local5 = hashVal[_local3] * Math.pow(bitSize, i);
}
_local2 = _local2 + _local5;
if (_local2 >= ceiling) {
_local6 = _local6 + ((_local2 - (_local2 % ceiling)) / ceiling);
_local2 = _local2 % ceiling;
}
i++;
}
if (_local6 > 0) {
_local2 = "" + _local2;
while (_local2.length < (ceiling.toString().length - 1)) {
_local2 = "0" + _local2;
}
_local2 = ("" + _local6) + _local2;
}
return(_local2);
}
var debug = new Object();
}
Symbol 108 MovieClip [__Packages.com.newgrounds.encoders.ImageScanner] Frame 0
class com.newgrounds.encoders.ImageScanner
{
var image_source, source_width, source_height, sourceBitmap, callback_target, callback_function, hash, cube, basen, xpos, ypos, pixels, busy, canvas_width, canvas_height, resizedBitmap, copyBitmap, output, draw_interval, callback_interval;
function ImageScanner (the_source) {
if (the_source) {
image_source = the_source;
} else {
image_source = _root;
}
reset();
if (typeof(image_source) == "movieclip") {
if (image_source == _root) {
source_width = Stage.width;
source_height = Stage.height;
} else {
source_width = Math.floor(image_source._width);
source_height = Math.floor(image_source._height);
}
sourceBitmap = new flash.display.BitmapData(source_width, source_height, false, 4294967295);
sourceBitmap.draw(_root);
} else if (image_source.width) {
source_width = image_source.width;
source_height = image_source.height;
sourceBitmap = image_source;
} else {
error("You can only use BitMaptData and MovieClip objects to create images");
}
}
function setCallback(target, funct) {
if (target && (funct)) {
callback_target = target;
callback_function = funct;
}
}
function reset() {
callback_target = null;
callback_function = null;
debug.bad_pixels = 0;
hash = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ<>?:;-_=+()!&";
var _local3 = Math.pow(hash.length, 2);
trace("MAX COLORS: " + _local3);
var _local2 = Math.floor(Math.pow(_local3, 0.333333333333333)) - 1;
var _local4 = Math.pow(_local2, 3);
cube = _local2;
basen = new com.newgrounds.encoders.BaseN(hash);
xpos = 0;
ypos = 0;
pixels = 0;
busy = false;
}
function startScan(w, h, s) {
if (w) {
image_width = w;
}
if (h) {
image_height = h;
}
if (s != undefined) {
crop = s;
}
var _local7 = _root.getNextHighestDepth();
var _local6 = _root.createEmptyMovieClip("API_image_container_" + _local7, _local7);
var _local5 = _local6.createEmptyMovieClip("canvas", 100);
_local5.attachBitmap(sourceBitmap, 100);
if (crop) {
if ((image_width / source_width) > (image_height / source_height)) {
canvas_width = image_width;
canvas_height = Math.ceil(source_height * (image_width / source_width));
} else {
canvas_height = image_height;
canvas_width = Math.ceil(source_width * (image_height / source_height));
}
} else {
canvas_width = image_width;
canvas_height = image_height;
}
_local5._x = Math.round((image_width - canvas_width) / 2);
_local5._width = canvas_width;
_local5._height = canvas_height;
resizedBitmap = new flash.display.BitmapData(image_width, image_height, false, 4294967295);
resizedBitmap.draw(_local6);
_local6.removeMovieClip();
copyBitmap = new flash.display.BitmapData(image_width, image_height, false, 4294967295);
var _local3 = "" + image_width;
while (_local3.length < 3) {
_local3 = "0" + _local3;
}
var _local4 = "" + image_height;
while (_local4.length < 3) {
_local4 = "0" + _local4;
}
output = _local3 + _local4;
draw_interval = setInterval(this, "drawChunk", 10);
busy = false;
return(resizedBitmap);
}
function getBitmapData() {
return(copyBitmap);
}
function getBytesTotal() {
return((image_width * image_height) * 2);
}
function getBytesScanned() {
return(pixels * 2);
}
function getProgress() {
return(Math.round((getBytesScanned() / getBytesTotal()) * 100));
}
function drawChunk() {
if (!busy) {
busy = true;
var _local2 = 0;
while (_local2 < pixels_per_chunk) {
if (!nextPixel()) {
clearInterval(draw_interval);
callback_interval = setInterval(this, "doCallback", 25);
busy = true;
break;
}
_local2++;
}
busy = false;
}
}
function doCallback() {
busy = false;
clearInterval(callback_interval);
if (callback_target and callback_function) {
callback_target[callback_function](output);
} else {
onScanComplete(output);
}
}
function onScanComplete(packet) {
sendMessage(("packet size: " + output.length) + " bytes", "onScanComplete");
}
function nextPixel() {
var _local15 = xpos;
var _local14 = ypos;
var _local7 = resizedBitmap.getPixel(_local15, _local14);
var _local17 = (_local7 >> 16) & 255;
var _local20 = (_local7 >> 8) & 255;
var _local16 = (_local7 >> 0) & 255;
var _local11 = Math.round(((_local17 + 1) / 256) * cube);
var _local10 = Math.round(((_local20 + 1) / 256) * cube);
var _local13 = Math.round(((_local16 + 1) / 256) * cube);
var _local12 = (((_local11 * (cube + 1)) * (cube + 1)) + (_local10 * (cube + 1))) + _local13;
var _local6 = basen.encode(_local12, 2);
output = output + _local6;
if (_local6.length != 2) {
trace("bad pixel " + _local6);
}
var _local5 = basen.decode(_local6);
var _local18 = _local5;
var _local8 = _local5 % (cube + 1);
_local5 = (_local5 - _local8) / (cube + 1);
var _local9 = _local5 % (cube + 1);
var _local19 = (_local5 - _local9) / (cube + 1);
if (((_local13 != _local8) and (_local10 != _local9)) and (_local11 != _local10)) {
debug.bad_pixels++;
trace((((((("BAD PIXEL " + debug.bad_pixels) + ") ") + _local12) + " != ") + _local18) + " ") + _local6);
trace(basen.debug.lastencode);
}
var _local2 = Math.round((_local19 / cube) * 255).toString(16);
var _local4 = Math.round((_local9 / cube) * 255).toString(16);
var _local3 = Math.round((_local8 / cube) * 255).toString(16);
while (_local2.length < 2) {
_local2 = "0" + _local2;
}
while (_local4.length < 2) {
_local4 = "0" + _local4;
}
while (_local3.length < 2) {
_local3 = "0" + _local3;
}
copyBitmap.setPixel(_local15, _local14, Number((("0x" + _local2) + _local4) + _local3));
pixels++;
if (pixels >= (image_width * image_height)) {
return(false);
}
xpos++;
if (xpos >= image_width) {
xpos = 0;
ypos++;
}
return(true);
}
function error(e, f) {
sendMessage(e, f, "ERROR");
}
function sendMessage(msg, func, type) {
var _local1 = "ImageScanner";
if (func) {
_local1 = _local1 + (("." + func) + "()");
}
if (type) {
_local1 = (type + " in ") + _local1;
}
_local1 = _local1 + (" :: " + msg);
trace(_local1);
}
var image_width = 100;
var image_height = 100;
var crop = true;
var pixels_per_chunk = 500;
var debug = new Object();
}
Symbol 109 MovieClip [__Packages.com.newgrounds.encoders.SerialXML] Frame 0
class com.newgrounds.encoders.SerialXML
{
function SerialXML () {
}
static function decode(xml) {
if (!(xml instanceof XML)) {
xml = new XML(xml);
}
var _local2 = populateObject(xml.firstChild, {});
return(_local2.DATA);
}
static function encode(obj) {
var _local1 = new XML();
populateXML(_local1, obj, "DATA");
return(_local1);
}
static function populateObject(child, object) {
var _local6 = child.nodeName;
var _local5 = getValue(_local6, child.attributes.v);
var _local4 = child.attributes.n;
if (object instanceof Array) {
_local4 = object.length;
object.push(_local5);
} else {
object[_local4] = _local5;
}
if (child.hasChildNodes()) {
var _local1 = 0;
while (_local1 < child.childNodes.length) {
populateObject(child.childNodes[_local1], object[_local4]);
_local1++;
}
}
return(object);
}
static function populateXML(child, obj, name) {
if (obj === undefined) {
return(undefined);
}
var _local5 = new XML();
var _local2;
if (obj instanceof Array) {
_local2 = _local5.createElement(getType(obj));
if (name) {
_local2.attributes.n = name;
}
child.appendChild(_local2);
var _local4 = 0;
while (_local4 < obj.length) {
populateXML(_local2, obj[_local4]);
_local4++;
}
} else if (typeof(obj) == "object") {
_local2 = _local5.createElement(getType(obj));
if (name) {
_local2.attributes.n = name;
}
child.appendChild(_local2);
for (var _local4 in obj) {
populateXML(_local2, obj[_local4], _local4);
}
} else {
_local2 = _local5.createElement(getType(obj));
if (name) {
_local2.attributes.n = name;
}
if (getType(obj).length == 1) {
_local2.attributes.v = obj;
}
child.appendChild(_local2);
}
}
static function getValue(type, stringval) {
switch (type.toUpperCase()) {
case "O" :
return(new Object());
case "A" :
return(new Array());
case "N" :
return(Number(stringval));
case "S" :
return(String(stringval));
case "TRUE" :
return(true);
case "FALSE" :
return(false);
}
return(null);
}
static function getType(obj) {
switch (((obj instanceof Array) ? "array" : (typeof(obj)))) {
case "array" :
return("A");
case "object" :
return("O");
case "string" :
return("S");
case "number" :
return("N");
case "boolean" :
return(((obj === true) ? "TRUE" : "FALSE"));
}
return("NULL");
}
}
Symbol 110 MovieClip [__Packages.com.newgrounds.encoders.LZW2] Frame 0
class com.newgrounds.encoders.LZW2
{
static var comp_dict, pos, result, buffer, nbChar, splitStr, len, local, interval;
function LZW2 () {
}
static function doCompressorConfig() {
comp_dict = [];
var _local1 = 0;
while (_local1 < 256) {
comp_dict[String.fromCharCode(_local1)] = _local1;
_local1++;
}
comp_dict["<"] = 256;
comp_dict[">"] = 257;
comp_dict["&"] = 258;
comp_dict["\""] = 259;
comp_dict["'"] = 260;
pos = 0;
result = "";
buffer = "";
nbChar = 256 + skipnum;
}
static function compress(string, callback, callback_params) {
doCompressorConfig();
if (busy) {
trace("[LZW COMPRESSOR] :: Compression can not begin until previous compression or decompression is complete!");
return(undefined);
}
splitStr = string.split("");
string = "";
len = splitStr.length;
local = {delay:30, callback:callback, callback_params:callback_params, compress_chunk:function () {
com.newgrounds.encoders.LZW2.compress_chunk();
}, busy:false, complete:false};
interval = setInterval(local, "compress_chunk", 5);
}
static function getProgress() {
return(Math.round((pos / len) * 100));
}
static function compress_chunk() {
if (local.delay > 0) {
local.delay--;
} else if (!local.busy) {
local.busy = true;
var _local1 = 0;
while (_local1 < max_chunk_length) {
encode_next();
if (local.complete) {
break;
}
_local1++;
}
local.busy = false;
}
if (local.complete) {
trace((((((((("LZW2 complete " + nbChar) + " ") + comp_dict.length) + " ") + len) + " ") + pos) + " ") + skipnum);
clearInterval(interval);
local.callback(result, local.callback_params);
result = "";
buffer = "";
}
}
static function encode_next() {
if (pos <= len) {
var _local1 = splitStr[pos];
if (!(comp_dict[buffer + _local1] === undefined)) {
buffer = buffer + _local1;
} else {
result = result + String.fromCharCode(comp_dict[buffer]);
comp_dict[buffer + _local1] = nbChar;
nbChar++;
buffer = _local1;
}
pos++;
} else {
local.complete = true;
return(undefined);
}
}
static var comp_config = false;
static var skipnum = 5;
static var busy = false;
static var max_chunk_length = 12000;
}
Symbol 111 MovieClip [__Packages.com.newgrounds.encoders.LZW] Frame 0
class com.newgrounds.encoders.LZW
{
function LZW () {
}
static function setXMLSafe(x) {
xmlsafe = x;
}
static function compress(str, escape_chars) {
var _local2 = new Array();
var _local11 = (xmlsafe ? 5 : 0);
var _local5 = 0;
while (_local5 < 256) {
_local2[String.fromCharCode(_local5)] = _local5;
_local5++;
}
if (xmlsafe) {
_local2["<"] = 256;
_local2[">"] = 257;
_local2["&"] = 258;
_local2["\""] = 259;
_local2["'"] = 260;
}
var _local7 = "";
var _local8 = str.split("");
var _local9 = _local8.length;
var _local6 = 256 + _local11;
var _local1 = "";
var _local4;
_local5 = 0;
while (_local5 <= _local9) {
var _local3 = _local8[_local5];
if (!(_local2[_local1 + _local3] === undefined)) {
_local1 = _local1 + _local3;
} else {
_local4 = String.fromCharCode(_local2[_local1]);
if (escape_chars and (((_local2[_local1] < 33) or (_local2[_local1] > 126)) or (_local4 == "%"))) {
_local4 = escape(_local4);
}
_local7 = _local7 + _local4;
_local2[_local1 + _local3] = _local6;
_local6++;
_local1 = _local3;
}
_local5++;
}
return(_local7);
}
static function decompress(str) {
var _local4 = new Array();
var _local10 = (xmlsafe ? 5 : 0);
var _local6 = 0;
while (_local6 < 256) {
var _local9 = String.fromCharCode(_local6);
_local4[_local6] = _local9;
_local6++;
}
if (xmlsafe) {
_local4[256] = "<";
_local4[257] = ">";
_local4[258] = "&";
_local4[259] = "\"";
_local4[260] = "'";
}
var _local11 = str;
var _local13 = _local11.split("");
var _local12 = _local13.length;
var _local7 = 256 + _local10;
var _local1 = "";
var _local2 = "";
var _local8 = "";
_local6 = 0;
while (_local6 < _local12) {
var _local5 = _local11.charCodeAt(_local6);
var _local3 = _local4[_local5];
if (_local1 == "") {
_local1 = _local3;
_local8 = _local8 + _local3;
} else if (_local5 <= (255 + _local10)) {
_local8 = _local8 + _local3;
_local2 = _local1 + _local3;
_local4[_local7] = _local2;
_local7++;
_local1 = _local3;
} else {
_local2 = _local4[_local5];
if (_local2 == undefined) {
_local2 = _local1 + _local1.slice(0, 1);
}
_local8 = _local8 + _local2;
_local4[_local7] = _local1 + _local2.slice(0, 1);
_local7++;
_local1 = _local2;
}
_local6++;
}
return(_local8);
}
static function compress_fp6(str) {
var _local3 = new Array();
var _local10 = (xmlsafe ? 5 : 0);
var _local4 = 0;
while (_local4 < 256) {
_local3[String(_local4)] = _local4;
_local4++;
}
if (xmlsafe) {
var _local14 = String(new String("<").charCodeAt(0));
var _local11 = String(new String(">").charCodeAt(0));
var _local13 = String(new String("&").charCodeAt(0));
var _local15 = String(new String("\"").charCodeAt(0));
var _local12 = String(new String("'").charCodeAt(0));
_local3[_local14] = 256;
_local3[_local11] = 257;
_local3[_local13] = 258;
_local3[_local15] = 259;
_local3[_local12] = 260;
}
var _local7 = "";
var _local16 = str;
var _local8 = _local16.split("");
var _local9 = _local8.length;
var _local6 = 256 + _local10;
var _local1 = new Array();
_local4 = 0;
while (_local4 <= _local9) {
var _local2 = _local8[_local4];
if (_local1.length == 0) {
var _local5 = String(_local2.charCodeAt(0));
} else {
var _local5 = (_local1.join("-") + "-") + String(_local2.charCodeAt(0));
}
if (!(_local3[_local5] === undefined)) {
_local1.push(_local2.charCodeAt(0));
} else {
_local7 = _local7 + String.fromCharCode(_local3[_local1.join("-")]);
_local3[_local5] = _local6;
_local6++;
_local1 = new Array();
_local1.push(_local2.charCodeAt(0));
}
_local4++;
}
return(_local7);
}
static var xmlsafe = false;
}
Symbol 112 MovieClip [__Packages.com.newgrounds.RemoteAuth] Frame 0
class com.newgrounds.RemoteAuth
{
var auth_token, receiver;
function RemoteAuth (id) {
auth_token = id;
System.security.allowDomain("*");
receiver = new LocalConnection();
receiver.allowDomain = function () {
return(true);
};
receiver.onAuth = function (auth_result) {
trace("remote login is a success! " + auth_result);
com.newgrounds.API.onRemoteAuthentication(auth_result);
};
receiver.connect("_" + auth_token);
}
function get token() {
return(auth_token);
}
}
Symbol 113 MovieClip [__Packages.com.newgrounds.Medal] Frame 0
class com.newgrounds.Medal
{
var _medal_id, _medal_name, _medal_value, _medal_difficulty;
function Medal (id, name, value, difficulty, unlocked, _icon_url) {
if ((((id == undefined) || (name == undefined)) || (value == undefined)) || (difficulty == undefined)) {
com.newgrounds.API.fatalError("Medal instances require an id, name, value and difficulty");
}
_medal_id = id;
_medal_name = name;
_medal_value = value;
_medal_difficulty = difficulty;
if (unlocked) {
_medal_unlocked = true;
}
if (_icon_url) {
this._icon_url = _icon_url;
}
}
function get difficulty() {
return(difficulty_names[_medal_difficulty]);
}
function get difficultyId() {
return(_medal_difficulty);
}
function get icon_url() {
return(_icon_url);
}
function get id() {
return(_medal_id);
}
function get name() {
return(_medal_name);
}
function get unlocked() {
return(_medal_unlocked);
}
function get value() {
return(_medal_value);
}
function isUnlocked() {
return(_medal_unlocked);
}
function unlock() {
if (!isUnlocked()) {
com.newgrounds.API.unlockMedal(this);
}
}
function setUnlocked(u) {
_medal_unlocked = u;
}
function attachIcon(target, depth) {
if (!depth) {
depth = target.getNextHighestDepth();
}
var _local3 = target.createEmptyMovieClip("Asset_Medal_Icon_" + getID(), depth);
if (_icon_url) {
_local3.loadMovie(_icon_url);
} else {
var _local4 = flash.display.BitmapData.loadBitmap("Asset_default_medal_icon_" + getDifficulty(), depth);
_local3.attachBitmap(_local4, depth, true);
}
}
function getID() {
return(_medal_id);
}
function getName() {
return(_medal_name);
}
function getValue() {
return(_medal_value);
}
function getDifficulty(as_string) {
if (as_string) {
return(difficulty_names[_medal_difficulty]);
}
return(_medal_difficulty);
}
var _medal_unlocked = false;
var _icon_loaded = false;
var _icon_width = 50;
var _icon_height = 50;
var _icon_url = null;
static var difficulty_names = new Array(null, "Easy", "Moderate", "Challenging", "Difficult", "Brutal");
}
Symbol 114 MovieClip [__Packages.com.newgrounds.ScoreBoard] Frame 0
class com.newgrounds.ScoreBoard
{
var _name, _id, _scores;
function ScoreBoard (id, name, tag) {
_name = name;
_id = id;
if (!(tag === undefined)) {
_tag = tag;
}
}
function exists() {
return(Number(_id) > 0);
}
function get id() {
return(_id);
}
function get name() {
return(_name);
}
function get period() {
return(_period);
}
function get tag() {
return(_tag);
}
function get page() {
return(_page);
}
function get num_results() {
return(_num_results);
}
function get scores() {
return(_scores);
}
function postScore(value, tag) {
if (!(tag === undefined)) {
_tag = tag;
}
com.newgrounds.API.postScore(_name, value, _tag);
}
function loadScores(period, page, num_results, tag) {
if (period) {
_period = period;
}
if (page) {
_page = page;
}
if (num_results) {
_num_results = num_results;
}
_scores = [];
com.newgrounds.API.loadScores(_name, _period, tag);
}
function setScores(scores, period, page, num_results) {
if (period) {
_period = period;
}
if (page) {
_page = page;
}
if (num_results) {
_num_results = num_results;
}
_scores = [];
var _local2 = 0;
while (_local2 < scores.length) {
var _local4 = ((_num_results * (_page - 1)) + 1) + _local2;
_scores.push(new com.newgrounds.Score(this, _local4, scores[_local2].username, scores[_local2].value, scores[_local2].numeric_value));
_local2++;
}
}
var _period = "Today";
var _num_results = 10;
var _page = 1;
var _tag = "";
}
Symbol 115 MovieClip [__Packages.com.newgrounds.Score] Frame 0
class com.newgrounds.Score
{
var _board, _position, _username, _value, _numeric_value;
function Score (board, position, username, value, numeric_value) {
_board = board;
_position = position;
_username = username;
_value = value;
_numeric_value = numeric_value;
}
function get board() {
return(_board);
}
function get position() {
return(_position);
}
function get username() {
return(_username);
}
function get value() {
return(_value);
}
function get numeric_value() {
return(_numeric_value);
}
static function fromTime(time) {
var _local1 = time.split(":");
var _local2 = Math.round(Number(_local1.pop()) * 1000);
if (_local1.length > 0) {
_local2 = _local2 + (Number(_local1.pop()) * 60);
}
if (_local1.length > 0) {
_local2 = _local2 + (Number(_local1.pop()) * 3600);
}
return(_local2);
}
static function fromDistance(distance) {
var _local1 = distance.indexOf("'");
var _local5 = distance.indexOf("\"", _local1);
var _local3 = Number(distance.substr(0, _local1));
var _local4 = Number(distance.substring(_local1 + 1, _local5));
return(Math.round((_local3 * 12) + _local4));
}
}
Symbol 116 MovieClip [__Packages.com.newgrounds.encoders.RC4] Frame 0
class com.newgrounds.encoders.RC4
{
function RC4 () {
}
static function encrypt(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToHex(_local2));
}
static function encryptbin(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(_local2);
}
static function decrypt(src, key) {
var _local3 = hexToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToStr(_local2));
}
static function initialize(pwd) {
var _local2 = 0;
var _local3;
var _local4 = pwd.length;
var _local1 = 0;
while (_local1 <= 255) {
mykey[_local1] = pwd[_local1 % _local4];
sbox[_local1] = _local1;
_local1++;
}
_local1 = 0;
while (_local1 <= 255) {
_local2 = ((_local2 + sbox[_local1]) + mykey[_local1]) % 256;
_local3 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local3;
_local1++;
}
}
static function calculate(plaintxt, psw) {
initialize(psw);
var _local1 = 0;
var _local2 = 0;
var _local9 = new Array();
var _local7;
var _local5;
var _local6;
var _local3 = 0;
while (_local3 < plaintxt.length) {
_local1 = (_local1 + 1) % 256;
_local2 = (_local2 + sbox[_local1]) % 256;
_local5 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local5;
var _local4 = (sbox[_local1] + sbox[_local2]) % 256;
_local7 = sbox[_local4];
_local6 = plaintxt[_local3] ^ _local7;
_local9.push(_local6);
_local3++;
}
return(_local9);
}
static function charsToHex(chars) {
var _local4 = new String("");
var _local3 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local1 = 0;
while (_local1 < chars.length) {
_local4 = _local4 + (_local3[chars[_local1] >> 4] + _local3[chars[_local1] & 15]);
_local1++;
}
return(_local4);
}
static function hexToChars(hex) {
var _local3 = new Array();
var _local1 = ((hex.substr(0, 2) == "0x") ? 2 : 0);
while (_local1 < hex.length) {
_local3.push(parseInt(hex.substr(_local1, 2), 16));
_local1 = _local1 + 2;
}
return(_local3);
}
static function charsToStr(chars) {
var _local3 = new String("");
var _local1 = 0;
while (_local1 < chars.length) {
_local3 = _local3 + String.fromCharCode(chars[_local1]);
_local1++;
}
return(_local3);
}
static function strToChars(str) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < str.length) {
_local3.push(str.charCodeAt(_local1));
_local1++;
}
return(_local3);
}
static var sbox = new Array(255);
static var mykey = new Array(255);
}
Symbol 117 MovieClip [__Packages.com.newgrounds.encoders.JSON] Frame 0
class com.newgrounds.encoders.JSON
{
static var start, cache, interval;
function JSON () {
}
static function encode(arg, noquotes) {
var _local3;
var _local2;
var _local6;
var _local1 = "";
var _local4;
if (arg.isSServerVar()) {
var _local8 = "sservervariable";
} else {
var _local8 = typeof(arg);
}
switch (_local8) {
case "sservervariable" :
return("?" + arg.getEncodedValue());
case "object" :
if (arg) {
if (arg instanceof Array) {
_local2 = 0;
while (_local2 < arg.length) {
_local4 = encode(arg[_local2]);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + _local4;
_local2++;
}
return(("[" + _local1) + "]");
}
if (typeof(arg.toString) != "undefined") {
for (_local2 in arg) {
_local4 = arg[_local2];
if ((typeof(_local4) != "undefined") && (typeof(_local4) != "function")) {
_local4 = encode(_local4);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + ((encode(_local2) + ":") + _local4);
}
}
return(("{" + _local1) + "}");
}
}
return("null");
case "number" :
return((isFinite(arg) ? (String(arg)) : "null"));
case "string" :
_local6 = arg.length;
if (noquotes) {
var _local7 = "";
} else {
var _local7 = "\"";
}
_local1 = _local7;
_local2 = 0;
while (_local2 < _local6) {
_local3 = arg.charAt(_local2);
if (_local3 >= " ") {
if ((_local3 == "\\") || (_local3 == "\"")) {
_local1 = _local1 + "\\";
}
_local1 = _local1 + _local3;
} else {
switch (_local3) {
case "\b" :
_local1 = _local1 + "\\b";
break;
case "\f" :
_local1 = _local1 + "\\f";
break;
case newline :
_local1 = _local1 + "\\n";
break;
case "\r" :
_local1 = _local1 + "\\r";
break;
case "\t" :
_local1 = _local1 + "\\t";
break;
default :
_local3 = _local3.charCodeAt();
_local1 = _local1 + (("\\u00" + Math.floor(_local3 / 16).toString(16)) + (_local3 % 16).toString(16));
}
}
_local2 = _local2 + 1;
}
return(_local1 + _local7);
case "boolean" :
return(String(arg));
}
return("null");
}
static function background_encode(arg, callback) {
if (busy) {
trace("[Newgrounds Encoder] :: Cannot encode a new file until the previous file is completed");
return(false);
}
if (!callback) {
trace("[Newgrounds Encoder] :: Missing a callback function, skipping encode");
return(false);
}
busy = true;
var _local2 = new Date();
start = _local2.getTime();
cache = {busy:false, complete:false, arg:arg, target:arg, parents:[], encoded:"", callback:callback, encode_chunk:function () {
com.newgrounds.encoders.JSON.encode_chunk();
}};
if (getType(arg) == "object") {
cache.encoded = "{";
} else if (getType(arg) == "array") {
cache.encoded = "[";
}
interval = setInterval(cache, "encode_chunk", 25);
return(true);
}
static function background_decode(arg, callback) {
if (busy) {
trace("[Newgrounds Encoder] :: Cannot decode a new file until the previous file is completed");
return(false);
}
if (!callback) {
trace("[Newgrounds Encoder] :: Missing a callback function, skipping decode");
return(false);
}
busy = true;
var _local1 = new Date();
start = _local1.getTime();
cache = {busy:false, callback:callback, complete:false, arg:arg, pos:0, parents:["root"], target:null, scratch:"", decode_chunk:function () {
com.newgrounds.encoders.JSON.decode_chunk();
}};
interval = setInterval(cache, "decode_chunk", 25);
return(true);
}
static function decode(text) {
var at = 0;
var ch = " ";
var _value;
var _error = function (m) {
throw {name:"JSONError", message:m, at:at - 1, text:text};
};
var _next = function () {
ch = text.charAt(at);
at = at + 1;
return(ch);
};
var _white = function () {
while (ch) {
if (ch <= " ") {
_next();
} else if (ch == "/") {
switch (_next()) {
case "/" :
while ((_next() && (ch != newline)) && (ch != "\r")) {
}
break;
case "*" :
_next();
for(;;){
if (ch) {
if (ch == "*") {
if (_next() == "/") {
_next();
// unexpected jump
}
} else {
_next();
}
} else {
_error("Unterminated comment");
}
};
break;
default :
_error("Syntax error");
}
} else {
return;
}
}
};
var _string = function () {
var _local4;
var _local1 = "";
var _local3;
var _local2;
var _local5 = false;
if (ch == "\"") {
while (_next()) {
if (ch == "\"") {
_next();
return(_local1);
}
if (ch == "\\") {
switch (_next()) {
case "b" :
_local1 = _local1 + "\b";
break;
case "f" :
_local1 = _local1 + "\f";
break;
case "n" :
_local1 = _local1 + newline;
break;
case "r" :
_local1 = _local1 + "\r";
break;
case "t" :
_local1 = _local1 + "\t";
break;
case "u" :
_local2 = 0;
_local4 = 0;
while (_local4 < 4) {
_local3 = parseInt(_next(), 16);
if (!isFinite(_local3)) {
_local5 = true;
break;
}
_local2 = (_local2 * 16) + _local3;
_local4 = _local4 + 1;
}
if (_local5) {
_local5 = false;
break;
}
_local1 = _local1 + String.fromCharCode(_local2);
break;
default :
_local1 = _local1 + ch;
}
} else {
_local1 = _local1 + ch;
}
}
}
_error("Bad string");
};
var _array = function () {
var _local1 = [];
if (ch == "[") {
_next();
_white();
if (ch == "]") {
_next();
return(_local1);
}
while (ch) {
_local1.push(_value());
_white();
if (ch == "]") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad array");
};
var _object = function () {
var _local2;
var _local1 = {};
if (ch == "{") {
_next();
_white();
if (ch == "}") {
_next();
return(_local1);
}
while (ch) {
_local2 = _string();
_white();
if (ch != ":") {
break;
}
_next();
_local1[_local2] = _value();
_white();
if (ch == "}") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad object");
};
var _number = function () {
var _local1 = "";
var _local2;
if (ch == "-") {
_local1 = "-";
_next();
}
while ((ch >= "0") && (ch <= "9")) {
_local1 = _local1 + ch;
_next();
}
if (ch == ".") {
_local1 = _local1 + ".";
while ((_next() && (ch >= "0")) && (ch <= "9")) {
_local1 = _local1 + ch;
}
}
_local2 = 1 * _local1;
if (!isFinite(_local2)) {
_error("Bad number");
} else {
return(_local2);
}
};
var _word = function () {
switch (ch) {
case "t" :
if (((_next() == "r") && (_next() == "u")) && (_next() == "e")) {
_next();
return(true);
}
break;
case "f" :
if ((((_next() == "a") && (_next() == "l")) && (_next() == "s")) && (_next() == "e")) {
_next();
return(false);
}
break;
case "n" :
if (!(((_next() == "u") && (_next() == "l")) && (_next() == "l"))) {
break;
}
_next();
return(null);
}
_error("Syntax error");
};
_value = function () {
_white();
switch (ch) {
case "{" :
return(_object());
case "[" :
return(_array());
case "\"" :
return(_string());
case "-" :
return(_number());
}
return((((ch >= "0") && (ch <= "9")) ? (_number()) : (_word())));
};
return(_value());
}
static function getType(v) {
if (v instanceof Array) {
return("array");
}
return(typeof(v));
}
static function decode_chunk() {
if ((!cache.busy) && (!cache.complete)) {
cache.busy = true;
var _local1 = 0;
while (_local1 < decode_chunks) {
chunk_decoder();
if (cache.complete) {
break;
}
_local1++;
}
trace(Math.round((cache.pos / cache.arg.length) * 100) + "% decoded");
cache.busy = false;
}
if (cache.complete) {
var _local2 = new Date();
busy = false;
clearInterval(interval);
cache.callback(cache.root, _local2.getTime() - start);
cache.arg = "";
}
}
static function encode_chunk() {
if ((!cache.busy) && (!cache.complete)) {
cache.busy = true;
var _local1 = 0;
while (_local1 < encode_chunks) {
chunk_encoder();
if (cache.complete) {
break;
}
_local1++;
}
cache.busy = false;
}
if (cache.complete) {
var _local3 = new Date();
var _local2 = _local3.getTime();
busy = false;
clearInterval(interval);
cache.callback(cache.encoded, _local2 - start);
cache.encoded = "";
}
}
static function chunk_decoder() {
function _object() {
var _local1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos);
if (!com.newgrounds.encoders.JSON.cache.mode) {
com.newgrounds.encoders.JSON.cache.mode = "object";
com.newgrounds.encoders.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos);
if (_local1 != "\"") {
throw "Malformed object key in encoded string. Keys must be wrapped in quotes (\"\")";
}
com.newgrounds.encoders.JSON.cache.scratch = "";
_setTargetValue({});
} else if (_local1 == ",") {
com.newgrounds.encoders.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos);
if (_local1 != "\"") {
throw "Malformed object key in encoded string. Keys must be wrapped in quotes (\"\")";
}
com.newgrounds.encoders.JSON.cache.scratch = "";
} else if (_local1 == "}") {
_useParent();
} else if (_local1 == "\"") {
com.newgrounds.encoders.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos);
if (_local1 != ":") {
throw "Malformed object notation. Object keys and values must be separated by colons(:)";
}
_addParent(com.newgrounds.encoders.JSON.cache.scratch);
com.newgrounds.encoders.JSON.cache.mode = null;
} else {
if (_local1 == "\\") {
com.newgrounds.encoders.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos);
}
com.newgrounds.encoders.JSON.cache.scratch = com.newgrounds.encoders.JSON.cache.scratch + _local1;
}
com.newgrounds.encoders.JSON.cache.pos++;
}
function _array() {
var _local1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos);
if (!com.newgrounds.encoders.JSON.cache.mode) {
com.newgrounds.encoders.JSON.cache.mode = "array";
com.newgrounds.encoders.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos);
_setTargetValue([]);
if (_local1 != "]") {
_addArrayKey();
} else {
_useParent();
}
return(undefined);
}
if (_local1 == ",") {
_addArrayKey();
} else if (_local1 == "]") {
_useParent();
}
com.newgrounds.encoders.JSON.cache.pos++;
}
function _boolean() {
var _local1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos);
if (_local1 == "t") {
_setTargetValue(true);
com.newgrounds.encoders.JSON.cache.pos = com.newgrounds.encoders.JSON.cache.pos + 3;
} else if (_local1 == "f") {
_setTargetValue(false);
com.newgrounds.encoders.JSON.cache.pos = com.newgrounds.encoders.JSON.cache.pos + 4;
} else {
throw "Bool values must be true or false";
}
_useParent();
}
function _null() {
var _local1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos);
if (_local1 == "n") {
_setTargetValue(null);
com.newgrounds.encoders.JSON.cache.pos = com.newgrounds.encoders.JSON.cache.pos + 2;
} else {
throw "Null values must be null";
}
_useParent();
}
function _string() {
var _local1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos);
if (!com.newgrounds.encoders.JSON.cache.mode) {
if (_local1 != "\"") {
throw "Strings must be wrapped in quotes (\"\")";
}
com.newgrounds.encoders.JSON.cache.scratch = "";
com.newgrounds.encoders.JSON.cache.mode = "string";
} else if (_local1 == "\"") {
_setTargetValue(com.newgrounds.encoders.JSON.cache.scratch);
_useParent();
} else {
if (_local1 == "\\") {
com.newgrounds.encoders.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos);
switch (_local1) {
case "n" :
_local1 = newline;
break;
case "r" :
_local1 = newline;
break;
case "t" :
_local1 = "\t";
break;
case "u" :
_local1 = "\\" + _local1;
}
}
com.newgrounds.encoders.JSON.cache.scratch = com.newgrounds.encoders.JSON.cache.scratch + _local1;
}
com.newgrounds.encoders.JSON.cache.pos++;
}
function _number() {
var _local1 = com.newgrounds.encoders.JSON.cache.arg.charAt(com.newgrounds.encoders.JSON.cache.pos);
var _local2 = "01234567890.-";
if (!com.newgrounds.encoders.JSON.cache.mode) {
com.newgrounds.encoders.JSON.cache.mode = "number";
com.newgrounds.encoders.JSON.cache.scratch = "";
}
if (_local2.indexOf(_local1) < 0) {
_setTargetValue(Number(com.newgrounds.encoders.JSON.cache.scratch));
_useParent();
} else {
com.newgrounds.encoders.JSON.cache.scratch = com.newgrounds.encoders.JSON.cache.scratch + _local1;
com.newgrounds.encoders.JSON.cache.pos++;
}
}
function _setTargetValue(newval) {
var _local2 = _getParent().obj;
var _local1 = com.newgrounds.encoders.JSON.cache.parents[com.newgrounds.encoders.JSON.cache.parents.length - 1];
_local2[_local1] = newval;
}
function _useParent() {
com.newgrounds.encoders.JSON.cache.mode = com.newgrounds.encoders.JSON.getType(_getParent().obj);
com.newgrounds.encoders.JSON.cache.parents.pop();
}
function _getParent() {
var _local2 = com.newgrounds.encoders.JSON.cache;
var _local1 = 0;
while (_local1 < (com.newgrounds.encoders.JSON.cache.parents.length - 1)) {
_local2 = _local2[com.newgrounds.encoders.JSON.cache.parents[_local1]];
_local1++;
}
return({obj:_local2, name:com.newgrounds.encoders.JSON.cache.parents[_local1]});
}
function _getCurrent() {
var _local2 = com.newgrounds.encoders.JSON.cache;
var _local1 = 0;
while (_local1 < com.newgrounds.encoders.JSON.cache.parents.length) {
_local2 = _local2[com.newgrounds.encoders.JSON.cache.parents[_local1]];
_local1++;
}
return({obj:_local2, name:com.newgrounds.encoders.JSON.cache.parents[_local1]});
}
function _addParent(child) {
com.newgrounds.encoders.JSON.cache.parents.push(child);
}
function _addArrayKey() {
var _local1 = _getCurrent().obj.length;
com.newgrounds.encoders.JSON.cache.parents.push(_local1);
com.newgrounds.encoders.JSON.cache.mode = null;
}
if (cache.pos >= cache.arg.length) {
cache.complete = true;
return(undefined);
}
if (cache.mode) {
eval ("_" + cache.mode)();
} else {
var char = cache.arg.charAt(cache.pos);
switch (char) {
case "{" :
_object();
return;
case "[" :
_array();
return;
case "\"" :
_string();
return;
case "n" :
_null();
return;
case "t" :
_boolean();
return;
case "f" :
_boolean();
return;
default :
_number();
}
}
}
static function chunk_encoder() {
if (cache.complete) {
return(undefined);
}
var _local2 = getType(cache.target);
switch (_local2) {
case "number" :
cache.encoded = cache.encoded + cache.target;
getParent();
break;
case "string" :
cache.encoded = cache.encoded + (("\"" + cache.target.split("\"").join("\\\"")) + "\"");
getParent();
break;
case "boolean" :
cache.encoded = cache.encoded + ((cache.target == true) ? "true" : "false");
getParent();
break;
case "null" :
cache.encoded = cache.encoded + "null";
getParent();
break;
case "array" :
if (cache.target.length < 1) {
cache.encoded = cache.encoded + "]";
getParent();
} else {
cache.parents.push(cache.target);
cache.target = cache.target[0];
if (getType(cache.target) == "array") {
cache.encoded = cache.encoded + "[";
} else if (getType(cache.target) == "object") {
cache.encoded = cache.encoded + "{";
}
}
break;
case "object" :
for (var _local1 in cache.target) {
break;
}
if (_local1 === undefined) {
cache.encoded = cache.encoded + "}";
getParent();
} else {
cache.parents.push(cache.target);
cache.target = cache.target[_local1];
cache.encoded = cache.encoded + (("\"" + _local1.split("\"").join("\\\"")) + "\":");
if (getType(cache.target) == "array") {
cache.encoded = cache.encoded + "[";
} else if (getType(cache.target) == "object") {
cache.encoded = cache.encoded + "{";
}
}
break;
default :
cache.encoded = cache.encoded + "null";
getParent();
}
}
static function getParent() {
if (cache.parents.length > 0) {
var _local1 = cache.parents.pop();
if (getType(_local1) == "array") {
_local1.shift();
} else {
for (var _local3 in _local1) {
delete _local1[_local3];
break;
}
}
if ((getType(_local1) == "object") or (getType(_local1) == "array")) {
for (var _local2 in _local1) {
break;
}
if (!(_local2 === undefined)) {
cache.encoded = cache.encoded + ",";
}
}
cache.target = _local1;
} else {
cache.complete = true;
}
}
static var encode_chunks = 20000;
static var decode_chunks = 20000;
static var busy = false;
}
Symbol 118 MovieClip [__Packages.com.newgrounds.APIEventDispatcher] Frame 0
class com.newgrounds.APIEventDispatcher
{
function APIEventDispatcher () {
}
function addEventListener(event, callback, target) {
if (!target) {
throw "Attempted to create a listener without providing a target object.";
}
if (!listeners[event]) {
listeners[event] = [];
} else {
removeEventListener(event, target);
}
listeners[event].push({target:target, callback:callback});
}
function removeEventListener(event, target) {
if (!target) {
throw "Attempted to remove a listener without providing a target object.";
}
if ((!listeners[event]) || (listeners[event].length < 1)) {
return(undefined);
}
var _local4 = [];
var _local2 = 0;
while (_local2 < listeners[event].length) {
if (listeners[event][_local2].target != target) {
_local4.push(listeners[event][_local2]);
}
_local2++;
}
listeners[event] = _local4;
}
function dispatchEvent(event) {
if (!hasEventListener(event.__get__type())) {
return(false);
}
collectGarbage(event.__get__type());
var _local2 = 0;
while (_local2 < listeners[event.__get__type()].length) {
var _local4 = listeners[event.__get__type()][_local2].callback;
if (listeners[event.__get__type()][_local2].target) {
var _local5 = listeners[event.__get__type()][_local2].target;
_local4.call(_local5, event);
} else {
_local4(event);
}
_local2++;
}
return(true);
}
function hasEventListener(event) {
return((listeners[event] != undefined) && (listeners[event].length > 0));
}
function collectGarbage(event) {
var _local5 = [];
if (!hasEventListener) {
return(undefined);
}
var _local2 = 0;
while (_local2 < listeners[event].length) {
var _local4 = listeners[event][_local2].target;
if (_local4) {
_local5.push(listeners[event][_local2]);
}
_local2++;
}
listeners[event] = _local5;
}
var listeners = {};
}
Symbol 119 MovieClip [__Packages.com.newgrounds.encoders.MD5] Frame 0
class com.newgrounds.encoders.MD5
{
function MD5 () {
}
static function calculate(src) {
return(hex_md5(src));
}
static function hex_md5(src) {
return(binl2hex(core_md5(str2binl(src), src.length * 8)));
}
static function core_md5(x, len) {
x[len >> 5] = x[len >> 5] | (128 << (len % 32));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var _local4 = 1732584193 /* 0x67452301 */;
var _local3 = -271733879;
var _local2 = -1732584194;
var _local1 = 271733878 /* 0x10325476 */;
var _local5 = 0;
while (_local5 < x.length) {
var _local10 = _local4;
var _local9 = _local3;
var _local8 = _local2;
var _local7 = _local1;
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 0], 7, -680876936);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 1], 12, -389564586);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 2], 17, 606105819);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 3], 22, -1044525330);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 4], 7, -176418897);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 5], 12, 1200080426);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 6], 17, -1473231341);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 7], 22, -45705983);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 8], 7, 1770035416);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 9], 12, -1958414417);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 10], 17, -42063);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 11], 22, -1990404162);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 12], 7, 1804603682);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 13], 12, -40341101);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 14], 17, -1502002290);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 15], 22, 1236535329);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 1], 5, -165796510);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 6], 9, -1069501632);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 11], 14, 643717713);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 0], 20, -373897302);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 5], 5, -701558691);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 10], 9, 38016083);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 15], 14, -660478335);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 4], 20, -405537848);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 9], 5, 568446438);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 14], 9, -1019803690);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 3], 14, -187363961);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 8], 20, 1163531501);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 13], 5, -1444681467);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 2], 9, -51403784);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 7], 14, 1735328473);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 12], 20, -1926607734);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 5], 4, -378558);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 8], 11, -2022574463);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 11], 16, 1839030562);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 14], 23, -35309556);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 1], 4, -1530992060);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 4], 11, 1272893353);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 7], 16, -155497632);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 10], 23, -1094730640);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 13], 4, 681279174);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 0], 11, -358537222);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 3], 16, -722521979);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 6], 23, 76029189);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 9], 4, -640364487);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 12], 11, -421815835);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 15], 16, 530742520);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 2], 23, -995338651);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 0], 6, -198630844);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 7], 10, 1126891415);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 14], 15, -1416354905);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 5], 21, -57434055);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 12], 6, 1700485571);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 3], 10, -1894986606);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 10], 15, -1051523);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 1], 21, -2054922799);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 8], 6, 1873313359);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 15], 10, -30611744);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 6], 15, -1560198380);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 13], 21, 1309151649);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 4], 6, -145523070);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 11], 10, -1120210379);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 2], 15, 718787259);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 9], 21, -343485551);
_local4 = safe_add(_local4, _local10);
_local3 = safe_add(_local3, _local9);
_local2 = safe_add(_local2, _local8);
_local1 = safe_add(_local1, _local7);
_local5 = _local5 + 16;
}
return(new Array(_local4, _local3, _local2, _local1));
}
static function md5_cmn(q, a, b, x, s, t) {
return(safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b));
}
static function md5_ff(a, b, c, d, x, s, t) {
return(md5_cmn((b & c) | ((~b) & d), a, b, x, s, t));
}
static function md5_gg(a, b, c, d, x, s, t) {
return(md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
static function md5_hh(a, b, c, d, x, s, t) {
return(md5_cmn((b ^ c) ^ d, a, b, x, s, t));
}
static function md5_ii(a, b, c, d, x, s, t) {
return(md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
}
static function bit_rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
static function safe_add(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
static function str2binl(str) {
var _local3 = new Array();
var _local4 = 255;
var _local1 = 0;
while (_local1 < (str.length * 8)) {
_local3[_local1 >> 5] = _local3[_local1 >> 5] | ((str.charCodeAt(_local1 / 8) & _local4) << (_local1 % 32));
_local1 = _local1 + 8;
}
return(_local3);
}
static function binl2hex(binarray) {
var _local4 = new String("");
var _local3 = new String("0123456789abcdef");
var _local1 = 0;
while (_local1 < (binarray.length * 4)) {
_local4 = _local4 + (_local3.charAt((binarray[_local1 >> 2] >> (((_local1 % 4) * 8) + 4)) & 15) + _local3.charAt((binarray[_local1 >> 2] >> ((_local1 % 4) * 8)) & 15));
_local1++;
}
return(_local4);
}
}
Symbol 287 MovieClip [o_achiev_point] Frame 1
onRelease = function () {
_root.sselected = _root.sselected - (ii - _root.item);
};
Symbol 305 MovieClip [o_backgrounds] Frame 1
stop();
Symbol 334 MovieClip [o_boom_part] Frame 24
this.removeMovieClip();
Symbol 337 MovieClip [o_buble] Frame 1
stop();
x0 = _x;
t = 0;
yy = Math.random() * 3;
tt = 0.15 + (Math.random() * 0.4);
choose = Math.round(Math.random());
_xscale = (70 + (Math.random() * 30));
_yscale = _xscale;
onEnterFrame = function () {
if (choose == 0) {
_x = (x0 + (Math.sin((t = t + tt)) * 4));
} else if (choose == 1) {
_x = (x0 + (Math.cos((t = t + tt)) * 4));
}
_y = (_y - yy);
_alpha = (_alpha - 1);
if (_alpha <= 0) {
this.removeMovieClip();
trace(1);
}
};
Symbol 342 MovieClip [o_but_inter_come] Frame 1
stop();
onRollOver = function () {
gotoAndStop (2);
};
onRollOut = function () {
gotoAndStop(curr);
};
Symbol 347 MovieClip [o_but_inter_noexit] Frame 1
stop();
onRollOver = function () {
gotoAndStop (2);
};
onRollOut = function () {
gotoAndStop(curr);
};
Symbol 354 MovieClip [o_but_music] Frame 1
stop();
onRollOver = function () {
gotoAndStop (2);
};
onRollOut = function () {
gotoAndStop(curr);
};
Symbol 361 MovieClip [o_but_sound] Frame 1
stop();
onRollOver = function () {
gotoAndStop (2);
};
onRollOut = function () {
gotoAndStop(curr);
};
Symbol 377 MovieClip [o_chosen_cell] Frame 1
stop();
Symbol 384 MovieClip [o_cloud] Frame 1
stop();
Symbol 384 MovieClip [o_cloud] Frame 2
stop();
Symbol 384 MovieClip [o_cloud] Frame 3
stop();
Symbol 387 MovieClip [o_hint_message] Frame 1
var a = 0;
_xscale = 10;
_yscale = 10;
onEnterFrame = function () {
if (a == 0) {
_xscale = (_xscale + 15);
_yscale = _xscale;
}
if ((a == 0) and (_xscale >= 110)) {
a = 1;
}
if (a == 1) {
_xscale = (_xscale - 5);
_yscale = _xscale;
}
if ((a == 1) and (_xscale < 100)) {
a = 2;
}
if (a == 3) {
_xscale = (_xscale + 5);
_yscale = _xscale;
}
if ((a == 3) and (_xscale >= 115)) {
a = 4;
}
if ((a == 4) and (_xscale > 0)) {
_xscale = (_xscale - 15);
_yscale = _xscale;
}
if (_xscale < 0) {
_visible = false;
_root.hints.t_hint1._visible = false;
_root.hints.t_hint2._visible = false;
}
_root.hints.t_hint1._xscale = _xscale;
_root.hints.t_hint1._yscale = _yscale;
_root.hints.t_hint1._alpha = _xscale;
_root.hints.t_hint2._xscale = _xscale;
_root.hints.t_hint2._yscale = _yscale;
_root.hints.t_hint2._alpha = _xscale;
};
Symbol 390 MovieClip [o_iceball] Frame 1
y0 = _y;
t = 0;
onEnterFrame = function () {
if (go == 0) {
_y = (y0 + (Math.sin((t = t + 0.15)) * 4));
} else if (go == 1) {
_y = y0;
}
};
Symbol 402 MovieClip [o_inter_but_go] Frame 1
stop();
curr = 1;
onRollOver = function () {
gotoAndStop(curr + 1);
};
onRollOut = function () {
gotoAndStop(curr);
};
Symbol 407 MovieClip [o_key] Frame 1
y0 = _y;
if (t == undefined) {
t = Math.random() * 10;
}
onEnterFrame = function () {
_y = (y0 + (Math.sin((t = t + 0.15)) * 4));
};
Symbol 415 MovieClip [o_level] Frame 1
stop();
if ((_currentframe == 1) and (_root.stars[((i * _root.sizee) + j) - 1] != 2)) {
this.attachMovie("o_level_star", ("o_level_star" + (i * _root.sizee)) + j, (i * _root.sizee) + j);
this[("o_level_star" + (i * _root.sizee)) + j]._x = 13;
this[("o_level_star" + (i * _root.sizee)) + j]._y = 18;
if (_root.stars[((i * _root.sizee) + j) - 1] == 1) {
this[("o_level_star" + (i * _root.sizee)) + j].gotoAndStop(2);
}
}
onEnterFrame = function () {
if (_alpha < 100) {
_alpha = (_alpha + 5);
_root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._alpha = _root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._alpha + 5;
}
};
onPress = function () {
if (_currentframe == 1) {
_root.PlaySound(_root.s_click);
}
};
onRelease = function () {
if (_currentframe == 1) {
var _local3 = 0;
while (_local3 < 12) {
var _local2 = 0;
while (_local2 < 12) {
_root.lvlArray1[(_local3 * 12) + _local2] = _root.lvlArray[((i * 7) + j) - 1][(_local3 * 12) + _local2];
_local2 = _local2 + 1;
}
_local3 = _local3 + 1;
}
_root.cur_level_number = ((i * 7) + j) - 1;
_root.tool_a1 = _root.tools_array[((i * 7) + j) - 1][0];
_root.tool_a2 = _root.tools_array[((i * 7) + j) - 1][1];
_root.back_a = _root.tools_array[((i * 7) + j) - 1][2];
_root.go_level = 1;
}
};
onRollOver = function () {
if ((_currentframe == 1) and (_xscale == 100)) {
_root.PlaySound(_root.s_bul);
_xscale = 130;
_yscale = 130;
_root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._xscale = 130;
_root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._yscale = 130;
_root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._x = _root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._x - 2;
_root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._y = _root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._y - 4;
}
};
onRollOut = function () {
if (_currentframe == 1) {
_xscale = 100;
_yscale = 100;
_root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._xscale = 100;
_root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._yscale = 100;
_root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._x = _root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._x + 2;
_root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._y = _root.all_m.levels_2[("t_level" + (i * _root.sizee)) + j]._y + 4;
}
};
Symbol 420 MovieClip [o_level_star] Frame 1
stop();
Symbol 423 MovieClip [o_little_star] Frame 1
stop();
speeed = 1 + (Math.random() * 4);
_alpha = 90;
y0 = _y;
x0 = _x;
onEnterFrame = function () {
_rotation = (_rotation + 10);
_alpha = (_alpha - 4);
if (_alpha <= 0) {
this.removeMovieClip();
trace(1);
}
};
Symbol 434 MovieClip [o_main_menu_logo] Frame 1
stop();
Symbol 443 MovieClip [o_mountains] Frame 1
stop();
Symbol 521 MovieClip [o_prince_f] Frame 1
stop();
Symbol 521 MovieClip [o_prince_f] Frame 9
gotoAndPlay (2);
Symbol 526 MovieClip [o_princess_b] Frame 1
stop();
y0 = _y;
t = 0;
onEnterFrame = function () {
_y = (y0 + (Math.sin((t = t + 0.35)) * 0.75));
};
Symbol 531 MovieClip [o_princess_f] Frame 1
stop();
Symbol 538 MovieClip [o_progress_bar] Frame 1
stop();
Symbol 551 MovieClip [o_snowy] Frame 1
stop();
x0 = _x;
t = 0;
yy = 1 + (Math.random() * 3);
tt = 0.15 + (Math.random() * 0.4);
_xscale = (70 + (Math.random() * 30));
_yscale = _xscale;
onEnterFrame = function () {
_y = (_y + yy);
_alpha = (_alpha - 5);
if (_alpha <= 0) {
this.removeMovieClip();
trace(1);
}
};
Symbol 563 MovieClip [o_tel] Frame 1
stop();
x0 = _x;
y0 = _y;
tx = Math.random() * 10000;
ty = Math.random() * 10000;
onEnterFrame = function () {
_x = (x0 + (Math.sin((tx = tx + 0.2)) * 15));
_y = (y0 + (Math.sin((ty = ty + 0.3)) * 25));
};
Symbol 649 MovieClip [o_vint] Frame 1
onEnterFrame = function () {
_rotation = (_rotation + 1);
};
Symbol 660 MovieClip [o_wave] Frame 19
_x = (((2 + (53 * _j)) + 12) + (Math.random() * 28));
_y = ((((-_root.dx) + (41 * _i)) + 3) + (Math.random() * 27));
Symbol 663 MovieClip [o_wood_princess] Frame 1
y0 = _y;
if (t == undefined) {
t = Math.random() * 10;
}
onEnterFrame = function () {
_y = (y0 + (Math.sin((t = t + 0.15)) * 4));
};
Symbol 748 MovieClip [o_up_star] Frame 1
stop();
speeed = 2 + (Math.random() * 4);
_alpha = 120;
y0 = _y;
x0 = _x;
onEnterFrame = function () {
_rotation = (_rotation + 10);
_y = (_y - speeed);
_alpha = (_alpha - 2);
if (_alpha <= 0) {
this.removeMovieClip();
trace(1);
}
};
Symbol 753 MovieClip [o_ach_pr_bar] Frame 1
stop();
Symbol 760 MovieClip [o_cake_piece] Frame 1
stop();
var qqq = 0;
speeed = 1 + (Math.random() * 4);
y0 = _y;
x0 = _x;
onEnterFrame = function () {
_y = (_y + (Math.sin((Math.PI * dir) / 180) * 4));
_rotation = (_rotation + 10);
_x = (_x + (Math.cos((Math.PI * dir) / 180) * 4));
_y = (_y + (0.1 + qqq));
qqq = qqq + 0.4;
_alpha = (_alpha - 4);
if (_alpha <= 0) {
this.removeMovieClip();
trace(1);
}
};
Symbol 763 MovieClip [o_frog_blick] Frame 1
onEnterFrame = function () {
_rotation = (_rotation + 4);
};
Symbol 769 MovieClip [o_hint_arrow] Frame 1
y0 = _y;
if (t == undefined) {
t = Math.random() * 10;
}
onEnterFrame = function () {
_y = (y0 + (Math.sin((t = t + 0.15)) * 4));
};
Symbol 775 MovieClip [o_preloader_gr] Frame 1
stop();
Symbol 791 MovieClip Frame 1
stop();