Section 1
//Cat (com.kennethwarner.petSpa.Cat)
package com.kennethwarner.petSpa {
public class Cat extends Pet {
public function Cat(_arg1:uint, _arg2:Array, _arg3:Object){
super(_arg1, _arg2, _arg3);
petType = "Cat";
init();
}
private function init():void{
super.setCurrentBitmap();
super.setInitialPixels();
}
}
}//package com.kennethwarner.petSpa
Section 2
//Cat1 (com.kennethwarner.petSpa.Cat1)
package com.kennethwarner.petSpa {
public class Cat1 extends Cat {
public function Cat1(_arg1:uint, _arg2:Array, _arg3:Object){
super(_arg1, _arg2, _arg3);
petSubType = "Cat1";
}
}
}//package com.kennethwarner.petSpa
Section 3
//Cat2 (com.kennethwarner.petSpa.Cat2)
package com.kennethwarner.petSpa {
public class Cat2 extends Cat {
public function Cat2(_arg1:uint, _arg2:Array, _arg3:Object){
super(_arg1, _arg2, _arg3);
petSubType = "Cat2";
}
}
}//package com.kennethwarner.petSpa
Section 4
//Dog (com.kennethwarner.petSpa.Dog)
package com.kennethwarner.petSpa {
import flash.display.*;
public class Dog extends Pet {
public var cut:MovieClip;
public var cutHolder:MovieClip;
var testString2:String;// = "Poopy"
public function Dog(_arg1:uint, _arg2:Array, _arg3:Object, _arg4:uint){
testString2 = "Poopy";
super(_arg1, _arg2, _arg3);
cutHexColor = _arg4;
petType = "Dog";
init();
}
private function init():void{
super.colorizeMovieClip(cut.cutColor, cutHexColor);
if (tasksObject.Cut == true){
transformMatrix.tx = cut.x;
transformMatrix.ty = cut.y;
cutBitmapData = new BitmapData(this.width, this.height, true, 0);
cutBitmapData.draw(cut, transformMatrix);
cutBitmap = new Bitmap(cutBitmapData);
cutHolder.addChild(cutBitmap);
cut.visible = false;
} else {
cut.visible = false;
};
super.setCurrentBitmap();
super.setInitialPixels();
}
}
}//package com.kennethwarner.petSpa
Section 5
//Dog1 (com.kennethwarner.petSpa.Dog1)
package com.kennethwarner.petSpa {
public class Dog1 extends Dog {
public function Dog1(_arg1:uint, _arg2:Array, _arg3:Object, _arg4:uint){
super(_arg1, _arg2, _arg3, _arg4);
petSubType = "Dog1";
}
}
}//package com.kennethwarner.petSpa
Section 6
//Dog2 (com.kennethwarner.petSpa.Dog2)
package com.kennethwarner.petSpa {
public class Dog2 extends Dog {
public function Dog2(_arg1:uint, _arg2:Array, _arg3:Object, _arg4:uint){
super(_arg1, _arg2, _arg3, _arg4);
petSubType = "Dog2";
}
}
}//package com.kennethwarner.petSpa
Section 7
//Dog3 (com.kennethwarner.petSpa.Dog3)
package com.kennethwarner.petSpa {
public class Dog3 extends Dog {
public function Dog3(_arg1:uint, _arg2:Array, _arg3:Object, _arg4:uint){
super(_arg1, _arg2, _arg3, _arg4);
petSubType = "Dog3";
}
}
}//package com.kennethwarner.petSpa
Section 8
//Dog4 (com.kennethwarner.petSpa.Dog4)
package com.kennethwarner.petSpa {
public class Dog4 extends Dog {
public function Dog4(_arg1:uint, _arg2:Array, _arg3:Object, _arg4:uint){
super(_arg1, _arg2, _arg3, _arg4);
petSubType = "Dog4";
}
}
}//package com.kennethwarner.petSpa
Section 9
//GameClock (com.kennethwarner.petSpa.GameClock)
package com.kennethwarner.petSpa {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class GameClock extends MovieClip {
private var gameTimeLimit:Number;
private var gameTimeCounter:Number;// = 0
private var minuteHandStartRotation:Number;
private var adjustedGameTimeLimit:Number;
private var totalHourHandRotation:Number;// = 240
private var gameTimer:Timer;
private var timerFrequency:Number;// = 250
private var hourHandStartRotation:Number;
private var totalMinuteHandRotation:Number;// = 2880
public var minuteHand:MovieClip;
private var hourHandRotationPerTimerTick:Number;
private var minuteHandRotationPerTimerTick:Number;
public var hourHand:MovieClip;
public function GameClock(){
gameTimeCounter = 0;
gameTimeLimit = PetSpa.gameTimeInSeconds;
totalMinuteHandRotation = 2880;
totalHourHandRotation = 240;
timerFrequency = 250;
adjustedGameTimeLimit = (gameTimeLimit * (1000 / timerFrequency));
minuteHandRotationPerTimerTick = (totalMinuteHandRotation / adjustedGameTimeLimit);
hourHandRotationPerTimerTick = (totalHourHandRotation / adjustedGameTimeLimit);
init();
}
function startGameClock():void{
trace("startGameClock() called.");
gameTimer = new Timer(timerFrequency, 0);
gameTimer.addEventListener(TimerEvent.TIMER, checkTime);
gameTimer.start();
}
private function checkTime(_arg1:TimerEvent):void{
var _local2:*;
if (PetSpa.gamePaused == false){
_local2 = (gameTimeCounter + 1);
gameTimeCounter = _local2;
minuteHand.rotation = (minuteHand.rotation + minuteHandRotationPerTimerTick);
hourHand.rotation = (hourHand.rotation + hourHandRotationPerTimerTick);
_arg1.updateAfterEvent();
if (gameTimeCounter >= adjustedGameTimeLimit){
endGame();
};
};
}
private function init():void{
hourHandStartRotation = hourHand.rotation;
minuteHandStartRotation = minuteHand.rotation;
}
function stopClock():void{
gameTimer.stop();
gameTimer.removeEventListener(TimerEvent.TIMER, checkTime);
}
private function endGame():void{
gameTimer.stop();
gameTimer.removeEventListener(TimerEvent.TIMER, checkTime);
dispatchEvent(new Event("quitting_time"));
}
function reset():void{
gameTimeCounter = 0;
hourHand.rotation = hourHandStartRotation;
minuteHand.rotation = minuteHandStartRotation;
}
function ():void{
}
}
}//package com.kennethwarner.petSpa
Section 10
//GameMeter (com.kennethwarner.petSpa.GameMeter)
package com.kennethwarner.petSpa {
import flash.events.*;
import flash.display.*;
public class GameMeter extends MovieClip {
public var liquid:MovieClip;
var previousControlPercentage:Number;
public var bottle:MovieClip;
var controlPercentage:Number;// = 100
public function GameMeter(){
controlPercentage = 100;
previousControlPercentage = controlPercentage;
init();
}
private function init():void{
}
function reset():void{
controlPercentage = 100;
updateMeter();
}
private function endGame():void{
updateMeter();
dispatchEvent(new Event("control_meter_at_zero"));
}
function loseControl(_arg1:uint):void{
controlPercentage = (controlPercentage - _arg1);
if (controlPercentage <= 0){
controlPercentage = 0;
endGame();
} else {
updateMeter();
if ((((controlPercentage <= 10)) && ((previousControlPercentage > 10)))){
dispatchEvent(new Event("control_meter_at_ten"));
} else {
if ((((controlPercentage <= 20)) && ((previousControlPercentage > 30)))){
dispatchEvent(new Event("control_meter_at_twenty"));
} else {
if ((((controlPercentage <= 30)) && ((previousControlPercentage > 50)))){
dispatchEvent(new Event("control_meter_at_thirty"));
dispatchEvent(new Event("speed_up_game_music"));
};
};
};
};
previousControlPercentage = controlPercentage;
}
private function updateMeter():void{
liquid.gotoAndStop((101 - Math.ceil(controlPercentage)));
}
function gainControl(_arg1:uint):void{
trace((("gainControl(" + _arg1) + ") called."));
controlPercentage = (controlPercentage + _arg1);
if (controlPercentage > 100){
controlPercentage = 100;
};
if ((((previousControlPercentage <= 30)) && ((controlPercentage > 50)))){
dispatchEvent(new Event("slow_down_game_music"));
};
updateMeter();
previousControlPercentage = controlPercentage;
}
}
}//package com.kennethwarner.petSpa
Section 11
//Pet (com.kennethwarner.petSpa.Pet)
package com.kennethwarner.petSpa {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class Pet extends MovieClip {
var remainingTasksArray:Array;
var currentBitmap:Bitmap;
var cutBitmap:Bitmap;
public var eye:MovieClip;
var angerSoundPlayed:Boolean;// = false
var petNeglectCounter:uint;// = 0
var brushBitmapData:BitmapData;
var transformMatrix:Matrix;
var tasksObject:Object;
var numberOfTasks:uint;
var accessoriesBitmap:Bitmap;
var accessoriesObject:Object;
private var petTimerFrequency:uint;// = 1000
public var wash:MovieClip;
var accessoriesMaskBitmap:Bitmap;
public var cleanup:MovieClip;
var currentTask:String;
var washBitmap:Bitmap;
var accessoriesBitmapData:BitmapData;
var petHappiness:uint;// = 100
public var base:MovieClip;
var accessoriesMaskBitmapData:BitmapData;
var cleanupBitmap:Bitmap;
var baseHexColor:uint;
private var petNeglected:Boolean;// = false
var petType:String;
public var accessoriesMaskHolder:MovieClip;
var brushBitmap:Bitmap;
public var accessoriesHolder:MovieClip;
var waitingForRemoval:Boolean;// = false
public var washHolder:MovieClip;
public var accessories:MovieClip;
public var brush:MovieClip;
var cleanupBitmapData:BitmapData;
var testString1:String;// = "Poop"
var currentTaskTool:String;
var cutBitmapData:BitmapData;
public var treatAlert:MovieClip;
private var petTimer:Timer;
var cutHexColor:uint;
var tasksArray:Array;
var stageWidth:uint;// = 810
public var cleanupHolder:MovieClip;
var washBitmapData:BitmapData;
var petSubType:String;
var numberOfTasksCompleted:uint;// = 0
public var brushHolder:MovieClip;
var angerSoundCounter:uint;// = 0
var initialPixelsObject:Object;
var petAngry:Boolean;// = false
var stageHeight:uint;// = 595
public var speak:MovieClip;
public function Pet(_arg1:uint, _arg2:Array, _arg3:Object){
testString1 = "Poop";
stageWidth = 810;
stageHeight = 595;
petTimerFrequency = 1000;
petNeglected = false;
petAngry = false;
petNeglectCounter = 0;
petHappiness = 100;
angerSoundPlayed = false;
angerSoundCounter = 0;
transformMatrix = new Matrix();
tasksArray = new Array();
remainingTasksArray = new Array();
numberOfTasksCompleted = 0;
accessoriesObject = new Object();
waitingForRemoval = false;
tasksObject = {Cut:false, Wash:false, Brush:false, Accessorize:false, Cleanup:true};
initialPixelsObject = {Cut:0, Wash:0, Brush:0, Accessorize:0, Cleanup:0};
baseHexColor = _arg1;
tasksArray = _arg2.slice();
remainingTasksArray = _arg2.slice();
accessoriesObject = _arg3;
init();
}
function die():void{
trace("die() called on pet instance.");
stopPetTimer();
petTimer.removeEventListener(TimerEvent.TIMER, checkThisPet);
petTimer = null;
}
function ():void{
trace("testFunction() called inside of Pet superclass.");
}
function colorizeMovieClip(_arg1:MovieClip, _arg2:uint):void{
var _local3:ColorTransform;
var _local4:uint;
var _local5:uint;
var _local6:uint;
_local4 = ((_arg2 >> 16) & 0xFF);
_local5 = ((_arg2 >> 8) & 0xFF);
_local6 = (_arg2 & 0xFF);
_local3 = new ColorTransform(0, 0, 0, 1, _local4, _local5, _local6, 0);
_arg1.transform.colorTransform = _local3;
}
function setCurrentBitmap():void{
trace("setCurrentBitmap() called.");
if (currentTask == "Cut"){
currentBitmap = cutBitmap;
} else {
if (currentTask == "Wash"){
currentBitmap = washBitmap;
} else {
if (currentTask == "Brush"){
currentBitmap = brushBitmap;
} else {
if (currentTask == "Accessorize"){
currentBitmap = accessoriesMaskBitmap;
} else {
if (currentTask == "Cleanup"){
currentBitmap = cleanupBitmap;
};
};
};
};
};
}
function applyCorrectTool():void{
petNeglectCounter = 0;
petNeglected = false;
}
private function playAngrySoundAndAnimation():void{
if (petType == "Dog"){
speak.gotoAndPlay("doghappy");
} else {
if (petType == "Cat"){
speak.gotoAndPlay("cathappy");
};
};
dispatchEvent(new Event("play_angry_sound"));
}
function receiveTreat():void{
trace("treat received");
if (petAngry == true){
dispatchEvent(new Event("play_eating_treat_sound"));
petAngry = false;
petHappiness = 100;
petNeglectCounter = 0;
petNeglected = false;
angerSoundPlayed = false;
angerSoundCounter = 0;
treatAlert.gotoAndPlay("thanks");
};
}
private function init():void{
var _local1:uint;
var _local2:String;
_local1 = 0;
while (_local1 < tasksArray.length) {
_local2 = tasksArray[_local1];
if (_local2 == "Cut"){
tasksObject.Cut = true;
} else {
if (_local2 == "Wash"){
tasksObject.Wash = true;
} else {
if (_local2 == "Brush"){
tasksObject.Brush = true;
} else {
if (_local2 == "Accessorize"){
tasksObject.Accessorize = true;
} else {
if (_local2 == "Cleanup"){
tasksObject.Cleanup = true;
};
};
};
};
};
_local1 = (_local1 + 1);
};
numberOfTasks = remainingTasksArray.length;
currentTask = remainingTasksArray[0];
currentTaskTool = getToolName(currentTask);
colorizeMovieClip(base.baseColor, baseHexColor);
if (tasksObject.Wash == true){
transformMatrix.tx = wash.x;
transformMatrix.ty = wash.y;
washBitmapData = new BitmapData(this.width, this.height, true, 0);
washBitmapData.draw(wash, transformMatrix);
washBitmap = new Bitmap(washBitmapData);
washHolder.addChild(washBitmap);
washHolder.alpha = wash.alpha;
wash.visible = false;
} else {
wash.visible = false;
};
if (tasksObject.Brush == true){
transformMatrix.tx = brush.x;
transformMatrix.ty = brush.y;
brushBitmapData = new BitmapData(this.width, this.height, true, 0);
brushBitmapData.draw(brush, transformMatrix);
brushBitmap = new Bitmap(brushBitmapData);
brushHolder.addChild(brushBitmap);
brush.visible = false;
} else {
brush.visible = false;
};
if (tasksObject.Accessorize == true){
trace("setting up Accessorize functionality");
transformMatrix.tx = accessories.x;
transformMatrix.ty = accessories.y;
accessoriesBitmapData = new BitmapData(this.width, this.height, true, 0);
accessories.gotoAndStop(("neck_" + accessoriesObject.neckAccessory));
accessoriesBitmapData.draw(accessories, transformMatrix);
accessories.gotoAndStop(("body_" + accessoriesObject.bodyAccessory));
accessoriesBitmapData.draw(accessories, transformMatrix);
accessories.gotoAndStop(("head_" + accessoriesObject.headAccessory));
accessoriesBitmapData.draw(accessories, transformMatrix);
accessoriesBitmap = new Bitmap(accessoriesBitmapData);
accessoriesHolder.addChild(accessoriesBitmap);
accessories.visible = false;
accessoriesMaskBitmapData = new BitmapData(this.width, this.height, true, 0);
accessoriesMaskBitmap = new Bitmap(accessoriesMaskBitmapData);
accessoriesMaskHolder.addChild(accessoriesMaskBitmap);
accessoriesMaskHolder.visible = false;
accessoriesBitmap.cacheAsBitmap = true;
accessoriesMaskBitmap.cacheAsBitmap = true;
accessoriesMaskHolder.cacheAsBitmap = true;
accessoriesBitmap.mask = accessoriesMaskHolder;
} else {
accessories.visible = false;
};
if (tasksObject.Cleanup == true){
transformMatrix.tx = cleanup.x;
transformMatrix.ty = cleanup.y;
cleanupBitmapData = new BitmapData(this.width, this.height, true, 0);
cleanupBitmapData.draw(cleanup, transformMatrix);
cleanupBitmap = new Bitmap(cleanupBitmapData);
cleanupHolder.addChild(cleanupBitmap);
cleanup.visible = false;
} else {
cleanup.visible = false;
};
speak.gotoAndStop("off");
treatAlert.gotoAndStop("off");
petTimer = new Timer(1000, 0);
petTimer.addEventListener(TimerEvent.TIMER, checkThisPet);
petTimer.start();
}
function applyWrongTool():void{
petHappiness = (petHappiness - 20);
if ((((petHappiness <= 0)) && ((petAngry == false)))){
petAngry = true;
treatAlert.gotoAndPlay("feedme");
trace("treatAlert activated");
dispatchEvent(new Event("pet_angry"));
};
}
function traceObject(_arg1:Object):void{
var _local2:String;
for (_local2 in _arg1) {
trace(((_local2 + ": ") + _arg1[_local2]));
};
}
function getFilledPixels(_arg1:BitmapData):uint{
var _local2:uint;
var _local3:Boolean;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:uint;
_local2 = _arg1.getPixel32(0, 0);
_local3 = false;
_local4 = 0;
_local5 = 0;
_local6 = 0;
while (_local6 < _arg1.width) {
_local7 = 0;
while (_local7 < _arg1.height) {
if (_arg1.getPixel32(_local6, _local7) == _local2){
_local5 = (_local5 + 1);
} else {
if (!_local3){
_local3 = true;
};
_local4 = (_local4 + 1);
};
_local7 = (_local7 + 1);
};
_local6 = (_local6 + 1);
};
return (_local4);
}
private function calculateInitialPixels(_arg1:String):uint{
var _local2:uint;
if (_arg1 == "Cut"){
_local2 = getFilledPixels(cutBitmap.bitmapData);
} else {
if (_arg1 == "Wash"){
_local2 = getFilledPixels(washBitmap.bitmapData);
} else {
if (_arg1 == "Brush"){
_local2 = getFilledPixels(brushBitmap.bitmapData);
} else {
if (_arg1 == "Accessorize"){
_local2 = getFilledPixels(accessoriesBitmap.bitmapData);
} else {
if (_arg1 == "Cleanup"){
_local2 = getFilledPixels(cleanupBitmap.bitmapData);
};
};
};
};
};
return (_local2);
}
private function checkThisPet(_arg1:TimerEvent):void{
var _local2:*;
if ((((PetSpa.gameStarted == true)) && ((PetSpa.gamePaused == false)))){
_local2 = (petNeglectCounter + 1);
petNeglectCounter = _local2;
if ((((petNeglectCounter == PetSpa.petNeglectToAngryTimeLimit)) && ((petNeglected == true)))){
if (petAngry == false){
petAngry = true;
treatAlert.gotoAndPlay("feedme");
trace("treatAlert activated");
};
};
if ((((petNeglectCounter >= PetSpa.petNeglectTimeLimit)) && ((petAngry == false)))){
petNeglected = true;
dispatchEvent(new Event("pet_neglected"));
};
if (petAngry == true){
dispatchEvent(new Event("pet_angry"));
if (angerSoundPlayed == false){
playAngrySoundAndAnimation();
angerSoundPlayed = true;
} else {
_local2 = (angerSoundCounter + 1);
angerSoundCounter = _local2;
if ((angerSoundCounter % PetSpa.petAngerSoundFrequency) == 0){
playAngrySoundAndAnimation();
};
};
};
};
}
function stopPetTimer():void{
petTimer.stop();
}
function completeCurrentTask():void{
trace("completeCurrentTask() called.");
var _local1:* = (numberOfTasksCompleted + 1);
numberOfTasksCompleted = _local1;
if (currentTask == "Accessorize"){
trace("What the fuck?");
accessoriesBitmap.mask = null;
} else {
currentBitmap.visible = false;
};
if (remainingTasksArray.length > 1){
dispatchEvent(new Event("play_task_completed_sound"));
remainingTasksArray.splice(0, 1);
currentTask = remainingTasksArray[0];
currentTaskTool = getToolName(currentTask);
setCurrentBitmap();
if (currentTask == "Cleanup"){
cleanupHolder.visible = true;
};
} else {
dispatchEvent(new Event("play_all_tasks_completed_sound"));
dispatchEvent(new Event("pet_groomed"));
waitingForRemoval = true;
};
}
function getFilledPixels2(_arg1:BitmapData):uint{
var _local2:uint;
var _local3:Boolean;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:uint;
_local2 = 0;
_local3 = false;
_local4 = 0;
_local5 = 0;
_local6 = 0;
while (_local6 < _arg1.width) {
_local7 = 0;
while (_local7 < _arg1.height) {
if (_arg1.getPixel32(_local6, _local7) == _local2){
_local5 = (_local5 + 1);
} else {
if (!_local3){
_local3 = true;
};
if (accessoriesBitmap.bitmapData.getPixel32(_local6, _local7) == _local2){
_local5 = (_local5 + 1);
} else {
_local4 = (_local4 + 1);
};
};
_local7 = (_local7 + 1);
};
_local6 = (_local6 + 1);
};
return (_local4);
}
function getToolName(_arg1:String):String{
var _local2:String;
if (_arg1 == "Cut"){
_local2 = "scissors";
} else {
if (_arg1 == "Wash"){
_local2 = "sponge";
} else {
if (_arg1 == "Brush"){
_local2 = "brush";
} else {
if (_arg1 == "Accessorize"){
_local2 = "puff";
} else {
if (_arg1 == "Cleanup"){
_local2 = "sweeper";
};
};
};
};
};
return (_local2);
}
function setInitialPixels():void{
var _local1:uint;
var _local2:String;
var _local3:uint;
_local3 = 0;
while (_local3 < tasksArray.length) {
_local2 = tasksArray[_local3];
_local1 = calculateInitialPixels(_local2);
initialPixelsObject[_local2] = _local1;
_local3 = (_local3 + 1);
};
traceObject(initialPixelsObject);
}
}
}//package com.kennethwarner.petSpa
Section 12
//PetManager (com.kennethwarner.petSpa.PetManager)
package com.kennethwarner.petSpa {
public class PetManager {
private var dogCutColorsArray:Array;
private var neckAccessoriesArray:Array;
private var catBaseColorsArray:Array;
private var bodyAccessoriesArray:Array;
private var dogTasksArray:Array;
private var headAccessoriesArray:Array;
private var dogBaseColorsArray:Array;
private var petTypesArray:Array;
private var petSubTypesArray:Array;
private var catTasksArray:Array;
public function PetManager(){
petTypesArray = new Array("Cat", "Cat", "Dog", "Dog", "Dog", "Dog");
petSubTypesArray = new Array("Cat1", "Cat2", "Dog1", "Dog2", "Dog3", "Dog4");
dogBaseColorsArray = new Array(10521956, 8934962, 12040364, 4738128, 14543002);
dogCutColorsArray = new Array(10132839, 8547897, 8818045, 6316651, 12707996);
catBaseColorsArray = new Array(14996902, 13989409, 11774348, 14276319, 8934962);
dogTasksArray = new Array("Cut", "Wash", "Brush", "Accessorize");
catTasksArray = new Array("Wash", "Brush", "Accessorize");
bodyAccessoriesArray = new Array("armor", "camo", "dress", "jeans", "jersey", "leather", "tutu");
headAccessoriesArray = new Array("bowler", "captain", "crown", "german", "headdress", "racoon", "rainbow");
neckAccessoriesArray = new Array("collar", "daisy", "diamond", "flowers", "pearls", "rainbow", "spike");
init();
}
function ():String{
var _local1:String;
_local1 = "Go Fuck Yourself";
return (_local1);
}
private function init():void{
}
private function getRandomNumber(_arg1:Number, _arg2:Number):Number{
var _local3:Number = NaN;
var _local4:Number = NaN;
_local3 = Math.random();
_local4 = (Math.floor((_local3 * (_arg2 - _arg1))) + _arg1);
return (_local4);
}
function getRandomPet():Pet{
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:String;
var _local5:String;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:Array;
var _local10:Array;
var _local11:Array;
var _local12:Array;
var _local13:Array;
var _local14:Object;
var _local15:Pet;
_local9 = new Array();
_local10 = new Array();
_local11 = new Array();
_local13 = new Array();
_local14 = new Object();
_local1 = getRandomNumberModulo(petSubTypesArray.length);
_local4 = petTypesArray[_local1];
_local5 = petSubTypesArray[_local1];
trace(((("petType: " + _local4) + ", petSubType: ") + _local5));
_local1 = getRandomNumberModulo(dogBaseColorsArray.length);
if (_local4 == "Dog"){
_local6 = dogBaseColorsArray[_local1];
_local7 = dogCutColorsArray[_local1];
} else {
if (_local4 == "Cat"){
_local6 = catBaseColorsArray[_local1];
_local7 = dogCutColorsArray[_local1];
};
};
trace(((("baseColor: " + _local6.toString(16)) + ", cutColor: ") + _local7.toString(16)));
if (_local4 == "Dog"){
_local10 = dogTasksArray.slice();
_local12 = dogTasksArray;
_local8 = getRandomNumber(1, 4);
} else {
if (_local4 == "Cat"){
_local10 = catTasksArray.slice();
_local12 = catTasksArray;
_local8 = getRandomNumber(1, 3);
};
};
_local2 = 1;
while (_local2 <= _local8) {
_local1 = getRandomNumberModulo(_local10.length);
_local9 = _local10.splice(_local1, 1);
_local11.push(_local9[0]);
_local2 = (_local2 + 1);
};
_local2 = 0;
while (_local2 < _local12.length) {
_local3 = 0;
while (_local3 < _local11.length) {
if (_local11[_local3] == _local12[_local2]){
_local13.push(_local11[_local3]);
break;
};
_local3 = (_local3 + 1);
};
_local2 = (_local2 + 1);
};
_local13.push("Cleanup");
_local8 = (_local8 + 1);
trace(("numberOfTasks: " + _local8));
trace(("petTasksArray: " + _local13));
_local1 = getRandomNumberModulo(bodyAccessoriesArray.length);
_local14.bodyAccessory = bodyAccessoriesArray[_local1];
_local1 = getRandomNumberModulo(headAccessoriesArray.length);
_local14.headAccessory = headAccessoriesArray[_local1];
_local1 = getRandomNumberModulo(neckAccessoriesArray.length);
_local14.neckAccessory = neckAccessoriesArray[_local1];
if (_local4 == "Dog"){
if (_local5 == "Dog1"){
_local15 = new Dog1(_local6, _local13, _local14, _local7);
} else {
if (_local5 == "Dog2"){
_local15 = new Dog2(_local6, _local13, _local14, _local7);
} else {
if (_local5 == "Dog3"){
_local15 = new Dog3(_local6, _local13, _local14, _local7);
} else {
if (_local5 == "Dog4"){
_local15 = new Dog4(_local6, _local13, _local14, _local7);
};
};
};
};
} else {
if (_local4 == "Cat"){
if (_local5 == "Cat1"){
_local15 = new Cat1(_local6, _local13, _local14);
} else {
if (_local5 == "Cat2"){
_local15 = new Cat2(_local6, _local13, _local14);
};
};
};
};
return (_local15);
}
private function getRandomNumberModulo(_arg1:Number):Number{
var _local2:Number = NaN;
var _local3:Number = NaN;
var _local4:Number = NaN;
var _local5:Number = NaN;
_local2 = _arg1;
_local3 = 16777216;
_local4 = getRandomNumber(_local2, _local3);
_local5 = (_local4 % _arg1);
return (_local5);
}
}
}//package com.kennethwarner.petSpa
Section 13
//PetSpa (com.kennethwarner.petSpa.PetSpa)
package com.kennethwarner.petSpa {
import gs.*;
import flash.events.*;
import flash.display.*;
import gs.easing.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
public class PetSpa extends MovieClip {
private var sweeperStartingPixels:uint;// = 0
public var floorAndWallpaper:MovieClip;
public var scissors:MovieClip;
public var curtains:MovieClip;
public var stall1PetHolder:MovieClip;
public var treat:MovieClip;
public var stall3PetHolder:MovieClip;
public var treatDropArea:MovieClip;
private var toolProgressTimer:Timer;
private var warningTimerFrequency:uint;// = 3000
private var activeToolDiameter:uint;
public var nextStall:MovieClip;
private var gameTimer:Timer;
public var intro:MovieClip;
public var unhappyPetAlert:MovieClip;
public var testingTxt:TextField;
public var petStall1:MovieClip;
private var sweeperHairAnimationStarted:Boolean;// = false
public var petStall3:MovieClip;
private var fromEndScreen:Boolean;// = false
public var credits:MovieClip;
private var warningDisplayed:Boolean;// = false
public var sweeper:MovieClip;
public var petStall2:MovieClip;
public var gameMeter:GameMeter;
public var adAnimation:MovieClip;
private var toolActive:Boolean;// = false
public var sendToFriend:SendToFriend;
private var stall1Pet:MovieClip;
public var end:MovieClip;
private var toolProgressTimerFrequency:uint;// = 500
public var sponge:MovieClip;
public var soundMC:MovieClip;
public var previousStall:MovieClip;
private var currentPet:uint;// = 2
private var treatStartY:Number;
private var toolReturnEase:Object;
private var treatStartX:Number;
private var currentPetMC:MovieClip;
private var pledgeURL:String;// = "http://www.starsue.net/"
private var warningTimer:Timer;
private var treatBeingDragged:Boolean;// = false
private var sweeperStartingPixelsDetermined:Boolean;// = false
private var petEraseShape:Shape;
private var stall2Pet:MovieClip;
public var stall2PetHolder:MovieClip;
public var gameClock:GameClock;
private var toolReturnTimeInSeconds:Number;// = 1.5
public var help:MovieClip;
public var brush:MovieClip;
private var taskThresholdObject:Object;
public var warningAnimation:MovieClip;
public var helpBtn:SimpleButton;
private var floorStartX:Number;
private var activeToolName:String;
public var creditsBtn:SimpleButton;
public var petAlert:MovieClip;
public var puff:MovieClip;
private var toolBeingDragged:Boolean;// = false
public var petManager:PetManager;
public var treats:MovieClip;
private var stall3Pet:MovieClip;
public var soundManager:SoundManager;
private var currentStall:uint;// = 2
private var petCheckTimer:Timer;
private var currentPetBitmap:Bitmap;
private var curtainsStartX:Number;
public var sendBtn:SimpleButton;
private var activeTool:MovieClip;
public var orderAnimation:MovieClip;
private var stallAnimationEase:Object;
private var stallsAnimating:Boolean;// = false
private var toolDiameterObject:Object;
private var stallAnimationTimeInSeconds:Number;// = 1.5
private var toolStartX:Number;
private var toolStartY:Number;
static var gamePaused:Boolean = false;
static var petCompletedGameMeterIncrement:Number = 10;
static var sendToFriendURL:String = "http://www.starsue.net/";
static var petAngryGameMeterDeduction:Number = 1;
static var petNeglectTimeLimit:uint = 10;
static var petAngerSoundFrequency:uint = 3;
static var wrongToolPetHappinessDeduction:Number = 20;
static var toolVolume:Number = 1;
static var taskCompletedGameMeterIncrement:Number = 7;
static var musicVolume:Number = 0.4;
static var petNeglectToAngryTimeLimit:uint = 18;
static var petNeglectGameMeterDeduction:Number = 0.5;
static var gameStarted:Boolean = false;
static var wrongToolGameMeterDeduction:Number = 5;
static var soundEffectsVolume:Number = 1;
static var gameTimeInSeconds:uint = 240;
public function PetSpa(){
stallAnimationTimeInSeconds = 1.5;
toolReturnTimeInSeconds = 1.5;
taskThresholdObject = {Cut:80, Wash:80, Brush:80, Accessorize:60, Cleanup:80};
toolDiameterObject = {scissors:30, sponge:30, brush:30, puff:30, sweeper:30};
pledgeURL = "http://www.starsue.net/";
currentPet = 2;
currentStall = 2;
stallsAnimating = false;
stallAnimationEase = Quint.easeOut;
toolActive = false;
toolReturnEase = Elastic.easeOut;
toolBeingDragged = false;
treatBeingDragged = false;
fromEndScreen = false;
petEraseShape = new Shape();
toolProgressTimerFrequency = 500;
warningDisplayed = false;
warningTimerFrequency = 3000;
sweeperStartingPixels = 0;
sweeperStartingPixelsDetermined = false;
sweeperHairAnimationStarted = false;
soundManager = new SoundManager();
petManager = new PetManager();
addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
private function endPledgeBtnClickListener(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest(pledgeURL);
navigateToURL(_local2, "_blank");
}
private function registerHelpLastListener(_arg1:Event):void{
help.removeEventListener("help_last_displayed", registerHelpLastListener);
help.playBtn.addEventListener(MouseEvent.CLICK, helpPlayClickListener);
}
private function revealSweeper(_arg1:Event):void{
orderAnimation.removeEventListener("order_form_cycled_in", revealSweeper);
sweeper.gotoAndStop("on");
orderAnimation.orderForm.sweeper.gotoAndStop("off");
}
private function registerHelpListeners(_arg1:Event):void{
help.removeEventListener("help_displayed", registerHelpListeners);
help.addEventListener("help_last_displayed", registerHelpLastListener);
help.okBtn.addEventListener(MouseEvent.CLICK, helpOkClickListener, false, 0, true);
help.skipBtn.addEventListener(MouseEvent.CLICK, helpSkipClickListener, false, 0, true);
}
private function endSendClickListener(_arg1:MouseEvent):void{
displaySendToFriend(true);
}
private function toggleSound(_arg1:MouseEvent):void{
soundManager.playSoundEffect("click");
if (soundManager.soundEnabled == true){
soundMC.gotoAndStop("off");
} else {
soundMC.gotoAndStop("on");
};
soundManager.toggleSound();
}
private function registerPetListeners(_arg1:MovieClip):void{
_arg1.addEventListener("pet_groomed", receivePetDispatchedEvent);
_arg1.addEventListener("pet_angry", receivePetDispatchedEvent);
_arg1.addEventListener("pet_neglected", receivePetDispatchedEvent);
_arg1.addEventListener("play_angry_sound", receivePetDispatchedEvent);
_arg1.addEventListener("play_task_completed_sound", receivePetDispatchedEvent);
_arg1.addEventListener("play_all_tasks_completed_sound", receivePetDispatchedEvent);
_arg1.addEventListener("play_eating_treat_sound", receivePetDispatchedEvent);
}
private function startToolProgressTimer():void{
toolProgressTimer.start();
}
private function removePetAlert():void{
petAlert.gotoAndStop("off");
}
private function previousStallOverListener(_arg1:MouseEvent):void{
previousStall.gotoAndPlay("in");
}
private function creditsBtnClickListener(_arg1:MouseEvent):void{
soundManager.playSoundEffect("click");
displayCredits(false);
}
private function releaseTool(_arg1:MouseEvent):void{
toolBeingDragged = false;
stopToolProgressTimer();
activeTool.stopDrag();
activeTool.removeEventListener(MouseEvent.MOUSE_MOVE, moveTool);
activeTool.removeEventListener(MouseEvent.MOUSE_UP, releaseTool);
petEraseShape.graphics.clear();
if ((((activeToolName == currentPetMC.currentTaskTool)) && ((activeToolName == "sweeper")))){
adAnimation.gotoAndPlay("out");
sweeper.sweeperAnimation.sweeper.hair.gotoAndStop("off");
sweeperStartingPixels = 0;
sweeperStartingPixelsDetermined = false;
sweeperHairAnimationStarted = false;
};
if (currentPetMC.waitingForRemoval == false){
removePetAlert();
};
activeTool.gotoAndStop("on");
soundManager.stopToolSound();
TweenLite.to(activeTool, toolReturnTimeInSeconds, {x:toolStartX, y:toolStartY, ease:toolReturnEase, onComplete:toolReturned, onCompleteParams:[activeTool]});
toolActive = false;
}
private function ():void{
}
private function helpOkClickListener(_arg1:MouseEvent):void{
soundManager.playSoundEffect("click");
help.nextFrame();
}
private function displayPetAlert(_arg1:String):void{
if (_arg1 == "pet_groomed"){
petAlert.gotoAndStop("pet_finished");
} else {
if (_arg1 == "wrong_tool"){
petAlert.gotoAndStop("wrong_tool");
};
};
}
private function helpPlayClickListener(_arg1:MouseEvent):void{
help.playBtn.removeEventListener(MouseEvent.CLICK, helpPlayClickListener);
soundManager.playSoundEffect("click");
help.gotoAndStop("off");
if (gameStarted == false){
startGame();
} else {
gamePaused = false;
};
}
private function orderFormCyclingInListener(_arg1:Event):void{
clearOrderForm();
updateOrderForm();
}
private function receiveGameListenersEvent(_arg1:Event):void{
var _local2:String;
var _local3:Object;
_local2 = _arg1.type;
_local3 = _arg1.target;
if (_local2 == "quitting_time"){
endGame();
} else {
if (_local2 == "control_meter_at_zero"){
gameClock.stopClock();
endGame();
} else {
if (_local2 == "control_meter_at_ten"){
displayWarning("It will take a miracle to get control now.");
} else {
if (_local2 == "control_meter_at_twenty"){
displayWarning("You are losing control.");
} else {
if (_local2 == "control_meter_at_thirty"){
displayWarning("Things aren't looking good - get control.");
} else {
if (_local2 == "speed_up_game_music"){
soundManager.speedUpGameMusic();
} else {
if (_local2 == "slow_down_game_music"){
soundManager.slowDownGameMusic();
} else {
if (_local2 == "play_click_sound"){
soundManager.playSoundEffect("click");
};
};
};
};
};
};
};
};
}
private function initPets():void{
stall1Pet = petManager.getRandomPet();
stall1PetHolder.addChild(stall1Pet);
stall2Pet = petManager.getRandomPet();
stall2PetHolder.addChild(stall2Pet);
stall3Pet = petManager.getRandomPet();
stall3PetHolder.addChild(stall3Pet);
registerPetListeners(stall1Pet);
registerPetListeners(stall2Pet);
registerPetListeners(stall3Pet);
if (gameStarted == false){
currentPetMC = stall2Pet;
currentPetBitmap = currentPetMC.currentBitmap;
} else {
currentPetMC = this[(("stall" + currentPet) + "Pet")];
currentPetBitmap = currentPetMC.currentBitmap;
};
}
private function stopToolProgressTimer():void{
toolProgressTimer.stop();
}
private function displaySendToFriend(_arg1:Boolean):void{
trace((("displaySendToFriend(" + _arg1) + ") called."));
if (_arg1 == true){
fromEndScreen = true;
end.visible = false;
} else {
gamePaused = true;
};
sendToFriend.addEventListener("remove_send_to_friend", removeSendToFriendListener);
sendToFriend.displayForm();
}
private function beginClickListener(_arg1:MouseEvent):void{
intro.begin.removeEventListener(MouseEvent.CLICK, beginClickListener);
soundManager.playSoundEffect("click");
intro.gotoAndStop("off");
help.gotoAndStop("on");
help.addEventListener("help_displayed", registerHelpListeners);
}
private function updateOrderForm():void{
var _local1:uint;
var _local2:uint;
trace("updateOrderForm() called.");
_local1 = 1;
_local2 = 0;
while (_local2 < currentPetMC.tasksArray.length) {
orderAnimation.orderForm[(("task" + _local1) + "Txt")].text = ((_local1 + ". ") + currentPetMC.tasksArray[_local2]);
_local1 = (_local1 + 1);
_local2 = (_local2 + 1);
};
if (currentPetMC.numberOfTasksCompleted > 0){
orderAnimation.orderForm.crossoutsAnimation.gotoAndStop(("crossout" + currentPetMC.numberOfTasksCompleted));
};
}
private function resetCurtains():void{
curtains.x = curtainsStartX;
}
private function dropTreat(_arg1:MouseEvent):void{
treatBeingDragged = false;
treat.removeEventListener(MouseEvent.MOUSE_UP, dropTreat);
treat.stopDrag();
if (treatDropArea.hitTestPoint(treat.x, treat.y)){
trace("treat dropped on current pet");
currentPetMC.receiveTreat();
};
treat.gotoAndStop("off");
treat.x = treatStartX;
treat.y = treatStartY;
}
private function displayWarning(_arg1:String):void{
warningAnimation.warning.warningTxt.text = _arg1;
soundManager.playSoundEffect("warning");
if (warningDisplayed == false){
warningAnimation.gotoAndPlay("in");
warningTimer.start();
warningDisplayed = true;
} else {
warningTimer.stop();
warningTimer.start();
};
}
private function initTools():void{
var _local1:Array;
var _local2:uint;
_local1 = new Array(brush, scissors, puff, sponge);
_local2 = 0;
while (_local2 < _local1.length) {
_local1[_local2].buttonMode = true;
_local1[_local2].addEventListener(MouseEvent.MOUSE_DOWN, toolClickListener);
_local2 = (_local2 + 1);
};
}
private function startPetCheckTimer():void{
petCheckTimer.start();
}
private function removePetListeners(_arg1:MovieClip):void{
_arg1.removeEventListener("pet_groomed", receivePetDispatchedEvent);
_arg1.removeEventListener("pet_angry", receivePetDispatchedEvent);
_arg1.removeEventListener("pet_neglected", receivePetDispatchedEvent);
_arg1.removeEventListener("play_angry_sound", receivePetDispatchedEvent);
_arg1.removeEventListener("play_task_completed_sound", receivePetDispatchedEvent);
_arg1.removeEventListener("play_all_tasks_completed_sound", receivePetDispatchedEvent);
_arg1.removeEventListener("play_eating_treat_sound", receivePetDispatchedEvent);
}
private function removeEndScreenListeners():void{
end.tryAgain.removeEventListener(MouseEvent.CLICK, endTryAgainClickListener);
end.send.removeEventListener(MouseEvent.CLICK, endSendClickListener);
end.credits.removeEventListener(MouseEvent.CLICK, endCreditsClickListener);
end.pledgeBtn.removeEventListener(MouseEvent.CLICK, endPledgeBtnClickListener);
}
private function stopPetCheckTimer():void{
petCheckTimer.stop();
unhappyPetAlert.gotoAndStop("off");
}
private function checkStallPosition(_arg1:MovieClip):void{
if (_arg1.x < -810){
_arg1.x = (_arg1.x + (810 * 3));
} else {
if (_arg1.x > 810){
_arg1.x = (_arg1.x - (810 * 3));
};
};
stallsAnimating = false;
}
private function initTreats():void{
treats.buttonMode = true;
treats.addEventListener(MouseEvent.MOUSE_DOWN, treatsClickListener);
}
private function removeWarning(_arg1:TimerEvent):void{
warningAnimation.gotoAndPlay("out");
warningTimer.stop();
warningDisplayed = false;
}
private function nextStallOverListener(_arg1:MouseEvent):void{
nextStall.gotoAndPlay("in");
}
private function (_arg1:TimerEvent):void{
}
private function registerBeginListener(_arg1:Event):void{
intro.removeEventListener("intro_displayed", registerBeginListener);
intro.begin.addEventListener(MouseEvent.CLICK, beginClickListener);
soundManager.playIntroEndLoop();
}
private function checkForAngryPets(_arg1:TimerEvent):void{
var _local2:Boolean;
var _local3:uint;
_local2 = false;
_local3 = 1;
while (_local3 <= 3) {
if (_local2 == false){
if (this[(("stall" + _local3) + "Pet")].petAngry == true){
_local2 = true;
};
};
_local3 = (_local3 + 1);
};
if (_local2 == true){
unhappyPetAlert.gotoAndStop("on");
} else {
unhappyPetAlert.gotoAndStop("off");
};
}
private function traceCurrentPetVars():void{
trace(("currentPetMC.numberOfTasks: " + currentPetMC.numberOfTasks));
trace(("currentPetMC.numberOfTasksCompleted: " + currentPetMC.numberOfTasksCompleted));
trace(("currentPetMC.currentTask: " + currentPetMC.currentTask));
trace(("currentPetMC.currentTaskTool: " + currentPetMC.currentTaskTool));
}
private function receivePetDispatchedEvent(_arg1:Event):void{
var _local2:String;
var _local3:Object;
var _local4:String;
var _local5:String;
_local2 = _arg1.type;
_local3 = _arg1.target;
_local4 = _local3.petType;
_local5 = _local3.petSubType;
if (_local3 == stall1Pet){
} else {
if (_local3 == stall2Pet){
} else {
if (_local3 == stall3Pet){
} else {
trace("event from undetermined pet mc");
};
};
};
if (_local2 == "pet_groomed"){
displayPetAlert("pet_groomed");
} else {
if (_local2 == "pet_neglected"){
gameMeter.loseControl(petNeglectGameMeterDeduction);
} else {
if (_local2 == "pet_angry"){
gameMeter.loseControl(petAngryGameMeterDeduction);
} else {
if (_local2 == "play_angry_sound"){
soundManager.playPetAngrySound(_local4, _local5);
} else {
if (_local2 == "play_task_completed_sound"){
soundManager.playSoundEffect("task_completed");
} else {
if (_local2 == "play_all_tasks_completed_sound"){
soundManager.playSoundEffect("all_tasks_completed");
} else {
if (_local2 == "play_eating_treat_sound"){
soundManager.playSoundEffect("treat");
};
};
};
};
};
};
};
}
private function registerEndScreenListeners():void{
end.tryAgain.addEventListener(MouseEvent.CLICK, endTryAgainClickListener);
end.send.addEventListener(MouseEvent.CLICK, endSendClickListener);
end.credits.addEventListener(MouseEvent.CLICK, endCreditsClickListener);
end.pledgeBtn.addEventListener(MouseEvent.CLICK, endPledgeBtnClickListener);
}
private function nextStallClickListener(_arg1:MouseEvent):void{
if (gamePaused == false){
if (stallsAnimating == false){
soundManager.playSoundEffect("click");
soundManager.playSoundEffect("swoosh");
stallsAnimating = true;
removePetAlert();
TweenLite.to(curtains, stallAnimationTimeInSeconds, {x:"-810", ease:stallAnimationEase, onComplete:resetCurtains});
TweenLite.to(floorAndWallpaper, stallAnimationTimeInSeconds, {x:"-810", ease:stallAnimationEase, onComplete:resetFloor});
animateStalls("next");
animatePets("next");
cycleOutOrderForm();
};
};
}
private function traceObject(_arg1:Object):void{
var _local2:String;
for (_local2 in _arg1) {
trace(((_local2 + ": ") + _arg1[_local2]));
};
}
private function cycleInOrderForm(_arg1:Event):void{
orderAnimation.removeEventListener("order_form_cycled_out", cycleInOrderForm);
orderAnimation.gotoAndPlay("in");
orderAnimation.addEventListener("order_form_cycled_in", revealSweeper);
}
private function initTimers():void{
petCheckTimer = new Timer(500, 0);
petCheckTimer.addEventListener(TimerEvent.TIMER, checkForAngryPets);
toolProgressTimer = new Timer(toolProgressTimerFrequency, 0);
toolProgressTimer.addEventListener(TimerEvent.TIMER, checkToolProgress);
warningTimer = new Timer(warningTimerFrequency, 1);
warningTimer.addEventListener(TimerEvent.TIMER, removeWarning);
}
private function displayEndInfo(_arg1:Event):void{
var _local2:Number = NaN;
var _local3:String;
_local2 = gameMeter.controlPercentage;
trace(("finalScore: " + _local2));
end.removeEventListener("end_screen_displayed", displayEndInfo);
if (_local2 >= 75){
_local3 = "Beehive : in control";
} else {
if (_local2 >= 50){
_local3 = "Mullet : half-way in control";
} else {
if (_local2 >= 25){
_local3 = "Flat Top : no-so in control";
} else {
if (_local2 >= 1){
_local3 = "Bowl Cut : flailing wildly";
} else {
_local3 = "Patchy Bald : out of control";
};
};
};
};
end.scoreTxt.text = _local3;
registerEndScreenListeners();
}
private function init(_arg1:Event):void{
trace("init() called inside PetSpa class.");
removeEventListener(Event.ADDED_TO_STAGE, init, false);
testingTxt.text = "";
removePetAlert();
initGameListeners();
initTimers();
initPets();
curtainsStartX = curtains.x;
floorStartX = floorAndWallpaper.x;
trace(("floorStartX: " + floorStartX));
treatStartX = treat.x;
treatStartY = treat.y;
intro.gotoAndStop("on");
intro.addEventListener("intro_displayed", registerBeginListener);
}
private function animateStalls(_arg1:String):void{
var _local3:*;
var _local2:String;
if (_arg1 == "previous"){
_local2 = "810";
_local3 = (currentStall - 1);
currentStall = _local3;
} else {
if (_arg1 == "next"){
_local2 = "-810";
_local3 = (currentStall + 1);
currentStall = _local3;
};
};
if (currentStall < 1){
currentStall = 3;
} else {
if (currentStall > 3){
currentStall = 1;
};
};
trace(("currentStall: " + currentStall));
TweenLite.to(petStall1, stallAnimationTimeInSeconds, {x:_local2, ease:stallAnimationEase, onComplete:checkStallPosition, onCompleteParams:[petStall1]});
TweenLite.to(petStall2, stallAnimationTimeInSeconds, {x:_local2, ease:stallAnimationEase, onComplete:checkStallPosition, onCompleteParams:[petStall2]});
TweenLite.to(petStall3, stallAnimationTimeInSeconds, {x:_local2, ease:stallAnimationEase, onComplete:checkStallPosition, onCompleteParams:[petStall3]});
}
private function displayHelp(_arg1:MouseEvent):void{
if (gamePaused == false){
soundManager.playSoundEffect("click");
help.gotoAndStop("on");
help.addEventListener("help_displayed", registerHelpListeners);
gamePaused = true;
};
}
private function removeCurrentPets():void{
var _local1:uint;
_local1 = 1;
while (_local1 <= 3) {
this[(("stall" + _local1) + "Pet")].die();
removePetListeners(this[(("stall" + _local1) + "Pet")]);
this[(("stall" + _local1) + "PetHolder")].removeChild(this[(("stall" + _local1) + "Pet")]);
this[(("stall" + _local1) + "Pet")] = null;
_local1 = (_local1 + 1);
};
currentPetMC = null;
currentPetBitmap = null;
}
private function sendBtnClickListener(_arg1:MouseEvent):void{
soundManager.playSoundEffect("click");
displaySendToFriend(false);
}
private function checkToolProgress(_arg1:TimerEvent):void{
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
if (activeToolName == "puff"){
_local2 = currentPetMC.getFilledPixels2(currentPetBitmap.bitmapData);
} else {
_local2 = currentPetMC.getFilledPixels(currentPetBitmap.bitmapData);
if ((((activeToolName == "sweeper")) && ((sweeperStartingPixelsDetermined == false)))){
sweeperStartingPixels = _local2;
sweeperStartingPixelsDetermined = true;
};
};
_local3 = currentPetMC.initialPixelsObject[currentPetMC.currentTask];
if ((((activeToolName == "sweeper")) && ((sweeperHairAnimationStarted == false)))){
if (_local2 < sweeperStartingPixels){
sweeper.sweeperAnimation.sweeper.hair.gotoAndPlay("on");
sweeperHairAnimationStarted = true;
};
};
_local4 = Math.ceil(((_local2 / _local3) * 100));
if (activeToolName == "puff"){
_local5 = _local4;
} else {
_local5 = (100 - _local4);
};
if (_local5 >= taskThresholdObject[currentPetMC.currentTask]){
completeCurrentTask();
};
if (currentPetMC.currentTask == "Cut"){
} else {
if (currentPetMC.currentTask == "Wash"){
};
};
}
private function removeSendToFriendListener(_arg1:Event):void{
sendToFriend.removeEventListener("remove_send_to_friend", removeSendToFriendListener);
removeSendToFriend();
}
private function ():void{
var _local1:uint;
_local1 = 1;
while (_local1 <= 3) {
if (this[(("stall" + _local1) + "PetHolder")].x < -810){
this[(("stall" + _local1) + "PetHolder")].x = (this[(("stall" + _local1) + "PetHolder")].x + (810 * 3));
} else {
if (this[(("stall" + _local1) + "PetHolder")].x > 810){
this[(("stall" + _local1) + "PetHolder")].x = (this[(("stall" + _local1) + "PetHolder")].x - (810 * 3));
};
};
trace(((("stall" + _local1) + "PetHolder.x: ") + this[(("stall" + _local1) + "PetHolder")].x));
if (this[(("stall" + _local1) + "Pet")].waitingForRemoval == true){
trace((("stall" + _local1) + "Pet is ready for removal."));
this[(("stall" + _local1) + "PetHolder")].removeChild(this[(("stall" + _local1) + "Pet")]);
trace(this[(("stall" + _local1) + "Pet")]);
this[(("stall" + _local1) + "Pet")] = petManager.getRandomPet();
this[(("stall" + _local1) + "PetHolder")].addChild(this[(("stall" + _local1) + "Pet")]);
trace(((("stall" + _local1) + "Pet waitingForRemoval: ") + this[(("stall" + _local1) + "Pet")].waitingForRemoval));
};
_local1 = (_local1 + 1);
};
}
private function startDraggingTool(_arg1:MouseEvent):void{
toolBeingDragged = true;
activeTool.startDrag();
activeTool.addEventListener(MouseEvent.MOUSE_MOVE, moveTool);
activeTool.addEventListener(MouseEvent.MOUSE_UP, releaseTool);
petEraseShape.graphics.lineStyle(activeToolDiameter, 0xFFFFFF, 1);
petEraseShape.graphics.moveTo(_arg1.stageX, _arg1.stageY);
}
private function initGameListeners():void{
gameClock.addEventListener("quitting_time", receiveGameListenersEvent);
gameMeter.addEventListener("control_meter_at_zero", receiveGameListenersEvent);
gameMeter.addEventListener("control_meter_at_ten", receiveGameListenersEvent);
gameMeter.addEventListener("control_meter_at_twenty", receiveGameListenersEvent);
gameMeter.addEventListener("control_meter_at_thirty", receiveGameListenersEvent);
gameMeter.addEventListener("speed_up_game_music", receiveGameListenersEvent);
gameMeter.addEventListener("slow_down_game_music", receiveGameListenersEvent);
sendToFriend.addEventListener("play_click_sound", receiveGameListenersEvent);
}
private function checkPetPosition(_arg1:MovieClip, _arg2:uint):void{
if (_arg1.x < -810){
_arg1.x = (_arg1.x + (810 * 3));
} else {
if (_arg1.x > 810){
_arg1.x = (_arg1.x - (810 * 3));
};
};
if (this[(("stall" + _arg2) + "Pet")].waitingForRemoval == true){
this[(("stall" + _arg2) + "Pet")].die();
removePetListeners(this[(("stall" + _arg2) + "Pet")]);
_arg1.removeChild(this[(("stall" + _arg2) + "Pet")]);
this[(("stall" + _arg2) + "Pet")] = null;
this[(("stall" + _arg2) + "Pet")] = petManager.getRandomPet();
_arg1.addChild(this[(("stall" + _arg2) + "Pet")]);
registerPetListeners(this[(("stall" + _arg2) + "Pet")]);
gameMeter.gainControl(petCompletedGameMeterIncrement);
};
}
private function initStallControls():void{
previousStall.buttonMode = true;
nextStall.buttonMode = true;
previousStall.addEventListener(MouseEvent.MOUSE_OVER, previousStallOverListener);
previousStall.addEventListener(MouseEvent.MOUSE_OUT, previousStallOutListener);
previousStall.addEventListener(MouseEvent.CLICK, previousStallClickListener);
nextStall.addEventListener(MouseEvent.MOUSE_OVER, nextStallOverListener);
nextStall.addEventListener(MouseEvent.MOUSE_OUT, nextStallOutListener);
nextStall.addEventListener(MouseEvent.CLICK, nextStallClickListener);
}
private function treatsClickListener(_arg1:MouseEvent):void{
if (gamePaused == false){
soundManager.playSoundEffect("click");
treatBeingDragged = true;
treat.gotoAndStop("on");
treat.startDrag(true);
treat.addEventListener(MouseEvent.MOUSE_UP, dropTreat);
};
}
private function creditsDisplayedListener(_arg1:Event):void{
credits.removeEventListener("credits_displayed", creditsDisplayedListener);
credits.closeBtn.addEventListener(MouseEvent.CLICK, creditsCloseClickListener);
}
private function removeSendToFriend():void{
if (fromEndScreen == true){
fromEndScreen = false;
end.visible = true;
} else {
gamePaused = false;
};
}
private function endCreditsClickListener(_arg1:MouseEvent):void{
displayCredits(true);
}
private function clearOrderForm():void{
var _local1:uint;
_local1 = 1;
while (_local1 <= 5) {
orderAnimation.orderForm[(("task" + _local1) + "Txt")].text = "";
_local1 = (_local1 + 1);
};
orderAnimation.orderForm.crossoutsAnimation.gotoAndStop("off");
}
private function endGame():void{
trace("endGame() called.");
if (toolBeingDragged == true){
releaseTool(new MouseEvent(MouseEvent.MOUSE_UP));
};
if (treatBeingDragged == true){
dropTreat(new MouseEvent(MouseEvent.MOUSE_UP));
};
gamePaused = true;
removePetAlert();
removeCurrentPets();
orderAnimation.gotoAndStop("off");
sweeper.gotoAndStop("off");
stopPetCheckTimer();
end.gotoAndStop("on");
end.addEventListener("end_screen_displayed", displayEndInfo);
soundManager.stopGameLoop();
soundManager.playIntroEndLoop();
}
private function initSweeper(_arg1:Event):void{
orderAnimation.removeEventListener("order_form_displayed", initSweeper);
sweeper.gotoAndStop("on");
sweeper.buttonMode = true;
sweeper.addEventListener(MouseEvent.MOUSE_DOWN, toolClickListener);
orderAnimation.orderForm.sweeper.gotoAndStop("off");
}
private function removeCredits():void{
credits.gotoAndStop("off");
if (fromEndScreen == true){
fromEndScreen = false;
end.visible = true;
} else {
gamePaused = false;
};
}
private function displayCredits(_arg1:Boolean):void{
if (_arg1 == true){
fromEndScreen = true;
end.visible = false;
} else {
gamePaused = true;
};
credits.gotoAndStop("on");
credits.addEventListener("credits_displayed", creditsDisplayedListener);
}
private function previousStallOutListener(_arg1:MouseEvent):void{
previousStall.gotoAndPlay("out");
}
private function startGame():void{
trace("startGame() called.");
if (gameStarted == false){
gameStarted = true;
initStallControls();
initTools();
initTreats();
initBottomButtons();
orderAnimation.addEventListener("order_form_cycling_in", orderFormCyclingInListener);
};
orderAnimation.addEventListener("order_form_displayed", initSweeper);
traceCurrentPetVars();
gameClock.startGameClock();
orderAnimation.gotoAndPlay("in");
gamePaused = false;
startPetCheckTimer();
soundManager.stopIntroEndLoop();
soundManager.playGameLoop();
}
private function nextStallOutListener(_arg1:MouseEvent):void{
nextStall.gotoAndPlay("out");
}
private function toolReturned(_arg1:MovieClip):void{
trace("toolReturned() called.");
if (_arg1 == activeTool){
activeTool = null;
};
}
private function cycleOutOrderForm():void{
sweeper.gotoAndStop("off");
orderAnimation.orderForm.sweeper.gotoAndStop("on");
orderAnimation.gotoAndPlay("out");
orderAnimation.addEventListener("order_form_cycled_out", cycleInOrderForm);
}
private function moveTool(_arg1:MouseEvent):void{
if (activeToolName == currentPetMC.currentTaskTool){
petEraseShape.graphics.lineTo(_arg1.stageX, _arg1.stageY);
if (activeToolName == "puff"){
currentPetBitmap.bitmapData.draw(petEraseShape);
} else {
currentPetBitmap.bitmapData.draw(petEraseShape, null, null, "erase");
};
};
}
private function creditsCloseClickListener(_arg1:MouseEvent):void{
credits.closeBtn.removeEventListener(MouseEvent.CLICK, creditsCloseClickListener);
soundManager.playSoundEffect("click");
removeCredits();
}
private function (_arg1:MouseEvent):void{
trace(("e.currentTarget.name: " + _arg1.currentTarget.name));
this["sponge"].x = (this["sponge"].x + 100);
}
private function initBottomButtons():void{
creditsBtn.addEventListener(MouseEvent.CLICK, creditsBtnClickListener);
helpBtn.addEventListener(MouseEvent.CLICK, displayHelp);
soundMC.buttonMode = true;
soundMC.addEventListener(MouseEvent.CLICK, toggleSound);
sendBtn.addEventListener(MouseEvent.CLICK, sendBtnClickListener);
}
private function toolClickListener(_arg1:MouseEvent):void{
trace(("e.currentTarget.name: " + _arg1.currentTarget.name));
if (gamePaused == false){
if (activeTool != this[_arg1.currentTarget.name]){
toolActive = true;
activeToolName = _arg1.currentTarget.name;
activeToolDiameter = toolDiameterObject[activeToolName];
activeTool = this[activeToolName];
toolStartX = activeTool.x;
toolStartY = activeTool.y;
activeTool.gotoAndStop("drag");
soundManager.playToolSound(activeToolName);
if (activeToolName == currentPetMC.currentTaskTool){
currentPetMC.applyCorrectTool();
if (activeToolName == "sweeper"){
adAnimation.gotoAndPlay("in");
};
startToolProgressTimer();
} else {
if (currentPetMC.waitingForRemoval == false){
displayPetAlert("wrong_tool");
};
soundManager.playSoundEffect("wrong_tool");
currentPetMC.applyWrongTool();
gameMeter.loseControl(wrongToolGameMeterDeduction);
};
startDraggingTool(_arg1);
};
};
}
private function animatePets(_arg1:String):void{
var _local3:*;
var _local2:String;
if (_arg1 == "previous"){
_local2 = "810";
_local3 = (currentPet - 1);
currentPet = _local3;
} else {
if (_arg1 == "next"){
_local2 = "-810";
_local3 = (currentPet + 1);
currentPet = _local3;
};
};
if (currentPet < 1){
currentPet = 3;
} else {
if (currentPet > 3){
currentPet = 1;
};
};
trace(("currentPet: " + currentPet));
if (currentPet == 1){
currentPetMC = stall1Pet;
} else {
if (currentPet == 2){
currentPetMC = stall2Pet;
} else {
if (currentPet == 3){
currentPetMC = stall3Pet;
};
};
};
trace(("currentPetMC: " + currentPetMC));
currentPetBitmap = currentPetMC.currentBitmap;
traceCurrentPetVars();
TweenLite.to(stall1PetHolder, stallAnimationTimeInSeconds, {x:_local2, ease:stallAnimationEase, onComplete:checkPetPosition, onCompleteParams:[stall1PetHolder, 1]});
TweenLite.to(stall2PetHolder, stallAnimationTimeInSeconds, {x:_local2, ease:stallAnimationEase, onComplete:checkPetPosition, onCompleteParams:[stall2PetHolder, 2]});
TweenLite.to(stall3PetHolder, stallAnimationTimeInSeconds, {x:_local2, ease:stallAnimationEase, onComplete:checkPetPosition, onCompleteParams:[stall3PetHolder, 3]});
}
private function completeCurrentTask():void{
gameMeter.gainControl(taskCompletedGameMeterIncrement);
stopToolProgressTimer();
currentPetMC.completeCurrentTask();
updateOrderForm();
currentPetBitmap = currentPetMC.currentBitmap;
}
private function helpSkipClickListener(_arg1:MouseEvent):void{
help.okBtn.removeEventListener(MouseEvent.CLICK, helpOkClickListener);
help.skipBtn.removeEventListener(MouseEvent.CLICK, helpSkipClickListener);
soundManager.playSoundEffect("click");
help.gotoAndStop("off");
if (gameStarted == false){
startGame();
} else {
gamePaused = false;
};
}
private function endTryAgainClickListener(_arg1:MouseEvent):void{
gameClock.reset();
gameMeter.reset();
initPets();
removeEndScreenListeners();
end.gotoAndStop("off");
orderAnimation.orderForm.sweeper.gotoAndStop("on");
startGame();
}
private function previousStallClickListener(_arg1:MouseEvent):void{
if (gamePaused == false){
if (stallsAnimating == false){
soundManager.playSoundEffect("click");
soundManager.playSoundEffect("swoosh");
stallsAnimating = true;
removePetAlert();
TweenLite.to(curtains, stallAnimationTimeInSeconds, {x:"810", ease:stallAnimationEase, onComplete:resetCurtains});
TweenLite.to(floorAndWallpaper, stallAnimationTimeInSeconds, {x:"810", ease:stallAnimationEase, onComplete:resetFloor});
animateStalls("previous");
animatePets("previous");
cycleOutOrderForm();
};
};
}
private function resetFloor():void{
floorAndWallpaper.x = floorStartX;
}
}
}//package com.kennethwarner.petSpa
Section 14
//SendToFriend (com.kennethwarner.petSpa.SendToFriend)
package com.kennethwarner.petSpa {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class SendToFriend extends MovieClip {
public var backBtn:SimpleButton;
public var friend1NameTxt:TextField;
private var gameURL:String;
public var yourNameTxt:TextField;
private var serverURL:String;// = "http://animal.discovery.com/webapps/staf/staf.jsp"
public var closeBtn:SimpleButton;
private var formData:Object;
public var yourEmailTxt:TextField;
public var friend1EmailTxt:TextField;
public var friend2EmailTxt:TextField;
public var friend3EmailTxt:TextField;
public var sendBtn:SimpleButton;
private var emailCounter:uint;// = 0
public var friend3NameTxt:TextField;
private var emailsToSend:uint;// = 0
public var friend2NameTxt:TextField;
private var emailSubject:String;// = "Help! I'm stuck in a Pet Spa and can't get out!"
public function SendToFriend(){
gameURL = PetSpa.sendToFriendURL;
serverURL = "http://animal.discovery.com/webapps/staf/staf.jsp";
emailSubject = "Help! I'm stuck in a Pet Spa and can't get out!";
formData = new Object();
emailCounter = 0;
emailsToSend = 0;
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
init();
}
private function traceObject(_arg1:Object):void{
var _local2:String;
for (_local2 in _arg1) {
trace(((_local2 + ": ") + _arg1[_local2]));
};
}
private function sendBtnClickListener(_arg1:MouseEvent):void{
sendBtn.removeEventListener(MouseEvent.CLICK, sendBtnClickListener);
dispatchEvent(new Event("play_click_sound"));
formData.friend1Name = friend1NameTxt.text;
formData.friend1Email = friend1EmailTxt.text;
formData.friend2Name = friend2NameTxt.text;
formData.friend2Email = friend2EmailTxt.text;
formData.friend3Name = friend3NameTxt.text;
formData.friend3Email = friend3EmailTxt.text;
formData.yourName = yourNameTxt.text;
formData.yourEmail = yourEmailTxt.text;
traceObject(formData);
if (((((((!((formData.friend1Name == ""))) && (!((formData.friend1Email == ""))))) && (!((formData.yourName == ""))))) && (!((formData.yourEmail == ""))))){
initSend();
} else {
this.addEventListener("error_frame_reached", errorFrameReachedListener);
this.gotoAndStop("error");
};
}
private function init():void{
}
private function sendEmail():void{
var friendName:String;
var friendEmail:String;
var yourName:String;
var yourEmail:String;
var msg:String;
var req:URLRequest;
var loader:URLLoader;
var vars:URLVariables;
var onLoaded:Function;
onLoaded = function (_arg1:Event):void{
var _local2:String;
_local2 = loader.data;
if (_local2.indexOf("SUCCESS=TRUE") != -1){
trace("Success");
if (emailCounter < emailsToSend){
sendEmail();
} else {
gotoAndStop("sent");
};
};
};
var _loc_3:* = (emailCounter + 1);
emailCounter = _loc_3;
friendName = formData[(("friend" + emailCounter) + "Name")];
friendEmail = formData[(("friend" + emailCounter) + "Email")];
yourName = formData.yourName;
yourEmail = formData.yourEmail;
msg = (friendName + "! Help!<br>");
msg = (msg + "I'm at the Pet Spa all alone and everyone has dropped off their pets to get groomed. ");
msg = (msg + (("Get over to " + gameURL) + " and help me wash, clip, brush and dress-up these pets before "));
msg = (msg + "things really get out of control! Hurry!<br><br>");
msg = (msg + (((yourName + " (") + yourEmail) + ")<br>"));
req = new URLRequest(serverURL);
loader = new URLLoader();
vars = new URLVariables();
vars.subject = emailSubject;
vars.header1 = "Help! I'm stuck in a Pet Spa and can't get out!";
vars.format = "flash2";
vars.toName = friendName;
vars.toAddress = friendEmail;
vars.fromName = yourName;
vars.fromAddress = yourEmail;
vars.userMessage = msg;
req.method = URLRequestMethod.POST;
req.data = vars;
loader.addEventListener(Event.COMPLETE, onLoaded);
loader.load(req);
}
private function errorFrameReachedListener(_arg1:Event):void{
this.removeEventListener("error_frame_reached", errorFrameReachedListener);
backBtn.addEventListener(MouseEvent.CLICK, backBtnClickListener);
}
function frame3(){
dispatchEvent(new Event("error_frame_reached"));
}
private function formDisplayedListener(_arg1:Event):void{
this.removeEventListener("form_displayed", formDisplayedListener);
friend1NameTxt.tabIndex = 1;
friend1EmailTxt.tabIndex = 2;
friend2NameTxt.tabIndex = 3;
friend2EmailTxt.tabIndex = 4;
friend3NameTxt.tabIndex = 5;
friend3EmailTxt.tabIndex = 6;
yourNameTxt.tabIndex = 7;
yourEmailTxt.tabIndex = 8;
sendBtn.tabIndex = 9;
friend1NameTxt.text = "";
friend1EmailTxt.text = "";
friend2NameTxt.text = "";
friend2EmailTxt.text = "";
friend3NameTxt.text = "";
friend3EmailTxt.text = "";
yourNameTxt.text = "";
yourEmailTxt.text = "";
sendBtn.addEventListener(MouseEvent.CLICK, sendBtnClickListener);
closeBtn.addEventListener(MouseEvent.CLICK, closeBtnClickListener);
}
private function backBtnClickListener(_arg1:MouseEvent):void{
backBtn.removeEventListener(MouseEvent.CLICK, backBtnClickListener);
dispatchEvent(new Event("play_click_sound"));
this.addEventListener("form_displayed", returnedToForm);
this.gotoAndStop("default");
}
function frame1(){
stop();
}
private function closeBtnClickListener(_arg1:MouseEvent):void{
closeBtn.removeEventListener(MouseEvent.CLICK, closeBtnClickListener);
dispatchEvent(new Event("play_click_sound"));
this.gotoAndStop("off");
this.dispatchEvent(new Event("remove_send_to_friend"));
}
function frame5(){
dispatchEvent(new Event("sent_frame_reached"));
}
private function sendingFrameReachedListener(_arg1:Event):void{
this.removeEventListener("sending_frame_reached", sendingFrameReachedListener);
sendEmail();
}
function displayForm():void{
this.gotoAndStop("default");
this.addEventListener("form_displayed", formDisplayedListener);
}
private function returnedToForm(_arg1:Event):void{
this.removeEventListener("form_displayed", returnedToForm);
friend1NameTxt.text = formData.friend1Name;
friend1EmailTxt.text = formData.friend1Email;
friend2NameTxt.text = formData.friend2Name;
friend2EmailTxt.text = formData.friend2Email;
friend3NameTxt.text = formData.friend3Name;
friend3EmailTxt.text = formData.friend3Email;
yourNameTxt.text = formData.yourName;
yourEmailTxt.text = formData.yourEmail;
sendBtn.addEventListener(MouseEvent.CLICK, sendBtnClickListener);
}
function frame2(){
dispatchEvent(new Event("form_displayed"));
}
function frame4(){
dispatchEvent(new Event("sending_frame_reached"));
}
private function initSend():void{
trace("initSend() called.");
emailCounter = 0;
if (((!((formData.friend2Name == ""))) && (!((formData.friend2Email == ""))))){
if (((!((formData.friend3Name == ""))) && (!((formData.friend3Email == ""))))){
emailsToSend = 3;
} else {
emailsToSend = 2;
};
} else {
emailsToSend = 1;
};
this.gotoAndStop("sending");
this.addEventListener("sending_frame_reached", sendingFrameReachedListener);
}
}
}//package com.kennethwarner.petSpa
Section 15
//SoundManager (com.kennethwarner.petSpa.SoundManager)
package com.kennethwarner.petSpa {
import flash.media.*;
public class SoundManager {
private var meow:MeowSound;
private var puff:PuffSound;
private var click:ClickSound;
private var bark1:Bark1Sound;
private var scissors:ScissorsSound;
private var sweeper:SweeperSound;
private var treat:EatingTreatSound;
private var warning:WarningSound;
private var soundEffectsChannel:SoundChannel;
private var swoosh:SwooshSound;
private var hiss:HissSound;
private var musicChannel:SoundChannel;
private var growl:GrowlSound;
private var brush:BrushSound;
private var gameLoop1:GameLoop1Sound;
private var gamePaused:Boolean;
var soundEnabled:Boolean;// = true
private var taskCompleted:TaskCompletedSound;
private var musicTransform:SoundTransform;
private var soundEffectsTransform:SoundTransform;
private var gameLoop2:GameLoop2Sound;
private var toolTransform:SoundTransform;
private var introEnd:IntroEndSound;
private var toolChannel:SoundChannel;
private var sponge:SpongeSound;
private var allTasksCompleted:AllTasksCompletedSound;
private var wrongTool:WrongToolSound;
private var bark2:Bark2Sound;
private var bark3:Bark3Sound;
private var bark4:Bark4Sound;
public function SoundManager(){
soundEnabled = true;
gameLoop1 = new GameLoop1Sound();
gameLoop2 = new GameLoop2Sound();
introEnd = new IntroEndSound();
brush = new BrushSound();
scissors = new ScissorsSound();
puff = new PuffSound();
sponge = new SpongeSound();
sweeper = new SweeperSound();
wrongTool = new WrongToolSound();
bark1 = new Bark1Sound();
bark2 = new Bark2Sound();
bark3 = new Bark3Sound();
bark4 = new Bark4Sound();
growl = new GrowlSound();
meow = new MeowSound();
hiss = new HissSound();
click = new ClickSound();
swoosh = new SwooshSound();
taskCompleted = new TaskCompletedSound();
allTasksCompleted = new AllTasksCompletedSound();
warning = new WarningSound();
treat = new EatingTreatSound();
gamePaused = PetSpa.gamePaused;
soundEffectsTransform = new SoundTransform(PetSpa.soundEffectsVolume);
musicTransform = new SoundTransform(PetSpa.musicVolume);
toolTransform = new SoundTransform(PetSpa.toolVolume);
trace("SoundEffects class initialized.");
init();
}
function playToolSound(_arg1:String):void{
if (soundEnabled == true){
toolChannel = this[_arg1].play(0, 10000);
toolChannel.soundTransform = toolTransform;
};
}
function toggleSound():void{
soundEnabled = !(soundEnabled);
trace(("soundEnabled: " + soundEnabled));
if (soundEnabled == true){
soundEffectsTransform.volume = PetSpa.soundEffectsVolume;
musicTransform.volume = PetSpa.musicVolume;
} else {
soundEffectsTransform.volume = 0;
musicTransform.volume = 0;
};
musicChannel.soundTransform = musicTransform;
}
private function init():void{
}
function playGameLoop():void{
musicChannel = gameLoop1.play(0, 10000);
musicChannel.soundTransform = musicTransform;
}
function speedUpGameMusic():void{
musicChannel.stop();
musicChannel = gameLoop2.play(0, 10000);
musicChannel.soundTransform = musicTransform;
}
function stopIntroEndLoop():void{
musicChannel.stop();
}
function playSoundEffect(_arg1:String):void{
if (soundEnabled == true){
if (_arg1 == "click"){
soundEffectsChannel = click.play();
} else {
if (_arg1 == "wrong_tool"){
soundEffectsChannel = wrongTool.play();
} else {
if (_arg1 == "swoosh"){
soundEffectsChannel = swoosh.play();
} else {
if (_arg1 == "task_completed"){
soundEffectsChannel = taskCompleted.play();
} else {
if (_arg1 == "all_tasks_completed"){
soundEffectsChannel = allTasksCompleted.play();
} else {
if (_arg1 == "warning"){
soundEffectsChannel = warning.play();
} else {
if (_arg1 == "treat"){
soundEffectsChannel = treat.play();
};
};
};
};
};
};
};
soundEffectsChannel.soundTransform = soundEffectsTransform;
};
}
function ():void{
trace("playTestSound() called.");
}
function slowDownGameMusic():void{
musicChannel.stop();
musicChannel = gameLoop1.play(0, 10000);
musicChannel.soundTransform = musicTransform;
}
function (_arg1:String):void{
trace((("playSound(" + _arg1) + ") called."));
if (_arg1 == "click"){
};
}
function (_arg1:String):void{
trace(("SoundManager.gamePaused: " + gamePaused));
if (_arg1 == "Dog"){
growl.play();
} else {
if (_arg1 == "Cat"){
hiss.play();
};
};
}
function stopGameLoop():void{
musicChannel.stop();
}
function playPetAngrySound(_arg1:String, _arg2:String):void{
if (soundEnabled == true){
if (_arg1 == "Dog"){
if (_arg2 == "Dog1"){
soundEffectsChannel = bark1.play();
} else {
if (_arg2 == "Dog2"){
soundEffectsChannel = bark2.play();
} else {
if (_arg2 == "Dog3"){
soundEffectsChannel = bark3.play();
} else {
if (_arg2 == "Dog4"){
soundEffectsChannel = bark4.play();
};
};
};
};
} else {
if (_arg1 == "Cat"){
soundEffectsChannel = meow.play();
};
};
soundEffectsChannel.soundTransform = soundEffectsTransform;
};
}
function playIntroEndLoop():void{
musicChannel = introEnd.play(0, 10000);
musicChannel.soundTransform = musicTransform;
}
function stopToolSound():void{
toolChannel.stop();
}
}
}//package com.kennethwarner.petSpa
Section 16
//Elastic (gs.easing.Elastic)
package gs.easing {
public class Elastic {
private static const _2PI:Number = 6.28319;
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number = NaN;
if (_arg1 == 0){
return (_arg2);
};
var _local8:* = (_arg1 / _arg4);
_arg1 = (_arg1 / _arg4);
if (_local8 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
_arg1--;
--_arg1;
return ((((-(_arg5) * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number = NaN;
if (_arg1 == 0){
return (_arg2);
};
var _local8:* = (_arg1 / (_arg4 / 2));
_arg1 = (_arg1 / (_arg4 / 2));
if (_local8 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
_arg1--;
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
};
_arg1--;
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number = NaN;
if (_arg1 == 0){
return (_arg2);
};
var _local8:* = (_arg1 / _arg4);
_arg1 = (_arg1 / _arg4);
if (_local8 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) + _arg3) + _arg2));
}
}
}//package gs.easing
Section 17
//Quint (gs.easing.Quint)
package gs.easing {
public class Quint {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:* = ((_arg1 / _arg4) - 1);
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_local5 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:* = (_arg1 / _arg4);
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _local5) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:*;
_local5 = (_arg1 / (_arg4 / 2));
_arg1 = (_arg1 / (_arg4 / 2));
if (_local5 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_local5 = (_arg1 - 2);
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_local5 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package gs.easing
Section 18
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class TweenLite {
public var delay:Number;
protected var _hasUpdate:Boolean;
public var started:Boolean;
protected var _subTweens:Array;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
protected var _hst:Boolean;
protected var _isDisplayObject:Boolean;
public var gc:Boolean;
public var vars:Object;
public var ease:Function;
public var tweens:Array;
protected var _specialVars:Object;
public var combinedTimeScale:Number;
public var initTime:Number;
private static var _timer:Timer = new Timer(2000);
private static var _classInitted:Boolean;
public static var defaultEase:Function = TweenLite.easeOut;
public static var version:Number = 9.3;
public static var masterList:Dictionary = new Dictionary(false);
public static var currentTime:uint;
public static var overwriteManager:Object;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local4:int;
if (_arg1 == null){
return;
};
if (!_classInitted){
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_classInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
_isDisplayObject = Boolean((((_arg1 is DisplayObject)) || (_arg1.hasOwnProperty("isTweenProxy"))));
if (!(this.vars.ease is Function)){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
this.vars.visible = Boolean((this.vars.alpha > 0));
};
_specialVars = ((this.vars.isTV == true)) ? this.vars.exposedProps : this.vars;
this.tweens = [];
_subTweens = [];
var _local5:Boolean;
this.initted = false;
_hst = _local5;
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
_local4 = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if ((((masterList[_arg1] == undefined)) || (((!((_arg1 == null))) && ((_local4 == 1)))))){
masterList[_arg1] = [];
};
masterList[_arg1].push(this);
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((_specialVars.visible == null))) && ((this.vars.runBackwards == true)))) && (_isDisplayObject))){
this.target.visible = _specialVars.visible;
};
};
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (masterList[this.target] == undefined){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
masterList[this.target].push(this);
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function render(_arg1:uint):void{
var _local2:Number = NaN;
var _local3:Number = NaN;
var _local4:Object;
var _local5:int;
_local2 = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
_local5--;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5], _local2);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
var _local1:Boolean;
this.active = true;
this.started = _local1;
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
(this.startTime - 1);
};
}
public function clear():void{
this.tweens = [];
_subTweens = [];
this.vars = {};
var _local1:Boolean;
_hasUpdate = false;
_hst = _local1;
}
protected function addSubTween(_arg1:String, _arg2:Function, _arg3:Object, _arg4:Object, _arg5:Object=null):void{
var _local6:String;
_subTweens[_subTweens.length] = {name:_arg1, proxy:_arg2, target:_arg3, info:_arg5};
for (_local6 in _arg4) {
if (typeof(_arg4[_local6]) == "number"){
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], (_arg4[_local6] - _arg3[_local6]), _arg1];
} else {
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], Number(_arg4[_local6]), _arg1];
};
};
_hst = true;
}
public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local5:Array;
var _local6:ColorTransform;
var _local7:ColorTransform;
var _local8:Object;
if (((!(_arg1)) && (overwriteManager.enabled))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
if ((this.target is Array)){
_local5 = ((this.vars.endArray) || ([]));
_local4 = 0;
while (_local4 < _local5.length) {
if (((!((this.target[_local4] == _local5[_local4]))) && (!((this.target[_local4] == undefined))))){
this.tweens[this.tweens.length] = [this.target, _local4.toString(), this.target[_local4], (_local5[_local4] - this.target[_local4]), _local4.toString()];
};
_local4++;
};
} else {
if (((((!((typeof(_specialVars.tint) == "undefined"))) || ((this.vars.removeTint == true)))) && (this.target.hasOwnProperty("transform")))){
_local6 = this.target.transform.colorTransform;
_local7 = new ColorTransform();
if (_specialVars.alpha != undefined){
_local7.alphaMultiplier = _specialVars.alpha;
delete _specialVars.alpha;
} else {
_local7.alphaMultiplier = this.target.alpha;
};
if (((!((this.vars.removeTint == true))) && (((((!((_specialVars.tint == null))) && (!((_specialVars.tint == ""))))) || ((_specialVars.tint == 0)))))){
_local7.color = _specialVars.tint;
};
addSubTween("tint", tintProxy, {progress:0}, {progress:1}, {target:this.target, color:_local6, endColor:_local7});
};
if (((!((_specialVars.frame == null))) && (_isDisplayObject))){
addSubTween("frame", frameProxy, {frame:this.target.currentFrame}, {frame:_specialVars.frame}, {target:this.target});
};
if (((!(isNaN(this.vars.volume))) && (this.target.hasOwnProperty("soundTransform")))){
addSubTween("volume", volumeProxy, this.target.soundTransform, {volume:this.vars.volume}, {target:this.target});
};
if (((!((_specialVars.visible == null))) && (_isDisplayObject))){
addSubTween("visible", visibleProxy, {}, {}, {tween:this});
};
for (_local3 in _specialVars) {
if ((((((((((((((((((((((((((((((((((((_local3 == "ease")) || ((_local3 == "delay")))) || ((_local3 == "overwrite")))) || ((_local3 == "onComplete")))) || ((_local3 == "onCompleteParams")))) || ((_local3 == "runBackwards")))) || ((_local3 == "visible")))) || ((_local3 == "autoOverwrite")))) || ((_local3 == "persist")))) || ((_local3 == "onUpdate")))) || ((_local3 == "onUpdateParams")))) || ((_local3 == "autoAlpha")))) || ((_local3 == "onStart")))) || ((_local3 == "onStartParams")))) || ((_local3 == "renderOnStart")))) || ((_local3 == "proxiedEase")))) || ((_local3 == "easeParams")))) || (((_arg1) && (!((_arg2.indexOf(((" " + _local3) + " ")) == -1))))))){
} else {
if (((!(((_isDisplayObject) && ((((((_local3 == "tint")) || ((_local3 == "removeTint")))) || ((_local3 == "frame"))))))) && (!((((_local3 == "volume")) && (this.target.hasOwnProperty("soundTransform"))))))){
if (typeof(_specialVars[_local3]) == "number"){
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], (_specialVars[_local3] - this.target[_local3]), _local3];
} else {
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], Number(_specialVars[_local3]), _local3];
};
};
};
};
};
if (this.vars.runBackwards == true){
_local4 = (this.tweens.length - 1);
while (_local4 > -1) {
_local8 = this.tweens[_local4];
_local8[2] = (_local8[2] + _local8[3]);
_local8[3] = (_local8[3] * -1);
_local4--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, []);
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function complete(_arg1:Boolean=false):void{
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function frameProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target.gotoAndStop(Math.round(_arg1.target.frame));
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function visibleProxy(_arg1:Object, _arg2:Number):void{
var _local3:TweenLite;
_local3 = _arg1.info.tween;
if (_local3.duration == _arg2){
if (((!((_local3.vars.runBackwards == true))) && ((_local3.ease == _local3.vars.ease)))){
_local3.target.visible = _local3.vars.visible;
};
} else {
if (_local3.target.visible != true){
_local3.target.visible = true;
};
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && (!((masterList[_arg1] == undefined))))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function updateAll(_arg1:Event=null):void{
var _local2:uint;
var _local3:Dictionary;
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local7:* = getTimer();
currentTime = getTimer();
_local2 = _local7;
_local3 = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6 == null){
} else {
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
};
_local5--;
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:* = (_arg1 / _arg4);
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _local5) * (_arg1 - 2)) + _arg2));
}
public static function tintProxy(_arg1:Object, _arg2:Number=0):void{
var _local3:Number = NaN;
var _local4:Number = NaN;
var _local5:Object;
var _local6:Object;
_local3 = _arg1.target.progress;
_local4 = (1 - _local3);
_local5 = _arg1.info.color;
_local6 = _arg1.info.endColor;
_arg1.info.target.transform.colorTransform = new ColorTransform(((_local5.redMultiplier * _local4) + (_local6.redMultiplier * _local3)), ((_local5.greenMultiplier * _local4) + (_local6.greenMultiplier * _local3)), ((_local5.blueMultiplier * _local4) + (_local6.blueMultiplier * _local3)), ((_local5.alphaMultiplier * _local4) + (_local6.alphaMultiplier * _local3)), ((_local5.redOffset * _local4) + (_local6.redOffset * _local3)), ((_local5.greenOffset * _local4) + (_local6.greenOffset * _local3)), ((_local5.blueOffset * _local4) + (_local6.blueOffset * _local3)), ((_local5.alphaOffset * _local4) + (_local6.alphaOffset * _local3)));
}
public static function volumeProxy(_arg1:Object, _arg2:Number=0):void{
_arg1.info.target.soundTransform = _arg1.target;
}
static function killGarbage(_arg1:TimerEvent):void{
var _local2:Dictionary;
var _local3:Object;
var _local4:Array;
_local2 = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 19
//ad_anim_141 (petspa_fla.ad_anim_141)
package petspa_fla {
import flash.display.*;
public dynamic class ad_anim_141 extends MovieClip {
public function ad_anim_141(){
addFrameScript(0, frame1, 11, frame12, 17, frame18);
}
function frame18(){
gotoAndStop(1);
}
function frame12(){
stop();
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 20
//alert_abovepet_86 (petspa_fla.alert_abovepet_86)
package petspa_fla {
import flash.display.*;
public dynamic class alert_abovepet_86 extends MovieClip {
public function alert_abovepet_86(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 21
//arrow_feedme_217 (petspa_fla.arrow_feedme_217)
package petspa_fla {
import flash.display.*;
public dynamic class arrow_feedme_217 extends MovieClip {
public function arrow_feedme_217(){
addFrameScript(0, frame1, 20, frame21, 61, frame62);
}
function frame1(){
stop();
}
function frame21(){
gotoAndPlay("feedme");
}
function frame62(){
gotoAndStop("off");
}
}
}//package petspa_fla
Section 22
//arrow_upset_152 (petspa_fla.arrow_upset_152)
package petspa_fla {
import flash.display.*;
public dynamic class arrow_upset_152 extends MovieClip {
public function arrow_upset_152(){
addFrameScript(9, frame10);
}
function frame10(){
gotoAndPlay(2);
}
}
}//package petspa_fla
Section 23
//brush_drag_112 (petspa_fla.brush_drag_112)
package petspa_fla {
import flash.display.*;
public dynamic class brush_drag_112 extends MovieClip {
public function brush_drag_112(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package petspa_fla
Section 24
//c1_cleanxcopy_209 (petspa_fla.c1_cleanxcopy_209)
package petspa_fla {
import flash.display.*;
public dynamic class c1_cleanxcopy_209 extends MovieClip {
public var c1base:MovieClip;
public function c1_cleanxcopy_209(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 25
//c1accessories_223 (petspa_fla.c1accessories_223)
package petspa_fla {
import flash.display.*;
public dynamic class c1accessories_223 extends MovieClip {
public function c1accessories_223(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 26
//c1base_213 (petspa_fla.c1base_213)
package petspa_fla {
import flash.display.*;
public dynamic class c1base_213 extends MovieClip {
public var baseColor:MovieClip;
}
}//package petspa_fla
Section 27
//c1x_203 (petspa_fla.c1x_203)
package petspa_fla {
import flash.display.*;
public dynamic class c1x_203 extends MovieClip {
public var c1brush:MovieClip;
public var c1base:MovieClip;
public function c1x_203(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 28
//c2accessories_250 (petspa_fla.c2accessories_250)
package petspa_fla {
import flash.display.*;
public dynamic class c2accessories_250 extends MovieClip {
public function c2accessories_250(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 29
//c2base_247 (petspa_fla.c2base_247)
package petspa_fla {
import flash.display.*;
public dynamic class c2base_247 extends MovieClip {
public var baseColor:MovieClip;
}
}//package petspa_fla
Section 30
//credits_163 (petspa_fla.credits_163)
package petspa_fla {
import flash.events.*;
import flash.display.*;
public dynamic class credits_163 extends MovieClip {
public var closeBtn:SimpleButton;
public var e:Event;
public function credits_163(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
e = new Event("credits_displayed");
trace(("event dispatched: " + dispatchEvent(e)));
}
}
}//package petspa_fla
Section 31
//CrossoutsAnimation_85 (petspa_fla.CrossoutsAnimation_85)
package petspa_fla {
import flash.display.*;
public dynamic class CrossoutsAnimation_85 extends MovieClip {
public function CrossoutsAnimation_85(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 32
//d1accessories_259 (petspa_fla.d1accessories_259)
package petspa_fla {
import flash.display.*;
public dynamic class d1accessories_259 extends MovieClip {
public function d1accessories_259(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 33
//d1base_254 (petspa_fla.d1base_254)
package petspa_fla {
import flash.display.*;
public dynamic class d1base_254 extends MovieClip {
public var baseColor:MovieClip;
}
}//package petspa_fla
Section 34
//d1cut_257 (petspa_fla.d1cut_257)
package petspa_fla {
import flash.display.*;
public dynamic class d1cut_257 extends MovieClip {
public var cutColor:MovieClip;
}
}//package petspa_fla
Section 35
//d2accessories_267 (petspa_fla.d2accessories_267)
package petspa_fla {
import flash.display.*;
public dynamic class d2accessories_267 extends MovieClip {
public function d2accessories_267(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 36
//d2base_262 (petspa_fla.d2base_262)
package petspa_fla {
import flash.display.*;
public dynamic class d2base_262 extends MovieClip {
public var baseColor:MovieClip;
}
}//package petspa_fla
Section 37
//d2cut_265 (petspa_fla.d2cut_265)
package petspa_fla {
import flash.display.*;
public dynamic class d2cut_265 extends MovieClip {
public var cutColor:MovieClip;
}
}//package petspa_fla
Section 38
//d3accessories_275 (petspa_fla.d3accessories_275)
package petspa_fla {
import flash.display.*;
public dynamic class d3accessories_275 extends MovieClip {
public function d3accessories_275(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 39
//d3base_270 (petspa_fla.d3base_270)
package petspa_fla {
import flash.display.*;
public dynamic class d3base_270 extends MovieClip {
public var baseColor:MovieClip;
}
}//package petspa_fla
Section 40
//d3cut_273 (petspa_fla.d3cut_273)
package petspa_fla {
import flash.display.*;
public dynamic class d3cut_273 extends MovieClip {
public var cutColor:MovieClip;
}
}//package petspa_fla
Section 41
//d4accessories_283 (petspa_fla.d4accessories_283)
package petspa_fla {
import flash.display.*;
public dynamic class d4accessories_283 extends MovieClip {
public function d4accessories_283(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 42
//d4base_278 (petspa_fla.d4base_278)
package petspa_fla {
import flash.display.*;
public dynamic class d4base_278 extends MovieClip {
public var baseColor:MovieClip;
}
}//package petspa_fla
Section 43
//d4cut_281 (petspa_fla.d4cut_281)
package petspa_fla {
import flash.display.*;
public dynamic class d4cut_281 extends MovieClip {
public var cutColor:MovieClip;
}
}//package petspa_fla
Section 44
//d4cutxcopy_170 (petspa_fla.d4cutxcopy_170)
package petspa_fla {
import flash.display.*;
public dynamic class d4cutxcopy_170 extends MovieClip {
public var d4base:MovieClip;
public var d4wash:MovieClip;
public var d4brush:MovieClip;
public var d4cut:MovieClip;
public function d4cutxcopy_170(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 45
//d4x_193 (petspa_fla.d4x_193)
package petspa_fla {
import flash.display.*;
public dynamic class d4x_193 extends MovieClip {
public var d4base:MovieClip;
public var d4wash:MovieClip;
public var d4brush:MovieClip;
public function d4x_193(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 46
//end_156 (petspa_fla.end_156)
package petspa_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public dynamic class end_156 extends MovieClip {
public var pledgeBtn:SimpleButton;
public var tryAgain:SimpleButton;
public var send:SimpleButton;
public var credits:SimpleButton;
public var scoreTxt:TextField;
public var e:Event;
public function end_156(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
e = new Event("end_screen_displayed");
trace(("event dispatched: " + dispatchEvent(e)));
}
}
}//package petspa_fla
Section 47
//eye1_216 (petspa_fla.eye1_216)
package petspa_fla {
import flash.display.*;
public dynamic class eye1_216 extends MovieClip {
public function eye1_216(){
addFrameScript(108, frame109, 175, frame176);
}
function frame176(){
stop();
}
function frame109(){
gotoAndPlay("blink");
}
}
}//package petspa_fla
Section 48
//help_169 (petspa_fla.help_169)
package petspa_fla {
import flash.events.*;
import flash.display.*;
public dynamic class help_169 extends MovieClip {
public var skipBtn:SimpleButton;
public var playBtn:SimpleButton;
public var okBtn:SimpleButton;
public function help_169(){
addFrameScript(0, frame1, 1, frame2, 6, frame7);
}
function frame7(){
dispatchEvent(new Event("help_last_displayed"));
}
function frame1(){
stop();
}
function frame2(){
dispatchEvent(new Event("help_displayed"));
}
}
}//package petspa_fla
Section 49
//intro_153 (petspa_fla.intro_153)
package petspa_fla {
import flash.events.*;
import flash.display.*;
public dynamic class intro_153 extends MovieClip {
public var e:Event;
public var begin:SimpleButton;
public function intro_153(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
e = new Event("intro_displayed");
trace(("event dispatched: " + dispatchEvent(e)));
}
}
}//package petspa_fla
Section 50
//meter_anim_46 (petspa_fla.meter_anim_46)
package petspa_fla {
import flash.display.*;
public dynamic class meter_anim_46 extends MovieClip {
public function meter_anim_46(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 51
//order_70 (petspa_fla.order_70)
package petspa_fla {
import flash.display.*;
import flash.text.*;
public dynamic class order_70 extends MovieClip {
public var task5Txt:TextField;
public var task2Txt:TextField;
public var task3Txt:TextField;
public var sweeper:MovieClip;
public var task4Txt:TextField;
public var task1Txt:TextField;
public var crossoutsAnimation:MovieClip;
}
}//package petspa_fla
Section 52
//order_anim_69 (petspa_fla.order_anim_69)
package petspa_fla {
import flash.events.*;
import flash.display.*;
public dynamic class order_anim_69 extends MovieClip {
public var orderForm:MovieClip;
public var e:Event;
public function order_anim_69(){
addFrameScript(0, frame1, 1, frame2, 24, frame25, 34, frame35, 39, frame40);
}
function frame25(){
stop();
e = new Event("order_form_displayed");
dispatchEvent(e);
e = new Event("order_form_cycled_in");
dispatchEvent(e);
}
function frame1(){
stop();
}
function frame35(){
gotoAndStop(1);
e = new Event("order_form_cycled_out");
dispatchEvent(e);
}
function frame40(){
stop();
}
function frame2(){
e = new Event("order_form_cycling_in");
dispatchEvent(e);
}
}
}//package petspa_fla
Section 53
//pointer_anim_67 (petspa_fla.pointer_anim_67)
package petspa_fla {
import flash.display.*;
public dynamic class pointer_anim_67 extends MovieClip {
public function pointer_anim_67(){
addFrameScript(0, frame1, 12, frame13, 16, frame17);
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame17(){
gotoAndStop(1);
}
}
}//package petspa_fla
Section 54
//puff_anim_119 (petspa_fla.puff_anim_119)
package petspa_fla {
import flash.display.*;
public dynamic class puff_anim_119 extends MovieClip {
public function puff_anim_119(){
addFrameScript(59, frame60);
}
function frame60(){
gotoAndPlay(2);
}
}
}//package petspa_fla
Section 55
//puff_drag_117 (petspa_fla.puff_drag_117)
package petspa_fla {
import flash.display.*;
public dynamic class puff_drag_117 extends MovieClip {
public function puff_drag_117(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 56
//puff_poof_anim_120 (petspa_fla.puff_poof_anim_120)
package petspa_fla {
import flash.display.*;
public dynamic class puff_poof_anim_120 extends MovieClip {
public function puff_poof_anim_120(){
addFrameScript(24, frame25);
}
function frame25(){
gotoAndPlay(10);
}
}
}//package petspa_fla
Section 57
//scissors_drag_129 (petspa_fla.scissors_drag_129)
package petspa_fla {
import flash.display.*;
public dynamic class scissors_drag_129 extends MovieClip {
public function scissors_drag_129(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 58
//scissors_hair_anim_132 (petspa_fla.scissors_hair_anim_132)
package petspa_fla {
import flash.display.*;
public dynamic class scissors_hair_anim_132 extends MovieClip {
public function scissors_hair_anim_132(){
addFrameScript(29, frame30);
}
function frame30(){
gotoAndPlay(11);
}
}
}//package petspa_fla
Section 59
//speak_219 (petspa_fla.speak_219)
package petspa_fla {
import flash.display.*;
public dynamic class speak_219 extends MovieClip {
public function speak_219(){
addFrameScript(0, frame1, 11, frame12, 22, frame23, 33, frame34, 44, frame45);
}
function frame12(){
gotoAndStop("off");
}
function frame1(){
stop();
}
function frame23(){
gotoAndStop("off");
}
function frame34(){
gotoAndStop("off");
}
function frame45(){
gotoAndStop("off");
}
}
}//package petspa_fla
Section 60
//sponge_drag_87 (petspa_fla.sponge_drag_87)
package petspa_fla {
import flash.display.*;
public dynamic class sponge_drag_87 extends MovieClip {
public function sponge_drag_87(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 61
//sponge_suds_anim_105 (petspa_fla.sponge_suds_anim_105)
package petspa_fla {
import flash.display.*;
public dynamic class sponge_suds_anim_105 extends MovieClip {
public function sponge_suds_anim_105(){
addFrameScript(26, frame27);
}
function frame27(){
gotoAndPlay(11);
}
}
}//package petspa_fla
Section 62
//sponge_suds_animxcopy_196 (petspa_fla.sponge_suds_animxcopy_196)
package petspa_fla {
import flash.display.*;
public dynamic class sponge_suds_animxcopy_196 extends MovieClip {
public function sponge_suds_animxcopy_196(){
addFrameScript(26, frame27);
}
function frame27(){
gotoAndPlay(11);
}
}
}//package petspa_fla
Section 63
//stage_sound_on_off_145 (petspa_fla.stage_sound_on_off_145)
package petspa_fla {
import flash.display.*;
public dynamic class stage_sound_on_off_145 extends MovieClip {
public var soundBtn:SimpleButton;
public function stage_sound_on_off_145(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 64
//sweeper_anim_137 (petspa_fla.sweeper_anim_137)
package petspa_fla {
import flash.display.*;
public dynamic class sweeper_anim_137 extends MovieClip {
public var sweeper:MovieClip;
}
}//package petspa_fla
Section 65
//sweeper_drag_136 (petspa_fla.sweeper_drag_136)
package petspa_fla {
import flash.display.*;
public dynamic class sweeper_drag_136 extends MovieClip {
public var sweeperAnimation:MovieClip;
public function sweeper_drag_136(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 66
//sweeper_for_anim_138 (petspa_fla.sweeper_for_anim_138)
package petspa_fla {
import flash.display.*;
public dynamic class sweeper_for_anim_138 extends MovieClip {
public var hair:MovieClip;
}
}//package petspa_fla
Section 67
//sweeper_order_74 (petspa_fla.sweeper_order_74)
package petspa_fla {
import flash.display.*;
public dynamic class sweeper_order_74 extends MovieClip {
public function sweeper_order_74(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 68
//sweeperhair_139 (petspa_fla.sweeperhair_139)
package petspa_fla {
import flash.display.*;
public dynamic class sweeperhair_139 extends MovieClip {
public function sweeperhair_139(){
addFrameScript(0, frame1, 112, frame113);
}
function frame1(){
stop();
}
function frame113(){
stop();
}
}
}//package petspa_fla
Section 69
//treat_drag_66 (petspa_fla.treat_drag_66)
package petspa_fla {
import flash.display.*;
public dynamic class treat_drag_66 extends MovieClip {
public function treat_drag_66(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 70
//UnhappyPetAlert_151 (petspa_fla.UnhappyPetAlert_151)
package petspa_fla {
import flash.display.*;
public dynamic class UnhappyPetAlert_151 extends MovieClip {
public var unhappyPetAlert:MovieClip;
public function UnhappyPetAlert_151(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package petspa_fla
Section 71
//warning_144 (petspa_fla.warning_144)
package petspa_fla {
import flash.display.*;
import flash.text.*;
public dynamic class warning_144 extends MovieClip {
public var warningTxt:TextField;
}
}//package petspa_fla
Section 72
//warning_anim_143 (petspa_fla.warning_anim_143)
package petspa_fla {
import flash.display.*;
public dynamic class warning_anim_143 extends MovieClip {
public var warning:MovieClip;
public function warning_anim_143(){
addFrameScript(0, frame1, 14, frame15, 19, frame20);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame20(){
gotoAndStop(1);
}
}
}//package petspa_fla
Section 73
//AllTasksCompletedSound (AllTasksCompletedSound)
package {
import flash.media.*;
public dynamic class AllTasksCompletedSound extends Sound {
}
}//package
Section 74
//Bark1Sound (Bark1Sound)
package {
import flash.media.*;
public dynamic class Bark1Sound extends Sound {
}
}//package
Section 75
//Bark2Sound (Bark2Sound)
package {
import flash.media.*;
public dynamic class Bark2Sound extends Sound {
}
}//package
Section 76
//Bark3Sound (Bark3Sound)
package {
import flash.media.*;
public dynamic class Bark3Sound extends Sound {
}
}//package
Section 77
//Bark4Sound (Bark4Sound)
package {
import flash.media.*;
public dynamic class Bark4Sound extends Sound {
}
}//package
Section 78
//BrushSound (BrushSound)
package {
import flash.media.*;
public dynamic class BrushSound extends Sound {
}
}//package
Section 79
//ClickSound (ClickSound)
package {
import flash.media.*;
public dynamic class ClickSound extends Sound {
}
}//package
Section 80
//EatingTreatSound (EatingTreatSound)
package {
import flash.media.*;
public dynamic class EatingTreatSound extends Sound {
}
}//package
Section 81
//GameLoop1Sound (GameLoop1Sound)
package {
import flash.media.*;
public dynamic class GameLoop1Sound extends Sound {
}
}//package
Section 82
//GameLoop2Sound (GameLoop2Sound)
package {
import flash.media.*;
public dynamic class GameLoop2Sound extends Sound {
}
}//package
Section 83
//GrowlSound (GrowlSound)
package {
import flash.media.*;
public dynamic class GrowlSound extends Sound {
}
}//package
Section 84
//HissSound (HissSound)
package {
import flash.media.*;
public dynamic class HissSound extends Sound {
}
}//package
Section 85
//IntroEndSound (IntroEndSound)
package {
import flash.media.*;
public dynamic class IntroEndSound extends Sound {
}
}//package
Section 86
//MeowSound (MeowSound)
package {
import flash.media.*;
public dynamic class MeowSound extends Sound {
}
}//package
Section 87
//PuffSound (PuffSound)
package {
import flash.media.*;
public dynamic class PuffSound extends Sound {
}
}//package
Section 88
//ScissorsSound (ScissorsSound)
package {
import flash.media.*;
public dynamic class ScissorsSound extends Sound {
}
}//package
Section 89
//SpongeSound (SpongeSound)
package {
import flash.media.*;
public dynamic class SpongeSound extends Sound {
}
}//package
Section 90
//SweeperSound (SweeperSound)
package {
import flash.media.*;
public dynamic class SweeperSound extends Sound {
}
}//package
Section 91
//SwooshSound (SwooshSound)
package {
import flash.media.*;
public dynamic class SwooshSound extends Sound {
}
}//package
Section 92
//TaskCompletedSound (TaskCompletedSound)
package {
import flash.media.*;
public dynamic class TaskCompletedSound extends Sound {
}
}//package
Section 93
//WarningSound (WarningSound)
package {
import flash.media.*;
public dynamic class WarningSound extends Sound {
}
}//package
Section 94
//WrongToolSound (WrongToolSound)
package {
import flash.media.*;
public dynamic class WrongToolSound extends Sound {
}
}//package