Section 1
//KongregateEvent (com.kongregate.as3.client.events.KongregateEvent)
package com.kongregate.as3.client.events {
import flash.events.*;
public class KongregateEvent extends Event {
public static const COMPLETE:String = "component_api_available";
public function KongregateEvent(_arg1:String){
super(_arg1);
}
}
}//package com.kongregate.as3.client.events
Section 2
//AbstractShadowService (com.kongregate.as3.client.services.AbstractShadowService)
package com.kongregate.as3.client.services {
import flash.events.*;
public class AbstractShadowService extends EventDispatcher {
protected function alert(_arg1:String, _arg2:String, _arg3="", _arg4:String=""):void{
trace(((((((("Kongregate API: " + _arg1) + ".") + _arg2) + "(") + _arg3) + ") ") + _arg4));
}
}
}//package com.kongregate.as3.client.services
Section 3
//HighScoreServiceShadow (com.kongregate.as3.client.services.HighScoreServiceShadow)
package com.kongregate.as3.client.services {
public class HighScoreServiceShadow extends AbstractShadowService implements IHighScoreServices {
private var mode:String;
public function HighScoreServiceShadow(){
mode = "";
}
public function submit(_arg1:Number, _arg2:String=null):void{
alert("IHighScoreServices", "submit", arguments);
}
public function connect():Boolean{
alert("IKongregateServices", "connect");
return (true);
}
public function requestList(_arg1:Function):void{
alert("IHighScoreServices", "requestList", "", (("[Mode: " + mode) + "]"));
_arg1({success:false});
}
public function setMode(_arg1:String):void{
alert("IHighScoreServices", "setMode", arguments);
this.mode = _arg1;
}
}
}//package com.kongregate.as3.client.services
Section 4
//IHighScoreServices (com.kongregate.as3.client.services.IHighScoreServices)
package com.kongregate.as3.client.services {
public interface IHighScoreServices {
function setMode(_arg1:String):void;
function submit(_arg1:Number, _arg2:String=null):void;
function requestList(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 5
//IKongregateServices (com.kongregate.as3.client.services.IKongregateServices)
package com.kongregate.as3.client.services {
import flash.events.*;
public interface IKongregateServices extends IEventDispatcher {
function getPlayerInfo(_arg1:Function):void;
function connect(_arg1:Number=-1):Boolean;
}
}//package com.kongregate.as3.client.services
Section 6
//IStatServices (com.kongregate.as3.client.services.IStatServices)
package com.kongregate.as3.client.services {
public interface IStatServices {
function submitArray(_arg1:Array):void;
function submit(_arg1:String, _arg2:Number):void;
}
}//package com.kongregate.as3.client.services
Section 7
//IUserServices (com.kongregate.as3.client.services.IUserServices)
package com.kongregate.as3.client.services {
public interface IUserServices {
function getName():String;
function getPlayerInfo(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 8
//KongregateServiceShadow (com.kongregate.as3.client.services.KongregateServiceShadow)
package com.kongregate.as3.client.services {
public class KongregateServiceShadow extends AbstractShadowService implements IKongregateServices {
public function getName():String{
alert("IKongregateServices", "getName");
return ("Guest");
}
public function connect(_arg1:Number=-1):Boolean{
alert("IKongregateServices", "connect", arguments);
return (true);
}
public function getPlayerInfo(_arg1:Function):void{
alert("IKongregateServices", "getPlayerInfo");
_arg1(new Object());
}
}
}//package com.kongregate.as3.client.services
Section 9
//StatServiceShadow (com.kongregate.as3.client.services.StatServiceShadow)
package com.kongregate.as3.client.services {
public class StatServiceShadow extends AbstractShadowService implements IStatServices {
public function submitArray(_arg1:Array):void{
alert("IStatServices", "submitArray", arguments);
}
public function submit(_arg1:String, _arg2:Number):void{
alert("IStatServices", "submitStat", arguments);
}
}
}//package com.kongregate.as3.client.services
Section 10
//UserServiceShadow (com.kongregate.as3.client.services.UserServiceShadow)
package com.kongregate.as3.client.services {
public class UserServiceShadow extends AbstractShadowService implements IUserServices {
public function getName():String{
alert("UserService", "getName");
return ("Guest");
}
public function getPlayerInfo(_arg1:Function):void{
alert("UserService", "getPlayerInfo");
_arg1({isGuest:true, name:"Guest", points:0, level:0, isMode:false, isAdmin:false, isDeveloper:false, avatarPath:"", chatAvatarPath:""});
}
}
}//package com.kongregate.as3.client.services
Section 11
//IAPIBootstrap (com.kongregate.as3.client.IAPIBootstrap)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
public interface IAPIBootstrap {
function init(_arg1:Event=null, _arg2:Stage=null):void;
function hideLog():void;
function showLog(_arg1:int=0):void;
}
}//package com.kongregate.as3.client
Section 12
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import com.kongregate.as3.client.services.*;
import flash.net.*;
import com.kongregate.as3.client.events.*;
import flash.system.*;
import flash.errors.*;
public class KongregateAPI extends Sprite {
private const VERSION:Number = 1;
private var loader:Loader;
private var loadedDomain:ApplicationDomain;
private static const CLASS_USER:String = "com.kongregate.as3.client.services.UserServices";
private static const CLASS_STATS:String = "com.kongregate.as3.client.services.StatServices";
private static const CLASS_SERVICES:String = "com.kongregate.as3.client.services.KongregateServices";
private static const CLASS_SCORES:String = "com.kongregate.as3.client.services.HighScoreServices";
private static const DEBUG_API_URL:String = "//Linuxpc/kongregate/public/flash/API_AS3.swf";
private static var _connected:Boolean;
private static var kUser:IUserServices;
private static var _loaded:Boolean;
private static var kServices:IKongregateServices;
private static var kScores:IHighScoreServices;
private static var mInstance:KongregateAPI;
private static var kStats:IStatServices;
private static var kAPI:IAPIBootstrap;
public function KongregateAPI(){
if (mInstance != null){
throw (new Error("Warning: KongregateAPI has been added to stage more than once or accessed improperly. Use getInstance() or a stage reference to access."));
};
mInstance = this;
this.addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
public function get loaded():Boolean{
return (_loaded);
}
public function get connected():Boolean{
return (_connected);
}
private function alertConnected(_arg1:TimerEvent=null):void{
var _local2:KongregateEvent;
var _local3:Boolean;
_local2 = new KongregateEvent(KongregateEvent.COMPLETE);
_local3 = this.dispatchEvent(_local2);
}
private function init(_arg1:Event):void{
var _local2:Object;
var _local3:String;
var _local4:URLRequest;
var _local5:LoaderContext;
this.removeEventListener(Event.ADDED_TO_STAGE, init);
_loaded = false;
_connected = false;
_local2 = LoaderInfo(root.loaderInfo).parameters;
_local3 = _local2.api_path;
if (_local3 == null){
trace("Alert: Kongregate API could not be loaded, due to local testing. API will load when the game is uploaded.");
createShadowServices();
return;
};
Security.allowDomain("*.kongregate.com");
Security.allowDomain("kongregatetrunk.com");
_local4 = new URLRequest(_local3);
_local5 = new LoaderContext(false);
_local5.applicationDomain = ApplicationDomain.currentDomain;
_local5.securityDomain = SecurityDomain.currentDomain;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.load(_local4, _local5);
}
public function get api():IAPIBootstrap{
return (kAPI);
}
private function loadComplete(_arg1:Event):void{
getServices();
}
public function get scores():IHighScoreServices{
return (kScores);
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
throw (new IOError(("API file not found. " + _arg1)));
}
public function get services():IKongregateServices{
return (kServices);
}
public function get stats():IStatServices{
return (kStats);
}
private function createShadowServices():void{
var _local1:Timer;
trace(">>> Kongregate Shadow Services instantiated for local development..");
kServices = new KongregateServiceShadow();
kScores = new HighScoreServiceShadow();
kStats = new StatServiceShadow();
kUser = new UserServiceShadow();
_local1 = new Timer(200, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, alertConnected);
_local1.start();
_connected = true;
}
public function get user():IUserServices{
return (kUser);
}
private function getServices():void{
var _local1:ApplicationDomain;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = ApplicationDomain.currentDomain;
kAPI = IAPIBootstrap(loader.getChildAt(0));
this.addChild(loader);
_local2 = _local1.getDefinition(CLASS_SERVICES);
trace(_local2);
kServices = _local2.getInstance();
_local3 = _local1.getDefinition(CLASS_SCORES);
kScores = _local3.getInstance();
_local4 = _local1.getDefinition(CLASS_STATS);
kStats = _local4.getInstance();
_local5 = _local1.getDefinition(CLASS_USER);
kUser = _local5.getInstance();
kServices.connect(VERSION);
_loaded = true;
_connected = true;
alertConnected();
}
public static function getInstance():KongregateAPI{
if (!mInstance){
throw (new IllegalOperationError("You must add the Kongregate API component to the stage before attempting to access it."));
};
return (mInstance);
}
}
}//package com.kongregate.as3.client
Section 13
//Achievement_AirlineTickets_38 (EndlessMigration_fla.Achievement_AirlineTickets_38)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_AirlineTickets_38 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_AirlineTickets_38(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 14
//Achievement_AroundTheWorld_43 (EndlessMigration_fla.Achievement_AroundTheWorld_43)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_AroundTheWorld_43 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_AroundTheWorld_43(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 15
//Achievement_Aviator1_28 (EndlessMigration_fla.Achievement_Aviator1_28)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Aviator1_28 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Aviator1_28(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 16
//Achievement_Aviator2_29 (EndlessMigration_fla.Achievement_Aviator2_29)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Aviator2_29 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Aviator2_29(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 17
//Achievement_Aviator3_30 (EndlessMigration_fla.Achievement_Aviator3_30)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Aviator3_30 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Aviator3_30(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 18
//Achievement_BabyHuey_39 (EndlessMigration_fla.Achievement_BabyHuey_39)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_BabyHuey_39 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_BabyHuey_39(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 19
//Achievement_Bourgeoisie_31 (EndlessMigration_fla.Achievement_Bourgeoisie_31)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Bourgeoisie_31 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Bourgeoisie_31(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 20
//Achievement_ClearlyDevoted_42 (EndlessMigration_fla.Achievement_ClearlyDevoted_42)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_ClearlyDevoted_42 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_ClearlyDevoted_42(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 21
//Achievement_ConsolationPrize_32 (EndlessMigration_fla.Achievement_ConsolationPrize_32)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_ConsolationPrize_32 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_ConsolationPrize_32(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 22
//Achievement_Curious_24 (EndlessMigration_fla.Achievement_Curious_24)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Curious_24 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Curious_24(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 23
//Achievement_FirstContact_41 (EndlessMigration_fla.Achievement_FirstContact_41)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_FirstContact_41 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_FirstContact_41(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 24
//Achievement_Flockmaster_34 (EndlessMigration_fla.Achievement_Flockmaster_34)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Flockmaster_34 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Flockmaster_34(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 25
//Achievement_FlyingSolo_35 (EndlessMigration_fla.Achievement_FlyingSolo_35)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_FlyingSolo_35 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_FlyingSolo_35(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 26
//Achievement_FrequentFlyer_36 (EndlessMigration_fla.Achievement_FrequentFlyer_36)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_FrequentFlyer_36 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_FrequentFlyer_36(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 27
//Achievement_Gold1_25 (EndlessMigration_fla.Achievement_Gold1_25)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Gold1_25 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Gold1_25(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 28
//Achievement_Gold2_26 (EndlessMigration_fla.Achievement_Gold2_26)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Gold2_26 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Gold2_26(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 29
//Achievement_Gold3_27 (EndlessMigration_fla.Achievement_Gold3_27)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Gold3_27 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Gold3_27(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 30
//Achievement_IntoTheStorm_37 (EndlessMigration_fla.Achievement_IntoTheStorm_37)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_IntoTheStorm_37 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_IntoTheStorm_37(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 31
//Achievement_MotherGoose_17 (EndlessMigration_fla.Achievement_MotherGoose_17)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_MotherGoose_17 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_MotherGoose_17(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 32
//Achievement_OffTheRadar_44 (EndlessMigration_fla.Achievement_OffTheRadar_44)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_OffTheRadar_44 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_OffTheRadar_44(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 33
//Achievement_Score1_18 (EndlessMigration_fla.Achievement_Score1_18)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Score1_18 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Score1_18(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 34
//Achievement_Score2_19 (EndlessMigration_fla.Achievement_Score2_19)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Score2_19 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Score2_19(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 35
//Achievement_Score3_20 (EndlessMigration_fla.Achievement_Score3_20)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Score3_20 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Score3_20(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 36
//Achievement_Score4_21 (EndlessMigration_fla.Achievement_Score4_21)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Score4_21 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Score4_21(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 37
//Achievement_Score5_22 (EndlessMigration_fla.Achievement_Score5_22)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_Score5_22 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_Score5_22(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 38
//Achievement_SelfPreservation_33 (EndlessMigration_fla.Achievement_SelfPreservation_33)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_SelfPreservation_33 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_SelfPreservation_33(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 39
//Achievement_ShockAndAwe_40 (EndlessMigration_fla.Achievement_ShockAndAwe_40)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_ShockAndAwe_40 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_ShockAndAwe_40(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 40
//Achievement_SocialButterfly_15 (EndlessMigration_fla.Achievement_SocialButterfly_15)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_SocialButterfly_15 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_SocialButterfly_15(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 41
//Achievement_WellVersed_23 (EndlessMigration_fla.Achievement_WellVersed_23)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Achievement_WellVersed_23 extends MovieClip {
public var CheckedBox:MovieClip;
public function Achievement_WellVersed_23(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 42
//AchievementDescriptions_52 (EndlessMigration_fla.AchievementDescriptions_52)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class AchievementDescriptions_52 extends MovieClip {
public var AlreadyEarnedText:MovieClip;
public function AchievementDescriptions_52(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 43
//AchievementsMenu_51 (EndlessMigration_fla.AchievementsMenu_51)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class AchievementsMenu_51 extends MovieClip {
public var Score2:MovieClip;
public var Score3:MovieClip;
public var ClearlyDevoted:MovieClip;
public var Score5:MovieClip;
public var FlyingSolo:MovieClip;
public var Score4:MovieClip;
public var FrequentFlyer:MovieClip;
public var WellVersed:MovieClip;
public var SoVeryCurious:MovieClip;
public var SocialButterfly:MovieClip;
public var Aviator3:MovieClip;
public var Aviator1:MovieClip;
public var Aviator2:MovieClip;
public var FirstContact:MovieClip;
public var OffTheRadar:MovieClip;
public var BabyHuey:MovieClip;
public var IntoTheStorm:MovieClip;
public var ConsolationPrize:MovieClip;
public var FlockmasterFlash:MovieClip;
public var AchievementDescriptions:MovieClip;
public var Bourgeoisie:MovieClip;
public var Gold1:MovieClip;
public var AroundTheWorld:MovieClip;
public var Gold2:MovieClip;
public var ShockAndAwe:MovieClip;
public var Gold3:MovieClip;
public var SelfPreservation:MovieClip;
public var AirlineTickets:MovieClip;
public var MotherGoose:MovieClip;
public var Score1:MovieClip;
}
}//package EndlessMigration_fla
Section 44
//AvatarBird_79 (EndlessMigration_fla.AvatarBird_79)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class AvatarBird_79 extends MovieClip {
public var GoldenGoose:MovieClip;
public var QuackBubble:MovieClip;
}
}//package EndlessMigration_fla
Section 45
//CheckedBox_16 (EndlessMigration_fla.CheckedBox_16)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class CheckedBox_16 extends MovieClip {
public function CheckedBox_16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 46
//ConfirmClearBox_2 (EndlessMigration_fla.ConfirmClearBox_2)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class ConfirmClearBox_2 extends MovieClip {
public var YesBtn:SimpleButton;
public var NoBtn:SimpleButton;
}
}//package EndlessMigration_fla
Section 47
//GameOverScreen_85 (EndlessMigration_fla.GameOverScreen_85)
package EndlessMigration_fla {
import flash.display.*;
import flash.text.*;
public dynamic class GameOverScreen_85 extends MovieClip {
public var RecapScoreTxt:TextField;
public var MenuBtn:SimpleButton;
public var UpgradeEarningsTxt:TextField;
public var HighScoreTxt:TextField;
public var TotalTimeTxt:TextField;
public var RetryBtn:SimpleButton;
public var BestTimeTxt:TextField;
}
}//package EndlessMigration_fla
Section 48
//GoldenBonusBox_84 (EndlessMigration_fla.GoldenBonusBox_84)
package EndlessMigration_fla {
import flash.display.*;
import flash.text.*;
public dynamic class GoldenBonusBox_84 extends MovieClip {
public var GoldenBonusTxt:TextField;
}
}//package EndlessMigration_fla
Section 49
//GroundLevel_73 (EndlessMigration_fla.GroundLevel_73)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class GroundLevel_73 extends MovieClip {
public var Building1:Building;
}
}//package EndlessMigration_fla
Section 50
//InGameAchievements_14 (EndlessMigration_fla.InGameAchievements_14)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class InGameAchievements_14 extends MovieClip {
public var Score2:MovieClip;
public var Score3:MovieClip;
public var Gold1:MovieClip;
public var Score1:MovieClip;
public function InGameAchievements_14(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 51
//QuackBubble_80 (EndlessMigration_fla.QuackBubble_80)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class QuackBubble_80 extends MovieClip {
public function QuackBubble_80(){
addFrameScript(0, frame1, 7, frame8);
}
function frame1(){
stop();
}
function frame8(){
gotoAndStop(1);
}
}
}//package EndlessMigration_fla
Section 52
//Ship1_77 (EndlessMigration_fla.Ship1_77)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Ship1_77 extends MovieClip {
public function Ship1_77(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 53
//TutorialScreen_45 (EndlessMigration_fla.TutorialScreen_45)
package EndlessMigration_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.system.*;
import flash.text.*;
import flash.filters.*;
import flash.geom.*;
import flash.errors.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class TutorialScreen_45 extends MovieClip {
public var PrevBtn:SimpleButton;
public var NextBtn:SimpleButton;
public function TutorialScreen_45(){
addFrameScript(0, frame1, 1, frame2, 7, frame8, 8, frame9);
}
function frame1(){
stop();
PrevBtn.visible = false;
}
function frame9(){
NextBtn.visible = false;
MovieClip(parent).WellVersedEarned();
}
function frame8(){
NextBtn.visible = true;
}
function frame2(){
PrevBtn.visible = true;
}
}
}//package EndlessMigration_fla
Section 54
//Upgrade_EagleEyes_65 (EndlessMigration_fla.Upgrade_EagleEyes_65)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Upgrade_EagleEyes_65 extends MovieClip {
public function Upgrade_EagleEyes_65(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 55
//Upgrade_HiveMind_63 (EndlessMigration_fla.Upgrade_HiveMind_63)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Upgrade_HiveMind_63 extends MovieClip {
public function Upgrade_HiveMind_63(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 56
//Upgrade_HomingBeacon_58 (EndlessMigration_fla.Upgrade_HomingBeacon_58)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Upgrade_HomingBeacon_58 extends MovieClip {
public function Upgrade_HomingBeacon_58(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 57
//Upgrade_Nightvision_64 (EndlessMigration_fla.Upgrade_Nightvision_64)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Upgrade_Nightvision_64 extends MovieClip {
public function Upgrade_Nightvision_64(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 58
//Upgrade_PhoenixPendant_62 (EndlessMigration_fla.Upgrade_PhoenixPendant_62)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Upgrade_PhoenixPendant_62 extends MovieClip {
public function Upgrade_PhoenixPendant_62(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 59
//Upgrade_PoseidonsBlessing_61 (EndlessMigration_fla.Upgrade_PoseidonsBlessing_61)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Upgrade_PoseidonsBlessing_61 extends MovieClip {
public function Upgrade_PoseidonsBlessing_61(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 60
//Upgrade_RabbitsFoot_57 (EndlessMigration_fla.Upgrade_RabbitsFoot_57)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Upgrade_RabbitsFoot_57 extends MovieClip {
public function Upgrade_RabbitsFoot_57(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 61
//Upgrade_RainDance_56 (EndlessMigration_fla.Upgrade_RainDance_56)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Upgrade_RainDance_56 extends MovieClip {
public function Upgrade_RainDance_56(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 62
//Upgrade_RoyalLineage_59 (EndlessMigration_fla.Upgrade_RoyalLineage_59)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Upgrade_RoyalLineage_59 extends MovieClip {
public function Upgrade_RoyalLineage_59(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 63
//Upgrade_RuggedDown_60 (EndlessMigration_fla.Upgrade_RuggedDown_60)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Upgrade_RuggedDown_60 extends MovieClip {
public function Upgrade_RuggedDown_60(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 64
//Upgrade_Speed1_66 (EndlessMigration_fla.Upgrade_Speed1_66)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Upgrade_Speed1_66 extends MovieClip {
public function Upgrade_Speed1_66(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 65
//Upgrade_Speed2_55 (EndlessMigration_fla.Upgrade_Speed2_55)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Upgrade_Speed2_55 extends MovieClip {
public function Upgrade_Speed2_55(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 66
//Upgrade_Speed3_67 (EndlessMigration_fla.Upgrade_Speed3_67)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class Upgrade_Speed3_67 extends MovieClip {
public function Upgrade_Speed3_67(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 67
//UpgradeDescriptions_68 (EndlessMigration_fla.UpgradeDescriptions_68)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class UpgradeDescriptions_68 extends MovieClip {
public var AlreadyPurchasedText:MovieClip;
public function UpgradeDescriptions_68(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package EndlessMigration_fla
Section 68
//UpgradesMenu_54 (EndlessMigration_fla.UpgradesMenu_54)
package EndlessMigration_fla {
import flash.display.*;
public dynamic class UpgradesMenu_54 extends MovieClip {
public var HiveMind:MovieClip;
public var UpgradeDescriptions:MovieClip;
public var RuggedDown:MovieClip;
public var PhoenixPendant:MovieClip;
public var DivineWings:MovieClip;
public var RainDance:MovieClip;
public var EagleEyes:MovieClip;
public var RabbitsFoot:MovieClip;
public var Aerodynamics:MovieClip;
public var HomingBeacon:MovieClip;
public var PoseidonsBlessing:MovieClip;
public var RoyalLineage:MovieClip;
public var BigWingspan:MovieClip;
public var Nightvision:MovieClip;
}
}//package EndlessMigration_fla
Section 69
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return (MochiServices.getVersion());
}
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{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, 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];
if (Security.sandboxType == "application"){
return (_local2);
};
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{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, 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"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
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 (!(clip is DisplayObject)){
trace("Warning: Object passed as container clip not a descendant of the DisplayObject type");
return (null);
};
if (MovieClip(clip).stage == null){
trace("Warning: Container clip for ad is not attached to the stage");
return (null);
};
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;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
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?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
if (!options.skip){
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;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
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_w:Number;
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 progress:Number;
var f:Function;
var sendHostProgress:Boolean;
var fn:Function;
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{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}, progress_override:function (_arg1:Object):Number{
return (NaN);
}, bar_offset:0};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
if (options.skip){
ad_timeout = 0;
};
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 + options.bar_offset);
bar.y = (h - 20);
};
bar_w = ((w - bar.x) - 10);
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(bar_w, 0);
backing.lineTo(bar_w, 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(bar_w, 0);
inside.lineTo(bar_w, 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(bar_w, 0);
outline.lineTo(bar_w, 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;
progress = Math.min(1, options.progress_override(clip));
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
if (!isNaN(progress)){
complete = (progress == 1);
} else {
if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){
complete = true;
} else {
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
};
};
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{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
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:Number;
var _local10:Object;
var _local11:Number;
var _local12: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;
_local7 = Math.min(1, options.progress_override(_local1));
if (_local7 == 1){
complete = true;
};
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local8 = ((100 * _local6) / _local5);
if (!isNaN(_local7)){
_local8 = (100 * _local7);
};
_local9 = ((100 * _local3) / chk.ad_msec);
_local10 = this._mochiad_bar._inside;
_local11 = Math.min(100, Math.min(((_local8) || (0)), _local9));
_local11 = Math.max(this.last_pcnt, _local11);
this.last_pcnt = _local11;
_local10.scaleX = (_local11 * 0.01);
options.ad_progress(_local11);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local8});
if (_local8 >= 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local12 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local12 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local8 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (unloaded){
MochiAd.unload(_local1);
} else {
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{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
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 mochi.as3
Section 70
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
public static var _inventory:MochiInventory;
public static function triggerEvent(_arg1:String, _arg2:Object):void{
MochiSocial.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.addEventListener(_arg1, _arg2);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 71
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function reencode():void{
var _local1:uint;
_local1 = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function toString():String{
var _local1:String;
_local1 = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String;
_local3 = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 72
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 73
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local3:Object;
var _local4:Object;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function endGame():void{
var _local1:Number;
_local1 = (new Date().time - gameStart);
trigger("end_game", {time:_local1});
}
public static function startGame():void{
gameStart = new Date().time;
trigger("start_game");
}
public static function trigger(_arg1:String, _arg2:Object=null):void{
if (_arg2 == null){
_arg2 = {};
} else {
if (_arg2["kind"] != undefined){
trace("WARNING: optional arguments package contains key 'id', it will be overwritten");
_arg2["kind"] = _arg1;
};
};
MochiServices.send("events_triggerEvent", {eventObject:_arg2}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startLevel():void{
levelStart = new Date().time;
trigger("start_level");
}
public static function endLevel():void{
var _local1:Number;
_local1 = (new Date().time - levelStart);
trigger("end_level", {time:_local1});
}
}
}//package mochi.as3
Section 74
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _consumableProperties:Object;
private var _syncID:Number;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (_arg1.privateProperties.consumable){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
private function sync(_arg1:Event=null):void{
var _local2:Object;
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
_local2 = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[_local2]);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 75
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = _clip._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _clip._callbacks[cb];
}
public static function get childClip():Object{
return (_clip);
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:MovieClip;
var _local8:LocalConnection;
var _local9:String;
var _local10:ByteArray;
var _local11:ByteArray;
var _local12:uint;
var _local13:uint;
var _local14:Loader;
_local3 = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
_local5 = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
_local6 = [0, 64, 0, 0, 0];
_local7 = new MovieClip();
_local8 = new LocalConnection();
_local9 = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
_local10 = new ByteArray();
_local11 = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
_local12 = ((_local3.length + _local11.length) + 4);
_local13 = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
var _local2:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
_local2 = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
var _local3:Number;
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
_local3 = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.7 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_clip._queue))){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String;
var _local3:String;
_local2 = _arg1.target;
_local3 = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local2:Object;
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
_local2 = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_clip._queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var mochiLCURL:String;
var req:URLRequest;
var complete:Function;
var clip = _arg1;
loader = new Loader();
mochiLCURL = (_servURL + _mochiLC);
req = new URLRequest(mochiLCURL);
complete = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var _local3:String;
var _local4:String;
var _local5:URLRequest;
var _local6:URLVariables;
_local3 = ("_mochiservices_com_" + _arg1);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
_local4 = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local4 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local4);
_clip = createEmptyMovieClip(_arg2, _local3, 10336, false);
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local5 = new URLRequest(_local4);
_local6 = new URLVariables();
_local6.listenLC = _listenChannelName;
_local6.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local6.api_version = getVersion();
if (widget){
_local6.widget = true;
};
_local5.data = _local6;
_loader.load(_local5);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 76
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const LOGIN_HIDE:String = "LoginHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function requestLogin():void{
MochiServices.send("coins_requestLogin");
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 77
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
_syncContainer = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:String;
if (_syncContainer[_arg1] == _arg2){
return;
};
_local3 = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
}
}//package mochi.as3
Section 78
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var error:Event;// = null
public var key:String;// = null
public var operation:String;// = null
public var data;// = null
public var _loader:URLLoader;
public function MochiUserData(_arg1:String="", _arg2:Function=null){
key = null;
data = null;
error = null;
operation = null;
callback = null;
super();
this.key = _arg1;
this.callback = _arg2;
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
public function request(_arg1:String, _arg2:ByteArray):void{
var api_url:String;
var api_token:String;
var args:URLVariables;
var req:URLRequest;
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
api_url = MochiSocial.getAPIURL();
api_token = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
args = new URLVariables();
args.op = _operation;
args.key = key;
req = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData;
_local3 = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData;
_local4 = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 79
//AchievementUnlocked (AchievementUnlocked)
package {
import flash.media.*;
public dynamic class AchievementUnlocked extends Sound {
}
}//package
Section 80
//Airbus (Airbus)
package {
import flash.display.*;
public class Airbus extends MovieClip {
public var spawnY:Number;
public var spawnX:Number;
public var flySpeed:Number;
public function Airbus(){
addFrameScript(0, frame1);
flySpeed = (10 + (Math.random() * 4));
if (Math.ceil((Math.random() * 4)) == 1){
spawnX = (100 + (Math.random() * 500));
spawnY = -100;
rotation = (50 + (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 2){
spawnX = (100 + (Math.random() * 500));
spawnY = 700;
rotation = (310 - (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 3){
spawnX = -100;
spawnY = (100 + (Math.random() * 500));
rotation = (320 + (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 4){
spawnX = 800;
spawnY = (100 + (Math.random() * 500));
rotation = (100 + (Math.random() * 80));
};
};
};
};
}
function frame1(){
stop();
}
}
}//package
Section 81
//Airplane (Airplane)
package {
import flash.display.*;
public class Airplane extends MovieClip {
public var spawnY:Number;
public var spawnX:Number;
public var flySpeed:Number;
public function Airplane(){
addFrameScript(0, frame1);
flySpeed = (10 + (Math.random() * 8));
if (Math.ceil((Math.random() * 4)) == 1){
spawnX = (100 + (Math.random() * 500));
spawnY = -30;
rotation = (50 + (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 2){
spawnX = (100 + (Math.random() * 500));
spawnY = 630;
rotation = (310 - (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 3){
spawnX = -30;
spawnY = (100 + (Math.random() * 500));
rotation = (320 + (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 4){
spawnX = 730;
spawnY = (100 + (Math.random() * 500));
rotation = (100 + (Math.random() * 80));
};
};
};
};
}
function frame1(){
stop();
}
}
}//package
Section 82
//Alien (Alien)
package {
import flash.display.*;
public class Alien extends MovieClip {
public var randScale:Number;
public var spawnY:Number;
public var spawnX:Number;
public var flySpeed:Number;
public var Rotator:MovieClip;
public function Alien(){
addFrameScript(0, frame1);
if (Math.random() > 0.5){
flySpeed = (16 + (Math.random() * 4));
spawnX = -100;
} else {
flySpeed = (-14 - (Math.random() * 4));
spawnX = 800;
};
spawnY = (Math.random() * 600);
rotation = (Math.random() * 360);
randScale = (0.8 + (Math.random() * 0.4));
}
function frame1(){
stop();
}
}
}//package
Section 83
//Balloon (Balloon)
package {
import flash.display.*;
public class Balloon extends MovieClip {
public var randScale:Number;
public var flySpeed:Number;
public function Balloon(){
addFrameScript(0, frame1);
rotation = (Math.random() * 360);
randScale = (0.9 + (Math.random() * 0.6));
flySpeed = (4 + (Math.random() * 6));
}
function frame1(){
stop();
}
}
}//package
Section 84
//Bird (Bird)
package {
import flash.display.*;
public class Bird extends MovieClip {
public var destinationY:Number;
public var destinationX:Number;
public var multiplierValue;// = 0.2
public var flockSpeed:Number;
public var SmallBird:MovieClip;
public var GoldenGoose:MovieClip;
public var flySpeed:Number;
public var soughtRot:Number;
public function Bird(){
multiplierValue = (1 / 5);
super();
GoldenGoose.visible = false;
this.x = (50 + (Math.random() * 600));
this.y = -20;
this.rotation = -90;
flySpeed = (2 + (Math.random() * 4));
flockSpeed = (9 + (Math.random() * 3));
destinationX = 350;
destinationY = 350;
gotoAndStop(Math.ceil((Math.random() * 3)));
}
}
}//package
Section 85
//Blimp (Blimp)
package {
import flash.display.*;
public class Blimp extends MovieClip {
public var randScale:Number;
public var flySpeed:Number;
public function Blimp(){
addFrameScript(0, frame1);
rotation = (Math.random() * 360);
randScale = (0.9 + (Math.random() * 0.6));
flySpeed = (4 + (Math.random() * 6));
}
function frame1(){
stop();
}
}
}//package
Section 86
//Building (Building)
package {
import flash.display.*;
public dynamic class Building extends MovieClip {
public var Ship:MovieClip;
public function Building(){
addFrameScript(0, frame1, 6, frame7);
}
function frame7(){
Ship.gotoAndStop(Math.ceil((Math.random() * 4)));
Ship.rotation = (Math.random() * 360);
Ship.alpha = 0.8;
}
function frame1(){
stop();
}
}
}//package
Section 87
//ChachingSnd (ChachingSnd)
package {
import flash.media.*;
public dynamic class ChachingSnd extends Sound {
}
}//package
Section 88
//Cloud (Cloud)
package {
import flash.display.*;
public class Cloud extends MovieClip {
public var randScale:Number;
public var flySpeed:Number;
public var hittingAvatar:Boolean;// = false
public var slowSpeed:Number;// = 0.4
public function Cloud(){
hittingAvatar = false;
slowSpeed = 0.4;
super();
gotoAndStop(Math.ceil((Math.random() * 10)));
rotation = (Math.random() * 360);
alpha = (0.3 + (Math.random() * 0.2));
randScale = (0.4 + (Math.random() * 0.2));
flySpeed = (4 + (Math.random() * 3));
}
}
}//package
Section 89
//EndlessMigration (EndlessMigration)
package {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.utils.*;
import com.kongregate.as3.client.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class EndlessMigration extends MovieClip {
public var hasAviator1:Boolean;// = false
public var hasAviator3:Boolean;// = false
public var hasBigWingspan:Boolean;// = false
public var oceansPassed:int;// = 0
public var GameOverScreen:MovieClip;
public var CurrentMultiplierTxt:TextField;
public var setCloudTimer:Timer;
public var moveObstaclesTimer:Timer;
public var hasConsolationPrize:Boolean;// = false
public var weatherSpeedEffect:Number;// = 4.2
public var hasAerodynamics:Boolean;// = false
public var scBgTransform:SoundTransform;
public var hasAviator2:Boolean;// = false
public var airbuses:Array;
public var setAirbusRand:int;// = 0
public var AchievementPointsTxt:TextField;
public var TutScreen:MovieClip;
public var setBlimpRand:int;// = 0
public var buildings:Array;
public var hasPhoenixPendant:Boolean;// = false
public var hasRuggedDown:Boolean;// = false
public var goldenGeese:Boolean;// = false
public var gooseGrabSnd:Sound;
public var elapsedEnemyTime:int;// = 0
public var SndBtn:SimpleButton;
public var setAlienCtr:int;// = 0
public var ResetUpgradesBtn:SimpleButton;
public var MenuBtn:SimpleButton;
public var bdg:Building;
public var SndTxt:TextField;
public var i:int;
public var j:int;
public var planeDropShadow:DropShadowFilter;
public var newCloud:Cloud;
public var AchievementsBtn:SimpleButton;
public var totalAchievements:int;// = 0
public var CareerAchievementsBox:TextField;
public var sc1Transform:SoundTransform;
public var AchievementsTxt:TextField;
public var currentScore:Number;// = 0
public var newPlane:Airplane;
public var setPlaneCtr:int;// = 0
public var phoenixRespawning:Boolean;// = false
public var hasHiveMind:Boolean;// = false
public var hasRabbitsFoot:Boolean;// = false
public var hasOffTheRadar:Boolean;// = false
public var hasBourgeoisie:Boolean;// = false
public var phoenixCount:int;// = 0
public var stealths:Array;
public var newHurricane:Hurricane;
public var achievementUnlockedSnd:Sound;
public var UpgradesBtn:SimpleButton;
public var newJet:Jet;
public var spawnBase:int;// = 12
public var clouds:Array;
public var jets:Array;
public var hasHomingBeacon:Boolean;// = false
public var setStealthRand:int;// = 0
public var lives:int;// = 3
public var newAlien:Alien;
public var hasMotherGoose:Boolean;// = false
public var soughtRotation:Number;
public var setStealthCtr:int;// = 0
public var currentUpgradePoints:int;// = 0
public var avatarRotSpeed:Number;// = 5
public var gooseImpactSnd:Sound;
public var flyingSoloStart:Number;// = 0
public var cookieCrunch:EndlessMigrationSharedObject;
public var hasIntoTheStorm:Boolean;// = false
public var sfxOn:Boolean;// = true
public var hasBabyHuey:Boolean;// = false
public var setAlienRand:int;// = 0
public var hasGold1:Boolean;// = false
public var hasGold2:Boolean;// = false
public var blimps:Array;
public var GoldenBonusBox:MovieClip;
public var Avatar:MovieClip;
public var hasGold3:Boolean;// = false
public var newBlimp:Blimp;
public var setHelicopterCtr:int;// = 0
public var hasSelfPreservation:Boolean;// = false
public var newHelicopter:Helicopter;
public var setHelicopterRand:int;// = 0
public var poseidonsSea:Boolean;// = false
public var hittingCloud:Boolean;// = false
public var careerScore:Number;// = 0
public var setCloudRand:int;// = 0
public var BestTimeTxt:TextField;
public var hasFrequentFlyer:Boolean;// = false
public var kongregate:KongregateAPI;
public var thunderSnd:Sound;
public var motherGooseStart:Number;// = 0
public var hasSoVeryCurious:Boolean;// = false
public var swanCount:int;// = 0
public var setBlimpCtr:int;// = 0
public var flockMates:Array;
public var hasAirlineTickets:Boolean;// = false
public var highScore:Number;// = 0
public var achievementPopUpCtr:int;// = 0
public var GroundLevel:MovieClip;
public var hasClearlyDevoted:Boolean;// = false
public var currentBonus:Number;// = 0
public var phoenixRespawnTimer:Timer;
public var inGameAchievementTimer:Timer;
public var setCloudCtr:int;// = 0
public var hasFlockmasterFlash:Boolean;// = false
public var newStealth:Stealth;
public var bgMusicTimer:Timer;
public var hasFlyingSolo:Boolean;// = false
public var motherGooseEnabled:Boolean;// = false
public var elapsedMultiples:int;// = 0
public var citySizeRand:int;// = 15
public var setPlaneRand:int;// = 0
public var HighScoreTxt:TextField;
public var hasDivineWings:Boolean;// = false
public var elapsedTime:int;// = 0
public var avatarSpeed:Number;
public var CloudLevel:MovieClip;
public var MoreGamesBtn:SimpleButton;
public var setStormRand:int;// = 0
public var citySizeCtr:int;// = 0
public var hasWellVersed:Boolean;// = false
public var gamePlayCount:int;// = 0
public var newBird:Bird;
public var aliens:Array;
public var energy:int;// = 100
public var setEnemyTimer:Timer;
public var ResetBtn:SimpleButton;
public var MusBtn:SimpleButton;
public var scBg:SoundChannel;
public var newAirbus:Airbus;
public var AchievementsMenu:MovieClip;
public var MusTxt:TextField;
public var CareerBestTimeBox:TextField;
public var bestTime:Number;// = 0
public var birds:Array;
public var musicOn:Boolean;// = true
public var CurrentScoreTxt:TextField;
public var elapsedMultipleFinder:int;// = 0
public var ConfirmClearBox:MovieClip;
public var setBirdRand:int;// = 0
public var setStormCtr:int;// = 0
public var SkyLevel:MovieClip;
public var OptionsBtn:SimpleButton;
public var hasNightvision:Boolean;// = false
public var setAirbusCtr:int;// = 0
public var hasEagleEyes:Boolean;// = false
public var hasFirstContact:Boolean;// = false
public var hasRainDance:Boolean;// = false
public var FlockSizeTxt:TextField;
public var hasScore1:Boolean;// = false
public var BgSong:Sound;
public var hasScore3:Boolean;// = false
public var hasScore4:Boolean;// = false
public var selfPreservationCheck:Boolean;// = true
public var hasScore2:Boolean;// = false
public var atSea:Boolean;// = false
public var hasScore5:Boolean;// = false
public var newStorm:Storm;
public var oceanSizeRand:int;// = 9
public var elapsedTimer:Timer;
public var hasPoseidonsBlessing:Boolean;// = false
public var earnedAchievementPoints:int;// = 0
public var hasRoyalLineage:Boolean;// = false
public var bonusMultiplier:Number;// = 1
public var gooseDieSnd:Sound;
public var CareerHighBox:TextField;
public var flyingSoloEnabled:Boolean;// = true
public var TotalUpgradesTxt:TextField;
public var newSwan:Swan;
public var CareerPlaysBox:TextField;
public var currentScale:Number;
public var ElapsedTimeTxt:TextField;
public var NewGameBtn:SimpleButton;
public var Cursor:MovieClip;
public var chachingSnd:Sound;
public var airplanes:Array;
public var helicopters:Array;
public var purchasedUpgradeCount:int;// = 0
public var oceanSizeCtr:int;// = 0
public var HowToBtn:SimpleButton;
public var hasSocialButterfly:Boolean;// = false
public var InGameAchievements:MovieClip;
public var setJetRand:int;// = 0
public var flockLimit:int;// = 16
public var TestBox:TextField;
public var goldenPopSnd:Sound;
public var hasAroundTheWorld:Boolean;// = false
public var setJetCtr:int;// = 0
public var avatarBase:Number;// = 10
public var oceansPassedToggle:Boolean;// = true
public var hasShockAndAwe:Boolean;// = false
public var sc1:SoundChannel;
public var setBirdTimer:Timer;
public var setBirdCtr:int;// = 0
public var CareerPointsBox:TextField;
public var avatarRotation:Number;
public var UpgradePointsTxt:TextField;
public var UpgradesMenu:MovieClip;
public function EndlessMigration(){
sfxOn = true;
musicOn = true;
cookieCrunch = new EndlessMigrationSharedObject();
kongregate = new KongregateAPI();
avatarBase = 10;
weatherSpeedEffect = 4.2;
avatarSpeed = avatarBase;
avatarRotSpeed = 5;
energy = 100;
lives = 3;
buildings = new Array();
setBirdTimer = new Timer(100);
setBirdCtr = 0;
setBirdRand = 0;
setEnemyTimer = new Timer(100);
setPlaneCtr = 0;
setPlaneRand = 0;
setBlimpCtr = 0;
setBlimpRand = 0;
setAirbusCtr = 0;
setAirbusRand = 0;
setHelicopterCtr = 0;
setHelicopterRand = 0;
setJetCtr = 0;
setJetRand = 0;
setAlienCtr = 0;
setAlienRand = 0;
setStealthCtr = 0;
setStealthRand = 0;
setCloudCtr = 0;
setCloudRand = 0;
setStormCtr = 0;
setStormRand = 0;
setCloudTimer = new Timer(100);
hittingCloud = false;
flockLimit = 16;
currentScore = 0;
currentBonus = 0;
bonusMultiplier = 1;
elapsedTime = 0;
highScore = 0;
bestTime = 0;
careerScore = 0;
elapsedTimer = new Timer(100);
elapsedEnemyTime = 0;
elapsedMultipleFinder = 0;
elapsedMultiples = 0;
spawnBase = 12;
bgMusicTimer = new Timer(188500);
BgSong = new Juventus();
gooseGrabSnd = new GooseGrabSnd();
gooseDieSnd = new GooseDieSnd();
gooseImpactSnd = new GooseImpactSnd();
chachingSnd = new ChachingSnd();
goldenPopSnd = new GoldenPopSnd();
thunderSnd = new ThunderSound();
achievementUnlockedSnd = new AchievementUnlocked();
sc1 = new SoundChannel();
sc1Transform = new SoundTransform();
scBg = new SoundChannel();
scBgTransform = new SoundTransform();
goldenGeese = false;
hasSocialButterfly = false;
hasMotherGoose = false;
hasScore1 = false;
hasScore2 = false;
hasScore3 = false;
hasScore4 = false;
hasScore5 = false;
hasWellVersed = false;
hasSoVeryCurious = false;
hasBourgeoisie = false;
hasFlockmasterFlash = false;
hasConsolationPrize = false;
hasGold1 = false;
hasGold2 = false;
hasGold3 = false;
hasAviator1 = false;
hasAviator2 = false;
hasAviator3 = false;
hasIntoTheStorm = false;
hasSelfPreservation = false;
hasFrequentFlyer = false;
hasFlyingSolo = false;
hasAirlineTickets = false;
hasBabyHuey = false;
hasShockAndAwe = false;
hasFirstContact = false;
hasOffTheRadar = false;
hasClearlyDevoted = false;
hasAroundTheWorld = false;
hasAerodynamics = false;
hasBigWingspan = false;
hasDivineWings = false;
hasHiveMind = false;
hasNightvision = false;
hasEagleEyes = false;
hasHomingBeacon = false;
hasRuggedDown = false;
hasRoyalLineage = false;
hasRabbitsFoot = false;
hasRainDance = false;
hasPoseidonsBlessing = false;
hasPhoenixPendant = false;
phoenixCount = 0;
phoenixRespawning = false;
phoenixRespawnTimer = new Timer(1000);
poseidonsSea = false;
oceansPassedToggle = true;
motherGooseStart = 0;
motherGooseEnabled = false;
flyingSoloStart = 0;
flyingSoloEnabled = true;
totalAchievements = 0;
earnedAchievementPoints = 0;
currentUpgradePoints = 0;
citySizeCtr = 0;
citySizeRand = 15;
oceanSizeCtr = 0;
oceanSizeRand = 9;
atSea = false;
oceansPassed = 0;
inGameAchievementTimer = new Timer(100);
achievementPopUpCtr = 0;
selfPreservationCheck = true;
gamePlayCount = 0;
swanCount = 0;
purchasedUpgradeCount = 0;
moveObstaclesTimer = new Timer(50);
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9);
LoadCookies();
addChild(kongregate);
}
public function ToMoreGames(_arg1:MouseEvent){
var _local2:URLRequest;
ConfirmClearBox.visible = false;
if (hasSoVeryCurious == false){
hasSoVeryCurious = true;
InGameAchievements.gotoAndStop("SoVeryCurious");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 10);
currentUpgradePoints = (currentUpgradePoints + 10);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
_local2 = new URLRequest("http://hotairraccoon.com/");
navigateToURL(_local2);
}
public function PhoenixRespawnReset(_arg1:TimerEvent){
phoenixRespawning = false;
phoenixRespawnTimer.stop();
}
public function GameOver(){
if ((((elapsedTime < 50)) && ((hasConsolationPrize == false)))){
hasConsolationPrize = true;
InGameAchievements.gotoAndStop("ConsolationPrize");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 1);
currentUpgradePoints = (currentUpgradePoints + 1);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
gamePlayCount++;
if ((((gamePlayCount >= 25)) && ((hasFrequentFlyer == false)))){
hasFrequentFlyer = true;
InGameAchievements.gotoAndStop("FrequentFlyer");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 30);
currentUpgradePoints = (currentUpgradePoints + 30);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
i = (birds.length - 1);
while (i >= 0) {
SkyLevel.removeChild(birds[i]);
birds.splice(i, 1);
i--;
};
i = (airplanes.length - 1);
while (i >= 0) {
SkyLevel.removeChild(airplanes[i]);
airplanes.splice(i, 1);
i--;
};
i = (blimps.length - 1);
while (i >= 0) {
SkyLevel.removeChild(blimps[i]);
blimps.splice(i, 1);
i--;
};
i = (airbuses.length - 1);
while (i >= 0) {
SkyLevel.removeChild(airbuses[i]);
airbuses.splice(i, 1);
i--;
};
i = (helicopters.length - 1);
while (i >= 0) {
SkyLevel.removeChild(helicopters[i]);
helicopters.splice(i, 1);
i--;
};
i = (jets.length - 1);
while (i >= 0) {
SkyLevel.removeChild(jets[i]);
jets.splice(i, 1);
i--;
};
i = (aliens.length - 1);
while (i >= 0) {
SkyLevel.removeChild(aliens[i]);
aliens.splice(i, 1);
i--;
};
i = (clouds.length - 1);
while (i >= 0) {
CloudLevel.removeChild(clouds[i]);
clouds.splice(i, 1);
i--;
};
i = (stealths.length - 1);
while (i >= 0) {
SkyLevel.removeChild(stealths[i]);
stealths.splice(i, 1);
i--;
};
Cursor.visible = false;
Mouse.show();
GameOverScreen.TotalTimeTxt.text = String((("Your flock survived for " + (elapsedTime / 10)) + " seconds."));
GameOverScreen.RecapScoreTxt.text = String((("You scored " + currentScore) + " points."));
careerScore = (careerScore + currentScore);
currentUpgradePoints = (currentUpgradePoints + Math.floor((currentScore / 10000)));
GameOverScreen.UpgradeEarningsTxt.text = String((("You earned " + Math.floor((currentScore / 10000))) + " Upgrade Points."));
if ((((careerScore >= 5000000)) && ((hasClearlyDevoted == false)))){
hasClearlyDevoted = true;
InGameAchievements.gotoAndStop("ClearlyDevoted");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 50);
currentUpgradePoints = (currentUpgradePoints + 50);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
if (currentScore > highScore){
GameOverScreen.HighScoreTxt.text = String("That's a new record!");
highScore = currentScore;
} else {
GameOverScreen.HighScoreTxt.text = String("");
};
if (elapsedTime > bestTime){
GameOverScreen.BestTimeTxt.text = String("That's a new best time!");
bestTime = elapsedTime;
} else {
GameOverScreen.BestTimeTxt.text = String("");
};
setBirdTimer.stop();
setBirdTimer.removeEventListener(TimerEvent.TIMER, SetBirds);
setEnemyTimer.stop();
setEnemyTimer.removeEventListener(TimerEvent.TIMER, SetEnemies);
setCloudTimer.stop();
setCloudTimer.removeEventListener(TimerEvent.TIMER, SetEnemies);
elapsedTimer.stop();
elapsedTimer.removeEventListener(TimerEvent.TIMER, ElapsedTiming);
moveObstaclesTimer.stop();
moveObstaclesTimer.removeEventListener(TimerEvent.TIMER, MoveObstacles);
phoenixRespawnTimer.stop();
phoenixRespawnTimer.removeEventListener(TimerEvent.TIMER, PhoenixRespawnReset);
SetCookies();
SendToKong();
}
public function ResetUpgrades(_arg1:MouseEvent){
if (hasHomingBeacon == true){
currentUpgradePoints = (currentUpgradePoints + 50);
hasHomingBeacon = false;
};
if (hasRuggedDown == true){
currentUpgradePoints = (currentUpgradePoints + 20);
hasRuggedDown = false;
};
if (hasAerodynamics == true){
currentUpgradePoints = (currentUpgradePoints + 30);
hasAerodynamics = false;
};
if (hasBigWingspan == true){
currentUpgradePoints = (currentUpgradePoints + 70);
hasBigWingspan = false;
};
if (hasDivineWings == true){
currentUpgradePoints = (currentUpgradePoints + 100);
hasDivineWings = false;
};
if (hasHiveMind == true){
currentUpgradePoints = (currentUpgradePoints + 50);
hasHiveMind = false;
};
if (hasRoyalLineage == true){
currentUpgradePoints = (currentUpgradePoints + 50);
hasRoyalLineage = false;
};
if (hasNightvision == true){
currentUpgradePoints = (currentUpgradePoints + 50);
hasNightvision = false;
};
if (hasEagleEyes == true){
currentUpgradePoints = (currentUpgradePoints + 80);
hasEagleEyes = false;
};
if (hasRabbitsFoot == true){
currentUpgradePoints = (currentUpgradePoints + 50);
hasRabbitsFoot = false;
};
if (hasRainDance == true){
currentUpgradePoints = (currentUpgradePoints + 40);
hasRainDance = false;
};
if (hasPoseidonsBlessing == true){
currentUpgradePoints = (currentUpgradePoints + 400);
hasPoseidonsBlessing = false;
};
if (hasPhoenixPendant == true){
currentUpgradePoints = (currentUpgradePoints + 400);
hasPhoenixPendant = false;
};
UpgradesMenu.HomingBeacon.gotoAndStop("Normal");
UpgradesMenu.RuggedDown.gotoAndStop("Normal");
UpgradesMenu.Aerodynamics.gotoAndStop("Normal");
UpgradesMenu.BigWingspan.gotoAndStop("Normal");
UpgradesMenu.DivineWings.gotoAndStop("Normal");
UpgradesMenu.HiveMind.gotoAndStop("Normal");
UpgradesMenu.RoyalLineage.gotoAndStop("Normal");
UpgradesMenu.Nightvision.gotoAndStop("Normal");
UpgradesMenu.EagleEyes.gotoAndStop("Normal");
UpgradesMenu.RabbitsFoot.gotoAndStop("Normal");
UpgradesMenu.RainDance.gotoAndStop("Normal");
UpgradesMenu.PoseidonsBlessing.gotoAndStop("Normal");
UpgradesMenu.PhoenixPendant.gotoAndStop("Normal");
purchasedUpgradeCount = 0;
SetCookies();
SendToKong();
}
public function BgmRestart(_arg1:TimerEvent){
if (musicOn == true){
scBgTransform.volume = 0.1;
scBg = BgSong.play();
scBg.soundTransform = scBgTransform;
};
}
function frame3(){
stop();
ConfirmClearBox.visible = false;
InGameAchievements.visible = false;
inGameAchievementTimer.addEventListener(TimerEvent.TIMER, AchievementPopUp);
CareerPlaysBox.text = String(("Career Plays: " + gamePlayCount));
CareerHighBox.text = String(("High Score: " + highScore));
CareerBestTimeBox.text = String((("Best Time: " + (bestTime / 10)) + " sec."));
CareerPointsBox.text = String(("Career Points: " + careerScore));
CareerAchievementsBox.text = String((("Achievements Earned: " + totalAchievements) + "/29"));
NewGameBtn.addEventListener(MouseEvent.CLICK, NewGame);
HowToBtn.addEventListener(MouseEvent.CLICK, ToHowTo);
AchievementsBtn.addEventListener(MouseEvent.CLICK, ToAchievements);
UpgradesBtn.addEventListener(MouseEvent.CLICK, ToUpgrades);
MoreGamesBtn.addEventListener(MouseEvent.CLICK, ToMoreGames);
OptionsBtn.addEventListener(MouseEvent.CLICK, ToOptions);
ResetBtn.addEventListener(MouseEvent.CLICK, ResetGame);
ConfirmClearBox.YesBtn.addEventListener(MouseEvent.CLICK, ConfirmClear);
ConfirmClearBox.NoBtn.addEventListener(MouseEvent.CLICK, CancelClear);
}
public function MoveClouds(){
i = (clouds.length - 1);
while (i >= 0) {
clouds[i].y = (clouds[i].y + clouds[i].flySpeed);
if (clouds[i].slowSpeed == 8){
clouds[i].rotation = (clouds[i].rotation + 10);
};
if (((clouds[i].hitTestPoint(Avatar.x, Avatar.y, true)) && ((Avatar.visible == true)))){
hittingCloud = true;
if (clouds[i].hittingAvatar == false){
if (hasRuggedDown == true){
weatherSpeedEffect = (weatherSpeedEffect + (clouds[i].slowSpeed / 2));
} else {
weatherSpeedEffect = (weatherSpeedEffect + clouds[i].slowSpeed);
};
clouds[i].hittingAvatar = true;
};
if ((((clouds[i].slowSpeed == 8)) && ((hasIntoTheStorm == false)))){
hasIntoTheStorm = true;
InGameAchievements.gotoAndStop("IntoTheStorm");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 15);
currentUpgradePoints = (currentUpgradePoints + 15);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
};
if (clouds[i].y > 800){
CloudLevel.removeChild(clouds[i]);
clouds.splice(i, 1);
};
i--;
};
if (hittingCloud == true){
avatarSpeed = (avatarBase - weatherSpeedEffect);
hittingCloud = false;
} else {
avatarSpeed = avatarBase;
if (hasRuggedDown == true){
weatherSpeedEffect = 3;
} else {
weatherSpeedEffect = 4.2;
};
};
}
function frame2(){
scBgTransform.volume = 0.1;
scBg = BgSong.play();
scBg.soundTransform = scBgTransform;
bgMusicTimer.addEventListener(TimerEvent.TIMER, BgmRestart);
bgMusicTimer.start();
}
function frame5(){
AchievementsTxt.text = String((("You have unlocked " + totalAchievements) + " of the 29 achievements."));
AchievementPointsTxt.text = String((("You have earned " + earnedAchievementPoints) + " of the 1226 Upgrade Points from achievements."));
MenuBtn.addEventListener(MouseEvent.CLICK, ToMenu2);
ButtonSet();
AchievementsMenu.addEventListener(MouseEvent.MOUSE_MOVE, OverAchievements);
}
function frame6(){
MenuBtn.addEventListener(MouseEvent.CLICK, ToMenu4);
TotalUpgradesTxt.text = String((("You have purchased " + purchasedUpgradeCount) + " of the 13 Upgrades."));
UpgradePointsTxt.text = String((("You have " + currentUpgradePoints) + " to spend on Upgrades."));
if (hasHomingBeacon == true){
UpgradesMenu.HomingBeacon.gotoAndStop("Over");
} else {
UpgradesMenu.HomingBeacon.gotoAndStop("Normal");
};
if (hasRuggedDown == true){
UpgradesMenu.RuggedDown.gotoAndStop("Over");
} else {
UpgradesMenu.RuggedDown.gotoAndStop("Normal");
};
if (hasAerodynamics == true){
UpgradesMenu.Aerodynamics.gotoAndStop("Over");
} else {
UpgradesMenu.Aerodynamics.gotoAndStop("Normal");
};
if (hasBigWingspan == true){
UpgradesMenu.BigWingspan.gotoAndStop("Over");
} else {
UpgradesMenu.BigWingspan.gotoAndStop("Normal");
};
if (hasDivineWings == true){
UpgradesMenu.DivineWings.gotoAndStop("Over");
} else {
UpgradesMenu.DivineWings.gotoAndStop("Normal");
};
if (hasHiveMind == true){
UpgradesMenu.HiveMind.gotoAndStop("Over");
} else {
UpgradesMenu.HiveMind.gotoAndStop("Normal");
};
if (hasRoyalLineage == true){
UpgradesMenu.RoyalLineage.gotoAndStop("Over");
} else {
UpgradesMenu.RoyalLineage.gotoAndStop("Normal");
};
if (hasNightvision == true){
UpgradesMenu.Nightvision.gotoAndStop("Over");
} else {
UpgradesMenu.Nightvision.gotoAndStop("Normal");
};
if (hasEagleEyes == true){
UpgradesMenu.EagleEyes.gotoAndStop("Over");
} else {
UpgradesMenu.EagleEyes.gotoAndStop("Normal");
};
if (hasRabbitsFoot == true){
UpgradesMenu.RabbitsFoot.gotoAndStop("Over");
} else {
UpgradesMenu.RabbitsFoot.gotoAndStop("Normal");
};
if (hasRainDance == true){
UpgradesMenu.RainDance.gotoAndStop("Over");
} else {
UpgradesMenu.RainDance.gotoAndStop("Normal");
};
if (hasPoseidonsBlessing == true){
UpgradesMenu.PoseidonsBlessing.gotoAndStop("Over");
} else {
UpgradesMenu.PoseidonsBlessing.gotoAndStop("Normal");
};
if (hasPhoenixPendant == true){
UpgradesMenu.PhoenixPendant.gotoAndStop("Over");
} else {
UpgradesMenu.PhoenixPendant.gotoAndStop("Normal");
};
UpgradesMenu.addEventListener(MouseEvent.MOUSE_MOVE, OverUpgrades);
UpgradesMenu.addEventListener(MouseEvent.CLICK, PurchaseUpgrades);
ResetUpgradesBtn.addEventListener(MouseEvent.CLICK, ResetUpgrades);
}
function frame7(){
if (sfxOn == true){
SndTxt.text = String("Sound is currently on.");
} else {
SndTxt.text = String("Sound is currently off.");
};
if (musicOn == true){
MusTxt.text = String("Music is currently on.");
} else {
MusTxt.text = String("Music is currently off.");
};
MenuBtn.addEventListener(MouseEvent.CLICK, ToMenu3);
MusBtn.addEventListener(MouseEvent.CLICK, MusToggle);
SndBtn.addEventListener(MouseEvent.CLICK, SndToggle);
}
function frame1(){
MochiAd.showPreGameAd({clip:root, id:"17be72d505b8b766", res:"700x600"});
}
function frame4(){
MenuBtn.addEventListener(MouseEvent.CLICK, ToMenu);
TutScreen.PrevBtn.addEventListener(MouseEvent.CLICK, TutPrev);
TutScreen.NextBtn.addEventListener(MouseEvent.CLICK, TutNext);
}
function frame9(){
gotoAndStop("Play");
}
function frame8(){
InitGame();
}
public function MoveJets(){
i = (jets.length - 1);
while (i >= 0) {
jets[i].x = (jets[i].x + (((elapsedMultiples / 2) + jets[i].flySpeed) * Math.cos((jets[i].rotation / (180 / Math.PI)))));
jets[i].y = (jets[i].y + (((elapsedMultiples / 2) + jets[i].flySpeed) * Math.sin((jets[i].rotation / (180 / Math.PI)))));
j = (flockMates.length - 1);
while (j >= 0) {
if (jets[i].hitTestPoint(flockMates[j].x, flockMates[j].y, true)){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
jets[i].gotoAndStop((jets[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[j]);
bonusMultiplier = (bonusMultiplier - flockMates[j].multiplierValue);
flockMates.splice(j, 1);
motherGooseEnabled = false;
};
j--;
};
if (jets[i].hitTestPoint(Avatar.x, Avatar.y, true)){
if ((((phoenixRespawning == false)) && ((((poseidonsSea == false)) || ((((poseidonsSea == true)) && ((hasPoseidonsBlessing == false)))))))){
selfPreservationCheck = false;
if (flockMates.length > 0){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
Avatar.x = flockMates[(flockMates.length - 1)].x;
Avatar.y = flockMates[(flockMates.length - 1)].y;
jets[i].gotoAndStop((jets[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[(flockMates.length - 1)]);
bonusMultiplier = (bonusMultiplier - flockMates[(flockMates.length - 1)].multiplierValue);
flockMates.splice((flockMates.length - 1), 1);
motherGooseEnabled = false;
} else {
if (sfxOn == true){
sc1 = gooseDieSnd.play();
sc1.soundTransform = sc1Transform;
};
if ((((hasPhoenixPendant == true)) && ((phoenixCount < 3)))){
phoenixCount++;
if (birds.length > 0){
Avatar.x = birds[0].x;
Avatar.y = birds[0].y;
phoenixRespawning = true;
phoenixRespawnTimer.start();
SkyLevel.removeChild(birds[i]);
birds.splice(i, 1);
};
} else {
Avatar.visible = false;
jets[i].gotoAndStop((jets[i].currentFrame + 1));
GameOverScreen.visible = true;
GameOver();
};
};
};
} else {
if ((((((((jets[i].x > 800)) || ((jets[i].x < -100)))) || ((jets[i].y > 700)))) || ((jets[i].y < -100)))){
SkyLevel.removeChild(jets[i]);
jets.splice(i, 1);
};
};
i--;
};
}
public function MoveBlimps(){
i = (blimps.length - 1);
while (i >= 0) {
blimps[i].y = (blimps[i].y + blimps[i].flySpeed);
j = (flockMates.length - 1);
while (j >= 0) {
if (blimps[i].hitTestPoint(flockMates[j].x, flockMates[j].y, true)){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
blimps[i].gotoAndStop((blimps[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[j]);
bonusMultiplier = (bonusMultiplier - flockMates[j].multiplierValue);
flockMates.splice(j, 1);
motherGooseEnabled = false;
};
j--;
};
if (((blimps[i].hitTestPoint(Avatar.x, Avatar.y, true)) && ((Avatar.visible == true)))){
if ((((phoenixRespawning == false)) && ((((poseidonsSea == false)) || ((((poseidonsSea == true)) && ((hasPoseidonsBlessing == false)))))))){
selfPreservationCheck = false;
if (flockMates.length > 0){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
Avatar.x = flockMates[(flockMates.length - 1)].x;
Avatar.y = flockMates[(flockMates.length - 1)].y;
blimps[i].gotoAndStop((blimps[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[(flockMates.length - 1)]);
bonusMultiplier = (bonusMultiplier - flockMates[(flockMates.length - 1)].multiplierValue);
flockMates.splice((flockMates.length - 1), 1);
motherGooseEnabled = false;
} else {
if (sfxOn == true){
sc1 = gooseDieSnd.play();
sc1.soundTransform = sc1Transform;
};
if ((((hasPhoenixPendant == true)) && ((phoenixCount < 3)))){
phoenixCount++;
if (birds.length > 0){
phoenixRespawning = true;
phoenixRespawnTimer.start();
Avatar.x = birds[0].x;
Avatar.y = birds[0].y;
SkyLevel.removeChild(birds[i]);
birds.splice(i, 1);
};
} else {
Avatar.visible = false;
blimps[i].gotoAndStop((blimps[i].currentFrame + 1));
GameOverScreen.visible = true;
GameOver();
};
};
};
} else {
if (blimps[i].y > 800){
SkyLevel.removeChild(blimps[i]);
blimps.splice(i, 1);
};
};
i--;
};
}
public function ElapsedTiming(_arg1:TimerEvent){
elapsedTime++;
elapsedEnemyTime++;
elapsedMultipleFinder++;
if (Avatar.visible == true){
currentScore = (currentScore + Math.ceil(((20 + (elapsedMultiples * 5)) * bonusMultiplier)));
if (hasRabbitsFoot == true){
currentScore = (currentScore + (10 * bonusMultiplier));
};
};
if (elapsedEnemyTime >= 100){
elapsedEnemyTime = 0;
if (spawnBase > 1){
spawnBase--;
} else {
spawnBase = 1;
};
};
if ((((((motherGooseEnabled == true)) && (((elapsedTime - motherGooseStart) >= 150)))) && ((hasMotherGoose == false)))){
hasMotherGoose = true;
InGameAchievements.gotoAndStop("MotherGoose");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 25);
currentUpgradePoints = (currentUpgradePoints + 25);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
if ((((((flyingSoloEnabled == true)) && (((elapsedTime - flyingSoloStart) >= 300)))) && ((hasFlyingSolo == false)))){
hasFlyingSolo = true;
InGameAchievements.gotoAndStop("FlyingSolo");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 40);
currentUpgradePoints = (currentUpgradePoints + 40);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
if (elapsedMultipleFinder >= 150){
elapsedMultipleFinder = 0;
elapsedMultiples++;
};
if ((((elapsedTime >= 1800)) && ((hasAviator3 == false)))){
hasAviator3 = true;
InGameAchievements.gotoAndStop("Aviator3");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 100);
currentUpgradePoints = (currentUpgradePoints + 100);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
} else {
if ((((elapsedTime >= 1200)) && ((hasAviator2 == false)))){
hasAviator2 = true;
InGameAchievements.gotoAndStop("Aviator2");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 50);
currentUpgradePoints = (currentUpgradePoints + 50);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
} else {
if ((((elapsedTime >= 600)) && ((hasAviator1 == false)))){
hasAviator1 = true;
InGameAchievements.gotoAndStop("Aviator1");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 20);
currentUpgradePoints = (currentUpgradePoints + 20);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
};
};
}
public function ToMenu2(_arg1:MouseEvent){
gotoAndStop("Menu");
}
public function ToMenu3(_arg1:MouseEvent){
gotoAndStop("Menu");
}
public function ToMenu4(_arg1:MouseEvent){
gotoAndStop("Menu");
}
public function MovePlanes(){
i = (airplanes.length - 1);
while (i >= 0) {
airplanes[i].x = (airplanes[i].x + (((elapsedMultiples / 2) + airplanes[i].flySpeed) * Math.cos((airplanes[i].rotation / (180 / Math.PI)))));
airplanes[i].y = (airplanes[i].y + (((elapsedMultiples / 2) + airplanes[i].flySpeed) * Math.sin((airplanes[i].rotation / (180 / Math.PI)))));
j = (flockMates.length - 1);
while (j >= 0) {
if (airplanes[i].hitTestPoint(flockMates[j].x, flockMates[j].y, true)){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
airplanes[i].gotoAndStop((airplanes[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[j]);
bonusMultiplier = (bonusMultiplier - flockMates[j].multiplierValue);
flockMates.splice(j, 1);
motherGooseEnabled = false;
};
j--;
};
if (airplanes[i].hitTestPoint(Avatar.x, Avatar.y, true)){
if ((((phoenixRespawning == false)) && ((((poseidonsSea == false)) || ((((poseidonsSea == true)) && ((hasPoseidonsBlessing == false)))))))){
selfPreservationCheck = false;
if (flockMates.length > 0){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
Avatar.x = flockMates[(flockMates.length - 1)].x;
Avatar.y = flockMates[(flockMates.length - 1)].y;
airplanes[i].gotoAndStop((airplanes[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[(flockMates.length - 1)]);
bonusMultiplier = (bonusMultiplier - flockMates[(flockMates.length - 1)].multiplierValue);
flockMates.splice((flockMates.length - 1), 1);
motherGooseEnabled = false;
} else {
if (sfxOn == true){
sc1 = gooseDieSnd.play();
sc1.soundTransform = sc1Transform;
};
if ((((hasPhoenixPendant == true)) && ((phoenixCount < 3)))){
phoenixCount++;
if (birds.length > 0){
Avatar.x = birds[0].x;
Avatar.y = birds[0].y;
phoenixRespawning = true;
phoenixRespawnTimer.start();
SkyLevel.removeChild(birds[i]);
birds.splice(i, 1);
};
} else {
Avatar.visible = false;
airplanes[i].gotoAndStop((airplanes[i].currentFrame + 1));
GameOverScreen.visible = true;
GameOver();
};
};
};
} else {
if ((((((((airplanes[i].x > 800)) || ((airplanes[i].x < -100)))) || ((airplanes[i].y > 700)))) || ((airplanes[i].y < -100)))){
SkyLevel.removeChild(airplanes[i]);
airplanes.splice(i, 1);
};
};
i--;
};
}
public function SendToKong(){
if (kongregate.connected){
kongregate.stats.submit("HighScore", highScore);
kongregate.stats.submit("BestTime", bestTime);
kongregate.stats.submit("TotalAchievementsEarned", totalAchievements);
kongregate.stats.submit("TotalAchievementPointsEarned", earnedAchievementPoints);
kongregate.stats.submit("CareerScore", careerScore);
kongregate.stats.submit("PurchasedUpgradeCount", purchasedUpgradeCount);
};
}
public function ToHowTo(_arg1:MouseEvent){
ConfirmClearBox.visible = false;
gotoAndStop("Learn");
}
public function MoveFlock(){
if ((((Avatar.x == mouseX)) && ((Avatar.y == mouseY)))){
if (Avatar.rotation > -75){
Avatar.rotation = (Avatar.rotation - 15);
} else {
if (Avatar.rotation < -105){
Avatar.rotation = (Avatar.rotation + 15);
} else {
Avatar.rotation = 270;
};
};
} else {
Avatar.rotation = soughtRotation;
if (Avatar.rotation > 0){
Avatar.rotation = (Avatar.rotation * -1);
};
};
if (Math.abs((Avatar.x - mouseX)) > avatarSpeed){
Avatar.x = (Avatar.x + (avatarSpeed * Math.cos((soughtRotation / (180 / Math.PI)))));
} else {
Avatar.x = mouseX;
};
if (Math.abs((Avatar.y - mouseY)) > avatarSpeed){
Avatar.y = (Avatar.y + (avatarSpeed * Math.sin((soughtRotation / (180 / Math.PI)))));
} else {
Avatar.y = mouseY;
};
bonusMultiplier = 1;
i = (flockMates.length - 1);
while (i >= 0) {
bonusMultiplier = (bonusMultiplier + (Math.floor((flockMates[i].multiplierValue * 10)) / 10));
if ((((bonusMultiplier >= 7.4)) && ((hasBourgeoisie == false)))){
hasBourgeoisie = true;
InGameAchievements.gotoAndStop("Bourgeoisie");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 50);
currentUpgradePoints = (currentUpgradePoints + 50);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
if (i == 0){
flockMates[i].destinationX = (Avatar.x - 7);
flockMates[i].destinationY = (Avatar.y + 10);
} else {
if (i == 1){
flockMates[i].destinationX = (Avatar.x + Math.abs((Avatar.x - flockMates[(i - 1)].destinationX)));
flockMates[i].destinationY = flockMates[(i - 1)].destinationY;
} else {
if (i > 0){
if (flockMates[(i - 1)].destinationX < Avatar.x){
flockMates[i].destinationX = (Avatar.x + Math.abs((Avatar.x - flockMates[(i - 1)].destinationX)));
flockMates[i].destinationY = flockMates[(i - 1)].destinationY;
} else {
if (flockMates[(i - 1)].destinationX > Avatar.x){
flockMates[i].destinationX = (flockMates[(i - 2)].destinationX - 7);
flockMates[i].destinationY = (flockMates[(i - 1)].destinationY + 10);
};
};
};
};
};
flockMates[i].soughtRot = (((180 / Math.PI) * Math.atan2((flockMates[i].y - flockMates[i].destinationY), (flockMates[i].x - flockMates[i].destinationX))) + 180);
if (Math.abs((flockMates[i].destinationX - flockMates[i].x)) > flockMates[i].flockSpeed){
flockMates[i].x = (flockMates[i].x + (flockMates[i].flockSpeed * Math.cos((flockMates[i].soughtRot / (180 / Math.PI)))));
} else {
flockMates[i].x = flockMates[i].destinationX;
};
if (Math.abs((flockMates[i].destinationY - flockMates[i].y)) > flockMates[i].flockSpeed){
flockMates[i].y = (flockMates[i].y + (flockMates[i].flockSpeed * Math.sin((flockMates[i].soughtRot / (180 / Math.PI)))));
} else {
flockMates[i].y = flockMates[i].destinationY;
};
if (flockMates[i].y > 590){
flockMates[i].y = 590;
};
if (flockMates[i].x < 10){
flockMates[i].x = 10;
} else {
if (flockMates[i].x > 690){
flockMates[i].x = 690;
};
};
i--;
};
}
public function WellVersedEarned(){
if (hasWellVersed == false){
hasWellVersed = true;
InGameAchievements.gotoAndStop("WellVersed");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 10);
currentUpgradePoints = (currentUpgradePoints + 10);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
cookieCrunch.setCookieInt("totalAchievements", totalAchievements);
cookieCrunch.setCookieInt("earnedAchievementPoints", earnedAchievementPoints);
if (kongregate.connected){
kongregate.stats.submit("TotalAchievementsEarned", totalAchievements);
kongregate.stats.submit("TotalAchievementPointsEarned", earnedAchievementPoints);
};
};
}
public function InitGame(){
phoenixRespawning = false;
flyingSoloEnabled = true;
flyingSoloStart = 0;
oceansPassedToggle = true;
sc1Transform.volume = 0.7;
currentScore = 0;
currentBonus = 0;
oceansPassed = 0;
bonusMultiplier = 1;
elapsedTime = 0;
elapsedEnemyTime = 0;
elapsedMultipleFinder = 0;
elapsedMultiples = 0;
phoenixCount = 0;
poseidonsSea = false;
selfPreservationCheck = true;
swanCount = 0;
spawnBase = 12;
flockMates = new Array();
birds = new Array();
airplanes = new Array();
blimps = new Array();
airbuses = new Array();
helicopters = new Array();
jets = new Array();
aliens = new Array();
stealths = new Array();
clouds = new Array();
Avatar.GoldenGoose.visible = false;
GoldenBonusBox.alpha = 0;
GameOverScreen.visible = false;
InGameAchievements.alpha = 1;
InGameAchievements.visible = false;
Mouse.hide();
buildings.push(GroundLevel.Building1);
Avatar.rotation = 270;
Avatar.scaleX = 0.075;
Avatar.scaleY = 0.075;
setBirdRand = 10;
setBirdCtr = 0;
setBirdTimer.addEventListener(TimerEvent.TIMER, SetBirds);
setBirdTimer.start();
setPlaneRand = 15;
setBlimpRand = 40;
setAirbusRand = 3;
setHelicopterRand = 3;
setJetRand = 3;
setAlienRand = 50;
setStealthRand = 3;
setPlaneCtr = 0;
setBlimpCtr = 0;
setAirbusCtr = 0;
setHelicopterCtr = 0;
setJetCtr = 0;
setAlienCtr = 0;
setStealthCtr = 0;
citySizeCtr = 0;
citySizeRand = 15;
oceanSizeCtr = 0;
oceanSizeRand = 9;
atSea = false;
if (hasDivineWings == true){
avatarBase = 20;
} else {
if (hasBigWingspan == true){
avatarBase = 15;
} else {
if (hasAerodynamics == true){
avatarBase = 13;
} else {
avatarBase = 10;
};
};
};
parent.addEventListener(Event.ENTER_FRAME, GameLoop);
setEnemyTimer.addEventListener(TimerEvent.TIMER, SetEnemies);
setEnemyTimer.start();
setCloudRand = 10;
setCloudCtr = 0;
setStormRand = 100;
setStormCtr = 0;
setCloudTimer.addEventListener(TimerEvent.TIMER, SetClouds);
setCloudTimer.start();
elapsedTimer.addEventListener(TimerEvent.TIMER, ElapsedTiming);
elapsedTimer.start();
moveObstaclesTimer.addEventListener(TimerEvent.TIMER, MoveObstacles);
moveObstaclesTimer.start();
phoenixRespawnTimer.addEventListener(TimerEvent.TIMER, PhoenixRespawnReset);
GameOverScreen.MenuBtn.addEventListener(MouseEvent.CLICK, BackToMenu);
GameOverScreen.RetryBtn.addEventListener(MouseEvent.CLICK, RetryGame);
}
public function ToAchievements(_arg1:MouseEvent){
ConfirmClearBox.visible = false;
gotoAndStop("Achievements");
}
public function MoveBirds(){
i = (birds.length - 1);
while (i >= 0) {
if (flockMates.length >= flockLimit){
if ((((GoldenBonusBox.alpha == 0)) && ((sfxOn == true)))){
sc1 = goldenPopSnd.play();
sc1.soundTransform = sc1Transform;
};
GoldenBonusBox.alpha = 0.6;
GoldenBonusBox.GoldenBonusTxt.text = String((("+" + currentBonus) + "!"));
Avatar.GoldenGoose.visible = true;
birds[i].GoldenGoose.visible = true;
birds[i].rotation = (((180 / Math.PI) * Math.atan2((birds[i].y - Avatar.y), (birds[i].x - Avatar.x))) + 180);
birds[i].x = (birds[i].x + ((4 * birds[i].flySpeed) * Math.cos((birds[i].rotation / (180 / Math.PI)))));
birds[i].y = (birds[i].y + ((4 * birds[i].flySpeed) * Math.sin((birds[i].rotation / (180 / Math.PI)))));
} else {
currentBonus = 500;
GoldenBonusBox.alpha = 0;
Avatar.GoldenGoose.visible = false;
birds[i].rotation = -90;
birds[i].GoldenGoose.visible = false;
birds[i].y = (birds[i].y + birds[i].flySpeed);
};
if (Avatar.QuackBubble.hitTestPoint(birds[i].x, birds[i].y)){
flyingSoloEnabled = false;
if (flockMates.length < flockLimit){
flockMates.push(birds[i]);
if (sfxOn == true){
sc1 = gooseGrabSnd.play();
sc1.soundTransform = sc1Transform;
};
} else {
currentBonus = (currentBonus + 500);
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
GoldenBonusBox.GoldenBonusTxt.text = String((("+" + currentBonus) + "!"));
currentScore = (currentScore + currentBonus);
Avatar.QuackBubble.gotoAndPlay(2);
SkyLevel.removeChild(birds[i]);
if ((((currentBonus >= 15000)) && ((hasGold3 == false)))){
hasGold3 = true;
InGameAchievements.gotoAndStop("Gold3");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 50);
currentUpgradePoints = (currentUpgradePoints + 50);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
} else {
if ((((currentBonus >= 10000)) && ((hasGold2 == false)))){
hasGold2 = true;
InGameAchievements.gotoAndStop("Gold2");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 25);
currentUpgradePoints = (currentUpgradePoints + 25);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
} else {
if ((((currentBonus >= 3000)) && ((hasGold1 == false)))){
hasGold1 = true;
InGameAchievements.gotoAndStop("Gold1");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 10);
currentUpgradePoints = (currentUpgradePoints + 10);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
};
};
};
birds.splice(i, 1);
break;
} else {
if (birds[i].y > 620){
SkyLevel.removeChild(birds[i]);
birds.splice(i, 1);
break;
};
};
i--;
};
}
public function NewGame(_arg1:MouseEvent){
ConfirmClearBox.visible = false;
gotoAndStop("Play");
}
public function ToUpgrades(_arg1:MouseEvent){
ConfirmClearBox.visible = false;
gotoAndStop("Upgrades");
}
public function ResetGame(_arg1:MouseEvent){
ConfirmClearBox.visible = true;
}
public function GameLoop(_arg1:Event){
currentScale = 1.8;
Cursor.x = mouseX;
Cursor.y = mouseY;
soughtRotation = (((180 / Math.PI) * Math.atan2((Avatar.y - mouseY), (Avatar.x - mouseX))) + 180);
if (hasHomingBeacon == true){
Avatar.QuackBubble.scaleX = 2.8;
} else {
Avatar.QuackBubble.scaleX = 1.5;
};
Avatar.QuackBubble.scaleY = Avatar.QuackBubble.scaleX;
if (Avatar.visible == true){
MoveFlock();
MoveBirds();
MovePlanes();
MoveAirbuses();
MoveJets();
MoveHelicopters();
MoveBlimps();
MoveAliens();
MoveStealths();
MoveClouds();
};
if (flockMates.length == 0){
if (flyingSoloEnabled == false){
flyingSoloEnabled = true;
flyingSoloStart = elapsedTime;
};
};
if (flockMates.length >= flockLimit){
if (motherGooseEnabled == false){
motherGooseEnabled = true;
motherGooseStart = elapsedTime;
};
goldenGeese = true;
if (hasSocialButterfly == false){
hasSocialButterfly = true;
InGameAchievements.gotoAndStop("SocialButterfly");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 10);
currentUpgradePoints = (currentUpgradePoints + 10);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
} else {
goldenGeese = false;
};
UpdateTextBoxes();
}
public function MoveAliens(){
i = (aliens.length - 1);
while (i >= 0) {
aliens[i].x = (aliens[i].x + aliens[i].flySpeed);
aliens[i].Rotator.rotation = (aliens[i].Rotator.rotation + 5);
j = (flockMates.length - 1);
while (j >= 0) {
if (aliens[i].hitTestPoint(flockMates[j].x, flockMates[j].y, true)){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
aliens[i].gotoAndStop((aliens[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[j]);
bonusMultiplier = (bonusMultiplier - flockMates[j].multiplierValue);
flockMates.splice(j, 1);
motherGooseEnabled = false;
};
j--;
};
if (((aliens[i].hitTestPoint(Avatar.x, Avatar.y, true)) && ((Avatar.visible == true)))){
if ((((phoenixRespawning == false)) && ((((poseidonsSea == false)) || ((((poseidonsSea == true)) && ((hasPoseidonsBlessing == false)))))))){
selfPreservationCheck = false;
if (flockMates.length > 0){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
Avatar.x = flockMates[(flockMates.length - 1)].x;
Avatar.y = flockMates[(flockMates.length - 1)].y;
aliens[i].gotoAndStop((aliens[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[(flockMates.length - 1)]);
bonusMultiplier = (bonusMultiplier - flockMates[(flockMates.length - 1)].multiplierValue);
flockMates.splice((flockMates.length - 1), 1);
motherGooseEnabled = false;
} else {
if (sfxOn == true){
sc1 = gooseDieSnd.play();
sc1.soundTransform = sc1Transform;
};
if ((((hasPhoenixPendant == true)) && ((phoenixCount < 3)))){
phoenixCount++;
if (birds.length > 0){
Avatar.x = birds[0].x;
Avatar.y = birds[0].y;
phoenixRespawning = true;
phoenixRespawnTimer.start();
SkyLevel.removeChild(birds[i]);
birds.splice(i, 1);
};
} else {
Avatar.visible = false;
aliens[i].gotoAndStop((aliens[i].currentFrame + 1));
GameOverScreen.visible = true;
GameOver();
};
};
};
} else {
if ((((aliens[i].x > 900)) || ((aliens[i].x < -200)))){
SkyLevel.removeChild(aliens[i]);
aliens.splice(i, 1);
};
};
i--;
};
}
public function SndToggle(_arg1:MouseEvent){
if (sfxOn == true){
sfxOn = false;
SndTxt.text = String("Sound is currently off.");
} else {
sfxOn = true;
SndTxt.text = String("Sound is currently on.");
};
}
public function PurchaseUpgrades(_arg1:MouseEvent){
if (((((UpgradesMenu.HomingBeacon.hitTestPoint(mouseX, mouseY)) && ((hasHomingBeacon == false)))) && ((currentUpgradePoints >= 50)))){
currentUpgradePoints = (currentUpgradePoints - 50);
hasHomingBeacon = true;
purchasedUpgradeCount++;
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
SetCookies();
SendToKong();
} else {
if (((((UpgradesMenu.RuggedDown.hitTestPoint(mouseX, mouseY)) && ((hasRuggedDown == false)))) && ((currentUpgradePoints >= 20)))){
currentUpgradePoints = (currentUpgradePoints - 20);
hasRuggedDown = true;
purchasedUpgradeCount++;
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
SetCookies();
SendToKong();
} else {
if (((((UpgradesMenu.Aerodynamics.hitTestPoint(mouseX, mouseY)) && ((hasAerodynamics == false)))) && ((currentUpgradePoints >= 30)))){
currentUpgradePoints = (currentUpgradePoints - 30);
hasAerodynamics = true;
purchasedUpgradeCount++;
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
SetCookies();
SendToKong();
} else {
if (((((((UpgradesMenu.BigWingspan.hitTestPoint(mouseX, mouseY)) && ((hasBigWingspan == false)))) && ((hasAerodynamics == true)))) && ((currentUpgradePoints >= 70)))){
currentUpgradePoints = (currentUpgradePoints - 70);
hasBigWingspan = true;
purchasedUpgradeCount++;
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
SetCookies();
SendToKong();
} else {
if (((((((UpgradesMenu.DivineWings.hitTestPoint(mouseX, mouseY)) && ((hasDivineWings == false)))) && ((hasBigWingspan == true)))) && ((currentUpgradePoints >= 100)))){
currentUpgradePoints = (currentUpgradePoints - 100);
hasDivineWings = true;
purchasedUpgradeCount++;
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
SetCookies();
SendToKong();
} else {
if (((((UpgradesMenu.HiveMind.hitTestPoint(mouseX, mouseY)) && ((hasHiveMind == false)))) && ((currentUpgradePoints >= 50)))){
currentUpgradePoints = (currentUpgradePoints - 50);
hasHiveMind = true;
purchasedUpgradeCount++;
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
SetCookies();
SendToKong();
} else {
if (((((UpgradesMenu.RoyalLineage.hitTestPoint(mouseX, mouseY)) && ((hasRoyalLineage == false)))) && ((currentUpgradePoints >= 50)))){
currentUpgradePoints = (currentUpgradePoints - 50);
hasRoyalLineage = true;
purchasedUpgradeCount++;
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
SetCookies();
SendToKong();
} else {
if (((((UpgradesMenu.RabbitsFoot.hitTestPoint(mouseX, mouseY)) && ((hasRabbitsFoot == false)))) && ((currentUpgradePoints >= 50)))){
currentUpgradePoints = (currentUpgradePoints - 50);
hasRabbitsFoot = true;
purchasedUpgradeCount++;
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
SetCookies();
SendToKong();
} else {
if (((((UpgradesMenu.Nightvision.hitTestPoint(mouseX, mouseY)) && ((hasNightvision == false)))) && ((currentUpgradePoints >= 50)))){
currentUpgradePoints = (currentUpgradePoints - 50);
hasNightvision = true;
purchasedUpgradeCount++;
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
SetCookies();
SendToKong();
} else {
if (((((((UpgradesMenu.EagleEyes.hitTestPoint(mouseX, mouseY)) && ((hasEagleEyes == false)))) && ((hasNightvision == true)))) && ((currentUpgradePoints >= 80)))){
currentUpgradePoints = (currentUpgradePoints - 80);
hasEagleEyes = true;
purchasedUpgradeCount++;
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
SetCookies();
SendToKong();
} else {
if (((((UpgradesMenu.RainDance.hitTestPoint(mouseX, mouseY)) && ((hasRainDance == false)))) && ((currentUpgradePoints >= 40)))){
currentUpgradePoints = (currentUpgradePoints - 40);
hasRainDance = true;
purchasedUpgradeCount++;
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
SetCookies();
SendToKong();
} else {
if (((((UpgradesMenu.PoseidonsBlessing.hitTestPoint(mouseX, mouseY)) && ((hasPoseidonsBlessing == false)))) && ((currentUpgradePoints >= 400)))){
currentUpgradePoints = (currentUpgradePoints - 400);
hasPoseidonsBlessing = true;
purchasedUpgradeCount++;
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
SetCookies();
SendToKong();
} else {
if (((((UpgradesMenu.PhoenixPendant.hitTestPoint(mouseX, mouseY)) && ((hasPhoenixPendant == false)))) && ((currentUpgradePoints >= 400)))){
currentUpgradePoints = (currentUpgradePoints - 400);
hasPhoenixPendant = true;
purchasedUpgradeCount++;
if (sfxOn == true){
sc1 = chachingSnd.play();
sc1.soundTransform = sc1Transform;
};
SetCookies();
SendToKong();
};
};
};
};
};
};
};
};
};
};
};
};
};
TotalUpgradesTxt.text = String((("You have purchased " + purchasedUpgradeCount) + " of the 13 Upgrades."));
UpgradePointsTxt.text = String((("You have " + currentUpgradePoints) + " to spend on Upgrades."));
}
public function OverAchievements(_arg1:MouseEvent){
ButtonSet();
if (AchievementsMenu.SocialButterfly.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("SocialButterfly");
AchievementsMenu.SocialButterfly.gotoAndStop("Over");
if (hasSocialButterfly == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.MotherGoose.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("MotherGoose");
AchievementsMenu.MotherGoose.gotoAndStop("Over");
if (hasMotherGoose == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.Score1.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("Score1");
AchievementsMenu.Score1.gotoAndStop("Over");
if (hasScore1 == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.Score2.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("Score2");
AchievementsMenu.Score2.gotoAndStop("Over");
if (hasScore2 == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.Score3.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("Score3");
AchievementsMenu.Score3.gotoAndStop("Over");
if (hasScore3 == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.Score4.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("Score4");
AchievementsMenu.Score4.gotoAndStop("Over");
if (hasScore4 == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.Score5.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("Score5");
AchievementsMenu.Score5.gotoAndStop("Over");
if (hasScore5 == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.WellVersed.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("WellVersed");
AchievementsMenu.WellVersed.gotoAndStop("Over");
if (hasWellVersed == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.SoVeryCurious.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("SoVeryCurious");
AchievementsMenu.SoVeryCurious.gotoAndStop("Over");
if (hasSoVeryCurious == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.Bourgeoisie.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("Bourgeoisie");
AchievementsMenu.Bourgeoisie.gotoAndStop("Over");
if (hasBourgeoisie == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.FlockmasterFlash.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("FlockmasterFlash");
AchievementsMenu.FlockmasterFlash.gotoAndStop("Over");
if (hasFlockmasterFlash == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.ConsolationPrize.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("ConsolationPrize");
AchievementsMenu.ConsolationPrize.gotoAndStop("Over");
if (hasConsolationPrize == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.Gold1.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("Gold1");
AchievementsMenu.Gold1.gotoAndStop("Over");
if (hasGold1 == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.Gold2.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("Gold2");
AchievementsMenu.Gold2.gotoAndStop("Over");
if (hasGold2 == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.Gold3.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("Gold3");
AchievementsMenu.Gold3.gotoAndStop("Over");
if (hasGold3 == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.Aviator1.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("Aviator1");
AchievementsMenu.Aviator1.gotoAndStop("Over");
if (hasAviator1 == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.Aviator2.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("Aviator2");
AchievementsMenu.Aviator2.gotoAndStop("Over");
if (hasAviator2 == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.Aviator3.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("Aviator3");
AchievementsMenu.Aviator3.gotoAndStop("Over");
if (hasAviator3 == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.IntoTheStorm.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("IntoTheStorm");
AchievementsMenu.IntoTheStorm.gotoAndStop("Over");
if (hasIntoTheStorm == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.SelfPreservation.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("SelfPreservation");
AchievementsMenu.SelfPreservation.gotoAndStop("Over");
if (hasSelfPreservation == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.FrequentFlyer.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("FrequentFlyer");
AchievementsMenu.FrequentFlyer.gotoAndStop("Over");
if (hasFrequentFlyer == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.FlyingSolo.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("FlyingSolo");
AchievementsMenu.FlyingSolo.gotoAndStop("Over");
if (hasFlyingSolo == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.AirlineTickets.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("AirlineTickets");
AchievementsMenu.AirlineTickets.gotoAndStop("Over");
if (hasAirlineTickets == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.BabyHuey.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("BabyHuey");
AchievementsMenu.BabyHuey.gotoAndStop("Over");
if (hasBabyHuey == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.ShockAndAwe.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("ShockAndAwe");
AchievementsMenu.ShockAndAwe.gotoAndStop("Over");
if (hasShockAndAwe == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.FirstContact.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("FirstContact");
AchievementsMenu.FirstContact.gotoAndStop("Over");
if (hasFirstContact == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.OffTheRadar.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("OffTheRadar");
AchievementsMenu.OffTheRadar.gotoAndStop("Over");
if (hasOffTheRadar == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.ClearlyDevoted.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("ClearlyDevoted");
AchievementsMenu.ClearlyDevoted.gotoAndStop("Over");
if (hasClearlyDevoted == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
if (AchievementsMenu.AroundTheWorld.hitTestPoint(mouseX, mouseY, true)){
AchievementsMenu.AchievementDescriptions.gotoAndStop("AroundTheWorld");
AchievementsMenu.AroundTheWorld.gotoAndStop("Over");
if (hasAroundTheWorld == true){
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = true;
} else {
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
};
} else {
AchievementsMenu.AchievementDescriptions.gotoAndStop("Default");
AchievementsMenu.AchievementDescriptions.AlreadyEarnedText.visible = false;
ButtonSet();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
public function BackToMenu(_arg1:MouseEvent){
parent.removeEventListener(Event.ENTER_FRAME, GameLoop);
i = (buildings.length - 1);
while (i >= 0) {
GroundLevel.removeChild(buildings[i]);
buildings.splice(i, 1);
i--;
};
gotoAndStop("Menu");
}
public function ToMenu(_arg1:MouseEvent){
gotoAndStop("Menu");
}
public function RetryGame(_arg1:MouseEvent){
parent.removeEventListener(Event.ENTER_FRAME, GameLoop);
i = (buildings.length - 1);
while (i >= 0) {
GroundLevel.removeChild(buildings[i]);
buildings.splice(i, 1);
i--;
};
gotoAndStop("Retry");
}
public function LoadCookies(){
highScore = cookieCrunch.readCookieInt("highScore");
bestTime = cookieCrunch.readCookieInt("bestTime");
totalAchievements = cookieCrunch.readCookieInt("totalAchievements");
earnedAchievementPoints = cookieCrunch.readCookieInt("earnedAchievementPoints");
currentUpgradePoints = cookieCrunch.readCookieInt("currentUpgradePoints");
careerScore = cookieCrunch.readCookieInt("careerScore");
purchasedUpgradeCount = cookieCrunch.readCookieInt("purchasedUpgradeCount");
gamePlayCount = cookieCrunch.readCookieInt("gamePlayCount");
hasSocialButterfly = cookieCrunch.readCookie("hasSocialButterfly");
hasMotherGoose = cookieCrunch.readCookie("hasMotherGoose");
hasScore1 = cookieCrunch.readCookie("hasScore1");
hasScore2 = cookieCrunch.readCookie("hasScore2");
hasScore3 = cookieCrunch.readCookie("hasScore3");
hasScore4 = cookieCrunch.readCookie("hasScore4");
hasScore5 = cookieCrunch.readCookie("hasScore5");
hasWellVersed = cookieCrunch.readCookie("hasWellVersed");
hasSoVeryCurious = cookieCrunch.readCookie("hasSoVeryCurious");
hasBourgeoisie = cookieCrunch.readCookie("hasBourgeoisie");
hasFlockmasterFlash = cookieCrunch.readCookie("hasFlockmasterFlash");
hasConsolationPrize = cookieCrunch.readCookie("hasConsolationPrize");
hasGold1 = cookieCrunch.readCookie("hasGold1");
hasGold2 = cookieCrunch.readCookie("hasGold2");
hasGold3 = cookieCrunch.readCookie("hasGold3");
hasAviator1 = cookieCrunch.readCookie("hasAviator1");
hasAviator2 = cookieCrunch.readCookie("hasAviator2");
hasAviator3 = cookieCrunch.readCookie("hasAviator3");
hasIntoTheStorm = cookieCrunch.readCookie("hasIntoTheStorm");
hasSelfPreservation = cookieCrunch.readCookie("hasSelfPreservation");
hasFrequentFlyer = cookieCrunch.readCookie("hasFrequentFlyer");
hasFlyingSolo = cookieCrunch.readCookie("hasFlyingSolo");
hasAirlineTickets = cookieCrunch.readCookie("hasAirlineTickets");
hasBabyHuey = cookieCrunch.readCookie("hasBabyHuey");
hasShockAndAwe = cookieCrunch.readCookie("hasShockAndAwe");
hasFirstContact = cookieCrunch.readCookie("hasFirstContact");
hasOffTheRadar = cookieCrunch.readCookie("hasOffTheRadar");
hasClearlyDevoted = cookieCrunch.readCookie("hasClearlyDevoted");
hasAroundTheWorld = cookieCrunch.readCookie("hasAroundTheWorld");
hasAerodynamics = cookieCrunch.readCookie("hasAerodynamics");
hasBigWingspan = cookieCrunch.readCookie("hasBigWingspan");
hasDivineWings = cookieCrunch.readCookie("hasDivineWings");
hasHiveMind = cookieCrunch.readCookie("hasHiveMind");
hasNightvision = cookieCrunch.readCookie("hasNightvision");
hasEagleEyes = cookieCrunch.readCookie("hasEagleEyes");
hasHomingBeacon = cookieCrunch.readCookie("hasHomingBeacon");
hasRuggedDown = cookieCrunch.readCookie("hasRuggedDown");
hasRoyalLineage = cookieCrunch.readCookie("hasRoyalLineage");
hasRabbitsFoot = cookieCrunch.readCookie("hasRabbitsFoot");
hasRainDance = cookieCrunch.readCookie("hasRainDance");
hasPoseidonsBlessing = cookieCrunch.readCookie("hasPoseidonsBlessing");
hasPhoenixPendant = cookieCrunch.readCookie("hasPhoenixPendant");
}
public function TutPrev(_arg1:MouseEvent){
TutScreen.gotoAndStop((TutScreen.currentFrame - 1));
}
public function MoveHelicopters(){
i = (helicopters.length - 1);
while (i >= 0) {
if ((((((((helicopters[i].x > 100)) && ((helicopters[i].x < 600)))) && ((helicopters[i].y > 100)))) && ((helicopters[i].y < 400)))){
helicopters[i].rotation = (helicopters[i].rotation + helicopters[i].rot);
};
helicopters[i].x = (helicopters[i].x + (((elapsedMultiples / 2) + helicopters[i].flySpeed) * Math.cos((helicopters[i].rotation / (180 / Math.PI)))));
helicopters[i].y = (helicopters[i].y + (((elapsedMultiples / 2) + helicopters[i].flySpeed) * Math.sin((helicopters[i].rotation / (180 / Math.PI)))));
j = (flockMates.length - 1);
while (j >= 0) {
if (helicopters[i].hitTestPoint(flockMates[j].x, flockMates[j].y, true)){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
helicopters[i].gotoAndStop((helicopters[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[j]);
bonusMultiplier = (bonusMultiplier - flockMates[j].multiplierValue);
flockMates.splice(j, 1);
motherGooseEnabled = false;
};
j--;
};
if (helicopters[i].hitTestPoint(Avatar.x, Avatar.y, true)){
if ((((phoenixRespawning == false)) && ((((poseidonsSea == false)) || ((((poseidonsSea == true)) && ((hasPoseidonsBlessing == false)))))))){
selfPreservationCheck = false;
if (flockMates.length > 0){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
Avatar.x = flockMates[(flockMates.length - 1)].x;
Avatar.y = flockMates[(flockMates.length - 1)].y;
helicopters[i].gotoAndStop((helicopters[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[(flockMates.length - 1)]);
bonusMultiplier = (bonusMultiplier - flockMates[(flockMates.length - 1)].multiplierValue);
flockMates.splice((flockMates.length - 1), 1);
motherGooseEnabled = false;
} else {
if (sfxOn == true){
sc1 = gooseDieSnd.play();
sc1.soundTransform = sc1Transform;
};
if ((((hasPhoenixPendant == true)) && ((phoenixCount < 3)))){
phoenixCount++;
if (birds.length > 0){
Avatar.x = birds[0].x;
Avatar.y = birds[0].y;
phoenixRespawning = true;
phoenixRespawnTimer.start();
SkyLevel.removeChild(birds[i]);
birds.splice(i, 1);
};
} else {
Avatar.visible = false;
helicopters[i].gotoAndStop((helicopters[i].currentFrame + 1));
GameOverScreen.visible = true;
GameOver();
};
};
};
} else {
if ((((((((helicopters[i].x > 800)) || ((helicopters[i].x < -100)))) || ((helicopters[i].y > 700)))) || ((helicopters[i].y < -100)))){
SkyLevel.removeChild(helicopters[i]);
helicopters.splice(i, 1);
};
};
i--;
};
}
public function MoveObstacles(_arg1:TimerEvent){
if (buildings[(buildings.length - 1)].y >= 10){
bdg = new Building();
if (atSea == false){
citySizeCtr++;
if (citySizeCtr >= citySizeRand){
bdg.gotoAndStop("ShorelineIn");
atSea = true;
oceansPassedToggle = true;
citySizeCtr = 0;
citySizeRand = (12 + Math.ceil((Math.random() * 13)));
} else {
bdg.gotoAndStop(Math.ceil((Math.random() * 3)));
bdg.scaleY = Math.pow(-1, Math.ceil((Math.random() * 2)));
};
} else {
oceanSizeCtr++;
if (oceanSizeCtr >= oceanSizeRand){
bdg.gotoAndStop("ShorelineOut");
atSea = false;
oceanSizeCtr = 0;
oceanSizeRand = (8 + Math.ceil((Math.random() * 12)));
} else {
bdg.gotoAndStop((6 + Math.floor((Math.random() * 3))));
};
};
bdg.x = 0;
bdg.y = (-300 - (Math.random() * 20));
bdg.scaleX = Math.pow(-1, Math.ceil((Math.random() * 2)));
GroundLevel.addChild(bdg);
buildings.push(bdg);
};
i = (buildings.length - 1);
while (i >= 0) {
buildings[i].y = (buildings[i].y + 20);
if (((buildings[i].hitTestPoint(Avatar.x, Avatar.y)) && ((buildings[i].currentLabel == "ShorelineIn")))){
if (hasPoseidonsBlessing == true){
poseidonsSea = true;
if ((((oceansPassed >= 4)) && ((hasAroundTheWorld == false)))){
hasAroundTheWorld = true;
InGameAchievements.gotoAndStop("AroundTheWorld");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 150);
currentUpgradePoints = (currentUpgradePoints + 150);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
};
} else {
if (((buildings[i].hitTestPoint(Avatar.x, Avatar.y)) && ((buildings[i].currentLabel == "ShorelineOut")))){
if (oceansPassedToggle == true){
oceansPassed++;
oceansPassedToggle = false;
};
if (hasPoseidonsBlessing == true){
poseidonsSea = false;
};
};
};
if (buildings[i].y > 1500){
GroundLevel.removeChild(buildings[i]);
buildings.splice(i, 1);
};
i--;
};
}
public function MusToggle(_arg1:MouseEvent){
if (musicOn == true){
musicOn = false;
MusTxt.text = String("Music is currently off.");
scBg.stop();
bgMusicTimer.removeEventListener(TimerEvent.TIMER, BgmRestart);
bgMusicTimer.stop();
} else {
musicOn = true;
MusTxt.text = String("Music is currently on.");
scBgTransform.volume = 0.1;
scBg = BgSong.play();
scBg.soundTransform = scBgTransform;
bgMusicTimer.addEventListener(TimerEvent.TIMER, BgmRestart);
bgMusicTimer.start();
};
}
public function OverUpgrades(_arg1:MouseEvent){
if ((((purchasedUpgradeCount >= 6)) && ((hasFlockmasterFlash == false)))){
hasFlockmasterFlash = true;
InGameAchievements.gotoAndStop("FlockmasterFlash");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 80);
currentUpgradePoints = (currentUpgradePoints + 80);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
if (UpgradesMenu.HomingBeacon.hitTestPoint(mouseX, mouseY)){
UpgradesMenu.HomingBeacon.gotoAndStop("Over");
UpgradesMenu.UpgradeDescriptions.gotoAndStop("HomingBeacon");
if (hasHomingBeacon == true){
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = true;
} else {
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = false;
};
} else {
if (UpgradesMenu.RuggedDown.hitTestPoint(mouseX, mouseY)){
UpgradesMenu.RuggedDown.gotoAndStop("Over");
UpgradesMenu.UpgradeDescriptions.gotoAndStop("RuggedDown");
if (hasRuggedDown == true){
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = true;
} else {
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = false;
};
} else {
if (UpgradesMenu.Aerodynamics.hitTestPoint(mouseX, mouseY)){
UpgradesMenu.Aerodynamics.gotoAndStop("Over");
UpgradesMenu.UpgradeDescriptions.gotoAndStop("Aerodynamics");
if (hasAerodynamics == true){
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = true;
} else {
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = false;
};
} else {
if (UpgradesMenu.BigWingspan.hitTestPoint(mouseX, mouseY)){
UpgradesMenu.BigWingspan.gotoAndStop("Over");
UpgradesMenu.UpgradeDescriptions.gotoAndStop("BigWingspan");
if (hasBigWingspan == true){
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = true;
} else {
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = false;
};
} else {
if (UpgradesMenu.DivineWings.hitTestPoint(mouseX, mouseY)){
UpgradesMenu.DivineWings.gotoAndStop("Over");
UpgradesMenu.UpgradeDescriptions.gotoAndStop("DivineWings");
if (hasDivineWings == true){
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = true;
} else {
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = false;
};
} else {
if (UpgradesMenu.HiveMind.hitTestPoint(mouseX, mouseY)){
UpgradesMenu.HiveMind.gotoAndStop("Over");
UpgradesMenu.UpgradeDescriptions.gotoAndStop("HiveMind");
if (hasHiveMind == true){
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = true;
} else {
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = false;
};
} else {
if (UpgradesMenu.RoyalLineage.hitTestPoint(mouseX, mouseY)){
UpgradesMenu.RoyalLineage.gotoAndStop("Over");
UpgradesMenu.UpgradeDescriptions.gotoAndStop("RoyalLineage");
if (hasRoyalLineage == true){
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = true;
} else {
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = false;
};
} else {
if (UpgradesMenu.Nightvision.hitTestPoint(mouseX, mouseY)){
UpgradesMenu.Nightvision.gotoAndStop("Over");
UpgradesMenu.UpgradeDescriptions.gotoAndStop("Nightvision");
if (hasNightvision == true){
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = true;
} else {
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = false;
};
} else {
if (UpgradesMenu.EagleEyes.hitTestPoint(mouseX, mouseY)){
UpgradesMenu.EagleEyes.gotoAndStop("Over");
UpgradesMenu.UpgradeDescriptions.gotoAndStop("EagleEyes");
if (hasEagleEyes == true){
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = true;
} else {
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = false;
};
} else {
if (UpgradesMenu.RabbitsFoot.hitTestPoint(mouseX, mouseY)){
UpgradesMenu.RabbitsFoot.gotoAndStop("Over");
UpgradesMenu.UpgradeDescriptions.gotoAndStop("RabbitsFoot");
if (hasRabbitsFoot == true){
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = true;
} else {
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = false;
};
} else {
if (UpgradesMenu.RainDance.hitTestPoint(mouseX, mouseY)){
UpgradesMenu.RainDance.gotoAndStop("Over");
UpgradesMenu.UpgradeDescriptions.gotoAndStop("RainDance");
if (hasRainDance == true){
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = true;
} else {
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = false;
};
} else {
if (UpgradesMenu.PoseidonsBlessing.hitTestPoint(mouseX, mouseY)){
UpgradesMenu.PoseidonsBlessing.gotoAndStop("Over");
UpgradesMenu.UpgradeDescriptions.gotoAndStop("PoseidonsBlessing");
if (hasPoseidonsBlessing == true){
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = true;
} else {
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = false;
};
} else {
if (UpgradesMenu.PhoenixPendant.hitTestPoint(mouseX, mouseY)){
UpgradesMenu.PhoenixPendant.gotoAndStop("Over");
UpgradesMenu.UpgradeDescriptions.gotoAndStop("PhoenixPendant");
if (hasPhoenixPendant == true){
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = true;
} else {
UpgradesMenu.UpgradeDescriptions.AlreadyPurchasedText.visible = false;
};
} else {
if (hasHomingBeacon == true){
UpgradesMenu.HomingBeacon.gotoAndStop("Over");
} else {
UpgradesMenu.HomingBeacon.gotoAndStop("Normal");
};
if (hasRuggedDown == true){
UpgradesMenu.RuggedDown.gotoAndStop("Over");
} else {
UpgradesMenu.RuggedDown.gotoAndStop("Normal");
};
if (hasAerodynamics == true){
UpgradesMenu.Aerodynamics.gotoAndStop("Over");
} else {
UpgradesMenu.Aerodynamics.gotoAndStop("Normal");
};
if (hasBigWingspan == true){
UpgradesMenu.BigWingspan.gotoAndStop("Over");
} else {
UpgradesMenu.BigWingspan.gotoAndStop("Normal");
};
if (hasDivineWings == true){
UpgradesMenu.DivineWings.gotoAndStop("Over");
} else {
UpgradesMenu.DivineWings.gotoAndStop("Normal");
};
if (hasHiveMind == true){
UpgradesMenu.HiveMind.gotoAndStop("Over");
} else {
UpgradesMenu.HiveMind.gotoAndStop("Normal");
};
if (hasRoyalLineage == true){
UpgradesMenu.RoyalLineage.gotoAndStop("Over");
} else {
UpgradesMenu.RoyalLineage.gotoAndStop("Normal");
};
if (hasNightvision == true){
UpgradesMenu.Nightvision.gotoAndStop("Over");
} else {
UpgradesMenu.Nightvision.gotoAndStop("Normal");
};
if (hasEagleEyes == true){
UpgradesMenu.EagleEyes.gotoAndStop("Over");
} else {
UpgradesMenu.EagleEyes.gotoAndStop("Normal");
};
if (hasRabbitsFoot == true){
UpgradesMenu.RabbitsFoot.gotoAndStop("Over");
} else {
UpgradesMenu.RabbitsFoot.gotoAndStop("Normal");
};
if (hasRainDance == true){
UpgradesMenu.RainDance.gotoAndStop("Over");
} else {
UpgradesMenu.RainDance.gotoAndStop("Normal");
};
if (hasPoseidonsBlessing == true){
UpgradesMenu.PoseidonsBlessing.gotoAndStop("Over");
} else {
UpgradesMenu.PoseidonsBlessing.gotoAndStop("Normal");
};
if (hasPhoenixPendant == true){
UpgradesMenu.PhoenixPendant.gotoAndStop("Over");
} else {
UpgradesMenu.PhoenixPendant.gotoAndStop("Normal");
};
};
};
};
};
};
};
};
};
};
};
};
};
};
if ((((purchasedUpgradeCount >= 6)) && ((hasFlockmasterFlash == false)))){
hasFlockmasterFlash = true;
InGameAchievements.gotoAndStop("FlockmasterFlash");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 80);
currentUpgradePoints = (currentUpgradePoints + 80);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
TotalUpgradesTxt.text = String((("You have purchased " + purchasedUpgradeCount) + " of the 13 Upgrades."));
UpgradePointsTxt.text = String((("You have " + currentUpgradePoints) + " to spend on Upgrades."));
}
public function AchievementPopUp(_arg1:TimerEvent){
achievementPopUpCtr++;
InGameAchievements.visible = true;
if (achievementPopUpCtr >= 40){
InGameAchievements.alpha = 1;
InGameAchievements.visible = false;
inGameAchievementTimer.stop();
achievementPopUpCtr = 0;
} else {
if (achievementPopUpCtr >= 30){
InGameAchievements.alpha = (InGameAchievements.alpha - 0.1);
};
};
}
public function MoveAirbuses(){
i = (airbuses.length - 1);
while (i >= 0) {
airbuses[i].x = (airbuses[i].x + (((elapsedMultiples / 2) + airbuses[i].flySpeed) * Math.cos((airbuses[i].rotation / (180 / Math.PI)))));
airbuses[i].y = (airbuses[i].y + (((elapsedMultiples / 2) + airbuses[i].flySpeed) * Math.sin((airbuses[i].rotation / (180 / Math.PI)))));
j = (flockMates.length - 1);
while (j >= 0) {
if (airbuses[i].hitTestPoint(flockMates[j].x, flockMates[j].y, true)){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
airbuses[i].gotoAndStop((airbuses[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[j]);
bonusMultiplier = (bonusMultiplier - flockMates[j].multiplierValue);
flockMates.splice(j, 1);
motherGooseEnabled = false;
};
j--;
};
if (airbuses[i].hitTestPoint(Avatar.x, Avatar.y, true)){
if ((((phoenixRespawning == false)) && ((((poseidonsSea == false)) || ((((poseidonsSea == true)) && ((hasPoseidonsBlessing == false)))))))){
selfPreservationCheck = false;
if (flockMates.length > 0){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
Avatar.x = flockMates[(flockMates.length - 1)].x;
Avatar.y = flockMates[(flockMates.length - 1)].y;
airbuses[i].gotoAndStop((airbuses[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[(flockMates.length - 1)]);
bonusMultiplier = (bonusMultiplier - flockMates[(flockMates.length - 1)].multiplierValue);
flockMates.splice((flockMates.length - 1), 1);
motherGooseEnabled = false;
} else {
if (sfxOn == true){
sc1 = gooseDieSnd.play();
sc1.soundTransform = sc1Transform;
};
if ((((hasPhoenixPendant == true)) && ((phoenixCount < 3)))){
phoenixCount++;
if (birds.length > 0){
Avatar.x = birds[0].x;
Avatar.y = birds[0].y;
phoenixRespawning = true;
phoenixRespawnTimer.start();
SkyLevel.removeChild(birds[i]);
birds.splice(i, 1);
};
} else {
Avatar.visible = false;
airbuses[i].gotoAndStop((airbuses[i].currentFrame + 1));
GameOverScreen.visible = true;
GameOver();
};
};
};
} else {
if ((((((((airbuses[i].x > 1000)) || ((airbuses[i].x < -300)))) || ((airbuses[i].y > 900)))) || ((airbuses[i].y < -300)))){
SkyLevel.removeChild(airbuses[i]);
airbuses.splice(i, 1);
};
};
i--;
};
}
public function ToOptions(_arg1:MouseEvent){
ConfirmClearBox.visible = false;
gotoAndStop("Options");
}
public function SetEnemies(_arg1:TimerEvent){
if (((((((airplanes.length + blimps.length) + airbuses.length) + helicopters.length) + jets.length) + aliens.length) + stealths.length) < 10){
setPlaneCtr++;
if (setPlaneCtr >= setPlaneRand){
planeDropShadow = new DropShadowFilter((20 + (Math.random() * 20)), (30 + (Math.random() * 30)), 0, 0.2, 5, 5, 1, 1);
setPlaneCtr = 0;
setPlaneRand = Math.floor(((9 + spawnBase) + Math.ceil((Math.random() * (4 + spawnBase)))));
newPlane = new Airplane();
newPlane.scaleX = (1.2 + (Math.random() * 0.2));
newPlane.scaleY = newPlane.scaleX;
newPlane.x = newPlane.spawnX;
newPlane.y = newPlane.spawnY;
newPlane.filters = new Array(planeDropShadow);
SkyLevel.addChild(newPlane);
airplanes.push(newPlane);
if (elapsedMultiples >= 3){
if (Math.random() > 0.75){
newPlane = new Airplane();
newPlane.scaleX = (1.2 + (Math.random() * 0.2));
newPlane.scaleY = newPlane.scaleX;
newPlane.x = newPlane.spawnX;
newPlane.y = newPlane.spawnY;
newPlane.filters = new Array(planeDropShadow);
SkyLevel.addChild(newPlane);
airplanes.push(newPlane);
};
};
if (elapsedMultiples >= 6){
if (Math.random() > 0.75){
newPlane = new Airplane();
newPlane.scaleX = (1.2 + (Math.random() * 0.2));
newPlane.scaleY = newPlane.scaleX;
newPlane.x = newPlane.spawnX;
newPlane.y = newPlane.spawnY;
newPlane.filters = new Array(planeDropShadow);
SkyLevel.addChild(newPlane);
airplanes.push(newPlane);
};
};
if (elapsedMultiples >= 20){
if (Math.random() > 0.75){
newPlane = new Airplane();
newPlane.scaleX = (1.2 + (Math.random() * 0.2));
newPlane.scaleY = newPlane.scaleX;
newPlane.x = newPlane.spawnX;
newPlane.y = newPlane.spawnY;
newPlane.filters = new Array(planeDropShadow);
SkyLevel.addChild(newPlane);
airplanes.push(newPlane);
};
};
};
setBlimpCtr++;
if (setBlimpCtr >= setBlimpRand){
planeDropShadow = new DropShadowFilter((20 + (Math.random() * 20)), (30 + (Math.random() * 30)), 0, 0.2, 5, 5, 1, 1);
setBlimpCtr = 0;
setBlimpRand = Math.floor(((15 + spawnBase) + Math.ceil((Math.random() * (10 + spawnBase)))));
newBlimp = new Blimp();
newBlimp.scaleX = newBlimp.randScale;
newBlimp.scaleY = newBlimp.randScale;
newBlimp.x = (Math.random() * 700);
newBlimp.y = -150;
newBlimp.filters = new Array(planeDropShadow);
SkyLevel.addChild(newBlimp);
blimps.push(newBlimp);
};
if (elapsedMultiples >= 1){
setAirbusCtr++;
if (setAirbusCtr >= setAirbusRand){
planeDropShadow = new DropShadowFilter((20 + (Math.random() * 20)), (30 + (Math.random() * 30)), 0, 0.2, 5, 5, 1, 1);
setAirbusCtr = 0;
setAirbusRand = Math.floor(((9 + spawnBase) + Math.ceil((Math.random() * (12 + spawnBase)))));
newAirbus = new Airbus();
newAirbus.scaleX = 1.5;
newAirbus.scaleY = 1.5;
newAirbus.x = newAirbus.spawnX;
newAirbus.y = newAirbus.spawnY;
newAirbus.filters = new Array(planeDropShadow);
SkyLevel.addChild(newAirbus);
airbuses.push(newAirbus);
if (hasAirlineTickets == false){
hasAirlineTickets = true;
InGameAchievements.gotoAndStop("AirlineTickets");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 15);
currentUpgradePoints = (currentUpgradePoints + 15);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
if (elapsedMultiples >= 5){
if (Math.random() > 0.75){
newAirbus = new Airbus();
newAirbus.scaleX = 1.5;
newAirbus.scaleY = 1.5;
newAirbus.x = newAirbus.spawnX;
newAirbus.y = newAirbus.spawnY;
newAirbus.filters = new Array(planeDropShadow);
SkyLevel.addChild(newAirbus);
airbuses.push(newAirbus);
};
};
if (elapsedMultiples >= 12){
if (Math.random() > 0.75){
newAirbus = new Airbus();
newAirbus.scaleX = 1.5;
newAirbus.scaleY = 1.5;
newAirbus.x = newAirbus.spawnX;
newAirbus.y = newAirbus.spawnY;
newAirbus.filters = new Array(planeDropShadow);
SkyLevel.addChild(newAirbus);
airbuses.push(newAirbus);
};
};
};
};
if (elapsedMultiples >= 2){
setHelicopterCtr++;
if (setHelicopterCtr >= setHelicopterRand){
planeDropShadow = new DropShadowFilter((20 + (Math.random() * 20)), (30 + (Math.random() * 30)), 0, 0.2, 5, 5, 1, 1);
setHelicopterCtr = 0;
setHelicopterRand = Math.floor(((9 + spawnBase) + Math.ceil((Math.random() * (14 + spawnBase)))));
newHelicopter = new Helicopter();
newHelicopter.scaleX = 1.3;
newHelicopter.scaleY = 1.3;
newHelicopter.x = newHelicopter.spawnX;
newHelicopter.y = newHelicopter.spawnY;
newHelicopter.filters = new Array(planeDropShadow);
SkyLevel.addChild(newHelicopter);
helicopters.push(newHelicopter);
if (hasBabyHuey == false){
hasBabyHuey = true;
InGameAchievements.gotoAndStop("BabyHuey");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 15);
currentUpgradePoints = (currentUpgradePoints + 15);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
if (elapsedMultiples >= 7){
if (Math.random() > 0.75){
newHelicopter = new Helicopter();
newHelicopter.scaleX = 1.3;
newHelicopter.scaleY = 1.3;
newHelicopter.x = newHelicopter.spawnX;
newHelicopter.y = newHelicopter.spawnY;
newHelicopter.filters = new Array(planeDropShadow);
SkyLevel.addChild(newHelicopter);
helicopters.push(newHelicopter);
};
};
if (elapsedMultiples >= 13){
if (Math.random() > 0.75){
newHelicopter = new Helicopter();
newHelicopter.scaleX = 1.3;
newHelicopter.scaleY = 1.3;
newHelicopter.x = newHelicopter.spawnX;
newHelicopter.y = newHelicopter.spawnY;
newHelicopter.filters = new Array(planeDropShadow);
SkyLevel.addChild(newHelicopter);
helicopters.push(newHelicopter);
};
};
};
};
if (elapsedMultiples >= 3){
setJetCtr++;
if (setJetCtr >= setJetRand){
planeDropShadow = new DropShadowFilter((20 + (Math.random() * 20)), (30 + (Math.random() * 30)), 0, 0.2, 5, 5, 1, 1);
setJetCtr = 0;
setJetRand = Math.floor(((9 + spawnBase) + Math.ceil((Math.random() * (9 + spawnBase)))));
newJet = new Jet();
newJet.scaleX = 1.3;
newJet.scaleY = 1.3;
newJet.x = newJet.spawnX;
newJet.y = newJet.spawnY;
newJet.filters = new Array(planeDropShadow);
SkyLevel.addChild(newJet);
jets.push(newJet);
if (hasShockAndAwe == false){
hasShockAndAwe = true;
InGameAchievements.gotoAndStop("ShockAndAwe");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 25);
currentUpgradePoints = (currentUpgradePoints + 25);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
if (elapsedMultiples >= 9){
if (Math.random() > 0.75){
newJet = new Jet();
newJet.scaleX = 1.3;
newJet.scaleY = 1.3;
newJet.x = newJet.spawnX;
newJet.y = newJet.spawnY;
newJet.filters = new Array(planeDropShadow);
SkyLevel.addChild(newJet);
jets.push(newJet);
};
};
if (elapsedMultiples >= 14){
if (Math.random() > 0.75){
newJet = new Jet();
newJet.scaleX = 1.3;
newJet.scaleY = 1.3;
newJet.x = newJet.spawnX;
newJet.y = newJet.spawnY;
newJet.filters = new Array(planeDropShadow);
SkyLevel.addChild(newJet);
jets.push(newJet);
};
};
};
};
if (elapsedMultiples >= 4){
setAlienCtr++;
if (setAlienCtr >= setAlienRand){
planeDropShadow = new DropShadowFilter((20 + (Math.random() * 20)), (30 + (Math.random() * 30)), 0, 0.2, 5, 5, 1, 1);
setAlienCtr = 0;
setAlienRand = Math.floor(((9 + spawnBase) + Math.ceil((Math.random() * (14 + spawnBase)))));
newAlien = new Alien();
newAlien.scaleX = newAlien.randScale;
newAlien.scaleY = newAlien.scaleX;
newAlien.x = newAlien.spawnX;
newAlien.y = newAlien.spawnY;
newAlien.filters = new Array(planeDropShadow);
SkyLevel.addChild(newAlien);
aliens.push(newAlien);
if (elapsedMultiples >= 11){
if (Math.random() > 0.75){
newAlien = new Alien();
newAlien.scaleX = 1.3;
newAlien.scaleY = 1.3;
newAlien.x = newAlien.spawnX;
newAlien.y = newAlien.spawnY;
newAlien.filters = new Array(planeDropShadow);
SkyLevel.addChild(newAlien);
aliens.push(newAlien);
};
};
if (hasFirstContact == false){
hasFirstContact = true;
InGameAchievements.gotoAndStop("FirstContact");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 35);
currentUpgradePoints = (currentUpgradePoints + 35);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
if (elapsedMultiples >= 17){
if (Math.random() > 0.75){
newAlien = new Alien();
newAlien.scaleX = 1.3;
newAlien.scaleY = 1.3;
newAlien.x = newAlien.spawnX;
newAlien.y = newAlien.spawnY;
newAlien.filters = new Array(planeDropShadow);
SkyLevel.addChild(newAlien);
aliens.push(newAlien);
};
};
};
};
if (elapsedMultiples >= 5){
setStealthCtr++;
if (setStealthCtr >= setStealthRand){
planeDropShadow = new DropShadowFilter((20 + (Math.random() * 20)), (30 + (Math.random() * 30)), 0, 0.2, 5, 5, 1, 1);
setStealthCtr = 0;
setStealthRand = Math.floor(((9 + spawnBase) + Math.ceil((Math.random() * (9 + spawnBase)))));
newStealth = new Stealth();
newStealth.scaleX = 1.3;
newStealth.scaleY = 1.3;
newStealth.x = newStealth.spawnX;
newStealth.y = newStealth.spawnY;
newStealth.filters = new Array(planeDropShadow);
SkyLevel.addChild(newStealth);
stealths.push(newStealth);
if (hasOffTheRadar == false){
hasOffTheRadar = true;
InGameAchievements.gotoAndStop("OffTheRadar");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 50);
currentUpgradePoints = (currentUpgradePoints + 50);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
if (elapsedMultiples >= 10){
if (Math.random() > 0.75){
newStealth = new Stealth();
newStealth.scaleX = 1.3;
newStealth.scaleY = 1.3;
newStealth.x = newStealth.spawnX;
newStealth.y = newStealth.spawnY;
newStealth.filters = new Array(planeDropShadow);
SkyLevel.addChild(newStealth);
stealths.push(newStealth);
};
};
if (elapsedMultiples >= 18){
if (Math.random() > 0.75){
newStealth = new Stealth();
newStealth.scaleX = 1.3;
newStealth.scaleY = 1.3;
newStealth.x = newStealth.spawnX;
newStealth.y = newStealth.spawnY;
newStealth.filters = new Array(planeDropShadow);
SkyLevel.addChild(newStealth);
stealths.push(newStealth);
};
};
};
};
};
}
public function TutNext(_arg1:MouseEvent){
TutScreen.gotoAndStop((TutScreen.currentFrame + 1));
}
public function ConfirmClear(_arg1:MouseEvent){
ClearCookies();
ConfirmClearBox.visible = false;
CareerPlaysBox.text = String(("Career Plays: " + gamePlayCount));
CareerHighBox.text = String(("High Score: " + highScore));
CareerBestTimeBox.text = String((("Best Time: " + (bestTime / 10)) + " sec."));
CareerPointsBox.text = String(("Career Points: " + careerScore));
CareerAchievementsBox.text = String((("Achievements Earned: " + totalAchievements) + "/29"));
}
public function ClearCookies(){
cookieCrunch.deleteCookie();
highScore = 0;
bestTime = 0;
totalAchievements = 0;
earnedAchievementPoints = 0;
careerScore = 0;
purchasedUpgradeCount = 0;
currentUpgradePoints = 0;
gamePlayCount = 0;
hasSocialButterfly = false;
hasMotherGoose = false;
hasScore1 = false;
hasScore2 = false;
hasScore3 = false;
hasScore4 = false;
hasScore5 = false;
hasWellVersed = false;
hasSoVeryCurious = false;
hasBourgeoisie = false;
hasFlockmasterFlash = false;
hasConsolationPrize = false;
hasGold1 = false;
hasGold2 = false;
hasGold3 = false;
hasAviator1 = false;
hasAviator2 = false;
hasAviator3 = false;
hasIntoTheStorm = false;
hasSelfPreservation = false;
hasFrequentFlyer = false;
hasFlyingSolo = false;
hasAirlineTickets = false;
hasBabyHuey = false;
hasShockAndAwe = false;
hasFirstContact = false;
hasOffTheRadar = false;
hasClearlyDevoted = false;
hasAroundTheWorld = false;
hasAerodynamics = false;
hasBigWingspan = false;
hasDivineWings = false;
hasHiveMind = false;
hasNightvision = false;
hasEagleEyes = false;
hasHomingBeacon = false;
hasRuggedDown = false;
hasRoyalLineage = false;
hasRabbitsFoot = false;
hasRainDance = false;
hasPoseidonsBlessing = false;
hasPhoenixPendant = false;
}
public function ButtonSet(){
if (hasSocialButterfly == true){
AchievementsMenu.SocialButterfly.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.SocialButterfly.gotoAndStop("Earned");
} else {
AchievementsMenu.SocialButterfly.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.SocialButterfly.gotoAndStop("Normal");
};
if (hasMotherGoose == true){
AchievementsMenu.MotherGoose.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.MotherGoose.gotoAndStop("Earned");
} else {
AchievementsMenu.MotherGoose.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.MotherGoose.gotoAndStop("Normal");
};
if (hasScore1 == true){
AchievementsMenu.Score1.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.Score1.gotoAndStop("Earned");
} else {
AchievementsMenu.Score1.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.Score1.gotoAndStop("Normal");
};
if (hasScore2 == true){
AchievementsMenu.Score2.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.Score2.gotoAndStop("Earned");
} else {
AchievementsMenu.Score2.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.Score2.gotoAndStop("Normal");
};
if (hasScore3 == true){
AchievementsMenu.Score3.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.Score3.gotoAndStop("Earned");
} else {
AchievementsMenu.Score3.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.Score3.gotoAndStop("Normal");
};
if (hasScore4 == true){
AchievementsMenu.Score4.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.Score4.gotoAndStop("Earned");
} else {
AchievementsMenu.Score4.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.Score4.gotoAndStop("Normal");
};
if (hasScore5 == true){
AchievementsMenu.Score5.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.Score5.gotoAndStop("Earned");
} else {
AchievementsMenu.Score5.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.Score5.gotoAndStop("Normal");
};
if (hasWellVersed == true){
AchievementsMenu.WellVersed.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.WellVersed.gotoAndStop("Earned");
} else {
AchievementsMenu.WellVersed.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.WellVersed.gotoAndStop("Normal");
};
if (hasSoVeryCurious == true){
AchievementsMenu.SoVeryCurious.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.SoVeryCurious.gotoAndStop("Earned");
} else {
AchievementsMenu.SoVeryCurious.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.SoVeryCurious.gotoAndStop("Normal");
};
if (hasBourgeoisie == true){
AchievementsMenu.Bourgeoisie.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.Bourgeoisie.gotoAndStop("Earned");
} else {
AchievementsMenu.Bourgeoisie.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.Bourgeoisie.gotoAndStop("Normal");
};
if (hasFlockmasterFlash == true){
AchievementsMenu.FlockmasterFlash.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.FlockmasterFlash.gotoAndStop("Earned");
} else {
AchievementsMenu.FlockmasterFlash.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.FlockmasterFlash.gotoAndStop("Normal");
};
if (hasConsolationPrize == true){
AchievementsMenu.ConsolationPrize.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.ConsolationPrize.gotoAndStop("Earned");
} else {
AchievementsMenu.ConsolationPrize.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.ConsolationPrize.gotoAndStop("Normal");
};
if (hasGold1 == true){
AchievementsMenu.Gold1.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.Gold1.gotoAndStop("Earned");
} else {
AchievementsMenu.Gold1.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.Gold1.gotoAndStop("Normal");
};
if (hasGold2 == true){
AchievementsMenu.Gold2.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.Gold2.gotoAndStop("Earned");
} else {
AchievementsMenu.Gold2.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.Gold2.gotoAndStop("Normal");
};
if (hasGold3 == true){
AchievementsMenu.Gold3.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.Gold3.gotoAndStop("Earned");
} else {
AchievementsMenu.Gold3.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.Gold3.gotoAndStop("Normal");
};
if (hasAviator1 == true){
AchievementsMenu.Aviator1.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.Aviator1.gotoAndStop("Earned");
} else {
AchievementsMenu.Aviator1.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.Aviator1.gotoAndStop("Normal");
};
if (hasAviator2 == true){
AchievementsMenu.Aviator2.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.Aviator2.gotoAndStop("Earned");
} else {
AchievementsMenu.Aviator2.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.Aviator2.gotoAndStop("Normal");
};
if (hasAviator3 == true){
AchievementsMenu.Aviator3.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.Aviator3.gotoAndStop("Earned");
} else {
AchievementsMenu.Aviator3.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.Aviator3.gotoAndStop("Normal");
};
if (hasIntoTheStorm == true){
AchievementsMenu.IntoTheStorm.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.IntoTheStorm.gotoAndStop("Earned");
} else {
AchievementsMenu.IntoTheStorm.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.IntoTheStorm.gotoAndStop("Normal");
};
if (hasSelfPreservation == true){
AchievementsMenu.SelfPreservation.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.SelfPreservation.gotoAndStop("Earned");
} else {
AchievementsMenu.SelfPreservation.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.SelfPreservation.gotoAndStop("Normal");
};
if (hasFrequentFlyer == true){
AchievementsMenu.FrequentFlyer.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.FrequentFlyer.gotoAndStop("Earned");
} else {
AchievementsMenu.FrequentFlyer.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.FrequentFlyer.gotoAndStop("Normal");
};
if (hasFlyingSolo == true){
AchievementsMenu.FlyingSolo.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.FlyingSolo.gotoAndStop("Earned");
} else {
AchievementsMenu.FlyingSolo.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.FlyingSolo.gotoAndStop("Normal");
};
if (hasAirlineTickets == true){
AchievementsMenu.AirlineTickets.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.AirlineTickets.gotoAndStop("Earned");
} else {
AchievementsMenu.AirlineTickets.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.AirlineTickets.gotoAndStop("Normal");
};
if (hasBabyHuey == true){
AchievementsMenu.BabyHuey.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.BabyHuey.gotoAndStop("Earned");
} else {
AchievementsMenu.BabyHuey.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.BabyHuey.gotoAndStop("Normal");
};
if (hasShockAndAwe == true){
AchievementsMenu.ShockAndAwe.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.ShockAndAwe.gotoAndStop("Earned");
} else {
AchievementsMenu.ShockAndAwe.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.ShockAndAwe.gotoAndStop("Normal");
};
if (hasFirstContact == true){
AchievementsMenu.FirstContact.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.FirstContact.gotoAndStop("Earned");
} else {
AchievementsMenu.FirstContact.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.FirstContact.gotoAndStop("Normal");
};
if (hasOffTheRadar == true){
AchievementsMenu.OffTheRadar.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.OffTheRadar.gotoAndStop("Earned");
} else {
AchievementsMenu.OffTheRadar.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.OffTheRadar.gotoAndStop("Normal");
};
if (hasClearlyDevoted == true){
AchievementsMenu.ClearlyDevoted.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.ClearlyDevoted.gotoAndStop("Earned");
} else {
AchievementsMenu.ClearlyDevoted.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.ClearlyDevoted.gotoAndStop("Normal");
};
if (hasAroundTheWorld == true){
AchievementsMenu.AroundTheWorld.CheckedBox.gotoAndStop("Earned");
AchievementsMenu.AroundTheWorld.gotoAndStop("Earned");
} else {
AchievementsMenu.AroundTheWorld.CheckedBox.gotoAndStop("Normal");
AchievementsMenu.AroundTheWorld.gotoAndStop("Normal");
};
}
public function UpdateTextBoxes(){
FlockSizeTxt.text = String(("Flock Size: " + flockMates.length));
HighScoreTxt.text = String(("Previous High Score: " + highScore));
BestTimeTxt.text = String((("Previous Best Time: " + (bestTime / 10)) + " sec."));
ElapsedTimeTxt.text = String(((("Elapsed Time: " + (elapsedTime / 10)) + " sec") + elapsedMultiples));
CurrentScoreTxt.text = String(("Score: " + currentScore));
CurrentMultiplierTxt.text = String(("Current Score Multiplier: " + (Math.round((bonusMultiplier * 10)) / 10)));
if ((((((selfPreservationCheck == true)) && ((elapsedTime >= 600)))) && ((hasSelfPreservation == false)))){
hasSelfPreservation = true;
InGameAchievements.gotoAndStop("SelfPreservation");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 20);
currentUpgradePoints = (currentUpgradePoints + 20);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
if ((((currentScore >= 1000000)) && ((hasScore5 == false)))){
hasScore5 = true;
InGameAchievements.gotoAndStop("Score5");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 150);
currentUpgradePoints = (currentUpgradePoints + 150);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
} else {
if ((((currentScore >= 500000)) && ((hasScore4 == false)))){
hasScore4 = true;
InGameAchievements.gotoAndStop("Score4");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 100);
currentUpgradePoints = (currentUpgradePoints + 100);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
} else {
if ((((currentScore >= 250000)) && ((hasScore3 == false)))){
hasScore3 = true;
InGameAchievements.gotoAndStop("Score3");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 50);
currentUpgradePoints = (currentUpgradePoints + 50);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
} else {
if ((((currentScore >= 100000)) && ((hasScore2 == false)))){
hasScore2 = true;
InGameAchievements.gotoAndStop("Score2");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 30);
currentUpgradePoints = (currentUpgradePoints + 30);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
} else {
if ((((currentScore >= 30000)) && ((hasScore1 == false)))){
hasScore1 = true;
InGameAchievements.gotoAndStop("Score1");
inGameAchievementTimer.start();
achievementPopUpCtr = 0;
totalAchievements++;
earnedAchievementPoints = (earnedAchievementPoints + 10);
currentUpgradePoints = (currentUpgradePoints + 10);
if (sfxOn == true){
sc1 = achievementUnlockedSnd.play();
sc1.soundTransform = sc1Transform;
};
};
};
};
};
};
}
public function SetBirds(_arg1:TimerEvent){
setBirdCtr++;
if (setBirdCtr >= setBirdRand){
setBirdCtr = 0;
setBirdRand = (3 + Math.ceil((Math.random() * 17)));
if (Math.random() < 0.1){
newSwan = new Swan();
newSwan.scaleX = 0.095;
newSwan.scaleY = 0.095;
if (hasHiveMind == true){
newSwan.flockSpeed = (12 + (Math.random() * 4));
};
SkyLevel.addChild(newSwan);
birds.push(newSwan);
} else {
newBird = new Bird();
newBird.scaleX = 0.075;
newBird.scaleY = 0.075;
if (hasHiveMind == true){
newBird.flockSpeed = (14 + (Math.random() * 4));
};
SkyLevel.addChild(newBird);
birds.push(newBird);
};
if ((((hasHomingBeacon == true)) && ((Math.random() <= 0.1)))){
newBird = new Bird();
newBird.scaleX = 0.075;
newBird.scaleY = 0.075;
if (hasHiveMind == true){
newBird.flockSpeed = (14 + (Math.random() * 4));
};
SkyLevel.addChild(newBird);
birds.push(newBird);
};
if ((((hasRabbitsFoot == true)) && ((Math.random() <= 0.5)))){
newBird = new Bird();
newBird.scaleX = 0.075;
newBird.scaleY = 0.075;
if (hasHiveMind == true){
newBird.flockSpeed = (14 + (Math.random() * 4));
};
SkyLevel.addChild(newBird);
birds.push(newBird);
};
if ((((hasRoyalLineage == true)) && ((Math.random() >= 0.4)))){
newSwan = new Swan();
newSwan.scaleX = 0.095;
newSwan.scaleY = 0.095;
if (hasHiveMind == true){
newSwan.flockSpeed = (12 + (Math.random() * 4));
};
SkyLevel.addChild(newSwan);
birds.push(newSwan);
};
};
}
public function SetClouds(_arg1:TimerEvent){
setCloudCtr++;
setStormCtr++;
if (setCloudCtr >= setCloudRand){
setCloudCtr = 0;
setCloudRand = Math.floor((20 + Math.ceil((Math.random() * 20))));
newCloud = new Cloud();
newCloud.scaleX = newCloud.randScale;
newCloud.scaleY = newCloud.randScale;
newCloud.x = (Math.random() * 700);
newCloud.y = -350;
if (hasNightvision == true){
newCloud.alpha = (newCloud.alpha / 2);
};
CloudLevel.addChild(newCloud);
clouds.push(newCloud);
};
if (setStormCtr >= setStormRand){
if (sfxOn == true){
sc1 = thunderSnd.play();
sc1.soundTransform = sc1Transform;
};
setStormCtr = 0;
setStormRand = Math.floor(((150 + spawnBase) + Math.ceil((Math.random() * (350 + spawnBase)))));
if (atSea == true){
newHurricane = new Hurricane();
newHurricane.scaleX = newHurricane.randScale;
newHurricane.scaleY = newHurricane.randScale;
newHurricane.x = (100 + (Math.random() * 500));
newHurricane.y = -400;
CloudLevel.addChild(newHurricane);
clouds.push(newHurricane);
} else {
i = (3 + Math.ceil((Math.random() * 6)));
while (i >= 0) {
newStorm = new Storm();
newStorm.scaleX = newStorm.randScale;
newStorm.scaleY = newStorm.randScale;
newStorm.x = (Math.random() * 700);
newStorm.y = ((-400 - (Math.random() * 500)) - (40 * i));
CloudLevel.addChild(newStorm);
clouds.push(newStorm);
i--;
};
};
if (hasRainDance == true){
i = (3 + Math.ceil((Math.random() * 3)));
while (i >= 0) {
newBird = new Bird();
newBird.scaleX = 0.075;
newBird.scaleY = 0.075;
if (hasHiveMind == true){
newBird.flockSpeed = (14 + (Math.random() * 4));
};
SkyLevel.addChild(newBird);
birds.push(newBird);
i--;
};
};
};
}
public function CancelClear(_arg1:MouseEvent){
ConfirmClearBox.visible = false;
}
public function MoveStealths(){
i = (stealths.length - 1);
while (i >= 0) {
stealths[i].x = (stealths[i].x + (((elapsedMultiples / 2) + stealths[i].flySpeed) * Math.cos((stealths[i].rotation / (180 / Math.PI)))));
stealths[i].y = (stealths[i].y + (((elapsedMultiples / 2) + stealths[i].flySpeed) * Math.sin((stealths[i].rotation / (180 / Math.PI)))));
if (stealths[i].Body.alpha > 0){
if (hasEagleEyes == true){
stealths[i].Body.alpha = (stealths[i].Body.alpha - 0.05);
} else {
stealths[i].Body.alpha = (stealths[i].Body.alpha - 0.08);
};
};
j = (flockMates.length - 1);
while (j >= 0) {
if (stealths[i].hitTestPoint(flockMates[j].x, flockMates[j].y, true)){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
stealths[i].gotoAndStop((stealths[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[j]);
bonusMultiplier = (bonusMultiplier - flockMates[j].multiplierValue);
flockMates.splice(j, 1);
motherGooseEnabled = false;
};
j--;
};
if (stealths[i].hitTestPoint(Avatar.x, Avatar.y, true)){
if ((((phoenixRespawning == false)) && ((((poseidonsSea == false)) || ((((poseidonsSea == true)) && ((hasPoseidonsBlessing == false)))))))){
selfPreservationCheck = false;
if (flockMates.length > 0){
if (sfxOn == true){
sc1 = gooseImpactSnd.play();
sc1.soundTransform = sc1Transform;
};
Avatar.x = flockMates[(flockMates.length - 1)].x;
Avatar.y = flockMates[(flockMates.length - 1)].y;
stealths[i].gotoAndStop((stealths[i].currentFrame + 1));
SkyLevel.removeChild(flockMates[(flockMates.length - 1)]);
bonusMultiplier = (bonusMultiplier - flockMates[(flockMates.length - 1)].multiplierValue);
flockMates.splice((flockMates.length - 1), 1);
motherGooseEnabled = false;
} else {
if (sfxOn == true){
sc1 = gooseDieSnd.play();
sc1.soundTransform = sc1Transform;
};
if ((((hasPhoenixPendant == true)) && ((phoenixCount < 3)))){
phoenixCount++;
if (birds.length > 0){
Avatar.x = birds[0].x;
Avatar.y = birds[0].y;
phoenixRespawning = true;
phoenixRespawnTimer.start();
SkyLevel.removeChild(birds[i]);
birds.splice(i, 1);
};
} else {
Avatar.visible = false;
stealths[i].gotoAndStop((stealths[i].currentFrame + 1));
GameOverScreen.visible = true;
GameOver();
};
};
};
} else {
if ((((((((stealths[i].x > 800)) || ((stealths[i].x < -100)))) || ((stealths[i].y > 700)))) || ((stealths[i].y < -100)))){
SkyLevel.removeChild(stealths[i]);
stealths.splice(i, 1);
};
};
i--;
};
}
public function SetCookies(){
cookieCrunch.setCookieInt("highScore", highScore);
cookieCrunch.setCookieInt("bestTime", bestTime);
cookieCrunch.setCookieInt("totalAchievements", totalAchievements);
cookieCrunch.setCookieInt("earnedAchievementPoints", earnedAchievementPoints);
cookieCrunch.setCookieInt("careerScore", careerScore);
cookieCrunch.setCookieInt("currentUpgradePoints", currentUpgradePoints);
cookieCrunch.setCookieInt("purchasedUpgradeCount", purchasedUpgradeCount);
cookieCrunch.setCookieInt("gamePlayCount", gamePlayCount);
cookieCrunch.setCookie("hasSocialButterfly", hasSocialButterfly);
cookieCrunch.setCookie("hasMotherGoose", hasMotherGoose);
cookieCrunch.setCookie("hasScore1", hasScore1);
cookieCrunch.setCookie("hasScore2", hasScore2);
cookieCrunch.setCookie("hasScore3", hasScore3);
cookieCrunch.setCookie("hasScore4", hasScore4);
cookieCrunch.setCookie("hasScore5", hasScore5);
cookieCrunch.setCookie("hasWellVersed", hasWellVersed);
cookieCrunch.setCookie("hasSoVeryCurious", hasSoVeryCurious);
cookieCrunch.setCookie("hasBourgeoisie", hasBourgeoisie);
cookieCrunch.setCookie("hasFlockmasterFlash", hasFlockmasterFlash);
cookieCrunch.setCookie("hasConsolationPrize", hasConsolationPrize);
cookieCrunch.setCookie("hasGold1", hasGold1);
cookieCrunch.setCookie("hasGold2", hasGold2);
cookieCrunch.setCookie("hasGold3", hasGold3);
cookieCrunch.setCookie("hasAviator1", hasAviator1);
cookieCrunch.setCookie("hasAviator2", hasAviator2);
cookieCrunch.setCookie("hasAviator3", hasAviator3);
cookieCrunch.setCookie("hasIntoTheStorm", hasIntoTheStorm);
cookieCrunch.setCookie("hasSelfPreservation", hasSelfPreservation);
cookieCrunch.setCookie("hasFrequentFlyer", hasFrequentFlyer);
cookieCrunch.setCookie("hasFlyingSolo", hasFlyingSolo);
cookieCrunch.setCookie("hasAirlineTickets", hasAirlineTickets);
cookieCrunch.setCookie("hasBabyHuey", hasBabyHuey);
cookieCrunch.setCookie("hasShockAndAwe", hasShockAndAwe);
cookieCrunch.setCookie("hasFirstContact", hasFirstContact);
cookieCrunch.setCookie("hasOffTheRadar", hasOffTheRadar);
cookieCrunch.setCookie("hasClearlyDevoted", hasClearlyDevoted);
cookieCrunch.setCookie("hasAroundTheWorld", hasAroundTheWorld);
cookieCrunch.setCookie("hasAerodynamics", hasAerodynamics);
cookieCrunch.setCookie("hasBigWingspan", hasBigWingspan);
cookieCrunch.setCookie("hasDivineWings", hasDivineWings);
cookieCrunch.setCookie("hasHiveMind", hasHiveMind);
cookieCrunch.setCookie("hasNightvision", hasNightvision);
cookieCrunch.setCookie("hasEagleEyes", hasEagleEyes);
cookieCrunch.setCookie("hasHomingBeacon", hasHomingBeacon);
cookieCrunch.setCookie("hasRuggedDown", hasRuggedDown);
cookieCrunch.setCookie("hasRoyalLineage", hasRoyalLineage);
cookieCrunch.setCookie("hasRabbitsFoot", hasRabbitsFoot);
cookieCrunch.setCookie("hasRainDance", hasRainDance);
cookieCrunch.setCookie("hasPoseidonsBlessing", hasPoseidonsBlessing);
cookieCrunch.setCookie("hasPhoenixPendant", hasPhoenixPendant);
}
}
}//package
Section 90
//EndlessMigrationSharedObject (EndlessMigrationSharedObject)
package {
import flash.net.*;
public class EndlessMigrationSharedObject {
private var so:SharedObject;
public function EndlessMigrationSharedObject(){
so = SharedObject.getLocal("EnldessMigrationSharedObject");
}
public function soFlush(){
so.flush();
}
public function readCookieInt(_arg1:String):int{
return (so.data[_arg1]);
}
public function setCookie(_arg1:String, _arg2:Object):void{
so.data[_arg1] = _arg2;
}
public function setCookieInt(_arg1:String, _arg2:int):void{
so.data[_arg1] = _arg2;
}
public function readCookie(_arg1:String):Object{
return (so.data[_arg1]);
}
public function deleteCookie(){
so.clear();
}
}
}//package
Section 91
//GoldenPopSnd (GoldenPopSnd)
package {
import flash.media.*;
public dynamic class GoldenPopSnd extends Sound {
}
}//package
Section 92
//GooseDieSnd (GooseDieSnd)
package {
import flash.media.*;
public dynamic class GooseDieSnd extends Sound {
}
}//package
Section 93
//GooseGrabSnd (GooseGrabSnd)
package {
import flash.media.*;
public dynamic class GooseGrabSnd extends Sound {
}
}//package
Section 94
//GooseImpactSnd (GooseImpactSnd)
package {
import flash.media.*;
public dynamic class GooseImpactSnd extends Sound {
}
}//package
Section 95
//Helicopter (Helicopter)
package {
import flash.display.*;
public class Helicopter extends MovieClip {
public var spawnY:Number;
public var spawnX:Number;
public var flySpeed:Number;
public var rot:Number;
public function Helicopter(){
addFrameScript(0, frame1);
rot = (-5 + (Math.random() * 10));
flySpeed = (5 + (Math.random() * 5));
if (Math.ceil((Math.random() * 4)) == 1){
spawnX = (100 + (Math.random() * 500));
spawnY = -30;
rotation = (50 + (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 2){
spawnX = (100 + (Math.random() * 500));
spawnY = 630;
rotation = (310 - (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 3){
spawnX = -30;
spawnY = (100 + (Math.random() * 500));
rotation = (320 + (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 4){
spawnX = 730;
spawnY = (100 + (Math.random() * 500));
rotation = (100 + (Math.random() * 80));
};
};
};
};
}
function frame1(){
stop();
}
}
}//package
Section 96
//Hurricane (Hurricane)
package {
import flash.display.*;
public class Hurricane extends MovieClip {
public var randScale:Number;
public var flySpeed:Number;
public var hittingAvatar:Boolean;// = false
public var slowSpeed:Number;// = 8
public function Hurricane(){
hittingAvatar = false;
slowSpeed = 8;
super();
rotation = (Math.random() * 360);
alpha = (0.4 + (Math.random() * 0.2));
randScale = (0.7 + (Math.random() * 0.2));
flySpeed = (6 + (Math.random() * 4));
}
}
}//package
Section 97
//Jet (Jet)
package {
import flash.display.*;
public class Jet extends MovieClip {
public var spawnY:Number;
public var spawnX:Number;
public var flySpeed:Number;
public function Jet(){
addFrameScript(0, frame1);
flySpeed = (20 + (Math.random() * 6));
if (Math.ceil((Math.random() * 4)) == 1){
spawnX = (100 + (Math.random() * 500));
spawnY = -30;
rotation = (50 + (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 2){
spawnX = (100 + (Math.random() * 500));
spawnY = 630;
rotation = (310 - (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 3){
spawnX = -30;
spawnY = (100 + (Math.random() * 500));
rotation = (320 + (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 4){
spawnX = 730;
spawnY = (100 + (Math.random() * 500));
rotation = (100 + (Math.random() * 80));
};
};
};
};
}
function frame1(){
stop();
}
}
}//package
Section 98
//Juventus (Juventus)
package {
import flash.media.*;
public dynamic class Juventus extends Sound {
}
}//package
Section 99
//Skyscraper (Skyscraper)
package {
import flash.display.*;
public dynamic class Skyscraper extends MovieClip {
}
}//package
Section 100
//Spire (Spire)
package {
import flash.display.*;
public dynamic class Spire extends MovieClip {
}
}//package
Section 101
//Stealth (Stealth)
package {
import flash.display.*;
public class Stealth extends MovieClip {
public var spawnY:Number;
public var spawnX:Number;
public var flySpeed:Number;
public var Body:MovieClip;
public function Stealth(){
addFrameScript(0, frame1);
flySpeed = (14 + (Math.random() * 3));
if (Math.ceil((Math.random() * 4)) == 1){
spawnX = (100 + (Math.random() * 500));
spawnY = -30;
rotation = (50 + (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 2){
spawnX = (100 + (Math.random() * 500));
spawnY = 630;
rotation = (310 - (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 3){
spawnX = -30;
spawnY = (100 + (Math.random() * 500));
rotation = (320 + (Math.random() * 80));
} else {
if (Math.ceil((Math.random() * 4)) == 4){
spawnX = 730;
spawnY = (100 + (Math.random() * 500));
rotation = (100 + (Math.random() * 80));
};
};
};
};
}
function frame1(){
stop();
}
}
}//package
Section 102
//Storm (Storm)
package {
import flash.display.*;
public class Storm extends MovieClip {
public var randScale:Number;
public var flySpeed:Number;
public var hittingAvatar:Boolean;// = false
public var slowSpeed:Number;// = 0.6
public function Storm(){
hittingAvatar = false;
slowSpeed = 0.6;
super();
gotoAndStop(Math.ceil((Math.random() * 10)));
rotation = (Math.random() * 360);
alpha = (0.4 + (Math.random() * 0.2));
randScale = (0.4 + (Math.random() * 0.2));
flySpeed = (6 + (Math.random() * 3));
}
}
}//package
Section 103
//Swan (Swan)
package {
import flash.display.*;
public class Swan extends MovieClip {
public var destinationY:Number;
public var destinationX:Number;
public var multiplierValue;// = 0.4
public var flockSpeed:Number;
public var SmallBird:MovieClip;
public var GoldenGoose:MovieClip;
public var flySpeed:Number;
public var soughtRot:Number;
public function Swan(){
multiplierValue = (2 / 5);
super();
GoldenGoose.visible = false;
this.x = (50 + (Math.random() * 600));
this.y = -20;
this.rotation = -90;
flySpeed = (2 + (Math.random() * 4));
flockSpeed = (7 + (Math.random() * 3));
destinationX = 350;
destinationY = 350;
gotoAndStop(Math.ceil((Math.random() * 3)));
}
}
}//package
Section 104
//ThunderSound (ThunderSound)
package {
import flash.media.*;
public dynamic class ThunderSound extends Sound {
}
}//package