Section 1
//credits_44 (clock_fla.credits_44)
package clock_fla {
import flash.display.*;
public dynamic class credits_44 extends MovieClip {
public var backButt:SimpleButton;
}
}//package clock_fla
Section 2
//dump_6 (clock_fla.dump_6)
package clock_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import flash.ui.*;
public dynamic class dump_6 extends MovieClip {
public function dump_6(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package clock_fla
Section 3
//face_22 (clock_fla.face_22)
package clock_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import flash.ui.*;
public dynamic class face_22 extends MovieClip {
public var ran:int;
public var rings:MovieClip;
public var s:String;
public var speech:TextField;
public function face_22(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 64, frame65, 135, frame136, 141, frame142, 0xFF, frame256);
}
function frame65(){
parent.setChildIndex(this, (parent.numChildren - 1));
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
function frame256(){
stop();
Game(parent).removeGame();
}
function frame136(){
stage.quality = "HIGH";
}
function frame142(){
ran = (Math.random() * 13);
switch (ran){
case 0:
s = "Oh noes! Hope I can claim this back on insurance!";
break;
case 1:
s = "There goes this weeks paycheck...";
break;
case 2:
s = "Damn ninjas, that's the third time this week!";
break;
case 3:
s = "I bet this is all just a game to you isn't it?";
break;
case 4:
s = "Is it just me or is there no way to win this game?";
break;
case 5:
s = "Don't look at me, I just work here.";
break;
case 6:
s = "My hand is glued to my head! What's your excuse eh?";
break;
case 7:
s = "Hands up everyone who saw that coming.";
break;
case 8:
s = "Ninjas... ninjas... NINJAS! AAAAAAAAH!";
break;
case 9:
s = "I hope you're satisfied, those guys are probably gonna come in here and do nasty things to me.";
break;
case 10:
s = "There's a world outside the clock!?";
break;
case 11:
s = "Aw, what a pain in the glass...";
break;
case 12:
s = "It's amazing I manage to turn this huge clock with my physical stature.";
break;
case 13:
s = "Ever heard of a little thing called PRIVACY?";
break;
case 14:
s = "Just... don't ask";
break;
default:
break;
};
speech.wordWrap = true;
speech.text = s;
}
}
}//package clock_fla
Section 4
//hitBox_29 (clock_fla.hitBox_29)
package clock_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import flash.ui.*;
public dynamic class hitBox_29 extends MovieClip {
public function hitBox_29(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package clock_fla
Section 5
//loaderCont_1 (clock_fla.loaderCont_1)
package clock_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import flash.ui.*;
public dynamic class loaderCont_1 extends MovieClip {
public var loaderBar:MovieClip;
public var textTotal:TextField;
public var loaderLoading:MovieClip;
public var totalSize:int;
public var loadedAmount:int;
public var parentMC:MovieClip;
public var blah:Boolean;
public function loaderCont_1(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame2(){
gotoAndPlay(1);
}
function frame3(){
if (((blah) && ((loadedAmount >= totalSize)))){
stop();
parentMC = null;
} else {
gotoAndPlay(1);
};
}
function frame1(){
parentMC = MovieClip(parent);
parentMC.stop();
blah = true;
loadedAmount = root.loaderInfo.bytesLoaded;
totalSize = root.loaderInfo.bytesTotal;
textTotal.text = ((Math.round(((100 * totalSize) / 0x100000)) / 100) + "Mb");
if (totalSize == 0){
gotoAndStop(3);
loaderLoading.gotoAndPlay("done");
} else {
loaderBar.scaleX = (Math.round(((loadedAmount / totalSize) * 1000)) / 1000);
loaderLoading.x = (loaderBar.x + loaderBar.width);
if (loadedAmount == totalSize){
gotoAndStop(3);
loaderLoading.gotoAndPlay("done");
};
};
}
}
}//package clock_fla
Section 6
//loaderLoading_3 (clock_fla.loaderLoading_3)
package clock_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import flash.ui.*;
public dynamic class loaderLoading_3 extends MovieClip {
public function loaderLoading_3(){
addFrameScript(27, frame28, 54, frame55);
}
function frame28(){
gotoAndPlay(1);
}
function frame55(){
stop();
MovieClip(root).play();
MovieClip(parent.parent).removeChild(MovieClip(parent));
}
}
}//package clock_fla
Section 7
//Menuclockface_10 (clock_fla.Menuclockface_10)
package clock_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Menuclockface_10 extends MovieClip {
public function Menuclockface_10(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package clock_fla
Section 8
//minHand_28 (clock_fla.minHand_28)
package clock_fla {
import flash.display.*;
public dynamic class minHand_28 extends MovieClip {
public var hit:MovieClip;
public var hit2:MovieClip;
}
}//package clock_fla
Section 9
//NinjaEnter_47 (clock_fla.NinjaEnter_47)
package clock_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import flash.ui.*;
public dynamic class NinjaEnter_47 extends MovieClip {
public function NinjaEnter_47(){
addFrameScript(21, frame22);
}
function frame22(){
MovieClip(parent).gotoAndStop(2);
}
}
}//package clock_fla
Section 10
//rings_23 (clock_fla.rings_23)
package clock_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import flash.ui.*;
public dynamic class rings_23 extends MovieClip {
public function rings_23(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package clock_fla
Section 11
//towerDoor_15 (clock_fla.towerDoor_15)
package clock_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import flash.ui.*;
public dynamic class towerDoor_15 extends MovieClip {
public function towerDoor_15(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package clock_fla
Section 12
//towerDoorClose_20 (clock_fla.towerDoorClose_20)
package clock_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import flash.ui.*;
public dynamic class towerDoorClose_20 extends MovieClip {
public function towerDoorClose_20(){
addFrameScript(7, frame8);
}
function frame8(){
stop();
MovieClip(parent).gotoAndStop(1);
}
}
}//package clock_fla
Section 13
//towerDoorOpen_19 (clock_fla.towerDoorOpen_19)
package clock_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import flash.ui.*;
public dynamic class towerDoorOpen_19 extends MovieClip {
public function towerDoorOpen_19(){
addFrameScript(7, frame8);
}
function frame8(){
stop();
MovieClip(parent).gotoAndStop(3);
stop();
}
}
}//package clock_fla
Section 14
//Baku (Baku)
package {
import flash.media.*;
public dynamic class Baku extends Sound {
}
}//package
Section 15
//Bell (Bell)
package {
import flash.media.*;
public dynamic class Bell extends Sound {
}
}//package
Section 16
//Click (Click)
package {
import flash.media.*;
public dynamic class Click extends Sound {
}
}//package
Section 17
//Document (Document)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
public dynamic class Document extends MovieClip {
public var gameMC:Game;
private var fpsModify:Boolean;// = true
private var midX:int;
private var midY:int;
public var menuMC:MovieClip;
private var startTime:Number;
public var urlString:String;
public var errorMC:MovieClip;
private var endMC:MovieClip;
private var fpsText:TextField;
private var interval:Number;// = 20
private var numFrames:Number;// = 0
public function Document():void{
fpsModify = true;
interval = 20;
numFrames = 0;
super();
addFrameScript(0, frame1, 2, frame3);
stage.showDefaultContextMenu = false;
midX = (stage.stageWidth / 2);
midY = (stage.stageHeight / 2);
}
public function addFramerateDisplay():void{
startTime = getTimer();
if (fpsModify){
stage.addEventListener("enterFrame", fpsMod);
} else {
stage.addEventListener("enterFrame", fpsUpdate);
};
}
private function startButtClick(_arg1:Event):void{
disableMenu();
removeChild(menuMC);
menuMC = null;
loadGame();
}
private function backButtClick(_arg1:Event):void{
menuMC.credits.visible = false;
menuMC.credits.backButt.removeEventListener("click", backButtClick);
enableMenu();
}
public function loadEnd(_arg1:int):void{
stage.quality = "HIGH";
endMC = new End();
endMC.score = _arg1;
endMC.scoreText.text = String(_arg1);
addChild(endMC);
enableEnd();
}
public function loadIntro():void{
var _local1:MovieClip;
_local1 = new Intro();
_local1.x = midX;
_local1.y = midY;
addChild(_local1);
}
public function qualityCycle():void{
switch (stage.quality){
case "LOW":
stage.quality = "BEST";
break;
case "MEDIUM":
stage.quality = "LOW";
break;
case "HIGH":
case "BEST":
stage.quality = "MEDIUM";
break;
default:
break;
};
}
private function sponsorButtClick(_arg1:Event):void{
goURL("http://www.hallpass.com");
}
private function fpsUpdate(_arg1:Object):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
if ((++numFrames % interval) == 0){
_local2 = getTimer();
_local3 = ((_local2 - startTime) / 1000);
_local4 = (interval / _local3);
fpsText.text = ("FPS=" + _local4.toFixed(2));
startTime = _local2;
};
}
private function enableEnd():void{
endMC.againButt.addEventListener("click", againButtClick);
endMC.sponsorButt.addEventListener("click", sponsorButtClick);
endMC.menuButt.addEventListener("click", menuButtClick);
}
function frame3(){
stop();
urlString = this.loaderInfo.url;
loadIntro();
}
function frame1(){
stop();
}
public function disableMenu():void{
menuMC.startButt.removeEventListener("click", startButtClick);
menuMC.sponsorButt.removeEventListener("click", sponsorButtClick);
menuMC.creditsButt.removeEventListener("click", creditsButtClick);
menuMC.shinkiButt.removeEventListener("click", shinkiButtClick);
menuMC.ccButt.removeEventListener("click", ccButtClick);
}
public function goURL(_arg1:String):void{
var _local2:URLRequest;
_local2 = new URLRequest(_arg1);
navigateToURL(_local2, "_blank");
}
public function loadMenu():void{
menuMC = new Menu();
menuMC.credits.visible = false;
menuMC.pic.cacheAsBitmap = true;
addChild(menuMC);
enableMenu();
}
public function enableMenu():void{
menuMC.startButt.addEventListener("click", startButtClick);
menuMC.sponsorButt.addEventListener("click", sponsorButtClick);
menuMC.creditsButt.addEventListener("click", creditsButtClick);
menuMC.shinkiButt.addEventListener("click", shinkiButtClick);
menuMC.ccButt.addEventListener("click", ccButtClick);
}
private function menuButtClick(_arg1:Event):void{
disableEnd();
removeChild(endMC);
endMC = null;
loadMenu();
}
private function fpsMod(_arg1:Object):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
if ((++numFrames % interval) == 0){
_local2 = getTimer();
_local3 = ((_local2 - startTime) / 1000);
_local4 = (interval / _local3);
startTime = _local2;
if (_local4 > 50){
stage.frameRate--;
} else {
if (_local4 < 28){
if (stage.quality != "LOW"){
qualityCycle();
};
};
};
};
}
private function ccButtClick(_arg1:Event):void{
goURL("http://crazychihuahua.newgrounds.com");
}
private function creditsButtClick(_arg1:Event):void{
menuMC.credits.visible = true;
disableMenu();
menuMC.credits.backButt.addEventListener("click", backButtClick);
}
private function againButtClick(_arg1:Event):void{
disableEnd();
removeChild(endMC);
endMC = null;
loadGame();
}
private function disableEnd():void{
endMC.againButt.removeEventListener("click", againButtClick);
endMC.sponsorButt.removeEventListener("click", sponsorButtClick);
endMC.menuButt.removeEventListener("click", menuButtClick);
}
private function shinkiButtClick(_arg1:Event):void{
goURL("http://www.shinki.co.uk");
}
public function loadGame():void{
gameMC = new Game();
addChild(gameMC);
addFramerateDisplay();
}
}
}//package
Section 18
//End (End)
package {
import flash.display.*;
import flash.text.*;
public dynamic class End extends MovieClip {
public var menuButt:SimpleButton;
public var sponsorButt:SimpleButton;
public var againButt:SimpleButton;
public var scoreText:TextField;
}
}//package
Section 19
//errorDisplay (errorDisplay)
package {
import flash.display.*;
public dynamic class errorDisplay extends MovieClip {
}
}//package
Section 20
//Game (Game)
package {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.utils.*;
public dynamic class Game extends Sprite {
private var hitAngle:int;
private var ninArray:Array;
private var maxHandNinjas:int;// = 13
public var ninjasKilled:int;// = 0
private var midX:int;// = 200
private var bellAvailable:Boolean;// = false
private var bellKnockChance:Number;// = 0.5
private var midY:int;// = 300
private var leftSpawnX:int;// = 66
public var sky2:Sprite;
private var music:Sound;
public var sky1:Sprite;
private var spawnY:int;// = 605
private var hourTravelRan:Number;
private var hitStrength:int;
private var ninHandArray:Array;
public var face:MovieClip;
public var hh:Sprite;
private var screams:int;// = 0
private var clickSound:Boolean;// = false
private var damage:int;// = 0
public var doorX:int;// = 200
private var ninjaSpawnSideNum:Number;// = 0.1
public var doorY:int;// = 55
private var effectsOn:Boolean;// = true
private var musicChannel:SoundChannel;
private var RadToDeg:Number;// = 57.2957795130823
private var started:Boolean;// = false
private var rightSpawnX:int;// = 334
public var mh:MovieClip;
private var ninjaSpawnNum:Number;// = 0.03
public var ninTower:int;// = 0
private var bellCount:int;// = 0
private var musicOn:Boolean;// = true
private var maxDamage:int;// = 10000
public function Game():void{
maxHandNinjas = 13;
ninjaSpawnNum = 0.03;
ninjaSpawnSideNum = 0.1;
bellKnockChance = 0.5;
maxDamage = 10000;
RadToDeg = (180 / Math.PI);
midX = 200;
midY = 300;
damage = 0;
ninArray = new Array();
ninHandArray = new Array();
ninTower = 0;
ninjasKilled = 0;
bellAvailable = false;
musicOn = true;
effectsOn = true;
screams = 0;
clickSound = false;
started = false;
bellCount = 0;
leftSpawnX = 66;
rightSpawnX = 334;
spawnY = 605;
doorX = 200;
doorY = 55;
super();
this.tower.cacheAsBitmap = (face.cacheAsBitmap = (sky1.cacheAsBitmap = (sky2.cacheAsBitmap = true)));
face.gotoAndStop(1);
face.rings.gotoAndStop(1);
this.door.gotoAndStop(1);
this.musicButt.addEventListener("click", musicButtClick);
this.sfxButt.addEventListener("click", sfxButtClick);
this.musicCross.visible = false;
this.sfxCross.visible = false;
this.readyButt.addEventListener("click", setup);
}
private function startMusic():void{
music = new musicLoop();
musicChannel = music.play();
musicChannel.addEventListener("soundComplete", musicComplete);
}
private function sfxButtClick(_arg1:Event):void{
this.sfxCross.visible = effectsOn;
effectsOn = !(effectsOn);
}
private function mhUpdate(_arg1:Event):void{
var _local2:Number;
var _local3:int;
var _local4:Ninja;
var _local5:int;
_local2 = (Math.atan2((mouseY - mh.y), (mouseX - mh.x)) * RadToDeg);
_local3 = Math.abs((mh.rotation - _local2));
if (_local3 > 180){
_local3 = (360 - _local3);
};
if (mh.rotation < _local2){
if ((_local2 - mh.rotation) > 180){
rotate((-(_local3) / 5));
} else {
rotate((_local3 / 5));
};
} else {
if ((mh.rotation - _local2) > 180){
rotate((_local3 / 5));
} else {
rotate((-(_local3) / 5));
};
};
_local5 = 0;
while (_local5 < ninArray.length) {
_local4 = ninArray[_local5];
if (mh.hit.hitTestObject(_local4.hit)){
if ((((hitStrength > 3)) && ((Math.random() < 0.97)))){
_local4.knock((hitAngle / RadToDeg), hitStrength);
} else {
if (ninHandArray.length < maxHandNinjas){
_local4.grab(1);
};
};
} else {
if (mh.hit2.hitTestObject(_local4.hit)){
if (ninHandArray.length < maxHandNinjas){
_local4.grab(-1);
};
};
};
_local5++;
};
if (Math.random() < ninjaSpawnNum){
createNinja();
if ((((ninjaSpawnNum >= 1)) && ((Math.random() < (ninjaSpawnNum - 1))))){
createNinja();
};
};
if (ninTower > 0){
damage = (damage + ninTower);
if (damage >= maxDamage){
endGame();
} else {
face.gotoAndStop(Math.floor((damage / (maxDamage / 7))));
};
};
}
private function bellClick(_arg1:Event):void{
var _local2:int;
var _local3:Sound;
if (bellAvailable){
stage.removeEventListener("click", bellClick);
addEventListener("enterFrame", bellUpdate);
hourTravelRan = (((Math.ceil((Math.random() * 11)) * 30) * ((int((Math.random() < 0.5)) * 2) - 1)) * 0.05);
if (effectsOn){
_local3 = new Bell();
_local3.play();
};
_local2 = (ninHandArray.length - 1);
while (_local2 > -1) {
ninHandArray[_local2].knock2();
_local2--;
};
_local2 = (ninArray.length - 1);
while (_local2 > -1) {
if (Math.random() > bellKnockChance){
ninArray[_local2].knock();
};
_local2--;
};
};
}
private function stopMusic():void{
musicChannel.removeEventListener("soundComplete", musicComplete);
musicChannel.stop();
music = null;
musicChannel = null;
}
private function rotate(_arg1:Number):void{
var _local2:int;
var _local3:Sound;
var _local4:SoundChannel;
_local2 = (30 - (2 * ninHandArray.length));
if (_arg1 > _local2){
_arg1 = _local2;
} else {
if (_arg1 < -(_local2)){
_arg1 = -(_local2);
};
};
mh.rotation = (mh.rotation + _arg1);
hh.rotation = (hh.rotation + (_arg1 / 12));
moveSky((_arg1 / 3));
if (effectsOn){
if (Math.abs(_arg1) >= 4){
if (!clickSound){
clickSound = true;
_local3 = new Click();
_local4 = _local3.play();
_local4.addEventListener("soundComplete", clickComplete);
};
};
};
if ((((((((hh.rotation > -98)) && ((hh.rotation < -82)))) && ((mh.rotation > -98)))) && ((mh.rotation < -82)))){
face.rings.gotoAndStop(2);
bellAvailable = true;
} else {
face.rings.gotoAndStop(1);
bellAvailable = false;
};
if (_arg1 > 0){
hitAngle = (mh.rotation + 90);
} else {
if (_arg1 < 0){
hitAngle = (mh.rotation - 90);
};
};
hitStrength = Math.abs(_arg1);
}
private function endGame():void{
var _local1:Sound;
if (musicOn){
stopMusic();
};
_local1 = new Baku();
_local1.play();
this.musicButt.removeEventListener("click", musicButtClick);
this.sfxButt.removeEventListener("click", sfxButtClick);
removeEventListener("enterFrame", mhUpdate);
stage.removeEventListener("click", bellClick);
removeEventListener("enterFrame", bellUpdate);
addEventListener("enterFrame", mhFall);
face.gotoAndPlay(7);
}
public function setup(_arg1:Event):void{
this.readyButt.removeEventListener("click", setup);
removeChild(this.readyButt);
if (musicOn){
startMusic();
};
started = true;
addEventListener("enterFrame", mhUpdate);
stage.addEventListener("click", bellClick);
}
private function moveSky(_arg1:Number):void{
var _local2:Number;
sky1.x = (sky1.x + _arg1);
if (sky1.x < midX){
sky2.x = (sky1.x + 2880);
} else {
sky2.x = (sky1.x - 2880);
};
if ((((sky1.x > ((sky1.width / 2) + midX))) || ((sky1.x < ((-(sky1.width) / 2) - midX))))){
_local2 = sky1.x;
sky1.x = sky2.x;
sky2.x = _local2;
};
}
public function ninAdd(_arg1:Ninja, _arg2:int):void{
var _local3:Array;
switch (_arg2){
case 0:
_local3 = ninArray;
break;
case 1:
_local3 = ninHandArray;
break;
};
_arg1.idx = _local3.length;
_local3.push(_arg1);
}
private function musicButtClick(_arg1:Event):void{
this.musicCross.visible = musicOn;
musicOn = !(musicOn);
if (started){
if (musicOn){
startMusic();
} else {
stopMusic();
};
};
}
public function ninRemove(_arg1:int, _arg2:int):void{
var _local3:Array;
var _local4:int;
switch (_arg2){
case 0:
_local3 = ninArray;
break;
case 1:
_local3 = ninHandArray;
break;
};
_local3.splice(_arg1, 1);
_local4 = _arg1;
while (_local4 < _local3.length) {
_local3[_local4].idx--;
_local4++;
};
}
private function bellUpdate(_arg1:Event):void{
bellCount++;
if (bellCount < 21){
hh.rotation = (hh.rotation + hourTravelRan);
moveSky((4 * hourTravelRan));
};
x = ((20 * Math.sin((bellCount * 0.7))) / bellCount);
if (bellCount > 60){
bellCount = 0;
stage.addEventListener("click", bellClick);
removeEventListener("enterFrame", bellUpdate);
};
}
public function removeGame():void{
var _local1:int;
var _local2:Document;
_local1 = (ninHandArray.length - 1);
while (_local1 > -1) {
ninHandArray[_local1].destroy(this, 1);
_local1--;
};
_local1 = (ninArray.length - 1);
while (_local1 > -1) {
ninArray[_local1].destroy(this);
_local1--;
};
ninArray = null;
ninHandArray = null;
_local2 = Document(parent);
_local2.removeChild(this);
_local2.gameMC = null;
_local2.loadEnd(ninjasKilled);
}
private function musicComplete(_arg1:Event):void{
musicChannel = music.play();
musicChannel.addEventListener("soundComplete", musicComplete);
}
private function screamComplete(_arg1:Event):void{
screams--;
}
public function killNinja():void{
var _local1:Class;
var _local2:Sound;
var _local3:SoundChannel;
if (effectsOn){
if (screams < 6){
_local1 = (getDefinitionByName(("Scream" + Math.ceil((Math.random() * 3)))) as Class);
_local2 = new (_local1);
_local3 = _local2.play();
_local3.addEventListener("soundComplete", screamComplete);
screams++;
};
};
ninjasKilled++;
this.killedText.text = String(ninjasKilled);
ninjaSpawnNum = ((ninjasKilled / 1000) + 0.01);
ninjaSpawnSideNum = ((ninjasKilled / 1000) + 0.1);
if (ninjaSpawnSideNum > 0.6){
ninjaSpawnSideNum = 0.6;
};
}
private function clickComplete(_arg1:Event):void{
clickSound = false;
}
private function createNinja():void{
var _local1:Ninja;
var _local2:Number;
_local1 = new Ninja();
_local2 = Math.random();
if (_local2 < ninjaSpawnSideNum){
if (_local2 < (ninjaSpawnSideNum / 2)){
_local1.x = leftSpawnX;
} else {
_local1.x = rightSpawnX;
};
_local1.y = (Math.floor((Math.random() * 200)) + 200);
} else {
_local1.y = spawnY;
_local1.x = (Math.floor((Math.random() * (rightSpawnX - leftSpawnX))) + leftSpawnX);
};
ninAdd(_local1, 0);
addChild(_local1);
_local1.setup();
}
private function mhFall(_arg1:Event):void{
mh.y = (mh.y + ((mh.y - 199) / 4));
hh.y = mh.y;
if (mh.y > 1000){
removeEventListener("enterFrame", mhFall);
};
}
}
}//package
Section 21
//Intro (Intro)
package {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Intro extends MovieClip {
public var hallpass:SimpleButton;
public function Intro(){
addFrameScript(0, frame1, 161, frame162);
}
function frame162(){
stop();
MovieClip(parent).loadMenu();
MovieClip(parent).removeChild(this);
}
function frame1(){
hallpass.addEventListener("click", hpClick);
}
public function hpClick(_arg1:MouseEvent):void{
MovieClip(root).goURL("http://www.hallpass.com");
}
}
}//package
Section 22
//Menu (Menu)
package {
import flash.display.*;
public dynamic class Menu extends MovieClip {
public var shinkiButt:SimpleButton;
public var pic:MovieClip;
public var startButt:SimpleButton;
public var sponsorButt:SimpleButton;
public var ccButt:SimpleButton;
public var creditsButt:SimpleButton;
public var credits:MovieClip;
}
}//package
Section 23
//musicLoop (musicLoop)
package {
import flash.media.*;
public dynamic class musicLoop extends Sound {
}
}//package
Section 24
//Ninja (Ninja)
package {
import flash.events.*;
import flash.display.*;
public dynamic class Ninja extends MovieClip {
private var midX:int;// = 200
private var midY:int;// = 300
private var entered:Boolean;// = false
private var RadToDeg:Number;// = 57.2957795130823
public var idx:int;
private var vx:Number;
private var vy:Number;
public function Ninja():void{
RadToDeg = (180 / Math.PI);
entered = false;
midX = 200;
midY = 300;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
public function destroy(_arg1:Game=null, _arg2:int=0):void{
if (_arg1 == null){
_arg1 = Game(parent);
};
removeEventListener("enterFrame", climb);
_arg1.ninRemove(idx, _arg2);
parent.removeChild(this);
}
public function grab(_arg1:int):void{
var _local2:Game;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Number;
_local2 = Game(parent);
_local3 = (x - _local2.mh.x);
_local4 = (y - _local2.mh.y);
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
removeEventListener("enterFrame", climb);
_local2.ninRemove(idx, 0);
_local2.removeChild(this);
x = (_local5 * _arg1);
scaleX = _arg1;
_local6 = Math.random();
if (_local6 < 0.5){
y = (-(Math.floor((_local6 * 10))) - 5);
} else {
y = Math.floor((_local6 * 10));
scaleY = -1;
};
rotation = 0;
gotoAndStop(4);
_local2.mh.addChild(this);
_local2.ninAdd(this, 1);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
private function expandAngle(_arg1:Number):Number{
var _local2:Number;
var _local3:Number;
_local2 = (Math.PI / 2);
_arg1 = (_arg1 + _local2);
_local3 = ((Math.abs(_arg1) - (_local2 / 4)) * 7);
if (_local3 > 1){
_arg1 = (_arg1 * _local3);
};
return ((_arg1 - _local2));
}
function frame4(){
stop();
}
private function fall(_arg1:Event):void{
x = (x + vx);
y = (y + vy);
vy = (vy + 0.5);
scaleX = (scaleX + 0.01);
scaleY = scaleX;
if ((((((y > ((midY * 2) + 50))) || ((x < -50)))) || ((x > ((midX * 2) + 50))))){
removeEventListener("enterFrame", fall);
Game(parent).removeChild(this);
};
}
function frame2(){
stop();
}
function frame5(){
stop();
}
public function setup():void{
addEventListener("enterFrame", climb);
}
private function climb(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:Number;
if (!entered){
gotoAndStop(1);
entered = true;
} else {
if (currentFrame > 2){
gotoAndStop(2);
};
};
_local2 = (Game(parent).doorY - y);
_local3 = (Game(parent).doorX - x);
if ((((Math.abs(_local3) < 8)) && ((Math.abs(_local2) < 8)))){
Game(parent).door.gotoAndStop(2);
Game(parent).ninTower++;
Game(parent).insideText.text = String(Game(parent).ninTower);
destroy();
} else {
_local4 = Math.atan2(_local2, _local3);
_local4 = expandAngle(_local4);
rotation = (_local4 * RadToDeg);
x = (x + (1.5 * Math.cos(_local4)));
y = (y + (1.5 * Math.sin(_local4)));
};
}
public function knock(_arg1:Number=0, _arg2:int=0):void{
removeEventListener("enterFrame", climb);
Game(parent).ninRemove(idx, 0);
Game(parent).killNinja();
vx = (_arg2 * Math.cos(_arg1));
vy = (_arg2 * Math.sin(_arg1));
addEventListener("enterFrame", fall);
rotation = _arg1;
gotoAndStop(5);
}
public function knock2():void{
var _local1:Game;
_local1 = Game(parent.parent);
_local1.ninRemove(idx, 1);
parent.removeChild(this);
_local1.killNinja();
y = (_local1.mh.y + (x * Math.sin((_local1.mh.rotation / RadToDeg))));
x = (_local1.mh.x + (x * Math.cos((_local1.mh.rotation / RadToDeg))));
_local1.addChild(this);
vx = ((Math.random() - 0.5) * 3);
vy = 0;
addEventListener("enterFrame", fall);
rotation = (Math.random() * 360);
gotoAndStop(5);
}
}
}//package
Section 25
//Scream1 (Scream1)
package {
import flash.media.*;
public dynamic class Scream1 extends Sound {
}
}//package
Section 26
//Scream2 (Scream2)
package {
import flash.media.*;
public dynamic class Scream2 extends Sound {
}
}//package
Section 27
//Scream3 (Scream3)
package {
import flash.media.*;
public dynamic class Scream3 extends Sound {
}
}//package