Section 1
//Color (fl.motion.Color)
package fl.motion {
import flash.geom.*;
import flash.display.*;
public class Color extends ColorTransform {
private var _tintMultiplier:Number;// = 0
private var _tintColor:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
_tintColor = 0;
_tintMultiplier = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setTint(_arg1:uint, _arg2:Number):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
private function deriveTintColor():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = (1 / this.tintMultiplier);
_local2 = Math.round((this.redOffset * _local1));
_local3 = Math.round((this.greenOffset * _local1));
_local4 = Math.round((this.blueOffset * _local1));
_local5 = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set brightness(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
_local2 = (1 - Math.abs(_arg1));
_local3 = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
private function parseXML(_arg1:XML=null):Color{
var _local2:XML;
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
_local2 = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
_local4 = (1 - _arg3);
_local5 = ((_arg1 >> 24) & 0xFF);
_local6 = ((_arg1 >> 16) & 0xFF);
_local7 = ((_arg1 >> 8) & 0xFF);
_local8 = (_arg1 & 0xFF);
_local9 = ((_arg2 >> 24) & 0xFF);
_local10 = ((_arg2 >> 16) & 0xFF);
_local11 = ((_arg2 >> 8) & 0xFF);
_local12 = (_arg2 & 0xFF);
_local13 = ((_local5 * _local4) + (_local9 * _arg3));
_local14 = ((_local6 * _local4) + (_local10 * _arg3));
_local15 = ((_local7 * _local4) + (_local11 * _arg3));
_local16 = ((_local8 * _local4) + (_local12 * _arg3));
_local17 = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number;
var _local5:ColorTransform;
_local4 = (1 - _arg3);
_local5 = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 2
//audio_clips_38 (kitty_match_fla.audio_clips_38)
package kitty_match_fla {
import flash.display.*;
public dynamic class audio_clips_38 extends MovieClip {
public function audio_clips_38(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package kitty_match_fla
Section 3
//CancelButton_34 (kitty_match_fla.CancelButton_34)
package kitty_match_fla {
import flash.display.*;
import flash.text.*;
public dynamic class CancelButton_34 extends MovieClip {
public var message_text:TextField;
}
}//package kitty_match_fla
Section 4
//content_holder_13 (kitty_match_fla.content_holder_13)
package kitty_match_fla {
import flash.display.*;
public dynamic class content_holder_13 extends MovieClip {
public function content_holder_13(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package kitty_match_fla
Section 5
//earth2_4 (kitty_match_fla.earth2_4)
package kitty_match_fla {
import flash.display.*;
public dynamic class earth2_4 extends MovieClip {
public var earth:MovieClip;
}
}//package kitty_match_fla
Section 6
//eyes_48 (kitty_match_fla.eyes_48)
package kitty_match_fla {
import flash.display.*;
public dynamic class eyes_48 extends MovieClip {
public function eyes_48(){
addFrameScript(12, frame13);
}
function frame13(){
gotoAndStop(1);
}
}
}//package kitty_match_fla
Section 7
//LoadBar_11 (kitty_match_fla.LoadBar_11)
package kitty_match_fla {
import flash.display.*;
public dynamic class LoadBar_11 extends MovieClip {
public var Fill:MovieClip;
}
}//package kitty_match_fla
Section 8
//NonobaSubmitBox_30 (kitty_match_fla.NonobaSubmitBox_30)
package kitty_match_fla {
import flash.display.*;
import flash.text.*;
public dynamic class NonobaSubmitBox_30 extends MovieClip {
public var score:TextField;
public var Continue:MovieClip;
}
}//package kitty_match_fla
Section 9
//PointText_37 (kitty_match_fla.PointText_37)
package kitty_match_fla {
import flash.display.*;
import flash.text.*;
public dynamic class PointText_37 extends MovieClip {
public var PointText:TextField;
}
}//package kitty_match_fla
Section 10
//PreloaderScreen_2 (kitty_match_fla.PreloaderScreen_2)
package kitty_match_fla {
import flash.display.*;
public dynamic class PreloaderScreen_2 extends MovieClip {
public var loader:LoadBarSymbol;
}
}//package kitty_match_fla
Section 11
//smallz_earth_3 (kitty_match_fla.smallz_earth_3)
package kitty_match_fla {
import flash.display.*;
public dynamic class smallz_earth_3 extends MovieClip {
public var earth:MovieClip;
}
}//package kitty_match_fla
Section 12
//SmallzSubmitBox_33 (kitty_match_fla.SmallzSubmitBox_33)
package kitty_match_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SmallzSubmitBox_33 extends MovieClip {
public var Submit:MovieClip;
public var user_name:TextField;
public var message_text:TextField;
public var score:TextField;
public var Cancel:MovieClip;
}
}//package kitty_match_fla
Section 13
//SubmitButton_35 (kitty_match_fla.SubmitButton_35)
package kitty_match_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SubmitButton_35 extends MovieClip {
public var message_text:TextField;
}
}//package kitty_match_fla
Section 14
//submitcancelButton_32 (kitty_match_fla.submitcancelButton_32)
package kitty_match_fla {
import flash.display.*;
import flash.text.*;
public dynamic class submitcancelButton_32 extends MovieClip {
public var message_text:TextField;
}
}//package kitty_match_fla
Section 15
//AchievementBox (AchievementBox)
package {
import flash.geom.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class AchievementBox extends MovieClip {
public var _duration:Number;
public var _isComplete:Boolean;
public var _type:int;
public var achievement_text:TextField;
public var _speed:Number;
public var _scale:Number;
public var _initTime:Number;
public var _spawnState:Boolean;// = true
public var user_name:TextField;
public var _state:String;
public var _defaultAchievementText:String;// = "You know how we do!"
public var _defaultDuration:Number;// = 3
public var _scaleSpeed:Number;// = 250
public var _defalutLoc:Point;
public function AchievementBox():void{
_scaleSpeed = 250;
_defaultDuration = 3;
_defalutLoc = new Point(0, 0);
_defaultAchievementText = "You know how we do!";
_spawnState = true;
super();
deactivate();
}
public function startTimer():void{
_initTime = getTimer();
}
public function activate():void{
_state = "Active";
visible = true;
_spawnState = false;
}
public function transitionIn():void{
_scale = 0.01;
scaleX = _scale;
scaleY = _scale;
_state = "Grow";
}
public function deactivate():void{
_state = "Inactive";
visible = false;
_isComplete = true;
}
public function transitionOut():void{
_state = "Shrink";
}
public function update(_arg1:Number):void{
switch (_state){
case "Active":
if (isDone()){
transitionOut();
};
break;
case "Grow":
_scale = (_scale + ((_arg1 * _scaleSpeed) / 100));
if (_scale >= 1){
_scale = 1;
startTimer();
_state = "Active";
};
scaleX = _scale;
scaleY = _scale;
break;
case "Shrink":
_scale = (_scale - ((_arg1 * _scaleSpeed) / 100));
if (_scale <= 0.1){
_scale = 1;
deactivate();
};
scaleX = _scale;
scaleY = _scale;
break;
case "Inactive":
break;
};
}
public function isDone():Boolean{
var _local1:Boolean;
_local1 = false;
if (GameManager.elapsedTime(_initTime) >= _duration){
_local1 = true;
};
return (_local1);
}
}
}//package
Section 16
//AchievementBoxManager (AchievementBoxManager)
package {
import flash.display.*;
public class AchievementBoxManager extends MovieClip {
public var active:Array;
public var clips:Array;
public function AchievementBoxManager():void{
clips = new Array();
active = new Array();
super();
}
public function init(_arg1:Number):void{
var _local2:int;
_local2 = 0;
while (_local2 < _arg1) {
clips[_local2] = new AchievementBox();
clips[_local2].alpha = 0.75;
addChild(clips[_local2]);
_local2++;
};
}
public function inactiveAchievementBox():int{
var _local1:int;
var _local2:int;
var _local3:int;
_local2 = -1;
_local3 = clips.length;
_local1 = 0;
while (_local1 < _local3) {
if (clips[_local1]._spawnState){
_local2 = _local1;
break;
};
_local1++;
};
return (_local2);
}
public function deactivateAllAchievementBoxes():void{
var _local1:int;
var _local2:int;
_local2 = clips.length;
_local1 = 0;
while (_local1 < _local2) {
clips[_local1].deactivate();
clips[_local1]._spawnState = true;
_local1++;
};
active = new Array();
}
public function spawn(_arg1:String, _arg2:Number):void{
var clipIndex:int;
var achievementText = _arg1;
var duration = _arg2;
clipIndex = inactiveAchievementBox();
if (clipIndex >= 0){
var _local4 = clips[clipIndex];
with (_local4) {
activate();
scaleX = 1;
scaleY = 1;
x = (15 + (201 * clipIndex));
y = (150 - (height + 25));
user_name.text = GameManager._userName;
achievement_text.text = achievementText;
_duration = duration;
transitionIn();
_isComplete = false;
active.push(clips[clipIndex]);
};
};
}
public function update(_arg1:Number):void{
var index:int;
var clipCount:int;
var elapsedTime = _arg1;
clipCount = active.length;
index = 0;
while (index < clipCount) {
var _local3 = active[index];
with (_local3) {
if (_state == "Inactive"){
_spawnState = true;
active.splice(index, 1);
index--;
clipCount--;
} else {
update(elapsedTime);
};
};
index = (index + 1);
};
}
}
}//package
Section 17
//AchievementRecord (AchievementRecord)
package {
public class AchievementRecord {
public var _experiencePoints:int;
public var _achievementKey:String;
public var _achievementName:String;
public var _isAchieved:Boolean;
public function AchievementRecord(_arg1:String, _arg2:String, _arg3:int):void{
_achievementName = _arg1;
_achievementKey = _arg2;
_experiencePoints = _arg3;
_isAchieved = false;
}
}
}//package
Section 18
//Background (Background)
package {
import flash.display.*;
public dynamic class Background extends MovieClip {
}
}//package
Section 19
//CreditsScreen (CreditsScreen)
package {
import flash.display.*;
import flash.events.*;
public class CreditsScreen extends MovieClip {
public var _state:String;
public var Continue:MovieClip;
public function CreditsScreen():void{
x = 0;
y = 0;
_state = "Inactive";
visible = false;
}
public function activate():void{
_state = "Active";
visible = true;
}
public function check_rollovers(){
if (Continue.hitTestPoint(mouseX, mouseY)){
Continue.scaleX = 1.25;
Continue.scaleY = 1.25;
} else {
Continue.scaleX = 1;
Continue.scaleY = 1;
};
}
public function menu_mouseUp(_arg1:MouseEvent){
if (Continue.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.gameState = "MainMenu";
};
}
public function deactivate():void{
_state = "Inactive";
visible = false;
}
public function update():void{
switch (_state){
case "Active":
break;
};
}
}
}//package
Section 20
//GameManager (GameManager)
package {
import flash.geom.*;
import flash.utils.*;
public class GameManager {
public static var _highScores:Array;
public static var ScorePopUpControl:ScorePopUpManager;
public static var _scrollSpeedY:Number = 100;
public static var _gameTitle:String = "Kitty Match";
public static var _timerBonusValid:Boolean = false;
public static var _multiplierValid:Boolean = false;
public static var gameID:int = 349;
public static var _mostMultipliers:int = 0;
public static var _nonobaHighScoresEnabled:Boolean = false;
public static var _nonobaDebuggerEnabled:Boolean = false;
public static var _highBonus:int = 0;
public static var _highScoresLoaded:Boolean = false;
public static var _timeBonusCounter:int = 0;
public static var centerLoc:Point = new Point((screenWidth / 2), (screenHeight / 2));
public static var playerScore:uint = 0;
public static var Debug:Boolean = false;
public static var screenWidth:Number = 640;
public static var _nonobaAchievementsEnabled:Boolean = false;
public static var isMochi:Boolean = true;
public static var screenHeight:Number = 480;
public static var gameState:String = "MainMenu";
public static var clockPulseInitTime:Number = getTimer();
public static var isNonoba:Boolean = false;
public static var _userName:String;
public static var _nonobaSendEnabled:Boolean = false;
public static var health:Number = 100;
public static var mochiID:String = "ed796fbde77168d8";
public static var _highScoresEnabled:Boolean = true;
public static var LevelControl:LevelManager;
public static var UI_Game:GameUIScreen;
public static var _multiplier:Number;
public static var _detailLevel:String = "";
public function GameManager():void{
}
public static function updateUI():void{
UI_Game.score.text = ("Score " + playerScore);
UI_Game.level.text = ("Level " + LevelControl._currentLevel);
}
public static function initUI(_arg1:GameUIScreen, _arg2:LevelManager):void{
UI_Game = _arg1;
LevelControl = _arg2;
}
public static function timeString(_arg1:int):String{
var _local2:int;
var _local3:String;
_local2 = Math.floor((_arg1 / 60));
_arg1 = (_arg1 - (_local2 * 60));
_local3 = ((_local2 + ":") + String((_arg1 + 100)).substr(1, 2));
return (_local3);
}
public static function initScorePopUpManager(_arg1:ScorePopUpManager):void{
ScorePopUpControl = _arg1;
}
public static function clockPulse():Number{
var _local1:Number;
_local1 = elapsedTime(clockPulseInitTime);
clockPulseInitTime = getTimer();
return (_local1);
}
public static function decrementHealth(_arg1:Number):void{
health = (health - _arg1);
if (health < 0){
health = 0;
};
}
public static function incrementHealth(_arg1:Number):void{
health = (health + _arg1);
if (health > 100){
health = 100;
};
}
public static function scorePopUp(_arg1:String, _arg2:Point):void{
ScorePopUpControl.activate(_arg2, _arg1);
}
public static function resetGame():void{
playerScore = 0;
_multiplier = 2;
_mostMultipliers = 0;
_timeBonusCounter = 0;
_highBonus = 0;
}
public static function incrementScore(_arg1:int):void{
playerScore = (playerScore + _arg1);
}
public static function elapsedTime(_arg1:Number):Number{
var _local2:Number;
_local2 = ((getTimer() - _arg1) / 1000);
return (_local2);
}
}
}//package
Section 21
//GameUIScreen (GameUIScreen)
package {
import flash.display.*;
import flash.text.*;
public class GameUIScreen extends MovieClip {
public var move_timer:MovieClip;
public var level:TextField;
public var score:TextField;
public var _state:String;
public function GameUIScreen():void{
x = 0;
y = 0;
deactivate();
}
public function activate():void{
_state = "Active";
visible = true;
}
public function deactivate():void{
_state = "Inactive";
visible = false;
}
public function update():void{
switch (_state){
case "Active":
break;
};
}
}
}//package
Section 22
//GridManager (GridManager)
package {
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class GridManager extends MovieClip {
public var active:Array;
public var _penDown:Boolean;// = false
public var clips:Array;
public var _grid:Array;
public var _moveTimerDuration:Number;
public var _moveTimerInit:Number;
public var gridRows:int;
public var _matchType:int;
public var _highlightedTiles:Array;
public var _pixelsTraveled:Number;// = 0
public var gridCols:int;
public var tileHeight:Number;
public var LevelControl:LevelManager;
public var _timerOffset:Number;// = 0
public var _tagged:Array;
public var _magicNumber:int;// = 9
public var _lastLoc:Point;
public var TileControl:TileManager;
public var _numberRange:int;// = 3
public var tileWidth:Number;
public var _drawLayer:MovieClip;
public function GridManager():void{
clips = new Array();
active = new Array();
_penDown = false;
_tagged = new Array();
_numberRange = 3;
_magicNumber = 9;
_timerOffset = 0;
_pixelsTraveled = 0;
super();
}
public function checkCollisionTile():void{
var _local1:int;
var _local2:Array;
var _local3:int;
var _local4:Number;
var _local5:Point;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:int;
var _local11:Number;
var _local12:int;
_local2 = TileControl.active;
_local3 = _local2.length;
_local7 = 10;
_local4 = smallzMath.pDistance(_lastLoc, new Point(mouseX, mouseY));
if (_local4 > _local7){
_local10 = Math.floor((_local4 / _local7));
_local8 = (_local4 / _local10);
} else {
_local10 = 0;
_local8 = 0;
};
_local6 = smallzMath.pGetAngle(new Point(mouseX, mouseY), _lastLoc);
_local1 = 0;
while (_local1 < (_local10 + 1)) {
_local11 = (_local1 * _local8);
_local5 = new Point(0, 0);
_local5.x = (mouseX + (_local11 * Math.cos(_local6)));
_local5.y = (mouseY + (_local11 * Math.sin(_local6)));
_local12 = 0;
while (_local12 < _local3) {
if (_local2[_local12]._state == "Active"){
if (isHit(_local2[_local12]._kittenClip, _local5)){
if (!_local2[_local12]._tagged){
_tagged.push(_local2[_local12]);
_local2[_local12]._tagged = true;
};
};
};
_local12++;
};
_local1++;
};
}
public function init(_arg1:LevelManager):void{
LevelControl = _arg1;
gridRows = 10;
gridCols = 9;
TileControl = new TileManager();
TileControl.init(100);
addChild(TileControl);
tileWidth = TileControl.clips[0]._frame.width;
tileHeight = TileControl.clips[0]._frame.height;
_drawLayer = new MovieClip();
addChild(_drawLayer);
smallzFilter.glow(_drawLayer, "0x000099", 10, 1, 2, 2);
smallzFilter.glow(_drawLayer, "0x0000FF", 2, 1, 12, 12);
}
private function isHit(_arg1:MovieClip, _arg2:Point):Boolean{
var _local3:Boolean;
_local3 = false;
if (_arg1.hitTestPoint(_arg2.x, _arg2.y, true)){
_local3 = true;
};
if (_arg1.hitTestPoint((_arg2.x + 1), _arg2.y, true)){
_local3 = true;
};
if (_arg1.hitTestPoint((_arg2.x - 1), _arg2.y, true)){
_local3 = true;
};
if (_arg1.hitTestPoint(_arg2.x, (_arg2.y - 1), true)){
_local3 = true;
};
if (_arg1.hitTestPoint(_arg2.x, (_arg2.y + 1), true)){
_local3 = true;
};
return (_local3);
}
public function isGameOver():Boolean{
var _local1:int;
var _local2:int;
var _local3:Boolean;
_local2 = TileControl.active.length;
_local3 = false;
_local1 = 0;
while (_local1 < _local2) {
if (TileControl.active[_local1].y < 50){
_local3 = true;
break;
};
_local1++;
};
return (_local3);
}
public function clearTagged():void{
var _local1:int;
var _local2:int;
_local2 = _tagged.length;
_local1 = 0;
while (_local1 < _local2) {
_tagged[_local1]._tagged = false;
_local1++;
};
_tagged = new Array();
}
public function plotPoint():void{
var distance:Number;
var intensity:Number;
distance = smallzMath.pDistance(_lastLoc, new Point(mouseX, mouseY));
_pixelsTraveled = (_pixelsTraveled + distance);
var _local2 = _drawLayer.graphics;
with (_local2) {
lineStyle(1.5, 0xFFFFFF, 1);
lineTo(mouseX, mouseY);
};
checkCollisionTile();
_lastLoc = new Point(mouseX, mouseY);
smallzFilter.removeFilters(_drawLayer);
intensity = (Math.random() * 5);
smallzFilter.glow(_drawLayer, "0x0000FF", intensity, 1, 2, 2);
smallzFilter.glow(_drawLayer, "0x000099", 2, 1, 12, 12);
}
public function getGridLoc(_arg1):Point{
var _local2:int;
var _local3:int;
var _local4:Point;
_local2 = 0;
while (_local2 < gridRows) {
_local3 = 0;
while (_local3 < gridCols) {
if (_grid[_local3][_local2] == _arg1){
_local4 = new Point(_local3, _local2);
break;
};
_local3++;
};
_local2++;
};
return (_local4);
}
public function solveCheck():void{
var _local1:int;
var _local2:int;
var _local3:Boolean;
_local2 = _tagged.length;
_local3 = false;
if (isSolved()){
scoreTagged();
SoundManager.playSound("Meow");
} else {
SoundManager.playSound("Shock");
};
resetDrawing();
}
public function spawnRow():void{
var _local1:int;
var _local2:int;
var _local3:Point;
var _local4:Point;
var _local5:int;
var _local6:Array;
var _local7:int;
_local2 = gridCols;
_local6 = TileControl.clips;
_local1 = 0;
while (_local1 < _local2) {
_local3 = new Point(((tileWidth * 0.5) + (_local1 * tileWidth)), (GameManager.screenHeight - (tileHeight * 0.5)));
_local4 = new Point((gridRows - 1), _local1);
_local7 = int((Math.random() * LevelControl._colorRange));
_local5 = TileControl.spawn(_local3, _local7);
_grid[_local1][(gridRows - 1)] = _local5;
_local6[_local5]._targetLoc.y = _local6[_local5].y;
_local6[_local5].y = (_local6[_local5].y + tileHeight);
_local6[_local5]._state = "Rising";
_local1++;
};
}
public function createGrid():void{
var _local1:int;
var _local2:int;
var _local3:int;
_grid = new Array();
_local3 = 0;
while (_local3 < gridCols) {
_grid[_local3] = new Array();
_local2 = 0;
while (_local2 < gridRows) {
_grid[_local3][_local2] = -1;
_local2++;
};
_local3++;
};
}
public function pctMoveTimeRemaining():Number{
var _local1:Number;
var _local2:Number;
_local1 = (GameManager.elapsedTime(_moveTimerInit) - _timerOffset);
_local2 = (((_moveTimerDuration - _local1) / _moveTimerDuration) * 100);
return (_local2);
}
public function spawnCheck():void{
if ((GameManager.elapsedTime(_moveTimerInit) - _timerOffset) >= _moveTimerDuration){
startNextMove();
};
}
public function shiftGridUp():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Array;
_local4 = TileControl.clips;
_local1 = 0;
while (_local1 < (gridRows - 1)) {
_local2 = 0;
while (_local2 < gridCols) {
_grid[_local2][_local1] = _grid[_local2][(_local1 + 1)];
_local2++;
};
_local1++;
};
}
public function update(_arg1:Number):void{
TileControl.update(_arg1);
if (!TileControl._pauseState){
if (_penDown){
plotPoint();
};
spawnCheck();
} else {
_timerOffset = (_timerOffset + _arg1);
};
}
public function startMoveTimer():void{
_moveTimerInit = getTimer();
}
public function resetDrawing():void{
_penDown = false;
clearTagged();
TileControl.unhighlightAll();
_drawLayer.graphics.clear();
GameManager._multiplierValid = false;
GameManager._timerBonusValid = false;
}
public function isSolved():Boolean{
var _local1:int;
var _local2:int;
var _local3:Boolean;
_local2 = _tagged.length;
_local3 = false;
if (_local2 > 1){
_local3 = true;
_local1 = 0;
while (_local1 < _local2) {
if (_tagged[_local1]._type != _tagged[0]._type){
_local3 = false;
};
_local1++;
};
};
return (_local3);
}
public function scoreTagged():void{
var _local1:int;
var _local2:int;
var _local3:Number;
var _local4:Point;
var _local5:String;
_local2 = _tagged.length;
_local3 = 0;
_local1 = 0;
while (_local1 < _local2) {
_local4 = getGridLoc(_tagged[_local1]._index);
_grid[_local4.x][_local4.y] = -1;
_tagged[_local1].explode();
_local3 = (_local3 + (25 * (_local1 + 1)));
_local1++;
};
_local3 = (_local2 * (25 * _local2));
if (GameManager._multiplierValid){
_local3 = (_local3 * GameManager._multiplier);
if (_local3 > GameManager._highBonus){
GameManager._highBonus = _local3;
};
if (GameManager._multiplier > GameManager._mostMultipliers){
GameManager._mostMultipliers = GameManager._multiplier;
};
};
_local5 = (("x" + _local2) + " ");
GameManager.scorePopUp((_local5 + String(_local3)), new Point(320, 240));
GameManager.incrementScore(_local3);
GameManager.updateUI();
if (GameManager._timerBonusValid){
_timerOffset = (_timerOffset + 3);
GameManager._timeBonusCounter++;
if ((GameManager.elapsedTime(_moveTimerInit) - _timerOffset) < 0){
_timerOffset = (_timerOffset - Math.abs((GameManager.elapsedTime(_moveTimerInit) - _timerOffset)));
};
};
dropBlocks();
}
public function dropBlocks():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = 0;
while (_local2 < gridCols) {
_local1 = (gridRows - 1);
while (_local1 > 0) {
if (_grid[_local2][_local1] == -1){
_local3 = (_local1 - 1);
while (_local3 >= 0) {
if (_grid[_local2][_local3] >= 0){
_grid[_local2][_local1] = _grid[_local2][_local3];
_grid[_local2][_local3] = -1;
_local4 = _grid[_local2][_local1];
TileControl.clips[_local4]._targetLoc.y = (TileControl.clips[_local4].y + (tileHeight * (_local1 - _local3)));
TileControl.clips[_local4]._state = "Dropping";
break;
};
_local3--;
};
};
_local1--;
};
_local2++;
};
}
public function startNextMove():void{
if (LevelControl.timerValue() > LevelControl._duration){
LevelControl.nextLevel();
LevelControl.initLevel();
GameManager.updateUI();
LevelControl._timerInit = getTimer();
SoundManager.playSound("NewLevel");
};
resetDrawing();
TileControl.shiftUp();
shiftGridUp();
spawnRow();
_moveTimerInit = getTimer();
_moveTimerDuration = LevelControl._moveTimerDuration;
_timerOffset = 0;
}
public function resetVariables():void{
createGrid();
resetDrawing();
_moveTimerDuration = LevelControl._moveTimerDuration;
}
}
}//package
Section 23
//HighScoreListingSymbol (HighScoreListingSymbol)
package {
import flash.display.*;
import flash.text.*;
public dynamic class HighScoreListingSymbol extends MovieClip {
public var User:TextField;
public var Rank:TextField;
public var Score:TextField;
}
}//package
Section 24
//HighScoreManager (HighScoreManager)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class HighScoreManager extends MovieClip {
public function HighScoreManager():void{
}
public function load_highscores(_arg1:int):void{
var _local2:URLRequest;
var _local3:URLVariables;
var _local4:URLLoader;
_local2 = new URLRequest("http://games.smallzworld.com/RecordManagement.php");
_local3 = new URLVariables();
_local3.Routine = "AS3LoadHighScores";
_local3.Game_ID = _arg1;
_local2.data = _local3;
_local4 = new URLLoader();
_local4.dataFormat = URLLoaderDataFormat.VARIABLES;
_local4.addEventListener(Event.COMPLETE, highscores_handler);
_local4.load(_local2);
GameManager.gameState = "Loading";
GameManager._highScoresLoaded = false;
}
private function highscores_handler(_arg1:Event):void{
var _local2:URLLoader;
var _local3:int;
var _local4:Array;
_local2 = URLLoader(_arg1.target);
_local4 = new Array();
_local3 = 1;
while (_local3 <= 10) {
if (_local2.data[("Score_" + _local3)]){
_local4[(_local3 - 1)] = new HighScoreRecord(_local3, _local2.data[("User_" + _local3)], _local2.data[("Score_" + _local3)], 0, "");
};
_local3++;
};
GameManager._highScores = _local4;
GameManager._highScoresLoaded = true;
GameManager.gameState = "HighScores";
}
public function save_highscore(_arg1:int, _arg2:int, _arg3:String, _arg4:int, _arg5:int, _arg6:int, _arg7:String):void{
var _local8:URLRequest;
var _local9:URLVariables;
var _local10:URLLoader;
_local8 = new URLRequest("http://games.smallzworld.com/RecordManagement.php");
_local9 = new URLVariables();
_local9.Routine = "AddHighScore";
_local9.Game_ID = _arg1;
_local9.Profile_ID = _arg2;
_local9.UserName = _arg3;
_local9.Level = _arg4;
_local9.Score = _arg5;
_local9.TimeScore = _arg6;
_local9.Comment = _arg7;
_local8.data = _local9;
_local10 = new URLLoader();
_local10.dataFormat = URLLoaderDataFormat.VARIABLES;
_local10.addEventListener(Event.COMPLETE, save_highscore_handler);
_local10.load(_local8);
GameManager.gameState = "Saving";
}
private function save_highscore_handler(_arg1:Event):void{
var _local2:URLLoader;
var _local3:int;
_local2 = URLLoader(_arg1.target);
GameManager.gameState = "HighScores";
}
}
}//package
Section 25
//HighScoreRecord (HighScoreRecord)
package {
public class HighScoreRecord {
public var _comment:String;
public var _level:int;
public var _rank:int;
public var _user:String;
public var _score:Number;
public function HighScoreRecord(_arg1:int, _arg2:String, _arg3:Number, _arg4:int, _arg5:String):void{
_rank = _arg1;
_user = _arg2;
_score = _arg3;
_level = _arg4;
_comment = _arg5;
}
}
}//package
Section 26
//HighScoresScreen (HighScoresScreen)
package {
import flash.display.*;
import flash.events.*;
public class HighScoresScreen extends MovieClip {
public var score_10:HighScoreListingSymbol;
public var _state:String;
public var score_2:HighScoreListingSymbol;
public var score_6:HighScoreListingSymbol;
public var score_7:HighScoreListingSymbol;
public var score_9:HighScoreListingSymbol;
public var score_3:HighScoreListingSymbol;
public var Continue:MovieClip;
public var score_5:HighScoreListingSymbol;
public var score_8:HighScoreListingSymbol;
public var score_1:HighScoreListingSymbol;
public var score_4:HighScoreListingSymbol;
public function HighScoresScreen():void{
x = 0;
y = 0;
_state = "Inactive";
visible = false;
}
public function activate():void{
var _local1:int;
_state = "Active";
visible = true;
_local1 = 1;
while (_local1 <= 10) {
this[("score_" + _local1)].visible = false;
_local1++;
};
}
public function check_rollovers():void{
if (Continue.hitTestPoint(mouseX, mouseY)){
Continue.scaleX = 1.25;
Continue.scaleY = 1.25;
} else {
Continue.scaleX = 1;
Continue.scaleY = 1;
};
}
public function menu_mouseUp(_arg1:MouseEvent):void{
if (Continue.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.gameState = "MainMenu";
};
}
public function deactivate():void{
_state = "Inactive";
visible = false;
}
public function update():void{
var index:int;
var score_count:int;
var score_index:int;
score_count = GameManager._highScores.length;
index = 0;
while (index < score_count) {
var _local2 = GameManager;
with (_local2) {
score_index = (index + 1);
this[("score_" + score_index)].Rank.text = String(_highScores[index]._rank);
this[("score_" + score_index)].Score.text = String(_highScores[index]._score);
this[("score_" + score_index)].User.text = _highScores[index]._user;
this[("score_" + score_index)].visible = true;
};
index = (index + 1);
};
}
}
}//package
Section 27
//InstructionsScreen (InstructionsScreen)
package {
import flash.display.*;
import flash.events.*;
public class InstructionsScreen extends MovieClip {
public var _state:String;
public var Continue:MovieClip;
public function InstructionsScreen():void{
x = 0;
y = 0;
_state = "Inactive";
visible = false;
}
public function activate():void{
_state = "Active";
visible = true;
}
public function check_rollovers():void{
if (Continue.hitTestPoint(mouseX, mouseY)){
Continue.scaleX = 1.25;
Continue.scaleY = 1.25;
} else {
Continue.scaleX = 1;
Continue.scaleY = 1;
};
}
public function menu_mouseUp(_arg1:MouseEvent):void{
if (Continue.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.gameState = "MainMenu";
};
}
public function deactivate():void{
_state = "Inactive";
visible = false;
}
public function update():void{
switch (_state){
case "Active":
break;
};
}
}
}//package
Section 28
//Kitty (Kitty)
package {
import flash.display.*;
public dynamic class Kitty extends MovieClip {
public var eyes:MovieClip;
public var color_clip:MovieClip;
}
}//package
Section 29
//kitty_match (kitty_match)
package {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public dynamic class kitty_match extends MovieClip {
private var Tinkle:TinkleSFX;
private var faultCount:int;// = 0
private var UI_MainMenu:MainMenuScreen;
private var LevelChange:LevelChangeSFX;
private var UI_Submit:SubmitScoreScreen;
public var Mute:MuteButton;
private var TheBackground:Background;
private var UI_Pause:PauseScreen;
public var _backgroundScale:Number;// = 1.25
private var Shock:ShockSFX;
public var _backgroundScaleMin:Number;// = 1
public var ScorePopUpControl:ScorePopUpManager;
private var UI_Game:GameUIScreen;
public var NonobaControl:NonobaManager;
private var UI_HighScores:HighScoresScreen;
public var GridControl:GridManager;
public var PopUp_UI:PopUp;
public var FPS_Display:smallzFPS;
public var _loader:Loader;
public var HighScoreControl:HighScoreManager;
public var KeyboardControl:smallzKeyboardManager;
public var LevelControl:LevelManager;
private var UI_Instructions:InstructionsScreen;
public var _backgroundRotationSpeed:Number;// = 15
private var Meow:MeowSFX;
public var _backgroundScaleMax:Number;// = 3
private var Soundtrack:SoundtrackMusic;
private var UI_Credits:CreditsScreen;
public var _backgroundScaleSpeed:Number;// = 0.25
public var load_screen:MovieClip;
public var _browser:MovieClip;
private var load_percent:Number;
public static var Debug:smallzDebug;
public function kitty_match(){
_backgroundScale = 1.25;
_backgroundRotationSpeed = 15;
_backgroundScaleSpeed = 0.25;
_backgroundScaleMax = 3;
_backgroundScaleMin = 1;
faultCount = 0;
super();
addFrameScript(0, frame1, 2, frame3, 3, frame4);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
Security.loadPolicyFile("http://games.smallzworld.com/crossdomain.xml");
}
public function initApplication(){
loadBrowser(("http://games.smallzworld.com/media/flash/headers/browser.swf?orbsketch=" + String(int((Math.random() * 100)))));
Soundtrack = new SoundtrackMusic();
Meow = new MeowSFX();
Tinkle = new TinkleSFX();
Shock = new ShockSFX();
LevelChange = new LevelChangeSFX();
TheBackground = new Background();
addChild(TheBackground);
SoundManager.addSound("Meow", Meow);
SoundManager.addSound("Tinkle", Tinkle);
SoundManager.addSound("Shock", Shock);
SoundManager.addSound("NewLevel", LevelChange);
SoundManager.addSound("Soundtrack", Soundtrack);
LevelControl = new LevelManager();
NonobaControl = new NonobaManager();
GridControl = new GridManager();
GridControl.init(LevelControl);
UI_Game = new GameUIScreen();
addChild(UI_Game);
addChild(GridControl);
UI_MainMenu = new MainMenuScreen();
addChild(UI_MainMenu);
UI_Instructions = new InstructionsScreen();
addChild(UI_Instructions);
UI_Credits = new CreditsScreen();
addChild(UI_Credits);
UI_Pause = new PauseScreen();
addChild(UI_Pause);
UI_HighScores = new HighScoresScreen();
addChild(UI_HighScores);
UI_Submit = new SubmitScoreScreen();
addChild(UI_Submit);
PopUp_UI = new PopUp();
addChild(PopUp_UI);
GameManager.initUI(UI_Game, LevelControl);
ScorePopUpControl = new ScorePopUpManager();
addChild(ScorePopUpControl);
ScorePopUpControl.init(10);
GameManager.initScorePopUpManager(ScorePopUpControl);
addChild(NonobaControl);
Mute = new MuteButton();
addChild(Mute);
Mute.gotoAndStop(1);
Mute.x = 10;
Mute.y = 10;
HighScoreControl = new HighScoreManager();
KeyboardControl = new smallzKeyboardManager();
addChild(KeyboardControl);
KeyboardControl.init();
stage.addEventListener(Event.ENTER_FRAME, mainLoop);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp_handler);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown_handler);
stage.focus = this;
if (GameManager.isNonoba){
NonobaControl.getUsername();
defineAchievements();
UI_MainMenu.LeaderBoards.visible = false;
UI_MainMenu.HighScores.visible = false;
};
SoundManager.loopSound("Soundtrack");
addChild(_browser);
}
public function mouseUp_handler(_arg1:MouseEvent){
if (Mute.hitTestPoint(mouseX, mouseY)){
if (!SoundManager._mute){
SoundManager._mute = true;
SoundManager.stopSound("Soundtrack");
Mute.gotoAndStop(2);
} else {
SoundManager._mute = false;
SoundManager.restartSound("Soundtrack", 999);
Mute.gotoAndStop(1);
};
} else {
switch (GameManager.gameState){
case "Game":
if (GridControl._penDown){
GridControl.solveCheck();
};
GridControl._penDown = false;
break;
case "LevelPrompt":
PopUp_UI._duration = 0;
break;
case "MainMenu":
UI_MainMenu.menu_mouseUp(_arg1);
break;
case "Instructions":
UI_Instructions.menu_mouseUp(_arg1);
break;
case "Credits":
UI_Credits.menu_mouseUp(_arg1);
break;
case "Pause":
UI_Pause.menu_mouseUp(_arg1);
break;
case "HighScores":
UI_HighScores.menu_mouseUp(_arg1);
break;
case "GameOver":
UI_Submit.menu_mouseUp(_arg1);
break;
};
};
}
private function checkAchievements():void{
if (!NonobaControl.isAchieved("gotsum")){
if (GameManager.playerScore >= 20000){
NonobaControl.markAchievement("gotsum");
};
};
if (!NonobaControl.isAchieved("mathematician")){
if (GameManager.playerScore >= 30000){
NonobaControl.markAchievement("mathematician");
};
};
if (!NonobaControl.isAchieved("multisummaster")){
if (GameManager.playerScore >= 50000){
NonobaControl.markAchievement("multisummaster");
};
};
if (!NonobaControl.isAchieved("massmult")){
if (GameManager._mostMultipliers >= 10){
NonobaControl.markAchievement("massmult");
};
};
if (!NonobaControl.isAchieved("timebandit")){
if (GameManager._timeBonusCounter >= 10){
NonobaControl.markAchievement("timebandit");
};
};
if (!NonobaControl.isAchieved("bigbonus")){
if (GameManager._highBonus >= 2000){
NonobaControl.markAchievement("bigbonus");
};
};
if (!NonobaControl.isAchieved("massivebonus")){
if (GameManager._highBonus >= 3000){
NonobaControl.markAchievement("massivebonus");
};
};
if (!NonobaControl.isAchieved("monsterbonus")){
if (GameManager._highBonus >= 5000){
NonobaControl.markAchievement("monsterbonus");
};
};
}
public function resumeGameAfterAd():void{
SoundManager.loopSound("Soundtrack");
}
public function isItLoaded(_arg1:Event):void{
if (loaderInfo.bytesLoaded == loaderInfo.bytesTotal){
this.removeEventListener(Event.ENTER_FRAME, isItLoaded);
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadProgress);
showAds(GameManager.mochiID, GameManager.isMochi);
};
}
function frame3(){
stop();
}
function frame4(){
gotoAndStop(3);
}
private function checkEndLevelAchievements():void{
}
public function showAds(_arg1:String, _arg2:Boolean){
stop();
if (_arg2){
MochiAd.showPreGameAd({clip:root, id:_arg1, res:"640x480", background:0, color:204, outline:0xFFFFFF, no_bg:false, ad_finished:adFinished});
} else {
adFinished();
};
}
function frame1(){
this.stop();
load_screen.alpha = 100;
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
this.addEventListener(Event.ENTER_FRAME, isItLoaded);
}
private function defineAchievements():void{
NonobaControl.addAchievement("Got Sum", "gotsum", 3);
NonobaControl.addAchievement("The Mathematician", "mathematician", 5);
NonobaControl.addAchievement("Multi Sum Master", "multisummaster", 10);
NonobaControl.addAchievement("Massive Multiplier", "massmult", 5);
NonobaControl.addAchievement("Time Bandit", "timebandit", 5);
NonobaControl.addAchievement("Big Bonus", "bigbonus", 3);
NonobaControl.addAchievement("Massive Bonus", "massivebonus", 5);
NonobaControl.addAchievement("Monster Bonus", "monsterbonus", 10);
}
private function processInput(){
if (KeyboardControl.isPressed(37)){
};
if (KeyboardControl.isPressed(38)){
};
if (KeyboardControl.isPressed(39)){
};
if (KeyboardControl.isPressed(40)){
};
if (KeyboardControl.isPressed(32)){
if ((((GameManager.elapsedTime(GridControl._moveTimerInit) > 0.5)) && (!(GridControl.TileControl._pauseState)))){
GridControl.startNextMove();
};
};
}
private function checkEndGameAchievements():void{
}
public function loadProgress(_arg1:ProgressEvent):void{
var _local2:Number;
_local2 = ((_arg1.bytesLoaded / _arg1.bytesTotal) * 100);
load_screen.loader.load_bar.scaleX = (_local2 / 100);
}
function browserLoadedHandler(_arg1:Event):void{
_browser.addChild(_loader.content);
_browser.x = 0;
_browser.y = 400;
}
function loadBrowser(_arg1:String):void{
var _local2:URLRequest;
_local2 = new URLRequest(((_arg1 + "?") + String(getTimer())));
_browser = new MovieClip();
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, browserLoadedHandler);
_loader.load(_local2);
}
public function adFinished():void{
load_screen.visible = false;
GameManager.gameState = "MainMenu";
gotoAndPlay(2);
initApplication();
}
public function mouseDown_handler(_arg1:MouseEvent){
switch (GameManager.gameState){
case "Game":
GridControl._penDown = true;
GridControl._drawLayer.graphics.moveTo(mouseX, mouseY);
GridControl._lastLoc = new Point(mouseX, mouseY);
GridControl._pixelsTraveled = 0;
break;
};
}
private function mainLoop(_arg1:Event){
var _local2:Number;
var _local3:String;
_local2 = GameManager.clockPulse();
processInput();
if (GameManager.isNonoba){
NonobaControl.AchievementBoxControl.update(_local2);
};
if (_browser){
if (GameManager.gameState != "MainMenu"){
if (_browser.visible){
_browser.visible = false;
};
};
};
switch (GameManager.gameState){
case "Game":
if (UI_Game._state == "Inactive"){
UI_Game.activate();
LevelControl.startTimer();
GridControl.startNextMove();
};
if (((GameManager.isNonoba) && (GameManager._nonobaAchievementsEnabled))){
checkAchievements();
NonobaControl.updateDebugBox();
};
GridControl.update(_local2);
ScorePopUpControl.update(_local2);
if (!GridControl.TileControl._pauseState){
UI_Game.move_timer.height = (GridControl.pctMoveTimeRemaining() * 2);
};
if (GridControl.isGameOver()){
GameManager.gameState = "GameOver";
};
break;
case "MainMenu":
if (UI_MainMenu._state == "Inactive"){
UI_MainMenu.activate();
UI_Game.deactivate();
_browser.visible = true;
};
if (GameManager.isNonoba){
UI_MainMenu.nonoba_text.text = (("Welcome " + NonobaControl._userName) + "!\nGood luck in Multi Sum, and don't forget to check out my profile for new games!");
} else {
UI_MainMenu.nonoba_text.visible = false;
};
UI_MainMenu.check_rollovers();
break;
case "LevelSetup":
LevelControl.initLevel();
GameManager.updateUI();
GameManager.gameState = "Game";
break;
case "Instructions":
if (UI_Instructions._state == "Inactive"){
UI_Instructions.activate();
};
UI_Instructions.check_rollovers();
break;
case "Credits":
if (UI_Credits._state == "Inactive"){
UI_Credits.activate();
};
UI_Credits.check_rollovers();
break;
case "GameOver":
if (UI_Submit._state == "Inactive"){
GridControl.TileControl.deactivateAll();
UI_Game.deactivate();
UI_Submit.activate();
if (GameManager.isNonoba){
if (GameManager._nonobaAchievementsEnabled){
checkEndGameAchievements();
};
if (GameManager._nonobaHighScoresEnabled){
NonobaControl.saveHighscore("highscores", GameManager.playerScore);
};
};
};
UI_Submit.check_rollovers();
break;
case "Pause":
if (UI_Pause._state == "Inactive"){
UI_Pause.activate();
};
break;
case "SaveHighScore":
if (GameManager._highScoresEnabled){
if (GameManager.isNonoba){
_local3 = ("Nonoba - " + GameManager._userName);
} else {
_local3 = GameManager._userName;
};
HighScoreControl.save_highscore(GameManager.gameID, 0, _local3, LevelControl._currentLevel, GameManager.playerScore, 0, "No Comment");
if (GameManager.isMochi){
SoundManager.stopSound("Soundtrack");
MochiAd.showInterLevelAd({clip:root, id:GameManager.mochiID, res:"640x480", ad_finished:resumeGameAfterAd});
};
};
break;
case "HighScores":
if (UI_HighScores._state == "Inactive"){
UI_HighScores.activate();
HighScoreControl.load_highscores(GameManager.gameID);
};
if (GameManager._highScoresLoaded){
UI_HighScores.update();
GameManager._highScoresLoaded = false;
};
UI_HighScores.check_rollovers();
break;
case "Reset":
GameManager.resetGame();
LevelControl._currentLevel = 1;
GridControl.resetVariables();
GameManager.gameState = "LevelSetup";
if (GameManager.isNonoba){
NonobaControl.resetAchievements();
};
break;
};
}
}
}//package
Section 30
//KittySymbol (KittySymbol)
package {
import flash.display.*;
public dynamic class KittySymbol extends MovieClip {
}
}//package
Section 31
//LevelChangeSFX (LevelChangeSFX)
package {
import flash.media.*;
public dynamic class LevelChangeSFX extends Sound {
}
}//package
Section 32
//LevelManager (LevelManager)
package {
import flash.utils.*;
public class LevelManager {
public var _moveTimerDuration:Number;
public var _currentLevel:int;
public var _duration:Number;
public var _timerInit:Number;
public var _colorRange:int;
public function LevelManager():void{
}
public function startTimer():void{
_timerInit = getTimer();
}
public function initLevel():void{
switch (_currentLevel){
case 1:
_duration = 45;
_moveTimerDuration = 5.75;
_colorRange = 3;
break;
case 2:
_duration = 45;
_moveTimerDuration = 5.75;
_colorRange = 4;
break;
case 3:
_duration = 45;
_moveTimerDuration = 5.5;
_colorRange = 5;
break;
case 4:
_duration = 45;
_moveTimerDuration = 5.5;
_colorRange = 6;
break;
case 5:
_duration = 45;
_moveTimerDuration = 5.25;
_colorRange = 7;
break;
case 6:
_duration = 45;
_moveTimerDuration = 5.25;
_colorRange = 8;
break;
case 7:
_duration = 45;
_moveTimerDuration = 5;
_colorRange = 9;
break;
case 8:
_duration = 45;
_moveTimerDuration = 5;
_colorRange = 9;
break;
case 9:
_duration = 45;
_moveTimerDuration = 4.75;
_colorRange = 9;
break;
case 10:
_duration = 45;
_moveTimerDuration = 4.75;
_colorRange = 9;
break;
case 11:
_duration = 45;
_moveTimerDuration = 4.5;
_colorRange = 9;
break;
case 12:
_duration = 45;
_moveTimerDuration = 4.5;
_colorRange = 9;
break;
case 13:
_duration = 45;
_moveTimerDuration = 4.25;
_colorRange = 9;
break;
case 14:
_duration = 45;
_moveTimerDuration = 4.25;
_colorRange = 9;
break;
case 15:
_duration = 45;
_moveTimerDuration = 4;
_colorRange = 9;
break;
case 16:
_duration = 45;
_moveTimerDuration = 4;
_colorRange = 9;
break;
case 17:
_duration = 45;
_moveTimerDuration = 3.75;
_colorRange = 9;
break;
default:
_duration = 45;
_moveTimerDuration = 3;
_colorRange = 9;
break;
};
}
public function nextLevel():void{
_currentLevel++;
}
public function timerValue():Number{
var _local1:Number;
_local1 = GameManager.elapsedTime(_timerInit);
return (_local1);
}
}
}//package
Section 33
//LoadBarSymbol (LoadBarSymbol)
package {
import flash.display.*;
public dynamic class LoadBarSymbol extends MovieClip {
public var load_bar:MovieClip;
}
}//package
Section 34
//MainMenuScreen (MainMenuScreen)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class MainMenuScreen extends MovieClip {
public var _smallzScale:Number;
public var PlayGame:MovieClip;
public var HighScores:MovieClip;
public var _state:String;
public var Credits:MovieClip;
public var nonoba_text:TextField;
public var Instructions:MovieClip;
public var game_title:TextField;
public var LeaderBoards:MovieClip;
public var Smallzworld:MovieClip;
public function MainMenuScreen():void{
x = 0;
y = 0;
_state = "Inactive";
visible = false;
_smallzScale = Smallzworld.scaleX;
game_title.text = GameManager._gameTitle;
}
public function activate():void{
_state = "Active";
visible = true;
Smallzworld.earth.earth.gotoAndPlay(1);
}
public function check_rollovers():void{
if (PlayGame.hitTestPoint(mouseX, mouseY)){
PlayGame.scaleX = 1.25;
PlayGame.scaleY = 1.25;
} else {
PlayGame.scaleX = 1;
PlayGame.scaleY = 1;
};
if (Instructions.hitTestPoint(mouseX, mouseY)){
Instructions.scaleX = 1.25;
Instructions.scaleY = 1.25;
} else {
Instructions.scaleX = 1;
Instructions.scaleY = 1;
};
if (Credits.hitTestPoint(mouseX, mouseY)){
Credits.scaleX = 1.25;
Credits.scaleY = 1.25;
} else {
Credits.scaleX = 1;
Credits.scaleY = 1;
};
if (HighScores.hitTestPoint(mouseX, mouseY)){
HighScores.scaleX = 1.25;
HighScores.scaleY = 1.25;
} else {
HighScores.scaleX = 1;
HighScores.scaleY = 1;
};
if (Smallzworld.earth.earth.hitTestPoint(mouseX, mouseY)){
Smallzworld.scaleX = (_smallzScale + 0.05);
Smallzworld.scaleY = (_smallzScale + 0.05);
} else {
Smallzworld.scaleX = _smallzScale;
Smallzworld.scaleY = _smallzScale;
};
if (LeaderBoards.hitTestPoint(mouseX, mouseY)){
LeaderBoards.scaleX = 1.25;
LeaderBoards.scaleY = 1.25;
} else {
LeaderBoards.scaleX = 1;
LeaderBoards.scaleY = 1;
};
}
public function menu_mouseUp(_arg1:MouseEvent){
var _local2:URLRequest;
var _local3:URLRequest;
if (PlayGame.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.gameState = "Reset";
};
if (Instructions.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.gameState = "Instructions";
};
if (Credits.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.gameState = "Credits";
};
if (((HighScores.hitTestPoint(_arg1.stageX, _arg1.stageY)) && (!(GameManager.isNonoba)))){
deactivate();
GameManager.gameState = "HighScores";
};
if (((LeaderBoards.hitTestPoint(_arg1.stageX, _arg1.stageY)) && (!(GameManager.isNonoba)))){
_local2 = new URLRequest(("http://games.smallzworld.com/Main.php?PageType=DisplayHighScores&Game_ID=" + GameManager.gameID));
navigateToURL(_local2);
};
if (Smallzworld.hitTestPoint(_arg1.stageX, _arg1.stageY)){
_local3 = new URLRequest("http://games.smallzworld.com/");
navigateToURL(_local3);
};
}
public function deactivate():void{
_state = "Inactive";
visible = false;
Smallzworld.earth.earth.gotoAndStop(1);
}
public function update():void{
switch (_state){
case "Active":
break;
};
}
}
}//package
Section 35
//MeowSFX (MeowSFX)
package {
import flash.media.*;
public dynamic class MeowSFX extends Sound {
}
}//package
Section 36
//Message (Message)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class Message extends MovieClip {
public var loader:Loader;
public var _messageText:String;
public var imageIcon:MovieClip;
public var message_text:TextField;
public var _imageLoaded:Boolean;// = false
public var _imageURL:String;
public var _state:String;
public var _linkURL:String;
public function Message():void{
_imageLoaded = false;
loader = new Loader();
super();
_state = "Inactive";
visible = false;
}
public function activate():void{
_state = "Active";
visible = true;
}
public function deactivate():void{
_state = "Inactive";
visible = false;
}
public function display_message(_arg1:Number, _arg2:Number, _arg3:String, _arg4:String):void{
var _local5:URLRequest;
if (imageIcon){
removeChild(imageIcon);
};
imageIcon = new MovieClip();
addChild(imageIcon);
loader = new Loader();
if (_arg4 == ""){
_arg4 = "http://www.smallzworld.com/media/images/avatars/smallz_avatar.jpg";
};
_local5 = new URLRequest((_arg4 + "?hey=1"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, iconLoaded);
activate();
message_text.text = _arg3;
x = _arg1;
y = _arg2;
loader.load(_local5);
}
private function iconLoaded(_arg1:Event):void{
var _local2:String;
imageIcon.addChild(loader.content);
imageIcon.x = 30;
imageIcon.y = 20;
_local2 = _imageURL.substr((_imageURL.length - 3), 3);
if (_local2 != "swf"){
imageIcon.width = 60;
imageIcon.height = 60;
};
}
}
}//package
Section 37
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return ("2.5");
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var sendHostProgress:Boolean;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
setTimeout(options.ad_finished, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 38
//MuteButton (MuteButton)
package {
import flash.display.*;
public dynamic class MuteButton extends MovieClip {
}
}//package
Section 39
//MyArial (MyArial)
package {
import flash.text.*;
public dynamic class MyArial extends Font {
}
}//package
Section 40
//NonobaAPI (NonobaAPI)
package {
import flash.display.*;
import flash.events.*;
import flash.system.*;
import flash.net.*;
public class NonobaAPI {
public static const SUCCESS:String = "success";
public static const ERROR:String = "error";
public static const NOT_LOGGED_IN:String = "user not logged in";
private static var isInited:Boolean = false;
private static var cachedRequests:Array = [];
private static var api:Object;
private static var loading:Boolean = false;
private static var failed:Boolean = false;
public function NonobaAPI(){
throw (new Error("You cannot create an instance of the NonobaAPI class!"));
}
public static function SubmitScore(_arg1:Stage, _arg2:String, _arg3:Number, _arg4:Function=null){
var stage = _arg1;
var key = _arg2;
var score = _arg3;
var callback = _arg4;
if (!isInited){
init(stage);
};
if (failed){
if (callback != null){
callback(ERROR);
};
return;
};
if (((api.content) && (api.content.SubmitScore))){
api.content.SubmitScore(stage, key, score, callback);
} else {
cachedRequests.push(function (){
SubmitScore(stage, key, score, callback);
});
};
}
private static function handleLoadCompleate(_arg1:Event){
emptyQueue();
}
private static function emptyQueue(){
var _local1:int;
_local1 = 0;
while (_local1 < cachedRequests.length) {
var _local2 = cachedRequests;
_local2[_local1]();
_local1++;
};
cachedRequests = [];
}
private static function init(_arg1:Stage){
var _local2:Object;
var _local3:URLRequest;
isInited = true;
_local2 = LoaderInfo(_arg1.root.loaderInfo).parameters;
if (!_local2.nonoba$apicodeas3){
enterErrorState();
return;
};
Security.allowDomain("*");
Security.allowInsecureDomain("*");
api = new Loader();
_local3 = new URLRequest(_local2.nonoba$apicodeas3);
api.contentLoaderInfo.addEventListener(Event.COMPLETE, handleLoadCompleate);
api.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, enterErrorState);
api.load(_local3);
}
private static function enterErrorState(_arg1:Event=null){
failed = true;
emptyQueue();
}
public static function GetUserData(_arg1:Stage, _arg2:String, _arg3:Function=null){
var stage = _arg1;
var key = _arg2;
var callback = _arg3;
if (!isInited){
init(stage);
};
if (failed){
if (callback != null){
callback(ERROR);
};
return;
};
if (((api.content) && (api.content.GetUserData))){
api.content.GetUserData(stage, key, callback);
} else {
cachedRequests.push(function (){
GetUserData(stage, key, callback);
});
};
}
public static function AwardAchievement(_arg1:Stage, _arg2:String, _arg3:Function=null){
var stage = _arg1;
var key = _arg2;
var callback = _arg3;
if (!isInited){
init(stage);
};
if (failed){
if (callback != null){
callback(ERROR, 0);
};
return;
};
if (((api.content) && (api.content.AwardAchievement))){
api.content.AwardAchievement(stage, key, callback);
} else {
cachedRequests.push(function (){
AwardAchievement(stage, key, callback);
});
};
}
public static function GetUsername(_arg1:Stage, _arg2:Function=null){
var stage = _arg1;
var callback = _arg2;
if (!isInited){
init(stage);
};
if (failed){
if (callback != null){
callback(ERROR, "");
};
return;
};
if (((api.content) && (api.content.GetUsername))){
api.content.GetUsername(stage, callback);
} else {
cachedRequests.push(function (){
GetUsername(stage, callback);
});
};
}
public static function SetUserData(_arg1:Stage, _arg2:String, _arg3:String, _arg4:Function=null){
var stage = _arg1;
var key = _arg2;
var value = _arg3;
var callback = _arg4;
if (!isInited){
init(stage);
};
if (failed){
if (callback != null){
callback(ERROR);
};
return;
};
if (((api.content) && (api.content.SetUserData))){
api.content.SetUserData(stage, key, value, callback);
} else {
cachedRequests.push(function (){
SetUserData(stage, key, value, callback);
});
};
}
}
}//package
Section 41
//NonobaDebugBox (NonobaDebugBox)
package {
import flash.display.*;
import flash.text.*;
public dynamic class NonobaDebugBox extends MovieClip {
public var log:TextField;
}
}//package
Section 42
//NonobaManager (NonobaManager)
package {
import flash.display.*;
import flash.utils.*;
public class NonobaManager extends MovieClip {
public var _achievements:Array;
public var _userName:String;// = "Default"
public var AchievementBoxControl:AchievementBoxManager;
public var _state:String;
public var _debugToggleDelay:Number;// = 0.25
public var _debugBox:NonobaDebugBox;
public var _debugToggleInitTime:Number;
public function NonobaManager():void{
_userName = "Default";
_achievements = new Array();
_debugToggleDelay = 0.25;
super();
AchievementBoxControl = new AchievementBoxManager();
addChild(AchievementBoxControl);
AchievementBoxControl.init(15);
if (GameManager._nonobaDebuggerEnabled){
_debugBox = new NonobaDebugBox();
addChild(_debugBox);
_debugToggleInitTime = getTimer();
};
}
public function toggleDebugBox():void{
if (((GameManager.isNonoba) && (GameManager._nonobaDebuggerEnabled))){
if (GameManager.elapsedTime(_debugToggleInitTime) > _debugToggleDelay){
if (_debugBox.visible){
_debugBox.visible = false;
} else {
_debugBox.visible = true;
};
_debugToggleInitTime = getTimer();
};
};
}
public function resetAchievements():void{
var _local1:int;
var _local2:int;
_local2 = _achievements.length;
_local1 = 0;
while (_local1 < _local2) {
_achievements[_local1]._isAchieved = false;
_local1++;
};
}
public function markAchievement(_arg1:String):void{
var _local2:int;
var _local3:int;
_local3 = _achievements.length;
_local2 = 0;
while (_local2 < _local3) {
if (_achievements[_local2]._achievementKey == _arg1){
setAchievement(_arg1);
_achievements[_local2]._isAchieved = true;
spawnAchievementBox((("Congrats, you achieved " + _achievements[_local2]._achievementName) + "!"), 3);
break;
};
_local2++;
};
}
public function getUsername():void{
_userName = "Error Clown Sent";
NonobaAPI.GetUsername(stage, function (_arg1:String, _arg2:String){
switch (_arg1){
case NonobaAPI.SUCCESS:
_userName = _arg2;
break;
case NonobaAPI.NOT_LOGGED_IN:
_arg2 = "Clown";
break;
case NonobaAPI.ERROR:
_arg2 = "Error Clown";
break;
};
_userName = _arg2;
GameManager._userName = _userName;
});
}
public function updateDebugBox():void{
if (((GameManager.isNonoba) && (GameManager._nonobaDebuggerEnabled))){
_debugBox.log.text = achievementsLogString();
};
}
public function spawnAchievementBox(_arg1:String, _arg2:Number):void{
AchievementBoxControl.spawn(_arg1, _arg2);
}
public function setAchievement(_arg1:String):void{
var achievementKey = _arg1;
if (GameManager._nonobaSendEnabled){
NonobaAPI.AwardAchievement(this.stage, achievementKey, function (_arg1:String, _arg2:Number){
switch (_arg1){
case NonobaAPI.SUCCESS:
break;
case NonobaAPI.NOT_LOGGED_IN:
break;
case NonobaAPI.ERROR:
break;
};
});
};
}
public function isAchieved(_arg1:String):Boolean{
var _local2:int;
var _local3:int;
var _local4:Boolean;
_local3 = _achievements.length;
_local2 = 0;
while (_local2 < _local3) {
if (_achievements[_local2]._achievementKey == _arg1){
_local4 = _achievements[_local2]._isAchieved;
break;
};
_local2++;
};
return (_local4);
}
public function saveHighscore(_arg1:String, _arg2:Number):void{
var keyName = _arg1;
var playerScore = _arg2;
if (GameManager._nonobaSendEnabled){
NonobaAPI.SubmitScore(this.stage, keyName, playerScore, function (_arg1:String){
switch (_arg1){
case NonobaAPI.SUCCESS:
break;
case NonobaAPI.NOT_LOGGED_IN:
break;
case NonobaAPI.ERROR:
break;
};
});
};
}
public function achievementsLogString():String{
var _local1:String;
var _local2:int;
var _local3:int;
_local1 = "";
_local3 = _achievements.length;
_local2 = 0;
while (_local2 < _local3) {
_local1 = ((((_local1 + _achievements[_local2]._achievementName) + " : ") + String(_achievements[_local2]._isAchieved)) + "\n");
_local2++;
};
return (_local1);
}
public function addAchievement(_arg1:String, _arg2:String, _arg3:int):void{
_achievements[_achievements.length] = new AchievementRecord(_arg1, _arg2, _arg3);
}
}
}//package
Section 43
//PauseScreen (PauseScreen)
package {
import flash.display.*;
import flash.events.*;
public class PauseScreen extends MovieClip {
public var _state:String;
public var Continue:MovieClip;
public function PauseScreen():void{
x = 0;
y = 0;
_state = "Inactive";
visible = false;
}
public function activate():void{
_state = "Active";
visible = true;
}
public function menu_mouseUp(_arg1:MouseEvent):void{
if (Continue.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.gameState = "MainMenu";
};
}
public function deactivate():void{
_state = "Inactive";
visible = false;
}
public function update():void{
switch (_state){
case "Active":
break;
};
}
}
}//package
Section 44
//PopUp (PopUp)
package {
import flash.geom.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class PopUp extends MovieClip {
public var _duration:Number;
public var _isComplete:Boolean;
public var box_text:TextField;
public var _scale:Number;
public var _initTime:Number;
public var _state:String;
public var _defaultCaption:String;// = "You know how we do!"
public var title_text:TextField;
public var _defaultDuration:Number;// = 3
public var _scaleSpeed:Number;// = 250
public var _defalutLoc:Point;
public var _defaultBody:String;// = "This is where you put popup text"
public function PopUp():void{
_scaleSpeed = 250;
_defaultDuration = 3;
_defalutLoc = new Point(0, 0);
_defaultCaption = "You know how we do!";
_defaultBody = "This is where you put popup text";
super();
deactivate();
}
public function startTimer():void{
_initTime = getTimer();
}
public function activate(_arg1, _arg2:String, _arg3:Point, _arg4:Number):void{
x = _arg3.x;
y = _arg3.y;
_state = "Active";
title_text.text = _arg1;
box_text.text = _arg2;
_duration = _arg4;
transitionIn();
_isComplete = false;
visible = true;
}
public function transitionIn():void{
_scale = 0.01;
scaleX = _scale;
scaleY = _scale;
_state = "Grow";
}
public function deactivate():void{
_state = "Inactive";
visible = false;
_isComplete = true;
}
public function transitionOut():void{
_state = "Shrink";
}
public function update(_arg1:Number):void{
switch (_state){
case "Active":
if (isDone()){
transitionOut();
};
break;
case "Grow":
_scale = (_scale + ((_arg1 * _scaleSpeed) / 100));
if (_scale >= 1){
_scale = 1;
startTimer();
_state = "Active";
};
scaleX = _scale;
scaleY = _scale;
break;
case "Shrink":
_scale = (_scale - ((_arg1 * _scaleSpeed) / 100));
if (_scale <= 0.1){
_scale = 1;
deactivate();
};
scaleX = _scale;
scaleY = _scale;
break;
case "Inactive":
break;
};
}
public function isDone():Boolean{
var _local1:Boolean;
_local1 = false;
if (GameManager.elapsedTime(_initTime) >= _duration){
_local1 = true;
};
return (_local1);
}
}
}//package
Section 45
//ScorePopUp (ScorePopUp)
package {
import flash.display.*;
import classes.smallz.*;
import classes.game.*;
public class ScorePopUp extends MovieClip {
public var _speed;// = 100
public var _spawnState:Boolean;// = true
public var _state:String;
public var _scoreValue:String;
public var PointText:MovieClip;
public function ScorePopUp():void{
_speed = 100;
_spawnState = true;
super();
addFrameScript(22, frame23);
deactivate();
}
public function activate():void{
visible = true;
_state = "Active";
_spawnState = false;
}
public function deactivate():void{
_state = "Inactive";
visible = false;
}
function frame23(){
this.stop();
}
public function update(_arg1:Number):void{
switch (_state){
case "Active":
y = (y - (_arg1 * _speed));
if (PointText){
if (PointText.PointText){
PointText.PointText.text = _scoreValue;
};
};
if (currentFrame == totalFrames){
deactivate();
};
break;
};
}
}
}//package
Section 46
//ScorePopUpManager (ScorePopUpManager)
package {
import flash.geom.*;
import flash.display.*;
public class ScorePopUpManager extends MovieClip {
public var active:Array;
public var popups:Array;
public var _scale:Number;// = 0.5
public function ScorePopUpManager():void{
popups = new Array();
active = new Array();
_scale = 0.5;
super();
}
public function inactive_popup():int{
var _local1:int;
var _local2:int;
var _local3:int;
_local2 = -1;
_local3 = popups.length;
_local1 = 0;
while (_local1 < _local3) {
if (popups[_local1]._spawnState){
_local2 = _local1;
break;
};
_local1++;
};
return (_local2);
}
public function activate(_arg1:Point, _arg2:String):void{
var popupIndex:int;
var screenLoc = _arg1;
var scoreString = _arg2;
popupIndex = inactive_popup();
active.push(popups[popupIndex]);
var _local4 = popups[popupIndex];
with (_local4) {
activate();
x = screenLoc.x;
y = screenLoc.y;
scaleX = _scale;
scaleY = _scale;
_scoreValue = scoreString;
gotoAndPlay(1);
};
}
public function init(_arg1:int){
var _local2:int;
_local2 = 0;
while (_local2 < _arg1) {
popups[_local2] = new ScorePopUp();
addChild(popups[_local2]);
_local2++;
};
}
public function deactivateAllPopups():void{
var _local1:int;
var _local2:int;
_local2 = popups.length;
_local1 = 0;
while (_local1 < _local2) {
popups[_local1].deactivate();
popups[_local1]._spawnState = true;
_local1++;
};
active = new Array();
}
public function update(_arg1:Number):void{
var index:int;
var popupCount:int;
var elapsedTime = _arg1;
popupCount = active.length;
index = 0;
while (index < popupCount) {
var _local3 = active[index];
with (_local3) {
if (_state == "Inactive"){
_spawnState = true;
active.splice(index, 1);
index--;
popupCount--;
} else {
update(elapsedTime);
};
};
index = (index + 1);
};
}
}
}//package
Section 47
//ShockSFX (ShockSFX)
package {
import flash.media.*;
public dynamic class ShockSFX extends Sound {
}
}//package
Section 48
//smallzColor (smallzColor)
package {
import flash.display.*;
import fl.motion.*;
public class smallzColor {
public function smallzColor():void{
}
public static function Tint(_arg1:MovieClip, _arg2:int, _arg3:Number):void{
var _local4:*;
_local4 = new Color();
_local4.setTint(_arg2, _arg3);
_arg1.transform.colorTransform = _local4;
}
}
}//package
Section 49
//smallzDebug (smallzDebug)
package {
import flash.text.*;
import flash.filters.*;
public class smallzDebug {
private var _log:Array;
private var _active:Boolean;
public var _window:TextField;
public function smallzDebug(_arg1:Number, _arg2:Number, _arg3:Boolean):void{
var _local4:DropShadowFilter;
var _local5:GlowFilter;
var _local6:TextFormat;
super();
_local4 = new DropShadowFilter(2, 45, 0, 25, 3, 3, 2, 2);
_local5 = new GlowFilter(0, 100, 2, 2, 2000, 1, false, false);
_active = _arg3;
_window = new TextField();
_window.x = _arg1;
_window.y = _arg2;
_window.multiline = true;
_window.wordWrap = true;
_window.width = 640;
_window.height = 480;
_window.selectable = false;
_window.text = "";
_window.filters = [_local5];
_log = new Array();
_local6 = new TextFormat();
_local6.font = "Arial";
_local6.bold = true;
_local6.size = 16;
_local6.color = 0xFFFFFF;
_window.defaultTextFormat = _local6;
}
public function update():void{
var _local1:int;
if (_active){
if (!_window.visible){
_window.visible = true;
};
_window.text = "";
_local1 = 0;
while (_local1 <= (_log.length - 1)) {
_window.appendText(_log[_local1]);
_window.appendText("\n");
_local1++;
};
} else {
if (_window.visible){
_window.visible = false;
};
};
}
public function add_trace(_arg1:String):void{
if (GameManager.Debug){
_log.push(_arg1);
};
}
public function clear_log():void{
var _local1:int;
var _local2:int;
_local2 = _log.length;
_local1 = 0;
while (_local1 < _local2) {
_log.pop();
_local1++;
};
}
public function deactivate():void{
_active = false;
}
public function activate():void{
_active = true;
}
}
}//package
Section 50
//smallzFilter (smallzFilter)
package {
import flash.display.*;
import flash.filters.*;
public class smallzFilter {
public function smallzFilter():void{
}
public static function bevel(_arg1:MovieClip, _arg2:String, _arg3:Number, _arg4:String, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:int, _arg12:String, _arg13:Boolean):void{
var _local14:BevelFilter;
var _local15:Array;
_local14 = new BevelFilter();
_local15 = new Array();
_local15 = _arg1.filters;
_local14.distance = _arg6;
_local14.angle = _arg7;
_local14.highlightColor = new Number(_arg2);
_local14.highlightAlpha = _arg3;
_local14.shadowColor = new Number(_arg4);
_local14.shadowAlpha = _arg5;
_local14.blurX = _arg8;
_local14.blurY = _arg9;
_local14.strength = _arg10;
_local14.quality = _arg11;
_local14.type = _arg12;
_local14.knockout = _arg13;
_local15.push(_local14);
_arg1.filters = _local15;
}
public static function glow(_arg1:MovieClip, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{
var _local7:GlowFilter;
var _local8:Array;
_local7 = new GlowFilter();
_local8 = new Array();
_local8 = _arg1.filters;
_local7.color = new Number(_arg2);
_local7.alpha = _arg4;
_local7.strength = _arg3;
_local7.blurX = _arg5;
_local7.blurY = _arg6;
_local8.push(_local7);
_arg1.filters = _local8;
}
public static function removeFilters(_arg1:MovieClip):void{
var _local2:Array;
_local2 = new Array();
_arg1.filters = _local2;
}
}
}//package
Section 51
//smallzFPS (smallzFPS)
package {
import flash.text.*;
import flash.utils.*;
public class smallzFPS {
private var _frameCount:int;
private var _initTime:Number;
private var _fps:Number;
private var _curTime:Number;
private var _sampleSize:int;
public var _fpsCounter:TextField;
public function smallzFPS(_arg1:Number, _arg2:Number, _arg3:int):void{
var _local4:Font;
var _local5:TextFormat;
super();
_local4 = new MyArial();
_local5 = new TextFormat();
_local5.font = _local4.fontName;
_local5.bold = true;
_local5.size = 14;
_local5.color = 0xFFFFFF;
_initTime = getTimer();
_sampleSize = _arg3;
_frameCount = 0;
_fps = 0;
_fpsCounter = new TextField();
_fpsCounter.embedFonts = true;
_fpsCounter.defaultTextFormat = _local5;
_fpsCounter.x = _arg1;
_fpsCounter.y = _arg2;
}
public function get_fps():Number{
return (_fps);
}
public function update(){
var _local1:Number;
_frameCount++;
_curTime = getTimer();
if (_frameCount == _sampleSize){
_local1 = (_curTime - _initTime);
_fps = ((_frameCount / _local1) * 1000);
_initTime = _curTime;
_frameCount = 0;
_fpsCounter.text = String(("FPS : " + int(_fps)));
};
}
}
}//package
Section 52
//smallzKeyboardManager (smallzKeyboardManager)
package {
import flash.display.*;
import flash.events.*;
public class smallzKeyboardManager extends Sprite {
public var pressed:Array;
public function smallzKeyboardManager(){
pressed = new Array();
super();
}
public function init(){
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
}
public function kill(){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyReleased);
}
public function isPressed(_arg1:int){
if (pressed.indexOf(_arg1) == -1){
return (false);
};
return (true);
}
public function keyPressed(_arg1:KeyboardEvent){
var _local2:int;
_local2 = pressed.indexOf(_arg1.keyCode);
if (_local2 == -1){
pressed.push(_arg1.keyCode);
};
}
public function keyReleased(_arg1:KeyboardEvent){
var _local2:int;
_local2 = pressed.indexOf(_arg1.keyCode);
if (_local2 != -1){
pressed.splice(_local2, 1);
};
}
}
}//package
Section 53
//smallzMath (smallzMath)
package {
import flash.geom.*;
public class smallzMath {
public static function random_point(_arg1:Number, _arg2:Number):Point{
var _local3:Point;
_local3 = new Point(0, 0);
_local3.x = (Math.random() * _arg1);
_local3.y = (Math.random() * _arg2);
return (_local3);
}
public static function pGetAngle(_arg1:Point, _arg2:Point):Number{
return (Math.atan2((_arg2.y - _arg1.y), (_arg2.x - _arg1.x)));
}
public static function pDistance(_arg1:Point, _arg2:Point):Number{
var _local3:Number;
_local3 = Math.sqrt((((_arg1.x - _arg2.x) * (_arg1.x - _arg2.x)) + ((_arg1.y - _arg2.y) * (_arg1.y - _arg2.y))));
return (_local3);
}
public static function getDistance(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
_local5 = Math.sqrt((((_arg1 - _arg3) * (_arg1 - _arg3)) + ((_arg2 - _arg4) * (_arg2 - _arg4))));
return (_local5);
}
public static function get_angle_point(_arg1:Point, _arg2:Point):Number{
return (Math.atan2((_arg2.y - _arg1.y), (_arg2.x - _arg1.x)));
}
public static function getAngle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (Math.atan2((_arg4 - _arg2), (_arg3 - _arg1)));
}
}
}//package
Section 54
//SoundManager (SoundManager)
package {
import flash.media.*;
public class SoundManager {
public static var _sounds:Array = new Array();
public static var _mute:Boolean = false;
public function SoundManager():void{
}
public static function loopSound(_arg1:String):void{
var _local2:int;
var _local3:int;
_local3 = _sounds.length;
if (!_mute){
_local2 = 0;
while (_local2 < _local3) {
if (_sounds[_local2]._identifier == _arg1){
_sounds[_local2]._channel = _sounds[_local2]._sound.play(0, 999, _sounds[_local2]._transform);
break;
};
_local2++;
};
};
}
public static function restartSound(_arg1:String, _arg2:int=0):void{
var _local3:int;
var _local4:int;
_local4 = _sounds.length;
_local3 = 0;
while (_local3 < _local4) {
if (_sounds[_local3]._identifier == _arg1){
_sounds[_local3]._channel = _sounds[_local3]._sound.play(_sounds[_local3]._position, _arg2);
break;
};
_local3++;
};
}
public static function stopAllSounds():void{
var _local1:int;
var _local2:int;
_local2 = _sounds.length;
_local1 = 0;
while (_local1 < _local2) {
_local1++;
};
}
public static function playSound(_arg1:String):void{
var _local2:int;
var _local3:int;
_local3 = _sounds.length;
if (!_mute){
_local2 = 0;
while (_local2 < _local3) {
if (_sounds[_local2]._identifier == _arg1){
_sounds[_local2]._channel = _sounds[_local2]._sound.play(0, 0, _sounds[_local2]._transform);
break;
};
_local2++;
};
};
}
public static function stopSound(_arg1:String):void{
var _local2:int;
var _local3:int;
_local3 = _sounds.length;
_local2 = 0;
while (_local2 < _local3) {
if (_sounds[_local2]._identifier == _arg1){
_sounds[_local2]._position = _sounds[_local2]._channel.position;
_sounds[_local2]._channel.stop();
break;
};
_local2++;
};
}
public static function addSound(_arg1:String, _arg2:Sound):void{
var _local3:SoundRecord;
var _local4:SoundChannel;
var _local5:SoundTransform;
_local5 = new SoundTransform();
_local5.volume = 1;
_local3 = new SoundRecord(_arg1, _arg2, _local4, _local5);
_sounds.push(_local3);
}
}
}//package
Section 55
//SoundRecord (SoundRecord)
package {
import flash.media.*;
public class SoundRecord {
public var _channel:SoundChannel;
public var _position:Number;
public var _transform:SoundTransform;
public var _identifier:String;
public var _sound:Sound;
public function SoundRecord(_arg1:String, _arg2:Sound, _arg3:SoundChannel, _arg4:SoundTransform):void{
_identifier = _arg1;
_sound = _arg2;
_channel = _arg3;
_transform = _arg4;
_position = 0;
}
}
}//package
Section 56
//SoundtrackMusic (SoundtrackMusic)
package {
import flash.media.*;
public dynamic class SoundtrackMusic extends Sound {
}
}//package
Section 57
//SubmitScoreScreen (SubmitScoreScreen)
package {
import flash.display.*;
import flash.events.*;
public class SubmitScoreScreen extends MovieClip {
public var _state:String;
public var nonoba_box:MovieClip;
public var smallz_box:MovieClip;
public function SubmitScoreScreen():void{
x = 0;
y = 0;
_state = "Inactive";
visible = false;
}
public function activate():void{
_state = "Active";
visible = true;
if (GameManager.isNonoba){
nonoba_box.visible = true;
smallz_box.visible = false;
nonoba_box.x = 190;
nonoba_box.y = 180;
nonoba_box.score.text = ("Final Score " + String(GameManager.playerScore));
} else {
nonoba_box.visible = false;
smallz_box.visible = true;
smallz_box.x = 190;
smallz_box.y = 180;
smallz_box.score.text = ("Final Score " + String(GameManager.playerScore));
};
}
public function check_rollovers():void{
if (GameManager.isNonoba){
if (nonoba_box.Continue.hitTestPoint(mouseX, mouseY)){
nonoba_box.Continue.scaleX = 1.25;
nonoba_box.Continue.scaleY = 1.25;
} else {
nonoba_box.Continue.scaleX = 1;
nonoba_box.Continue.scaleY = 1;
};
} else {
if (smallz_box.Submit.hitTestPoint(mouseX, mouseY)){
smallz_box.Submit.scaleX = 1.25;
smallz_box.Submit.scaleY = 1.25;
} else {
smallz_box.Submit.scaleX = 1;
smallz_box.Submit.scaleY = 1;
};
if (smallz_box.Cancel.hitTestPoint(mouseX, mouseY)){
smallz_box.Cancel.scaleX = 1.25;
smallz_box.Cancel.scaleY = 1.25;
} else {
smallz_box.Cancel.scaleX = 1;
smallz_box.Cancel.scaleY = 1;
};
};
}
public function menu_mouseUp(_arg1:MouseEvent):void{
if (GameManager.isNonoba){
if (nonoba_box.Continue.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.gameState = "SaveHighScore";
};
} else {
if (smallz_box.Cancel.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.gameState = "MainMenu";
};
if (((smallz_box.Submit.hitTestPoint(_arg1.stageX, _arg1.stageY)) && (smallz_box.Submit.visible))){
deactivate();
GameManager._userName = smallz_box.user_name.text;
GameManager.gameState = "SaveHighScore";
};
};
}
public function deactivate():void{
_state = "Inactive";
visible = false;
}
public function update():void{
switch (_state){
case "Active":
break;
};
}
}
}//package
Section 58
//Tile (Tile)
package {
import flash.geom.*;
import flash.display.*;
public class Tile extends MovieClip {
public var _kittenClip:MovieClip;
public var _type:int;
public var _kittenScale;// = 0.3
public var _speed:Number;// = 250
public var _scale:Number;
public var _targetLoc:Point;
public var _spawnState:Boolean;// = true
public var _number:int;
private var _blinking:Boolean;// = false
public var _state:String;
public var _tagged:Boolean;// = false
public var _frame:tile_frame;
public var _highlighted:Boolean;// = false
public var _kittens:Array;
private var _colors:Array;
public var _scaleSpeed:Number;// = 6
public var _index:int;
public function Tile():void{
_speed = 250;
_scaleSpeed = 6;
_spawnState = true;
_highlighted = false;
_tagged = false;
_targetLoc = new Point(0, 0);
_kittens = new Array();
_kittenScale = 0.3;
_colors = new Array(0xFF0000, 0xFF00, 7172071, 16751001, 0xFFFF00, 0xFFFF, 0x993300, 0, 0xFFFFFF);
_blinking = false;
super();
_frame = new tile_frame();
_kittenClip = new Kitty();
addChild(_frame);
addChild(_kittenClip);
_kittenClip.eyes.gotoAndStop(1);
deactivate();
}
public function activate():void{
_state = "Active";
visible = true;
_spawnState = false;
_kittenClip.scaleX = _kittenScale;
_kittenClip.scaleY = _kittenScale;
}
public function unhighlight():void{
smallzFilter.removeFilters(_kittenClip);
_highlighted = false;
}
public function setKittenColor(_arg1:int):void{
smallzColor.Tint(_kittenClip.color_clip, _colors[_arg1], 1);
}
public function deactivate():void{
_state = "Inactive";
visible = false;
}
public function highlight():void{
var _local1:Number;
_local1 = ((Math.random() * 5) + 2);
smallzFilter.removeFilters(_kittenClip);
smallzFilter.glow(_kittenClip, "0xFFFF00", _local1, 1, 10, 10);
_highlighted = true;
}
public function update(_arg1:Number):void{
var _local2:int;
switch (_state){
case "Active":
if (_tagged){
highlight();
};
if (_kittenClip.eyes.currentFrame == 1){
_local2 = int(((Math.random() * 1000) + 1));
if (_local2 < 20){
_kittenClip.eyes.gotoAndPlay(2);
};
};
break;
case "Inactive":
break;
case "Dropping":
y = (y + (_speed * _arg1));
if (y > _targetLoc.y){
y = _targetLoc.y;
_state = "Active";
};
break;
case "Rising":
y = (y - (_speed * _arg1));
if (y < _targetLoc.y){
y = _targetLoc.y;
_state = "Active";
};
break;
case "Explode":
_scale = (_scale - (_scaleSpeed * _arg1));
if (_scale < 0.25){
deactivate();
_scale = 1;
};
scaleX = _scale;
scaleY = _scale;
break;
};
}
public function explode():void{
_state = "Explode";
}
}
}//package
Section 59
//tile_frame (tile_frame)
package {
import flash.display.*;
public dynamic class tile_frame extends MovieClip {
}
}//package
Section 60
//TileManager (TileManager)
package {
import flash.geom.*;
import flash.display.*;
public class TileManager extends MovieClip {
public var active:Array;
public var clips:Array;
public var _pauseState:Boolean;// = false
public function TileManager():void{
clips = new Array();
active = new Array();
_pauseState = false;
super();
}
public function init(_arg1:Number):void{
var _local2:int;
_local2 = 0;
while (_local2 < _arg1) {
clips[_local2] = new Tile();
addChild(clips[_local2]);
clips[_local2]._index = _local2;
_local2++;
};
}
public function inactiveClip():int{
var _local1:int;
var _local2:int;
var _local3:int;
_local2 = -1;
_local3 = clips.length;
_local1 = 0;
while (_local1 < _local3) {
if (clips[_local1]._spawnState){
_local2 = _local1;
break;
};
_local1++;
};
return (_local2);
}
public function unhighlightAll():void{
var index:int;
var count:int;
count = active.length;
index = 0;
while (index < count) {
var _local2 = active[index];
with (_local2) {
unhighlight();
};
index = (index + 1);
};
}
public function spawn(_arg1:Point, _arg2:int):int{
var clipIndex:int;
var screenLoc = _arg1;
var colorIndex = _arg2;
clipIndex = inactiveClip();
if (clipIndex >= 0){
var _local4 = clips[clipIndex];
with (_local4) {
activate();
x = screenLoc.x;
y = screenLoc.y;
_scale = 1;
scaleX = _scale;
scaleY = _scale;
_tagged = false;
unhighlight();
_type = colorIndex;
setKittenColor(_type);
_frame.visible = false;
active.push(clips[clipIndex]);
};
};
return (clipIndex);
}
public function deactivateAll():void{
var _local1:int;
var _local2:int;
_local2 = clips.length;
_local1 = 0;
while (_local1 < _local2) {
clips[_local1].deactivate();
clips[_local1]._spawnState = true;
_local1++;
};
active = new Array();
}
public function shiftUp():void{
var index:int;
var count:int;
count = active.length;
index = 0;
while (index < count) {
var _local2 = active[index];
with (_local2) {
_targetLoc.y = (_targetLoc.y - height);
_state = "Rising";
};
index = (index + 1);
};
}
public function update(_arg1:Number):void{
var index:int;
var count:int;
var elapsedTime = _arg1;
count = active.length;
_pauseState = false;
index = 0;
while (index < count) {
var _local3 = active[index];
with (_local3) {
if ((((((_state == "Dropping")) || ((_state == "Rising")))) || ((_state == "Explode")))){
_pauseState = true;
};
if (_state == "Inactive"){
_spawnState = true;
active.splice(index, 1);
index--;
count--;
} else {
update(elapsedTime);
};
};
index = (index + 1);
};
}
}
}//package
Section 61
//TinkleSFX (TinkleSFX)
package {
import flash.media.*;
public dynamic class TinkleSFX extends Sound {
}
}//package