Section 1
//audio_clips_31 (disco_fish_fla.audio_clips_31)
package disco_fish_fla {
import flash.display.*;
public dynamic class audio_clips_31 extends MovieClip {
public function audio_clips_31(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package disco_fish_fla
Section 2
//LoadBar_3 (disco_fish_fla.LoadBar_3)
package disco_fish_fla {
import flash.display.*;
public dynamic class LoadBar_3 extends MovieClip {
public var Fill:MovieClip;
}
}//package disco_fish_fla
Section 3
//sunshine_meter_25 (disco_fish_fla.sunshine_meter_25)
package disco_fish_fla {
import flash.display.*;
public dynamic class sunshine_meter_25 extends MovieClip {
public var bar:MovieClip;
}
}//package disco_fish_fla
Section 4
//Bubble (game.Bubble)
package game {
import flash.display.*;
public class Bubble extends MovieClip {
public var _type:int;
public var _speed:Number;
public var _scale:Number;
public var _state:String;
public function Bubble():void{
_state = "Inactive";
visible = false;
}
public function shake():void{
x = (x + (((Math.random() * 6) + 1) - 3));
}
public function activate():void{
_state = "Active";
_speed = (((Math.random() * 3) * 1.25) + 4);
x = (Math.random() * 640);
y = (480 + height);
_scale = (((Math.random() * 30) + 30) / 100);
scaleX = _scale;
scaleY = _scale;
alpha = 0.4;
visible = true;
}
public function deactivate():void{
_state = "Inactive";
visible = false;
}
public function update():void{
var _local1:Number;
switch (_state){
case "Active":
y = (y - _speed);
shake();
if (y < -(height)){
deactivate();
};
break;
};
}
}
}//package game
Section 5
//Credits (game.Credits)
package game {
import flash.display.*;
import flash.events.*;
public class Credits extends MovieClip {
public var _type:int;
public var _scale:Number;
public var _state:String;
public var Continue:MovieClip;
public var _angle:Number;
public function Credits():void{
x = 0;
y = 0;
_state = "Inactive";
visible = false;
}
public function activate(){
_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 deactivate(){
_state = "Inactive";
visible = false;
}
public function menu_mouseUp(_arg1:MouseEvent){
if (Continue.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.change_gameState("MainMenu");
};
}
public function update():void{
switch (_state){
case "Active":
break;
};
}
}
}//package game
Section 6
//Fish (game.Fish)
package game {
import flash.display.*;
public class Fish extends MovieClip {
public var _direction:String;
public var _Fishx:Number;
public var _Fishy:Number;
public var _type:int;
public var _speed:Number;
public var _scale:Number;
public var _state:String;
public var _xs:Number;
public var _ys:Number;
public var _angle:Number;
public function Fish():void{
_state = "Inactive";
visible = false;
}
public function activate(_arg1:Boolean):void{
var _local2:int;
_local2 = int(((Math.random() * 7) + 2));
_state = "Active";
if (!_arg1){
_speed = (((Math.random() * 3) + 3) + (GameManager.level * 0.035));
_direction = random_direction();
switch (_direction){
case "Left":
x = (640 + width);
_speed = -(_speed);
break;
case "Right":
x = -(width);
break;
};
y = ((Math.random() * 425) + 25);
gotoAndStop(_local2);
_scale = (((Math.random() * 30) + 70) / 100);
scaleX = _scale;
scaleY = _scale;
if (_direction == "Right"){
scaleX = -(_scale);
};
} else {
_scale = 0.75;
scaleX = _scale;
scaleY = _scale;
gotoAndStop(1);
};
visible = true;
}
private function random_direction():String{
var _local1:int;
_local1 = int(((Math.random() * 2) + 1));
if (_local1 == 1){
return ("Left");
};
return ("Right");
}
public function deactivate():void{
_state = "Inactive";
visible = false;
}
public function bob():void{
y = (y + (((Math.random() * 5) + 1) - 3.5));
}
public function update():void{
var _local1:Number;
switch (_state){
case "Active":
x = (x + _speed);
bob();
switch (_direction){
case "Left":
if (x < -(width)){
deactivate();
};
break;
case "Right":
if (x > (640 + width)){
deactivate();
};
break;
};
break;
};
}
public function update_loc(_arg1:Number, _arg2:Number):void{
if (Math.abs((_arg1 - x)) > 1){
if (_arg1 > x){
scaleX = -(_scale);
} else {
scaleX = _scale;
};
};
x = _arg1;
y = _arg2;
}
}
}//package game
Section 7
//GameManager (game.GameManager)
package game {
public class GameManager {
public static var level:int = 1;
public static var gameID:int = 9;
public static var playerScore:uint = 0;
public static var health:Number = 100;
public static var gameState:String = "MainMenu";
public function GameManager():void{
}
public static function resetGame():void{
playerScore = 0;
health = 100;
level = 1;
gameState = "Core";
}
public static function increment_health(_arg1:Number):void{
health = (health + _arg1);
if (health > 100){
health = 100;
};
}
public static function increment_score(_arg1:uint):void{
playerScore = (playerScore + _arg1);
}
public static function change_gameState(_arg1:String):void{
gameState = _arg1;
}
public static function get_gameState():String{
return (gameState);
}
public static function decrement_health(_arg1:Number):void{
health = (health - _arg1);
if (health < 0){
health = 0;
};
}
}
}//package game
Section 8
//GameOver (game.GameOver)
package game {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class GameOver extends MovieClip {
public var _type:int;
public var Submit:MovieClip;
public var user_name_label:TextField;
public var _scale:Number;
public var user_name:TextField;
public var HighScores:MovieClip;
public var final_score:TextField;
public var _state:String;
public var Continue:MovieClip;
public var _angle:Number;
public function GameOver():void{
x = 0;
y = 0;
_state = "Inactive";
visible = false;
}
public function activate(){
_state = "Active";
visible = true;
user_name_label.visible = true;
user_name.visible = true;
Submit.visible = true;
final_score.text = String(GameManager.playerScore);
}
public function check_rollovers(){
if (Submit.hitTestPoint(mouseX, mouseY)){
Submit.scaleX = 1.25;
Submit.scaleY = 1.25;
} else {
Submit.scaleX = 1;
Submit.scaleY = 1;
};
if (Continue.hitTestPoint(mouseX, mouseY)){
Continue.scaleX = 1.25;
Continue.scaleY = 1.25;
} else {
Continue.scaleX = 1;
Continue.scaleY = 1;
};
if (HighScores.hitTestPoint(mouseX, mouseY)){
HighScores.scaleX = 1.25;
HighScores.scaleY = 1.25;
} else {
HighScores.scaleX = 1;
HighScores.scaleY = 1;
};
}
public function deactivate(){
_state = "Inactive";
visible = false;
}
public function menu_mouseUp(_arg1:MouseEvent){
if (Continue.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.change_gameState("MainMenu");
};
if (((Submit.hitTestPoint(_arg1.stageX, _arg1.stageY)) && (Submit.visible))){
disco_fish.save_highscore(GameManager.gameID, 0, user_name.text, GameManager.level, GameManager.playerScore, 0, "No Comment");
user_name.visible = false;
user_name_label.visible = false;
Submit.visible = false;
};
if (HighScores.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.change_gameState("HighScores");
};
}
public function update():void{
switch (_state){
case "Active":
break;
};
}
}
}//package game
Section 9
//GameUI (game.GameUI)
package game {
import flash.display.*;
import flash.text.*;
public class GameUI extends MovieClip {
public var _type:int;
public var _scale:Number;
public var score:TextField;
public var _state:String;
public var _angle:Number;
public var health_meter:MovieClip;
public function GameUI():void{
x = 0;
y = 0;
deactivate();
}
public function activate(){
_state = "Active";
visible = true;
}
public function deactivate(){
_state = "Inactive";
visible = false;
}
public function update():void{
switch (_state){
case "Active":
break;
};
}
}
}//package game
Section 10
//HighScores (game.HighScores)
package game {
import flash.display.*;
import flash.events.*;
public class HighScores extends MovieClip {
public var score_10:HighScoreListingSymbol;
public var _type:int;
public var _scale:Number;
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 _angle:Number;
public var score_4:HighScoreListingSymbol;
public function HighScores():void{
x = 0;
y = 0;
_state = "Inactive";
visible = false;
}
public function activate(){
_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 deactivate(){
_state = "Inactive";
visible = false;
}
public function menu_mouseUp(_arg1:MouseEvent){
if (Continue.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.change_gameState("MainMenu");
};
}
public function update():void{
switch (_state){
case "Active":
break;
};
}
}
}//package game
Section 11
//Instructions (game.Instructions)
package game {
import flash.display.*;
import flash.events.*;
public class Instructions extends MovieClip {
public var _type:int;
public var _scale:Number;
public var _state:String;
public var Continue:MovieClip;
public var _angle:Number;
public function Instructions():void{
x = 0;
y = 0;
_state = "Inactive";
visible = false;
}
public function activate(){
_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 deactivate(){
_state = "Inactive";
visible = false;
}
public function menu_mouseUp(_arg1:MouseEvent){
if (Continue.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.change_gameState("MainMenu");
};
}
public function update():void{
switch (_state){
case "Active":
break;
};
}
}
}//package game
Section 12
//MainMenu (game.MainMenu)
package game {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class MainMenu extends MovieClip {
public var _type:int;
public var _scale:Number;
public var PlayGame:MovieClip;
public var HighScores:MovieClip;
public var _state:String;
public var Credits:MovieClip;
public var Instructions:MovieClip;
public var _angle:Number;
public var LeaderBoards:MovieClip;
public var Smallzworld:MovieClip;
public function MainMenu():void{
x = 0;
y = 0;
_state = "Inactive";
visible = false;
}
public function activate(){
_state = "Active";
visible = true;
}
public function check_rollovers(){
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.hitTestPoint(mouseX, mouseY)){
Smallzworld.scaleX = 1.25;
Smallzworld.scaleY = 1.25;
} else {
Smallzworld.scaleX = 1;
Smallzworld.scaleY = 1;
};
if (LeaderBoards.hitTestPoint(mouseX, mouseY)){
LeaderBoards.scaleX = 1.25;
LeaderBoards.scaleY = 1.25;
} else {
LeaderBoards.scaleX = 1;
LeaderBoards.scaleY = 1;
};
}
public function deactivate(){
_state = "Inactive";
visible = false;
}
public function menu_mouseUp(_arg1:MouseEvent){
var _local2:URLRequest;
var _local3:URLRequest;
if (PlayGame.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.change_gameState("Reset");
};
if (Instructions.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.change_gameState("Instructions");
};
if (Credits.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.change_gameState("Credits");
};
if (HighScores.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.change_gameState("HighScores");
};
if (LeaderBoards.hitTestPoint(_arg1.stageX, _arg1.stageY)){
_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 update():void{
switch (_state){
case "Active":
break;
};
}
}
}//package game
Section 13
//PauseMenu (game.PauseMenu)
package game {
import flash.display.*;
import flash.events.*;
public class PauseMenu extends MovieClip {
public var _type:int;
public var _scale:Number;
public var _state:String;
public var Continue:MovieClip;
public var _angle:Number;
public function PauseMenu():void{
x = 0;
y = 0;
_state = "Inactive";
visible = false;
}
public function activate(){
_state = "Active";
visible = true;
}
public function menu_mouseUp(_arg1:MouseEvent){
if (Continue.hitTestPoint(_arg1.stageX, _arg1.stageY)){
deactivate();
GameManager.change_gameState("MainMenu");
};
}
public function deactivate(){
_state = "Inactive";
visible = false;
}
public function update():void{
switch (_state){
case "Active":
break;
};
}
}
}//package game
Section 14
//Worm (game.Worm)
package game {
import flash.display.*;
public class Worm extends MovieClip {
public var _direction:String;
public var _type:int;
public var _speed:Number;
public var _scale:Number;
public var _state:String;
public var _xs:Number;
public var _Wormx:Number;
public var _Wormy:Number;
public var _ys:Number;
public var _angle:Number;
public function Worm():void{
_state = "Inactive";
_scale = 0.5;
scaleX = _scale;
scaleY = _scale;
visible = false;
}
public function activate(_arg1:int):void{
var _local2:int;
_local2 = int(((Math.random() * 15) + 1));
_state = "Active";
y = ((Math.random() * 280) + 100);
_speed = 3;
_direction = random_direction();
switch (_direction){
case "Left":
x = (640 + width);
_speed = -(_speed);
scaleX = -(_scale);
break;
case "Right":
x = -(width);
scaleX = _scale;
break;
};
visible = true;
}
private function random_direction():String{
var _local1:int;
_local1 = int(((Math.random() * 2) + 1));
if (_local1 == 1){
return ("Left");
};
return ("Right");
}
public function deactivate():void{
_state = "Inactive";
visible = false;
}
public function update():void{
switch (_state){
case "Active":
x = (x + _speed);
if ((((x < -(width))) || ((x > (640 + width))))){
deactivate();
};
break;
};
}
}
}//package game
Section 15
//smallzFPS (smallz.smallzFPS)
package smallz {
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 = 22;
_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 smallz
Section 16
//smallzMath (smallz.smallzMath)
package smallz {
public class smallzMath {
public static function get_angle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (Math.atan2((_arg4 - _arg2), (_arg3 - _arg1)));
}
public static function get_distance(_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);
}
}
}//package smallz
Section 17
//Background (Background)
package {
import flash.display.*;
public dynamic class Background extends MovieClip {
public var weed:MovieClip;
}
}//package
Section 18
//DeveloperScreen (DeveloperScreen)
package {
import flash.display.*;
public dynamic class DeveloperScreen extends MovieClip {
}
}//package
Section 19
//disco_fish (disco_fish)
package {
import flash.display.*;
import flash.events.*;
import smallz.*;
import flash.text.*;
import game.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.ui.*;
public dynamic class disco_fish extends MovieClip {
private var MainUI:GameUI;
private var screen_width:int;// = 640
private var percent:int;
private var HighScoresUI:HighScores;
private var TheBackground:Background;
private var screen_height:int;// = 480
private var Fish_Count:int;// = 20
private var developerWait;// = 90
private var worm_num:int;// = 0
private var CreditsUI:Credits;
private var fish_timer:Timer;
private var Worm_Count:int;// = 15
private var TheGulp:Gulp;
private var PauseUI:PauseMenu;
private var PlayerFish:Fish;
private var InstructionsUI:Instructions;
private var GameOverUI:GameOver;
private var worm_timer:Timer;
private var Fishes:Array;
private var FPS_Display:smallzFPS;
private var Bubbles:Array;
private var TheSwipe:Swipe;
private var MainMenuUI:MainMenu;
private var Bubble_Count:int;// = 25
private var Worms:Array;
private var Soundtrack:SoundtrackMusic;
private var DeveloperUI:DeveloperScreen;
private var bubble_timer:Timer;
public var load_screen:LoadBarSymbol;
public function disco_fish(){
screen_width = 640;
screen_height = 480;
Fish_Count = 20;
Worm_Count = 15;
Bubble_Count = 25;
Fishes = new Array();
Worms = new Array();
Bubbles = new Array();
worm_num = 0;
developerWait = 90;
super();
addFrameScript(0, frame1, 2, frame3);
trace("disco_fish()");
Security.allowDomain("*");
Security.allowInsecureDomain("*");
Security.loadPolicyFile("http://games.smallzworld.com/crossdomain.xml");
}
public function preload(){
stop();
this.addEventListener(Event.ENTER_FRAME, showProgress);
}
private function fish_collision(){
var _local1:int;
var _local2:Boolean;
var _local3:Number;
var _local4:Number;
var _local5:Boolean;
_local2 = false;
_local3 = PlayerFish.x;
_local4 = PlayerFish.y;
_local1 = 0;
while (_local1 < Fish_Count) {
if (Fishes[_local1]._state == "Active"){
if (smallzMath.get_distance(Fishes[_local1].x, Fishes[_local1].y, _local3, _local4) < 100){
if (Fishes[_local1].hitTestObject(PlayerFish)){
TheSwipe.play();
GameManager.decrement_health(1.5);
};
};
};
_local1++;
};
}
public function update_fish(){
var _local1:int;
_local1 = 0;
while (_local1 < Fish_Count) {
Fishes[_local1].update();
_local1++;
};
}
public function initApplication(){
var _local1:int;
Soundtrack = new SoundtrackMusic();
TheGulp = new Gulp();
TheSwipe = new Swipe();
TheBackground = new Background();
addChild(TheBackground);
TheBackground.x = 0;
TheBackground.y = 0;
_local1 = 0;
while (_local1 < Worm_Count) {
Worms[_local1] = new Worm();
addChild(Worms[_local1]);
_local1++;
};
PlayerFish = new Fish();
addChild(PlayerFish);
_local1 = 0;
while (_local1 < Fish_Count) {
Fishes[_local1] = new Fish();
addChild(Fishes[_local1]);
_local1++;
};
_local1 = 0;
while (_local1 < Bubble_Count) {
Bubbles[_local1] = new Bubble();
addChild(Bubbles[_local1]);
_local1++;
};
MainUI = new GameUI();
addChild(MainUI);
MainMenuUI = new MainMenu();
addChild(MainMenuUI);
InstructionsUI = new Instructions();
addChild(InstructionsUI);
CreditsUI = new Credits();
addChild(CreditsUI);
GameOverUI = new GameOver();
addChild(GameOverUI);
PauseUI = new PauseMenu();
addChild(PauseUI);
HighScoresUI = new HighScores();
addChild(HighScoresUI);
DeveloperUI = new DeveloperScreen();
addChild(DeveloperUI);
DeveloperUI.visible = false;
fish_timer = new Timer(1000);
fish_timer.addEventListener("timer", fish_manager);
fish_timer.start();
worm_timer = new Timer(1000);
worm_timer.addEventListener("timer", worm_manager);
worm_timer.start();
bubble_timer = new Timer(250);
bubble_timer.addEventListener("timer", bubble_manager);
bubble_timer.start();
stage.addEventListener(Event.ENTER_FRAME, main_loop);
stage.addEventListener(MouseEvent.MOUSE_UP, mouse_mouseUp_handler);
stage.focus = this;
Soundtrack.play(0, 999);
}
public function showProgress(_arg1:Event):void{
percent = Math.round(((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100));
load_screen.load_bar.Fill.width = (198 * (percent / 100));
trace("Preloading");
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
trace("Done loading");
this.removeEventListener(Event.ENTER_FRAME, showProgress);
showAds();
};
}
private function inactive_worm():int{
var _local1:int;
var _local2:int;
_local2 = -1;
_local1 = 0;
while (_local1 < Worm_Count) {
if (Worms[_local1]._state == "Inactive"){
_local2 = _local1;
break;
};
_local1++;
};
return (_local2);
}
function frame1(){
preload();
}
function frame3(){
stop();
}
public function showAds(){
stop();
MochiAd.showPreGameAd({clip:root, id:"e530d7b18036dd02", res:"640x480", ad_finished:adFinished});
load_screen.load_bar.visible = false;
}
public function worm_manager(_arg1:TimerEvent){
if (GameManager.gameState == "Core"){
release_new_worm();
};
}
public function mouse_mouseUp_handler(_arg1:MouseEvent){
switch (GameManager.gameState){
case "Core":
break;
case "MainMenu":
MainMenuUI.menu_mouseUp(_arg1);
break;
case "Instructions":
InstructionsUI.menu_mouseUp(_arg1);
break;
case "Credits":
CreditsUI.menu_mouseUp(_arg1);
break;
case "GameOver":
GameOverUI.menu_mouseUp(_arg1);
break;
case "PauseMenu":
PauseUI.menu_mouseUp(_arg1);
break;
case "HighScores":
HighScoresUI.menu_mouseUp(_arg1);
break;
};
}
public function object_manager(_arg1:TimerEvent){
var _local2:int;
_local2 = int(((Math.random() * 3) + 1));
switch (_local2){
case 1:
break;
case 2:
break;
case 3:
break;
};
}
public function fish_manager(_arg1:TimerEvent){
var _local2:int;
var _local3:int;
_local3 = (1 + (GameManager.level / 5));
_local2 = 1;
while (_local2 <= _local3) {
release_new_fish();
_local2++;
};
}
public function update_worms(){
var _local1:int;
_local1 = 0;
while (_local1 < Worm_Count) {
Worms[_local1].update();
_local1++;
};
}
private function release_new_fish():void{
var _local1:int;
var _local2:int;
_local2 = inactive_fish();
if (_local2 >= 0){
Fishes[_local2].activate(false);
};
}
private function inactive_bubble():int{
var _local1:int;
var _local2:int;
_local2 = -1;
_local1 = 0;
while (_local1 < Bubble_Count) {
if (Bubbles[_local1]._state == "Inactive"){
_local2 = _local1;
break;
};
_local1++;
};
return (_local2);
}
public function bubble_manager(_arg1:TimerEvent){
release_new_bubble();
}
private function worm_collision():void{
var _local1:int;
_local1 = 0;
while (_local1 < Worm_Count) {
if (Worms[_local1]._state == "Active"){
if (Worms[_local1].hitTestObject(PlayerFish)){
GameManager.increment_score(25);
GameManager.increment_health(2.5);
Worms[_local1].deactivate();
TheGulp.play();
};
};
_local1++;
};
}
private function release_new_bubble():void{
var _local1:int;
_local1 = inactive_bubble();
if (_local1 >= 0){
Bubbles[_local1].activate();
};
}
private function highscores_handler(_arg1:Event):void{
var _local2:URLLoader;
var _local3:int;
_local2 = URLLoader(_arg1.target);
trace("Back");
_local3 = 1;
while (_local3 <= 10) {
if (_local2.data[("Score_" + _local3)]){
HighScoresUI[("score_" + _local3)].Rank.text = _local3;
HighScoresUI[("score_" + _local3)].Score.text = _local2.data[("Score_" + _local3)];
HighScoresUI[("score_" + _local3)].User.text = _local2.data[("User_" + _local3)];
HighScoresUI[("score_" + _local3)].visible = true;
} else {
HighScoresUI[("score_" + _local3)].visible = false;
};
_local3++;
};
}
private function load_highscores(_arg1:int){
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);
trace("Sent");
}
private function main_loop(_arg1:Event){
var _local2:int;
switch (GameManager.gameState){
case "Mochi":
break;
case "DeveloperScreen":
if (!DeveloperUI.visible){
DeveloperUI.visible = true;
};
if (developerWait > 0){
developerWait--;
} else {
DeveloperUI.visible = false;
GameManager.gameState = "MainMenu";
Mouse.hide();
};
break;
case "Core":
if (MainUI._state == "Inactive"){
MainUI.activate();
PlayerFish.activate(true);
Mouse.hide();
};
GameManager.level = (int((GameManager.playerScore / 250)) + 1);
PlayerFish.update_loc(mouseX, mouseY);
update_fish();
update_worms();
worm_collision();
update_bubbles();
fish_collision();
GameManager.decrement_health(0.115);
MainUI.health_meter.bar.x = (-198 + (GameManager.health * 2));
MainUI.score.text = ("Score " + GameManager.playerScore);
if (GameManager.health == 0){
GameManager.gameState = "GameOver";
};
break;
case "MainMenu":
if (MainMenuUI._state == "Inactive"){
MainMenuUI.activate();
MainUI.deactivate();
PlayerFish.deactivate();
Mouse.show();
};
MainMenuUI.check_rollovers();
update_fish();
update_bubbles();
update_worms();
break;
case "Instructions":
if (InstructionsUI._state == "Inactive"){
InstructionsUI.activate();
PlayerFish.deactivate();
Mouse.show();
};
InstructionsUI.check_rollovers();
update_fish();
update_bubbles();
update_worms();
break;
case "Credits":
if (CreditsUI._state == "Inactive"){
CreditsUI.activate();
PlayerFish.deactivate();
Mouse.show();
};
CreditsUI.check_rollovers();
update_fish();
update_bubbles();
update_worms();
break;
case "GameOver":
if (GameOverUI._state == "Inactive"){
MainUI.deactivate();
GameOverUI.activate();
PlayerFish.deactivate();
Mouse.show();
};
GameOverUI.check_rollovers();
break;
case "PauseMenu":
if (PauseUI._state == "Inactive"){
PauseUI.activate();
PlayerFish.deactivate();
Mouse.show();
};
break;
case "HighScores":
if (HighScoresUI._state == "Inactive"){
HighScoresUI.activate();
PlayerFish.deactivate();
Mouse.show();
_local2 = 1;
while (_local2 <= 10) {
HighScoresUI[("score_" + _local2)].visible = false;
_local2++;
};
load_highscores(GameManager.gameID);
};
HighScoresUI.check_rollovers();
update_fish();
update_bubbles();
update_worms();
break;
case "Reset":
deactivate_all_fish();
deactivate_all_worms();
GameManager.resetGame();
break;
};
}
private function release_new_worm():void{
var _local1:int;
_local1 = inactive_worm();
if (_local1 >= 0){
worm_num++;
Worms[_local1].activate(worm_num);
};
}
public function deactivate_all_worms(){
var _local1:int;
_local1 = 0;
while (_local1 < Worm_Count) {
Worms[_local1].deactivate();
_local1++;
};
}
public function deactivate_all_fish(){
var _local1:int;
_local1 = 0;
while (_local1 < Fish_Count) {
Fishes[_local1].deactivate();
_local1++;
};
}
private function inactive_fish():int{
var _local1:int;
var _local2:int;
_local2 = -1;
_local1 = 0;
while (_local1 < Fish_Count) {
if (Fishes[_local1]._state == "Inactive"){
_local2 = _local1;
break;
};
_local1++;
};
return (_local2);
}
public function adFinished():void{
load_screen.visible = false;
GameManager.gameState = "MainMenu";
gotoAndPlay(2);
initApplication();
}
public function update_bubbles(){
var _local1:int;
_local1 = 0;
while (_local1 < Bubble_Count) {
Bubbles[_local1].update();
_local1++;
};
}
private static function save_highscore_handler(_arg1:Event):void{
var _local2:URLLoader;
var _local3:int;
_local2 = URLLoader(_arg1.target);
trace("Back from save high score");
GameManager.gameState = "GameOver";
}
public static function save_highscore(_arg1:int, _arg2:int, _arg3:String, _arg4:int, _arg5:int, _arg6:int, _arg7:String){
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);
trace("Sent High Score");
}
}
}//package
Section 20
//Gulp (Gulp)
package {
import flash.media.*;
public dynamic class Gulp extends Sound {
}
}//package
Section 21
//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 22
//LoadBarSymbol (LoadBarSymbol)
package {
import flash.display.*;
public dynamic class LoadBarSymbol extends MovieClip {
public var load_bar:MovieClip;
}
}//package
Section 23
//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.1");
}
public static function showTimedAd(_arg1:Object):void{
MochiAd.showInterLevelAd(_arg1);
}
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 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 f:Function;
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);
};
if (clip._mochiad_loaded){
return (null);
};
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;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
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 sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
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];
};
};
_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++;
};
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
_arg1.removeChild(_arg1._mochiad);
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{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
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_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
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;
_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.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
_local3 = true;
};
};
};
if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_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 _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 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 _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
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.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
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 r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
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_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
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);
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{
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.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
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.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;
_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);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
_local4 = true;
};
};
};
if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_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 fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
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 {
mc.removeEventListener(Event.ENTER_FRAME, f);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 24
//MyArial (MyArial)
package {
import flash.text.*;
public dynamic class MyArial extends Font {
}
}//package
Section 25
//SoundtrackMusic (SoundtrackMusic)
package {
import flash.media.*;
public dynamic class SoundtrackMusic extends Sound {
}
}//package
Section 26
//Swipe (Swipe)
package {
import flash.media.*;
public dynamic class Swipe extends Sound {
}
}//package