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 com.kongregate.as3.client.services.*;
import com.kongregate.as3.client.events.*;
import flash.system.*;
import flash.utils.*;
import flash.net.*;
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
//RC4 (com.meychi.ascrypt3.RC4)
package com.meychi.ascrypt3 {
public class RC4 {
private static var mykey:Array = new Array(0xFF);
private static var sbox:Array = new Array(0xFF);
public function encrypt(_arg1:String, _arg2:String):String{
var _local3:Array;
var _local4:Array;
var _local5:Array;
_local3 = strToChars(_arg1);
_local4 = strToChars(_arg2);
_local5 = calculate(_local3, _local4);
return (charsToHex(_local5));
}
public function decrypt(_arg1:String, _arg2:String):String{
var _local3:Array;
var _local4:Array;
var _local5:Array;
_local3 = hexToChars(_arg1);
_local4 = strToChars(_arg2);
_local5 = calculate(_local3, _local4);
return (charsToStr(_local5));
}
private static function initialize(_arg1:Array):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = 0;
_local4 = _arg1.length;
_local5 = 0;
_local5 = 0;
while (_local5 <= 0xFF) {
mykey[_local5] = _arg1[(_local5 % _local4)];
sbox[_local5] = _local5;
_local5++;
};
_local5 = 0;
while (_local5 <= 0xFF) {
_local2 = (((_local2 + sbox[_local5]) + mykey[_local5]) % 0x0100);
_local3 = sbox[_local5];
sbox[_local5] = sbox[_local2];
sbox[_local2] = _local3;
_local5++;
};
}
private static function strToChars(_arg1:String):Array{
var _local2:Array;
var _local3:Number;
_local2 = new Array();
_local3 = 0;
while (_local3 < _arg1.length) {
_local2.push(_arg1.charCodeAt(_local3));
_local3++;
};
return (_local2);
}
private static function charsToStr(_arg1:Array):String{
var _local2:String;
var _local3:Number;
_local2 = new String("");
_local3 = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(_arg1[_local3]));
_local3++;
};
return (_local2);
}
private static function charsToHex(_arg1:Array):String{
var _local2:String;
var _local3:Array;
var _local4:Number;
_local2 = new String("");
_local3 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
_local4 = 0;
while (_local4 < _arg1.length) {
_local2 = (_local2 + (_local3[(_arg1[_local4] >> 4)] + _local3[(_arg1[_local4] & 15)]));
_local4++;
};
return (_local2);
}
private static function calculate(_arg1:Array, _arg2:Array):Array{
var _local3:Number;
var _local4:Number;
var _local5:Array;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
initialize(_arg2);
_local3 = 0;
_local4 = 0;
_local5 = new Array();
_local9 = 0;
while (_local9 < _arg1.length) {
_local3 = ((_local3 + 1) % 0x0100);
_local4 = ((_local4 + sbox[_local3]) % 0x0100);
_local7 = sbox[_local3];
sbox[_local3] = sbox[_local4];
sbox[_local4] = _local7;
_local10 = ((sbox[_local3] + sbox[_local4]) % 0x0100);
_local6 = sbox[_local10];
_local8 = (_arg1[_local9] ^ _local6);
_local5.push(_local8);
_local9++;
};
return (_local5);
}
private static function hexToChars(_arg1:String):Array{
var _local2:Array;
var _local3:Number;
_local2 = new Array();
_local3 = ((_arg1.substr(0, 2))=="0x") ? 2 : 0;
while (_local3 < _arg1.length) {
_local2.push(parseInt(_arg1.substr(_local3, 2), 16));
_local3 = (_local3 + 2);
};
return (_local2);
}
}
}//package com.meychi.ascrypt3
Section 14
//MindJoltAPI (com.mindjolt.api.as3.MindJoltAPI)
package com.mindjolt.api.as3 {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class MindJoltAPI extends MovieClip {
private var dispatcher:CustomDispatcher;
public static var service:Object;
public function MindJoltAPI(){
dispatcher = new CustomDispatcher();
dispatcher.doAction(1, 100);
dispatcher.addEventListener(_slot2.ACTION, createRoot);
}
private function createRoot(_arg1:Event):void{
if (root != null){
_arg1.currentTarget.removeEventListener(_slot2.ACTION, createRoot);
init();
};
}
private function init():void{
var _local1:Object;
var _local2:String;
var _local3:Loader;
_local1 = Object(parent.root).loaderInfo.parameters;
_local2 = "";
if (((!((_local1.mjPath == null))) && (isDomainAllowed()))){
_local2 = _local1.mjPath;
} else {
_local2 = "http://static.mindjolt.com/api/as3/scoreapi_as3_local.swf";
};
_local3 = new Loader();
_local3.contentLoaderInfo.addEventListener(Event.COMPLETE, loadFinished);
_local3.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadFailed);
_local3.load(new URLRequest(_local2));
addChild(_local3);
}
private function loadFinished(_arg1:Event):void{
service = _arg1.currentTarget.content.service;
service.connect();
trace("[MindJoltAPI] service loaded");
}
private function isDomainAllowed():Boolean{
var _local1:String;
var _local2:LocalConnection;
var _local3:String;
_local1 = ".mindjolt.com";
_local2 = new LocalConnection();
_local3 = _local2.domain;
if (_local3.indexOf(_local1) == (_local3.length - _local1.length)){
return (true);
};
return (false);
}
private function loadFailed(_arg1:IOErrorEvent):void{
trace("[MindJoltAPI] unable to load service");
}
}
}//package com.mindjolt.api.as3
import flash.events.*;
import flash.utils.*;
class CustomDispatcher extends EventDispatcher {
public static var ACTION:String = "action";
private function CustomDispatcher(){
}
public function doAction(_arg1:Number, _arg2:Number):void{
var myTimer:Timer;
var propAction:Function;
var delay = _arg1;
var repeat = _arg2;
propAction = function (_arg1:TimerEvent):void{
dispatchEvent(new Event(_slot2.ACTION));
};
myTimer = new Timer(delay, repeat);
myTimer.addEventListener(TimerEvent.TIMER, propAction);
myTimer.start();
}
}
Section 15
//MindJoltSponsoredAPI (com.mindjolt.api.as3.MindJoltSponsoredAPI)
package com.mindjolt.api.as3 {
import flash.events.*;
import flash.display.*;
import com.meychi.ascrypt3.*;
import flash.net.*;
import flash.external.*;
public class MindJoltSponsoredAPI {
private static var displayObject:Object;
private static var connected:Boolean = false;
private static var gameId:String;
private static var flashCookie:SharedObject;
private static var key:String;
public static function openLink(_arg1:uint, _arg2:String=null):void{
var url:String;
var browserAgent:String;
var linkId = _arg1;
var mode = _arg2;
url = (((((("http://game.mindjolt.com/servlet/GameLink?key=" + gameId) + "&link=") + linkId) + ((mode)!=null) ? ("&mode=" + escape(mode)) : "") + "&httpref=") + escape(displayObject.loaderInfo.loaderURL));
browserAgent = null;
try {
if (ExternalInterface.available){
browserAgent = ExternalInterface.call("function getBrowser(){return navigator.userAgent;}");
};
} catch(e:Error) {
browserAgent = null;
};
if (((((!((browserAgent == null))) && (ExternalInterface.available))) && ((((browserAgent.indexOf("Firefox") >= 0)) || ((browserAgent.indexOf("MSIE") >= 0)))))){
ExternalInterface.call("window.open", url);
} else {
navigateToURL(new URLRequest(url), "_blank");
};
}
public static function connect(_arg1:String, _arg2:String, _arg3:Object){
if ((_arg3 is DisplayObject)){
if (!connected){
flashCookie = SharedObject.getLocal("com.mindjolt", "/");
flashCookie.objectEncoding = ObjectEncoding.AMF0;
gameId = _arg1.toUpperCase();
key = _arg2.toUpperCase();
displayObject = _arg3;
connected = true;
//unresolved jump
};
//unresolved jump
};
}
private static function finishedSubmitScore(_arg1:Event):void{
var _local2:String;
var _local3:RC4;
var _local4:URLVariables;
var _local5:String;
_local2 = _arg1.target.data.session;
if (_local2 != null){
_local3 = new RC4();
_local4 = new URLVariables();
_local4.decode(_local3.decrypt(_local2, key));
_local5 = _local4.userToken;
if (_local5 != null){
flashCookie.data.userToken = _local5;
flashCookie.flush();
};
};
}
public static function submitScore(_arg1:String, _arg2:Number, _arg3:String=null){
var userToken:String;
var rc4:RC4;
var session:String;
var send_lv:URLVariables;
var request:URLRequest;
var loader:URLLoader;
var name = _arg1;
var score = _arg2;
var mode = _arg3;
userToken = null;
if (flashCookie.data.userToken != null){
userToken = flashCookie.data.userToken;
} else {
userToken = null;
};
rc4 = new RC4();
session = rc4.encrypt(((((("score=" + score) + "&name=") + escape(name)) + ((mode)!=null) ? ("&mode=" + escape(mode)) : "") + ((userToken)!=null) ? ("&userToken=" + escape(userToken)) : ""), key);
send_lv = new URLVariables();
send_lv.gameId = gameId;
send_lv.session = session;
request = new URLRequest();
request.url = "http://game.mindjolt.com/servlet/GameScore";
request.method = URLRequestMethod.POST;
request.data = send_lv;
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, finishedSubmitScore);
loader.addEventListener(IOErrorEvent.IO_ERROR, failedSubmitScore);
try {
loader.load(request);
} catch(e:Error) {
};
}
private static function failedSubmitScore(_arg1:Event):void{
}
}
}//package com.mindjolt.api.as3
Section 16
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public class AdLoader {
private static var cpmstarLoader:Loader;
public static function LoadAd(_arg1:int, _arg2:int):DisplayObject{
var _local3:String;
Security.allowDomain("server.cpmstar.com");
_local3 = "http://server.cpmstar.com/adviewas3.swf";
cpmstarLoader = new Loader();
cpmstarLoader.load(new URLRequest(((((_local3 + "?poolid=") + _arg1) + "&subpoolid=") + _arg2)));
return (cpmstarLoader);
}
}
}//package CPMStar
Section 17
//assetHolder_31 (veggiefling_fla.assetHolder_31)
package veggiefling_fla {
import flash.display.*;
public dynamic class assetHolder_31 extends MovieClip {
public function assetHolder_31(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package veggiefling_fla
Section 18
//bigConveyor_43 (veggiefling_fla.bigConveyor_43)
package veggiefling_fla {
import flash.display.*;
public dynamic class bigConveyor_43 extends MovieClip {
public function bigConveyor_43(){
addFrameScript(29, frame30, 59, frame60);
}
function frame30(){
this.gotoAndPlay("right");
}
function frame60(){
this.gotoAndPlay("left");
}
}
}//package veggiefling_fla
Section 19
//creditsScreen_16 (veggiefling_fla.creditsScreen_16)
package veggiefling_fla {
import flash.display.*;
public dynamic class creditsScreen_16 extends MovieClip {
public var cont:SimpleButton;
public var soundsnap:SimpleButton;
public var irregular:SimpleButton;
public var deviant:SimpleButton;
public var musopen:SimpleButton;
public var fgl:SimpleButton;
public var flashkit:SimpleButton;
}
}//package veggiefling_fla
Section 20
//flingButton_26 (veggiefling_fla.flingButton_26)
package veggiefling_fla {
import flash.display.*;
public dynamic class flingButton_26 extends MovieClip {
public function flingButton_26(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package veggiefling_fla
Section 21
//gameOverScreen_12 (veggiefling_fla.gameOverScreen_12)
package veggiefling_fla {
import flash.display.*;
import flash.text.*;
public dynamic class gameOverScreen_12 extends MovieClip {
public var finalScoreTxt:TextField;
public var cont:SimpleButton;
public var highscores:SimpleButton;
public var inBowlTxt:TextField;
public var elsewhereTxt:TextField;
public var irregular:SimpleButton;
public var veggiesFlungTxt:TextField;
public var accuracyTxt:TextField;
public var submitStuff:MovieClip;
public var mindjolt:MovieClip;
}
}//package veggiefling_fla
Section 22
//loadingScreen_27 (veggiefling_fla.loadingScreen_27)
package veggiefling_fla {
import flash.display.*;
public dynamic class loadingScreen_27 extends MovieClip {
public var loadingBar:MovieClip;
public var adBox:MovieClip;
public var firstPlayBtn:SimpleButton;
}
}//package veggiefling_fla
Section 23
//mindjolt_ident_46 (veggiefling_fla.mindjolt_ident_46)
package veggiefling_fla {
import flash.events.*;
import flash.display.*;
import com.mindjolt.api.as3.*;
public dynamic class mindjolt_ident_46 extends MovieClip {
public var eyes:MovieClip;
public var logo_btn:SimpleButton;
public var mindlogo:MovieClip;
public function mindjolt_ident_46(){
addFrameScript(0, frame1, 53, frame54, 59, frame60, 176, frame177);
}
function frame177(){
MovieClip(parent).play();
stop();
}
function frame1(){
MovieClip(parent).stop();
logo_btn.addEventListener(MouseEvent.CLICK, mouseClickHandler);
}
function frame54(){
mindlogo.stop();
}
public function mouseClickHandler(_arg1:MouseEvent):void{
MindJoltSponsoredAPI.openLink(1);
}
function frame60(){
mindlogo.play();
}
}
}//package veggiefling_fla
Section 24
//mj_logo_58 (veggiefling_fla.mj_logo_58)
package veggiefling_fla {
import flash.display.*;
public dynamic class mj_logo_58 extends MovieClip {
public function mj_logo_58(){
addFrameScript(37, frame38);
}
function frame38(){
stop();
}
}
}//package veggiefling_fla
Section 25
//mj_marker_49 (veggiefling_fla.mj_marker_49)
package veggiefling_fla {
import flash.display.*;
public dynamic class mj_marker_49 extends MovieClip {
public function mj_marker_49(){
addFrameScript(0, frame1);
}
function frame1(){
this.visible = false;
}
}
}//package veggiefling_fla
Section 26
//siteLockScreen_24 (veggiefling_fla.siteLockScreen_24)
package veggiefling_fla {
import flash.display.*;
public dynamic class siteLockScreen_24 extends MovieClip {
public var siteLockTxt:SimpleButton;
}
}//package veggiefling_fla
Section 27
//submitStuff_14 (veggiefling_fla.submitStuff_14)
package veggiefling_fla {
import flash.display.*;
import flash.text.*;
public dynamic class submitStuff_14 extends MovieClip {
public var submitScore:SimpleButton;
public var nameTxt:TextField;
}
}//package veggiefling_fla
Section 28
//titleScreen_1 (veggiefling_fla.titleScreen_1)
package veggiefling_fla {
import flash.display.*;
public dynamic class titleScreen_1 extends MovieClip {
public var titleText:MovieClip;
}
}//package veggiefling_fla
Section 29
//titleText_2 (veggiefling_fla.titleText_2)
package veggiefling_fla {
import flash.display.*;
public dynamic class titleText_2 extends MovieClip {
public function titleText_2(){
addFrameScript(0, frame1, 110, frame111);
}
function frame1(){
stop();
}
function frame111(){
this.stop();
}
}
}//package veggiefling_fla
Section 30
//bounceSound (bounceSound)
package {
import flash.media.*;
public dynamic class bounceSound extends Sound {
}
}//package
Section 31
//bowl (bowl)
package {
import flash.events.*;
import flash.display.*;
public class bowl extends Sprite {
private const BOWLRIGHT:uint = 563;
private const BOWLLEFT:uint = 302;
private var theConveyor:MovieClip;
public var hitBar:MovieClip;
public var dx:Number;
public static var BOWLHEIGHT:uint = 195;
public function bowl(_arg1:MovieClip){
this.theConveyor = _arg1;
addEventListener(Event.ENTER_FRAME, enterFrameListener);
this.x = 500;
this.y = bowl.BOWLHEIGHT;
this.dx = 1.2;
}
private function enterFrameListener(_arg1:Event):void{
this.x = (this.x + this.dx);
if ((((this.x > this.BOWLRIGHT)) && ((this.dx > 0)))){
this.dx = (this.dx * -1);
this.theConveyor.gotoAndPlay("left");
};
if ((((this.x < this.BOWLLEFT)) && ((this.dx < 0)))){
this.dx = (this.dx * -1);
this.theConveyor.gotoAndPlay("right");
};
}
}
}//package
Section 32
//bpepper (bpepper)
package {
import flash.display.*;
public dynamic class bpepper extends MovieClip {
}
}//package
Section 33
//broccoli (broccoli)
package {
import flash.display.*;
public dynamic class broccoli extends MovieClip {
}
}//package
Section 34
//buttonSound (buttonSound)
package {
import flash.media.*;
public dynamic class buttonSound extends Sound {
}
}//package
Section 35
//carrot (carrot)
package {
import flash.display.*;
public dynamic class carrot extends MovieClip {
}
}//package
Section 36
//countSound (countSound)
package {
import flash.media.*;
public dynamic class countSound extends Sound {
}
}//package
Section 37
//eggplant (eggplant)
package {
import flash.display.*;
public dynamic class eggplant extends MovieClip {
}
}//package
Section 38
//flinger (flinger)
package {
import flash.events.*;
import flash.display.*;
public class flinger extends Sprite {
public static var ROTATIONSPEED:uint = 4;
public static var RADIUS:uint = 40;
public static var YPOS:uint = 320;
public static var XPOS:uint = 100;
public function flinger(){
addEventListener(Event.ENTER_FRAME, enterFrameListener);
this.x = flinger.XPOS;
this.y = flinger.YPOS;
}
private function enterFrameListener(_arg1:Event):void{
this.rotation = (this.rotation + flinger.ROTATIONSPEED);
}
}
}//package
Section 39
//flingSound (flingSound)
package {
import flash.media.*;
public dynamic class flingSound extends Sound {
}
}//package
Section 40
//gameScreen (gameScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class gameScreen extends MovieClip {
public var counter:MovieClip;
public var bigConveyor:MovieClip;
public var timeTxt:TextField;
public var hitBar:MovieClip;
public var smallConveyor:MovieClip;
}
}//package
Section 41
//inBowlSound (inBowlSound)
package {
import flash.media.*;
public dynamic class inBowlSound extends Sound {
}
}//package
Section 42
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("core.mochibot.com");
Security.allowInsecureDomain("core.mochibot.com");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 43
//musicSound (musicSound)
package {
import flash.media.*;
public dynamic class musicSound extends Sound {
}
}//package
Section 44
//score (score)
package {
import flash.display.*;
import flash.text.*;
public class score extends Sprite {
private var myscore:uint;
public var scoreTxt:TextField;
public function score(){
this.x = 142;
this.y = 14;
this.myscore = 0;
this.scoreTxt.text = "0";
}
public function increaseScore():void{
this.myscore = (this.myscore + 100);
this.scoreTxt.text = String(myscore);
}
}
}//package
Section 45
//splatSound (splatSound)
package {
import flash.media.*;
public dynamic class splatSound extends Sound {
}
}//package
Section 46
//Symbol1 (Symbol1)
package {
import flash.display.*;
public dynamic class Symbol1 extends MovieClip {
public var highscores:SimpleButton;
public var irregular:SimpleButton;
public var startFlinging:SimpleButton;
public var credits:SimpleButton;
public var moregames:SimpleButton;
public var mindjolt:MovieClip;
}
}//package
Section 47
//tomato (tomato)
package {
import flash.display.*;
public dynamic class tomato extends MovieClip {
}
}//package
Section 48
//veggie (veggie)
package {
import flash.display.*;
import flash.media.*;
public class veggie extends MovieClip {
private const GRAVITY:Number = 1.15;
private const LEFTWALL:uint = 10;
private const GROUNDHEIGHT:uint = 440;
private const RIGHTWALL:uint = 630;
private const TANGVEL;
private var channel:SoundChannel;
public var veggieState:String;
private var myHitBar:MovieClip;
private var myScore:score;
private var angleToVeggie:Number;
private var dy:Number;
private var dx:Number;
private var vf:veggiefling;
private var myBowl:bowl;
public function veggie(_arg1:MovieClip, _arg2:bowl, _arg3:score, _arg4:MovieClip, _arg5:veggiefling):void{
TANGVEL = ((((flinger.ROTATIONSPEED / 360) * 2) * Math.PI) * flinger.RADIUS);
super();
this.myBowl = _arg2;
this.myScore = _arg3;
this.myHitBar = _arg4;
this.vf = _arg5;
this.x = -25;
this.y = 355;
this.dx = 3;
this.dy = 0;
this.veggieState = "onConveyor";
this.angleToVeggie = Math.PI;
addChild(_arg1);
}
public function checkState(){
var _local1:Number;
var _local2:splatSound;
var _local3:inBowlSound;
var _local4:bounceSound;
if (this.veggieState == "onConveyor"){
_local1 = (Math.pow((this.y - flinger.YPOS), 2) + Math.pow((this.x - flinger.XPOS), 2));
if (_local1 < (flinger.RADIUS * flinger.RADIUS)){
this.veggieState = "onFlinger";
this.angleToVeggie = Math.atan2((this.y - flinger.YPOS), (this.x - flinger.XPOS));
};
} else {
if ((((this.veggieState == "flying")) && ((((((this.y > this.GROUNDHEIGHT)) || ((this.x > this.RIGHTWALL)))) || ((((this.x < this.LEFTWALL)) && ((this.dx < 0)))))))){
_local2 = new splatSound();
channel = _local2.play();
this.veggieState = "splat";
} else {
if ((((((this.veggieState == "flying")) && ((Math.abs((this.x - this.myBowl.x)) < 75)))) && ((Math.abs((this.y - this.myBowl.y)) < 50)))){
if (((this.hitTestObject(this.myBowl.hitBar)) && ((this.dy > 0)))){
this.vf.setChildIndex(this.myBowl, (this.vf.numChildren - 1));
_local3 = new inBowlSound();
channel = _local3.play();
this.veggieState = "inBowl";
this.y = (bowl.BOWLHEIGHT - 10);
this.myScore.increaseScore();
};
} else {
if ((((((this.veggieState == "flying")) && ((Math.abs((this.x - this.myHitBar.x)) < 50)))) && ((Math.abs((this.y - this.myHitBar.y)) < 75)))){
if ((((this.dx > 5)) && (this.hitTestObject(this.myHitBar)))){
_local4 = new bounceSound();
channel = _local4.play();
this.dx = (this.dx * -1);
};
};
};
};
};
}
public function flingVeggie():void{
this.dy = ((Math.sin((this.angleToVeggie + (Math.PI / 2))) * this.TANGVEL) * 9.75);
this.dx = ((Math.cos((this.angleToVeggie + (Math.PI / 2))) * this.TANGVEL) * 9.75);
this.veggieState = "flying";
}
public function moveVeggie(){
var _local1:Number;
var _local2:Number;
if (this.veggieState == "onConveyor"){
this.x = (this.x + this.dx);
} else {
if (this.veggieState == "onFlinger"){
_local1 = (Math.sin(this.angleToVeggie) * flinger.RADIUS);
_local2 = (Math.cos(this.angleToVeggie) * flinger.RADIUS);
this.angleToVeggie = (this.angleToVeggie + ((flinger.ROTATIONSPEED * Math.PI) / 180));
this.x = (flinger.XPOS + _local2);
this.y = (flinger.YPOS + _local1);
this.rotation = (this.rotation + flinger.ROTATIONSPEED);
};
};
if (this.veggieState == "flying"){
this.x = (this.x + this.dx);
this.y = (this.y + this.dy);
this.dy = (this.dy + this.GRAVITY);
};
if (this.veggieState == "inBowl"){
this.x = (this.x + this.myBowl.dx);
};
}
}
}//package
Section 49
//veggiefling (veggiefling)
package {
import flash.events.*;
import flash.display.*;
import com.kongregate.as3.client.*;
import com.mindjolt.api.as3.*;
import CPMStar.*;
import flash.media.*;
import flash.utils.*;
import flash.net.*;
import flash.ui.*;
public dynamic class veggiefling extends MovieClip {
public var siteLockScreen:MovieClip;
public var ad:DisplayObject;
private var theGameScreen:MovieClip;
public var timeLeft:uint;
private var countTime:uint;
private var onKong:Boolean;// = false
private var theScore:score;
private var veggies:Array;
public var menuScreen:Symbol1;
public var domain;
public var CPMStarSubPoolID:int;
public var CPMStarPoolID:int;
public var loadingScreen:MovieClip;
public var titleScreen:MovieClip;
private var channel:SoundChannel;
public var onKongregate:Boolean;
public var initBytes:int;
private var theTimer:Timer;
private var newVeggieDelay:uint;
private var theFlinger:flinger;
public var allowed_site:String;
public var creditsScreen:MovieClip;
public var flingButton:MovieClip;
private var lastVeggieTime:uint;
private var onMindjolt:Boolean;// = false
public var gameOverScreen:MovieClip;
private var theBowl:bowl;
public function veggiefling(){
var _local1:String;
var _local2:*;
var _local3:KongregateAPI;
onMindjolt = false;
onKong = false;
super();
addFrameScript(0, frame1, 1, frame2, 3, frame4);
_local1 = "mindjolt.com";
_local2 = this.root.loaderInfo.url.split("/")[2];
if (_local2.indexOf(_local1) == (_local2.length - _local1.length)){
onMindjolt = true;
gameOverScreen.submitStuff.visible = false;
};
_local1 = "kongregate.com";
if (_local2.indexOf(_local1) == (_local2.length - _local1.length)){
_local3 = new KongregateAPI();
this.addChild(_local3);
onKong = true;
};
}
public function onRootLoaderInit(_arg1:Event):void{
initBytes = _arg1.target.bytesLoaded;
}
private function titleEnterframe(_arg1:Event):void{
var _local2:flingSound;
if (titleScreen.titleText.currentLabel == "finished"){
_local2 = new flingSound();
channel = _local2.play();
hideIt(titleScreen);
titleScreen.removeEventListener(Event.ENTER_FRAME, titleEnterframe);
newMenu();
};
}
private function hideIt(_arg1:MovieClip):void{
_arg1.x = (_arg1.y = 5000);
_arg1.visible = false;
}
public function onRootLoaderComplete(_arg1:Event):void{
if (onKongregate){
play();
} else {
loadingScreen.firstPlayBtn.visible = true;
loadingScreen.firstPlayBtn.addEventListener(MouseEvent.CLICK, clickPlayHandler);
};
}
private function countdown(){
var _local1:Timer;
theGameScreen = new gameScreen();
addChild(theGameScreen);
theGameScreen.hitBar.visible = false;
theGameScreen.x = (theGameScreen.y = 0);
theGameScreen.visible = true;
veggies = [];
this.theBowl = new bowl(theGameScreen.bigConveyor);
addChild(this.theBowl);
this.theBowl.hitBar.visible = false;
theGameScreen.bigConveyor.gotoAndPlay("right");
this.theFlinger = new flinger();
addChild(this.theFlinger);
this.theScore = new score();
addChild(this.theScore);
this.timeLeft = 60;
theGameScreen.timeTxt.text = "60";
hideIt(gameOverScreen);
hideIt(creditsScreen);
stage.addEventListener(MouseEvent.MOUSE_MOVE, moveHandler);
flingButton.visible = true;
Mouse.hide();
setChildIndex(flingButton, (numChildren - 1));
addEventListener(Event.ENTER_FRAME, tempFrameListener);
this.theBowl.cacheAsBitmap = true;
theGameScreen.cacheAsBitmap = true;
theGameScreen.bigConveyor.cacheAsBitmap = true;
theGameScreen.smallConveyor.cacheAsBitmap = true;
this.countTime = 5;
theGameScreen.counter.visible = false;
_local1 = new Timer(1000, 5);
_local1.addEventListener("timer", countdownHandler);
_local1.start();
}
private function timerHandler(_arg1:TimerEvent):void{
this.timeLeft--;
theGameScreen.timeTxt.text = String(timeLeft);
if (this.timeLeft == 0){
endGame();
};
}
private function moveHandler(_arg1:MouseEvent):void{
flingButton.x = mouseX;
flingButton.y = mouseY;
}
function frame2(){
this.stage.frameRate = 25;
}
function frame1(){
MindJoltSponsoredAPI.connect("FJD511AF", "DD56813585CAFA34", root);
CPMStarPoolID = 1437;
CPMStarSubPoolID = 15070;
allowed_site = "kongregate.com";
onKongregate = false;
domain = this.root.loaderInfo.url.split("/")[2];
if (domain.indexOf(allowed_site) == (domain.length - allowed_site.length)){
onKongregate = true;
};
if (!onKongregate){
ad = AdLoader.LoadAd(CPMStarPoolID, CPMStarSubPoolID);
loadingScreen.adBox.addChild(ad);
};
stop();
loadingScreen.firstPlayBtn.visible = false;
loadingScreen.loadingBar.width = 0;
initBytes = 0;
this.root.loaderInfo.addEventListener(Event.INIT, onRootLoaderInit);
this.root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onRootLoaderProgress);
this.root.loaderInfo.addEventListener(Event.COMPLETE, onRootLoaderComplete);
}
function frame4(){
stop();
MochiBot.track(this, "f864c16d");
this.stage.frameRate = 31;
startGame();
}
private function clickContinue(_arg1:MouseEvent):void{
var _local2:buttonSound;
var _local3:uint;
_local2 = new buttonSound();
channel = _local2.play();
_local3 = 0;
while (_local3 < veggies.length) {
if (veggies[_local3].veggieState == "splat"){
removeChild(veggies[_local3]);
};
veggies[_local3] = null;
_local3++;
};
veggies = [];
gameOverScreen.submitStuff.submitScore.removeEventListener(MouseEvent.MOUSE_DOWN, clickSubmit);
gameOverScreen.highscores.removeEventListener(MouseEvent.MOUSE_DOWN, clickHighscores);
gameOverScreen.mindjolt.removeEventListener(MouseEvent.MOUSE_DOWN, clickMindjolt);
gameOverScreen.cont.removeEventListener(MouseEvent.MOUSE_DOWN, clickContinue);
hideIt(gameOverScreen);
newMenu();
}
private function clickMindjolt(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
channel = _local2.play();
MindJoltSponsoredAPI.openLink(5);
}
private function clickFlashkit(_arg1:MouseEvent):void{
openUrl("http://www.flashkit.com");
}
private function clickHandler(_arg1:MouseEvent):void{
var _local2:Boolean;
var _local3:uint;
var _local4:flingSound;
_local2 = false;
_local3 = 0;
while (_local3 < veggies.length) {
if (veggies[_local3].veggieState == "onFlinger"){
veggies[_local3].flingVeggie();
_local2 = true;
};
_local3++;
};
if (_local2){
_local4 = new flingSound();
channel = _local4.play();
flingButton.gotoAndPlay("click");
};
}
private function clickSoundsnap(_arg1:MouseEvent):void{
openUrl("http://www.soundsnap.com");
}
private function clickMenuHighscores(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
channel = _local2.play();
MindJoltSponsoredAPI.openLink(3);
}
private function clickSiteLock(_arg1:MouseEvent):void{
openUrl("http://www.irregulargames.com/veggiefling/");
}
private function openUrl(_arg1:String):void{
var button:buttonSound;
var request:URLRequest;
var url = _arg1;
button = new buttonSound();
channel = button.play();
request = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
};
}
public function clickPlayHandler(_arg1:Event):void{
loadingScreen.firstPlayBtn.removeEventListener(MouseEvent.CLICK, clickPlayHandler);
if (ad){
loadingScreen.adBox.removeChild(ad);
};
play();
}
private function clickMenuMindjolt(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
channel = _local2.play();
MindJoltSponsoredAPI.openLink(6);
}
private function clickFGL(_arg1:MouseEvent):void{
openUrl("http://www.flashgamelicense.com/game_referral.php?game_id=1037");
}
private function newMenu():void{
menuScreen.x = (menuScreen.y = 0);
menuScreen.visible = true;
menuScreen.startFlinging.addEventListener(MouseEvent.MOUSE_DOWN, clickStart);
menuScreen.highscores.addEventListener(MouseEvent.MOUSE_DOWN, clickMenuHighscores);
menuScreen.irregular.addEventListener(MouseEvent.MOUSE_DOWN, clickIrregular);
menuScreen.credits.addEventListener(MouseEvent.MOUSE_DOWN, clickCredits);
menuScreen.mindjolt.addEventListener(MouseEvent.MOUSE_DOWN, clickMenuMindjolt);
menuScreen.moregames.addEventListener(MouseEvent.MOUSE_DOWN, clickMenuMoregames);
}
private function addVeggie(_arg1){
veggies[veggies.length] = new veggie(_arg1, this.theBowl, this.theScore, theGameScreen.hitBar, this);
addChild(veggies[(veggies.length - 1)]);
this.lastVeggieTime = getTimer();
setChildIndex(flingButton, (numChildren - 1));
}
private function showSiteLock():void{
siteLockScreen.x = (siteLockScreen.y = 0);
siteLockScreen.siteLockTxt.addEventListener(MouseEvent.MOUSE_DOWN, clickSiteLock);
}
public function onRootLoaderProgress(_arg1:ProgressEvent):void{
loadingScreen.loadingBar.width = (((_arg1.bytesLoaded - initBytes) / (_arg1.bytesTotal - initBytes)) * 301);
}
private function clickMenuMoregames(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
channel = _local2.play();
MindJoltSponsoredAPI.openLink(2);
}
private function enterFrameListener(_arg1:Event):void{
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:MovieClip;
_local2 = 0;
while (_local2 < veggies.length) {
if (veggies[_local2].veggieState != "splat"){
veggies[_local2].moveVeggie();
if ((((veggies[_local2].veggieState == "onConveyor")) || ((veggies[_local2].veggieState == "flying")))){
veggies[_local2].checkState();
};
};
_local2++;
};
_local3 = (getTimer() - this.lastVeggieTime);
if (_local3 > this.newVeggieDelay){
_local4 = Math.round((Math.random() * 4));
switch (_local4){
case 0:
_local5 = new broccoli();
break;
case 1:
_local5 = new eggplant();
break;
case 2:
_local5 = new tomato();
break;
case 3:
_local5 = new carrot();
break;
case 4:
_local5 = new bpepper();
break;
};
addVeggie(MovieClip(_local5));
if (this.timeLeft < 8){
this.newVeggieDelay = uint((50 + (Math.random() * 300)));
};
if (this.timeLeft < 16){
this.newVeggieDelay = uint((200 + (Math.random() * 600)));
} else {
if (this.timeLeft < 23){
this.newVeggieDelay = uint((400 + (Math.random() * 700)));
} else {
if (this.timeLeft < 30){
this.newVeggieDelay = uint((1200 + (Math.random() * 700)));
} else {
if (this.timeLeft < 40){
this.newVeggieDelay = uint((1600 + (Math.random() * 700)));
} else {
if (this.timeLeft < 50){
this.newVeggieDelay = uint((2000 + (Math.random() * 700)));
} else {
this.newVeggieDelay = 2800;
};
};
};
};
};
};
}
private function clickContinueCredits(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
channel = _local2.play();
creditsScreen.cont.removeEventListener(MouseEvent.MOUSE_DOWN, clickContinueCredits);
creditsScreen.irregular.removeEventListener(MouseEvent.MOUSE_DOWN, clickIrregular);
creditsScreen.soundsnap.removeEventListener(MouseEvent.MOUSE_DOWN, clickSoundsnap);
creditsScreen.flashkit.removeEventListener(MouseEvent.MOUSE_DOWN, clickFlashkit);
creditsScreen.musopen.removeEventListener(MouseEvent.MOUSE_DOWN, clickMusopen);
creditsScreen.deviant.removeEventListener(MouseEvent.MOUSE_DOWN, clickDeviant);
creditsScreen.fgl.removeEventListener(MouseEvent.MOUSE_DOWN, clickFGL);
hideIt(creditsScreen);
menuScreen.x = (menuScreen.y = 0);
menuScreen.visible = true;
}
private function showTitle():void{
hideIt(siteLockScreen);
titleScreen.x = (titleScreen.y = 0);
titleScreen.titleText.gotoAndPlay(2);
titleScreen.addEventListener(Event.ENTER_FRAME, titleEnterframe);
}
private function endGame():void{
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:KongregateAPI;
Mouse.show();
hideIt(flingButton);
hideIt(theGameScreen);
_local1 = 0;
_local2 = 0;
gameOverScreen.x = (gameOverScreen.y = 0);
gameOverScreen.visible = true;
if (!onMindjolt){
gameOverScreen.submitStuff.visible = true;
gameOverScreen.submitStuff.nameTxt.selectable = true;
gameOverScreen.submitStuff.nameTxt.stage.focus = gameOverScreen.submitStuff.nameTxt;
gameOverScreen.submitStuff.nameTxt.setSelection(0, gameOverScreen.submitStuff.nameTxt.text.length);
gameOverScreen.submitStuff.nameTxt.backgroundColor = 0x999999;
};
_local3 = 0;
while (_local3 < veggies.length) {
if (veggies[_local3].veggieState == "inBowl"){
_local1++;
} else {
if (veggies[_local3].veggieState == "splat"){
_local2++;
};
};
_local3++;
};
gameOverScreen.veggiesFlungTxt.text = (_local1 + _local2);
gameOverScreen.inBowlTxt.text = _local1;
gameOverScreen.elsewhereTxt.text = _local2;
if ((((_local1 == 0)) && ((_local2 == 0)))){
gameOverScreen.accuracyTxt.text = "0%";
} else {
gameOverScreen.accuracyTxt.text = (Math.round(((100 * _local1) / (_local1 + _local2))) + "%");
};
gameOverScreen.finalScoreTxt.text = (_local1 * 100);
if (onMindjolt){
MindJoltAPI.service.submitScore((_local1 * 100));
} else {
if (onKong){
_local5 = KongregateAPI.getInstance();
_local5.scores.submit((_local1 * 100));
_local5.stats.submit("Accuracy", Math.round(((100 * _local1) / (_local1 + _local2))));
_local5.stats.submit("Total veggies flung", (_local1 + _local2));
};
};
removeChild(this.theBowl);
this.theBowl = null;
_local4 = 0;
while (_local4 < veggies.length) {
if (veggies[_local4].veggieState != "splat"){
removeChild(veggies[_local4]);
};
_local4++;
};
removeChild(this.theFlinger);
this.theFlinger = null;
removeChild(this.theScore);
this.theScore = null;
removeChild(theGameScreen);
theGameScreen = null;
this.theTimer.removeEventListener("timer", timerHandler);
this.theTimer = null;
removeEventListener(Event.ENTER_FRAME, enterFrameListener);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, clickHandler);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, moveHandler);
gameOverScreen.submitStuff.submitScore.addEventListener(MouseEvent.MOUSE_DOWN, clickSubmit);
gameOverScreen.highscores.addEventListener(MouseEvent.MOUSE_DOWN, clickHighscores);
gameOverScreen.mindjolt.addEventListener(MouseEvent.MOUSE_DOWN, clickMindjolt);
gameOverScreen.cont.addEventListener(MouseEvent.MOUSE_DOWN, clickContinue);
}
private function startGame():void{
showTitle();
hideIt(loadingScreen);
}
private function newGame(){
this.theTimer = new Timer(1000, 60);
this.theTimer.addEventListener("timer", timerHandler);
this.theTimer.start();
this.newVeggieDelay = 0;
this.lastVeggieTime = getTimer();
addEventListener(Event.ENTER_FRAME, enterFrameListener);
stage.addEventListener(MouseEvent.MOUSE_DOWN, clickHandler);
}
private function clickStart(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
channel = _local2.play();
menuScreen.startFlinging.removeEventListener(MouseEvent.MOUSE_DOWN, clickStart);
menuScreen.highscores.removeEventListener(MouseEvent.MOUSE_DOWN, clickMenuHighscores);
menuScreen.irregular.removeEventListener(MouseEvent.MOUSE_DOWN, clickIrregular);
menuScreen.credits.removeEventListener(MouseEvent.MOUSE_DOWN, clickCredits);
menuScreen.mindjolt.removeEventListener(MouseEvent.MOUSE_DOWN, clickMenuMindjolt);
menuScreen.moregames.removeEventListener(MouseEvent.MOUSE_DOWN, clickMenuMoregames);
hideIt(menuScreen);
countdown();
}
private function clickSubmit(_arg1:MouseEvent):void{
var _local2:buttonSound;
var _local3:String;
_local2 = new buttonSound();
channel = _local2.play();
gameOverScreen.submitStuff.visible = false;
_local3 = gameOverScreen.submitStuff.nameTxt.text;
if (_local3 == "[type name]"){
_local3 = "";
};
MindJoltSponsoredAPI.submitScore(_local3, int(gameOverScreen.finalScoreTxt.text));
}
private function clickIrregular(_arg1:MouseEvent):void{
openUrl("http://www.irregulargames.com");
}
private function tempFrameListener(_arg1:Event):void{
flingButton.x = mouseX;
flingButton.y = mouseY;
}
private function clickDeviant(_arg1:MouseEvent):void{
openUrl("http://www.trevor80.deviantart.com");
}
private function countdownHandler(_arg1:TimerEvent):void{
var _local2:countSound;
var _local3:musicSound;
this.countTime--;
theGameScreen.counter.gotoAndStop((5 - this.countTime));
_local2 = new countSound();
if (this.countTime == 4){
channel = _local2.play();
theGameScreen.counter.gotoAndStop(1);
theGameScreen.counter.visible = true;
} else {
if (this.countTime == 1){
_local3 = new musicSound();
channel = _local3.play(0, 1);
removeEventListener(Event.ENTER_FRAME, tempFrameListener);
newGame();
} else {
if (this.countTime == 0){
theGameScreen.counter.visible = false;
} else {
channel = _local2.play();
};
};
};
}
private function clickHighscores(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
channel = _local2.play();
MindJoltSponsoredAPI.openLink(4);
}
private function clickMusopen(_arg1:MouseEvent):void{
openUrl("http://www.musopen.com/music.php?type=piece&id=141");
}
private function clickCredits(_arg1:MouseEvent):void{
var _local2:buttonSound;
_local2 = new buttonSound();
channel = _local2.play();
hideIt(menuScreen);
creditsScreen.x = (creditsScreen.y = 0);
creditsScreen.visible = true;
creditsScreen.cont.addEventListener(MouseEvent.MOUSE_DOWN, clickContinueCredits);
creditsScreen.irregular.addEventListener(MouseEvent.MOUSE_DOWN, clickIrregular);
creditsScreen.soundsnap.addEventListener(MouseEvent.MOUSE_DOWN, clickSoundsnap);
creditsScreen.flashkit.addEventListener(MouseEvent.MOUSE_DOWN, clickFlashkit);
creditsScreen.musopen.addEventListener(MouseEvent.MOUSE_DOWN, clickMusopen);
creditsScreen.deviant.addEventListener(MouseEvent.MOUSE_DOWN, clickDeviant);
creditsScreen.fgl.addEventListener(MouseEvent.MOUSE_DOWN, clickFGL);
}
}
}//package