Frame 1
_root.once = false;
NewgroundsAPI.connectMovie(2901);
Stage.showMenu = false;
startDrag (_root.cursor, true);
Mouse.hide();
Frame 2
startDrag (_root.cursor, true);
Instance of Symbol 118 MovieClip in Frame 2
on (release) {
NewgroundsAPI.loadMySite();
}
Frame 3
if (_root.once == false) {
_root.once = true;
var wait = false;
var goto_text = Test;
var voice_text = "";
var level_nr = 1;
var mission_text = "It has been a long day, time to relax and watch some television.";
var mini_1_complete = false;
var mini_1_started = false;
var mini_1_rotate = 0;
var another_volume22 = 100;
var random_var2 = false;
var r_var1_boo = false;
var another_timer3 = 60;
_root.block._visible = false;
startDrag (_root.cursor, true);
stop();
Mouse.hide();
_root.sound_lightning = new Sound(this);
_root.sound_lightning.attachSound("lightning");
_root.sound_rain = new Sound("sound_MC_rain");
_root.sound_rain.attachSound("rain_loop");
_root.sound_shower = new Sound("sound_MC_shower");
_root.sound_shower.attachSound("shower");
_root.sound_heart = new Sound("sound_MC_heart");
_root.sound_heart.attachSound("heart");
_root.sound_breath = new Sound("sound_MC_breath");
_root.sound_breath.attachSound("breath");
_root.sound_glass = new Sound(this);
_root.sound_glass.attachSound("glass");
_root.sound_door_locked = new Sound(this);
_root.sound_door_locked.attachSound("door_locked");
_root.sound_lever = new Sound(this);
_root.sound_lever.attachSound("lever");
_root.sound_bulb = new Sound(this);
_root.sound_bulb.attachSound("bulb");
_root.sound_scary1 = new Sound(this);
_root.sound_scary1.attachSound("scary1");
_root.sound_scary2 = new Sound(this);
_root.sound_scary2.attachSound("scary2");
_root.sound_scary3 = new Sound(this);
_root.sound_scary3.attachSound("scary3");
_root.sound_rain.start(0, 9999);
item_look_on = function (f_type, f_voice_text) {
if (wait == false) {
if (f_type == "use") {
_root.cursor.gotoAndStop("use");
}
if (f_type == "look") {
_root.cursor.gotoAndStop("look");
}
_root.block._visible = true;
_root.voice_text = f_voice_text;
}
};
item_look_click = function (f_type, f_voice_nr) {
if (wait == false) {
}
};
mission_proceed = function (f_text) {
_root.mission_text = f_text;
_root.mission_text_effect.gotoAndPlay("first");
_root.sound_voice.stop("sound_voice");
_root.sound_voice = new Sound(this);
_root.sound_voice.attachSound(_root.level_nr);
_root.sound_voice.start();
_root.level_nr++;
_root.voice_text = "";
_root.block._visible = false;
};
item_look_off = function () {
if (wait == false) {
_root.voice_text = "";
_root.cursor.gotoAndStop("standard");
_root.block._visible = false;
}
};
goto_on = function (goto_description, mc_path) {
if (wait == false) {
mc_path = mc_path.slice(1);
_root.cursor.gotoAndStop("goto");
_root.goto_text = goto_description;
_root[mc_path].gotoAndStop("hover");
}
};
goto_click = function (f_location, f_blackout) {
if (wait == false) {
_root.sound_voice.stop("sound_voice");
_root.gotoAndStop(f_location);
_root.cursor.gotoAndStop("standard");
if (f_blackout == undefined) {
_root.SE_blackout.gotoAndPlay(1);
}
}
};
goto_off = function (mc_path) {
if (wait == false) {
mc_path = mc_path.slice(1);
_root.cursor.gotoAndStop("standard");
_root[mc_path].gotoAndStop("normal");
}
};
}
onMouseMove = function () {
Mouse.hide();
};
enterFrame_MC.onEnterFrame = function () {
if (level_nr == 7) {
if (random_var2 == false) {
_root.sound_heart.start(0, 9999);
_root.sound_heart.setVolume(25);
}
random_var2 = true;
}
if (_root.wait == true) {
_root.cursor.gotoAndStop("wait");
}
sound_voice.onSoundComplete = function () {
_root.wait = false;
_root.cursor.gotoAndStop("standard");
};
if (_root.scene_11 == true) {
if (!(another_volume22 === 0)) {
_root.sound_heart.setVolume(another_volume22);
_root.another_volume22--;
} else if (_root.another_timer3 == 0) {
_root.scene_11 = false;
_root.killer_mc.play();
} else {
_root.another_timer3--;
}
}
if (_root.mini_1_started == true) {
if (mini_1_sounddown == true) {
if (r_var1_boo == false) {
_root.r_var1 = 100;
r_var1_boo = true;
}
_root.sound_shower.setVolume(r_var1);
r_var1 = r_var1 + -5;
if (r_var1 == 0) {
mini_1_sounddown = false;
_root.sound_shower.stop();
}
}
if (_root.mini_1_complete == false) {
sound_lever.onSoundComplete = function () {
_root.sound_lever_playing = false;
};
if (_root.mini_1_rotate < -36) {
_root.mini_1_won.play();
_root.mini_1_rotate = -37;
_root.mini_1_complete = true;
_root.wait = true;
_root.mission_text = "";
} else {
_root.justanother_volume = _root.mini_1_rotate - ((_root.mini_1_rotate * 2) * 3);
if (_root.justanother_volume > 100) {
_root.justanother_volume = 100;
}
_root.valve_valve._rotation = _root.mini_1_rotate * 10;
_root.sound_volume = _root.justanother_volume;
_root.sound_shower.setVolume(_root.sound_volume);
}
}
}
};
_root.sound_rain.setVolume(100);
if (!(_root.level_nr === 1)) {
_root.living_tv.gotoAndStop("signal");
}
if (!(_root.level_nr === 1)) {
_root.mission_1._visible = false;
}
living_picture.onRollOver = function () {
_root.item_look_on("look", "Just a picture I bought some months ago. I am not sure what is is supposed to look like.");
};
living_picture.onPress = function () {
_root.item_look_click("look");
};
living_picture.onRollOut = (living_picture.onDragOut = function () {
_root.item_look_off();
});
living_tv.onRollOver = function () {
_root.item_look_on("look", "My new LCD television. 5000$ for something that only looks half as good as my old CRT.");
};
living_tv.onPress = function () {
_root.item_look_click("look");
};
living_tv.onRollOut = (living_tv.onDragOut = function () {
_root.item_look_off();
});
living_window.onRollOver = function () {
_root.item_look_on("look", "Argh, god forbid good weather when it is Halloween...");
};
living_window.onPress = function () {
_root.item_look_click("look");
};
living_window.onRollOut = (living_window.onDragOut = function () {
_root.item_look_off();
});
living_pumpkin.onRollOver = function () {
_root.item_look_on("look", "Argh, I am too lazy for this. Next year I am just going to buy a pre-carved pumpkin.");
};
living_pumpkin.onPress = function () {
_root.item_look_click("look");
};
living_pumpkin.onRollOut = (living_pumpkin.onDragOut = function () {
_root.item_look_off();
});
all_beer_1.onRollOver = (all_beer_2.onRollOver = (all_beer_3.onRollOver = function () {
_root.item_look_on("look", "This evening could be so much better if I had like 12 more of these.");
}));
all_beer_1.onPress = (all_beer_2.onPress = (all_beer_3.onPress = function () {
_root.item_look_click("look");
}));
all_beer_1.onRollOut = (all_beer_2.onRollOut = (all_beer_3.onRollOut = (all_beer_1.onDragOut = (all_beer_2.onDragOut = (all_beer_3.onDragOut = function () {
_root.item_look_off();
})))));
mission_1.onRollOver = function () {
_root.item_look_on("use", "< Press to change channel >");
};
mission_1.onPress = function () {
if (level_nr == 1) {
_root.mission_proceed("No signal... now what?");
_root.SE_lightning.play();
_root.living_tv.gotoAndStop("signal");
_root.living_window.play();
_root.sound_lightning.start();
_root.mission_1._visible = false;
_root.cursor.gotoAndStop("standard");
}
};
mission_1.onRollOut = (mission_1.onDragOut = function () {
_root.item_look_off();
});
if (level_nr > 1) {
}
if (level_nr == 4) {
_root.mission_proceed("Might as well prepare for night, begining with a good shower. The clean-up can wait.");
}
if (level_nr == 7) {
_root.mission_proceed("\"Die\"?... get outside, FAST!");
_root.sound_heart.setVolume(50);
}
if (level_nr == 10) {
_root.mission_proceed("Hurry up and find the phone!");
_root.scene_11 = true;
}
Instance of Symbol 134 MovieClip "all_beer_3" in Frame 3
onClipEvent (load) {
if (_root.level_nr > 2) {
this.gotoAndStop("fallen");
}
}
Instance of Symbol 137 MovieClip "all_beer_1" in Frame 3
onClipEvent (load) {
if (_root.level_nr > 2) {
this.gotoAndStop("fallen");
}
}
Instance of Symbol 139 MovieClip "all_beer_2" in Frame 3
onClipEvent (load) {
if (_root.level_nr > 2) {
this._visible = false;
}
}
Instance of Symbol 172 MovieClip "living_pumpkin" in Frame 3
onClipEvent (load) {
if (_root.level_nr > 6) {
this.gotoAndStop("carved");
}
}
Instance of Symbol 226 MovieClip "dir_down" in Frame 3
on (rollOver, dragOver) {
_root.goto_on("Go to the hall", _target);
}
on (press) {
_root.goto_click("Hall");
}
on (rollOut) {
_root.goto_off(this._target);
}
onClipEvent (load) {
if (_root.level_nr > 9) {
this._visible = false;
} else {
this._visible = true;
}
}
Instance of Symbol 230 MovieClip "look_down" in Frame 3
on (rollOver, dragOver) {
_root.goto_on("Look down", _target);
}
on (press) {
_root.goto_click("Livingroom_down", false);
}
on (rollOut) {
_root.goto_off(this._target);
}
onClipEvent (load) {
if (_root.level_nr == 3) {
this._visible = true;
} else {
this._visible = false;
}
}
Frame 12
_root.sound_rain.setVolume(100);
if (_root.level_nr > 3) {
_root.living_tv.gotoAndStop("signal");
}
all_beer_4.onRollOver = function () {
_root.item_look_on("look", "I will clean this up... another day.");
};
all_beer_4.onPress = function () {
_root.item_look_click("look");
};
all_beer_4.onRollOut = (all_beer_4.onDragOut = function () {
_root.item_look_off();
});
if (level_nr == 3) {
_root.mission_proceed("Not again... Problably another cat which found its way in here. The bottle was at least empty.");
}
Instance of Symbol 240 MovieClip "all_beer_4" in Frame 12
onClipEvent (load) {
if (_root.level_nr > 3) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 230 MovieClip "look_down" in Frame 12
on (rollOver, dragOver) {
_root.goto_on("Look up", _target);
}
on (press) {
_root.goto_click("Livingroom", false);
}
on (rollOut) {
_root.goto_off(this._target);
}
Frame 21
_root.sound_rain.setVolume(50);
hall_mat.onRollOver = function () {
_root.item_look_on("look", "My favorit mat, imported from Denmark. The text says \"fuck off\".");
};
hall_mat.onPress = function () {
_root.item_look_click("look");
};
hall_mat.onRollOut = (hall_mat.onDragOut = function () {
_root.item_look_off();
});
hall_shoe.onRollOver = function () {
_root.item_look_on("look", "No need to take my shoes on, I am not going anywhere.");
};
hall_shoe.onPress = function () {
_root.item_look_click("look");
};
hall_shoe.onRollOut = (hall_shoe.onDragOut = function () {
_root.item_look_off();
});
hall_wardrobe.onRollOver = function () {
_root.item_look_on("look", "It is too hot around here to use a jacket and my \"pusher\" hoodie is more than comfortable.");
};
hall_wardrobe.onPress = function () {
_root.item_look_click("look");
};
hall_wardrobe.onRollOut = (hall_wardrope.onDragOut = function () {
_root.item_look_off();
});
hall_bedroom.onRollOver = function () {
_root.item_look_on("look", "My bedroom, the light bulb broke a while ago so I can not walk around in there at night.");
};
hall_bedroom.onPress = function () {
_root.item_look_click("look");
};
hall_bedroom.onRollOut = (hall_bedroom.onDragOut = function () {
_root.item_look_off();
});
mission_8.onRollOver = function () {
if (level_nr == 8) {
_root.item_look_on("use", "< Open door >");
}
};
mission_8.onPress = function () {
if (level_nr == 8) {
_root.mission_proceed("Oh no, the door is locked and the key is gone! I need something defend myself with!");
_root.mission_8._visible = false;
_root.cursor.gotoAndStop("standard");
_root.sound_door_locked.start();
_root.sound_heart.setVolume(75);
}
};
mission_8.onRollOut = (mission_1.onDragOut = function () {
_root.item_look_off();
});
Instance of Symbol 261 MovieClip "hall_door" in Frame 21
onClipEvent (load) {
if (_root.level_nr > 6) {
this.gotoAndStop("first");
}
}
Instance of Symbol 226 MovieClip "dir_down" in Frame 21
on (rollOver, dragOver) {
_root.goto_on("Go to the livingroom", _target);
}
on (press) {
_root.goto_click("Livingroom");
}
on (rollOut) {
_root.goto_off(this._target);
}
Instance of Symbol 265 MovieClip "dir_left" in Frame 21
on (rollOver, dragOver) {
_root.goto_on("Go to the bathroom", _target);
}
on (press) {
_root.goto_click("Toilet");
}
on (rollOut) {
_root.goto_off(this._target);
}
Instance of Symbol 226 MovieClip "dir_left2" in Frame 21
on (rollOver, dragOver) {
_root.goto_on("Go to the kitchen", _target);
}
on (press) {
_root.goto_click("Kitchen");
}
on (rollOut) {
_root.goto_off(this._target);
}
Frame 31
_root.sound_rain.setVolume(50);
hall_shoe.onRollOver = function () {
_root.item_look_on("look", "No need to take my shoes on, I am not going anywhere.");
};
hall_shoe.onPress = function () {
_root.item_look_click("look");
};
hall_shoe.onRollOut = (hall_shoe.onDragOut = function () {
_root.item_look_off();
});
hall_wardrobe.onRollOver = function () {
_root.item_look_on("look", "It is too hot around here to use a jacket and my \"pusher\" hoodie is more than comfortable.");
};
hall_wardrobe.onPress = function () {
_root.item_look_click("look");
};
hall_wardrobe.onRollOut = (hall_wardrope.onDragOut = function () {
_root.item_look_off();
});
hall_bedroom.onRollOver = function () {
_root.item_look_on("look", "My bedroom, the light bulb broke a while ago so I can not walk around in there at night.");
};
hall_bedroom.onPress = function () {
_root.item_look_click("look");
};
hall_bedroom.onRollOut = (hall_bedroom.onDragOut = function () {
_root.item_look_off();
});
Instance of Symbol 277 MovieClip "dir_down" in Frame 31
on (rollOver, dragOver) {
_root.goto_on("Go to the livingroom", _target);
}
on (press) {
_root.goto_click("Livingroom");
}
on (rollOut) {
_root.goto_off(this._target);
}
Instance of Symbol 265 MovieClip "dir_right2" in Frame 31
on (rollOver, dragOver) {
_root.goto_on("Go to the kitchen", _target);
}
on (press) {
_root.goto_click("Kitchen");
}
on (rollOut) {
_root.goto_off(this._target);
}
Instance of Symbol 226 MovieClip "dir_right" in Frame 31
on (rollOver, dragOver) {
_root.goto_on("Go to the bathroom", _target);
}
on (press) {
_root.goto_click("Toilet");
}
on (rollOut) {
_root.goto_off(this._target);
}
Frame 41
_root.sound_rain.setVolume(100);
kitchen_window.onRollOver = function () {
_root.item_look_on("look", "It does not matter which room I am standing in, the weather is still shitty.");
};
kitchen_window.onPress = function () {
_root.item_look_click("look");
};
kitchen_window.onRollOut = (kitchen_window.onDragOut = function () {
_root.item_look_off();
});
kitchen_glass.onRollOver = function () {
_root.item_look_on("look", "I have been drinking from this glass even more than there are Chinese people.");
};
kitchen_glass.onPress = function () {
_root.item_look_click("look");
};
kitchen_glass.onRollOut = (kitchen_glass.onDragOut = function () {
_root.item_look_off();
});
kitchen_cutboard.onRollOver = function () {
_root.item_look_on("look", "A burger was supposed to be made out of this mess.");
};
kitchen_cutboard.onPress = function () {
_root.item_look_click("look");
};
kitchen_cutboard.onRollOut = (kitchen_cutboard.onDragOut = function () {
_root.item_look_off();
});
kitchen_knifeholder.onRollOver = function () {
if (_root.level_nr > 6) {
_root.item_look_on("look", "Shit! All my knives are gone!");
} else {
_root.item_look_on("look", "Why do I even have all these knives?");
}
};
kitchen_knifeholder.onPress = function () {
_root.item_look_click("look");
};
kitchen_knifeholder.onRollOut = (kitchen_knifeholder.onDragOut = function () {
_root.item_look_off();
});
kitchen_fridge.onRollOver = function () {
_root.item_look_on("look", "Just a plain old refrigerator.");
};
kitchen_fridge.onPress = function () {
_root.item_look_click("look");
};
kitchen_fridge.onRollOut = (kitchen_fridge.onDragOut = function () {
_root.item_look_off();
});
if (level_nr == 2) {
_root.mission_proceed("Shiii..! Sounds like a glass or bottle broke in the living room.");
_root.sound_glass.start();
_root.sound_glass.setVolume(50);
}
if (level_nr == 9) {
_root.mission_proceed("FUCK! \"He\" took all the knives!.. Call the cops!");
_root.sound_heart.setVolume(100);
}
Instance of Symbol 286 MovieClip "kitchen_knifeholder" in Frame 41
onClipEvent (load) {
if (_root.level_nr > 6) {
this.gotoAndStop("first");
}
}
Instance of Symbol 226 MovieClip "dir_down" in Frame 41
on (rollOver, dragOver) {
_root.goto_on("Go to the hall", _target);
}
on (press) {
_root.goto_click("Hall_r");
}
on (rollOut) {
_root.goto_off(this._target);
}
Frame 51
_root.sound_rain.setVolume(25);
toilet_glass.onRollOver = function () {
_root.item_look_on("look", "You can see the hall I came from in the mirror.");
};
toilet_glass.onPress = function () {
_root.item_look_click("look");
};
toilet_glass.onRollOut = (toilet_glass.onDragOut = function () {
_root.item_look_off();
});
toilet_soap.onRollOver = function () {
_root.item_look_on("look", "I feel like an idiot, when I have to buy a product with a label that tells me what it is.");
};
toilet_soap.onPress = function () {
_root.item_look_click("look");
};
toilet_soap.onRollOut = (toilet_soap.onDragOut = function () {
_root.item_look_off();
});
toilet_toilet.onRollOver = function () {
_root.item_look_on("look", "... it is a toilet?");
};
toilet_toilet.onPress = function () {
_root.item_look_click("look");
};
toilet_toilet.onRollOut = (toilet_toilet.onDragOut = function () {
_root.item_look_off();
});
mission_5.onRollOver = function () {
if (level_nr == 5) {
_root.item_look_on("use", "< Take a shower >");
}
};
mission_5.onPress = function () {
if (level_nr == 5) {
_root.mission_proceed("Just turn the right valve a few times.");
_root.mission_5._visible = false;
_root.cursor.gotoAndStop("standard");
_root.gotoAndStop("mini_shower");
}
};
mission_5.onRollOut = (mission_1.onDragOut = function () {
_root.item_look_off();
});
Instance of Symbol 226 MovieClip "dir_down" in Frame 51
on (rollOver, dragOver) {
_root.goto_on("Go to the hall", _target);
}
on (press) {
_root.goto_click("Hall");
}
on (rollOut) {
_root.goto_off(this._target);
}
Frame 71
_root.sound_shower.start(0, 99999);
_root.sound_shower.setVolume(_root.sound_volume);
_root.sound_lever_playing = false;
_root.mini_1_started = true;
Instance of Symbol 321 MovieClip "valve_1" in Frame 71
on (rollOver, dragOver) {
_root.mini_1_rotate--;
_root.valve_2._visible = true;
this._visible = false;
if (_root.sound_lever_playing == false) {
if (_root.mini_1_complete == false) {
_root.sound_lever.start();
_root.sound_lever_playing = true;
}
}
}
Instance of Symbol 321 MovieClip "valve_2" in Frame 71
onClipEvent (load) {
this._visible = false;
}
on (rollOver, dragOver) {
_root.mini_1_rotate--;
_root.valve_3._visible = true;
this._visible = false;
if (_root.sound_lever_playing == false) {
if (_root.mini_1_complete == false) {
_root.sound_lever.start();
_root.sound_lever_playing = true;
}
}
}
Instance of Symbol 321 MovieClip "valve_3" in Frame 71
onClipEvent (load) {
this._visible = false;
}
on (rollOver, dragOver) {
_root.mini_1_rotate--;
_root.valve_4._visible = true;
this._visible = false;
if (_root.sound_lever_playing == false) {
if (_root.mini_1_complete == false) {
_root.sound_lever.start();
_root.sound_lever_playing = true;
}
}
}
Instance of Symbol 321 MovieClip "valve_4" in Frame 71
onClipEvent (load) {
this._visible = false;
}
on (rollOver, dragOver) {
_root.mini_1_rotate--;
_root.valve_1._visible = true;
this._visible = false;
if (_root.sound_lever_playing == false) {
if (_root.mini_1_complete == false) {
_root.sound_lever.start();
_root.sound_lever_playing = true;
}
}
}
Frame 82
_root.cursor.gotoAndStop("wait");
stopAllSounds();
_quality = "MEDIUM";
play();
Frame 503
_quality = "HIGH";
Frame 597
startDrag (_root.cursor, true);
Frame 758
stop();
Symbol 18 MovieClip [toilet_rain_animated] Frame 21
this.removeMovieClip(this);
Symbol 21 MovieClip [all_rain_animated_2] Frame 21
this.removeMovieClip(this);
Symbol 30 MovieClip [all_rain_animated] Frame 100
this.removeMovieClip(this);
Symbol 48 MovieClip Frame 40
stop();
Symbol 62 Button
on (press) {
tellTarget (_root) {
nextFrame();
};
}
Symbol 63 Button
on (press) {
gotoAndStop ("end");
_root.play();
}
Instance of Symbol 38 MovieClip in Symbol 64 MovieClip Frame 1
onClipEvent (load) {
_root.stop();
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndStop("lastframe");
}
}
onClipEvent (enterFrame) {
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndPlay("loaded");
}
}
Symbol 64 MovieClip Frame 101
play();
Symbol 64 MovieClip Frame 165
stop();
Symbol 70 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 75 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 77 MovieClip Frame 1
function startAd(ngad_url) {
trace("opening " + ngad_url);
System.security.allowDomain("70.87.128.99");
System.security.allowInsecureDomain("70.87.128.99");
System.security.allowDomain("ads.shizmoo.com");
System.security.allowInsecureDomain("ads.shizmoo.com");
System.security.allowDomain("www.cpmstar.com");
System.security.allowInsecureDomain("www.cpmstar.com");
System.security.allowDomain("server.cpmstar.com");
System.security.allowInsecureDomain("server.cpmstar.com");
var ngads_redirect = new XML();
ngads_redirect.ignoreWhite = true;
ngads_redirect.onLoad = function (success) {
trace("[NEWGROUNDS FLASH ADS] :: You may get a 'Security Sandbox Violation' ... this is normal, do not freak out!");
if (success) {
ng_ad.loadMovie(ngads_redirect.toString(), "GET");
}
};
ngads_redirect.load(ngad_url);
}
if (NewgroundsAPI.getAdURL()) {
startAd(NewgroundsAPI.getAdURL());
}
NewgroundsAPI.onAdsApproved = function (ad_url) {
startAd(ad_url);
};
stop();
Symbol 89 MovieClip Frame 1
stop();
Symbol 358 MovieClip [__Packages.NewgroundsAPI] Frame 0
class NewgroundsAPI
{
static var tracker_id, host, version, debug, error_format, header_format, normal_format, link_format;
function NewgroundsAPI () {
}
static function connectMovie(id) {
if (!id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else if (!tracker_id) {
SendMessage("Connecting to API gateway...");
tracker_id = id;
host = _url.split("/")[2].toLowerCase();
if (host.length < 1) {
host = "localhost";
}
var _local2 = new Object();
SendEvent(MOVIE_VIEWS);
}
}
static function setMovieVersion(movie_version) {
if (!movie_version) {
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = movie_version;
}
}
static function debugMode() {
debug = true;
}
static function addCustomEvent(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else if (!stat_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[stat_name] = CUSTOM_STATS + stat_id;
SendMessage("Created custom event: " + stat_name);
}
}
static function addCustomLink(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else if (!stat_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[stat_name] = CUSTOM_STATS + stat_id;
SendMessage((("Created custom link " + stat_id) + ": ") + stat_name);
}
}
static function loadMySite() {
SendLink(AUTHOR_SITE);
}
static function loadNewgrounds(special) {
if (special) {
var _local1 = {page:special};
}
SendLink(NEWGROUNDS, _local1);
}
static function logCustomEvent(event_name) {
if (!event_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else if (!custom_events[event_name]) {
SendError("Attempted to log undefined custom event: " + event_name);
} else {
SendEvent(custom_events[event_name]);
}
}
static function loadCustomLink(link_name) {
if (!link_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else if (!custom_links[link_name]) {
SendError("Attempted to open undefined custom link: " + link_name);
} else {
SendLink(custom_links[link_name]);
}
}
static function getAdURL() {
return(movie_options.ad_url);
}
static function getMovieURL() {
if (movie_options.movie_url) {
return(movie_options.movie_url);
}
return("Newgrounds.com");
}
static function getNewVersionURL() {
return((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + NEW_VERSION);
}
static function SendEvent(id) {
SendStat(id, false);
}
static function SendLink(id, extra) {
SendStat(id, true, extra);
}
static function ReadGatewayData(params) {
for (var _local2 in params) {
params[_local2] = unescape(params[_local2]);
movie_options[_local2] = params[_local2];
}
if (params.settings_loaded) {
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage(("Movie Identified as '" + movie_options.movie_name) + "'");
if (movie_options.message) {
SendMessage(movie_options.message);
}
if (movie_options.ad_url) {
SendMessage("Your movie has been approved to run Flash Ads");
onAdsApproved(movie_options.ad_url);
}
if (movie_options.movie_version and (movie_options.movie_version.toString() != version.toString())) {
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
onNewVersionAvailable(movie_options.movie_version, getMovieURL(), getNewVersionURL());
}
if (movie_options.deny_host) {
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
onDenyHost(host, getMovieURL(), getNewVersionURL());
}
if (movie_options.request_portal_url == 1) {
var _local4 = (((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_url);
var _local3 = new XML();
_local3.ignoreWhite = true;
_local3.load(_local4);
}
} else if (!movie_options.settings_loaded) {
SendError("Could not establish connection to the API gateway.");
}
}
static function SendStat(stat_id, open_in_browser, extra) {
if (!tracker_id) {
SendError("API calls cannot be made without a valid movie id.");
SendError("Did you remember to add the \"NewgroundsAPI.connectMovie()\" code?");
} else {
var _local7 = (((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id;
for (var _local9 in extra) {
_local7 = _local7 + ((("&" + escape(_local9)) + "=") + escape(extra[_local9]));
}
trace(_local7);
if (debug) {
_local7 = _local7 + "&debug=1";
}
if (open_in_browser) {
getURL (_local7, "_blank");
} else {
var _local10 = new XML();
_local10.ignoreWhite = true;
_local10.onLoad = function (success) {
var _local6 = new Object();
var _local3 = 0;
while (_local3 < this.firstChild.childNodes.length) {
var _local4 = this.firstChild.childNodes[_local3];
var _local5 = _local4.nodeName;
var _local2 = _local4.attributes.value;
if (_local2 == Number(_local2)) {
_local2 = Number(_local2);
}
_local6[_local5] = _local2;
_local3++;
}
NewgroundsAPI.ReadGatewayData(_local6);
};
_local10.load(_local7);
}
}
}
static function SendError(msg) {
trace("[NEWGROUNDS API ERROR] :: " + msg);
}
static function SendMessage(msg) {
trace("[NEWGROUNDS API] :: " + msg);
}
static function InitTextFormats() {
if (!error_format) {
error_format = new TextFormat();
error_format.font = "Arial Black";
error_format.size = 48;
error_format.color = 16711680 /* 0xFF0000 */;
}
if (!header_format) {
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.size = 24;
header_format.color = 16777215 /* 0xFFFFFF */;
}
if (!normal_format) {
normal_format = new TextFormat();
normal_format.font = "Arial";
normal_format.bold = true;
normal_format.size = 12;
normal_format.color = 16777215 /* 0xFFFFFF */;
}
if (!link_format) {
link_format = new TextFormat();
link_format.color = 16776960 /* 0xFFFF00 */;
link_format.underline = true;
}
}
static function onNewVersionAvailable(version, movie_url, redirect_url) {
InitTextFormats();
var _local2 = new Object();
_local2.x = Stage.width / 2;
_local2.y = Stage.height / 2;
_root.createEmptyMovieClip("NGAPI_new_version_overlay", _root.getNextHighestDepth());
_root.NGAPI_new_version_overlay.lineStyle(1, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(0, 70);
_root.NGAPI_new_version_overlay.moveTo(-10, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, -10);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.lineStyle(10, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(51);
_root.NGAPI_new_version_overlay.moveTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.createEmptyMovieClip("exit", 1000);
_root.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100);
_root.NGAPI_new_version_overlay.exit.beginFill(0, 50);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.endFill();
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 214, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 226, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 226, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 214, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.onMouseUp = function () {
if (_root.NGAPI_new_version_overlay.exit.hitTest(_root._xmouse, _root._ymouse)) {
_root.NGAPI_new_version_overlay.removeMovieClip();
}
};
var _local3 = (("Version " + version) + " is now available at:") + newline;
var _local5 = _local3.length;
_local3 = _local3 + movie_url;
var _local4 = _local3.length;
_root.NGAPI_new_version_overlay.createTextField("mouseblocker", 99, -10, -10, 1000, 1000);
_root.NGAPI_new_version_overlay.createTextField("newversion", 100, _local2.x - 210, _local2.y - 90, 400, 80);
_root.NGAPI_new_version_overlay.newversion.text = "New Version Available!";
_root.NGAPI_new_version_overlay.newversion.setTextFormat(header_format);
_root.NGAPI_new_version_overlay.createTextField("message", 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40);
_root.NGAPI_new_version_overlay.message.text = _local3;
_root.NGAPI_new_version_overlay.message.multiline = true;
_root.NGAPI_new_version_overlay.message.wordWrap = true;
_root.NGAPI_new_version_overlay.message.html = true;
_root.NGAPI_new_version_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_root.NGAPI_new_version_overlay.message.setTextFormat(_local5, _local4, link_format);
}
static function onDenyHost(hostname, movie_url, redirect_url) {
InitTextFormats();
_root.createEmptyMovieClip("NGAPI_deny_host_overlay", _root.getNextHighestDepth());
_root.NGAPI_deny_host_overlay.lineStyle(20, 0, 100);
_root.NGAPI_deny_host_overlay.beginFill(6684672);
_root.NGAPI_deny_host_overlay.moveTo(0, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, 0);
_root.NGAPI_deny_host_overlay.endFill();
var _local2 = ("This movie has not been approved for use on " + hostname) + ".";
_local2 = _local2 + "\r\rFor an aproved copy, please visit:\r";
var _local4 = _local2.length;
_local2 = _local2 + movie_url;
var _local3 = _local2.length;
_root.NGAPI_deny_host_overlay.createTextField("mousekill", 100, 0, 0, Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.createTextField("error", 101, (Stage.width - 400) / 2, (Stage.height / 2) - 100, 400, 200);
_root.NGAPI_deny_host_overlay.error.text = "ERROR!";
_root.NGAPI_deny_host_overlay.error.setTextFormat(error_format);
_root.NGAPI_deny_host_overlay.createTextField("message", 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200);
_root.NGAPI_deny_host_overlay.message.text = _local2;
_root.NGAPI_deny_host_overlay.message.multiline = true;
_root.NGAPI_deny_host_overlay.message.wordWrap = true;
_root.NGAPI_deny_host_overlay.message.html = true;
_root.NGAPI_deny_host_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_root.NGAPI_deny_host_overlay.message.setTextFormat(_local4, _local3, link_format);
}
static function isInstalled() {
return(true);
}
static function onAdsApproved(ad_url) {
}
static var movie_options = new Object();
static var custom_events = new Object();
static var custom_links = new Object();
static var MOVIE_VIEWS = 1;
static var AUTHOR_SITE = 2;
static var NEWGROUNDS = 3;
static var NEW_VERSION = 4;
static var CUSTOM_STATS = 50;
static var GATEWAY_URL = "http://www.ngads.com/gateway.php";
}
Symbol 118 MovieClip Frame 1
_root.stop();
Symbol 118 MovieClip Frame 110
_root.play();
Symbol 125 MovieClip Frame 1
this.onLoad = function () {
this.amount = 0;
this.ynr = 250;
this.ynr = 250;
};
this.onEnterFrame = function () {
if (amount == undefined) {
i = 0;
while (i < 90) {
this.amount++;
this.randomx = Math.round(Math.random() * 220);
this.randomy = Math.round(Math.random() * 250);
this.all_rain_animated = this.attachMovie("all_rain_animated", "all_rain_animated" + this.amount, this.getNextHighestDepth());
this.all_rain_animated._x = this.randomx;
this.all_rain_animated._y = this.randomy;
this.all_rain_animated.gotoAndPlay(random(99));
i++;
}
i2 = 0;
while (i2 < 150) {
this.amount++;
this.randomx = Math.round((Math.random() * 400) - 100);
this.randomy = Math.round((Math.random() * 20) + 255);
this.all_rain_animated = this.attachMovie("all_rain_animated_2", "all_rain_animated_2" + this.amount, this.getNextHighestDepth());
this.all_rain_animated._x = this.randomx;
this.all_rain_animated._y = this.randomy;
this.all_rain_animated.gotoAndPlay(random(20));
i2++;
}
}
i = 0;
while (i < 3) {
this.amount++;
this.randomx = Math.round(Math.random() * 220);
this.randomy = Math.round(Math.random() * 250);
this.all_rain_animated = this.attachMovie("all_rain_animated", "all_rain_animated" + this.amount, this.getNextHighestDepth());
this.all_rain_animated._x = this.randomx;
this.all_rain_animated._y = this.randomy;
i++;
}
i2 = 0;
while (i2 < 5) {
this.amount++;
this.randomx = Math.round((Math.random() * 400) - 100);
this.randomy = Math.round((Math.random() * 20) + 255);
this.all_rain_animated = this.attachMovie("all_rain_animated_2", "all_rain_animated_2" + this.amount, this.getNextHighestDepth());
this.all_rain_animated._x = this.randomx;
this.all_rain_animated._y = this.randomy;
i2++;
}
};
Instance of Symbol 124 MovieClip in Symbol 125 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 128 MovieClip Frame 1
stop();
Symbol 134 MovieClip Frame 1
stop();
Symbol 137 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 1
stop();
Symbol 172 MovieClip Frame 1
stop();
Symbol 174 MovieClip Frame 1
this._alpha = 0;
Symbol 194 MovieClip Frame 9
stop();
Symbol 198 MovieClip Frame 1
stop();
Symbol 198 MovieClip Frame 28
_root.gotoAndStop("end");
Symbol 203 MovieClip Frame 1
stop();
Symbol 207 MovieClip Frame 6
stop();
Symbol 212 MovieClip Frame 1
stop();
Symbol 212 MovieClip Frame 70
_root.mini_1_sounddown = true;
Symbol 212 MovieClip Frame 90
_root.gotoAndStop("Toilet");
Symbol 212 MovieClip Frame 95
_root.toilet_glass.gotoAndPlay("first");
Symbol 212 MovieClip Frame 110
stop();
Symbol 214 MovieClip Frame 30
stop();
Symbol 221 MovieClip Frame 1
stop();
Symbol 226 MovieClip Frame 1
stop();
Symbol 230 MovieClip Frame 1
stop();
Symbol 240 MovieClip Frame 1
stop();
Symbol 240 MovieClip Frame 2
prevFrame();
Symbol 261 MovieClip Frame 1
stop();
Symbol 265 MovieClip Frame 1
stop();
Symbol 277 MovieClip Frame 1
stop();
Symbol 286 MovieClip Frame 1
stop();
Symbol 290 MovieClip Frame 1
stop();
Symbol 309 MovieClip Frame 1
stop();
Symbol 309 MovieClip Frame 15
_root.sound_scary3.start();
Symbol 309 MovieClip Frame 60
_root.mission_proceed("... what the hell was that in the mirror?!");
_root.wait = false;
_root.cursor.gotoAndStop("standard");
Symbol 319 MovieClip Frame 1
onLoad = function () {
this.amount = 0;
this.ynr = 250;
this.ynr = 250;
};
onEnterFrame = function () {
this.nrrain = _root.mini_1_rotate - (_root.mini_1_rotate * 2);
this.nrrain = this.nrrain / 2;
i = 0;
while (i < this.nrrain) {
this.amount++;
this.randomx = 300 + (random(15) - random(15));
this.toilet_rain_animated = this.attachMovie("toilet_rain_animated", "toilet_rain_animated" + this.amount, this.getNextHighestDepth());
this.toilet_rain_animated._x = this.randomx;
this.toilet_rain_animated._y = -1100 + random(100);
this.toilet_rain_animated._rotation = random(15) - random(15);
i++;
}
};
Instance of Symbol 124 MovieClip in Symbol 319 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 349 Button
on (release) {
NewgroundsAPI.loadMySite();
}
Symbol 353 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 357 Button
on (release) {
_root.gotoAndStop("very_first_frame");
}