Section 1
//bandage (bandage)
package {
import flash.display.*;
public dynamic class bandage extends MovieClip {
}
}//package
Section 2
//bandageKey (bandageKey)
package {
import flash.display.*;
public dynamic class bandageKey extends MovieClip {
}
}//package
Section 3
//bat (bat)
package {
import flash.display.*;
public dynamic class bat extends MovieClip {
}
}//package
Section 4
//bed (bed)
package {
import flash.display.*;
public dynamic class bed extends MovieClip {
}
}//package
Section 5
//beepSnd (beepSnd)
package {
import flash.media.*;
public dynamic class beepSnd extends Sound {
}
}//package
Section 6
//bigTV (bigTV)
package {
import flash.display.*;
public dynamic class bigTV extends MovieClip {
}
}//package
Section 7
//bomb (bomb)
package {
import flash.display.*;
public dynamic class bomb extends MovieClip {
}
}//package
Section 8
//bombBtn (bombBtn)
package {
import flash.display.*;
public dynamic class bombBtn extends MovieClip {
}
}//package
Section 9
//catSnd (catSnd)
package {
import flash.media.*;
public dynamic class catSnd extends Sound {
}
}//package
Section 10
//ceilingFan (ceilingFan)
package {
import flash.display.*;
public dynamic class ceilingFan extends MovieClip {
}
}//package
Section 11
//cellDialingSnd (cellDialingSnd)
package {
import flash.media.*;
public dynamic class cellDialingSnd extends Sound {
}
}//package
Section 12
//cellPhone (cellPhone)
package {
import flash.display.*;
public dynamic class cellPhone extends MovieClip {
}
}//package
Section 13
//chair (chair)
package {
import flash.display.*;
public dynamic class chair extends MovieClip {
}
}//package
Section 14
//coffee (coffee)
package {
import flash.display.*;
public dynamic class coffee extends MovieClip {
}
}//package
Section 15
//computer (computer)
package {
import flash.display.*;
public dynamic class computer extends MovieClip {
}
}//package
Section 16
//continueBtn (continueBtn)
package {
import flash.display.*;
public dynamic class continueBtn extends MovieClip {
}
}//package
Section 17
//couch (couch)
package {
import flash.display.*;
public dynamic class couch extends MovieClip {
}
}//package
Section 18
//desk (desk)
package {
import flash.display.*;
public dynamic class desk extends MovieClip {
public function desk(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 19
//dogBarkSnd (dogBarkSnd)
package {
import flash.media.*;
public dynamic class dogBarkSnd extends Sound {
}
}//package
Section 20
//dogSnd (dogSnd)
package {
import flash.media.*;
public dynamic class dogSnd extends Sound {
}
}//package
Section 21
//doorHandleNote (doorHandleNote)
package {
import flash.display.*;
public dynamic class doorHandleNote extends MovieClip {
}
}//package
Section 22
//Escape (Escape)
package {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class Escape extends MovieClip {
var frontDoorCode;
var takeAway:uint;// = 0
public var ladder:ladder1;
var keypadBeep:beepSnd;
var tvFieldCreated:uint;
var blinds3:window2;
var paw2:pawPrints2;
var paw3:pawPrints3;
var cord1:powerCord;
var paw4:pawPrints4;
var madCat:madCatSnd;
var paw5:pawPrints5;
var myScore:Number;// = 1300000
var haveBandage1:Boolean;// = false
var take1:bombBtn;
var take2:bombBtn;
var take3:bombBtn;
var noteRead:Boolean;// = false
var frames:uint;// = 0
public var desk3:desk;
var room4CodeA:Array;
var room4CodeB:Array;
var passedOut:youLoseSnd;
var highScoreField:TextField;
var bedroomCode:uint;
var bigTV5:bigTV;
var hat2:witchHat;
var keyPad2:numberKeyPad;
var allBombs:Array;
var keyPad4:numberKeyPad;
var message2:message;
var message4:message;
var continueGame:continueBtn;
var wrongCode:wrongCodeSnd;
var dog:dogSnd;
var evilLaugh:evilLaughSnd;
var needCord:Boolean;// = false
var btn1:uint;// = 0
var btn2:uint;// = 0
var pressSwitch:switchSnd;
var room4ColorB:Array;
var code4a:uint;
var code4b:uint;
var code4c:uint;
var code4d:uint;
var btn4:uint;// = 0
var room4ColorA:Array;
var btn3:uint;// = 0
var btn5:uint;// = 0
var phone:cellDialingSnd;
var bombNum:uint;// = 0
var vase3a:roseVase;
var vase3b:lillyVase;
var haveBat:Boolean;// = false
var pictureBreaking:glassbreakingSnd;
var cpuOn:Boolean;// = false
var playingCpuGame:Boolean;// = false
var key1:key;
var haveCpuPower:Boolean;// = false
var bombsLeft:uint;// = 0
var gameTime:uint;
var coffee5:coffee;
var tv1:tv;
var gasPrice:uint;// = 4
var currentRoom:uint;
var cpuBeep:pcBeepSnd;
var counter:uint;
var chair1:chair;
var highScore;
var beatCpu:Boolean;// = false
var allKeypadBtns:Array;
var dogBark:dogBarkSnd;
var table1:desk;
var table5:desk;
var petCat:Boolean;// = false
var infoBox:TextField;
var couch5:couch;
var gameTimeField:TextField;
var cpuTurn:Boolean;// = true
var dog1:puppy;
var haveHat2:Boolean;// = false
var gameStartTime:uint;
var haveCell1:Boolean;// = false
var invY:uint;// = 0
var invX:uint;// = 0
var rArrow:rightArrow;
var bandage1:bandage;
var progressField:TextField;
var bat5:bat;
public var play_btn:SimpleButton;
var bombStart:bombBtn;
var userCode4:uint;// = 0
var lArrow:leftArrow;
var leaveCpuGame:continueBtn;
var haveCalled:Boolean;// = false
var fan:fanSnd;
var cell1:cellPhone;
var cat1:kitty;
var foundSolution:Boolean;// = false
var doorOpen:openDoorSnd;
var myHealth:Number;// = 10000
var haveKey1:Boolean;// = false
var usingKeyPad:Boolean;// = false
var bandageKey1:bandageKey;
var switch3:lightSwitch1;
var fan3:ceilingFan;
var tvOff:tvOffSnd;
var cpu5:computer;
var tvField:TextField;
var outlet5a:outlet;
var outlet5b:outlet;
var invCount:uint;// = 0
var petDog:Boolean;// = false
var openDrawer5:Boolean;// = false
var haveCord1:Boolean;// = false
var bed5:bed;
var cat:catSnd;
var pic1:picture1;
var pic3:picture3;
var myProgress:uint;// = 0
private static const numpadOffsetY:uint = 100;
private static const tileHorizontalSpacing:uint = 103;
private static const numpadHeight:uint = 3;
private static const numpadOffsetX:uint = 300;
private static const numpadWidth:uint = 3;
private static const tileVerticalSpacing:uint = 103;
public function Escape():void{
var _local1:TextFormat;
infoBox = new TextField();
rArrow = new rightArrow();
lArrow = new leftArrow();
dog = new dogSnd();
cat = new catSnd();
madCat = new madCatSnd();
tvOff = new tvOffSnd();
pictureBreaking = new glassbreakingSnd();
pressSwitch = new switchSnd();
keyPad2 = new numberKeyPad();
keyPad4 = new numberKeyPad();
keypadBeep = new beepSnd();
phone = new cellDialingSnd();
fan = new fanSnd();
cpuBeep = new pcBeepSnd();
passedOut = new youLoseSnd();
evilLaugh = new evilLaughSnd();
dogBark = new dogBarkSnd();
wrongCode = new wrongCodeSnd();
doorOpen = new openDoorSnd();
key1 = new key();
dog1 = new puppy();
cat1 = new kitty();
chair1 = new chair();
pic1 = new picture1();
pic3 = new picture3();
fan3 = new ceilingFan();
vase3a = new roseVase();
vase3b = new lillyVase();
blinds3 = new window2();
table1 = new desk();
table5 = new desk();
tv1 = new tv();
cord1 = new powerCord();
cell1 = new cellPhone();
message2 = new message();
message4 = new message();
paw2 = new pawPrints2();
paw3 = new pawPrints3();
paw4 = new pawPrints4();
paw5 = new pawPrints5();
switch3 = new lightSwitch1();
hat2 = new witchHat();
continueGame = new continueBtn();
leaveCpuGame = new continueBtn();
bandage1 = new bandage();
bandageKey1 = new bandageKey();
bigTV5 = new bigTV();
couch5 = new couch();
cpu5 = new computer();
bat5 = new bat();
outlet5a = new outlet();
outlet5b = new outlet();
coffee5 = new coffee();
bed5 = new bed();
bombStart = new bombBtn();
take1 = new bombBtn();
take2 = new bombBtn();
take3 = new bombBtn();
room4CodeA = [3, 4, 1, 5];
room4CodeB = new Array();
room4ColorA = ["green", "orange", "blue", "red"];
room4ColorB = new Array();
frontDoorCode = (Math.floor((Math.random() * 8798)) + 1201);
highScore = (frontDoorCode - 200);
btn1 = 0;
btn2 = 0;
btn3 = 0;
btn4 = 0;
btn5 = 0;
userCode4 = 0;
allKeypadBtns = new Array();
allBombs = new Array();
haveKey1 = false;
haveBandage1 = false;
haveCord1 = false;
haveCell1 = false;
haveCalled = false;
haveHat2 = false;
haveBat = false;
petDog = false;
petCat = false;
noteRead = false;
usingKeyPad = false;
openDrawer5 = false;
haveCpuPower = false;
needCord = false;
cpuOn = false;
playingCpuGame = false;
cpuTurn = true;
beatCpu = false;
foundSolution = false;
frames = 0;
invX = 0;
invY = 0;
invCount = 0;
bombsLeft = 0;
takeAway = 0;
bombNum = 0;
myProgress = 0;
myScore = 1300000;
myHealth = 10000;
gasPrice = 4;
super();
addFrameScript(0, frame1, 9, frame10, 10, frame11, 20, frame21, 30, frame31, 40, frame41, 50, frame51, 60, frame61, 70, frame71, 80, frame81);
infoBox.width = 357;
infoBox.height = 143;
infoBox.x = 465.5;
infoBox.y = 605;
infoBox.selectable = false;
infoBox.multiline = true;
infoBox.wordWrap = true;
addChild(infoBox);
_local1 = new TextFormat("Arial", 15, 0, true);
infoBox.defaultTextFormat = _local1;
gotoAndStop("Intro");
}
public function clickBandage(_arg1:MouseEvent){
infoBox.text = "You take the bandage.\nIt's been added to your inventory.";
haveBandage1 = true;
bandage1.removeEventListener(MouseEvent.CLICK, clickBandage);
bandage1.width = 65;
bandage1.height = 65;
invPosition();
bandage1.x = invX;
bandage1.y = invY;
}
public function setupNumPad():void{
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:keypad1;
_local1 = 4;
_local2 = 0;
while (_local2 < numpadHeight) {
_local3 = 0;
while (_local3 < numpadWidth) {
_local4 = new keypad1();
_local4.x = ((_local3 * tileHorizontalSpacing) + numpadOffsetX);
_local4.y = ((_local2 * tileVerticalSpacing) + numpadOffsetY);
_local4.gotoAndStop(_local1);
_local4.num = (_local1 - 3);
_local4.addEventListener(MouseEvent.CLICK, clickNum);
addChild(_local4);
allKeypadBtns.push(_local4);
_local1++;
_local3++;
};
_local2++;
};
_local4 = new keypad1();
_local4.x = ((0 * tileHorizontalSpacing) + numpadOffsetX);
_local4.y = ((3 * tileVerticalSpacing) + numpadOffsetY);
_local4.gotoAndStop("zero");
_local4.num = 0;
_local4.addEventListener(MouseEvent.CLICK, clickNum);
addChild(_local4);
allKeypadBtns.push(_local4);
_local4 = new keypad1();
_local4.x = ((1 * tileHorizontalSpacing) + numpadOffsetX);
_local4.y = ((3 * tileVerticalSpacing) + numpadOffsetY);
_local4.gotoAndStop("enter");
_local4.num = 10;
_local4.addEventListener(MouseEvent.CLICK, clickNum);
addChild(_local4);
allKeypadBtns.push(_local4);
gotoAndStop("Number Pad");
infoBox.text = ("Click on numbers and then click enter.\n\n" + "Click CONTINUE to view room again.");
continueGame.width = 465;
continueGame.height = 147;
continueGame.x = 233;
continueGame.y = 674;
continueGame.gotoAndStop(1);
continueGame.addEventListener(MouseEvent.CLICK, clickContinue);
addChild(continueGame);
continueGame.visible = true;
usingKeyPad = true;
userCode4 = 0;
btn1 = 0;
btn2 = 0;
btn3 = 0;
btn4 = 0;
btn5 = 0;
}
public function setupGame():void{
timeElapsed();
setBedroomCode();
rArrow.width = 50;
rArrow.height = 50;
rArrow.x = 430;
rArrow.y = 670;
rArrow.num = 1;
rArrow.gotoAndStop(1);
rArrow.addEventListener(MouseEvent.CLICK, moveRight);
addChild(rArrow);
lArrow.width = 50;
lArrow.height = 50;
lArrow.x = 380;
lArrow.y = 670;
lArrow.num = 3;
lArrow.gotoAndStop(1);
lArrow.addEventListener(MouseEvent.CLICK, moveLeft);
addChild(lArrow);
gotoAndStop("Room 0");
currentRoom = 0;
infoBox.text = ("All game messages appear here.\n\n" + "CLICK EITHER ARROW TO START\n\nGood Luck and Enjoy!\n");
}
public function clearCpu():void{
var _local1:uint;
var _local2:uint;
_local1 = 0;
while (_local1 < 21) {
removeChild(allBombs[_local1]);
_local1++;
};
_local2 = 0;
_local1 = 0;
while (_local1 < 21) {
allBombs.splice(_local2, 1);
_local1++;
};
take1.removeEventListener(MouseEvent.CLICK, clickTake1);
removeChild(take1);
take2.removeEventListener(MouseEvent.CLICK, clickTake2);
removeChild(take2);
take3.removeEventListener(MouseEvent.CLICK, clickTake3);
removeChild(take3);
bombStart.removeEventListener(MouseEvent.CLICK, click21Bombs);
removeChild(bombStart);
}
public function invPosition():void{
invCount++;
if (invCount == 1){
invX = 60;
invY = 637;
} else {
if (invCount == 2){
invX = 175;
invY = 637;
} else {
if (invCount == 3){
invX = 290;
invY = 637;
} else {
if (invCount == 4){
invX = 60;
invY = 714;
} else {
if (invCount == 5){
invX = 175;
invY = 714;
} else {
invX = 290;
invY = 714;
};
};
};
};
};
}
function frame10(){
setupGame();
}
public function animateChair(_arg1:Event){
infoBox.text = "You move the chair.";
if (chair1.x != 655){
chair1.x = (chair1.x + 5);
} else {
chair1.removeEventListener(Event.ENTER_FRAME, animateChair);
chair1.removeEventListener(MouseEvent.CLICK, clickChair);
};
}
function frame11(){
stop();
}
function frame1(){
stop();
play_btn.addEventListener(MouseEvent.CLICK, play_game);
}
function frame21(){
stop();
}
public function setupCpuGame():void{
var _local1:uint;
var _local2:uint;
var _local3:TextFormat;
var _local4:uint;
var _local5:bomb;
infoBox.text = (((("Welcome to 21 bombs. " + "A simple game where you take away either 1, 2, or 3 bombs ") + "at a time. The object of the game is to force your opponent ") + "to take the last bomb and you win.\n\n") + "The computer always goes first. Beat the computer to set a high score.");
playingCpuGame = true;
gotoAndStop("Cpu Game");
leaveCpuGame.width = 465;
leaveCpuGame.height = 147;
leaveCpuGame.x = 233;
leaveCpuGame.y = 674;
leaveCpuGame.gotoAndStop(2);
leaveCpuGame.addEventListener(MouseEvent.CLICK, clickLeaveGame);
addChild(leaveCpuGame);
leaveCpuGame.visible = true;
_local1 = 2;
_local2 = 0;
while (_local2 < 3) {
_local4 = 0;
while (_local4 < 7) {
_local5 = new bomb();
_local5.x = ((_local4 * 75) + 100);
_local5.y = ((_local2 * 110) + 260);
_local5.gotoAndStop(_local1);
_local5.num = (23 - _local1);
addChild(_local5);
allBombs.push(_local5);
_local1++;
_local4++;
};
_local2++;
};
bombStart.x = 713;
bombStart.y = 542;
bombStart.gotoAndStop(4);
bombStart.addEventListener(MouseEvent.CLICK, click21Bombs);
addChild(bombStart);
bombStart.visible = true;
take1.x = 713;
take1.y = 242;
take1.gotoAndStop(1);
take1.addEventListener(MouseEvent.CLICK, clickTake1);
addChild(take1);
take1.visible = true;
take2.x = 713;
take2.y = 342;
take2.gotoAndStop(2);
take2.addEventListener(MouseEvent.CLICK, clickTake2);
addChild(take2);
take2.visible = true;
take3.x = 713;
take3.y = 442;
take3.gotoAndStop(3);
take3.addEventListener(MouseEvent.CLICK, clickTake3);
addChild(take3);
take3.visible = true;
highScoreField = new TextField();
highScoreField.width = 100;
highScoreField.height = 57;
highScoreField.x = 411;
highScoreField.y = 18;
highScoreField.selectable = false;
_local3 = new TextFormat();
_local3.size = 48;
_local3.bold = true;
highScoreField.defaultTextFormat = _local3;
addChild(highScoreField);
highScoreField.visible = true;
if (beatCpu == true){
highScoreField.text = highScore.toString();
};
}
function frame31(){
stop();
}
public function click21Bombs(_arg1:MouseEvent){
bombStart.visible = false;
cpuTurn = true;
cpuAI();
}
function frame41(){
stop();
}
public function clickComputer(_arg1:MouseEvent){
if (outlet5a.currentFrame == 1){
if (haveCord1 == false){
infoBox.text = (("You try turning on the computer, but the " + "power cord is missing.\n\n") + "It's not going to work without a power cord!");
needCord = true;
} else {
infoBox.text = "You need to plug the computer into a wall outlet.";
};
} else {
if (cpuOn == false){
infoBox.text = "You turn on the computer.";
playSound(cpuBeep);
cpu5.gotoAndStop(2);
cpuOn = true;
myProgress = (myProgress + 10);
} else {
leaveRoom5();
bombNum = 0;
bombsLeft = 21;
takeAway = 0;
setupCpuGame();
};
};
}
function frame51(){
stop();
}
public function moveRight(_arg1:MouseEvent):void{
infoBox.text = "";
if (currentRoom == 1){
leaveRoom1();
setupRoom2();
} else {
if (currentRoom == 2){
leaveRoom2();
setupRoom3();
} else {
if (currentRoom == 3){
leaveRoom3();
setupRoom4();
} else {
if (currentRoom == 4){
leaveRoom4();
setupRoom1();
} else {
if (currentRoom == 5){
leaveRoom5();
setupRoom4();
} else {
if (currentRoom == 0){
setupRoom1();
myProgress = (myProgress + 1);
} else {
infoBox.text = "You can't go that way, sorry.";
};
};
};
};
};
};
}
public function removeInv():void{
key1.visible = false;
bandage1.visible = false;
cord1.visible = false;
cell1.visible = false;
hat2.visible = false;
bat5.visible = false;
}
public function clickSwitch3(_arg1:MouseEvent){
infoBox.text = "You press the switch on the wall.";
playSound(pressSwitch);
if (switch3.onOff == 2){
pic3.gotoAndStop(pic3.currentFrame);
fan3.gotoAndStop(1);
vase3a.gotoAndStop(1);
vase3b.gotoAndStop(1);
blinds3.gotoAndStop(1);
switch3.onOff = 0;
} else {
pic3.gotoAndPlay(pic3.currentFrame);
fan3.gotoAndPlay(1);
vase3a.gotoAndPlay(1);
vase3b.gotoAndPlay(1);
blinds3.gotoAndPlay(1);
switch3.onOff = (switch3.onOff + 1);
};
}
public function clickNum(_arg1:MouseEvent){
var _local2:keypad1;
_local2 = (_arg1.currentTarget as keypad1);
if (btn1 == 0){
btn1 = (_local2.num + 1);
} else {
if (btn2 == 0){
btn2 = (_local2.num + 1);
} else {
if (btn3 == 0){
btn3 = (_local2.num + 1);
} else {
if (btn4 == 0){
btn4 = (_local2.num + 1);
} else {
if (_local2.num != 10){
btn5 = 10000;
};
};
};
};
};
if (_local2.num != 10){
playSound(keypadBeep);
};
switch (_local2.num){
case 0:
infoBox.text = "You press 0 on the keypad";
break;
case 1:
infoBox.text = "You press 1 on the keypad";
break;
case 2:
infoBox.text = "You press 2 on the keypad";
break;
case 3:
infoBox.text = "You press 3 on the keypad";
break;
case 4:
infoBox.text = "You press 4 on the keypad";
break;
case 5:
infoBox.text = "You press 5 on the keypad";
break;
case 6:
infoBox.text = "You press 6 on the keypad";
break;
case 7:
infoBox.text = "You press 7 on the keypad";
break;
case 8:
infoBox.text = "You press 8 on the keypad";
break;
case 9:
infoBox.text = "You press 9 on the keypad";
break;
case 10:
infoBox.text = "You press the ENTER key on the keypad";
userCode4 = ((((((btn1 - 1) * 1000) + ((btn2 - 1) * 100)) + ((btn3 - 1) * 10)) + (btn4 - 1)) + btn5);
btn1 = 0;
btn2 = 0;
btn3 = 0;
btn4 = 0;
btn5 = 0;
checkCode();
break;
default:
infoBox.text = "You press a number on the keypad";
};
}
function frame61(){
stop();
}
public function clickBigScreen(_arg1:MouseEvent){
var _local2:uint;
_local2 = 9;
if (bigTV5.currentFrame == 1){
playSound(tvOff);
myProgress = (myProgress + 5);
};
if (bigTV5.currentFrame != _local2){
bigTV5.gotoAndStop((bigTV5.currentFrame + 1));
} else {
bigTV5.gotoAndStop(2);
};
if (bigTV5.currentFrame == 2){
infoBox.text = "This is the Fishing Channel.";
} else {
if (bigTV5.currentFrame == 3){
infoBox.text = ("This is the Flash Gaming Network. They're " + "annoucing the 'Flash Game of the Year Award'. Looks good.");
} else {
if (bigTV5.currentFrame == 4){
infoBox.text = (((<i>"and today's Lucky7 numbers were..."</i>
+ "\n10, 22, 28, 30, 33, 37, and 40.\n\n") + "Now we have an exciting story to report. 'Matching Animal Sounds v2.0' ") + "has been annouced as the 'Flash Game of the Year'.");
} else {
if (bigTV5.currentFrame == 5){
infoBox.text = ("This is the Racing Network. " + "A nice looking Indy car is on the screen now.");
} else {
if (bigTV5.currentFrame == 6){
infoBox.text = ("This is the Cryptography Channel.\n\n" + "Julius Ceasar is sending an encoded message to one of his generals.");
} else {
if (bigTV5.currentFrame == 7){
infoBox.text = "This is suppose to be Channel 6 News.";
} else {
if (bigTV5.currentFrame == 8){
infoBox.text = "This must be the Math Network. Hmm, looks boring.";
} else {
if (bigTV5.currentFrame == 9){
infoBox.text = "This tv channel is showing the Army's latest tank.";
};
};
};
};
};
};
};
};
}
function frame71(){
stop();
}
function frame81(){
stop();
}
public function clickCat(_arg1:MouseEvent){
if (tv1.currentFrame == 1){
playSound(cat);
} else {
playSound(madCat);
};
if ((((noteRead == true)) && ((dog1.room == 2)))){
petCat = true;
petDog = false;
moveDog();
};
}
public function clickOutlet5a(_arg1:MouseEvent){
if (haveCpuPower == true){
infoBox.text = "The computer is plugged into the outlet.";
} else {
if (haveCord1 == false){
infoBox.text = "A power outlet just waiting for a cord to be plugged into it.\n\n";
} else {
if (haveCpuPower == false){
infoBox.text = "You plug the power cord into the computer.";
playSound(tvOff);
haveCpuPower = true;
outlet5a.gotoAndStop(3);
cord1.visible = false;
haveCord1 = false;
myProgress = (myProgress + 10);
};
};
};
}
public function clickOutlet5b(_arg1:MouseEvent){
if (haveCord1 == true){
infoBox.text = (("The power cord you have is too short to reach this " + "power outlet from the computer. There is no way to move the computer ") + "with all this stuff in here.");
} else {
infoBox.text = "A power outlet just waiting for a cord to be plugged into it.\n\n";
};
}
public function clickCord(_arg1:MouseEvent){
if (needCord == true){
myProgress = (myProgress + 15);
infoBox.text = ("You yank the power cord from the TV.\n" + "You add it to your inventory.");
playSound(tvOff);
cord1.removeEventListener(MouseEvent.CLICK, clickCord);
tv1.gotoAndStop("no signal");
cord1.width = 65;
cord1.height = 55;
invPosition();
cord1.x = invX;
cord1.y = invY;
tv1.removeEventListener(MouseEvent.CLICK, clickTV1);
needCord = false;
haveCord1 = true;
cat1.gotoAndStop(1);
} else {
infoBox.text = "The tv cord seems loose.";
};
}
public function clickKeyPad(_arg1:MouseEvent){
if (currentRoom == 1){
leaveRoom1();
} else {
if (currentRoom == 2){
if (dog1.room == 2){
infoBox.text = ("As you go to touch the front door keypad, the " + "dog bites at your hand.");
} else {
leaveRoom2();
setupNumPad();
};
} else {
if (currentRoom == 4){
leaveRoom4();
setupNumPad();
};
};
};
}
public function clickBat(_arg1:MouseEvent){
infoBox.text = "You find a baseball bat.\n\nYou add it to your inventory.";
bat5.removeEventListener(MouseEvent.CLICK, clickBat);
haveBat = true;
bat5.width = 65;
bat5.height = 65;
invPosition();
bat5.x = invX;
bat5.y = invY;
}
public function checkForWin():void{
if (bombsLeft == 0){
if (cpuTurn == false){
infoBox.text = "You Lose. Take a break and try again later.";
playSound(evilLaugh);
} else {
infoBox.text = ("You forced the computer to take the last bomb!\n\n" + "You beat the computer!");
highScoreField.text = highScore.toString();
if (beatCpu == false){
myProgress = (myProgress + 20);
};
beatCpu = true;
};
take1.visible = false;
take2.visible = false;
take3.visible = false;
};
}
public function priceOfGas(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:String;
_local2 = Math.floor((_arg1 / 1000));
_local3 = Math.floor((_local2 / 100));
_local2 = (_local2 - (_local3 * 100));
_local4 = (((gasPrice + _local3) + ".") + String((_local2 + 100)).substr(1, 2));
return (_local4);
}
public function clickTable1(_arg1:MouseEvent){
if (haveKey1 == false){
infoBox.text = "A table with a locked drawer.";
} else {
infoBox.text = "You try your key on the locked drawer, but it won't open.";
};
}
public function clickTable5(_arg1:MouseEvent){
if (haveKey1 == false){
infoBox.text = "Your computer desk.\n\nThe drawer is locked close.";
} else {
if (openDrawer5 == false){
infoBox.text = ("You use your key to unlock and open the drawer.\n\n" + "Unfortunately, you don't find anything at all in the drawer.");
table5.gotoAndStop(1);
openDrawer5 = true;
myProgress = (myProgress + 5);
} else {
infoBox.text = "Just a plain desk with an empty drawer.";
};
};
}
public function timeElapsed(){
tvField = new TextField();
tvField.x = 139;
tvField.y = 395;
tvField.selectable = false;
progressField = new TextField();
progressField.x = 367;
progressField.y = 710;
progressField.selectable = false;
addChild(progressField);
gameTimeField = new TextField();
gameTimeField.x = 375;
gameTimeField.y = 610;
gameTimeField.multiline = true;
gameTimeField.selectable = false;
addChild(gameTimeField);
gameStartTime = getTimer();
gameTime = 0;
addEventListener(Event.ENTER_FRAME, showTime);
}
public function play_game(_arg1:MouseEvent):void{
gotoAndPlay("Begin");
}
public function clickChair(_arg1:MouseEvent){
chair1.addEventListener(Event.ENTER_FRAME, animateChair);
}
public function setupRoom3():void{
currentRoom = 3;
gotoAndStop("Room 3");
if (blinds3.created != 1){
blinds3.width = 161;
blinds3.height = 192;
blinds3.x = 83;
blinds3.y = 146;
blinds3.gotoAndStop(1);
addChild(blinds3);
blinds3.created = 1;
};
if (vase3b.created != 1){
vase3b.width = 78;
vase3b.height = 175;
vase3b.x = 215;
vase3b.y = 263;
vase3b.gotoAndStop(1);
addChild(vase3b);
vase3b.created = 1;
};
if (vase3a.created != 1){
vase3a.width = 70;
vase3a.height = 173;
vase3a.x = 299;
vase3a.y = 269;
vase3a.gotoAndStop(1);
addChild(vase3a);
vase3a.created = 1;
};
if (fan3.created != 1){
fan3.width = 197;
fan3.height = 126;
fan3.x = 683;
fan3.y = 62;
fan3.gotoAndStop(1);
addChild(fan3);
fan3.created = 1;
};
if (pic3.created != 1){
pic3.width = 144;
pic3.height = 127;
pic3.x = 491;
pic3.y = 155;
pic3.gotoAndStop(1);
addChild(pic3);
pic3.created = 1;
};
if (switch3.created != 1){
switch3.width = 35;
switch3.height = 67;
switch3.x = 789;
switch3.y = 215;
switch3.onOff = 0;
switch3.gotoAndStop(1);
switch3.addEventListener(MouseEvent.CLICK, clickSwitch3);
addChild(switch3);
switch3.created = 1;
};
if (paw3.created != 1){
paw3.width = 604;
paw3.height = 82;
paw3.x = 519;
paw3.y = 560;
paw3.gotoAndStop(1);
addChild(paw3);
paw3.created = 1;
paw3.visible = false;
};
if (dog1.room == 5){
paw3.visible = true;
};
if (cell1.created != 1){
cell1.width = 20;
cell1.height = 40;
cell1.x = 260;
cell1.y = 355;
cell1.gotoAndStop(1);
cell1.addEventListener(MouseEvent.CLICK, clickCell);
addChild(cell1);
cell1.created = 1;
};
if (pic1.created != 1){
pic1.width = 85;
pic1.height = 70;
pic1.x = 270;
pic1.y = 360;
pic1.gotoAndStop(1);
pic1.addEventListener(MouseEvent.CLICK, clickPic);
addChild(pic1);
pic1.created = 1;
};
if (bandage1.created != 1){
bandage1.width = 74;
bandage1.height = 63;
bandage1.x = 517;
bandage1.y = 321;
bandage1.gotoAndStop(1);
bandage1.addEventListener(MouseEvent.CLICK, clickBandage);
addChild(bandage1);
bandage1.visible = false;
bandage1.created = true;
};
if (bandageKey1.created != 1){
bandageKey1.width = 34;
bandageKey1.height = 92;
bandageKey1.x = 498;
bandageKey1.y = 330;
bandageKey1.gotoAndStop(1);
bandageKey1.addEventListener(MouseEvent.CLICK, clickbandageKey);
addChild(bandageKey1);
bandageKey1.created = 1;
};
if (chair1.created != 1){
chair1.width = 200;
chair1.height = 245;
chair1.x = 535;
chair1.y = 400;
chair1.gotoAndStop(1);
chair1.addEventListener(MouseEvent.CLICK, clickChair);
addChild(chair1);
chair1.created = 1;
};
blinds3.visible = true;
vase3a.visible = true;
vase3b.visible = true;
fan3.visible = true;
pic3.visible = true;
switch3.visible = true;
chair1.visible = true;
pic1.visible = true;
if (haveKey1 == false){
bandageKey1.visible = true;
} else {
bandage1.visible = true;
};
if (haveCell1 == false){
cell1.visible = true;
};
}
public function setupRoom4():void{
currentRoom = 4;
gotoAndStop("Room 4");
if (message4.created != 1){
message4.width = 47;
message4.height = 43;
message4.x = 259;
message4.y = 339;
message4.gotoAndStop(1);
message4.addEventListener(MouseEvent.CLICK, clickMessage4);
addChild(message4);
message4.created = 1;
};
if (keyPad4.created != 1){
keyPad4.width = 30;
keyPad4.height = 40;
keyPad4.x = 477;
keyPad4.y = 333;
keyPad4.gotoAndStop(1);
keyPad4.addEventListener(MouseEvent.CLICK, clickKeyPad);
addChild(keyPad4);
keyPad4.created = 1;
};
if (paw4.created != 1){
paw4.width = 80;
paw4.height = 90;
paw4.x = 335;
paw4.y = 553;
paw4.gotoAndStop(1);
addChild(paw4);
paw4.created = 1;
paw4.visible = false;
};
if (dog1.room == 5){
paw4.visible = true;
};
keyPad4.visible = true;
message4.visible = true;
}
public function leaveRoom1():void{
cat1.visible = false;
table1.visible = false;
tv1.visible = false;
if (haveCord1 == false){
cord1.visible = false;
};
tvField.visible = false;
}
public function leaveRoom5():void{
dog1.visible = false;
bigTV5.visible = false;
couch5.visible = false;
paw5.visible = false;
cpu5.visible = false;
if (haveBat == false){
bat5.visible = false;
};
outlet5a.visible = false;
outlet5b.visible = false;
table5.visible = false;
coffee5.visible = false;
bed5.visible = false;
}
public function setupRoom1():void{
currentRoom = 1;
gotoAndStop("Room 1");
infoBox.text = ((("You notice an open window. The " + "fresh air is helping a little, but ") + "you'd really like to climb out, if ") + "the window wasn't stuck where it is.");
if (table1.created != 1){
table1.width = 282;
table1.height = 188;
table1.x = 195;
table1.y = 507;
table1.gotoAndStop(2);
table1.addEventListener(MouseEvent.CLICK, clickTable1);
addChild(table1);
table1.created = 1;
};
if (tv1.created != 1){
tv1.width = 139.5;
tv1.height = 198;
tv1.x = 158;
tv1.y = 350;
tv1.gotoAndStop(1);
tv1.addEventListener(MouseEvent.CLICK, clickTV1);
addChild(tv1);
tv1.created = 1;
};
if (tvFieldCreated != 1){
addChild(tvField);
tvFieldCreated = 1;
} else {
tvField.visible = true;
};
if (cord1.created != 1){
cord1.width = 60;
cord1.height = 135;
cord1.x = 58;
cord1.y = 487;
cord1.gotoAndStop(1);
cord1.addEventListener(MouseEvent.CLICK, clickCord);
addChild(cord1);
cord1.created = 1;
};
if (cat1.created != 1){
cat1.width = 96;
cat1.height = 137;
cat1.x = 446;
cat1.y = 425;
cat1.gotoAndPlay(1);
cat1.addEventListener(MouseEvent.CLICK, clickCat);
addChild(cat1);
cat1.created = 1;
};
tv1.visible = true;
table1.visible = true;
cat1.visible = true;
if (haveCord1 == false){
cord1.visible = true;
};
}
public function setupRoom2():void{
currentRoom = 2;
gotoAndStop("Room 2");
if (keyPad2.created != 1){
keyPad2.width = 39;
keyPad2.height = 52;
keyPad2.x = 570;
keyPad2.y = 280;
keyPad2.gotoAndStop(1);
keyPad2.addEventListener(MouseEvent.CLICK, clickKeyPad);
addChild(keyPad2);
keyPad2.created = 1;
};
if (hat2.created != 1){
hat2.width = 89;
hat2.height = 91;
hat2.x = 277;
hat2.y = 204;
hat2.gotoAndStop(1);
hat2.addEventListener(MouseEvent.CLICK, clickHat);
addChild(hat2);
hat2.created = 1;
};
if (paw2.created != 1){
paw2.width = 103;
paw2.height = 40;
paw2.x = 734;
paw2.y = 508;
paw2.gotoAndStop(1);
addChild(paw2);
paw2.created = 1;
paw2.visible = false;
};
if (dog1.room == 5){
paw2.visible = true;
};
if (message2.created != 1){
message2.width = 64;
message2.height = 55;
message2.x = 434;
message2.y = 318;
message2.gotoAndStop(1);
message2.addEventListener(MouseEvent.CLICK, clickMessage2);
addChild(message2);
message2.created = 1;
};
if (dog1.created != 1){
dog1.width = 90;
dog1.height = 130;
dog1.x = 660;
dog1.y = 420;
dog1.room = 2;
dog1.gotoAndStop("puppy1");
dog1.addEventListener(MouseEvent.CLICK, clickDog);
addChild(dog1);
dog1.created = 1;
};
keyPad2.visible = true;
message2.visible = true;
if (dog1.room == 2){
dog1.visible = true;
} else {
dog1.visible = false;
};
if (haveHat2 == false){
hat2.visible = true;
};
}
public function playSound(_arg1:Object){
var _local2:SoundChannel;
_local2 = _arg1.play();
}
public function setupRoom5():void{
currentRoom = 5;
gotoAndStop("Room 5");
infoBox.text = (((("This is your bedroom. What a mess. Looks like all " + "the household furniture has been moved in here for the painting.\n\n") + "At least the paint fumes are a little less potent in here. ") + "To the right is the door you just came through and to the left ") + "is a bathroom.");
if (bigTV5.created != 1){
bigTV5.width = 288.5;
bigTV5.height = 248.4;
bigTV5.x = 214;
bigTV5.y = 348;
bigTV5.gotoAndStop(1);
bigTV5.addEventListener(MouseEvent.CLICK, clickBigScreen);
addChild(bigTV5);
bigTV5.created = 1;
};
if (outlet5a.created != 1){
outlet5a.width = 18;
outlet5a.height = 27;
outlet5a.x = 403;
outlet5a.y = 375;
outlet5a.gotoAndStop(1);
outlet5a.addEventListener(MouseEvent.CLICK, clickOutlet5a);
addChild(outlet5a);
outlet5a.created = 1;
};
if (outlet5b.created != 1){
outlet5b.width = 20;
outlet5b.height = 30;
outlet5b.x = 715;
outlet5b.y = 465;
outlet5b.gotoAndStop(2);
outlet5b.addEventListener(MouseEvent.CLICK, clickOutlet5b);
addChild(outlet5b);
outlet5b.created = 1;
};
if (table5.created != 1){
table5.width = 190;
table5.height = 129;
table5.x = 455;
table5.y = 396;
table5.gotoAndStop(2);
table5.addEventListener(MouseEvent.CLICK, clickTable5);
addChild(table5);
table5.created = 1;
};
if (bat5.created != 1){
bat5.width = 50;
bat5.height = 160;
bat5.x = 602;
bat5.y = 370;
bat5.gotoAndStop(1);
bat5.addEventListener(MouseEvent.CLICK, clickBat);
addChild(bat5);
bat5.created = 1;
};
if (bed5.created != 1){
bed5.width = 322;
bed5.height = 243;
bed5.x = 550;
bed5.y = 465;
bed5.gotoAndStop(1);
addChild(bed5);
bed5.created = 1;
};
if (couch5.created != 1){
couch5.width = 383;
couch5.height = 172;
couch5.x = 259;
couch5.y = 511;
couch5.gotoAndStop(1);
couch5.addEventListener(MouseEvent.CLICK, clickCouch);
addChild(couch5);
couch5.created = 1;
couch5.visible = false;
};
if (paw5.created != 1){
paw5.width = 65;
paw5.height = 55;
paw5.x = 725;
paw5.y = 545;
paw5.gotoAndStop(1);
addChild(paw5);
paw5.created = 1;
paw5.visible = false;
};
if (cpu5.created != 1){
cpu5.width = 100;
cpu5.height = 90;
cpu5.x = 435;
cpu5.y = 330;
cpu5.gotoAndStop(1);
cpu5.addEventListener(MouseEvent.CLICK, clickComputer);
addChild(cpu5);
cpu5.created = 1;
};
if (coffee5.created != 1){
coffee5.width = 42;
coffee5.height = 50;
coffee5.x = 507;
coffee5.y = 342;
coffee5.gotoAndStop(1);
coffee5.addEventListener(MouseEvent.CLICK, clickCoffee);
addChild(coffee5);
coffee5.created = 1;
};
bed5.visible = true;
coffee5.visible = true;
table5.visible = true;
outlet5a.visible = true;
outlet5b.visible = true;
bat5.visible = true;
cpu5.visible = true;
couch5.visible = true;
bigTV5.visible = true;
if (dog1.room == 5){
dog1.visible = true;
paw5.visible = true;
};
}
public function clickContinue(_arg1:MouseEvent){
continueGame.removeEventListener(MouseEvent.CLICK, clickContinue);
removeChild(continueGame);
clearKeypad();
infoBox.text = "";
usingKeyPad = false;
if (currentRoom == 1){
setupRoom1();
} else {
if (currentRoom == 2){
setupRoom2();
} else {
if (currentRoom == 3){
setupRoom3();
} else {
if (currentRoom == 4){
setupRoom4();
} else {
if (currentRoom == 5){
setupRoom5();
};
};
};
};
};
}
public function leaveRoom2():void{
message2.visible = false;
dog1.visible = false;
paw2.visible = false;
if (haveHat2 == false){
hat2.visible = false;
};
keyPad2.visible = false;
}
public function leaveRoom3():void{
chair1.visible = false;
bandageKey1.visible = false;
if (haveBandage1 == false){
bandage1.visible = false;
};
pic1.visible = false;
if (haveCell1 == false){
cell1.visible = false;
};
paw3.visible = false;
switch3.visible = false;
pic3.visible = false;
fan3.visible = false;
vase3a.visible = false;
vase3b.visible = false;
blinds3.visible = false;
}
public function leaveRoom4():void{
paw4.visible = false;
keyPad4.visible = false;
message4.visible = false;
}
public function clearKeypad():void{
var _local1:uint;
var _local2:uint;
_local1 = 0;
while (_local1 < 11) {
removeChild(allKeypadBtns[_local1]);
allKeypadBtns[_local1].removeEventListener(MouseEvent.CLICK, clickNum);
_local1++;
};
_local2 = 0;
_local1 = 0;
while (_local1 < 11) {
allKeypadBtns.splice(_local2, 1);
_local1++;
};
}
public function clickDog(_arg1:MouseEvent){
playSound(dog);
petDog = true;
counter = 0;
dog1.addEventListener(Event.ENTER_FRAME, animateDog);
}
public function animateDog(_arg1:Event){
var _local2:*;
if (dog1.currentFrame == 1){
dog1.gotoAndStop((dog1.currentFrame + 1));
} else {
dog1.gotoAndStop(1);
};
counter++;
_local2 = (Math.floor((Math.random() * 9)) + Math.floor((Math.random() * 9)));
if (counter > _local2){
dog1.removeEventListener(Event.ENTER_FRAME, animateDog);
};
}
public function clickLeaveGame(_arg1:MouseEvent){
leaveCpuGame.removeEventListener(MouseEvent.CLICK, clickLeaveGame);
removeChild(leaveCpuGame);
clearCpu();
removeChild(highScoreField);
playingCpuGame = false;
setupRoom5();
infoBox.text = "Click computer to play '21 Bombs' anytime.";
}
public function clickMessage2(_arg1:MouseEvent){
infoBox.text = (((("You find a note on the door. It reads...\n\n" + "Now that I'm done with installing these keypad's, I ") + "decided to paint the place. Went to get more paint. Brb. ") + "Please pet the cat, and then pet the dog. ") + "I hope I can remember the keycode to get back in! Ha.\n");
if (noteRead == false){
myProgress = (myProgress + 5);
};
noteRead = true;
}
public function clickMessage4(_arg1:MouseEvent){
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:String;
_local2 = room4ColorB[0];
_local3 = room4ColorB[1];
_local4 = room4ColorB[2];
_local5 = room4ColorB[3];
infoBox.text = (((((((((("You find a note near your bedroom door. It reads...\n\n" + "Thought you should know that I've decided to paint your room tomorrow. ") + "I'm starting with ") + _local2) + ", then ") + _local3) + ", then ") + _local4) + ", and finally ") + _local5) + ". Hope you like it!");
}
public function clickbandageKey(_arg1:MouseEvent){
infoBox.text = "You found a key!\nIt's been added to your inventory.";
bandageKey1.visible = false;
bandageKey1.removeEventListener(MouseEvent.CLICK, clickbandageKey);
removeChild(bandageKey1);
haveKey1 = true;
bandage1.visible = true;
key1.width = 65;
key1.height = 65;
invPosition();
key1.x = invX;
key1.y = invY;
addChild(key1);
myProgress = (myProgress + 10);
}
public function clickPic(_arg1:MouseEvent){
infoBox.text = "You knock the picture over...oops!";
playSound(pictureBreaking);
pic1.addEventListener(Event.ENTER_FRAME, animatePic);
}
public function animatePic(_arg1:Event){
if (pic1.currentFrame != 13){
pic1.gotoAndStop((pic1.currentFrame + 1));
} else {
pic1.removeEventListener(Event.ENTER_FRAME, animatePic);
pic1.removeEventListener(MouseEvent.CLICK, clickPic);
};
}
public function clickCouch(_arg1:MouseEvent){
infoBox.text = (((("You search the couch and under one cushion you find " + "an old paper titled 'Cipher 101'.\n\n") + "DEFGHI...ABC (encrypted)\n") + "ABCDEF...XYZ (decrypted)\n\n") + "It doesn't interest you, so you leave it.");
if (foundSolution == false){
myProgress = (myProgress + 5);
};
foundSolution = true;
}
public function clickCell(_arg1:MouseEvent){
infoBox.text = (("You find a cell phone.\n\n" + "Unfortunately it doesn't seem to have any reception in the house at this moment.\n\n") + "You add it to your inventory.");
cell1.removeEventListener(MouseEvent.CLICK, clickCell);
cell1.width = 65;
cell1.height = 65;
invPosition();
cell1.x = invX;
cell1.y = invY;
haveCell1 = true;
}
public function checkCode():void{
var _local1:TextFormat;
if (currentRoom == 4){
if (userCode4 == bedroomCode){
infoBox.text = ("You input the correct code!\n\n" + "Press CONTINUE to enter bedroom.");
playSound(doorOpen);
userCode4 = 0;
leaveRoom4();
currentRoom = 5;
} else {
infoBox.text = "The door doesn't open. Wrong code.";
playSound(wrongCode);
};
} else {
if (currentRoom == 2){
if (userCode4 != frontDoorCode){
infoBox.text = "The front door doesn't open. Wrong code.";
playSound(wrongCode);
} else {
infoBox.text = "";
continueGame.removeEventListener(MouseEvent.CLICK, clickContinue);
removeChild(continueGame);
rArrow.visible = false;
lArrow.visible = false;
progressField.text = "";
removeEventListener(Event.ENTER_FRAME, showTime);
clearKeypad();
removeInv();
gotoAndStop("Win Game");
_local1 = new TextFormat("Arial", 50, 0, true);
gameTimeField.defaultTextFormat = _local1;
gameTimeField.width = 500;
gameTimeField.height = 0xFF;
gameTimeField.x = 10;
gameTimeField.y = 300;
gameTimeField.text = ("Time: " + clockTime(gameTime));
};
};
};
}
public function setBedroomCode():void{
var _local1:uint;
var _local2:uint;
_local1 = 0;
while (_local1 < 4) {
_local2 = Math.floor((Math.random() * room4CodeA.length));
room4CodeB[_local1] = room4CodeA[_local2];
room4CodeA.splice(_local2, 1);
room4ColorB[_local1] = room4ColorA[_local2];
room4ColorA.splice(_local2, 1);
_local1++;
};
code4a = room4CodeB[0];
code4b = room4CodeB[1];
code4c = room4CodeB[2];
code4d = room4CodeB[3];
bedroomCode = ((((code4a * 1000) + (code4b * 100)) + (code4c * 10)) + code4d);
}
public function clickTV1(_arg1:MouseEvent){
var _local2:uint;
_local2 = 8;
if (tv1.currentFrame != _local2){
tv1.gotoAndStop((tv1.currentFrame + 1));
} else {
tv1.gotoAndStop(1);
};
cat1.gotoAndStop(1);
if (tv1.currentFrame == 1){
infoBox.text = ("This is the fishing channel. " + "The cat seems to enjoy this channel.");
cat1.gotoAndPlay(1);
} else {
if (tv1.currentFrame == 2){
infoBox.text = "This tv channel is showing a DQ comercial.";
} else {
if (tv1.currentFrame == 3){
infoBox.text = "You switch the channel and find a Circus show.";
} else {
if (tv1.currentFrame == 4){
infoBox.text = "HDTV. An impressive looking channel.";
} else {
if (tv1.currentFrame == 5){
infoBox.text = "This tv channel is doing a lottery drawing.";
} else {
if (tv1.currentFrame == 6){
infoBox.text = "Channel 6 News is showing the current price of gas in your area.";
} else {
if (tv1.currentFrame == 7){
infoBox.text = "Channel 7 News is showing a massive selloff in the Stock Market.";
} else {
if (tv1.currentFrame == 8){
infoBox.text = "This tv channel is taking a live poll.";
if ((((haveCell1 == true)) && ((haveCalled == false)))){
playSound(phone);
infoBox.text = (("You suddenly get reception on your cell phone and " + "decide to call in to vote in the poll. But just as soon as ") + "your vote is registered, you lose cell phone reception.");
haveCalled = true;
myScore = (myScore + 10000);
};
};
};
};
};
};
};
};
};
}
public function showTime(_arg1:Event){
gameTime = (getTimer() - gameStartTime);
myScore = (myScore - (Math.floor((Math.random() * 50)) + 25));
myHealth = (myHealth - Math.floor((Math.random() * 2)));
gameTimeField.text = ("Time: " + clockTime(gameTime));
progressField.text = (("Progress: " + myProgress.toString()) + "%");
if (tv1.currentFrame == 6){
tvField.text = (("$" + priceOfGas(gameTime)) + "/gal");
} else {
if (tv1.currentFrame == 7){
tvField.text = (myScore / 100).toString();
} else {
if (tv1.currentFrame == 8){
tvField.text = ((myHealth / 100).toString() + "%");
} else {
tvField.text = "";
};
};
};
if ((((myHealth < 9900)) && ((myHealth > 9897)))){
infoBox.text = "You're getting a mild headache from all the paint fumes.";
};
if ((((myHealth < 1000)) && ((myHealth > 997)))){
infoBox.text = "You feel very lightheaded. Seek fresh air soon!";
};
if ((((((myHealth < 1)) && ((usingKeyPad == false)))) && ((playingCpuGame == false)))){
infoBox.text = (("You just passed out from all the paint fumes!" + "\n\nHope you enjoyed the game though.\n\n") + "Thanks for playing! Try again soon!");
if (currentRoom == 1){
leaveRoom1();
} else {
if (currentRoom == 2){
leaveRoom2();
} else {
if (currentRoom == 3){
leaveRoom3();
} else {
if (currentRoom == 4){
leaveRoom4();
} else {
if (currentRoom == 5){
leaveRoom5();
};
};
};
};
};
rArrow.visible = false;
lArrow.visible = false;
removeEventListener(Event.ENTER_FRAME, showTime);
playSound(passedOut);
gotoAndStop("Lose Game");
};
frames++;
if ((((((switch3.onOff == 1)) && ((currentRoom == 3)))) && ((frames >= 5)))){
playSound(fan);
frames = 0;
} else {
if ((((switch3.onOff == 2)) && ((currentRoom == 3)))){
playSound(fan);
};
};
}
public function moveLeft(_arg1:MouseEvent):void{
infoBox.text = "";
if (currentRoom == 3){
leaveRoom3();
setupRoom2();
} else {
if (currentRoom == 2){
leaveRoom2();
setupRoom1();
} else {
if (currentRoom == 1){
leaveRoom1();
setupRoom4();
} else {
if (currentRoom == 4){
leaveRoom4();
setupRoom3();
} else {
if (currentRoom == 5){
infoBox.text = "You don't want to go in there, trust me.";
} else {
if (currentRoom == 0){
setupRoom1();
myProgress = (myProgress + 1);
} else {
infoBox.text = "You can't go that way, sorry.";
};
};
};
};
};
};
}
public function clickCoffee(_arg1:MouseEvent){
coffee5.gotoAndStop(2);
infoBox.text = ("You drink the coffee and eat the cookie.\n\n" + "You feel a little better now.");
myHealth = (myHealth + 1000);
coffee5.removeEventListener(MouseEvent.CLICK, clickCoffee);
coffee5.y = (coffee5.y + 20);
}
public function moveDog():void{
dog1.room = 5;
dog1.width = 79;
dog1.height = 100;
dog1.x = 652;
dog1.y = 549;
myProgress = (myProgress + 9);
}
public function cpuAI():void{
var _local1:*;
var _local2:uint;
_local2 = (Math.floor((Math.random() * 2)) + 1);
_local1 = takeAway;
if (bombsLeft == 1){
takeAway = 1;
} else {
if (bombsLeft < 5){
takeAway = (bombsLeft - 1);
} else {
if ((((((bombsLeft < 9)) && ((bombsLeft > 5)))) && ((beatCpu == true)))){
takeAway = (bombsLeft - 5);
} else {
if ((((((bombsLeft < 13)) && ((bombsLeft > 9)))) && ((beatCpu == true)))){
takeAway = (bombsLeft - 9);
} else {
if ((((((bombsLeft < 17)) && ((bombsLeft > 13)))) && ((beatCpu == true)))){
takeAway = (bombsLeft - 13);
} else {
takeAway = _local2;
};
};
};
};
};
if (_local1 == 0){
infoBox.text = ((("Computer takes away " + takeAway) + " bomb(s).\n\n") + "Your turn.");
} else {
infoBox.appendText(((("Computer takes away " + takeAway) + " bomb(s).\n\n") + "Your turn."));
};
removeBombs();
cpuTurn = false;
}
public function clickTake1(_arg1:MouseEvent){
if (bombStart.visible == true){
infoBox.text = "Click the Start button to begin a new game.";
} else {
infoBox.text = "You take 1 bomb away.\n\n";
takeAway = 1;
removeBombs();
if (bombsLeft > 0){
cpuTurn = true;
cpuAI();
};
};
}
public function clickTake2(_arg1:MouseEvent){
if (bombStart.visible == true){
infoBox.text = "Click the Start button to begin a new game.";
} else {
if (bombsLeft > 1){
infoBox.text = "You take 2 bombs away.\n\n";
takeAway = 2;
removeBombs();
if (bombsLeft > 0){
cpuTurn = true;
cpuAI();
};
} else {
infoBox.text = "Not that many bombs left to take. Try again.";
};
};
}
public function clickTake3(_arg1:MouseEvent){
if (bombStart.visible == true){
infoBox.text = "Click the Start button to begin a new game.";
} else {
if (bombsLeft > 2){
infoBox.text = "You take 3 bombs away\n\n";
takeAway = 3;
removeBombs();
if (bombsLeft > 0){
cpuTurn = true;
cpuAI();
};
} else {
infoBox.text = "Not that many bombs left to take. Try again.";
};
};
}
public function removeBombs():void{
var _local1:uint;
_local1 = 0;
while (_local1 < takeAway) {
allBombs[bombNum].visible = false;
bombsLeft--;
bombNum++;
_local1++;
};
checkForWin();
}
public function clickHat(_arg1:MouseEvent){
infoBox.text = ("A witch's hat. With nothing better to " + "do with it, you decide to wear it.");
haveHat2 = true;
hat2.removeEventListener(MouseEvent.CLICK, clickHat);
hat2.width = 65;
hat2.height = 65;
invPosition();
hat2.x = invX;
hat2.y = invY;
}
public function clockTime(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:String;
_local2 = Math.floor((_arg1 / 1000));
_local3 = Math.floor((_local2 / 60));
_local2 = (_local2 - (_local3 * 60));
_local4 = ((_local3 + ":") + String((_local2 + 100)).substr(1, 2));
return (_local4);
}
}
}//package
Section 23
//evilLaughSnd (evilLaughSnd)
package {
import flash.media.*;
public dynamic class evilLaughSnd extends Sound {
}
}//package
Section 24
//fanSnd (fanSnd)
package {
import flash.media.*;
public dynamic class fanSnd extends Sound {
}
}//package
Section 25
//glassbreakingSnd (glassbreakingSnd)
package {
import flash.media.*;
public dynamic class glassbreakingSnd extends Sound {
}
}//package
Section 26
//hookWithKeys (hookWithKeys)
package {
import flash.display.*;
public dynamic class hookWithKeys extends MovieClip {
}
}//package
Section 27
//hookWithoutKeys (hookWithoutKeys)
package {
import flash.display.*;
public dynamic class hookWithoutKeys extends MovieClip {
}
}//package
Section 28
//key (key)
package {
import flash.display.*;
public dynamic class key extends MovieClip {
}
}//package
Section 29
//keypad1 (keypad1)
package {
import flash.display.*;
public dynamic class keypad1 extends MovieClip {
}
}//package
Section 30
//kitty (kitty)
package {
import flash.display.*;
public dynamic class kitty extends MovieClip {
}
}//package
Section 31
//ladder1 (ladder1)
package {
import flash.display.*;
public dynamic class ladder1 extends MovieClip {
}
}//package
Section 32
//leftArrow (leftArrow)
package {
import flash.display.*;
public dynamic class leftArrow extends MovieClip {
}
}//package
Section 33
//lightSwitch1 (lightSwitch1)
package {
import flash.display.*;
public dynamic class lightSwitch1 extends MovieClip {
}
}//package
Section 34
//lillyVase (lillyVase)
package {
import flash.display.*;
public dynamic class lillyVase extends MovieClip {
}
}//package
Section 35
//madCatSnd (madCatSnd)
package {
import flash.media.*;
public dynamic class madCatSnd extends Sound {
}
}//package
Section 36
//message (message)
package {
import flash.display.*;
public dynamic class message extends MovieClip {
}
}//package
Section 37
//numberKeyPad (numberKeyPad)
package {
import flash.display.*;
public dynamic class numberKeyPad extends MovieClip {
}
}//package
Section 38
//openDoorSnd (openDoorSnd)
package {
import flash.media.*;
public dynamic class openDoorSnd extends Sound {
}
}//package
Section 39
//outlet (outlet)
package {
import flash.display.*;
public dynamic class outlet extends MovieClip {
}
}//package
Section 40
//pawPrints2 (pawPrints2)
package {
import flash.display.*;
public dynamic class pawPrints2 extends MovieClip {
}
}//package
Section 41
//pawPrints3 (pawPrints3)
package {
import flash.display.*;
public dynamic class pawPrints3 extends MovieClip {
}
}//package
Section 42
//pawPrints4 (pawPrints4)
package {
import flash.display.*;
public dynamic class pawPrints4 extends MovieClip {
}
}//package
Section 43
//pawPrints5 (pawPrints5)
package {
import flash.display.*;
public dynamic class pawPrints5 extends MovieClip {
}
}//package
Section 44
//pcBeepSnd (pcBeepSnd)
package {
import flash.media.*;
public dynamic class pcBeepSnd extends Sound {
}
}//package
Section 45
//picture1 (picture1)
package {
import flash.display.*;
public dynamic class picture1 extends MovieClip {
}
}//package
Section 46
//picture3 (picture3)
package {
import flash.display.*;
public dynamic class picture3 extends MovieClip {
}
}//package
Section 47
//powerCord (powerCord)
package {
import flash.display.*;
public dynamic class powerCord extends MovieClip {
}
}//package
Section 48
//puppy (puppy)
package {
import flash.display.*;
public dynamic class puppy extends MovieClip {
}
}//package
Section 49
//rightArrow (rightArrow)
package {
import flash.display.*;
public dynamic class rightArrow extends MovieClip {
}
}//package
Section 50
//roseVase (roseVase)
package {
import flash.display.*;
public dynamic class roseVase extends MovieClip {
}
}//package
Section 51
//switchSnd (switchSnd)
package {
import flash.media.*;
public dynamic class switchSnd extends Sound {
}
}//package
Section 52
//tv (tv)
package {
import flash.display.*;
public dynamic class tv extends MovieClip {
public function tv(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 53
//tvOffSnd (tvOffSnd)
package {
import flash.media.*;
public dynamic class tvOffSnd extends Sound {
}
}//package
Section 54
//window2 (window2)
package {
import flash.display.*;
public dynamic class window2 extends MovieClip {
}
}//package
Section 55
//witchHat (witchHat)
package {
import flash.display.*;
public dynamic class witchHat extends MovieClip {
}
}//package
Section 56
//wrongCodeSnd (wrongCodeSnd)
package {
import flash.media.*;
public dynamic class wrongCodeSnd extends Sound {
}
}//package
Section 57
//youLoseSnd (youLoseSnd)
package {
import flash.media.*;
public dynamic class youLoseSnd extends Sound {
}
}//package