Section 1
//GameInterface (com.meteorgames.flashsystem.game.GameInterface)
package com.meteorgames.flashsystem.game {
import flash.display.*;
import com.meteorgames.flashsystem.system.*;
public class GameInterface extends MovieClip {
private var _systemReady:Boolean;
public var _SYSTEM:System;
public function GameInterface(){
_systemReady = false;
}
public function initGame(){
var _local1:*;
var _local2:*;
var _local3:String;
_local1 = false;
_local2 = false;
_local3 = this.root.loaderInfo.url;
if (((!((_local3.indexOf("http://www.twinskies.com/", 0) == 0))) && (!((_local3.indexOf("http://192.168.2.13", 0) == 0))))){
_local1 = true;
} else {
if (_local3.indexOf("/flash/g/", 0) == -1){
_local1 = true;
};
};
if (_local3.toUpperCase().indexOf("FILE", 0) != -1){
_local1 = false;
_local2 = true;
};
if (this.parent.toString().toUpperCase().indexOf("STAGE", 0) >= 0){
_local2 = true;
};
if (((_local1) || (_local2))){
_SYSTEM = new System();
_SYSTEM.init(new GameParams());
_SYSTEM.gameIsOffline = _local2;
_SYSTEM.gameIsHostedExternally = _local1;
_systemReady = true;
};
}
public function setSystem(_arg1:System){
_SYSTEM = _arg1;
_systemReady = true;
}
public function get systemReady():Boolean{
return (_systemReady);
}
}
}//package com.meteorgames.flashsystem.game
Section 2
//GameParams (com.meteorgames.flashsystem.system.GameParams)
package com.meteorgames.flashsystem.system {
public class GameParams {
public var sUserID:String;
public var iGameHeight:Number;
public var sPreloader:String;
public var iGameWidth:Number;
public var sID:String;
public var iCollectStats:Number;
public var sPHPServer:String;
public var sLanguage:String;
public var iFramerate:Number;
public var sTehGame:String;
public var sSWFServer:String;
public function GameParams(){
sID = "";
sTehGame = "";
sPreloader = "";
sSWFServer = "";
sPHPServer = "";
iCollectStats = 0;
iFramerate = 30;
iGameWidth = 500;
iGameHeight = 500;
sUserID = "";
sLanguage = "en";
}
public function setVar(_arg1:String, _arg2):void{
if (this[_arg1] != undefined){
if (_arg2 != undefined){
this[_arg1] = _arg2;
};
};
}
}
}//package com.meteorgames.flashsystem.system
Section 3
//GameTracking (com.meteorgames.flashsystem.system.GameTracking)
package com.meteorgames.flashsystem.system {
import flash.events.*;
import flash.net.*;
public class GameTracking {
private var _dataReceived:Boolean;
private var _iTrackData:int;
private var _PHPSERVER:String;
private var _PHPSCRIPT:String;
private var _GAMEID:String;
private var _loader:URLLoader;
public function GameTracking(){
_PHPSERVER = "";
_PHPSCRIPT = "scripts/minigame";
_dataReceived = false;
}
private function securityErrorHandler(_arg1:SecurityErrorEvent):void{
_dataReceived = true;
removeListeners();
}
public function init(_arg1:String, _arg2:String="", _arg3:int=0):void{
_PHPSERVER = _arg1;
_GAMEID = _arg2;
_iTrackData = _arg3;
if (_PHPSERVER.charAt((_PHPSERVER.length - 1)) != "/"){
_PHPSERVER = (_PHPSERVER + "/");
};
}
private function completeHandler(_arg1:Event):void{
_dataReceived = true;
removeListeners();
}
public function logGameOver(_arg1:String):void{
var _local2:String;
var _local3:URLVariables;
var _local4:URLRequest;
if (_iTrackData == 0){
return;
};
_local2 = (_PHPSERVER + _PHPSCRIPT);
_local3 = new URLVariables();
_local3.data = _arg1;
_local4 = new URLRequest(_local2);
_local4.data = _local3;
trackIt(_local4);
}
private function removeListeners():void{
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
}
private function trackIt(_arg1:URLRequest):void{
var request = _arg1;
try {
sendToURL(request);
} catch(e:Error) {
};
}
public function getReturnVar(_arg1:String):String{
var _local2:String;
_local2 = "";
if (_loader.data[_arg1] != null){
_local2 = String(_loader.data[_arg1]);
};
return (_local2);
}
public function postPoints(_arg1:String):void{
var _local2:String;
var _local3:URLVariables;
var _local4:URLRequest;
_dataReceived = false;
_local2 = (_PHPSERVER + _PHPSCRIPT);
_local3 = new URLVariables();
_local3.data = _arg1;
_local4 = new URLRequest(_local2);
_local4.data = _local3;
postIt(_local4);
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
_dataReceived = true;
removeListeners();
}
private function postIt(_arg1:URLRequest):void{
var request = _arg1;
_loader = new URLLoader();
_loader.dataFormat = URLLoaderDataFormat.VARIABLES;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(request);
} catch(e:Error) {
_dataReceived = true;
};
}
public function logGameStart(_arg1:String):void{
var _local2:String;
var _local3:URLVariables;
var _local4:URLRequest;
if (_iTrackData == 0){
return;
};
_local2 = (_PHPSERVER + _PHPSCRIPT);
_local3 = new URLVariables();
_local3.data = _arg1;
_local4 = new URLRequest(_local2);
_local4.data = _local3;
trackIt(_local4);
}
public function get wasDataReceived():Boolean{
return (_dataReceived);
}
public function keepSessionAlive(_arg1:String):void{
var _local2:String;
var _local3:URLVariables;
var _local4:URLRequest;
_local2 = (_PHPSERVER + _PHPSCRIPT);
_local3 = new URLVariables();
_local3.data = _arg1;
_local4 = new URLRequest(_local2);
_local4.data = _local3;
trackIt(_local4);
}
}
}//package com.meteorgames.flashsystem.system
Section 4
//System (com.meteorgames.flashsystem.system.System)
package com.meteorgames.flashsystem.system {
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class System {
private var _bOffline:Boolean;
private var _KEY:Verschluesselung;
private var _GAMETRACKING:GameTracking;
private var _TRANSLATION:Translation;
private var _bExternalHost:Boolean;
private var _aAdd:Array;
private var _iGameSessionLength:int;
private var _aP:Array;
private var _GAME_PARAMS:Object;
public function System(){
var _local1:Array;
super();
_bOffline = false;
_bExternalHost = false;
_aP = new Array();
_aAdd = new Array();
_iGameSessionLength = 0;
_local1 = new Array();
}
public function keepSessionAlive():void{
var _local1:String;
var _local2:*;
if (((_bOffline) || (_bExternalHost))){
return;
};
_local1 = "ct=keep_session_alive";
_local2 = _KEY.run(_local1);
_GAMETRACKING.keepSessionAlive(_local2);
}
public function addParam(_arg1:String, _arg2):void{
_aAdd[_arg1] = _arg2;
}
public function addFont(_arg1:Font, _arg2:String):void{
_TRANSLATION.addFont(_arg1, _arg2);
}
public function logGameOver(_arg1:int=1):void{
var _local2:String;
var _local3:*;
_iGameSessionLength = (getTimer() - _iGameSessionLength);
if (((_bOffline) || (_bExternalHost))){
return;
};
_local2 = ((("ct=game_end&minigame_id=" + String(getFlashParam("sID"))) + "&minigame_mode=") + String(_arg1));
_local3 = _KEY.run(_local2);
_GAMETRACKING.logGameOver(_local3);
}
public function setTextField(_arg1:TextField, _arg2:String):void{
_TRANSLATION.setTextField(_arg1, _arg2);
}
public function setFont(_arg1:String):void{
_TRANSLATION.setFont(_arg1);
}
public function set gameIsOffline(_arg1:Boolean):void{
_bOffline = _arg1;
}
public function get gameIsOffline():Boolean{
return (_bOffline);
}
public function init(_arg1:Object):void{
_GAME_PARAMS = _arg1;
_GAMETRACKING = new GameTracking();
_GAMETRACKING.init(getFlashParam("sPHPServer"), getFlashParam("sID"), int(getFlashParam("iCollectStats")));
_TRANSLATION = new Translation();
_TRANSLATION.init();
_KEY = new Verschluesselung();
}
public function getServerResponse():String{
var _local1:String;
_local1 = "";
if (((_bOffline) || (_bExternalHost))){
_local1 = "Visit <u><a href='http://www.twinskies.com/' target='_blank'>www.twinskies.com</a></u> today to sign up for an account!";
} else {
_local1 = _GAMETRACKING.getReturnVar("text");
};
return (_local1);
}
public function get gameIsHostedExternally():Boolean{
return (_bExternalHost);
}
public function postPoints(_arg1:int=0, _arg2:int=1):void{
var _local3:*;
if (((_bOffline) || (_bExternalHost))){
return;
};
_local3 = "TPOSG";
_GAMETRACKING.postPoints(_local3);
}
public function getLegalText(_arg1:int):String{
var _local2:String;
var _local3:*;
_local2 = (("<p align='center'><font size='" + String(_arg1)) + "'><a href='http://www.twinskies.com' target='_blank'>Twin Skies</a> graphics, text and sound elements copyright 2008");
_local3 = new Date();
if (_local3.getFullYear() > 2008){
_local2 = (_local2 + (" - " + String(_local3.getFullYear())));
};
_local2 = (_local2 + " by Meteor Games LLC.<br>All rights reserved. <a href='http://www.twinskies.com' target='_blank'>Twin Skies</a> is a trademark of Meteor Games LLC.</font></p>");
return (_local2);
}
public function serverHasResponded():Boolean{
var _local1:Boolean;
_local1 = false;
if (((_bOffline) || (_bExternalHost))){
_local1 = true;
} else {
_local1 = _GAMETRACKING.wasDataReceived;
};
return (_local1);
}
public function set gameIsHostedExternally(_arg1:Boolean):void{
_bExternalHost = _arg1;
}
public function getFlashParam(_arg1:String):String{
return (String(_GAME_PARAMS[_arg1]));
}
public function logGameStart(_arg1:int=1):void{
var _local2:String;
var _local3:*;
_iGameSessionLength = getTimer();
if (((_bOffline) || (_bExternalHost))){
return;
};
_local2 = ((("ct=game_start&minigame_id=" + String(getFlashParam("sID"))) + "&minigame_mode=") + String(_arg1));
_local3 = _KEY.run(_local2);
_GAMETRACKING.logGameStart(_local3);
}
public function setSchluessel(_arg1:MovieClip){
}
public function getGameVersion():String{
var _local1:String;
var _local2:String;
var _local3:RegExp;
var _local4:Array;
_local1 = "";
_local2 = getFlashParam("sTehGame");
if (_local2 != ""){
_local3 = /_v[0-9]+?.swf/;
_local4 = _local2.match(_local3);
if (_local4 != null){
if (_local4.length > 0){
_local1 = String(_local4[0]);
_local1 = _local1.replace("_v", "");
_local1 = _local1.replace(".swf", "");
};
};
};
return (_local1);
}
}
}//package com.meteorgames.flashsystem.system
Section 5
//Textfields (com.meteorgames.flashsystem.system.Textfields)
package com.meteorgames.flashsystem.system {
import flash.text.*;
public class Textfields {
private var _aFonts:Array;
private var _bMultiline:Boolean;
private var _objDefaultTextFormat:TextFormat;
private var _bWordWrap:Boolean;
private var _bWesternLang:Boolean;
public function Textfields():void{
_bWesternLang = true;
_bMultiline = true;
_bWordWrap = true;
_aFonts = new Array();
_objDefaultTextFormat = new TextFormat();
}
public function setTextField(_arg1:TextField, _arg2:String):void{
_arg1.embedFonts = _bWesternLang;
_arg1.multiline = _bMultiline;
_arg1.wordWrap = _bWordWrap;
_arg1.htmlText = _arg2;
_arg1.setTextFormat(_objDefaultTextFormat);
}
public function init(_arg1:Boolean):void{
_bWesternLang = _arg1;
}
public function setFont(_arg1:String):void{
if (_aFonts[_arg1] != undefined){
_objDefaultTextFormat.font = _aFonts[_arg1].fontName;
};
}
public function addFont(_arg1:Font, _arg2:String):void{
if (_aFonts[_arg2] == undefined){
_aFonts[_arg2] = _arg1;
};
}
}
}//package com.meteorgames.flashsystem.system
Section 6
//Translation (com.meteorgames.flashsystem.system.Translation)
package com.meteorgames.flashsystem.system {
import flash.text.*;
public class Translation {
private var _TEXTFIELDS:Textfields;
public function Translation(){
_TEXTFIELDS = new Textfields();
}
public function init():void{
_TEXTFIELDS.init(true);
}
public function addFont(_arg1:Font, _arg2:String):void{
_TEXTFIELDS.addFont(_arg1, _arg2);
}
public function setFont(_arg1:String):void{
_TEXTFIELDS.setFont(_arg1);
}
public function setTextField(_arg1:TextField, _arg2:String):void{
_TEXTFIELDS.setTextField(_arg1, _arg2);
}
}
}//package com.meteorgames.flashsystem.system
Section 7
//Verschluesselung (com.meteorgames.flashsystem.system.Verschluesselung)
package com.meteorgames.flashsystem.system {
public class Verschluesselung {
private static var _sA:String;
private static var _sB:String;
public function Verschluesselung(){
var _local1:uint;
var _local2:Array;
var _local3:Array;
super();
_local1 = (Math.pow(2, 3) * Math.pow(2, 3));
_local2 = [-15, -14, -13, -12, -11, -10, -9, -8, -7, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -16, -15, -14, -13, -12, -11, -10];
_local3 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26];
}
public function run(_arg1:String):String{
return ("TPOSG");
}
}
}//package com.meteorgames.flashsystem.system
Section 8
//SoundManager (com.meteorgames.libs.sound.SoundManager)
package com.meteorgames.libs.sound {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
public class SoundManager {
private var _bMusic:Boolean;
private var _aChannels:Array;
private var _iVolFX:Number;
private var _iVolMusic:Number;
private var _aMusic:Array;
private var _bFX:Boolean;
private var _aFX:Array;
static var _C_MUSIC:int = 1;
static var _C_FX:int = 0;
public function SoundManager(){
_bFX = true;
_bMusic = true;
_iVolFX = 1;
_iVolMusic = 1;
_aFX = new Array();
_aMusic = new Array();
_aChannels = new Array();
}
public function stopMusic(_arg1:String=""):void{
var _local2:SoundObject;
var _local3:Object;
var _local4:String;
var _local5:Boolean;
for (_local4 in _aChannels) {
_local2 = _aChannels[_local4];
if (_local2 == null){
} else {
if (_local2.getType() == _C_MUSIC){
_local5 = true;
if (((!((_arg1 == ""))) && (!((_local2.getID() == _arg1))))){
_local5 = false;
};
if (_local5){
_local2._soundChannel.stop();
_local3 = _aMusic[_local2.getID()];
_local3.iPlaying--;
};
};
};
};
}
private function updateAllFXVol():void{
var _local1:SoundObject;
var _local2:String;
for (_local2 in _aChannels) {
_local1 = _aChannels[_local2];
if (_local1 == null){
} else {
if (_local1.getType() == _C_FX){
_local1.setVolume(_iVolFX);
};
};
};
}
public function addMusic(_arg1:Sound, _arg2:String="", _arg3:Boolean=false):void{
var _local4:Object;
if (_arg2 == ""){
return;
};
if (_aMusic[_arg2] == undefined){
_local4 = createSoundAsset(_C_MUSIC, _arg1, _arg2, _arg3);
_aMusic[_arg2] = _local4;
};
}
public function playFX(_arg1:String="", _arg2:int=0, _arg3:int=1, _arg4:Number=1, _arg5:Number=0):void{
var _local6:Object;
if (!_bFX){
return;
};
if (_aFX[_arg1] != undefined){
_local6 = _aFX[_arg1];
if (_arg4 > _iVolFX){
_arg4 = _iVolFX;
};
playIt(_local6, _arg2, _arg3, _arg4, _arg5);
};
}
public function stopAll():void{
stopFX();
stopMusic();
_aChannels = new Array();
}
public function fadeMusic(_arg1:String="", _arg2:Number=0, _arg3:Number=1, _arg4:int=1000):void{
if (_arg2 > _iVolMusic){
_arg2 = _iVolMusic;
};
fade(_C_MUSIC, _arg1, _arg2, _arg3, _arg4);
}
public function playMusic(_arg1:String="", _arg2:int=0, _arg3:int=1, _arg4:Number=1, _arg5:Number=0):void{
var _local6:Object;
if (!_bMusic){
return;
};
if (_aMusic[_arg1] != undefined){
_local6 = _aMusic[_arg1];
if (_arg4 > _iVolMusic){
_arg4 = _iVolMusic;
};
playIt(_local6, _arg2, _arg3, _arg4, _arg5);
};
}
public function stopFX(_arg1:String=""):void{
var _local2:SoundObject;
var _local3:Object;
var _local4:String;
var _local5:Boolean;
for (_local4 in _aChannels) {
_local2 = _aChannels[_local4];
if (_local2 == null){
} else {
if (_local2.getType() == _C_FX){
_local5 = true;
if (((!((_arg1 == ""))) && (!((_local2.getID() == _arg1))))){
_local5 = false;
};
if (_local5){
_local2._soundChannel.stop();
_local3 = _aFX[_local2.getID()];
_local3.iPlaying--;
};
};
};
};
}
public function fadeFX(_arg1:String="", _arg2:Number=0, _arg3:Number=1, _arg4:int=1000):void{
if (_arg2 > _iVolFX){
_arg2 = _iVolFX;
};
fade(_C_FX, _arg1, _arg2, _arg3, _arg4);
}
public function setMusicVolume(_arg1:int):void{
_iVolMusic = Number((_arg1 / 100));
updateAllMusicVol();
}
private function fade(_arg1:int, _arg2:String, _arg3:Number, _arg4:Number, _arg5:int):void{
var _local6:SoundObject;
var _local7:Object;
var _local8:String;
var _local9:Boolean;
for (_local8 in _aChannels) {
_local6 = _aChannels[_local8];
if (_local6 == null){
} else {
if (_local6.getType() == _arg1){
_local9 = true;
if (((!((_arg2 == ""))) && (!((_local6.getID() == _arg2))))){
_local9 = false;
};
if (_local9){
_local6.fade(_arg3, _arg4, _arg5);
};
};
};
};
}
public function getFXVolume():Number{
return (_iVolFX);
}
private function updateAllMusicVol():void{
var _local1:SoundObject;
var _local2:String;
for (_local2 in _aChannels) {
_local1 = _aChannels[_local2];
if (_local1 == null){
} else {
if (_local1.getType() == _C_MUSIC){
_local1.setVolume(_iVolMusic);
};
};
};
}
public function getMusicVolume():Number{
return (_iVolMusic);
}
public function setMusic(_arg1:Boolean):void{
_bMusic = _arg1;
}
public function setFXVolume(_arg1:int):void{
_iVolFX = Number((_arg1 / 100));
updateAllFXVol();
}
public function getFX():Boolean{
return (_bFX);
}
public function setFX(_arg1:Boolean):void{
_bFX = _arg1;
}
public function soundComplete(_arg1:int, _arg2:String, _arg3:String):void{
var _local4:SoundObject;
var _local5:Boolean;
if (_aChannels[_arg3] != null){
_local4 = _aChannels[_arg3];
_local4._soundChannel.removeEventListener(Event.SOUND_COMPLETE, _local4.onSoundComplete);
_local5 = false;
if (_arg1 == _C_FX){
if (_aFX[_arg2] != null){
_aFX[_arg2].iPlaying--;
_local5 = _aFX[_arg2].bMultiple;
};
} else {
if (_arg1 == _C_MUSIC){
if (_aMusic[_arg2] != null){
_aMusic[_arg2].iPlaying--;
_local5 = _aMusic[_arg2].bMultiple;
};
};
};
if (_local5){
_aChannels[_arg3] = null;
delete _aChannels[_arg3];
};
};
}
public function addFX(_arg1:Sound, _arg2:String="", _arg3:Boolean=true):void{
var _local4:Object;
if (_arg2 == ""){
return;
};
if (_aFX[_arg2] == undefined){
_local4 = createSoundAsset(_C_FX, _arg1, _arg2, _arg3);
_aFX[_arg2] = _local4;
};
}
public function findSoundObject(_arg1:String):SoundObject{
var _local2:SoundObject;
var _local3:String;
for (_local3 in _aChannels) {
if (_aChannels[_local3] == null){
continue;
} else {
if (_aChannels[_local3].getID() == _arg1){
_local2 = _aChannels[_local3];
break;
};
};
};
return (_local2);
}
private function createSoundAsset(_arg1:int, _arg2:Sound, _arg3:String, _arg4:Boolean):Object{
var _local5:Object;
_local5 = new Object();
_local5.iType = _arg1;
_local5.sound = _arg2;
_local5.soundID = _arg3;
_local5.bMultiple = _arg4;
_local5.iPlaying = 0;
return (_local5);
}
public function getMusic():Boolean{
return (_bMusic);
}
public function playIt(_arg1:Object, _arg2:int=0, _arg3:int=1, _arg4:Number=1, _arg5:Number=0):void{
var _local6:Boolean;
var _local7:SoundObject;
var _local8:String;
_local6 = false;
if (!_arg1.bMultiple){
_local7 = findSoundObject(_arg1.soundID);
};
if (_local7 == null){
_local7 = new SoundObject(this);
} else {
_local6 = true;
if (_local7.isFading()){
_local7.killFadeTimer();
};
_local7._soundChannel.stop();
};
_local7._soundChannel = _arg1.sound.play(_arg2, _arg3);
_local7._soundTransform.volume = _arg4;
_local7._soundTransform.pan = _arg5;
_local7._soundChannel.soundTransform = _local7._soundTransform;
if (!_local6){
_arg1.iPlaying++;
_local8 = (getTimer() + _arg1.soundID);
_local7.setID(_arg1.iType, _arg1.soundID, _local8);
_local7._soundChannel.addEventListener(Event.SOUND_COMPLETE, _local7.onSoundComplete, false, 0, true);
_aChannels[_local8] = _local7;
};
}
}
}//package com.meteorgames.libs.sound
Section 9
//SoundObject (com.meteorgames.libs.sound.SoundObject)
package com.meteorgames.libs.sound {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
public class SoundObject {
private var _objParent:Object;
private var _iType:int;
private var _nFadeVol:Number;
private var _tFade:Timer;
private var _nFadePan:Number;
public var _soundChannel:SoundChannel;
private var _sSoundID:String;
private var _iFadeVolTarget:Number;
private var _sCustomID:String;
private var _iFadePanTarget:Number;
public var _soundTransform:SoundTransform;
public function SoundObject(_arg1:Object){
_objParent = _arg1;
_iType = 0;
_sSoundID = "";
_sCustomID = "";
_tFade = new Timer(0, 0);
_nFadeVol = 0;
_nFadePan = 0;
_iFadeVolTarget = 0;
_iFadePanTarget = 0;
_soundChannel = new SoundChannel();
_soundTransform = new SoundTransform();
}
public function stop():void{
_soundChannel.stop();
if (_tFade.running){
_tFade.stop();
};
_objParent.soundComplete(_iType, _sSoundID, _sCustomID);
}
public function isFading():Boolean{
return (_tFade.running);
}
public function fade(_arg1:Number, _arg2:Number, _arg3:int):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
if (_arg1 == _soundTransform.volume){
if (_arg2 == _soundTransform.pan){
return;
};
};
if (_tFade.running){
_tFade.stop();
};
_iFadeVolTarget = _arg1;
_iFadePanTarget = _arg2;
_local4 = 100;
_local5 = Math.abs((_soundTransform.volume - _iFadeVolTarget));
_local6 = Math.abs((_soundTransform.pan - _iFadePanTarget));
_local7 = int((_arg3 / _local4));
_nFadeVol = Number((_local5 / _local7));
_nFadePan = Number((_local6 / _local7));
if (_iFadeVolTarget < _soundTransform.volume){
_nFadeVol = (_nFadeVol * -1);
};
if (_iFadePanTarget < _soundTransform.pan){
_nFadePan = (_nFadePan * -1);
};
startFadeTimer(_local4, _local7);
}
public function onSoundComplete(_arg1:Event):void{
_objParent.soundComplete(_iType, _sSoundID, _sCustomID);
}
private function onTimerFade(_arg1:TimerEvent):void{
_soundTransform.volume = (_soundTransform.volume + _nFadeVol);
_soundTransform.pan = (_soundTransform.pan + _nFadePan);
_soundChannel.soundTransform = _soundTransform;
}
private function onTimerCompleteFade(_arg1:TimerEvent):void{
_soundTransform.volume = _iFadeVolTarget;
_soundTransform.pan = _iFadePanTarget;
_soundChannel.soundTransform = _soundTransform;
if (_soundTransform.volume <= 0){
_soundChannel.stop();
_objParent.soundComplete(_iType, _sSoundID, _sCustomID);
};
}
public function setVolume(_arg1:Number):void{
_soundTransform.volume = _arg1;
_soundChannel.soundTransform = _soundTransform;
}
public function killFadeTimer():void{
_tFade.reset();
if (_tFade.hasEventListener(TimerEvent.TIMER)){
_tFade.removeEventListener(TimerEvent.TIMER, onTimerFade);
};
if (_tFade.hasEventListener(TimerEvent.TIMER_COMPLETE)){
_tFade.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerCompleteFade);
};
}
private function startFadeTimer(_arg1:Number, _arg2:int):void{
_tFade = new Timer(_arg1, _arg2);
if (!_tFade.hasEventListener(TimerEvent.TIMER)){
_tFade.addEventListener(TimerEvent.TIMER, onTimerFade, false, 0, true);
};
if (!_tFade.hasEventListener(TimerEvent.TIMER_COMPLETE)){
_tFade.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerCompleteFade, false, 0, true);
};
_tFade.start();
}
public function getType():int{
return (_iType);
}
public function getID():String{
return (_sSoundID);
}
public function setID(_arg1:int, _arg2:String, _arg3:String){
_iType = _arg1;
_sSoundID = _arg2;
_sCustomID = _arg3;
}
}
}//package com.meteorgames.libs.sound
Section 10
//XVar (com.meteorgames.libs.xvars.XVar)
package com.meteorgames.libs.xvars {
public class XVar {
private var _aXVar:Array;
public function XVar(_arg1){
_aXVar = [];
create(_arg1);
}
public function add(_arg1):void{
var _local2:*;
if (_aXVar[0][0] > 0){
_aXVar[0][1] = (_aXVar[0][1] + (_aXVar[0][0] * _arg1));
} else {
_local2 = 0;
while (_local2 < _arg1.length) {
_aXVar[0][1].push(_arg1.charCodeAt(_local2));
_local2++;
};
};
}
public function set(_arg1):void{
create(_arg1);
}
private function create(_arg1):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_aXVar = [];
_local2 = [];
_local3 = typeof(_arg1);
if (_local3.toLowerCase() == "string"){
_local2.push(0);
_local4 = [];
_local5 = 0;
while (_local5 < _arg1.length) {
_local4.push(_arg1.charCodeAt(_local5));
_local5++;
};
_local2.push(_local4);
} else {
if (_local3.toLowerCase() == "number"){
_local2.push((11 + int((Math.random() * 100))));
_local2.push((_arg1 * _local2[0]));
};
};
_aXVar.push(_local2);
}
public function out(){
var _local1:*;
var _local2:*;
if (_aXVar[0][0] > 0){
return ((_aXVar[0][1] / _aXVar[0][0]));
};
_local1 = "";
_local2 = 0;
while (_local2 < _aXVar[0][1].length) {
_local1 = (_local1 + String.fromCharCode(_aXVar[0][1][_local2]));
_local2++;
};
return (_local1);
}
}
}//package com.meteorgames.libs.xvars
Section 11
//Regular (fl.transitions.easing.Regular)
package fl.transitions.easing {
public class Regular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.transitions.easing
Section 12
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 13
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 14
//fps (game.fps)
package game {
import flash.text.*;
import flash.utils.*;
public class fps extends gameObject {
private var sTextColor:String;
private var iMilliseconds:int;
private var iFrames:int;// = 0
private var tx_fps:TextField;
private var bKeyDown:Boolean;// = false
public function fps(_arg1:String="#ffffff"):void{
tx_fps = new TextField();
iFrames = 0;
iMilliseconds = getTimer();
bKeyDown = false;
super();
cacheAsBitmap = true;
tx_fps.selectable = false;
sTextColor = _arg1;
visible = false;
addChild(tx_fps);
mouseEnabled = false;
mouseChildren = false;
}
public function toggleFPS():void{
if (((((Key.isDown(82)) && (Key.isDown(17)))) && (!(bKeyDown)))){
visible = !(visible);
bKeyDown = true;
} else {
if (((!(Key.isDown(82))) || (!(Key.isDown(17))))){
bKeyDown = false;
};
};
}
override public function init():void{
Key.initialize(stage);
fn_state = frameCount;
}
function frameCount():void{
var _local1:Number;
toggleFPS();
_local1 = ((getTimer() - iMilliseconds) / 1000);
iFrames++;
if (_local1 > 1){
tx_fps.htmlText = (((("<font face='Georgia' color='" + sTextColor) + "'>") + int(Math.round((iFrames / _local1))).toString()) + " fps</font > ");
tx_fps.autoSize = TextFieldAutoSize.CENTER;
iMilliseconds = getTimer();
iFrames = 0;
};
graphics.clear();
graphics.beginFill(0xFFFFFF);
graphics.drawRect(tx_fps.x, tx_fps.y, width, height);
graphics.endFill();
}
}
}//package game
Section 15
//gameButton (game.gameButton)
package game {
import flash.display.*;
import flash.text.*;
import flash.events.*;
public class gameButton extends gameObject {
private var tx_buttonText:TextField;
private var do_graphic:Sprite;// = null
private var fn_callFunction:Function;// = null
public function gameButton(_arg1:String="", _arg2:int=300, _arg3:int=60, _arg4:Function=null, _arg5:Boolean=true):void{
tx_buttonText = new TextField();
do_graphic = null;
fn_callFunction = null;
super();
tx_buttonText.selectable = false;
buttonMode = true;
useHandCursor = true;
tx_buttonText.width = _arg2;
tx_buttonText.height = _arg3;
addChild(tx_buttonText);
tx_buttonText.mouseEnabled = false;
tx_buttonText.multiline = true;
tx_buttonText.htmlText = _arg1;
if (_arg4 != null){
setFunctionToCall(_arg4);
} else {
setFunctionToCall(piku);
};
if (_arg5){
setDefaultGraphic();
};
}
public function defaultRollOut(_arg1:MouseEvent):void{
drawDefaultGraphic();
}
public function piku():void{
}
public function setGraphic(_arg1:Sprite):void{
do_graphic = _arg1;
addChildAt(do_graphic, 0);
}
public function defaultRollOver(_arg1:MouseEvent):void{
do_graphic.graphics.clear();
do_graphic.graphics.beginFill(0xCCCCCC);
do_graphic.graphics.drawRect(0, 0, tx_buttonText.width, tx_buttonText.height);
do_graphic.graphics.endFill();
}
public function setDefaultGraphic():void{
if (do_graphic != null){
removeChild(do_graphic);
do_graphic = null;
};
do_graphic = new Sprite();
addChildAt(do_graphic, 0);
drawDefaultGraphic();
addEventListener(MouseEvent.MOUSE_OVER, defaultRollOver, false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, defaultRollOut, false, 0, true);
}
override public function kill():void{
removeEventListener(MouseEvent.CLICK, buttonClicked);
if (hasEventListener(MouseEvent.MOUSE_OVER)){
removeEventListener(MouseEvent.MOUSE_OVER, defaultRollOver);
removeEventListener(MouseEvent.MOUSE_OUT, defaultRollOut);
removeChild(do_graphic);
};
removeChild(tx_buttonText);
super.kill();
}
public function setFunctionToCall(_arg1:Function):void{
fn_callFunction = _arg1;
addEventListener(MouseEvent.CLICK, buttonClicked);
}
public function buttonClicked(_arg1:MouseEvent):void{
fn_callFunction.call();
}
public function setText(_arg1:String):void{
tx_buttonText.htmlText = _arg1;
}
public function drawDefaultGraphic():void{
do_graphic.graphics.clear();
do_graphic.graphics.beginFill(0xAAAAAA);
do_graphic.graphics.drawRect(0, 0, tx_buttonText.width, tx_buttonText.height);
do_graphic.graphics.endFill();
}
}
}//package game
Section 16
//gameMenu (game.gameMenu)
package game {
public class gameMenu extends gameObject {
private var iButtonHeight:int;
private var nButtonY:Number;// = 0
private var nButtonX:Number;// = 0
private var iNumButtons:int;// = 0
private var iButtonWidth:int;
private var bVertical:Boolean;// = true
public function gameMenu(_arg1:int=300, _arg2:int=60, _arg3:Boolean=true):void{
iNumButtons = 0;
nButtonX = 0;
nButtonY = 0;
bVertical = true;
super();
iButtonWidth = _arg1;
iButtonHeight = _arg2;
bVertical = _arg3;
mouseChildren = true;
}
public function hideButton(_arg1:gameButton):void{
if (contains(_arg1)){
_arg1.visible = false;
};
}
public function addNewButton(_arg1:String="", _arg2=null, _arg3=true):gameButton{
var _local4:gameButton;
if (_arg1 == ""){
_arg1 = ("Button " + iNumButtons.toString());
};
_local4 = new gameButton(_arg1, iButtonWidth, iButtonHeight, _arg2, _arg3);
addChild(_local4);
setNewButtonPos(_local4);
return (_local4);
}
public function enableButton(_arg1:gameButton):void{
if (contains(_arg1)){
_arg1.enabled = true;
};
}
public function disableButton(_arg1:gameButton):void{
if (contains(_arg1)){
_arg1.enabled = false;
};
}
public function addButton(_arg1:gameButton):void{
if (!contains(_arg1)){
addChild(_arg1);
setNewButtonPos(_arg1);
};
}
public function showButton(_arg1:gameButton):void{
if (contains(_arg1)){
_arg1.visible = true;
};
}
public function resetButtonPos():void{
var _local1:int;
iNumButtons = 0;
_local1 = 0;
while (_local1 < numChildren) {
if ((getChildAt(_local1) is gameButton)){
setNewButtonPos(gameButton(getChildAt(_local1)));
};
_local1++;
};
}
public function setNewButtonPos(_arg1:gameButton):void{
if (bVertical){
_arg1.x = 0;
_arg1.y = ((iNumButtons * _arg1.height) + (iNumButtons * 5));
iNumButtons++;
} else {
_arg1.x = ((iNumButtons * _arg1.width) + (iNumButtons * 5));
_arg1.y = 0;
iNumButtons++;
};
}
public function removeButton(_arg1:gameButton):void{
if (contains(_arg1)){
removeChild(_arg1);
resetButtonPos();
};
}
}
}//package game
Section 17
//gameObject (game.gameObject)
package game {
import flash.display.*;
public class gameObject extends MovieClip {
public var fn_state:Function;// = null
public function gameObject():void{
fn_state = null;
super();
focusRect = false;
tabEnabled = false;
fn_state = init;
}
public function init():void{
fn_state = wait;
}
public function addChildAsRuntimeBitmapAt(_arg1:DisplayObject, _arg2:int):DisplayObject{
_arg1.cacheAsBitmap = true;
return (addChildAt(_arg1, _arg2));
}
override public function addChild(_arg1:DisplayObject):DisplayObject{
if ((_arg1 is InteractiveObject)){
InteractiveObject(_arg1).focusRect = false;
InteractiveObject(_arg1).tabEnabled = false;
};
return (super.addChild(_arg1));
}
public function wait():void{
}
public function kill():void{
killChildren();
parent.removeChild(this);
}
public function killChildren():void{
var _local1:int;
if (numChildren > 0){
_local1 = 0;
while (_local1 < numChildren) {
if ((getChildAt(_local1) is gameObject)){
gameObject(getChildAt(_local1)).kill();
} else {
removeChildAt(_local1);
};
_local1++;
};
};
}
override public function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject{
if ((_arg1 is InteractiveObject)){
InteractiveObject(_arg1).focusRect = false;
InteractiveObject(_arg1).tabEnabled = false;
};
_arg1.cacheAsBitmap = true;
return (super.addChildAt(_arg1, _arg2));
}
public function get state():Function{
return (fn_state);
}
public function addChildAsRuntimeBitmap(_arg1:DisplayObject):DisplayObject{
_arg1.cacheAsBitmap = true;
return (addChild(_arg1));
}
public function distanceFormula(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = Math.sqrt((Math.pow((((width / 2) + x) - _arg1), 2) + Math.pow((((width / 2) + y) - _arg2), 2)));
return (_local3);
}
public function update():void{
if (fn_state != null){
fn_state.call();
updateChildren();
};
}
public function updateChildren():void{
var _local1:int;
_local1 = 0;
while (_local1 < numChildren) {
if ((getChildAt(_local1) is gameObject)){
gameObject(getChildAt(_local1)).update();
};
_local1++;
};
}
}
}//package game
Section 18
//gameText (game.gameText)
package game {
public class gameText {
public static const GAME_OVER:String = "<font size='30' color='#ffffff'>Total Score: %<br><br>Total stains removed: %<br><br>Total clothes cleaned: %</font>";
public static const SURVIVAL_MODE:String = "Clean as much of the laundry as possible before the time runs out. Every time you completely clean an article of clothing, you gain 1 extra second.";
public static const TWO_MIN_MATCH:String = "<font size='30' color='#ffffff' face='Arial'>Start 2 Minute Match</font>";
public static const INSTRUCTIONS_TEXT:String = "<font size='18' face='Arial'>Use the mouse to scrub three or more stains of the same colour.<br><br>Pay attention! Some clothes may have several stains.</font>";
public static const RETRY:String = "<font size='30' color='#ffffff' face='Arial'>Retry?</font>";
public static const FIVE_MIN_MATCH:String = "<font size='30' color='#ffffff' face='Arial'>Start 5 Minute Match</font>";
public static const LEVEL_MATCH:String = "<font size='30' color='#ffffff' face='Arial'>Start Level Match</font>";
public static const IMPIT_TEXT:String = "Impits like to scurry up the clothesline, dropping clothes as they go.";
public static const INANIMATE_TEXT:String = "Axes, Shield, and Rocks are among many things you should never throw in with the washing. As a result, it's impossible for you to remove these items from the clothes line by conventional means. You may have to find another way to get rid of them.";
public static const CAT_TEXT:String = "This is Sooty, Elena's mischievous cat. Scrubbing Sooty causes him to fall into the trough (along with anything on the clothesline below him!)";
public static const LEVEL_MODE:String = "Each level has you clean off an increasing amount of clothing before the timer runs out.";
public static const INSTRUCTIONS:String = "<font size='30' color='#ffffff' face='Arial'>View Instructions</font>";
public static const BOMB_TEXT:String = "Bombs are sometimes left in the clothing by careless customers. After three moves, they'll explode and take out anything around them.";
public static const RETURN_TO_START:String = "<font size='30' color='#ffffff' face='Arial'>Return to Menu</font>";
public static const SCORE_BUBBLE_TEXT:String = "<font size='30' face='Arial'>%</font >";
public static const FREEPLAY_MATCH:String = "<font size='30' color='#ffffff' face='Arial'>Free Play Match</font>";
public static const QUIT:String = "<font size='30' color='#ffffff' face='Arial'>Quit</font>";
public static const SQUIRREL_TEXT:String = "Squirrels are so cute... when not running everywhere, knocking off the laundry!";
public static const SCORE_TEXT:String = "Score:";
public static const SURVIVAL_MATCH:String = "<font size='30' color='#ffffff' face='Arial'>Survival Match</font>";
public static const RETURN_TO_PREV:String = "<font size='24' color='#ffffff' face='Arial'>Back</font>";
public static const FUNGUS_TEXT:String = "<font color='#000000'>FUNGUS! How dirty <I>ARE</I> these people? You'll have to scrub off any fungus before you can clean the stains underneath. Hurry before it spreads!</font>";
public static const TIME_ADDED:String = "<font size='20' color='#ffff99' face='Arial'>+%</font>";
public static const CLOTHING_COUNT:String = "<center><font size='18' color='#ffffff' face='Arial'>Clothes Cleaned:<br>%<br>Overall total:<br>%</font></center>";
public static const SUBMITTING_SCORE:String = "Submitting score...";
public static const LEVEL_OBJECTIVE:String = "<center><font size='18' color='#ffffff' face='Arial'><b><font color='#ff5555' size='28'>Level %</font>:</b><br>Clean % articles of clothing in % seconds!</font></center>";
public static function insertVariables(_arg1:String, _arg2, ... _args):String{
var _local4:int;
_local4 = 0;
while (_local4 < _args.length) {
_arg1 = _arg1.replace(_arg2, _args[_local4]);
_local4++;
};
return (_arg1);
}
}
}//package game
Section 19
//Key (game.Key)
package game {
import flash.display.*;
import flash.events.*;
public class Key {
private static var initialized:Boolean = false;
private static var keysDown:Object = new Object();
private static var keyboardEventHolder:KeyboardEvent;
public static function initialize(_arg1:Stage){
if (!initialized){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
_arg1.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
private static function clearKeys(_arg1:Event):void{
keysDown = new Object();
}
public static function isDown(_arg1:uint):Boolean{
if (!initialized){
throw (new Error("Key class has yet been initialized."));
};
return (Boolean((_arg1 in keysDown)));
}
private static function keyPressed(_arg1:KeyboardEvent):void{
keyboardEventHolder = _arg1;
keysDown[keyboardEventHolder.keyCode] = true;
}
private static function keyReleased(_arg1:KeyboardEvent):void{
if ((_arg1.keyCode in keysDown)){
delete keysDown[_arg1.keyCode];
};
}
}
}//package game
Section 20
//holder_1 (match3_test_fla.holder_1)
package match3_test_fla {
import flash.display.*;
public dynamic class holder_1 extends MovieClip {
public function holder_1(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package match3_test_fla
Section 21
//scoreboard_141 (match3_test_fla.scoreboard_141)
package match3_test_fla {
import flash.display.*;
public dynamic class scoreboard_141 extends MovieClip {
public var score_text:MovieClip;
}
}//package match3_test_fla
Section 22
//clothesPin (src.clothes.clothesPin)
package src.clothes {
import game.*;
public class clothesPin {
private const MOVE_SPEED:int = 8;
private var clothesPinBelow:clothesPin;// = null
private var mc_myClothes:clothing;// = null
private var clothesPinLeft:clothesPin;// = null
private var fn_state:Function;// = null
private var xpos:int;// = 0
private var bMarked:Boolean;// = false
private var ypos:int;// = 0
private var myParent:gameObject;// = null
public function clothesPin(_arg1:gameObject):void{
xpos = 0;
ypos = 0;
bMarked = false;
fn_state = null;
mc_myClothes = null;
clothesPinLeft = null;
clothesPinBelow = null;
myParent = null;
super();
myParent = _arg1;
}
public function get y():int{
return (ypos);
}
public function isMarked():Boolean{
return (bMarked);
}
public function passClothes():void{
if (mc_myClothes){
if (((!((clothesPinLeft == null))) && (!(clothesPinLeft.hasClothes())))){
bMarked = false;
mc_myClothes.alpha = 1;
clothesPinLeft.receiveClothes(mc_myClothes);
mc_myClothes = null;
fn_state = null;
} else {
mc_myClothes.x = xpos;
};
};
}
public function update():void{
if (fn_state != null){
fn_state.call();
};
}
public function set y(_arg1):void{
ypos = _arg1;
}
public function hasClothes():Boolean{
if (mc_myClothes == null){
return (false);
};
return (true);
}
public function releaseClothes():void{
bMarked = false;
mc_myClothes.release();
mc_myClothes = null;
fn_state = null;
}
public function get state():Function{
return (fn_state);
}
public function get clothes():clothing{
return (mc_myClothes);
}
public function get leftClothesPin():clothesPin{
return (clothesPinLeft);
}
public function moveClothingLeft():void{
if (mc_myClothes != null){
mc_myClothes.x = (mc_myClothes.x - MOVE_SPEED);
if (mc_myClothes.x <= xpos){
fn_state = passClothes;
passClothes();
};
} else {
fn_state = null;
};
}
public function cleanClothes(_arg1:int):void{
if (mc_myClothes != null){
mc_myClothes.removeStain(_arg1);
if (!mc_myClothes.anyStainsLeft()){
releaseClothes();
} else {
mc_myClothes.alpha = 1;
};
};
bMarked = false;
}
public function receiveClothes(_arg1:clothing):void{
mc_myClothes = _arg1;
fn_state = moveClothingLeft;
}
public function set leftClothesPin(_arg1):void{
clothesPinLeft = _arg1;
}
public function markClothesPin():void{
bMarked = true;
if (mc_myClothes != null){
mc_myClothes.alpha = 0.75;
};
}
public function get color():int{
if (mc_myClothes != null){
return (mc_myClothes.stainColor);
};
return (-1);
}
public function set bottomClothesPin(_arg1):void{
clothesPinBelow = _arg1;
}
public function removeMark():void{
bMarked = false;
if (mc_myClothes != null){
mc_myClothes.alpha = 1;
};
}
public function set x(_arg1):void{
xpos = _arg1;
}
public function getNewClothes(_arg1:int=1, _arg2:int=1, _arg3:int=3):void{
if (mc_myClothes == null){
mc_myClothes = new clothing(_arg1, _arg2, _arg3);
mc_myClothes.x = (xpos + mc_myClothes.width);
mc_myClothes.y = ypos;
myParent.addChildAsRuntimeBitmap(mc_myClothes);
fn_state = moveClothingLeft;
};
}
public function get x():int{
return (xpos);
}
}
}//package src.clothes
Section 23
//clothing (src.clothes.clothing)
package src.clothes {
import flash.display.*;
import game.*;
import src.items.*;
import flash.geom.*;
import src.screens.*;
import src.matches.*;
import src.particles.*;
public class clothing extends gameObject {
private const MOVE_SPEED:int = 8;
public const CLOTHES_ARRAY:Array;
public const STAIN_CLASS_ARRAY:Array;
private const MAX_COLORS:int;
private var iForce:Number;// = 10
private var mc_clothing:MovieClip;// = null
private var bt_myMask:Bitmap;
private var mc_stainArray:Array;
private var bSplashEffects:Boolean;// = true
public var sSplash:String;// = "Small Splash"
private var bd_bitmapData:BitmapData;
private var iStainColorsArray:Array;
private var mc_cover:MovieClip;
public var bSound:Boolean;// = false
private var myItem:item;// = null
public static const PANTS:int = 2;
public static const BLOOMERS:int = 5;
public static const SHIRT:int = 0;
public static const DRESS:int = 1;
public static const BROWN:int = 5;
public static const BLACK:int = 4;
public static const GREEN:int = 3;
public static const FALL_SPEED:int = 10;
public static const ORANGE:int = 0;
public static const RED:int = 2;
public static const SHORTS:int = 4;
public static const NONE:int = -1;
public static const BOXERS:int = 3;
public static const PURPLE:int = 1;
public static const COLOR_ARRAY:Array = new Array(ORANGE, PURPLE, RED, GREEN);
public function clothing(_arg1:int=1, _arg2:int=1, _arg3:int=3, _arg4:int=-1):void{
var _local5:int;
var _local6:int;
var _local7:Array;
var _local8:int;
var _local9:Class;
var _local10:Matrix;
var _local11:Rectangle;
var _local12:MovieClip;
var _local13:Class;
STAIN_CLASS_ARRAY = new Array(stain_orange, stain_purple, stain_red, stain_green);
MAX_COLORS = COLOR_ARRAY.length;
CLOTHES_ARRAY = new Array(shirt, dress, pants, boxers, shorts, bloomers);
sSplash = screenManager.sSmallSplash;
mc_clothing = null;
mc_stainArray = new Array();
iStainColorsArray = new Array();
myItem = null;
iForce = 10;
bSplashEffects = true;
bSound = false;
bd_bitmapData = new BitmapData(50, 50, true, 0);
bt_myMask = new Bitmap(bd_bitmapData);
mc_cover = new MovieClip();
super();
_local5 = Math.floor((Math.random() * _arg1));
_local6 = (Math.floor((Math.random() * _arg2)) + 1);
_local7 = new Array(ORANGE, PURPLE, RED);
_arg4 = NONE;
_local8 = 0;
blendMode = BlendMode.LAYER;
cacheAsBitmap = true;
if (_arg3 > 3){
_local7.push(GREEN);
};
if (_arg2 < 1){
_arg2 = 1;
} else {
if (_arg2 > MAX_COLORS){
_arg2 = MAX_COLORS;
};
};
if (_local5 >= CLOTHES_ARRAY.length){
(_local5 == 0);
};
_local9 = Class(CLOTHES_ARRAY[_local5]);
mc_clothing = new (_local9);
mc_clothing.x = (match.CLOTHES_WIDTH / 2);
mc_clothing.y = (match.CLOTHES_HEIGHT / 2);
addChild(mc_clothing);
_local8 = 0;
while (_local8 < _local6) {
_arg4 = int((Math.random() * _local7.length));
_local13 = Class(STAIN_CLASS_ARRAY[_local7[_arg4]]);
_local12 = new (_local13);
_local12.x = 0;
_local12.y = 0;
mc_stainArray.push(_local12);
iStainColorsArray.push(_local7[_arg4]);
_local7.splice(_arg4, 1);
_local8++;
};
_local8 = 0;
while (_local8 < mc_stainArray.length) {
addChild(MovieClip(mc_stainArray[_local8]));
_local8++;
};
mc_cover.graphics.beginFill(0x999999);
mc_cover.graphics.drawRect(0, 0, match.CLOTHES_WIDTH, match.CLOTHES_HEIGHT);
mc_cover.graphics.endFill();
mc_cover.visible = false;
addChild(mc_cover);
_local10 = new Matrix(1, 0, 0, 1, mc_clothing.x, mc_clothing.y);
_local11 = new Rectangle(mc_clothing.x, mc_clothing.y, mc_clothing.width, mc_clothing.height);
bt_myMask.bitmapData.draw(mc_clothing, _local10, null, null, null, true);
bt_myMask.blendMode = BlendMode.ALPHA;
addChild(bt_myMask);
}
public function anyStainsLeft():Boolean{
if (mc_stainArray.length > 0){
return (true);
};
return (false);
}
public function release():void{
fn_state = fall;
}
public function clearStain():Boolean{
iStainColorsArray.pop();
removeChild(MovieClip(mc_stainArray.pop()));
if (mc_stainArray.length < 1){
return (true);
};
return (false);
}
public function get stainColor():int{
return (iStainColorsArray[(iStainColorsArray.length - 1)]);
}
public function spawnItem(_arg1:Class=null):void{
var _local2:int;
var _local3:Array;
var _local4:int;
var _local5:Class;
_local2 = Math.floor((Math.random() * 100));
if (_arg1 != null){
myItem = new _arg1(this);
gameObject(parent).addChildAsRuntimeBitmap(myItem);
} else {
_local3 = itemManager.getEnabledItems();
_local4 = Math.floor((Math.random() * _local3.length));
if (_local2 < 6){
_local5 = Class(_local3[_local4]);
if (((!((_local5 == cat))) || ((((_local5 == cat)) && (cat.bAllowCat))))){
myItem = new _local5(this);
gameObject(parent).addChildAsRuntimeBitmap(myItem);
};
};
};
}
public function itemClick():void{
myItem.clicked();
}
public function getNumStains():int{
return (iStainColorsArray.length);
}
public function removeStain(_arg1:int):void{
var _local2:int;
var _local3:MovieClip;
_local2 = 0;
while (_local2 < iStainColorsArray.length) {
if (iStainColorsArray[_local2] == _arg1){
_local3 = MovieClip(mc_stainArray[_local2]);
mc_stainArray.splice(_local2, 1);
iStainColorsArray.splice(_local2, 1);
removeChild(_local3);
return;
};
_local2++;
};
}
public function setSplash(_arg1:Boolean):void{
bSplashEffects = _arg1;
}
public function getItem():item{
return (myItem);
}
public function checkForStainColor(_arg1:int):Boolean{
var _local2:int;
for each (_local2 in iStainColorsArray) {
if (_local2 == _arg1){
return (true);
};
};
return (false);
}
public function fall():void{
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:Number;
alpha = 0.75;
y = (y + FALL_SPEED);
iForce = (iForce + 0.5);
if (y > screenManager.SCREEN_HEIGHT){
kill();
} else {
if ((y + height) >= 500){
if (bSound){
screenManager.playSound(sSplash);
bSound = false;
};
if (bSplashEffects){
_local1 = 0;
while (_local1 < this.width) {
_local2 = (this.width / 2);
_local3 = ((Math.random() * ((_local1 - _local2) / _local2)) * 50);
_local4 = ((((Math.random() * (_local2 - Math.abs((_local1 - _local2)))) / _local2) + 0.025) * iForce);
match(parent.parent).particleLayer.addChildAsRuntimeBitmap(new splash((_local1 + this.x), (y + height), _local3, _local4));
_local1 = (_local1 + 3);
};
bSplashEffects = false;
};
};
};
}
public function hideClothes():void{
mc_cover.visible = true;
}
public function loseItem():void{
myItem = null;
}
public function showClothes():void{
mc_cover.visible = false;
}
public function hasItem():Boolean{
if (myItem != null){
return (true);
};
return (false);
}
public function getStains():Array{
return (iStainColorsArray);
}
}
}//package src.clothes
Section 24
//clothingMgr (src.clothes.clothingMgr)
package src.clothes {
public class clothingMgr {
private static var iProposedCount:int = 0;
private static var iNumClothing:int = 0;
private static var bOverride:Boolean = false;
public static function resetClothing():void{
if (bOverride){
iNumClothing = iProposedCount;
bOverride = false;
};
}
public static function getCount(_arg1:int=1):int{
iProposedCount = _arg1;
if (!bOverride){
iNumClothing = iProposedCount;
};
return (iNumClothing);
}
public static function overrideClothingCount(_arg1:int):void{
bOverride = true;
iNumClothing = _arg1;
}
public static function get NUM_CLOTHES():int{
return (iNumClothing);
}
}
}//package src.clothes
Section 25
//stainMgr (src.clothes.stainMgr)
package src.clothes {
public class stainMgr {
private static var iProposedCount:int;
private static var iStainColors:int = 0;
private static var iNumColors:int = 0;
private static var bOverride:Boolean = false;
private static var iStainCount:int = 0;
private static var bColorOverride:Boolean = false;
public static function resetStains():void{
if (bOverride){
iStainCount = iProposedCount;
bOverride = false;
};
}
public static function getNumStainColors(_arg1:int):int{
iStainColors = _arg1;
if (!bColorOverride){
iNumColors = iStainColors;
};
return (iNumColors);
}
public static function get NUM_COLORS():int{
return (iNumColors);
}
public static function get NUM_STAINS():int{
return (iStainCount);
}
public static function getCount(_arg1:int):int{
iProposedCount = _arg1;
if (!bOverride){
iStainCount = iProposedCount;
};
return (iStainCount);
}
public static function overrideNumStainColors(_arg1:int):void{
bColorOverride = true;
iNumColors = _arg1;
}
public static function overrideStainCount(_arg1:int):void{
bOverride = true;
iStainCount = _arg1;
}
public static function resetNumStainColors():void{
if (bColorOverride){
iNumColors = iStainColors;
bColorOverride = false;
};
}
}
}//package src.clothes
Section 26
//demo (src.demo.demo)
package src.demo {
import flash.display.*;
import game.*;
import flash.geom.*;
import src.matches.*;
public class demo extends gameObject {
private var shirtArray:Array;
private var myPoint:Point;
private var iCounter:int;// = 0
private var posArray:Array;
private var spr_draw:Sprite;
private var mc_scrubBrush:MovieClip;
private var iIndex:int;// = 0
public function demo():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:MovieClip;
var _local5:MovieClip;
var _local6:Bitmap;
var _local7:Matrix;
var _local8:Rectangle;
mc_scrubBrush = new scrub_brush();
shirtArray = new Array(12);
posArray = new Array(5);
iIndex = 0;
iCounter = 0;
spr_draw = new Sprite();
super();
blendMode = BlendMode.LAYER;
_local1 = 0;
_local2 = 0;
_local3 = 0;
while (_local3 < shirtArray.length) {
shirtArray[_local3] = new MovieClip();
_local4 = new shirt();
if ((((((_local3 == 0)) || ((_local3 == 1)))) || ((((_local3 >= 4)) && ((_local3 <= 8)))))){
_local5 = new stain_orange();
} else {
if ((((_local3 == 2)) || ((_local3 == 3)))){
_local5 = new stain_red();
} else {
_local5 = new stain_purple();
};
};
_local4.x = (match.CLOTHES_WIDTH / 2);
_local4.y = (match.CLOTHES_HEIGHT / 2);
_local5.x = 0;
_local5.y = 0;
MovieClip(shirtArray[_local3]).addChild(_local4);
MovieClip(shirtArray[_local3]).addChild(_local5);
_local6 = new Bitmap(new BitmapData(match.CLOTHES_WIDTH, match.CLOTHES_HEIGHT, true, 0));
_local7 = new Matrix(1, 0, 0, 1, _local4.x, _local4.y);
_local8 = new Rectangle(_local4.x, _local4.y, _local4.width, _local4.height);
_local6.bitmapData.draw(_local4, _local7);
_local6.blendMode = BlendMode.ALPHA;
MovieClip(shirtArray[_local3]).addChild(_local6);
MovieClip(shirtArray[_local3]).x = ((_local3 % 4) * match.CLOTHES_WIDTH);
MovieClip(shirtArray[_local3]).y = (Math.floor((_local3 / 4)) * match.CLOTHES_HEIGHT);
addChild(MovieClip(shirtArray[_local3]));
_local3++;
};
posArray[0] = new Point((MovieClip(shirtArray[8]).x + _local4.x), (MovieClip(shirtArray[8]).y + _local4.y));
posArray[1] = new Point((MovieClip(shirtArray[0]).x + _local4.x), (MovieClip(shirtArray[0]).y + _local4.y));
posArray[2] = new Point((MovieClip(shirtArray[1]).x + _local4.x), (MovieClip(shirtArray[1]).y + _local4.y));
posArray[3] = new Point((MovieClip(shirtArray[5]).x + _local4.x), (MovieClip(shirtArray[5]).y + _local4.y));
posArray[4] = new Point((MovieClip(shirtArray[7]).x + _local4.x), (MovieClip(shirtArray[7]).y + _local4.y));
myPoint = Point(posArray[iIndex]);
mc_scrubBrush.x = myPoint.x;
mc_scrubBrush.y = myPoint.y;
iIndex++;
addChild(spr_draw);
spr_draw.alpha = 0.75;
addChild(mc_scrubBrush);
fn_state = anticipation;
}
public function moveBrush():void{
var _local1:int;
var _local2:int;
if (((!((mc_scrubBrush.x == myPoint.x))) || (!((mc_scrubBrush.y == myPoint.y))))){
_local1 = mc_scrubBrush.x;
_local2 = mc_scrubBrush.y;
if (mc_scrubBrush.x != myPoint.x){
if (mc_scrubBrush.x < myPoint.x){
mc_scrubBrush.x = (mc_scrubBrush.x + 5);
} else {
mc_scrubBrush.x = (mc_scrubBrush.x - 5);
};
};
if (mc_scrubBrush.y != myPoint.y){
if (mc_scrubBrush.y < myPoint.y){
mc_scrubBrush.y = (mc_scrubBrush.y + 5);
} else {
mc_scrubBrush.y = (mc_scrubBrush.y - 5);
};
};
spr_draw.graphics.moveTo(_local1, _local2);
spr_draw.graphics.lineStyle(4, 16764159);
spr_draw.graphics.lineTo(mc_scrubBrush.x, mc_scrubBrush.y);
} else {
if (iIndex < posArray.length){
myPoint = posArray[iIndex];
iIndex++;
} else {
fn_state = pauseBrush;
};
};
}
public function pauseBrush():void{
iCounter++;
if (iCounter >= root.stage.frameRate){
reset();
};
}
public function reset():void{
iIndex = 0;
myPoint = Point(posArray[iIndex]);
mc_scrubBrush.x = myPoint.x;
mc_scrubBrush.y = myPoint.y;
iIndex++;
iCounter = 0;
spr_draw.graphics.clear();
fn_state = anticipation;
}
public function anticipation():void{
iCounter++;
if (iCounter >= (root.stage.frameRate / 2)){
iCounter = 0;
fn_state = moveBrush;
};
}
}
}//package src.demo
Section 27
//bomb (src.items.bomb)
package src.items {
import flash.display.*;
import flash.events.*;
import src.clothes.*;
import flash.utils.*;
import src.screens.*;
import src.matches.*;
import src.particles.*;
public class bomb extends item {
private var mc_bombGraphic:MovieClip;
private var num_moves:int;
private var tm_timer:Timer;
public function bomb(_arg1:clothing=null):void{
mc_bombGraphic = new mc_bomb();
tm_timer = new Timer(5000);
num_moves = match.NUM_MOVES;
super();
cacheAsBitmap = true;
mc_targetClothing = _arg1;
addChild(mc_bombGraphic);
setUp();
tm_timer.addEventListener(TimerEvent.TIMER, initExplosion, false, 0, true);
scrubbable = true;
}
override public function clicked():void{
}
override public function kill():void{
tm_timer.stop();
tm_timer.removeEventListener(TimerEvent.TIMER, initExplosion);
super.kill();
}
public function explode():void{
var _local1:int;
var _local2:clothesPin;
var _local3:Number;
var _local4:Number;
tm_timer.stop();
tm_timer.removeEventListener(TimerEvent.TIMER, initExplosion);
screenManager.playSound(screenManager.sExplosion);
_local1 = 0;
while (_local1 < grandparent.clothesPinArray.length) {
_local2 = clothesPin(grandparent.clothesPinArray[_local1]);
if (((_local2.hasClothes()) && ((distanceFormula(_local2.clothes.x, _local2.clothes.y) <= (match.CLOTHES_WIDTH * 2))))){
_local2.releaseClothes();
};
_local1++;
};
_local1 = 0;
while (_local1 < 360) {
_local3 = Math.cos(((_local1 * Math.PI) / 180));
_local4 = Math.sin(((_local1 * Math.PI) / 180));
grandparent.addChild(new smoke((x + (width / 2)), (y + (height / 2)), _local3, _local4));
_local1 = (_local1 + (360 / 10));
};
if (distanceFormula(grandparent.mouseX, grandparent.mouseY) <= 100){
grandparent.freeEverything();
};
kill();
}
public function initExplosion(_arg1:Event):void{
explode();
}
override public function hangOn():void{
var _local1:int;
var _local2:int;
super.hangOn();
_local1 = match.NUM_MOVES;
_local2 = (_local1 - num_moves);
x = (x + (Math.floor((Math.random() * _local2)) - (_local2 / 2)));
y = (y + (Math.floor((Math.random() * _local2)) - (_local2 / 2)));
if (_local2 > 4){
explode();
};
}
}
}//package src.items
Section 28
//cat (src.items.cat)
package src.items {
import flash.display.*;
import flash.events.*;
import src.clothes.*;
import flash.utils.*;
import src.screens.*;
import src.matches.*;
public class cat extends item {
private var ti_meowTimer:Timer;
private var ti_timer:Timer;
private var mc_catGraphic:MovieClip;
public static var bAllowCat:Boolean = true;
public function cat(_arg1:clothing=null):void{
mc_catGraphic = new sooty();
ti_timer = new Timer(int((1000 / 30)));
ti_meowTimer = new Timer((int((Math.random() * 7000)) + 10000));
super();
screenManager.playSound(screenManager.sCatMeow);
mc_targetClothing = _arg1;
mc_targetClothing.visible = false;
addChild(mc_catGraphic);
mc_catGraphic.stop();
bAllowCat = false;
ti_timer.addEventListener(TimerEvent.TIMER, updateAnim, false, 0, true);
ti_timer.start();
ti_meowTimer.addEventListener(TimerEvent.TIMER, meow, false, 0, true);
ti_meowTimer.start();
setUp();
}
override public function clicked():void{
screenManager.playSound(screenManager.sCatSound);
mc_targetClothing.loseItem();
mc_targetClothing.release();
fn_state = fall;
}
override public function kill():void{
bAllowCat = true;
ti_timer.stop();
ti_timer.removeEventListener(TimerEvent.TIMER, updateAnim);
ti_meowTimer.stop();
ti_meowTimer.removeEventListener(TimerEvent.TIMER, meow);
super.kill();
}
public function meow(_arg1:TimerEvent):void{
screenManager.playSound(screenManager.catIdleSounds[int((Math.random() * screenManager.catIdleSounds.length))]);
ti_meowTimer.delay = (int((Math.random() * 7000)) + 10000);
}
public function updateAnim(_arg1:TimerEvent):void{
if (mc_catGraphic.currentFrame != mc_catGraphic.totalFrames){
mc_catGraphic.nextFrame();
} else {
mc_catGraphic.gotoAndStop(1);
};
}
public function fall():void{
checkClothesCollision();
y = (y + 10);
}
override public function hangOn():void{
x = (mc_targetClothing.x + (match.CLOTHES_WIDTH / 2));
y = (mc_targetClothing.y + 33);
}
}
}//package src.items
Section 29
//fungus (src.items.fungus)
package src.items {
import flash.display.*;
import flash.events.*;
import src.clothes.*;
import flash.utils.*;
import src.matches.*;
public class fungus extends item {
private var iGrowth:Number;// = 2.5
private var tm_timer:Timer;
public function fungus(_arg1:clothing):void{
iGrowth = 2.5;
tm_timer = new Timer(3000);
super();
if (_arg1 == null){
throw (new Error("Error! Cannot create fungus object without giving it clothing to hang on to"));
};
mc_targetClothing = _arg1;
setUp();
tm_timer.addEventListener(TimerEvent.TIMER, spread, false, 0, true);
}
override public function clicked():void{
}
override public function kill():void{
tm_timer.stop();
tm_timer.removeEventListener(TimerEvent.TIMER, spread);
super.kill();
}
public function scrubFungus():void{
if (iGrowth > 10){
iGrowth = (iGrowth - 0.25);
} else {
kill();
};
}
public function spread(_arg1:TimerEvent){
var _local2:Array;
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
_local2 = grandparent.clothesPinArray;
_local3 = new Array();
_local4 = 0;
findIndex();
if ((((iCurrentIndex > -1)) && (!((mc_targetClothing.fn_state == mc_targetClothing.fall))))){
_local5 = (iCurrentIndex - match.NUM_COLS);
if ((((((iCurrentIndex >= match.NUM_COLS)) && (clothesPin(_local2[_local5]).hasClothes()))) && (!(clothesPin(_local2[_local5]).clothes.hasItem())))){
_local3.push(_local5);
};
_local5 = (iCurrentIndex + match.NUM_COLS);
if ((((((iCurrentIndex < (grandparent.clothesPinArray.length - match.NUM_COLS))) && (clothesPin(_local2[_local5]).hasClothes()))) && (!(clothesPin(_local2[_local5]).clothes.hasItem())))){
_local3.push(_local5);
};
_local5 = (iCurrentIndex + 1);
if (((((!(((iCurrentIndex % match.NUM_COLS) == (match.NUM_COLS - 1)))) && (clothesPin(_local2[_local5]).hasClothes()))) && (!(clothesPin(_local2[_local5]).clothes.hasItem())))){
_local3.push(_local5);
};
_local5 = (iCurrentIndex - 1);
if (((((!(((iCurrentIndex % match.NUM_COLS) == 0))) && (clothesPin(_local2[_local5]).hasClothes()))) && (!(clothesPin(_local2[_local5]).clothes.hasItem())))){
_local3.push(_local5);
};
while ((((_local3.length > 0)) && ((_local4 < 2)))) {
_local6 = Math.floor((Math.random() * _local3.length));
_local5 = _local3[_local6];
clothesPin(_local2[_local5]).clothes.spawnItem(fungus);
_local4++;
_local3.splice(_local6, 1);
if (tm_timer.running){
tm_timer.reset();
};
};
};
}
override public function hangOn():void{
var _local1:DisplayObject;
_local1 = mc_targetClothing.parent;
if (_local1){
x = ((mc_targetClothing.width / 2) + mc_targetClothing.x);
y = ((mc_targetClothing.height / 2) + mc_targetClothing.y);
if (match(_local1.parent).fn_state == match(_local1.parent).updateMatch){
if (iGrowth < 20){
graphics.clear();
graphics.beginFill(8978329);
graphics.drawCircle(0, 0, iGrowth);
graphics.endFill();
iGrowth = (iGrowth + 0.05);
if (tm_timer.running){
tm_timer.reset();
};
} else {
tm_timer.start();
};
} else {
if (tm_timer.running){
tm_timer.stop();
};
};
} else {
kill();
};
}
}
}//package src.items
Section 30
//impit (src.items.impit)
package src.items {
import flash.display.*;
import src.clothes.*;
public class impit extends item {
private var mc_graphic:MovieClip;
public function impit(_arg1:clothing=null):void{
mc_graphic = new mc_impit();
super();
addChild(mc_graphic);
mc_targetClothing = _arg1;
mc_targetClothing.visible = false;
setUp();
}
public function scurry():void{
checkClothesCollision();
y = (y - 10);
}
override public function clicked():void{
fn_state = scurry;
mc_targetClothing.loseItem();
mc_targetClothing.release();
mc_targetClothing.fn_state = mc_targetClothing.fall;
grandparent.addChild(parent.removeChild(this));
}
}
}//package src.items
Section 31
//inanimate (src.items.inanimate)
package src.items {
import flash.display.*;
import src.clothes.*;
import src.screens.*;
public class inanimate extends item {
private var itemArray:Array;
private var mc_graphic:MovieClip;
private var index:int;
public function inanimate(_arg1:clothing=null):void{
var _local2:Class;
itemArray = new Array(rock, shield, ax);
index = int((Math.random() * itemArray.length));
super();
mc_targetClothing = _arg1;
mc_targetClothing.visible = false;
_local2 = Class(itemArray[index]);
mc_graphic = new (_local2);
addChildAsRuntimeBitmap(mc_graphic);
setUp();
}
override public function clicked():void{
if ((mc_graphic is shield)){
screenManager.playSound(screenManager.sShieldBang);
} else {
if ((mc_graphic is rock)){
screenManager.playSound(screenManager.sRockThud);
} else {
if ((mc_graphic is ax)){
screenManager.playSound(screenManager.sAxTing);
};
};
};
}
}
}//package src.items
Section 32
//item (src.items.item)
package src.items {
import game.*;
import src.clothes.*;
import src.screens.*;
import src.matches.*;
public class item extends gameObject {
public var mc_targetClothing:clothing;// = null
public var grandparent:match;// = null
public var iCurrentIndex:int;// = 0
public var scrubbable:Boolean;// = false
public var iPrevIndex:int;// = -1
public function item():void{
mc_targetClothing = null;
iCurrentIndex = 0;
iPrevIndex = -1;
scrubbable = false;
grandparent = null;
super();
}
public function checkPos():void{
if ((((((((y > screenManager.SCREEN_HEIGHT)) || ((y < -(height))))) || ((x < -(width))))) || ((visible == false)))){
kill();
};
}
public function clicked():void{
}
public function validIndex():Boolean{
findIndex();
if ((((((iCurrentIndex > -1)) && ((iCurrentIndex < grandparent.clothesPinArray.length)))) && (!((iCurrentIndex == iPrevIndex))))){
iPrevIndex = iCurrentIndex;
return (true);
};
return (false);
}
override public function kill():void{
if (mc_targetClothing != null){
mc_targetClothing.loseItem();
mc_targetClothing = null;
};
super.kill();
}
public function findIndex():void{
var _local1:int;
var _local2:int;
_local1 = Math.floor((x / match.CLOTHES_WIDTH));
_local2 = Math.floor((y / match.CLOTHES_HEIGHT));
if ((((((((_local1 >= match.NUM_COLS)) || ((_local2 >= match.NUM_ROWS)))) || ((_local1 < 0)))) || ((_local2 < 0)))){
iCurrentIndex = 1;
};
iCurrentIndex = ((_local2 * match.NUM_COLS) + _local1);
}
public function setUp():void{
if (mc_targetClothing != null){
x = (mc_targetClothing.x + (match.CLOTHES_WIDTH / 2));
y = (mc_targetClothing.y + (match.CLOTHES_HEIGHT / 2));
fn_state = hangOn;
};
}
override public function update():void{
if (grandparent == null){
grandparent = match(parent.parent);
};
super.update();
checkPos();
}
public function hangOn():void{
x = (mc_targetClothing.x + (match.CLOTHES_WIDTH / 2));
y = (mc_targetClothing.y + (match.CLOTHES_HEIGHT / 2));
}
public function checkClothesCollision():void{
var _local1:clothesPin;
if (validIndex()){
_local1 = clothesPin(grandparent.clothesPinArray[iCurrentIndex]);
if (_local1.hasClothes()){
_local1.clothes.bSound = true;
_local1.releaseClothes();
};
};
}
}
}//package src.items
Section 33
//itemManager (src.items.itemManager)
package src.items {
public class itemManager {
public static const classArray:Array = new Array(cat, bomb, inanimate, squirrel, impit, fungus);
public static const DISABLE_ARRAY:Array = new Array("Cats disabled.", "Bombs disabled.", "Inanimate objects disabled.", "Squirrels disabled.", "Impits disabled.", "Fungus disabled.");
public static const IMPIT:int = 4;
public static const SQUIRRELS:int = 3;
public static const CATS:int = 0;
public static const FUNGUS:int = 5;
public static const BOMBS:int = 1;
public static const INANIMATE:int = 2;
public static const ENABLE_ARRAY:Array = new Array("Cats enabled.", "Bombs enabled.", "Inanimate objects enabled.", "Squirrels enabled.", "Impits enabled.", "Fungus enabled.");
private static var itemArray:Array = new Array(false, false, false, false, false, false);
public static function enableAllItems():void{
var _local1:int;
_local1 = 0;
while (_local1 < itemArray.length) {
itemArray[_local1] = true;
_local1++;
};
}
public static function toggleItem(_arg1:int):void{
if (!isItemEnabled(_arg1)){
enableItem(_arg1);
} else {
disableItem(_arg1);
};
}
public static function itemsAllowed():Boolean{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
while (_local2 < itemArray.length) {
if (itemArray[_local2]){
_local1++;
};
_local2++;
};
if (_local1 > 0){
return (true);
};
return (false);
}
public static function numItemsEnabled():int{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
while (_local2 < itemArray.length) {
if (itemArray[_local2]){
_local1++;
};
_local2++;
};
return (_local1);
}
public static function disableItem(_arg1:int):void{
if ((((_arg1 < 0)) || ((_arg1 >= itemArray.length)))){
throw (new Error("Cannot disallow item type requested! Item type not found!"));
};
itemArray[_arg1] = false;
}
public static function isItemEnabled(_arg1:int):Boolean{
if ((((_arg1 < 0)) || ((_arg1 >= itemArray.length)))){
throw (new Error("Cannot query item type requested! Item type not found!"));
};
return (itemArray[_arg1]);
}
public static function disableAllItems():void{
var _local1:int;
_local1 = 0;
while (_local1 < itemArray.length) {
itemArray[_local1] = false;
_local1++;
};
}
public static function getEnabledItems():Array{
var _local1:Array;
var _local2:int;
_local1 = new Array();
_local2 = 0;
while (_local2 < itemArray.length) {
if (itemArray[_local2]){
_local1.push(classArray[_local2]);
};
_local2++;
};
return (_local1);
}
public static function enableItem(_arg1:int):void{
if ((((_arg1 < 0)) || ((_arg1 >= itemArray.length)))){
throw (new Error("Cannot allow item type requested! Item type not found!"));
};
itemArray[_arg1] = true;
}
}
}//package src.items
Section 34
//squirrel (src.items.squirrel)
package src.items {
import flash.display.*;
import flash.events.*;
import src.clothes.*;
import flash.utils.*;
import src.screens.*;
public class squirrel extends item {
private var mc_squirrelAnim:MovieClip;
private var mc_squirrelRunning:MovieClip;
private var nSpeed:Number;// = 2.5
private var animTimer:Timer;
private var mc_squirrelHanging:MovieClip;
public function squirrel(_arg1:clothing=null):void{
nSpeed = 2.5;
mc_squirrelHanging = new squirrel_hanging();
mc_squirrelRunning = new squirrel_running();
animTimer = new Timer(int((1000 / 30)));
super();
mc_squirrelHanging.stop();
mc_squirrelRunning.stop();
mc_squirrelHanging.scaleX = -1;
mc_squirrelRunning.scaleX = -1;
mc_squirrelRunning.visible = false;
addChild(mc_squirrelRunning);
addChild(mc_squirrelHanging);
mc_squirrelAnim = mc_squirrelHanging;
mc_targetClothing = _arg1;
mc_targetClothing.visible = false;
animTimer.addEventListener(TimerEvent.TIMER, updateAnim, false, 0, true);
animTimer.start();
setUp();
screenManager.playSound(screenManager.SQUIRREL_SOUNDS[int((Math.random() * 4))]);
}
public function flyLeft():void{
checkClothesCollision();
x = (x - 7.5);
}
override public function clicked():void{
fn_state = flyLeft;
mc_squirrelHanging.visible = false;
mc_squirrelAnim = mc_squirrelRunning;
mc_squirrelRunning.visible = true;
mc_squirrelAnim.y = (mc_squirrelAnim.y - 35);
mc_targetClothing.loseItem();
mc_targetClothing.kill();
grandparent.addChild(parent.removeChild(this));
screenManager.playSound(screenManager.sSquirrelEscaping);
}
override public function kill():void{
animTimer.stop();
animTimer.removeEventListener(TimerEvent.TIMER, updateAnim);
super.kill();
}
override public function setUp():void{
super.setUp();
}
public function updateAnim(_arg1:TimerEvent):void{
if (mc_squirrelAnim.currentFrame != mc_squirrelAnim.totalFrames){
mc_squirrelAnim.nextFrame();
} else {
mc_squirrelAnim.gotoAndStop(1);
};
}
}
}//package src.items
Section 35
//freePlay (src.matches.freePlay)
package src.matches {
public class freePlay extends match {
override public function updateMatch():void{
super.updateMatch();
if (!clothesLineFull()){
spawnClothing();
} else {
if (!checkAllColorMatches()){
stopMatch();
};
};
updateClothing();
}
}
}//package src.matches
Section 36
//levelMatch (src.matches.levelMatch)
package src.matches {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import game.*;
import src.clothes.*;
import src.items.*;
import flash.utils.*;
import src.screens.*;
import src.stopWatch.*;
public class levelMatch extends match {
private var mc_nextLevelButton:SimpleButton;
private var tx_levelInfo:TextField;
private var bStopWatchStarted:Boolean;// = false
var spaceAvailable:int;
private var tm_restartTimer:Timer;
private var iCurrentLevel:int;// = 0
private var tx_levelObjective:TextField;
private var iLevelClothingCount:int;// = 0
var myStopWatch:stopWatch;
private var iSeconds:int;// = 0
private var tf_myFormat:TextFormat;
public function levelMatch():void{
iLevelClothingCount = 0;
iCurrentLevel = 0;
iSeconds = 0;
tm_restartTimer = new Timer(1000);
mc_nextLevelButton = new next_level();
tx_levelObjective = new TextField();
tx_levelInfo = new TextField();
tf_myFormat = new TextFormat();
bStopWatchStarted = false;
myStopWatch = new stopWatch();
super();
spaceAvailable = (screenManager.SCREEN_WIDTH - (x + GAME_WIDTH));
tx_levelObjective.selectable = false;
tx_levelInfo.selectable = false;
tx_levelObjective.embedFonts = true;
tx_levelInfo.embedFonts = true;
tx_levelObjective.wordWrap = true;
tf_myFormat.align = "center";
addChild(tx_levelObjective);
addChild(tx_levelInfo);
addChild(myStopWatch);
mc_nextLevelButton.addEventListener(MouseEvent.CLICK, goToNextLevel);
mc_nextLevelButton.visible = false;
addChild(mc_nextLevelButton);
setLevelParameters();
tm_restartTimer.addEventListener(TimerEvent.TIMER, restart);
}
public function goToNextLevel(_arg1:MouseEvent):void{
btnPause.visible = true;
mc_nextLevelButton.visible = false;
setLevelParameters();
fn_state = updateMatch;
}
public function restart(_arg1:TimerEvent):void{
tm_restartTimer.reset();
fn_state = updateMatch;
}
public function updateClothingCount():void{
tx_levelInfo.multiline = true;
tx_levelInfo.htmlText = gameText.insertVariables(gameText.CLOTHING_COUNT, "%", int(iClothingCount.out()), int(iTotalClothingCount.out()));
tx_levelInfo.autoSize = TextFieldAutoSize.CENTER;
tx_levelInfo.setTextFormat(tf_myFormat);
tx_levelInfo.x = (screenManager.SCREEN_WIDTH - ((spaceAvailable + tx_levelInfo.width) / 2));
tx_levelInfo.y = ((myStopWatch.y + myStopWatch.height) + 5);
}
override public function updateNumStains():int{
var _local1:int;
_local1 = 0;
if (iCurrentLevel >= 12){
_local1 = 4;
} else {
if (iCurrentLevel >= 9){
_local1 = 3;
} else {
if (iCurrentLevel >= 6){
_local1 = 2;
} else {
_local1 = 1;
};
};
};
return (stainMgr.getCount(_local1));
}
override public function updateClothingColor():int{
var _local1:int;
if (iCurrentLevel < 5){
_local1 = 1;
} else {
if (iCurrentLevel < 7){
_local1 = 3;
} else {
if (iCurrentLevel < 10){
_local1 = 5;
} else {
if (iCurrentLevel >= 12){
_local1 = 6;
};
};
};
};
return (clothingMgr.getCount(_local1));
}
override public function updateItems():void{
if ((((iCurrentLevel >= 3)) && (!(itemManager.isItemEnabled(itemManager.CATS))))){
itemManager.enableItem(itemManager.CATS);
};
if ((((iCurrentLevel >= 5)) && (!(itemManager.isItemEnabled(itemManager.BOMBS))))){
itemManager.enableItem(itemManager.BOMBS);
};
if ((((iCurrentLevel >= 7)) && (!(itemManager.isItemEnabled(itemManager.INANIMATE))))){
itemManager.enableItem(itemManager.INANIMATE);
};
if ((((iCurrentLevel >= 9)) && (!(itemManager.isItemEnabled(itemManager.SQUIRRELS))))){
itemManager.enableItem(itemManager.SQUIRRELS);
};
if ((((iCurrentLevel >= 12)) && (!(itemManager.isItemEnabled(itemManager.FUNGUS))))){
itemManager.enableItem(itemManager.FUNGUS);
};
}
override public function updateMatch():void{
super.updateMatch();
if (!myStopWatch.expired){
if (!clothesLineFull()){
spawnClothing();
} else {
if (((clothesLineFull()) && (!(bStopWatchStarted)))){
bStopWatchStarted = true;
myStopWatch.startCountDown();
} else {
if (!checkAllColorMatches()){
resetBoard();
};
};
};
updateClothing();
updateClothingCount();
} else {
clearLevel();
};
}
public function resetBoard():void{
bStopWatchStarted = false;
clearBoard();
fn_state = wait;
tm_restartTimer.start();
}
override public function updateNumStainColors():int{
var _local1:int;
_local1 = 3;
if (iCurrentLevel >= 5){
_local1 = 4;
};
return (stainMgr.getNumStainColors(_local1));
}
override public function stopMatch():void{
mc_nextLevelButton.visible = false;
myStopWatch.stopCountDown();
super.stopMatch();
}
override public function unpause(_arg1:MouseEvent):void{
if (bStopWatchStarted){
myStopWatch.startCountDown();
};
super.unpause(_arg1);
}
public function nextLevelButton():void{
mc_nextLevelButton.visible = true;
btnPause.visible = false;
}
public function clearLevel():void{
clearBoard();
if (int(iClothingCount.out()) < iLevelClothingCount){
stopMatch();
} else {
fn_state = wait;
nextLevelButton();
};
}
override public function reset():void{
mc_nextLevelButton.visible = false;
iCurrentLevel = 0;
super.reset();
setLevelParameters();
}
override public function kill():void{
mc_nextLevelButton.removeEventListener(MouseEvent.CLICK, goToNextLevel);
tm_restartTimer.removeEventListener(TimerEvent.TIMER, restart);
super.kill();
}
public function setLevelParameters():void{
iCurrentLevel++;
iClothingCount.set(0);
iLevelClothingCount = (((iCurrentLevel - 1) * 5) + 10);
iSeconds = (iCurrentLevel * 15);
tx_levelObjective.width = (GAME_WIDTH - 20);
tx_levelObjective.multiline = true;
tx_levelObjective.htmlText = gameText.insertVariables(gameText.LEVEL_OBJECTIVE, "%", iCurrentLevel, iLevelClothingCount, iSeconds);
tx_levelObjective.setTextFormat(tf_myFormat);
tx_levelObjective.x = ((GAME_WIDTH - tx_levelObjective.width) / 2);
tx_levelObjective.y = 495;
updateClothingCount();
bStopWatchStarted = false;
myStopWatch.setCountDownTime(iSeconds);
myStopWatch.x = (screenManager.SCREEN_WIDTH - ((spaceAvailable + myStopWatch.width) / 2));
myStopWatch.y = 85;
updateItems();
}
override public function pause(_arg1:MouseEvent):void{
myStopWatch.stopCountDown();
super.pause(_arg1);
}
}
}//package src.matches
Section 37
//match (src.matches.match)
package src.matches {
import flash.display.*;
import flash.events.*;
import game.*;
import src.clothes.*;
import src.items.*;
import com.meteorgames.libs.xvars.*;
import src.pieces.*;
import src.screens.*;
import src.particles.*;
import flash.ui.*;
public class match extends gameObject {
public const GAME_HEIGHT:int = 450;
public const GAME_WIDTH:int = 450;
public const NUM_POINTS:int = 10;
public var iTotalStainsRemoved:XVar;
public var spr_surface:drawing_surface;
public var clothesPinArray:Array;
private var mc_washTubb:MovieClip;
public var markedClothesPinArray:Array;
public var particleLayer:gameObject;
public var iClothingCount:XVar;
public var mc_scrubber:scrubber;
public var mc_renderLayers:Array;
public var bMouseDown:Boolean;// = false
public var colorArray:Array;
private var btnQuit:SimpleButton;
public var btnPause:SimpleButton;
private var btnUnpause:SimpleButton;
private var cycleArray:Array;
public var iPrevMark:int;
private var bombCycle:Boolean;// = false
private var iScore:XVar;
public var iCurrentMark:int;
public var iTotalClothingCount:XVar;
private var bMatchOver:Boolean;// = false
private var counter:int;
public static const MAX_BUBBLES:int = 15;
public static const MAX_SOAP_BUBBLES:int = 3;
public static const CLOTHES_WIDTH:int = 50;
public static const NUM_COLS:int = 9;
public static const pointsArray:Array = new Array(20, 30, 40, 50, 70, 100, 130, 170, 220, 280, 350, 430, 520, 620, 730, 850, 990, 1200);
public static const NUM_ROWS:int = 9;
public static const CLOTHES_HEIGHT:int = 50;
private static var num_moves:int = 0;
public static var num_bubbles:int = 15;
public static var num_soap_bubbles:int = 3;
public function match():void{
var _local1:int;
var _local2:int;
bMouseDown = false;
iClothingCount = new XVar(0);
iTotalClothingCount = new XVar(0);
iTotalStainsRemoved = new XVar(0);
clothesPinArray = new Array((NUM_COLS * NUM_ROWS));
markedClothesPinArray = new Array();
spr_surface = new drawing_surface();
mc_scrubber = new scrubber();
iScore = new XVar(0);
bombCycle = false;
cycleArray = new Array(NUM_ROWS);
mc_renderLayers = new Array(NUM_ROWS);
mc_washTubb = new washtubb();
btnQuit = new quit_BTN();
btnPause = new pause_BTN();
btnUnpause = new unpause_BTN();
bMatchOver = false;
particleLayer = new gameObject();
super();
focusRect = false;
_local1 = 0;
_local1 = (mc_renderLayers.length - 1);
while (_local1 >= 0) {
mc_renderLayers[_local1] = new gameObject();
addChild(gameObject(mc_renderLayers[_local1]));
_local1--;
};
_local1 = 0;
while (_local1 < clothesPinArray.length) {
clothesPinArray[_local1] = new clothesPin(gameObject(mc_renderLayers[int((_local1 / NUM_COLS))]));
clothesPinArray[_local1].x = ((_local1 % NUM_COLS) * CLOTHES_WIDTH);
clothesPinArray[_local1].y = (int((_local1 / NUM_COLS)) * CLOTHES_HEIGHT);
if ((_local1 % NUM_COLS) != 0){
clothesPin(clothesPinArray[_local1]).leftClothesPin = clothesPin(clothesPinArray[(_local1 - 1)]);
};
_local1++;
};
_local1 = 0;
while (_local1 < (clothesPinArray.length - NUM_COLS)) {
clothesPin(clothesPinArray[_local1]).bottomClothesPin = clothesPin(clothesPinArray[(_local1 + NUM_COLS)]);
_local1++;
};
_local1 = 0;
while (_local1 < cycleArray.length) {
cycleArray[_local1] = 0;
_local1++;
};
spr_surface.alpha = 0.8;
addChild(spr_surface);
addChildAsRuntimeBitmap(mc_scrubber);
if ((((this is levelMatch)) || ((this is survivalMatch)))){
if (int((Math.random() * 100)) == 1){
bombCycle = true;
};
};
addChild(particleLayer);
_local2 = 0;
while (_local2 < num_bubbles) {
particleLayer.addChildAsRuntimeBitmap(new waterBubble());
_local2++;
};
mc_washTubb.cacheAsBitmap = true;
mc_washTubb.x = ((mc_washTubb.width / 2) - 25);
mc_washTubb.y = (screenManager.SCREEN_HEIGHT - (mc_washTubb.height / 2));
addChildAsRuntimeBitmap(mc_washTubb);
btnQuit.x = ((screenManager.SCREEN_WIDTH - (btnQuit.width / 2)) - 40);
btnQuit.y = ((screenManager.SCREEN_HEIGHT - (btnQuit.height / 2)) - 20);
btnPause.x = btnQuit.x;
btnPause.y = ((btnQuit.y - btnPause.height) - 10);
btnUnpause.x = btnPause.x;
btnUnpause.y = btnPause.y;
btnUnpause.visible = false;
addChildAsRuntimeBitmap(btnUnpause);
addChildAsRuntimeBitmap(btnPause);
addChildAsRuntimeBitmap(btnQuit);
btnQuit.addEventListener(MouseEvent.CLICK, quitGame);
btnPause.addEventListener(MouseEvent.CLICK, pause);
btnUnpause.addEventListener(MouseEvent.CLICK, unpause);
}
public function clearArray():void{
var _local1:int;
_local1 = markedClothesPinArray.length;
while (_local1 > 0) {
markedClothesPinArray.pop();
_local1--;
};
}
public function checkIndexColorMatches(_arg1:int):int{
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:Array;
var _local6:*;
_local2 = 0;
_local3 = 0;
_local4 = clothesPin(clothesPinArray[_arg1]).clothes.getStains();
_local5 = new Array((_arg1 >= NUM_COLS), (_arg1 < (clothesPinArray.length - NUM_COLS)), !(((_arg1 % NUM_COLS) == (NUM_COLS - 1))), !(((_arg1 % NUM_COLS) == 0)));
for each (_local6 in _local4) {
if (((_local5[0]) && (clothesPin(clothesPinArray[(_arg1 - NUM_COLS)]).clothes.checkForStainColor(_local6)))){
_local2++;
};
if (((_local5[1]) && (clothesPin(clothesPinArray[(_arg1 + NUM_COLS)]).clothes.checkForStainColor(_local6)))){
_local2++;
};
if (((_local5[2]) && (clothesPin(clothesPinArray[(_arg1 + 1)]).clothes.checkForStainColor(_local6)))){
_local2++;
};
if (((_local5[3]) && (clothesPin(clothesPinArray[(_arg1 - 1)]).clothes.checkForStainColor(_local6)))){
_local2++;
};
if (_local2 > _local3){
_local3 = _local2;
};
};
return (_local3);
}
public function updateNumStains():int{
var _local1:int;
_local1 = 1;
if (int(iTotalClothingCount.out()) > 600){
_local1 = 4;
} else {
if (int(iTotalClothingCount.out()) > 300){
_local1 = 3;
} else {
if (int(iTotalClothingCount.out()) > 200){
_local1 = 2;
};
};
};
return (stainMgr.getCount(_local1));
}
public function spawnClothing():void{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = (NUM_COLS - 1);
while (_local2 < clothesPinArray.length) {
if (!clothesPin(clothesPinArray[_local2]).hasClothes()){
clothesPin(clothesPinArray[_local2]).getNewClothes(updateClothingColor(), updateNumStains(), updateNumStainColors());
if (itemManager.itemsAllowed()){
clothesPin(clothesPinArray[_local2]).clothes.spawnItem();
} else {
if (((bombCycle) && ((cycleArray[_local1] == (NUM_COLS - 1))))){
clothesPin(clothesPinArray[_local2]).clothes.spawnItem(bomb);
};
};
var _local3 = cycleArray;
var _local4 = _local1;
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
};
_local1++;
_local2 = (_local2 + NUM_COLS);
};
}
public function freeEverything():void{
clearMarks();
clearArray();
removeEventListener(MouseEvent.MOUSE_MOVE, checkMousePos);
spr_surface.stopDraw();
}
public function get clothingCount():int{
return (int(iTotalClothingCount.out()));
}
public function checkAllColorMatches():Boolean{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < clothesPinArray.length) {
if (clothesPin(clothesPinArray[_local1]).hasClothes()){
_local2 = checkIndexColorMatches(_local1);
if (_local2 > 1){
return (true);
};
};
_local1++;
};
return (false);
}
public function countDown():void{
var _local1:Boolean;
var _local2:int;
_local1 = false;
_local2 = 0;
while (_local2 < mc_renderLayers.length) {
if (gameObject(mc_renderLayers[_local2]).numChildren > 0){
_local1 = true;
};
_local2++;
};
if (!_local1){
fn_state = wait;
gameScreen(parent).endGame();
};
}
public function updateItems():void{
if ((((int(iTotalClothingCount.out()) > 200)) && (!(itemManager.isItemEnabled(itemManager.CATS))))){
itemManager.enableItem(itemManager.CATS);
};
if ((((int(iTotalClothingCount.out()) > 400)) && (!(itemManager.isItemEnabled(itemManager.BOMBS))))){
itemManager.enableItem(itemManager.BOMBS);
};
if ((((int(iTotalClothingCount.out()) > 800)) && (!(itemManager.isItemEnabled(itemManager.INANIMATE))))){
itemManager.enableItem(itemManager.INANIMATE);
};
if ((((int(iTotalClothingCount.out()) > 1200)) && (!(itemManager.isItemEnabled(itemManager.SQUIRRELS))))){
itemManager.enableItem(itemManager.SQUIRRELS);
};
if ((((int(iTotalClothingCount.out()) > 2000)) && (!(itemManager.isItemEnabled(itemManager.FUNGUS))))){
itemManager.enableItem(itemManager.FUNGUS);
};
}
public function clearStains(_arg1:int):void{
var _local2:int;
var _local3:clothesPin;
var _local4:uint;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:scoreBubble;
var _local12:int;
var _local13:int;
var _local14:soapBubble;
if (!bMatchOver){
_local2 = 0;
_local6 = 0;
_local7 = 0;
_local8 = -1;
switch (_arg1){
case clothing.RED:
_local4 = soapBubble.RED;
break;
case clothing.ORANGE:
_local4 = soapBubble.ORANGE;
break;
case clothing.GREEN:
_local4 = soapBubble.GREEN;
break;
case clothing.PURPLE:
_local4 = soapBubble.PURPLE;
break;
case clothing.BLACK:
_local4 = soapBubble.BLACK;
break;
case clothing.BROWN:
_local4 = soapBubble.BROWN;
break;
};
_local9 = 0;
while (_local9 < markedClothesPinArray.length) {
if (clothesPin(markedClothesPinArray[_local9]).clothes.getStains().length == 1){
_local7++;
if (_local8 > -1){
if (clothesPin(markedClothesPinArray[_local9]).y > clothesPin(markedClothesPinArray[_local8]).y){
clothesPin(markedClothesPinArray[_local8]).clothes.bSound = false;
clothesPin(markedClothesPinArray[_local9]).clothes.bSound = true;
_local8 = _local9;
};
} else {
clothesPin(markedClothesPinArray[_local9]).clothes.bSound = true;
_local8 = _local9;
};
};
_local9++;
};
if (_local8 > -1){
if (_local7 >= 9){
clothesPin(markedClothesPinArray[_local8]).clothes.sSplash = screenManager.sBigSplash;
} else {
if (_local7 >= 6){
clothesPin(markedClothesPinArray[_local8]).clothes.sSplash = screenManager.sMediumSplash;
} else {
clothesPin(markedClothesPinArray[_local8]).clothes.sSplash = screenManager.sSmallSplash;
};
};
};
_local10 = int(iClothingCount.out());
_local9 = 0;
while (_local9 < markedClothesPinArray.length) {
clothesPin(markedClothesPinArray[_local9]).cleanClothes(_arg1);
iTotalStainsRemoved.add(1);
_local5 = 0;
while (_local5 < num_soap_bubbles) {
_local12 = (int((Math.random() * CLOTHES_WIDTH)) + clothesPin(markedClothesPinArray[_local9]).x);
_local13 = (int((Math.random() * CLOTHES_HEIGHT)) + clothesPin(markedClothesPinArray[_local9]).y);
_local14 = new soapBubble(_local12, _local13, _local4);
particleLayer.addChildAsRuntimeBitmap(_local14);
_local5++;
};
if (!clothesPin(markedClothesPinArray[_local9]).hasClothes()){
iClothingCount.add(1);
iTotalClothingCount.add(1);
};
_local3 = clothesPin(markedClothesPinArray[_local9]);
_local9++;
};
updateItems();
if (_local9 < pointsArray.length){
_local2 = int(pointsArray[(_local9 - 3)]);
} else {
_local2 = int(pointsArray[(pointsArray.length - 1)]);
};
if ((int(iClothingCount.out()) - _local10) > 0){
screenManager.playSound(screenManager.clothesSndArray[int((Math.random() * screenManager.clothesSndArray.length))]);
};
if ((this is survivalMatch)){
_local6 = (int(iClothingCount.out()) - _local10);
survivalMatch(this).showTimeAdded(_local6);
};
_local11 = new scoreBubble((_local3.x + (CLOTHES_WIDTH / 2)), (_local3.y + (CLOTHES_HEIGHT / 2)), _local2, gameScreen(parent).getScoreLocation());
particleLayer.addChildAsRuntimeBitmap(_local11);
iScore.add(_local2);
num_moves++;
};
}
public function updateMatch():void{
if ((((((((((parent.mouseX >= x)) && ((parent.mouseY >= y)))) && ((parent.mouseX <= (x + GAME_WIDTH))))) && ((parent.mouseY <= (y + GAME_HEIGHT))))) && (!(screenManager.MENU_VISIBLE)))){
Mouse.hide();
mc_scrubber.visible = true;
} else {
Mouse.show();
mc_scrubber.visible = false;
};
}
public function updateClothingColor():int{
var _local1:int;
if (int(iTotalClothingCount.out()) < 250){
_local1 = 1;
} else {
if (int(iTotalClothingCount.out()) < 400){
_local1 = 3;
} else {
if (int(iTotalClothingCount.out()) < 550){
_local1 = 5;
} else {
_local1 = 6;
};
};
};
return (clothingMgr.getCount(_local1));
}
public function checkMousePos(_arg1:MouseEvent):void{
var _local2:clothesPin;
var _local3:item;
if (!_arg1.buttonDown){
mouseReleased();
} else {
if ((((((((mouseX >= GAME_WIDTH)) || ((mouseY >= GAME_HEIGHT)))) || ((mouseX < 0)))) || ((mouseY < 0)))){
freeEverything();
} else {
iCurrentMark = findIndex();
if ((((iCurrentMark == -1)) || ((iCurrentMark > clothesPinArray.length)))){
freeEverything();
};
spr_surface.draw();
mc_scrubber.spawnBubbles();
_local2 = clothesPin(clothesPinArray[iCurrentMark]);
if (_local2.hasClothes()){
if (!_local2.isMarked()){
if (_local2.state == _local2.passClothes){
processUnmarkedClothing(_local2);
};
} else {
if (iCurrentMark == iPrevMark){
if (((_local2.clothes.hasItem()) && (!(_local2.clothes.getItem().scrubbable)))){
_local3 = _local2.clothes.getItem();
if ((_local3 is fungus)){
fungus(_local3).scrubFungus();
};
};
} else {
if (iPrevMark != iCurrentMark){
freeEverything();
};
};
};
};
};
};
}
public function get score():int{
return (int(iScore.out()));
}
public function clearBoard():void{
var _local1:clothing;
var _local2:int;
_local2 = 0;
while (_local2 < clothesPinArray.length) {
if (clothesPin(clothesPinArray[_local2]).hasClothes()){
if (_local1 != null){
_local1.bSound = false;
};
_local1 = clothesPin(clothesPinArray[_local2]).clothes;
_local1.bSound = true;
_local1.sSplash = screenManager.sHugeSplash;
if (_local2 >= NUM_COLS){
clothesPin(clothesPinArray[_local2]).clothes.setSplash(false);
};
clothesPin(clothesPinArray[_local2]).releaseClothes();
};
_local2++;
};
freeEverything();
}
public function findIndex():int{
var _local1:int;
var _local2:int;
_local1 = int((mouseX / CLOTHES_WIDTH));
_local2 = int((mouseY / CLOTHES_HEIGHT));
if ((((((((_local1 >= NUM_COLS)) || ((_local2 >= NUM_ROWS)))) || ((_local1 < 0)))) || ((_local2 < 0)))){
return (-1);
};
return (((_local2 * NUM_COLS) + _local1));
}
override public function update():void{
if (((!(bMatchOver)) && ((fn_state == updateMatch)))){
if (((screenManager.MOUSE_DOWN) && (!(bMouseDown)))){
bMouseDown = true;
mousePressed();
} else {
if (((!(screenManager.MOUSE_DOWN)) && (bMouseDown))){
bMouseDown = false;
mouseReleased();
};
};
};
super.update();
}
public function get stainCount():int{
return (int(iTotalStainsRemoved.out()));
}
public function quitGame(_arg1:MouseEvent):void{
stopMatch();
}
public function updateNumStainColors():int{
var _local1:int;
_local1 = 3;
if (int(iTotalClothingCount.out()) > 250){
_local1 = 4;
};
return (stainMgr.getNumStainColors(_local1));
}
public function stopMatch():void{
screenManager.playSound(screenManager.sBubbleBloop);
clearBoard();
endMatch();
btnQuit.visible = false;
btnPause.visible = false;
btnUnpause.visible = false;
}
public function clearMarks():void{
var _local1:int;
_local1 = 0;
while (_local1 < markedClothesPinArray.length) {
clothesPin(markedClothesPinArray[_local1]).removeMark();
_local1++;
};
}
public function unpause(_arg1:MouseEvent):void{
var _local2:clothesPin;
btnPause.visible = true;
btnUnpause.visible = false;
fn_state = updateMatch;
for each (_local2 in clothesPinArray) {
if (_local2.hasClothes()){
_local2.clothes.showClothes();
};
};
}
public function clothesLineFull():Boolean{
var _local1:int;
_local1 = 0;
while (_local1 < clothesPinArray.length) {
if (clothesPin(clothesPinArray[_local1]).state != clothesPin(clothesPinArray[_local1]).passClothes){
return (false);
};
_local1++;
};
return (true);
}
public function mouseReleased():void{
var _local1:Array;
var _local2:*;
var _local3:Boolean;
var _local4:*;
spr_surface.stopDraw();
if (hasEventListener(MouseEvent.MOUSE_MOVE)){
removeEventListener(MouseEvent.MOUSE_MOVE, checkMousePos);
if (markedClothesPinArray.length > 0){
_local1 = clothesPin(markedClothesPinArray[0]).clothes.getStains();
if (markedClothesPinArray.length < 3){
clearMarks();
clearArray();
return;
};
for each (_local2 in _local1) {
_local3 = true;
for each (_local4 in markedClothesPinArray) {
if (!clothesPin(_local4).clothes.checkForStainColor(_local2)){
_local3 = false;
break;
};
};
if (_local3 == true){
clearStains(_local2);
clearArray();
return;
};
};
clearMarks();
clearArray();
};
};
}
public function updateScoreBoard(_arg1:int):void{
gameScreen(parent).updateScore(_arg1);
}
public function paused():void{
wait();
}
public function processUnmarkedClothing(_arg1:clothesPin):void{
var _local2:item;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
if (((_arg1.clothes.hasItem()) && (!(_arg1.clothes.getItem().scrubbable)))){
_local2 = _arg1.clothes.getItem();
if ((_local2 is fungus)){
fungus(_local2).scrubFungus();
} else {
_arg1.clothes.itemClick();
freeEverything();
};
} else {
if ((((((Math.abs((iCurrentMark - iPrevMark)) == 1)) || ((Math.abs((iCurrentMark - iPrevMark)) == NUM_COLS)))) || (((iCurrentMark - iPrevMark) == 0)))){
if (stainMatch(_arg1)){
_arg1.markClothesPin();
markedClothesPinArray.push(_arg1);
} else {
freeEverything();
return;
};
iPrevMark = iCurrentMark;
} else {
if ((((int((iCurrentMark / NUM_COLS)) == int((iPrevMark / NUM_COLS)))) || (((Math.abs((iCurrentMark - iPrevMark)) % NUM_COLS) == 0)))){
if (int((iCurrentMark / NUM_COLS)) == int((iPrevMark / NUM_COLS))){
_local5 = 1;
} else {
_local5 = NUM_COLS;
};
if (iCurrentMark < iPrevMark){
_local3 = iCurrentMark;
_local4 = iPrevMark;
} else {
_local3 = iPrevMark;
_local4 = iCurrentMark;
};
_local6 = _local3;
while (_local6 <= _local4) {
if (stainMatch(clothesPin(clothesPinArray[_local6]))){
clothesPin(clothesPinArray[_local6]).markClothesPin();
markedClothesPinArray.push(clothesPin(clothesPinArray[_local6]));
} else {
freeEverything();
return;
};
_local6 = (_local6 + _local5);
};
iPrevMark = iCurrentMark;
} else {
freeEverything();
};
};
};
}
public function reset():void{
btnQuit.visible = true;
btnPause.visible = true;
bMatchOver = false;
iScore.set(0);
iTotalClothingCount.set(0);
iClothingCount.set(0);
iTotalStainsRemoved.set(0);
}
public function setProperScore():void{
gameScreen(parent).setScore();
}
public function updateClothing():void{
var _local1:int;
_local1 = 0;
while (_local1 < clothesPinArray.length) {
clothesPin(clothesPinArray[_local1]).update();
_local1++;
};
}
override public function wait():void{
mc_scrubber.visible = false;
Mouse.show();
super.wait();
}
public function stainMatch(_arg1:clothesPin):Boolean{
var _local2:Boolean;
var _local3:int;
_local2 = false;
if (colorArray != null){
_local3 = 0;
while (_local3 < colorArray.length) {
if (colorArray[_local3] != -1){
if (_arg1.clothes.checkForStainColor(colorArray[_local3])){
_local2 = true;
} else {
colorArray[_local3] = -1;
};
};
_local3++;
};
};
return (_local2);
}
public function compareClothing(_arg1:int, _arg2:int):Boolean{
var _local3:clothesPin;
var _local4:clothesPin;
var _local5:item;
_local3 = clothesPin(clothesPinArray[_arg1]);
_local4 = clothesPin(clothesPinArray[_arg2]);
_local5 = null;
if (_local3.clothes.hasItem()){
_local5 = _local3.clothes.getItem();
if ((_local5 is cat)){
return (false);
};
} else {
if (_local4.clothes.hasItem()){
_local5 = _local4.clothes.getItem();
if ((_local5 is cat)){
return (false);
};
} else {
if ((((_local3.state == _local3.passClothes)) && ((_local4.state == _local4.passClothes)))){
return (true);
};
};
};
return (false);
}
public function endMatch():void{
bMatchOver = true;
Mouse.show();
mc_scrubber.visible = false;
clothingMgr.resetClothing();
stainMgr.resetStains();
stainMgr.resetNumStainColors();
itemManager.disableAllItems();
num_moves = 0;
fn_state = countDown;
btnPause.visible = false;
btnUnpause.visible = false;
}
public function mousePressed():void{
var _local1:item;
if ((((mouseX < GAME_WIDTH)) || ((mouseY < GAME_HEIGHT)))){
iCurrentMark = findIndex();
if (iCurrentMark != -1){
if (((clothesPin(clothesPinArray[iCurrentMark]).hasClothes()) && ((clothesPin(clothesPinArray[iCurrentMark]).state == clothesPin(clothesPinArray[iCurrentMark]).passClothes)))){
addEventListener(MouseEvent.MOUSE_MOVE, checkMousePos);
if (((clothesPin(clothesPinArray[iCurrentMark]).clothes.hasItem()) && (!(clothesPin(clothesPinArray[iCurrentMark]).clothes.getItem().scrubbable)))){
_local1 = clothesPin(clothesPinArray[iCurrentMark]).clothes.getItem();
if ((_local1 is fungus)){
fungus(_local1).scrubFungus();
spr_surface.startDraw();
iPrevMark = iCurrentMark;
clothesPin(clothesPinArray[iCurrentMark]).markClothesPin();
markedClothesPinArray.push(clothesPin(clothesPinArray[iCurrentMark]));
} else {
clothesPin(clothesPinArray[iCurrentMark]).clothes.itemClick();
freeEverything();
};
} else {
spr_surface.startDraw();
iPrevMark = iCurrentMark;
clothesPin(clothesPinArray[iCurrentMark]).markClothesPin();
colorArray = clothesPin(clothesPinArray[iCurrentMark]).clothes.getStains().concat();
markedClothesPinArray.push(clothesPin(clothesPinArray[iCurrentMark]));
};
};
};
};
}
public function pause(_arg1:MouseEvent):void{
var _local2:clothesPin;
btnPause.visible = false;
btnUnpause.visible = true;
fn_state = paused;
for each (_local2 in clothesPinArray) {
if (_local2.hasClothes()){
_local2.clothes.hideClothes();
};
};
}
public static function bubbles_off():void{
num_bubbles = 0;
num_soap_bubbles = 0;
}
public static function get NUM_MOVES():int{
return (num_moves);
}
public static function bubbles_on():void{
num_bubbles = MAX_BUBBLES;
num_soap_bubbles = MAX_SOAP_BUBBLES;
}
}
}//package src.matches
Section 38
//survivalMatch (src.matches.survivalMatch)
package src.matches {
import flash.text.*;
import flash.events.*;
import game.*;
import src.clothes.*;
import flash.utils.*;
import src.screens.*;
import src.stopWatch.*;
public class survivalMatch extends match {
private var iVisibleTime:int;
private var tx_timeAdded:TextField;
private var bStopWatchStarted:Boolean;// = false
private var iTime:int;// = 30
private var myStopWatch:stopWatch;
public function survivalMatch():void{
var _local1:int;
iTime = 30;
myStopWatch = new stopWatch(iTime, stopWatch.SECONDS);
bStopWatchStarted = false;
tx_timeAdded = new TextField();
super();
_local1 = (screenManager.SCREEN_WIDTH - (x + GAME_WIDTH));
myStopWatch.x = (screenManager.SCREEN_WIDTH - ((_local1 + myStopWatch.width) / 2));
myStopWatch.y = 85;
addChild(myStopWatch);
tx_timeAdded.embedFonts = true;
tx_timeAdded.selectable = false;
tx_timeAdded.visible = false;
addChild(tx_timeAdded);
}
override public function clearStains(_arg1:int):void{
var _local2:int;
var _local3:clothesPin;
var _local4:int;
var _local5:int;
_local2 = int(iClothingCount.out());
super.clearStains(_arg1);
_local3 = null;
_local4 = 0;
while (_local4 < markedClothesPinArray.length) {
if (!clothesPin(markedClothesPinArray[_local4]).hasClothes()){
_local3 = clothesPin(markedClothesPinArray[_local4]);
};
_local4++;
};
_local5 = (int(iClothingCount.out()) - _local2);
if (_local5 > 0){
myStopWatch.addToTime(_local5);
};
}
override public function updateMatch():void{
if (myStopWatch.expired){
stopMatch();
} else {
if (!clothesLineFull()){
spawnClothing();
} else {
if (((clothesLineFull()) && (!(bStopWatchStarted)))){
bStopWatchStarted = true;
myStopWatch.startCountDown();
} else {
if (!checkAllColorMatches()){
resetBoard();
};
};
};
updateClothing();
};
super.updateMatch();
}
override public function update():void{
if (((tx_timeAdded.visible) && (((getTimer() - iVisibleTime) >= 2000)))){
tx_timeAdded.visible = false;
};
super.update();
}
public function resetBoard():void{
bStopWatchStarted = false;
clearBoard();
fn_state = waitUntilClear;
}
override public function stopMatch():void{
myStopWatch.stopCountDown();
super.stopMatch();
}
public function waitUntilClear():void{
var _local1:Boolean;
var _local2:int;
_local1 = false;
_local2 = 0;
while (_local2 < mc_renderLayers.length) {
if (gameObject(mc_renderLayers[_local2]).numChildren > 0){
_local1 = true;
};
_local2++;
};
if (!_local1){
fn_state = updateMatch;
};
}
override public function unpause(_arg1:MouseEvent):void{
if (bStopWatchStarted){
myStopWatch.startCountDown();
};
super.unpause(_arg1);
}
override public function reset():void{
myStopWatch.setCountDownTime(iTime);
bStopWatchStarted = false;
super.reset();
}
public function showTimeAdded(_arg1:int):void{
tx_timeAdded.x = (myStopWatch.x + myStopWatch.width);
tx_timeAdded.y = myStopWatch.y;
tx_timeAdded.htmlText = (("<font size='20' color='#ffff99' face='Arial'>+" + _arg1.toString()) + "</font>");
tx_timeAdded.visible = true;
iVisibleTime = getTimer();
}
override public function pause(_arg1:MouseEvent):void{
myStopWatch.stopCountDown();
super.pause(_arg1);
}
}
}//package src.matches
Section 39
//timedMatch (src.matches.timedMatch)
package src.matches {
import flash.events.*;
import game.*;
import flash.utils.*;
import src.screens.*;
import src.stopWatch.*;
public class timedMatch extends match {
private var bStopWatchStarted:Boolean;// = false
private var tm_restartTimer:Timer;
public var myStopWatch:stopWatch;// = null
private var iTimeRemaining:int;// = 0
public function timedMatch(_arg1:Number=0.5):void{
var _local2:int;
tm_restartTimer = new Timer(1000);
iTimeRemaining = 0;
myStopWatch = null;
bStopWatchStarted = false;
super();
iTimeRemaining = (_arg1 * 60);
myStopWatch = new stopWatch(iTimeRemaining, 1);
_local2 = (screenManager.SCREEN_WIDTH - (x + GAME_WIDTH));
myStopWatch.x = (screenManager.SCREEN_WIDTH - ((_local2 + myStopWatch.width) / 2));
myStopWatch.y = 85;
addChild(myStopWatch);
tm_restartTimer.addEventListener(TimerEvent.TIMER, restart, false, 0, true);
}
public function restart(_arg1:TimerEvent):void{
tm_restartTimer.reset();
fn_state = updateMatch;
}
override public function updateMatch():void{
super.updateMatch();
if (!myStopWatch.expired){
if (!clothesLineFull()){
spawnClothing();
} else {
if (((clothesLineFull()) && (!(bStopWatchStarted)))){
bStopWatchStarted = true;
myStopWatch.startCountDown();
} else {
if (!checkAllColorMatches()){
resetBoard();
};
};
};
updateClothing();
} else {
stopMatch();
};
}
public function timesUp():void{
stopMatch();
}
public function resetBoard():void{
bStopWatchStarted = false;
clearBoard();
fn_state = waitUntilClear;
}
override public function stopMatch():void{
myStopWatch.stopCountDown();
super.stopMatch();
}
public function waitUntilClear():void{
var _local1:Boolean;
var _local2:int;
_local1 = false;
_local2 = 0;
while (_local2 < mc_renderLayers.length) {
if (gameObject(mc_renderLayers[_local2]).numChildren > 0){
_local1 = true;
};
_local2++;
};
if (!_local1){
fn_state = updateMatch;
};
}
override public function reset():void{
myStopWatch.setCountDownTime(iTimeRemaining);
myStopWatch.startCountDown();
super.reset();
}
override public function kill():void{
tm_restartTimer.removeEventListener(TimerEvent.TIMER, restart);
super.kill();
}
override public function pause(_arg1:MouseEvent):void{
bStopWatchStarted = false;
myStopWatch.stopCountDown();
super.pause(_arg1);
}
}
}//package src.matches
Section 40
//bubble (src.particles.bubble)
package src.particles {
import game.*;
import flash.utils.*;
public class bubble extends gameObject {
private var nDecay:Number;// = 0.95
private var iDirectionX:Number;// = 0
private var iDirectionY:Number;// = 0
private var nSway:Number;
private var iCounter:int;// = 0
private var bInit:Boolean;// = false
public var iFloatSpeed:Number;// = 0
private static var iPrevMouseY:int = 0;
private static var iTimer:int = getTimer();
private static var iPrevMouseX:int = 0;
public function bubble():void{
iFloatSpeed = 0;
iCounter = 0;
nDecay = 0.95;
bInit = false;
iDirectionX = 0;
iDirectionY = 0;
nSway = (((Math.floor((Math.random() * 100)) + 20) / 200) * 0.5);
super();
mouseEnabled = false;
mouseChildren = false;
cacheAsBitmap = true;
}
override public function init():void{
if (iPrevMouseX == 0){
iPrevMouseX = parent.mouseX;
iPrevMouseY = parent.mouseY;
};
fn_state = float;
}
public function mouseCheck():void{
if ((getTimer() - iTimer) >= 100){
mousePosCheck(parent.mouseX, parent.mouseY);
};
if (distanceFormula(parent.mouseX, parent.mouseY) < 35){
iDirectionX = ((parent.mouseX - iPrevMouseX) / 10);
iDirectionY = ((iPrevMouseY - parent.mouseY) / 10);
};
}
override public function kill():void{
super.kill();
}
public function float():void{
mouseCheck();
x = (x + (Math.cos((iCounter * nSway)) + iDirectionX));
y = (y - (iFloatSpeed + iDirectionY));
iDirectionX = (iDirectionX * nDecay);
iDirectionY = (iDirectionY * nDecay);
iCounter++;
}
public static function mousePosCheck(_arg1:Number, _arg2:Number):void{
iPrevMouseX = _arg1;
iPrevMouseY = _arg2;
iTimer = getTimer();
}
}
}//package src.particles
Section 41
//scoreBubble (src.particles.scoreBubble)
package src.particles {
import flash.text.*;
import game.*;
import flash.geom.*;
import src.matches.*;
public class scoreBubble extends bubble {
private var nSpeedY:Number;
private var tx_text:TextField;
private var nDistanceX:Number;
private var nDistanceY:Number;
private var scale:int;
private var nDistance:Number;
private var originalSize:int;
private var firstMotion:Boolean;// = true
private var pt_destination:Point;
private var tx_time:TextField;
private var iScore:int;// = 0
private var nPercentage:Number;
private var nSpeed:Number;
private var nSpeedX:Number;
public function scoreBubble(_arg1:int, _arg2:int, _arg3:int, _arg4:Point):void{
var _local5:int;
iScore = 0;
tx_text = new TextField();
tx_time = new TextField();
nPercentage = (1 + 0.04);
firstMotion = true;
super();
cacheAsBitmap = true;
iScore = _arg3;
_local5 = Math.floor(((_arg3 / 10) * 1.5));
tx_text.embedFonts = true;
tx_text.htmlText = gameText.insertVariables(gameText.SCORE_BUBBLE_TEXT, "%", iScore);
tx_text.autoSize = TextFieldAutoSize.CENTER;
tx_text.x = -((tx_text.width / 2));
tx_text.y = -((tx_text.height / 2));
scale = ((tx_text.width / 2) + 5);
graphics.beginFill(0xAAAA);
graphics.drawCircle(0, 0, scale);
graphics.endFill();
graphics.beginFill(0xFFFFFF);
graphics.drawCircle((0.3 * scale), (-0.5 * scale), (0.3 * scale));
graphics.endFill();
x = 400;
y = 500;
tx_text.selectable = false;
addChild(tx_text);
pt_destination = _arg4;
nDistanceX = (pt_destination.x - x);
nDistanceY = (pt_destination.y - y);
nSpeedX = (nDistanceX / 500);
nSpeedY = (nDistanceY / 500);
nDistance = distanceFormula(pt_destination.x, pt_destination.y);
}
override public function float():void{
if ((((match(parent.parent).fn_state == match(parent.parent).updateMatch)) || ((match(parent.parent).fn_state == match(parent.parent).paused)))){
x = (x + nSpeedX);
y = (y + nSpeedY);
nSpeedX = (nSpeedX * nPercentage);
nSpeedY = (nSpeedY * nPercentage);
if ((((Math.abs((pt_destination.x - x)) < 10)) && ((Math.abs((pt_destination.y - y)) < 10)))){
match(parent.parent).updateScoreBoard(iScore);
kill();
};
} else {
match(parent.parent).setProperScore();
kill();
};
}
}
}//package src.particles
Section 42
//smoke (src.particles.smoke)
package src.particles {
import game.*;
import src.matches.*;
public class smoke extends gameObject {
private var nDirectionX:Number;
private var nDirectionY:Number;
public function smoke(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
mouseEnabled = false;
mouseChildren = false;
cacheAsBitmap = true;
x = _arg1;
y = _arg2;
nDirectionX = ((_arg3 * match.CLOTHES_WIDTH) / 10);
nDirectionY = ((_arg4 * match.CLOTHES_HEIGHT) / 10);
graphics.beginFill(0xFFFFFF);
graphics.drawRect(-20, -20, 40, 40);
graphics.endFill();
fn_state = disperse;
}
public function disperse():void{
x = (x + nDirectionX);
y = (y - nDirectionY);
scaleX = (scaleX - 0.02);
scaleY = (scaleY - 0.02);
rotation = (rotation + 5);
if (scaleX <= 0){
kill();
};
}
}
}//package src.particles
Section 43
//soapBubble (src.particles.soapBubble)
package src.particles {
import src.screens.*;
public class soapBubble extends bubble {
public static const GREEN:uint = 0x6600;
public static const PURPLE:uint = 7548604;
public static const ORANGE:uint = 16750641;
public static const RED:uint = 0x990000;
public static const PINK:uint = 16764159;
public static const BLUE:uint = 26367;
public static const YELLOW:uint = 0xEEEE00;
public static const BROWN:uint = 8865302;
public static const BLACK:uint = 0x333333;
public function soapBubble(_arg1:int=-10, _arg2:int=-10, _arg3:uint=16764159):void{
var _local4:Number;
super();
x = _arg1;
y = _arg2;
cacheAsBitmap = true;
_local4 = ((Math.random() * 8) + 1);
iFloatSpeed = -((Math.floor((Math.random() * 3)) + 1.5));
graphics.beginFill(_arg3);
graphics.drawCircle(0, 0, _local4);
graphics.endFill();
graphics.beginFill(0xFFFFFF);
graphics.drawCircle((0.3 * _local4), (-0.5 * _local4), (0.3 * _local4));
graphics.endFill();
}
override public function float():void{
super.float();
if (y > screenManager.SCREEN_HEIGHT){
kill();
};
}
}
}//package src.particles
Section 44
//splash (src.particles.splash)
package src.particles {
import game.*;
import src.screens.*;
public class splash extends gameObject {
private const nAccelY:Number = 0.9;
private var nSpeedY:Number;
private var nWidth:Number;
private var nHeight:Number;
private var nSpeedX:Number;
public function splash(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Number;
super();
cacheAsBitmap = true;
_local5 = ((Math.random() * 4) + 1);
graphics.beginFill(0xBBBB, 1);
graphics.drawCircle(0, 0, _local5);
graphics.endFill();
graphics.beginFill(0xFFFFFF, 0.3);
graphics.drawCircle((0.3 * _local5), (-0.5 * _local5), (0.3 * _local5));
graphics.endFill();
x = _arg1;
y = _arg2;
nSpeedX = (_arg3 / 6);
nSpeedY = _arg4;
fn_state = fall;
}
public function fall():void{
x = (x + nSpeedX);
y = (y - nSpeedY);
nSpeedY = (nSpeedY - nAccelY);
if (y > screenManager.SCREEN_HEIGHT){
kill();
};
}
}
}//package src.particles
Section 45
//waterBubble (src.particles.waterBubble)
package src.particles {
import src.screens.*;
public class waterBubble extends bubble {
override public function init():void{
var _local1:Number;
var _local2:Number;
cacheAsBitmap = true;
_local1 = ((Math.random() * 8) + 1);
setBubble();
_local2 = ((Math.random() * 0.5) + 0.3);
graphics.beginFill(0xBBBB);
graphics.drawCircle(0, 0, _local1);
graphics.endFill();
graphics.beginFill(0xFFFFFF);
graphics.drawCircle((0.3 * _local1), (-0.5 * _local1), (0.3 * _local1));
graphics.endFill();
fn_state = float;
}
override public function float():void{
super.float();
if (y <= -20){
setBubble();
};
}
public function setBubble():void{
iFloatSpeed = ((Math.random() * 3) + 0.1);
y = (Math.floor((Math.random() * 150)) + screenManager.SCREEN_HEIGHT);
x = (Math.floor((Math.random() * 400)) + 50);
}
}
}//package src.particles
Section 46
//drawing_surface (src.pieces.drawing_surface)
package src.pieces {
import flash.display.*;
import src.clothes.*;
import flash.geom.*;
public class drawing_surface extends Sprite {
private var iStartY:int;
private var bMouseDown:Boolean;// = false
private var colorArray:Array;
private var lineArray:Array;
private var iStartX:int;
public function drawing_surface():void{
var _local1:int;
bMouseDown = false;
lineArray = new Array(4);
colorArray = new Array(4);
super();
cacheAsBitmap = true;
_local1 = 0;
while (_local1 < lineArray.length) {
lineArray[_local1] = new Point(((_local1 * 3) - 6), ((_local1 * 3) - 6));
_local1++;
};
colorArray[clothing.ORANGE] = 16750641;
colorArray[clothing.PURPLE] = 7548604;
colorArray[clothing.RED] = 0x990000;
colorArray[clothing.GREEN] = 0x6600;
}
public function draw():void{
if (bMouseDown){
graphics.moveTo(iStartX, iStartY);
graphics.lineStyle(4, 16737955);
graphics.lineTo(mouseX, mouseY);
iStartX = mouseX;
iStartY = mouseY;
};
}
public function stopDraw():void{
bMouseDown = false;
graphics.clear();
}
public function startDraw():void{
bMouseDown = true;
iStartX = mouseX;
iStartY = mouseY;
}
}
}//package src.pieces
Section 47
//gameOver (src.pieces.gameOver)
package src.pieces {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import game.*;
import src.screens.*;
public class gameOver extends gameObject {
private var txtScore:TextField;
private var iStainCount:int;
private var mov:MovieClip;
private var txtScoreMsg:TextField;
private var btnInstructions:SimpleButton;
private var txtClothing:TextField;
private var movText:MovieClip;
private var txtStains:TextField;
private var iScore:int;
private var btnRetry:SimpleButton;
private var btnReturn:SimpleButton;
private var iClothingCount:int;
public var btnSubmit:SimpleButton;
private var btnOk:SimpleButton;
public function gameOver():void{
mov = new score_board();
super();
btnRetry = SimpleButton(mov.retry);
btnReturn = SimpleButton(mov.return_to_menu);
btnInstructions = SimpleButton(mov.instructions);
btnSubmit = SimpleButton(mov.submit);
btnOk = SimpleButton(mov.ok);
btnOk.visible = false;
txtScoreMsg = TextField(mov.score_msg);
txtScore = TextField(mov.tx_score);
txtStains = TextField(mov.tx_stains);
txtClothing = TextField(mov.tx_clothes);
movText = MovieClip(mov.score_main.score_text);
addChild(mov);
}
override public function init():void{
btnRetry.addEventListener(MouseEvent.CLICK, restartGame);
btnReturn.addEventListener(MouseEvent.CLICK, returnToMenu);
btnInstructions.addEventListener(MouseEvent.CLICK, viewInstructions);
btnSubmit.addEventListener(MouseEvent.CLICK, submitScore);
btnOk.addEventListener(MouseEvent.CLICK, moveOn);
super.init();
}
public function setScore(_arg1:int, _arg2:int, _arg3:int):void{
txtScore.htmlText = (("<font size='30' face='Arial'>" + _arg1.toString()) + "</font>");
txtStains.htmlText = (("<font size='30' face='Arial'>" + _arg2.toString()) + "</font>");
txtClothing.htmlText = (("<font size='30' face='Arial'>" + _arg3.toString()) + "</font>");
}
public function submitScore(_arg1:MouseEvent):void{
disableButtons();
hideText();
gameScreen(parent).submitScore();
fn_state = waitForScore;
}
public function moveOn(_arg1:MouseEvent):void{
enableButtons();
showText();
}
public function restartGame(_arg1:MouseEvent):void{
gameScreen(parent).restartGame();
}
public function disableButtons():void{
movText.visible = false;
txtScoreMsg.htmlText = gameText.SUBMITTING_SCORE;
btnSubmit.visible = false;
btnRetry.visible = false;
btnReturn.visible = false;
btnInstructions.visible = false;
}
public function hideText():void{
txtScore.visible = false;
txtStains.visible = false;
txtClothing.visible = false;
}
public function returnToMenu(_arg1:MouseEvent):void{
screen(parent).returnToMenu();
}
public function showText():void{
txtScore.visible = true;
txtStains.visible = true;
txtClothing.visible = true;
}
public function enableButtons():void{
txtScoreMsg.htmlText = "";
movText.visible = true;
btnOk.visible = false;
btnRetry.visible = true;
btnReturn.visible = true;
btnInstructions.visible = true;
}
public function waitForScore():void{
if (screenManager(parent.parent)._SYSTEM.serverHasResponded()){
txtScoreMsg.htmlText = screenManager(parent.parent)._SYSTEM.getServerResponse();
btnOk.visible = true;
fn_state = wait;
};
}
public function viewInstructions(_arg1:MouseEvent):void{
screen(parent).showInstructions();
}
}
}//package src.pieces
Section 48
//scrubber (src.pieces.scrubber)
package src.pieces {
import flash.display.*;
import game.*;
import src.matches.*;
import src.particles.*;
public class scrubber extends gameObject {
private var mc_graphic:MovieClip;
public function scrubber():void{
mc_graphic = new scrub_brush();
super();
cacheAsBitmap = true;
addChildAsRuntimeBitmap(mc_graphic);
fn_state = updateScrubber;
}
public function spawnBubbles():void{
var _local1:int;
var _local2:soapBubble;
_local1 = Math.floor((Math.random() * 5));
if ((((_local1 == 1)) && ((match.num_bubbles > 0)))){
_local2 = new soapBubble((Math.round((Math.random() * width)) + x), y);
match(parent).particleLayer.addChildAsRuntimeBitmap(_local2);
};
}
public function updateScrubber():void{
x = parent.mouseX;
y = parent.mouseY;
}
}
}//package src.pieces
Section 49
//cheatMenu (src.screens.cheatMenu)
package src.screens {
import flash.display.*;
import game.*;
import src.clothes.*;
import src.items.*;
public class cheatMenu extends MovieClip {
private var close:gameMenu;
private var myClothingMenu:gameMenu;
private var myItemMenu:gameMenu;
private var myStainMenu:gameMenu;
public function cheatMenu():void{
myItemMenu = new gameMenu(180, 40);
myClothingMenu = new gameMenu(180, 40);
myStainMenu = new gameMenu(180, 40);
close = new gameMenu(80, 40);
super();
myItemMenu.x = 10;
myItemMenu.y = 10;
myItemMenu.addNewButton("Toggle cats", function (){
itemManager.toggleItem(itemManager.CATS);
});
myItemMenu.addNewButton("Toggle bombs", function (){
itemManager.toggleItem(itemManager.BOMBS);
});
myItemMenu.addNewButton("Toggle inanimate objects", function (){
itemManager.toggleItem(itemManager.INANIMATE);
});
myItemMenu.addNewButton("Toggle squirrels", function (){
itemManager.toggleItem(itemManager.SQUIRRELS);
});
myItemMenu.addNewButton("Toggle impits", function (){
itemManager.toggleItem(itemManager.IMPIT);
});
myItemMenu.addNewButton("Toggle fungus", function (){
itemManager.toggleItem(itemManager.FUNGUS);
});
myItemMenu.addNewButton("Enable all items", itemManager.enableAllItems);
myItemMenu.addNewButton("Disable all items", itemManager.disableAllItems);
addChild(myItemMenu);
myClothingMenu.x = ((myItemMenu.x + myItemMenu.width) + 10);
myClothingMenu.y = 10;
myClothingMenu.addNewButton("Set clothing count to 1", function (){
clothingMgr.overrideClothingCount(1);
});
myClothingMenu.addNewButton("Set clothing count to 2", function (){
clothingMgr.overrideClothingCount(2);
});
myClothingMenu.addNewButton("Set clothing count to 3", function (){
clothingMgr.overrideClothingCount(3);
});
myClothingMenu.addNewButton("Set clothing count to 4", function (){
clothingMgr.overrideClothingCount(4);
});
myClothingMenu.addNewButton("Set clothing count to 5", function (){
clothingMgr.overrideClothingCount(5);
});
myClothingMenu.addNewButton("Set clothing count to 6", function (){
clothingMgr.overrideClothingCount(6);
});
myClothingMenu.addNewButton("Return clothing count to normal", clothingMgr.resetClothing);
addChild(myClothingMenu);
myStainMenu.x = ((myClothingMenu.x + myClothingMenu.width) + 10);
myStainMenu.y = 10;
myStainMenu.addNewButton("1 stain per clothing", function (){
stainMgr.overrideStainCount(1);
});
myStainMenu.addNewButton("2 stain per clothing", function (){
stainMgr.overrideStainCount(2);
});
myStainMenu.addNewButton("3 stain per clothing", function (){
stainMgr.overrideStainCount(3);
});
myStainMenu.addNewButton("4 stain per clothing", function (){
stainMgr.overrideStainCount(4);
});
myStainMenu.addNewButton("Set 3 different stain colors", function (){
stainMgr.overrideNumStainColors(3);
});
myStainMenu.addNewButton("Set 4 different stain colors", function (){
stainMgr.overrideNumStainColors(4);
});
myStainMenu.addNewButton("Reset stains per clothing", stainMgr.resetStains);
myStainMenu.addNewButton("Reset stain colors", stainMgr.resetNumStainColors);
addChild(myStainMenu);
close.addNewButton("Close menu<br>(Spacebar)", function (){
visible = false;
});
close.x = ((myStainMenu.x + myStainMenu.width) + 10);
close.y = 10;
addChild(close);
}
}
}//package src.screens
Section 50
//gameScreen (src.screens.gameScreen)
package src.screens {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import game.*;
import flash.geom.*;
import fl.transitions.*;
import flash.utils.*;
import com.meteorgames.libs.xvars.*;
import fl.transitions.easing.*;
import src.pieces.*;
import src.matches.*;
public class gameScreen extends screen {
private const TIMED:int = 3;
private const SURVIVAL:int = 1;
private const LEVEL:int = 2;
private const FREEPLAY:int = 4;
private var go_gameOverMsg:gameOver;
private var gameMatch:match;
private var tx_score:TextField;
private var myTween:Tween;
private var elenaTimer:Timer;
private var fps_counter:fps;
private var iScore:XVar;
private var mc_bubbleContainer:gameObject;
private var margin:int;// = 10
private var iMode:int;
private var mc_scorePanel:MovieClip;
private var bKeyDown:Boolean;// = false
private var mc_elena:MovieClip;
public function gameScreen(_arg1:Class, _arg2:Number=0):void{
var _local3:int;
var _local4:MovieClip;
var _local5:int;
var _local6:MovieClip;
var _local7:MovieClip;
margin = 10;
iScore = new XVar(0);
tx_score = new TextField();
mc_bubbleContainer = new gameObject();
mc_scorePanel = new scorepanel();
mc_elena = new elena();
elenaTimer = new Timer(int((1000 / 30)));
fps_counter = new fps();
go_gameOverMsg = new gameOver();
bKeyDown = false;
super();
cacheAsBitmap = true;
if ((((_arg1 == timedMatch)) && ((_arg2 > 0)))){
gameMatch = new _arg1(_arg2);
} else {
gameMatch = new (_arg1);
};
switch (_arg1){
case survivalMatch:
iMode = SURVIVAL;
break;
case levelMatch:
iMode = LEVEL;
break;
case timedMatch:
iMode = TIMED;
break;
default:
iMode = FREEPLAY;
break;
};
_local3 = int((Math.random() * 2));
if (_local3 == 1){
_local4 = new bg_day();
} else {
_local4 = new bg_dusk_dawn();
};
_local4.scaleX = 1.2;
_local4.scaleY = 1.2;
_local4.x = (screenManager.SCREEN_WIDTH / 2);
_local4.y = (screenManager.SCREEN_HEIGHT / 2);
addChildAsRuntimeBitmap(_local4);
setUp();
_local5 = 0;
while (_local5 < match.NUM_ROWS) {
_local7 = new clothesline();
_local7.y = (((_local5 * match.CLOTHES_HEIGHT) + gameMatch.y) + 2);
addChildAsRuntimeBitmap(_local7);
_local5++;
};
mc_scorePanel.cacheAsBitmap = true;
mc_scorePanel.x = (screenManager.SCREEN_WIDTH - (mc_scorePanel.width / 2));
mc_scorePanel.y = ((mc_scorePanel.height / 2) + 20);
addChildAsRuntimeBitmap(mc_scorePanel);
mc_elena.cacheAsBitmap = true;
mc_elena.x = ((screenManager.SCREEN_WIDTH - mc_elena.width) + 15);
mc_elena.y = ((screenManager.SCREEN_HEIGHT - mc_elena.height) + 50);
mc_elena.gotoAndStop(1);
addChildAsRuntimeBitmap(mc_elena);
addChild(gameMatch);
tx_score.embedFonts = true;
tx_score.selectable = false;
addChild(tx_score);
if (_local3 == 1){
_local6 = new foreground_weeds_day();
} else {
_local6 = new foreground_weeds_dusk();
};
_local6.mouseEnabled = false;
_local6.mouseChildren = false;
if (_arg1 != levelMatch){
_local6.x = ((screenManager.SCREEN_WIDTH / 2) + 15);
_local6.y = (screenManager.SCREEN_HEIGHT + 30);
_local6.cacheAsBitmap = true;
addChildAsRuntimeBitmap(_local6);
};
elenaTimer.addEventListener(TimerEvent.TIMER, updateElena, false, 0, true);
elenaTimer.start();
go_gameOverMsg.x = screenManager.SCREEN_WIDTH;
go_gameOverMsg.y = ((screenManager.SCREEN_HEIGHT - go_gameOverMsg.height) / 2);
addChild(go_gameOverMsg);
fps_counter.visible = false;
fps_counter.x = (screenManager.SCREEN_WIDTH - 60);
fps_counter.y = (screenManager.SCREEN_HEIGHT - 30);
}
public function toggleFPS():void{
if (((((Key.isDown(82)) && (Key.isDown(17)))) && (!(bKeyDown)))){
fps_counter.visible = !(fps_counter.visible);
bKeyDown = true;
} else {
if (((!(Key.isDown(82))) || (!(Key.isDown(17))))){
bKeyDown = false;
};
};
}
override public function init():void{
focusRect = false;
startNewMatch();
super.init();
}
public function showGameOver():void{
myTween = new Tween(go_gameOverMsg, "x", Regular.easeOut, screenManager.SCREEN_WIDTH, ((screenManager.SCREEN_WIDTH - go_gameOverMsg.width) / 2), 0.75, true);
}
public function updateElena(_arg1:TimerEvent):void{
if (MovieClip(mc_elena.elena_figure).currentFrame != MovieClip(mc_elena.elena_figure).totalFrames){
MovieClip(mc_elena.elena_figure).nextFrame();
} else {
MovieClip(mc_elena.elena_figure).gotoAndStop(1);
};
}
public function setScore():void{
iScore.set(gameMatch.score);
updateScore();
}
public function reset(_arg1:TweenEvent):void{
go_gameOverMsg.btnSubmit.visible = true;
myTween.removeEventListener(TweenEvent.MOTION_FINISH, reset);
updateScore();
gameMatch.reset();
startNewMatch();
}
public function startNewMatch():void{
iScore.set(0);
updateScore();
gameMatch.fn_state = gameMatch.updateMatch;
screenManager(parent)._SYSTEM.logGameStart(iMode);
}
override public function kill():void{
if (myTween.hasEventListener(TweenEvent.MOTION_FINISH)){
myTween.removeEventListener(TweenEvent.MOTION_FINISH, reset);
};
elenaTimer.stop();
elenaTimer.removeEventListener(TimerEvent.TIMER, updateElena);
super.kill();
}
public function restartGame():void{
myTween.continueTo(screenManager.SCREEN_WIDTH, 0.75);
myTween.addEventListener(TweenEvent.MOTION_FINISH, reset, false, 0, true);
}
public function endGame():void{
iScore.set(gameMatch.score);
updateScore();
go_gameOverMsg.setScore(gameMatch.score, gameMatch.stainCount, gameMatch.clothingCount);
screenManager(parent)._SYSTEM.logGameOver(iMode);
showGameOver();
}
override public function update():void{
toggleFPS();
super.update();
}
public function updateScore(_arg1:int=0):void{
if (_arg1 > 0){
iScore.add(_arg1);
};
tx_score.htmlText = (("<font size='24' color='#ffffff' face='Arial'>Score: " + int(iScore.out()).toString()) + "</font>");
tx_score.autoSize = TextFieldAutoSize.LEFT;
tx_score.x = (mc_scorePanel.x - (tx_score.width / 2));
}
public function getScoreLocation():Point{
return (new Point((tx_score.x + (tx_score.width / 2)), (tx_score.y + (tx_score.height / 2))));
}
public function submitScore():void{
screenManager(parent)._SYSTEM.postPoints(int(iScore.out()), iMode);
}
public function setUp():void{
gameMatch.x = margin;
gameMatch.y = margin;
tx_score.y = 56;
}
}
}//package src.screens
Section 51
//instructionsScreen (src.screens.instructionsScreen)
package src.screens {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import game.*;
import flash.utils.*;
import src.demo.*;
public class instructionsScreen extends screen {
private var demoGraphic:demo;
private var mc_instructions:MovieClip;
private var animTimer:Timer;
public function instructionsScreen():void{
var _local1:int;
var _local2:DisplayObject;
demoGraphic = new demo();
mc_instructions = new instructions();
animTimer = new Timer(int((1000 / 30)));
super();
addChild(mc_instructions);
_local1 = 0;
while (_local1 < mc_instructions.numChildren) {
_local2 = mc_instructions.getChildAt(_local1);
if ((_local2 is MovieClip)){
MovieClip(_local2).stop();
};
_local1++;
};
addChildAsRuntimeBitmap(demoGraphic);
animTimer.addEventListener(TimerEvent.TIMER, updateAnim);
animTimer.start();
}
public function showMenu(_arg1:MouseEvent):void{
super.returnToMenu();
}
override public function init():void{
TextField(mc_instructions.main_text).htmlText = gameText.INSTRUCTIONS_TEXT;
TextField(mc_instructions.main_text).autoSize = TextFieldAutoSize.LEFT;
demoGraphic.x = TextField(mc_instructions.main_text).x;
demoGraphic.y = ((TextField(mc_instructions.main_text).y + TextField(mc_instructions.main_text).height) + 20);
TextField(mc_instructions.cat_text).htmlText = gameText.CAT_TEXT;
TextField(mc_instructions.bomb_text).htmlText = gameText.BOMB_TEXT;
TextField(mc_instructions.inanimate_text).htmlText = gameText.INANIMATE_TEXT;
TextField(mc_instructions.squirrel_text).htmlText = gameText.SQUIRREL_TEXT;
TextField(mc_instructions.impit_text).htmlText = gameText.IMPIT_TEXT;
TextField(mc_instructions.fungus_text).htmlText = gameText.FUNGUS_TEXT;
SimpleButton(mc_instructions.return_btn).addEventListener(MouseEvent.CLICK, showMenu);
super.init();
}
public function updateAnim(_arg1:TimerEvent):void{
var _local2:int;
var _local3:DisplayObject;
_local2 = 0;
while (_local2 < mc_instructions.numChildren) {
_local3 = mc_instructions.getChildAt(_local2);
if ((_local3 is MovieClip)){
if (MovieClip(_local3).currentFrame != MovieClip(_local3).totalFrames){
MovieClip(_local3).nextFrame();
} else {
MovieClip(_local3).gotoAndStop(1);
};
};
_local2++;
};
}
}
}//package src.screens
Section 52
//matchPage (src.screens.matchPage)
package src.screens {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import game.*;
import src.matches.*;
public class matchPage extends screen {
private var mov:MovieClip;
public function matchPage():void{
mov = new match_page();
super();
addChild(mov);
SimpleButton(mov.survival_mode).addEventListener(MouseEvent.MOUSE_OVER, showSurvivalInstructions);
SimpleButton(mov.level_mode).addEventListener(MouseEvent.MOUSE_OVER, showLevelInstructions);
SimpleButton(mov.survival_mode).addEventListener(MouseEvent.ROLL_OUT, hideInstructions);
SimpleButton(mov.level_mode).addEventListener(MouseEvent.ROLL_OUT, hideInstructions);
SimpleButton(mov.survival_mode).addEventListener(MouseEvent.CLICK, newSurvivalGame);
SimpleButton(mov.level_mode).addEventListener(MouseEvent.CLICK, newLevelGame);
SimpleButton(mov.return_btn).addEventListener(MouseEvent.CLICK, showMenu);
SimpleButton(mov.bubbles_on_btn).addEventListener(MouseEvent.CLICK, bubbles_off);
SimpleButton(mov.bubbles_off_btn).addEventListener(MouseEvent.CLICK, bubbles_on);
SimpleButton(mov.bubbles_off_btn).visible = false;
}
public function showMenu(_arg1:MouseEvent):void{
super.returnToMenu();
}
public function hideInstructions(_arg1:MouseEvent):void{
TextField(mov.tx_description).htmlText = "";
}
public function newSurvivalGame(_arg1:MouseEvent):void{
screenManager.playSound(screenManager.sBubbleSquirt);
super.startSurvivalGame();
}
public function bubbles_off(_arg1:MouseEvent):void{
match.bubbles_off();
SimpleButton(mov.bubbles_on_btn).visible = false;
SimpleButton(mov.bubbles_off_btn).visible = true;
}
public function showSurvivalInstructions(_arg1:MouseEvent):void{
TextField(mov.tx_description).htmlText = gameText.SURVIVAL_MODE;
}
public function bubbles_on(_arg1:MouseEvent):void{
match.bubbles_on();
SimpleButton(mov.bubbles_on_btn).visible = true;
SimpleButton(mov.bubbles_off_btn).visible = false;
}
public function showLevelInstructions(_arg1:MouseEvent):void{
TextField(mov.tx_description).htmlText = gameText.LEVEL_MODE;
}
public function newLevelGame(_arg1:MouseEvent):void{
screenManager.playSound(screenManager.sBubbleSquirt);
super.startLevelGame();
}
}
}//package src.screens
Section 53
//screen (src.screens.screen)
package src.screens {
import game.*;
import src.matches.*;
public class screen extends gameObject {
public var myMenu:gameMenu;
public function screen():void{
myMenu = new gameMenu();
super();
}
public function startFreePlayGame():void{
screenManager(parent).startMatch(freePlay);
}
public function startLevelGame():void{
screenManager(parent).startMatch(levelMatch);
}
public function showInstructions():void{
screenManager(parent).showInstructionScreen();
}
public function startFiveMinGame():void{
screenManager(parent).startMatch(timedMatch, 5);
}
public function showMatches():void{
screenManager(parent).showMatchPage();
}
public function startTwoMinGame():void{
screenManager(parent).startMatch(timedMatch, 2);
}
public function returnToPrevScreen():void{
screenManager(parent).returnToPrevScreen();
}
public function setUpMenu():void{
myMenu.x = ((screenManager.SCREEN_WIDTH - myMenu.width) - 20);
myMenu.y = ((screenManager.SCREEN_HEIGHT - myMenu.height) - 20);
addChild(myMenu);
}
public function returnToMenu():void{
screenManager(parent).showStartScreen();
}
public function startSurvivalGame():void{
screenManager(parent).startMatch(survivalMatch);
}
}
}//package src.screens
Section 54
//screenManager (src.screens.screenManager)
package src.screens {
import flash.text.*;
import com.meteorgames.libs.sound.*;
import flash.events.*;
import game.*;
import flash.utils.*;
import com.meteorgames.flashsystem.game.*;
public class screenManager extends GameInterface {
private var bMusic:Boolean;// = true
private var sCurrentTheme:String;
private var activeScreen:gameObject;// = null
private var myStartScreen:startScreen;
private var previousScreen:gameObject;// = null
private var myMatchScreen:matchPage;
private var myInstructionsScreen:instructionsScreen;
public var fn_state:Function;// = null
private var cFPS:fps;
private var iScore:int;// = 0
private var gameMatchType:Class;
private var bMusicPlaying:Boolean;// = false
private var time:int;
private var gameTime:Number;// = 0
public static const sCatMeow:String = "Cat Meow";
public static const sCatAnnoyed:String = "Cat Annoyed";
public static const sSquirrelEscaping:String = "Squirrel Running";
public static const sClothRelease2:String = "Cloth Release2";
public static const sClothRelease3:String = "Cloth Release3";
public static const sSquirrelChatter2:String = "Squirrel Chitter 2";
public static const sSquirrelChatter4:String = "Squirrel Chitter 4";
public static const sAxTing:String = "Axe Ting";
public static const sSquirrelChatter1:String = "Squirrel Chitter 1";
public static const sSquirrelChatter3:String = "Squirrel Chitter 3";
public static const sClothRelease1:String = "Cloth Release1";
public static const sCatBeg:String = "Cat Beg";
public static const sShieldBang:String = "Shield Bang";
public static const catIdleSounds:Array = new Array(sCatPlead, sCatBeg, sCatAnnoyed);
public static const sCatPlead:String = "Cat Plead";
public static const sRockThud:String = "Rock Thud";
public static const sClothRelease4:String = "Cloth Release4";
public static const sHugeSplash:String = "Huge Splash";
public static const sMediumSplash:String = "Medium Splash";
public static const sBigSplash:String = "Big Splash";
public static const sSmallSplash:String = "Small Splash";
public static const clothesSndArray:Array = new Array(sClothRelease1, sClothRelease2, sClothRelease3, sClothRelease4);
public static const sExplosion:String = "Explosion";
public static const sBubbleBloop:String = "Bubble Gloop";
public static const SQUIRREL_SOUNDS:Array = new Array(sSquirrelChatter1, sSquirrelChatter2, sSquirrelChatter3, sSquirrelChatter4);
public static const sCatSound:String = "Cat Scream";
public static const sBubbleSquirt:String = "Bubble Squirt";
private static var myCheatMenu:cheatMenu = new cheatMenu();
public static var sTheme:String = "LoL Theme";
private static var bMouseDown:Boolean = false;
private static var screen_width:int;
private static var bSound:Boolean = true;
private static var bMenuVisible:Boolean = false;
private static var screen_height:int;
public static var sndMgr:SoundManager = new SoundManager();
public function screenManager():void{
activeScreen = null;
previousScreen = null;
iScore = 0;
myStartScreen = new startScreen();
myInstructionsScreen = new instructionsScreen();
myMatchScreen = new matchPage();
gameTime = 0;
fn_state = null;
time = getTimer();
bMusic = true;
bMusicPlaying = false;
cFPS = new fps("#000000");
super();
focusRect = false;
tabEnabled = false;
tabChildren = false;
addEventListener(Event.ENTER_FRAME, update);
fn_state = interfaceInit;
sndMgr.addMusic(new lol_theme(), sTheme);
sndMgr.addFX(new cat_scream(), sCatSound, false);
sndMgr.addFX(new cat_meow(), sCatMeow, false);
sndMgr.addFX(new cat_plead(), sCatPlead, false);
sndMgr.addFX(new cat_beg(), sCatBeg, false);
sndMgr.addFX(new cat_annoyed(), sCatAnnoyed, false);
sndMgr.addFX(new deep_explosion(), sExplosion, true);
sndMgr.addFX(new splash_small(), sSmallSplash, false);
sndMgr.addFX(new splash_medium(), sMediumSplash, false);
sndMgr.addFX(new splash_big(), sBigSplash, false);
sndMgr.addFX(new splash_huge(), sHugeSplash, false);
sndMgr.addFX(new squirrel_chitter1(), sSquirrelChatter1, true);
sndMgr.addFX(new squirrel_chitter2(), sSquirrelChatter2, true);
sndMgr.addFX(new squirrel_chitter3(), sSquirrelChatter3, true);
sndMgr.addFX(new squirrel_chitter4(), sSquirrelChatter4, true);
sndMgr.addFX(new squirrel_escaping(), sSquirrelEscaping, true);
sndMgr.addFX(new cloth_release1(), sClothRelease1, false);
sndMgr.addFX(new cloth_release2(), sClothRelease2, false);
sndMgr.addFX(new cloth_release3(), sClothRelease3, false);
sndMgr.addFX(new cloth_release4(), sClothRelease4, false);
sndMgr.addFX(new shield_bang(), sShieldBang, false);
sndMgr.addFX(new rock_thud(), sRockThud, false);
sndMgr.addFX(new ax_ting(), sAxTing, false);
sndMgr.addFX(new bubble_squirt(), sBubbleSquirt, false);
sndMgr.addFX(new bubble_bloop(), sBubbleBloop, false);
}
public function musicOn():void{
sndMgr.playMusic(sCurrentTheme, 0, 9999, 0);
sndMgr.fadeMusic(sCurrentTheme, 1, 0, 1500);
bMusic = true;
}
public function showMenu(){
myCheatMenu.visible = true;
}
public function mouseUp(_arg1:MouseEvent):void{
bMouseDown = false;
}
public function showInstructionScreen():void{
checkActiveScreen();
activeScreen = myInstructionsScreen;
activeScreen.visible = true;
}
public function getKey():void{
if (((((Key.isDown(192)) && (Key.isDown(17)))) && (!(myCheatMenu.visible)))){
showMenu();
} else {
if (((Key.isDown(32)) && (myCheatMenu.visible))){
hideMenu();
};
};
}
public function removeMe():void{
removeEventListener(Event.ENTER_FRAME, update);
parent.removeChild(this);
}
public function musicOff():void{
sndMgr.fadeMusic(sCurrentTheme, 0, 1, 500);
bMusic = false;
}
public function waitForSystem():void{
var _local1:String;
var _local2:StyleSheet;
if (systemReady){
addChild(myMatchScreen);
addChild(myStartScreen);
addChild(myInstructionsScreen);
fn_state = null;
myMatchScreen.visible = false;
myStartScreen.visible = false;
myInstructionsScreen.visible = false;
showStartScreen();
previousScreen = activeScreen;
root.stage.focus = this;
addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
addEventListener(MouseEvent.MOUSE_UP, mouseUp);
myCheatMenu.visible = false;
addChild(myCheatMenu);
sCurrentTheme = sTheme;
sndMgr.playMusic(sCurrentTheme, 0, 9999, 1);
cFPS.y = (SCREEN_HEIGHT - 20);
cFPS.cacheAsBitmap = true;
addChild(cFPS);
if (((_SYSTEM.gameIsHostedExternally) || (_SYSTEM.gameIsOffline))){
_local1 = "a:link{text-decoration:underline;color:#FFFFFF;} a:hover{text-decoration:underline;color:#FFFF00;} a:active{text-decoration:underline;color:#FFFF00;}";
_local2 = new StyleSheet();
_local2.parseCSS(_local1);
myStartScreen.txtLegal.styleSheet = _local2;
myStartScreen.txtLegal.htmlText = _SYSTEM.getLegalText(12);
};
};
}
public function soundOn():void{
bSound = true;
}
public function showMatchPage():void{
activeScreen.visible = false;
activeScreen = myMatchScreen;
activeScreen.visible = true;
}
public function startMatch(_arg1:Class, _arg2:Number=0):void{
gameMatchType = _arg1;
gameTime = _arg2;
activeScreen.visible = false;
activeScreen = new gameScreen(gameMatchType, gameTime);
addChildAt(activeScreen, (getChildIndex(myCheatMenu) - 1));
}
public function showStartScreen():void{
checkActiveScreen();
activeScreen = myStartScreen;
activeScreen.visible = true;
}
public function checkActiveScreen():void{
if (activeScreen != null){
activeScreen.visible = false;
previousScreen = activeScreen;
activeScreen = null;
};
}
public function returnToPrevScreen():void{
var _local1:gameObject;
_local1 = activeScreen;
activeScreen = previousScreen;
previousScreen = _local1;
previousScreen.visible = false;
activeScreen.visible = true;
}
public function getKeyCode(_arg1:KeyboardEvent):void{
var _local2:Function;
_local2 = getKey;
}
public function hideMenu(){
myCheatMenu.visible = false;
}
public function update(_arg1:Event):void{
if (myCheatMenu.visible){
bMenuVisible = true;
} else {
bMenuVisible = false;
};
if (fn_state != null){
fn_state.call();
};
if (systemReady){
cFPS.update();
if (activeScreen){
activeScreen.update();
};
};
}
public function soundOff():void{
bSound = false;
}
public function interfaceInit():void{
if (loaderInfo.bytesLoaded < loaderInfo.bytesTotal){
} else {
super.initGame();
Key.initialize(stage);
screen_width = 682;
screen_height = 600;
fn_state = waitForSystem;
};
}
public function mouseDown(_arg1:MouseEvent):void{
if (myCheatMenu.visible){
bMouseDown = false;
} else {
bMouseDown = true;
};
}
public function restartMatch():void{
activeScreen.kill();
activeScreen = new gameScreen(gameMatchType, gameTime);
addChildAt(activeScreen, (getChildIndex(myCheatMenu) - 1));
}
public static function get MOUSE_DOWN():Boolean{
return (bMouseDown);
}
public static function get SCREEN_WIDTH():int{
return (screen_width);
}
public static function playSound(_arg1:String){
if (bSound){
sndMgr.playFX(_arg1);
};
}
public static function get SCREEN_HEIGHT():int{
return (screen_height);
}
public static function get MENU_VISIBLE():Boolean{
return (bMenuVisible);
}
}
}//package src.screens
Section 55
//startScreen (src.screens.startScreen)
package src.screens {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import game.*;
import flash.utils.*;
import src.matches.*;
public class startScreen extends screen {
public var musicOnBtn:SimpleButton;
public var txtLegal:TextField;
public var soundOnBtn:SimpleButton;
public var musicOffBtn:SimpleButton;
private var btn_play:SimpleButton;
private var myGameMenu:gameMenu;
private var sndMenu:gameMenu;
public var soundOffBtn:SimpleButton;
private var btn_instructions:SimpleButton;
private var mc_logo:MovieClip;
private var time:int;
private var mc_startMov:MovieClip;
private var myTimer:Timer;
public function startScreen():void{
myGameMenu = new gameMenu();
mc_startMov = new start_page();
mc_logo = new logo_anim();
myTimer = new Timer((1000 / 30));
time = getTimer();
sndMenu = new gameMenu(100, 20, false);
super();
txtLegal = TextField(mc_startMov.tfLegal);
}
override public function init():void{
mc_logo.x = 177.3;
mc_logo.y = 347;
mc_startMov.stop();
mc_logo.stop();
addChild(mc_startMov);
addChild(mc_logo);
btn_play = SimpleButton(mc_startMov.play_button);
btn_play.addEventListener(MouseEvent.CLICK, showMatchPage);
btn_instructions = SimpleButton(mc_startMov.instructions_button);
btn_instructions.addEventListener(MouseEvent.CLICK, showInstructionsPage);
myGameMenu.x = ((screenManager.SCREEN_WIDTH - myGameMenu.width) - 20);
myGameMenu.y = ((screenManager.SCREEN_HEIGHT - myGameMenu.height) - 20);
musicOnBtn = SimpleButton(mc_startMov.music_on_btn);
musicOffBtn = SimpleButton(mc_startMov.music_off_btn);
soundOnBtn = SimpleButton(mc_startMov.sound_on_btn);
soundOffBtn = SimpleButton(mc_startMov.sound_off_btn);
musicOnBtn.addEventListener(MouseEvent.CLICK, turnMusicOff, false, 0, true);
musicOffBtn.addEventListener(MouseEvent.CLICK, turnMusicOn, false, 0, true);
soundOnBtn.addEventListener(MouseEvent.CLICK, turnSoundOff, false, 0, true);
soundOffBtn.addEventListener(MouseEvent.CLICK, turnSoundOn, false, 0, true);
musicOffBtn.visible = false;
soundOffBtn.visible = false;
myTimer.addEventListener(TimerEvent.TIMER, updateAnim, false, 0, true);
myTimer.start();
super.init();
}
public function newSurvivalGame(_arg1:MouseEvent):void{
screenManager.playSound(screenManager.sBubbleSquirt);
myTimer.stop();
super.startSurvivalGame();
}
public function turnSoundOn(_arg1:MouseEvent):void{
soundOnBtn.visible = true;
soundOffBtn.visible = false;
screenManager(parent).soundOn();
}
override public function wait():void{
if (!myTimer.running){
myTimer.start();
};
super.wait();
}
override public function kill():void{
myTimer.stop();
myTimer.removeEventListener(TimerEvent.TIMER, updateAnim);
super.kill();
}
public function showMatchPage(_arg1:MouseEvent):void{
myTimer.stop();
super.showMatches();
}
public function turnSoundOff(_arg1:MouseEvent):void{
soundOnBtn.visible = false;
soundOffBtn.visible = true;
screenManager(parent).soundOff();
}
public function turnMusicOff(_arg1:MouseEvent):void{
musicOnBtn.visible = false;
musicOffBtn.visible = true;
screenManager(parent).musicOff();
}
public function updateAnim(_arg1:TimerEvent){
var _local2:int;
var _local3:DisplayObject;
if (mc_startMov.currentFrame != mc_startMov.totalFrames){
mc_startMov.nextFrame();
} else {
mc_startMov.gotoAndStop(1);
};
_local2 = 0;
while (_local2 < mc_startMov.numChildren) {
_local3 = mc_startMov.getChildAt(_local2);
if ((_local3 is MovieClip)){
if (MovieClip(_local3).currentFrame != MovieClip(_local3).totalFrames){
MovieClip(_local3).nextFrame();
} else {
MovieClip(_local3).gotoAndStop(1);
};
};
_local2++;
};
if (mc_logo.currentFrame != mc_logo.totalFrames){
mc_logo.nextFrame();
};
}
public function turnMusicOn(_arg1:MouseEvent):void{
musicOnBtn.visible = true;
musicOffBtn.visible = false;
screenManager(parent).musicOn();
}
public function showInstructionsPage(_arg1:MouseEvent):void{
myTimer.stop();
super.showInstructions();
}
}
}//package src.screens
Section 56
//stopWatch (src.stopWatch.stopWatch)
package src.stopWatch {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import flash.utils.*;
public class stopWatch extends MovieClip {
private var timeFormat:int;// = 0
private var iMinutes:int;
private var timeOver:Boolean;// = false
private var tf_textFormat:TextFormat;
private var tx_time:TextField;
private var iSeconds:int;
private var tm_timer:Timer;
public static const MINUTES = 1;
public static const SECONDS = 0;
public function stopWatch(_arg1:int=0, _arg2:int=0):void{
tx_time = new TextField();
timeOver = false;
timeFormat = SECONDS;
tf_textFormat = new TextFormat();
super();
cacheAsBitmap = true;
timeFormat = _arg2;
tf_textFormat.align = "center";
if (((!((timeFormat == MINUTES))) && (!((timeFormat == SECONDS))))){
throw (new Error("Invalid format specified for stopWatch! Please either set it to stopWatch.SECONDS or stopWatch.MINUTES"));
};
tx_time.selectable = false;
tx_time.embedFonts = true;
addChild(tx_time);
tm_timer = new Timer(1000);
if (_arg1 > 0){
setCountDownTime(_arg1);
};
}
public function addToTime(_arg1:int):void{
if (!expired){
tm_timer.repeatCount = (tm_timer.repeatCount + _arg1);
updateTime();
};
}
public function get format():int{
return (timeFormat);
}
public function startCountDown():void{
if ((tm_timer.repeatCount - tm_timer.currentCount) <= 0){
throw (new Error("Error in StartCountDown: You haven't set up the time yet!"));
};
tm_timer.start();
}
public function get expired():Boolean{
return (timeOver);
}
public function updateTime():void{
var _local1:String;
var _local2:String;
if (timeFormat == SECONDS){
tx_time.embedFonts = true;
tx_time.htmlText = "<font size='20' color='#ffffff' face='Arial'>Time: ";
if ((tm_timer.repeatCount - tm_timer.currentCount) < 10){
tx_time.htmlText = (tx_time.htmlText + "0");
};
tx_time.htmlText = (tx_time.htmlText + (int((tm_timer.repeatCount - tm_timer.currentCount)).toString() + "</font>"));
} else {
if (timeFormat == MINUTES){
iMinutes = ((tm_timer.repeatCount - tm_timer.currentCount) / 60);
iSeconds = ((tm_timer.repeatCount - tm_timer.currentCount) % 60);
_local1 = iMinutes.toString();
if (iSeconds >= 10){
_local2 = iSeconds.toString();
} else {
_local2 = ("0" + iSeconds.toString());
};
tx_time.htmlText = (((("<font size='20' color='#ffffff' face='Arial'>" + _local1) + ":") + _local2) + "</font>");
};
};
tx_time.autoSize = TextFieldAutoSize.LEFT;
tx_time.setTextFormat(tf_textFormat);
tx_time.x = 0;
tx_time.y = 0;
}
public function stopCountDown():void{
tm_timer.stop();
}
public function setCountDownTime(_arg1:int):void{
timeOver = false;
tm_timer.reset();
tm_timer.repeatCount = _arg1;
updateTime();
if (!tm_timer.hasEventListener(TimerEvent.TIMER)){
tm_timer.addEventListener(TimerEvent.TIMER, updateCountDown, false, 0, true);
tm_timer.addEventListener(TimerEvent.TIMER_COMPLETE, timeExpired, false, 0, true);
};
}
public function updateCountDown(_arg1:TimerEvent):void{
updateTime();
}
public function timeExpired(_arg1:TimerEvent):void{
timeOver = true;
tm_timer.removeEventListener(TimerEvent.TIMER, updateCountDown);
tm_timer.removeEventListener(TimerEvent.TIMER_COMPLETE, timeExpired);
tm_timer.reset();
}
public function set format(_arg1:int):void{
if (((!((_arg1 == MINUTES))) && (!((_arg1 == SECONDS))))){
throw (new Error("Invalid format specified for stopWatch! Please either set it to stopWatch.SECONDS or stopWatch.MINUTES."));
};
timeFormat = _arg1;
}
}
}//package src.stopWatch
Section 57
//_Arial (_Arial)
package {
import flash.text.*;
public dynamic class _Arial extends Font {
}
}//package
Section 58
//ax (ax)
package {
import flash.display.*;
public dynamic class ax extends MovieClip {
}
}//package
Section 59
//ax_ting (ax_ting)
package {
import flash.media.*;
public dynamic class ax_ting extends Sound {
}
}//package
Section 60
//bg_day (bg_day)
package {
import flash.display.*;
public dynamic class bg_day extends MovieClip {
}
}//package
Section 61
//bg_dusk_dawn (bg_dusk_dawn)
package {
import flash.display.*;
public dynamic class bg_dusk_dawn extends MovieClip {
}
}//package
Section 62
//Black_stain (Black_stain)
package {
import flash.display.*;
public dynamic class Black_stain extends MovieClip {
}
}//package
Section 63
//bloomers (bloomers)
package {
import flash.display.*;
public dynamic class bloomers extends MovieClip {
}
}//package
Section 64
//boxers (boxers)
package {
import flash.display.*;
public dynamic class boxers extends MovieClip {
}
}//package
Section 65
//Brown_stain (Brown_stain)
package {
import flash.display.*;
public dynamic class Brown_stain extends MovieClip {
}
}//package
Section 66
//bubble_bloop (bubble_bloop)
package {
import flash.media.*;
public dynamic class bubble_bloop extends Sound {
}
}//package
Section 67
//bubble_squirt (bubble_squirt)
package {
import flash.media.*;
public dynamic class bubble_squirt extends Sound {
}
}//package
Section 68
//cat_annoyed (cat_annoyed)
package {
import flash.media.*;
public dynamic class cat_annoyed extends Sound {
}
}//package
Section 69
//cat_beg (cat_beg)
package {
import flash.media.*;
public dynamic class cat_beg extends Sound {
}
}//package
Section 70
//cat_meow (cat_meow)
package {
import flash.media.*;
public dynamic class cat_meow extends Sound {
}
}//package
Section 71
//cat_plead (cat_plead)
package {
import flash.media.*;
public dynamic class cat_plead extends Sound {
}
}//package
Section 72
//cat_scream (cat_scream)
package {
import flash.media.*;
public dynamic class cat_scream extends Sound {
}
}//package
Section 73
//cloth_release1 (cloth_release1)
package {
import flash.media.*;
public dynamic class cloth_release1 extends Sound {
}
}//package
Section 74
//cloth_release2 (cloth_release2)
package {
import flash.media.*;
public dynamic class cloth_release2 extends Sound {
}
}//package
Section 75
//cloth_release3 (cloth_release3)
package {
import flash.media.*;
public dynamic class cloth_release3 extends Sound {
}
}//package
Section 76
//cloth_release4 (cloth_release4)
package {
import flash.media.*;
public dynamic class cloth_release4 extends Sound {
}
}//package
Section 77
//clothesline (clothesline)
package {
import flash.display.*;
public dynamic class clothesline extends MovieClip {
}
}//package
Section 78
//deep_explosion (deep_explosion)
package {
import flash.media.*;
public dynamic class deep_explosion extends Sound {
}
}//package
Section 79
//dress (dress)
package {
import flash.display.*;
public dynamic class dress extends MovieClip {
}
}//package
Section 80
//elena (elena)
package {
import flash.display.*;
public dynamic class elena extends MovieClip {
public var elena_figure:MovieClip;
public function elena(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 81
//foreground_weeds_day (foreground_weeds_day)
package {
import flash.display.*;
public dynamic class foreground_weeds_day extends MovieClip {
}
}//package
Section 82
//foreground_weeds_dusk (foreground_weeds_dusk)
package {
import flash.display.*;
public dynamic class foreground_weeds_dusk extends MovieClip {
}
}//package
Section 83
//Green_stain (Green_stain)
package {
import flash.display.*;
public dynamic class Green_stain extends MovieClip {
}
}//package
Section 84
//instructions (instructions)
package {
import flash.display.*;
import flash.text.*;
public dynamic class instructions extends MovieClip {
public var main_text:TextField;
public var fungus_text:TextField;
public var squirrel_text:TextField;
public var inanimate_text:TextField;
public var impit_text:TextField;
public var bomb_text:TextField;
public var return_btn:SimpleButton;
public var cat_text:TextField;
public function instructions(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 85
//logo_anim (logo_anim)
package {
import flash.display.*;
public dynamic class logo_anim extends MovieClip {
}
}//package
Section 86
//lol_theme (lol_theme)
package {
import flash.media.*;
public dynamic class lol_theme extends Sound {
}
}//package
Section 87
//match_page (match_page)
package {
import flash.display.*;
import flash.text.*;
public dynamic class match_page extends MovieClip {
public var survival_mode:play_BTN;
public var level_mode:SimpleButton;
public var bubbles_off_btn:SimpleButton;
public var tx_description:TextField;
public var return_btn:SimpleButton;
public var bubbles_on_btn:SimpleButton;
}
}//package
Section 88
//mc_bomb (mc_bomb)
package {
import flash.display.*;
public dynamic class mc_bomb extends MovieClip {
}
}//package
Section 89
//mc_impit (mc_impit)
package {
import flash.display.*;
public dynamic class mc_impit extends MovieClip {
}
}//package
Section 90
//next_level (next_level)
package {
import flash.display.*;
public dynamic class next_level extends SimpleButton {
}
}//package
Section 91
//Orange_stain (Orange_stain)
package {
import flash.display.*;
public dynamic class Orange_stain extends MovieClip {
}
}//package
Section 92
//pants (pants)
package {
import flash.display.*;
public dynamic class pants extends MovieClip {
}
}//package
Section 93
//pause_BTN (pause_BTN)
package {
import flash.display.*;
public dynamic class pause_BTN extends SimpleButton {
}
}//package
Section 94
//play_BTN (play_BTN)
package {
import flash.display.*;
public dynamic class play_BTN extends SimpleButton {
}
}//package
Section 95
//playScreen (playScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class playScreen extends MovieClip {
public var background_day:bg_day;
public var score_panel:scorepanel;
public var unpause_btn:unpause_BTN;
public var fg_day:foreground_weeds_day;
public var level_info_text:TextField;
public var level_objectives_text:TextField;
public var bg_dusk:bg_dusk_dawn;
public var wash_tub:washtubb;
public var fg_dusk:foreground_weeds_dusk;
public var quit_btn:quit_BTN;
public var pause_btn:pause_BTN;
public var score_text:TextField;
public var elena:MovieClip;
public var score_id:TextField;
public function playScreen(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 96
//quit_BTN (quit_BTN)
package {
import flash.display.*;
public dynamic class quit_BTN extends SimpleButton {
}
}//package
Section 97
//rock (rock)
package {
import flash.display.*;
public dynamic class rock extends MovieClip {
}
}//package
Section 98
//rock_thud (rock_thud)
package {
import flash.media.*;
public dynamic class rock_thud extends Sound {
}
}//package
Section 99
//score_board (score_board)
package {
import flash.display.*;
import flash.text.*;
public dynamic class score_board extends MovieClip {
public var ok:SimpleButton;
public var tx_score:TextField;
public var submit:SimpleButton;
public var score_msg:TextField;
public var score_main:MovieClip;
public var return_to_menu:SimpleButton;
public var retry:SimpleButton;
public var tx_clothes:TextField;
public var instructions:SimpleButton;
public var tx_stains:TextField;
}
}//package
Section 100
//scorepanel (scorepanel)
package {
import flash.display.*;
public dynamic class scorepanel extends MovieClip {
}
}//package
Section 101
//scrub_brush (scrub_brush)
package {
import flash.display.*;
public dynamic class scrub_brush extends MovieClip {
}
}//package
Section 102
//shield (shield)
package {
import flash.display.*;
public dynamic class shield extends MovieClip {
}
}//package
Section 103
//shield_bang (shield_bang)
package {
import flash.media.*;
public dynamic class shield_bang extends Sound {
}
}//package
Section 104
//shirt (shirt)
package {
import flash.display.*;
public dynamic class shirt extends MovieClip {
}
}//package
Section 105
//shorts (shorts)
package {
import flash.display.*;
public dynamic class shorts extends MovieClip {
}
}//package
Section 106
//sooty (sooty)
package {
import flash.display.*;
public dynamic class sooty extends MovieClip {
}
}//package
Section 107
//splash_big (splash_big)
package {
import flash.media.*;
public dynamic class splash_big extends Sound {
}
}//package
Section 108
//splash_huge (splash_huge)
package {
import flash.media.*;
public dynamic class splash_huge extends Sound {
}
}//package
Section 109
//splash_medium (splash_medium)
package {
import flash.media.*;
public dynamic class splash_medium extends Sound {
}
}//package
Section 110
//splash_small (splash_small)
package {
import flash.media.*;
public dynamic class splash_small extends Sound {
}
}//package
Section 111
//squirrel_chitter1 (squirrel_chitter1)
package {
import flash.media.*;
public dynamic class squirrel_chitter1 extends Sound {
}
}//package
Section 112
//squirrel_chitter2 (squirrel_chitter2)
package {
import flash.media.*;
public dynamic class squirrel_chitter2 extends Sound {
}
}//package
Section 113
//squirrel_chitter3 (squirrel_chitter3)
package {
import flash.media.*;
public dynamic class squirrel_chitter3 extends Sound {
}
}//package
Section 114
//squirrel_chitter4 (squirrel_chitter4)
package {
import flash.media.*;
public dynamic class squirrel_chitter4 extends Sound {
}
}//package
Section 115
//squirrel_escaping (squirrel_escaping)
package {
import flash.media.*;
public dynamic class squirrel_escaping extends Sound {
}
}//package
Section 116
//squirrel_hanging (squirrel_hanging)
package {
import flash.display.*;
public dynamic class squirrel_hanging extends MovieClip {
}
}//package
Section 117
//squirrel_running (squirrel_running)
package {
import flash.display.*;
public dynamic class squirrel_running extends MovieClip {
}
}//package
Section 118
//stain_green (stain_green)
package {
import flash.display.*;
public dynamic class stain_green extends MovieClip {
}
}//package
Section 119
//stain_orange (stain_orange)
package {
import flash.display.*;
public dynamic class stain_orange extends MovieClip {
}
}//package
Section 120
//stain_purple (stain_purple)
package {
import flash.display.*;
public dynamic class stain_purple extends MovieClip {
}
}//package
Section 121
//stain_red (stain_red)
package {
import flash.display.*;
public dynamic class stain_red extends MovieClip {
}
}//package
Section 122
//start_mov (start_mov)
package {
import flash.display.*;
public dynamic class start_mov extends MovieClip {
}
}//package
Section 123
//start_page (start_page)
package {
import flash.display.*;
import flash.text.*;
public dynamic class start_page extends MovieClip {
public var instructions_button:SimpleButton;
public var sound_on_btn:SimpleButton;
public var music_on_btn:SimpleButton;
public var sound_off_btn:SimpleButton;
public var tfLegal:TextField;
public var bubbles:MovieClip;
public var music_off_btn:SimpleButton;
public var play_button:SimpleButton;
public var elena:MovieClip;
}
}//package
Section 124
//unpause_BTN (unpause_BTN)
package {
import flash.display.*;
public dynamic class unpause_BTN extends SimpleButton {
}
}//package
Section 125
//washtubb (washtubb)
package {
import flash.display.*;
public dynamic class washtubb extends MovieClip {
}
}//package