Frame 1
MochiAd.showPreGameAd({id:"05b531c6c02fdcf8", res:"800x480", background:16777161, color:4102098, outline:4102098, no_bg:true});
m_ripex.field.text = "ripex.no";
m_ripex._yscale = 75;
m_ripex.onPress = function () {
getURL ("http://www.ripex.no/", "_blank");
};
mute = false;
m_mute.onPress = function () {
if (mute) {
mute = false;
m_mute.gotoAndStop(1);
} else {
mute = true;
m_mute.gotoAndStop(2);
}
};
Frame 2
stop();
user_so = SharedObject.getLocal("user");
if (user_so.data.levels_completed == undefined) {
user_so.data.levels_completed = 1;
}
if (user_so.data.username == undefined) {
user_so.data.username = "";
}
this.onEnterFrame = function () {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
gotoAndStop ("menu");
}
};
menu = new ContextMenu();
menu.hideBuiltInItems();
menu.customItems.push(Functioned);
_root.menu = menu;
Frame 10
m_play.field.text = "Play";
m_options.field.text = "Options";
m_help.field.text = "Help";
m_play.onPress = function () {
gotoAndStop ("select");
};
m_options.onPress = function () {
gotoAndStop ("options");
};
m_help.onPress = function () {
gotoAndStop ("help");
};
Frame 19
gotoAndStop ("menu");
Frame 20
m_back.field.text = "Back";
m_back.onPress = function () {
gotoAndStop ("menu");
};
this.onEnterFrame = function () {
};
Frame 29
gotoAndStop ("help");
Frame 30
m_back.field.text = "Back";
m_back.onPress = function () {
gotoAndStop ("menu");
};
this.onEnterFrame = function () {
g_low.btn_text.text = "Low";
g_medium.btn_text.text = "Medium";
g_high.btn_text.text = "High";
cloud_yes.btn_text.text = "Yes";
cloud_no.btn_text.text = "No";
if (_quality == "LOW") {
g_low.gotoAndStop(2);
} else {
g_low.gotoAndStop(1);
}
if (_quality == "MEDIUM") {
g_medium.gotoAndStop(2);
} else {
g_medium.gotoAndStop(1);
}
if (_quality == "HIGH") {
g_high.gotoAndStop(2);
} else {
g_high.gotoAndStop(1);
}
if (clouds._visible == true) {
cloud_yes.gotoAndStop(2);
} else {
cloud_yes.gotoAndStop(1);
}
if (clouds._visible == false) {
cloud_no.gotoAndStop(2);
} else {
cloud_no.gotoAndStop(1);
}
};
g_low.onPress = function () {
_quality = "LOW";
};
g_medium.onPress = function () {
_quality = "MEDIUM";
};
g_high.onPress = function () {
_quality = "HIGH";
};
cloud_no.onPress = function () {
clouds._visible = false;
};
cloud_yes.onPress = function () {
clouds._visible = true;
};
Frame 40
function delete_clips() {
i = 1;
while (i <= 30) {
_root["level_" + i].removeMovieClip();
i++;
}
normal.removeMovieClip();
hard.removeMovieClip();
expert.removeMovieClip();
}
var s_no = new Sound();
s_no.attachSound("no");
i = 0;
while (i < 10) {
_root["ready" + i] = false;
i++;
}
i = 0;
while (i < 10) {
_root["slinging" + i] = false;
i++;
}
m_normal.field.text = "Normal";
m_hard.field.text = "Hard";
m_expert.field.text = "Expert";
normal_hs.field.text = (hard_hs.field.text = (expert_hs.field.text = "[View highscores]"));
m_back.field.text = "Back";
normal_hs.onPress = function () {
delete_clips();
skill = "Normal";
campaign = true;
score_submit = false;
player_playing = false;
gotoAndStop ("scoreboard");
};
hard_hs.onPress = function () {
delete_clips();
skill = "Hard";
campaign = true;
score_submit = false;
player_playing = false;
gotoAndStop ("scoreboard");
};
expert_hs.onPress = function () {
delete_clips();
skill = "Expert";
campaign = true;
score_submit = false;
player_playing = false;
gotoAndStop ("scoreboard");
};
m_back.onPress = function () {
delete_clips();
gotoAndStop ("menu");
};
x = 0;
while (x <= 2) {
i = 1 + (x * 10);
while (i <= (10 + (x * 10))) {
var t = attachMovie("button", "level_" + i, this.getNextHighestDepth(), {_x:150 + (100 * x), _y:140 + (20 * (i - (10 * x)))});
t.field.text = "Level " + i;
t.id = i;
t._yscale = 66;
t._xscale = 45;
if (user_so.data.levels_completed < i) {
var my_color = new Color(t);
my_color.setRGB(10027008);
t.onPress = function () {
if (!mute) {
s_no.start(0, 0);
}
};
} else {
t.onPress = function () {
level = this.id;
campaign = false;
gotoAndStop ("game");
delete_clips();
};
}
i++;
}
x++;
}
this.onEnterFrame = function () {
if (user_so.data.levels_completed > 0) {
m_normal.onPress = function () {
skill = "Normal";
campaign = true;
level = 1;
last_level = 10;
gotoAndStop ("game");
delete_clips();
};
normal_txt.textbox.text = "Beat level 1-10 to show of your Sling Jumper skills.";
} else {
var _local1 = new Color(m_normal.field);
_local1.setRGB(10027008);
m_normal.onPress = function () {
if (!mute) {
s_no.start(0, 0);
}
};
}
if (user_so.data.levels_completed > 10) {
m_hard.onPress = function () {
skill = "Hard";
campaign = true;
level = 11;
last_level = 20;
gotoAndStop ("game");
delete_clips();
};
hard_txt.textbox.text = "You must beat level 11-20 to show what you're made of!";
} else {
var _local1 = new Color(m_hard.field);
_local1.setRGB(10027008);
m_hard.onPress = function () {
if (!mute) {
s_no.start(0, 0);
}
};
hard_txt.textbox.text = "Beat level 10 to unlock this challenge.";
}
if (user_so.data.levels_completed > 20) {
m_expert.onPress = function () {
skill = "Expert";
campaign = true;
level = 21;
last_level = 30;
gotoAndStop ("game");
delete_clips();
};
expert_txt.textbox.text = "Show your \u00FCber elite skills. You only have to beat level 21-30 as fast as possible.";
} else {
var _local1 = new Color(m_expert.field);
_local1.setRGB(10027008);
m_expert.onPress = function () {
if (!mute) {
s_no.start(0, 0);
}
};
expert_txt.textbox.text = "Just beat level 20 to unlock this challenge so you can prove your awesome skills.";
}
};
Frame 49
delete_clips();
gotoAndStop ("select");
Frame 50
function init() {
drawLevel(level, false);
}
function createSling(x, y) {
slings++;
_root.attachMovie("node", "node1_" + slings, this.getNextHighestDepth(), {_x:x - 50, _y:y});
_root.attachMovie("node", "node2_" + slings, this.getNextHighestDepth(), {_x:x + 50, _y:y});
_root.createEmptyMovieClip("line_" + slings, this.getNextHighestDepth());
}
function createCoin(count) {
i = 1;
while (i <= count) {
coins++;
coin_t = attachMovie("coin", "coin_" + i, this.getNextHighestDepth());
coin_t.onEnterFrame = function () {
if (this.hitTest(ball)) {
if (!mute) {
cash.start();
}
coins_collected++;
this.removeMovieClip();
}
};
i++;
}
}
function createCoinLine(startCount, endCount, xpos, ypos) {
var _local2 = startCount;
while (_local2 <= endCount) {
_root["coin_" + _local2]._x = xpos + (20 * (_local2 - startCount));
_root["coin_" + _local2]._y = ypos;
_local2++;
}
}
function createCoinCurveLine(startCount, endCount, xpos, ypos) {
var _local2 = startCount;
while (_local2 <= endCount) {
_root["coin_" + _local2]._x = xpos + (20 * (_local2 - startCount));
_root["coin_" + _local2]._y = (ypos + (Math.cos(10 - ((_local2 - startCount) / 18)) * 100)) + 80;
_local2++;
}
}
function createTerrain(count) {
_root.attachMovie("terrain_" + count, "terrain", -1, {_x:400, _y:240});
}
function createDeath(count) {
_root.attachMovie("death_" + count, "death", -2, {_x:400, _y:240});
}
function createIntro(intro_text) {
if (reset) {
return(undefined);
}
_root.createEmptyMovieClip("black_bg", this.getNextHighestDepth());
black_bg.clear();
black_bg.beginFill(0, 100);
black_bg.moveTo(0, 0);
black_bg.lineTo(800, 0);
black_bg.lineTo(800, 480);
black_bg.lineTo(0, 480);
black_bg.endFill();
black_bg._alpha = 30;
_root.attachMovie("description", "description", this.getNextHighestDepth(), {_x:400, _y:240});
description.heading_text.text = "Level " + level;
description.content_text.text = intro_text;
pause_game = true;
start_lvl = true;
}
function clearIntro() {
black_bg.removeMovieClip();
description.removeMovieClip();
}
function resetLevel() {
clearLevel();
drawLevel(level, true);
}
function clearLevel() {
i = 1;
while (i <= slings) {
_root["node1_" + i].removeMovieClip();
_root["node2_" + i].removeMovieClip();
_root["line_" + i].removeMovieClip();
i++;
}
i = 1;
while (i <= coins) {
_root["coin_" + i].removeMovieClip();
i++;
}
death.removeMovieClip();
terrain.removeMovieClip();
createTerrain(0);
createDeath(0);
slings = 0;
coins = 0;
coins_collected = 0;
coins_needed = 0;
}
function drawLevel(number, reset_value) {
vel.x = 0;
vel.y = 0;
reset = reset_value;
switch (number) {
case 1 :
ball._x = 250;
ball._y = 200;
finish._x = 550;
finish._y = 225;
createSling(250, 350);
createSling(550, 350);
createIntro("The very basics...");
break;
case 2 :
ball._x = 150;
ball._y = 200;
finish._x = 650;
finish._y = 225;
createSling(150, 350);
createSling(650, 350);
createIntro("Shouldn't be too hard.");
break;
case 3 :
ball._x = 200;
ball._y = 100;
finish._x = 600;
finish._y = 100;
createSling(200, 200);
createSling(600, 400);
createTerrain(3);
createIntro("Sling the ball to \"new\" heights...");
break;
case 4 :
ball._x = 250;
ball._y = 200;
finish._x = 700;
finish._y = 250;
createSling(250, 350);
createSling(550, 350);
createTerrain(4);
createIntro("Just jump over the wall.");
break;
case 5 :
ball._x = 250;
ball._y = 175;
finish._x = 700;
finish._y = 225;
createSling(250, 350);
createSling(550, 350);
createTerrain(5);
createIntro("Same as previous, just with a little precision.");
break;
case 6 :
ball._x = 200;
ball._y = 175;
finish._x = 700;
finish._y = 225;
createSling(200, 350);
createSling(400, 350);
createSling(600, 350);
createTerrain(6);
createIntro("Fine tuning your precision-slinging.");
break;
case 7 :
ball._x = 250;
ball._y = 200;
finish._x = 700;
finish._y = 225;
createSling(250, 350);
createSling(550, 350);
createTerrain(7);
createIntro("Timing and a bit of luck is the answer to everything. Maybe not, but at least this level.");
break;
case 8 :
ball._x = 200;
ball._y = 175;
finish._x = 700;
finish._y = 225;
createSling(200, 350);
createSling(400, 350);
createSling(600, 350);
createTerrain(8);
createIntro("Timing plus luck equals win.");
break;
case 9 :
ball._x = 200;
ball._y = 200;
finish._x = 600;
finish._y = 200;
createSling(200, 400);
createSling(600, 400);
coins_needed = 1;
createCoin(1);
coin_1._x = 400;
coin_1._y = 175;
createIntro("You just need that one stupid coin.");
break;
case 10 :
ball._x = 150;
ball._y = 150;
finish._x = 600;
finish._y = 220;
createSling(150, 400);
createSling(400, 400);
createSling(600, 400);
coins_needed = 100;
createCoin(120);
x = 0;
while (x <= 7) {
createCoinLine(1 + (x * 15), 30 + (x * 30), 250, 150 + (x * 20));
x++;
}
createIntro("There are 120 coins, but you only need to collect 100 of them.");
break;
case 11 :
ball._x = 250;
ball._y = 175;
finish._x = 550;
finish._y = 175;
createSling(250, 350);
createSling(550, 350);
createTerrain(11);
createIntro("Use the environment to your advantage.");
break;
case 12 :
ball._x = 200;
ball._y = 215;
finish._x = 675;
finish._y = 100;
createSling(200, 400);
createTerrain(12);
createIntro("Can you handle the bounce?");
break;
case 13 :
ball._x = 100;
ball._y = 105;
finish._x = 600;
finish._y = 300;
createSling(100, 250);
createSling(600, 400);
createTerrain(13);
createIntro("Get the right bounce.");
break;
case 14 :
ball._x = 150;
ball._y = 200;
finish._x = 550;
finish._y = 200;
createSling(150, 350);
createSling(300, 350);
createTerrain(14);
createIntro("Get the idea?");
break;
case 15 :
ball._x = 200;
ball._y = 175;
finish._x = 700;
finish._y = 200;
createSling(200, 350);
createSling(600, 350);
coins_needed = 26;
createCoin(36);
x = 0;
while (x <= 5) {
createCoinLine(1 + (x * 6), 20 + (x * 6), 550, 150 + (x * 20));
x++;
}
createTerrain(15);
createDeath(15);
createIntro("Feeling the pressure?\nDon't hit the red line and collect 26 or more coins to finish the level.");
break;
case 16 :
ball._x = 200;
ball._y = 250;
finish._x = 700;
finish._y = 250;
createSling(200, 200);
createSling(200, 400);
createSling(400, 200);
createSling(700, 400);
coins_needed = 3;
createCoin(4);
coin_1._x = 300;
coin_1._y = 30;
coin_2._x = 300;
coin_2._y = 50;
coin_3._x = 300;
coin_3._y = 70;
coin_4._x = 300;
coin_4._y = 90;
createTerrain(16);
createDeath(16);
createIntro("Last level was too stressful? You can calm down now, but make sure to get atleast three out of four coins.");
break;
case 17 :
ball._x = 200;
ball._y = 200;
finish._x = 600;
finish._y = 200;
createSling(200, 350);
createSling(600, 350);
coins_needed = 8;
createCoin(8);
x = 0;
while (x <= 1) {
createCoinLine(1 + (x * 2), 2 + (x * 2), 150, 200 + (x * 20));
x++;
}
x = 0;
while (x <= 1) {
createCoinLine(5 + (x * 2), 8 + (x * 2), 230, 200 + (x * 20));
x++;
}
createTerrain(17);
createDeath(17);
createIntro("Deadly accuracy.");
break;
case 18 :
ball._x = 200;
ball._y = 125;
finish._x = 600;
finish._y = 125;
createSling(200, 400);
createSling(600, 400);
coins_needed = 2;
createCoin(10);
createCoinLine(1, 10, 510, 90);
createTerrain(18);
createDeath(18);
createIntro("This must be piece of cake...");
break;
case 19 :
ball._x = 200;
ball._y = 200;
finish._x = 700;
finish._y = 75;
createSling(200, 400);
createSling(600, 400);
coins_needed = 3;
createCoin(3);
coin_1._x = 400;
coin_1._y = 45;
coin_2._x = 400;
coin_2._y = 64;
coin_3._x = 400;
coin_3._y = 85;
createTerrain(19);
createDeath(19);
createIntro("Use the wall to get some real height on that ball.");
break;
case 20 :
ball._x = 200;
ball._y = 200;
finish._x = 550;
finish._y = 350;
createSling(200, 400);
createSling(690, 400);
coins_needed = 20;
createCoin(30);
x = 0;
while (x <= 4) {
createCoinLine(1 + (x * 6), 6 + (x * 6), 650, 100 + (x * 20));
x++;
}
createTerrain(20);
createDeath(20);
createIntro("Ok, you've learned some basic slinging skills. Lets see them in action!");
break;
case 21 :
ball._x = 150;
ball._y = 250;
finish._x = 650;
finish._y = 340;
createSling(150, 400);
createTerrain(21);
createDeath(21);
createIntro("So you call yourself an expert?");
break;
case 22 :
ball._x = 150;
ball._y = 200;
finish._x = 700;
finish._y = 200;
createSling(150, 400);
createTerrain(22);
createDeath(22);
createIntro("You can do it!");
break;
case 23 :
ball._x = 100;
ball._y = 200;
finish._x = 700;
finish._y = 200;
createSling(100, 400);
createSling(400, 300);
createSling(700, 400);
createTerrain(23);
createDeath(23);
createIntro("Oh man, you just got to love the spinning wheel of death...");
break;
case 24 :
ball._x = 250;
ball._y = 50;
finish._x = 600;
finish._y = 150;
createSling(250, 150);
createSling(100, 400);
createSling(500, 400);
createSling(700, 400);
coins_needed = 25;
createCoin(30);
x = 0;
while (x <= 2) {
createCoinLine(1 + (x * 15), 15 + (x * 15), 460, 200 + (x * 20));
x++;
}
createTerrain(24);
createDeath(24);
createIntro("Do you really know how to sling? \nRemember, you only have to collect 25 out of 30 coins.");
break;
case 25 :
ball._x = 100;
ball._y = 250;
finish._x = 600;
finish._y = 50;
createSling(100, 400);
createSling(600, 400);
coins_needed = 22;
createCoin(24);
x = 0;
while (x <= 3) {
createCoinLine(1 + (x * 8), 10 + (x * 8), 180, 200 + (x * 20));
x++;
}
createTerrain(25);
createDeath(25);
createIntro("Oh fancy. A spinning stick!");
break;
case 26 :
ball._x = 100;
ball._y = 200;
finish._x = 725;
finish._y = 300;
createSling(100, 400);
createSling(300, 400);
createSling(500, 400);
createTerrain(26);
createDeath(26);
createIntro("Wall jumping... And a chainsaw?");
break;
case 27 :
ball._x = 100;
ball._y = 50;
finish._x = 700;
finish._y = 380;
createSling(100, 200);
createSling(350, 250);
createTerrain(27);
createDeath(27);
createIntro("Can you handle a seesaw? Now it's time to show off your childhood seesaw-skills!");
break;
case 30 :
ball._x = 100;
ball._y = 50;
finish._x = 700;
finish._y = 380;
createSling(100, 200);
createSling(300, 400);
createTerrain(28);
createDeath(28);
createIntro("There's only one thing to say, the final level!");
break;
case 28 :
ball._x = 400;
ball._y = 300;
finish._x = 400;
finish._y = 50;
createSling(400, 450);
createTerrain(29);
createDeath(29);
createIntro("Easier said than done?");
break;
case 29 :
ball._x = 100;
ball._y = 50;
finish._x = 675;
finish._y = 350;
createSling(100, 150);
createSling(100, 400);
createSling(270, 200);
createTerrain(30);
createDeath(30);
createIntro("Oh boy...");
break;
default :
level--;
}
}
_root.attachMovie("finish", "finish", 0, {_x:x, _y:y});
_root.attachMovie("ball", "ball", 1, {_x:x, _y:y});
var boing = new Sound();
boing.attachSound("boing");
var stretch = new Sound();
stretch.attachSound("stretch");
var cash = new Sound();
cash.attachSound("cash");
var level_complete = new Sound();
level_complete.attachSound("success");
var bounce = new Sound();
bounce.attachSound("bounce");
var pause_game = false;
var start_lvl = true;
var acc = {x:0, y:0};
var vel = {x:0, y:0};
var gravity = 0.2;
var radius = 6.3;
var angle1 = 0;
var angle2 = 0;
var elastic = 0.015;
var precision = 360;
var pause_hit = 0;
var hit_count = 0;
var get_sling = 0;
var on_sling = false;
var level;
var last_level;
var campaign;
var skill;
var slings = 0;
var coins = 0;
var coins_collected = 0;
var coins_needed = 0;
var tick = 0;
var time_milli = 0;
var time_sec = 0;
var time_min = 0;
player_playing = true;
init();
key_P = 0;
key_ESC = 0;
key_SPACE = 1;
this.onEnterFrame = function () {
speed = Math.sqrt((vel.y * vel.y) + (vel.x * vel.x));
s_volume = speed * speed;
if (s_volume > 100) {
s_volume = 100;
}
if (Key.isDown(80)) {
key_P++;
if (key_P == 1) {
if ((!start_lvl) && (!quit_level)) {
if (pause_game) {
pause_game = false;
} else {
pause_game = true;
}
}
}
} else {
key_P = 0;
}
if (Key.isDown(32)) {
if (key_SPACE == 0) {
if (start_lvl && (!quit_level)) {
pause_game = false;
start_lvl = false;
clearIntro();
}
}
key_SPACE = 1;
} else {
key_SPACE = 0;
}
if (Key.isDown(27)) {
key_ESC++;
if (key_ESC == 1) {
if (quit_level) {
quit_level_box.removeMovieClip();
quit_level = false;
if (!start_lvl) {
pause_game = false;
}
} else {
attachMovie("quit_level", "quit_level_box", this.getNextHighestDepth(), {_x:400, _y:240});
quit_level_box.m_yes.field.text = "Yes";
quit_level_box.m_no.field.text = "No";
quit_level_box.m_yes.onPress = function () {
level_info.removeMovieClip();
clearLevel();
quit_level_box.removeMovieClip();
ball.removeMovieClip();
finish.removeMovieClip();
description.removeMovieClip();
black_bg.removeMovieClip();
gotoAndStop ("select");
quit_level = false;
};
quit_level_box.m_no.onPress = function () {
quit_level_box.removeMovieClip();
quit_level = false;
if (!start_lvl) {
pause_game = false;
}
};
quit_level = true;
pause_game = true;
}
}
} else {
key_ESC = 0;
}
i = 1;
while (i <= slings) {
_root["line_" + i].clear();
_root["line_" + i].lineStyle(2, 0);
if ((((ball._y + radius) < _root["node1_" + i]._y) and (ball._x > _root["node1_" + i]._x)) and (ball._x < _root["node2_" + i]._x)) {
_root["ready" + i] = true;
} else if ((ball._x < _root["node1_" + i]._x) or (ball._x > _root["node2_" + i]._x)) {
_root["ready" + i] = false;
}
if (((((ball._y + radius) >= _root["node1_" + i]._y) and (ball._x > _root["node1_" + i]._x)) and (ball._x < _root["node2_" + i]._x)) and _root["ready" + i]) {
get_sling = i;
_root["slinging" + i] = true;
} else if ((ball._y + radius) < _root["node1_" + i]._y) {
_root["slinging" + i] = false;
}
if (_root["slinging" + i]) {
_root["forced" + get_sling] = true;
var _local6 = ball._x - _root["node1_" + get_sling]._x;
var _local4 = ball._y - _root["node1_" + get_sling]._y;
var _local5 = _root["node2_" + get_sling]._x - ball._x;
var _local3 = _root["node2_" + get_sling]._y - ball._y;
var _local7 = Math.sqrt((_local6 * _local6) + (_local4 * _local4));
var _local8 = Math.sqrt((_local5 * _local5) + (_local3 * _local3));
angle1 = Math.atan2(_local4, _local6);
angle2 = Math.atan2(_local3, _local5);
var _local12 = Math.cos(angle1 + (Math.PI/2)) * (radius + 0.7);
var _local11 = Math.sin(angle1 + (Math.PI/2)) * (radius + 0.7);
var _local9 = Math.cos(angle2 + (Math.PI/2)) * (radius + 0.7);
var _local10 = Math.sin(angle2 + (Math.PI/2)) * (radius + 0.7);
angle1 = angle1 + Math.sin(radius / _local7);
angle2 = angle2 + (Math.sin(radius / _local8) * -1);
_root["line_" + i].moveTo(_root["node1_" + i]._x, _root["node1_" + i]._y);
_root["line_" + i].lineTo(ball._x + _local12, ball._y + _local11);
_root["line_" + i].moveTo(_root["node2_" + i]._x, _root["node2_" + i]._y);
_root["line_" + i].lineTo(ball._x + _local9, ball._y + _local10);
}
if (!_root["slinging" + i]) {
_root["forced" + i] = false;
_root["line_" + i].moveTo(_root["node1_" + i]._x, _root["node1_" + i]._y);
_root["line_" + i].lineTo(_root["node2_" + i]._x, _root["node2_" + i]._y);
}
acc.x = 0;
acc.y = 0;
acc.y = gravity;
if (_root["forced" + i]) {
if (!pause_game) {
acc.x = acc.x + (((_local7 * Math.sin(angle2)) * elastic) * slings);
acc.y = acc.y + ((((-_local7) * Math.cos(angle1)) * elastic) * slings);
acc.x = acc.x + (((_local8 * Math.sin(angle1)) * elastic) * slings);
acc.y = acc.y + ((((-_local8) * Math.cos(angle2)) * elastic) * slings);
if ((ball._x - radius) < _root["node1_" + i]._x) {
vel.x = vel.x + 0.5;
} else if ((ball._x + radius) > _root["node2_" + i]._x) {
vel.x = vel.x - 0.5;
}
}
}
vel.x = vel.x + (acc.x / slings);
vel.y = vel.y + (acc.y / slings);
i++;
}
if ((get_sling > 0) && (!_root["slinging" + get_sling])) {
if (!mute) {
boing.setVolume(s_volume);
boing.start();
}
get_sling = 0;
}
};
var s_volume = 0;
ball.onEnterFrame = function () {
if (!pause_game) {
if (Key.isDown(37)) {
vel.x = vel.x - 0.1;
} else if (Key.isDown(39)) {
vel.x = vel.x + 0.1;
}
tick++;
ball._x = ball._x + vel.x;
ball._y = ball._y + vel.y;
gravity = 0.2;
} else {
acc.x = 0;
acc.y = 0;
gravity = 0;
}
if ((ball._x - radius) <= 0) {
ball._x = 0 + radius;
vel.x = 0;
} else if ((ball._x + radius) >= 800) {
ball._x = 800 - radius;
vel.x = 0;
}
if ((ball._y - radius) <= 0) {
ball._y = 0 + radius;
vel.y = 0;
} else if (((ball._y - radius) >= 480) && (get_sling == 0)) {
resetLevel();
}
var _local3 = 0;
var _local5 = 0;
var _local4 = 0;
x = 1;
while (x < precision) {
spot_x = this._x + (radius * Math.sin(x * ((Math.PI*2) / precision)));
spot_y = this._y - (radius * Math.cos(x * ((Math.PI*2) / precision)));
if (terrain.hitTest(spot_x, spot_y, true)) {
if ((_local3 == 0) && (!mute)) {
bounce.setVolume(s_volume);
bounce.start();
}
_local3++;
_local5 = _local5 + spot_x;
_local4 = _local4 + spot_y;
}
if (death.hitTest(spot_x, spot_y, true)) {
resetLevel();
}
x++;
}
if (_local3 > 0) {
last_hit_x = old_x;
last_hit_y = old_y;
last_vel_x = vel.x;
last_vel_y = vel.y;
ball.dir = Math.atan(vel.y / (vel.x * -1)) / (Math.PI/180);
if ((vel.x * -1) < 0) {
ball.dir = ball.dir + 180;
}
if (((vel.x * -1) >= 0) && (vel.y < 0)) {
ball.dir = ball.dir + 360;
}
last_x = int((last_hit_x + last_vel_x) * 10) / 10;
now_x = int(ball._x * 10) / 10;
last_y = int((last_hit_y + last_vel_y) * 10) / 10;
now_y = int(ball._y * 10) / 10;
spot_x = _local5 / _local3;
spot_y = _local4 / _local3;
x_cat = spot_x - this._x;
y_cat = spot_y - this._y;
ball_coll = Math.atan(y_cat / x_cat) / (Math.PI/180);
if (x_cat < 0) {
ball_coll = ball_coll + 180;
}
if ((x_cat >= 0) && (y_cat < 0)) {
ball_coll = ball_coll + 360;
}
ground_rotation = ball_coll - 90;
if (ground_rotation < 0) {
ground_rotation = ground_rotation + 180;
}
bounce_angle = (180 - ball.dir) - (2 * ground_rotation);
if (bounce_angle < 0) {
bounce_angle = bounce_angle + 360;
}
vel.x = (speed * 0.9) * Math.cos((bounce_angle * Math.PI) / 180);
vel.y = ((speed * 0.9) * Math.sin((bounce_angle * Math.PI) / 180)) * -1;
this._x = old_x;
this._y = old_y;
if ((last_x == now_x) && (last_y == now_y)) {
hit_count++;
}
if (hit_count > 5) {
resetLevel();
}
} else {
old_x = this._x;
old_y = this._y;
hit_count = 0;
}
if (ball.hitTest(finish) && (coins_collected >= coins_needed)) {
i = 0;
while (i < 10) {
_root["ready" + i] = false;
i++;
}
i = 0;
while (i < 10) {
_root["slinging" + i] = false;
i++;
}
if (!mute) {
level_complete.start();
}
clearLevel();
if ((level == last_level) && (campaign)) {
ball.removeMovieClip();
finish.removeMovieClip();
level_count.removeMovieClip();
level_info.removeMovieClip();
gotoAndStop ("submit");
} else if ((level == 30) && (user_so.data.levels_completed == 30)) {
ball.removeMovieClip();
finish.removeMovieClip();
level_count.removeMovieClip();
level_info.removeMovieClip();
gotoAndStop ("congrats");
} else if (campaign) {
level++;
drawLevel(level, false);
} else {
ball.removeMovieClip();
finish.removeMovieClip();
level_count.removeMovieClip();
level_info.removeMovieClip();
gotoAndStop ("submit");
}
if (level >= user_so.data.levels_completed) {
user_so.data.levels_completed = level + 1;
}
}
if (vel.x >= 10) {
vel.x = 10;
} else if (vel.x <= -10) {
vel.x = -10;
}
time_min = Math.floor((tick / 40) / 60);
time_sec = Math.floor(tick / 40) - (60 * time_min);
time_milli = Math.floor((tick * 2.5) - (100 * Math.floor(tick / 40)));
if (time_milli < 10) {
output_milli = "0" + time_milli;
} else {
output_milli = time_milli;
}
if (time_sec < 10) {
output_sec = "0" + time_sec;
} else {
output_sec = time_sec;
}
if (time_min < 10) {
output_min = "0" + time_min;
} else {
output_min = time_min;
}
output_time = (((output_min + ":") + output_sec) + ".") + output_milli;
if (pause_game) {
terrain.stop();
death.stop();
} else {
terrain.play();
death.play();
}
};
_root.attachMovie("text_box", "level_info", this.getNextHighestDepth(), {_x:10, _y:420});
level_info.onEnterFrame = function () {
this.textbox.text = ((((((((("Level " + level) + "\nCoins: ") + coins_collected) + "/") + coins_needed) + " ") + "(") + coins) + ")\n") + output_time;
};
Frame 59
gotoAndStop ("game");
Frame 60
m_submit.field.text = "Submit score";
m_menu.field.text = "Menu";
m_submit.onPress = function () {
gotoAndStop ("submit");
};
m_menu.onPress = function () {
gotoAndStop ("menu");
};
this.onEnterFrame = function () {
};
Frame 69
gotoAndStop ("congrats");
Frame 70
function submitScore() {
if (submit_score.playerName.text) {
if (campaign) {
level_mode = skill;
} else {
level_mode = level;
}
player_playing = true;
score_submit = true;
sendData.lvl = level_mode;
sendData.username = submit_score.playerName.text;
sendData.score = output_time;
sendData.timestamp = tick * 49;
sendData.sendAndLoad("http://www.ripex.no/games/sling-jumper-2/php/score_save.php", receiveData, "POST");
user_so.data.username = submit_score.playerName.text;
gotoAndStop ("loading");
} else {
gotoAndStop ("no_name");
}
}
submit_score.playerName.text = user_so.data.username;
submit_score.m_submit.field.text = "Submit";
submit_score.m_view.field.text = "View scores";
submit_score.m_menu.field.text = "Menu";
this.onEnterFrame = function () {
if (Selection.getFocus(submit_score.playerName)) {
if (Key.isDown(13)) {
submitScore();
}
} else if (Key.isDown(32)) {
_root.level++;
_root.gotoAndStop("game");
}
};
submit_score.timeScore.text = output_time;
submit_score.m_view.onPress = function () {
score_submit = false;
player_playing = true;
gotoAndStop ("scoreboard");
};
submit_score.m_menu.onPress = function () {
gotoAndStop ("select");
};
sendData = new LoadVars();
receiveData = new LoadVars();
submit_score.m_submit.onPress = function () {
submitScore();
};
receiveData.onLoad = function () {
if (this.success) {
gotoAndStop ("scoreboard");
} else {
gotoAndStop ("error");
}
};
Frame 79
gotoAndStop ("submit");
Frame 89
gotoAndStop ("loading");
Frame 90
m_back.field.text = "Back";
m_back.onPress = function () {
gotoAndStop ("submit");
};
Frame 99
gotoAndStop ("error");
Frame 100
m_back.field.text = "Back";
m_back.onPress = function () {
gotoAndStop ("submit");
};
Frame 109
gotoAndStop ("no_name");
Frame 110
function clear_fields() {
}
scoreboard.m_retry.field.text = "Retry";
scoreboard.m_menu.field.text = "Menu";
scoreboard.m_retry.onPress = function () {
gotoAndStop ("game");
};
scoreboard.m_menu.onPress = function () {
gotoAndStop ("select");
};
scoreboard.m_next.onPress = function () {
level++;
gotoAndStop ("game");
};
if (campaign) {
level_mode = skill;
scoreboard.score_level.text = ("( " + skill) + " challenge )";
} else {
level_mode = level;
scoreboard.score_level.text = ("( Level " + level) + " )";
}
time_span = 0;
var xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = function () {
getting._visible = false;
};
if (score_submit) {
scoreboard.style_lines._alpha = 100;
xml.load((((((("http://www.ripex.no/games/sling-jumper-2/php/score_list.php?time=" + time_span) + "&level=") + level_mode) + "&name=") + user_so.data.username) + "&score=") + output_time);
} else {
scoreboard.style_lines._alpha = 0;
xml.load((("http://www.ripex.no/games/sling-jumper-2/php/score_list.php?time=" + time_span) + "&level=") + level_mode);
}
this.onEnterFrame = function () {
if (time_span == 0) {
scoreboard.sc_today.gotoAndStop(2);
} else {
scoreboard.sc_today.gotoAndStop(1);
}
if (time_span == 1) {
scoreboard.sc_week.gotoAndStop(2);
} else {
scoreboard.sc_week.gotoAndStop(1);
}
if (time_span == 2) {
scoreboard.sc_month.gotoAndStop(2);
} else {
scoreboard.sc_month.gotoAndStop(1);
}
if (time_span == 3) {
scoreboard.sc_all.gotoAndStop(2);
} else {
scoreboard.sc_all.gotoAndStop(1);
}
scoreboard.sc_today.btn_text.text = "Today";
scoreboard.sc_week.btn_text.text = "This week";
scoreboard.sc_month.btn_text.text = "This month";
scoreboard.sc_all.btn_text.text = "All time";
var _local1 = xml.childNodes[time_span].childNodes;
i = 0;
while (i < (_local1.length - 1)) {
scoreboard["sc_row_" + i].sc_place.text = i + 1;
scoreboard["sc_row_" + i].sc_name.text = _local1[i].attributes.name;
scoreboard["sc_row_" + i].sc_score.text = _local1[i].attributes.score;
scoreboard["sc_row_" + i].sc_submitted.text = _local1[i].attributes.submitted;
if ((i == 0) && (score_submit)) {
scoreboard.sc_row_10.sc_place.text = _local1[_local1.length - 1].attributes.place;
scoreboard.sc_row_10.sc_name.text = _local1[_local1.length - 1].attributes.name;
scoreboard.sc_row_10.sc_score.text = _local1[_local1.length - 1].attributes.score;
scoreboard.sc_row_10.sc_submitted.text = _local1[_local1.length - 1].attributes.submitted;
}
i++;
}
i = _local1.length - 1;
while (i < 10) {
scoreboard["sc_row_" + i].sc_place.text = "";
scoreboard["sc_row_" + i].sc_name.text = "";
scoreboard["sc_row_" + i].sc_score.text = "";
scoreboard["sc_row_" + i].sc_submitted.text = "";
i++;
}
};
scoreboard.sc_today.onPress = function () {
clear_fields();
time_span = 0;
};
scoreboard.sc_week.onPress = function () {
clear_fields();
time_span = 1;
};
scoreboard.sc_month.onPress = function () {
clear_fields();
time_span = 2;
};
scoreboard.sc_all.onPress = function () {
clear_fields();
time_span = 3;
};
Frame 119
gotoAndStop ("scoreboard");
Symbol 15 MovieClip [button] Frame 1
this.onRollOver = function () {
var _local1 = new Color(field);
_local1.setRGB(26316);
};
this.onRollOut = function () {
var _local1 = new Color(field);
_local1.setRGB(0);
};
Symbol 19 MovieClip [mute] Frame 1
stop();
Symbol 194 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.5");
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local3);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
}
Symbol 139 MovieClip [button_left] Frame 1
this.onRollOver = function () {
var _local1 = new Color(field);
_local1.setRGB(26316);
};
this.onRollOut = function () {
var _local1 = new Color(field);
_local1.setRGB(0);
};
Symbol 141 MovieClip [button_right] Frame 1
this.onRollOver = function () {
var _local1 = new Color(field);
_local1.setRGB(26316);
};
this.onRollOut = function () {
var _local1 = new Color(field);
_local1.setRGB(0);
};
Symbol 158 MovieClip Frame 1
stop();
this.onRollOver = function () {
var _local1 = new Color(btn_text);
_local1.setRGB(26316);
};
this.onRollOut = function () {
var _local1 = new Color(btn_text);
_local1.setRGB(0);
};
Symbol 177 MovieClip [score_list] Frame 1
if (_root.level < 30) {
t = attachMovie("button_right", "m_next", this.getNextHighestDepth(), {_x:285.4, _y:153.8});
t.field.text = "Next";
t._xscale = 40;
t.onPress = function () {
_root.level++;
_root.gotoAndStop("game");
};
}
retry = attachMovie("button_left", "m_retry", this.getNextHighestDepth(), {_x:15.9, _y:152.9});
retry.field.text = "Retry";
retry._xscale = 45;
retry.onPress = function () {
if (_root.campaign) {
if (_root.skill == "Normal") {
_root.level = 1;
} else if (_root.skill == "Hard") {
_root.level = 11;
} else if (_root.skill == "Expert") {
_root.level = 21;
}
}
_root.gotoAndStop("game");
};
Symbol 191 MovieClip Frame 1
i = 0;
while (i < 10) {
t = attachMovie("sc_row", "sc_row_" + i, 10000 + i, {_x:17.1, _y:96.7 + (23.5 * i)});
i++;
}
if (_root.player_playing) {
if (_root.level < 30) {
temp = attachMovie("button_right", "m_next", this.getNextHighestDepth(), {_x:383.1, _y:397.3});
temp.field.text = "Next";
temp._xscale = 40;
temp.onPress = function () {
_root.level++;
_root.gotoAndStop("game");
};
}
retry = attachMovie("button_left", "m_retry", this.getNextHighestDepth(), {_x:17.1, _y:366.3});
retry.field.text = "Retry";
retry._xscale = 45;
retry.onPress = function () {
if (_root.campaign) {
if (_root.skill == "Normal") {
_root.level = 1;
} else if (_root.skill == "Hard") {
_root.level = 11;
} else if (_root.skill == "Expert") {
_root.level = 21;
}
}
_root.gotoAndStop("game");
};
}