Section 1
//JSON (com.adobe.serialization.json.JSON)
package com.adobe.serialization.json {
public class JSON {
public static function decode(_arg1:String){
var _local2:JSONDecoder = new JSONDecoder(_arg1);
return (_local2.getValue());
}
public static function encode(_arg1:Object):String{
var _local2:JSONEncoder = new JSONEncoder(_arg1);
return (_local2.getString());
}
}
}//package com.adobe.serialization.json
Section 2
//JSONDecoder (com.adobe.serialization.json.JSONDecoder)
package com.adobe.serialization.json {
public class JSONDecoder {
private var value;
private var tokenizer:JSONTokenizer;
private var token:JSONToken;
public function JSONDecoder(_arg1:String){
tokenizer = new JSONTokenizer(_arg1);
nextToken();
value = parseValue();
}
private function parseObject():Object{
var _local2:String;
var _local1:Object = new Object();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
while (true) {
if (token.type == JSONTokenType.STRING){
_local2 = String(token.value);
nextToken();
if (token.type == JSONTokenType.COLON){
nextToken();
_local1[_local2] = parseValue();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting } or , but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting : but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting string but found " + token.value));
};
};
return (null);
}
private function parseValue():Object{
if (token == null){
tokenizer.parseError("Unexpected end of input");
};
switch (token.type){
case JSONTokenType.LEFT_BRACE:
return (parseObject());
case JSONTokenType.LEFT_BRACKET:
return (parseArray());
case JSONTokenType.STRING:
case JSONTokenType.NUMBER:
case JSONTokenType.TRUE:
case JSONTokenType.FALSE:
case JSONTokenType.NULL:
return (token.value);
default:
tokenizer.parseError(("Unexpected " + token.value));
};
return (null);
}
private function nextToken():JSONToken{
return ((token = tokenizer.getNextToken()));
}
public function getValue(){
return (value);
}
private function parseArray():Array{
var _local1:Array = new Array();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
while (true) {
_local1.push(parseValue());
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting ] or , but found " + token.value));
};
};
return (null);
}
}
}//package com.adobe.serialization.json
Section 3
//JSONEncoder (com.adobe.serialization.json.JSONEncoder)
package com.adobe.serialization.json {
import flash.utils.*;
public class JSONEncoder {
private var jsonString:String;
public function JSONEncoder(_arg1){
jsonString = convertToString(_arg1);
}
private function escapeString(_arg1:String):String{
var _local3:String;
var _local6:String;
var _local7:String;
var _local2 = "";
var _local4:Number = _arg1.length;
var _local5:int;
while (_local5 < _local4) {
_local3 = _arg1.charAt(_local5);
switch (_local3){
case "\"":
_local2 = (_local2 + "\\\"");
break;
case "\\":
_local2 = (_local2 + "\\\\");
break;
case "\b":
_local2 = (_local2 + "\\b");
break;
case "\f":
_local2 = (_local2 + "\\f");
break;
case "\n":
_local2 = (_local2 + "\\n");
break;
case "\r":
_local2 = (_local2 + "\\r");
break;
case "\t":
_local2 = (_local2 + "\\t");
break;
default:
if (_local3 < " "){
_local6 = _local3.charCodeAt(0).toString(16);
_local7 = ((_local6.length == 2)) ? "00" : "000";
_local2 = (_local2 + (("\\u" + _local7) + _local6));
} else {
_local2 = (_local2 + _local3);
};
};
_local5++;
};
return ((("\"" + _local2) + "\""));
}
private function arrayToString(_arg1:Array):String{
var _local2 = "";
var _local3:int;
while (_local3 < _arg1.length) {
if (_local2.length > 0){
_local2 = (_local2 + ",");
};
_local2 = (_local2 + convertToString(_arg1[_local3]));
_local3++;
};
return ((("[" + _local2) + "]"));
}
public function getString():String{
return (jsonString);
}
private function objectToString(_arg1:Object):String{
var value:Object;
var key:String;
var v:XML;
var o = _arg1;
var s = "";
var classInfo:XML = describeType(o);
if (classInfo.@name.toString() == "Object"){
for (key in o) {
value = o[key];
if ((value is Function)){
} else {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(key) + ":") + convertToString(value)));
};
};
} else {
for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(v.@name.toString()) + ":") + convertToString(o[v.@name])));
};
};
return ((("{" + s) + "}"));
}
private function convertToString(_arg1):String{
if ((_arg1 is String)){
return (escapeString((_arg1 as String)));
};
if ((_arg1 is Number)){
return ((isFinite((_arg1 as Number))) ? _arg1.toString() : "null");
} else {
if ((_arg1 is Boolean)){
return ((_arg1) ? "true" : "false");
} else {
if ((_arg1 is Array)){
return (arrayToString((_arg1 as Array)));
};
if ((((_arg1 is Object)) && (!((_arg1 == null))))){
return (objectToString(_arg1));
};
};
};
return ("null");
}
}
}//package com.adobe.serialization.json
Section 4
//JSONParseError (com.adobe.serialization.json.JSONParseError)
package com.adobe.serialization.json {
public class JSONParseError extends Error {
private var _location:int;
private var _text:String;
public function JSONParseError(_arg1:String="", _arg2:int=0, _arg3:String=""){
super(_arg1);
_location = _arg2;
_text = _arg3;
}
public function get location():int{
return (_location);
}
public function get text():String{
return (_text);
}
}
}//package com.adobe.serialization.json
Section 5
//JSONToken (com.adobe.serialization.json.JSONToken)
package com.adobe.serialization.json {
public class JSONToken {
private var _value:Object;
private var _type:int;
public function JSONToken(_arg1:int=-1, _arg2:Object=null){
_type = _arg1;
_value = _arg2;
}
public function get value():Object{
return (_value);
}
public function get type():int{
return (_type);
}
public function set type(_arg1:int):void{
_type = _arg1;
}
public function set value(_arg1:Object):void{
_value = _arg1;
}
}
}//package com.adobe.serialization.json
Section 6
//JSONTokenizer (com.adobe.serialization.json.JSONTokenizer)
package com.adobe.serialization.json {
public class JSONTokenizer {
private var loc:int;
private var ch:String;
private var obj:Object;
private var jsonString:String;
public function JSONTokenizer(_arg1:String){
jsonString = _arg1;
loc = 0;
nextChar();
}
private function skipComments():void{
if (ch == "/"){
nextChar();
switch (ch){
case "/":
do {
nextChar();
} while (((!((ch == "\n"))) && (!((ch == "")))));
nextChar();
break;
case "*":
nextChar();
while (true) {
if (ch == "*"){
nextChar();
if (ch == "/"){
nextChar();
break;
};
} else {
nextChar();
};
if (ch == ""){
parseError("Multi-line comment not closed");
};
};
break;
default:
parseError((("Unexpected " + ch) + " encountered (expecting '/' or '*' )"));
};
};
}
private function isDigit(_arg1:String):Boolean{
return ((((_arg1 >= "0")) && ((_arg1 <= "9"))));
}
private function readString():JSONToken{
var _local3:String;
var _local4:int;
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.STRING;
var _local2 = "";
nextChar();
while (((!((ch == "\""))) && (!((ch == ""))))) {
if (ch == "\\"){
nextChar();
switch (ch){
case "\"":
_local2 = (_local2 + "\"");
break;
case "/":
_local2 = (_local2 + "/");
break;
case "\\":
_local2 = (_local2 + "\\");
break;
case "b":
_local2 = (_local2 + "\b");
break;
case "f":
_local2 = (_local2 + "\f");
break;
case "n":
_local2 = (_local2 + "\n");
break;
case "r":
_local2 = (_local2 + "\r");
break;
case "t":
_local2 = (_local2 + "\t");
break;
case "u":
_local3 = "";
_local4 = 0;
while (_local4 < 4) {
if (!isHexDigit(nextChar())){
parseError((" Excepted a hex digit, but found: " + ch));
};
_local3 = (_local3 + ch);
_local4++;
};
_local2 = (_local2 + String.fromCharCode(parseInt(_local3, 16)));
break;
default:
_local2 = (_local2 + ("\\" + ch));
};
} else {
_local2 = (_local2 + ch);
};
nextChar();
};
if (ch == ""){
parseError("Unterminated string literal");
};
nextChar();
_local1.value = _local2;
return (_local1);
}
private function nextChar():String{
return ((ch = jsonString.charAt(loc++)));
}
public function getNextToken():JSONToken{
var _local2:String;
var _local3:String;
var _local4:String;
var _local1:JSONToken = new JSONToken();
skipIgnored();
switch (ch){
case "{":
_local1.type = JSONTokenType.LEFT_BRACE;
_local1.value = "{";
nextChar();
break;
case "}":
_local1.type = JSONTokenType.RIGHT_BRACE;
_local1.value = "}";
nextChar();
break;
case "[":
_local1.type = JSONTokenType.LEFT_BRACKET;
_local1.value = "[";
nextChar();
break;
case "]":
_local1.type = JSONTokenType.RIGHT_BRACKET;
_local1.value = "]";
nextChar();
break;
case ",":
_local1.type = JSONTokenType.COMMA;
_local1.value = ",";
nextChar();
break;
case ":":
_local1.type = JSONTokenType.COLON;
_local1.value = ":";
nextChar();
break;
case "t":
_local2 = ((("t" + nextChar()) + nextChar()) + nextChar());
if (_local2 == "true"){
_local1.type = JSONTokenType.TRUE;
_local1.value = true;
nextChar();
} else {
parseError(("Expecting 'true' but found " + _local2));
};
break;
case "f":
_local3 = (((("f" + nextChar()) + nextChar()) + nextChar()) + nextChar());
if (_local3 == "false"){
_local1.type = JSONTokenType.FALSE;
_local1.value = false;
nextChar();
} else {
parseError(("Expecting 'false' but found " + _local3));
};
break;
case "n":
_local4 = ((("n" + nextChar()) + nextChar()) + nextChar());
if (_local4 == "null"){
_local1.type = JSONTokenType.NULL;
_local1.value = null;
nextChar();
} else {
parseError(("Expecting 'null' but found " + _local4));
};
break;
case "\"":
_local1 = readString();
break;
default:
if (((isDigit(ch)) || ((ch == "-")))){
_local1 = readNumber();
} else {
if (ch == ""){
return (null);
};
parseError((("Unexpected " + ch) + " encountered"));
};
};
return (_local1);
}
private function skipWhite():void{
while (isWhiteSpace(ch)) {
nextChar();
};
}
public function parseError(_arg1:String):void{
throw (new JSONParseError(_arg1, loc, jsonString));
}
private function isWhiteSpace(_arg1:String):Boolean{
return ((((((((_arg1 == " ")) || ((_arg1 == "\t")))) || ((_arg1 == "\n")))) || ((_arg1 == "\r"))));
}
private function skipIgnored():void{
skipWhite();
skipComments();
skipWhite();
}
private function isHexDigit(_arg1:String):Boolean{
var _local2:String = _arg1.toUpperCase();
return (((isDigit(_arg1)) || ((((_local2 >= "A")) && ((_local2 <= "F"))))));
}
private function readNumber():JSONToken{
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.NUMBER;
var _local2 = "";
if (ch == "-"){
_local2 = (_local2 + "-");
nextChar();
};
if (!isDigit(ch)){
parseError("Expecting a digit");
};
if (ch == "0"){
_local2 = (_local2 + ch);
nextChar();
if (isDigit(ch)){
parseError("A digit cannot immediately follow 0");
};
} else {
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
if (ch == "."){
_local2 = (_local2 + ".");
nextChar();
if (!isDigit(ch)){
parseError("Expecting a digit");
};
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
if ((((ch == "e")) || ((ch == "E")))){
_local2 = (_local2 + "e");
nextChar();
if ((((ch == "+")) || ((ch == "-")))){
_local2 = (_local2 + ch);
nextChar();
};
if (!isDigit(ch)){
parseError("Scientific notation number needs exponent value");
};
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
var _local3:Number = Number(_local2);
if (((isFinite(_local3)) && (!(isNaN(_local3))))){
_local1.value = _local3;
return (_local1);
};
parseError((("Number " + _local3) + " is not valid!"));
return (null);
}
}
}//package com.adobe.serialization.json
Section 7
//JSONTokenType (com.adobe.serialization.json.JSONTokenType)
package com.adobe.serialization.json {
public class JSONTokenType {
public static const NUMBER:int = 11;
public static const FALSE:int = 8;
public static const RIGHT_BRACKET:int = 4;
public static const NULL:int = 9;
public static const TRUE:int = 7;
public static const RIGHT_BRACE:int = 2;
public static const UNKNOWN:int = -1;
public static const COMMA:int = 0;
public static const LEFT_BRACKET:int = 3;
public static const STRING:int = 10;
public static const LEFT_BRACE:int = 1;
public static const COLON:int = 6;
}
}//package com.adobe.serialization.json
Section 8
//MochiScores (mochi.MochiScores)
package mochi {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var options = _arg1;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (_slot1.boardID != null){
options.boardID = _slot1.boardID;
};
};
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
var _local2:Object = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (_arg1 != null){
if (_arg1.error != null){
if (_arg1.error == true){
if (onErrorHandler != null){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
_slot1.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi
Section 9
//MochiServices (mochi.MochiServices)
package mochi {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _sendChannel:LocalConnection;
private static var _rcvChannelName:String;
private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _startTime:Number;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__mochiservices";
private static var _rcvChannel:LocalConnection;
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
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++;
};
};
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (_clip != null){
if (_clip._queue != null){
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);
};
};
};
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
public static function get id():String{
return (_id);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function getVersion():String{
return ("1.31");
}
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 {
_listenChannel.close();
_rcvChannel.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
return (_local2);
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
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 onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion()});
_rcvChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = this.client._callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = 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 this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
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 (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) {
};
};
};
};
}
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");
_rcvChannelName = _arg1;
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var id = _arg1;
var clip = _arg2;
var clipname:String = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
MochiServices.allowDomains(_gatewayURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
_timer = new Timer(1000, 0);
_startTime = getTimer();
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
var f:Function = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
var req:URLRequest = new URLRequest(_gatewayURL);
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain("*", "localhost");
_rcvChannel.allowInsecureDomain("*", "localhost");
_rcvChannel.client = _clip;
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
public static function bringToTop(_arg1:Event):void{
var e = _arg1;
if (MochiServices.clip != null){
if (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 connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
if ((clip is DisplayObject)){
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 parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
var mc:MovieClip = 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 connectWait(_arg1:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_timer.stop();
};
}
}
}//package mochi
Section 10
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.0.0.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 11
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 12
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 13
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 14
//FlexMovieClip (mx.core.FlexMovieClip)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexMovieClip extends MovieClip {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexMovieClip(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 15
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 16
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 17
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(_arg1:Point):Point;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(_arg1:String):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(_arg1:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(_arg1:Point):Point;
function get height():Number;
function set blendMode(_arg1:String):void;
function get parent():DisplayObjectContainer;
function getBounds(_arg1:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(_arg1:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(_arg1:Number):void;
function set accessibilityProperties(_arg1:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(_arg1:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(_arg1:Number):void;
function set mask(_arg1:DisplayObject):void;
function getRect(_arg1:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(_arg1:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(_arg1:DisplayObject):Boolean;
function set opaqueBackground(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get transform():Transform;
function set filters(_arg1:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(_arg1:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 18
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 19
//MovieClipAsset (mx.core.MovieClipAsset)
package mx.core {
public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 20
//MovieClipLoaderAsset (mx.core.MovieClipLoaderAsset)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
public class MovieClipLoaderAsset extends MovieClipAsset implements IFlexAsset, IFlexDisplayObject {
protected var initialHeight:Number;// = 0
private var loader:Loader;// = null
private var initialized:Boolean;// = false
protected var initialWidth:Number;// = 0
private var requestedHeight:Number;
private var requestedWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipLoaderAsset(){
var _local1:LoaderContext = new LoaderContext();
_local1.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
if (("allowLoadBytesCodeExecution" in _local1)){
_local1["allowLoadBytesCodeExecution"] = true;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.loadBytes(movieClipData, _local1);
addChild(loader);
}
override public function get width():Number{
if (!initialized){
return (initialWidth);
};
return (super.width);
}
override public function set width(_arg1:Number):void{
if (!initialized){
requestedWidth = _arg1;
} else {
loader.width = _arg1;
};
}
override public function get measuredHeight():Number{
return (initialHeight);
}
private function completeHandler(_arg1:Event):void{
initialized = true;
initialWidth = loader.width;
initialHeight = loader.height;
if (!isNaN(requestedWidth)){
loader.width = requestedWidth;
};
if (!isNaN(requestedHeight)){
loader.height = requestedHeight;
};
dispatchEvent(_arg1);
}
override public function set height(_arg1:Number):void{
if (!initialized){
requestedHeight = _arg1;
} else {
loader.height = _arg1;
};
}
override public function get measuredWidth():Number{
return (initialWidth);
}
override public function get height():Number{
if (!initialized){
return (initialHeight);
};
return (super.height);
}
public function get movieClipData():ByteArray{
return (null);
}
}
}//package mx.core
Section 21
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 22
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 23
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.0.0.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local4:String;
var _local5:Array;
var _local3:DisplayObject = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 24
//Bubble (Bubble)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Bubble extends Sprite {
private var lastTime:int;
private var sprite:Bitmap;
public var number:int;
public var scale:Number;
public var combo:int;
public var starter:Boolean;
public var upgrade1:Boolean;
public var upgrade2:Boolean;
private var explodeProgressNumber:int;
public var exploding:Boolean;
public var color:int;
public var upgrade3:Boolean;
public var videoTime:Number;
public var speedX:int;
public var speedY:int;
public function Bubble(_arg1:Bitmap, _arg2:Number, _arg3:int, _arg4:int, _arg5:Boolean, _arg6:Boolean, _arg7:Boolean){
starter = false;
this.upgrade1 = _arg5;
this.upgrade2 = _arg6;
this.upgrade3 = _arg7;
exploding = false;
this.number = _arg3;
this.color = _arg4;
explodeProgressNumber = 0;
combo = 1;
sprite = _arg1;
sprite.cacheAsBitmap = true;
sprite.smoothing = true;
addChild(sprite);
sprite.x = (-(sprite.width) / 2);
sprite.y = (-(sprite.height) / 2);
this.scaleY = (this.scaleX = (this.scale = _arg2));
this.x = (Math.random() * (NRApplication.WIDTH - this.width));
this.y = (Math.random() * (NRApplication.HEIGHT - this.height));
speedX = getRandomSpeed();
speedY = getRandomSpeed();
lastTime = getTimer();
addEventListener(Event.ENTER_FRAME, moveObject);
}
public function getRandomSpeed():Number{
var _local1:Number = ((Math.random() * 40) + 10);
if (Math.random() < 0.5){
_local1 = (_local1 * -1);
};
return (_local1);
}
public function explode(_arg1:int){
this.combo = _arg1;
exploding = true;
sprite.cacheAsBitmap = false;
}
public function deleteBubble():void{
removeEventListener(Event.ENTER_FRAME, moveObject);
NRApplication(parent).removeBubble(this);
parent.removeChild(this);
}
public function moveObject(_arg1:Event):void{
var _local2:int = (getTimer() - lastTime);
lastTime = (lastTime + _local2);
this.x = (this.x + ((speedX * _local2) / 1000));
this.y = (this.y + ((speedY * _local2) / 1000));
if (upgrade3){
if (this.x < 0){
if (speedX < 0){
this.x = NRApplication.WIDTH;
};
};
if (this.x > NRApplication.WIDTH){
if (speedX > 0){
this.x = 0;
};
};
if (this.y < 0){
if (speedY < 0){
this.y = NRApplication.HEIGHT;
};
};
if (this.y > NRApplication.HEIGHT){
if (speedY > 0){
this.y = 0;
};
};
} else {
if (this.x < 0){
if (speedX < 0){
speedX = (speedX * -1);
};
};
if (this.x > NRApplication.WIDTH){
if (speedX > 0){
speedX = (speedX * -1);
};
};
if (this.y < 0){
if (speedY < 0){
speedY = (speedY * -1);
};
};
if (this.y > NRApplication.HEIGHT){
if (speedY > 0){
speedY = (speedY * -1);
};
};
};
if (exploding){
explodeProgress((_local2 / 1000));
};
}
private function explodeProgress(_arg1:Number):void{
explodeProgressNumber = (explodeProgressNumber + (70 * _arg1));
if (explodeProgressNumber < 42){
if (upgrade2){
this.scaleX = (this.scaleY = (this.scaleY + ((((0.13 * combo) * _arg1) * explodeProgressNumber) * scale)));
} else {
this.scaleX = (this.scaleY = (this.scaleY + ((((0.1 * combo) * _arg1) * explodeProgressNumber) * scale)));
};
} else {
if (this.scaleX > 0){
if (this.upgrade1){
this.scaleX = (this.scaleY = (this.scaleY - ((((0.005 * combo) * _arg1) * explodeProgressNumber) * scale)));
} else {
this.scaleX = (this.scaleY = (this.scaleY - ((((0.008 * combo) * _arg1) * explodeProgressNumber) * scale)));
};
} else {
deleteBubble();
};
};
}
}
}//package
Section 25
//InterfaceApplication (InterfaceApplication)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import mochi.*;
import flash.net.*;
public class InterfaceApplication extends Sprite {
private var mainVideoGalleryBtnHooverInterface:Class;
private var JAY:Class;
private var mainMenuBackground:Bitmap;
private var levelsStartBtnInterface:Class;
private var upgrade1YellowContainer:Sprite;
private var submitScoreBtnHooverInterface:Class;
private var mainInsaneBtnInterface:Class;
private var jay:MovieClip;
public var statusTarget:TextField;
private var upgrade3RedContainer:Sprite;
private var soundBtnContainer:Sprite;
private var upgrade3GreenContainer:Sprite;
private var menuBar:Bitmap;
private var mainNormalBtn:Bitmap;
private var levelsSubmitScoreBtnInterface:Class;
public var statusTargetMetSlash:TextField;
public var upgradesUsed;
private var levelsSubmittedVideoBtn:Bitmap;
private var levelsMainMenuBtnHoover:Bitmap;
private var soundMuteInterface:Class;
private var mainVideoGalleryBtnContainer:Sprite;
private var mainHighscoresBtnHoover:Bitmap;
private var upgradeYellowBubble:Class;
private var mainNormalBtnInterface:Class;
private var upgrade1Text:TextField;
private var mainMoreGamesBtnHoover:Bitmap;
private var upgrade1Yellow:Bitmap;
private var levelsMainMenuBtnContainer:Sprite;
private var upgrade1Green:Bitmap;
private var soundPlayBtn:Bitmap;
private var menuBtn:Bitmap;
private var mainEasyBtnContainer:Sprite;
private var mainHighscoresBtnContainer:Sprite;
private var menuBtnContainer:Sprite;
private var mainHardBtnHooverInterface:Class;
public var modeIntro:TextField;
private var mainMoreGamesBtnInterface:Class;
private var upgrade3Blue:Bitmap;
private var levelsSubmitVideoBtnHooverInterface:Class;
private var levelsMoreGamesBtnHoover:Bitmap;
private var mainHardBtnInterface:Class;
public var mainMenuContainer:Sprite;
private var mainMoreGamesBtn:Bitmap;
private var levelsSubmitVideoBtnInterface:Class;
private var levelsStartBtnHooverInterface:Class;
public var statusTargetMet:TextField;
private var mainEasyBtnHoover:Bitmap;
public var statusLevel:TextField;
private var upgradeBlueBubble:Class;
private var upgrade1Red:Bitmap;
private var mainInsaneBtnHooverInterface:Class;
private var submitScoreBtnInterface:Class;
private var levelsMainMenuBtnHooverInterface:Class;
private var gameApp:NRApplication;
private var mainInsaneBtnHoover:Bitmap;
private var submitScoreBtn:Bitmap;
private var menuBtnHooverInterface:Class;
public var points:TextField;
private var levelsStartBtnHoover:Bitmap;
public var submitName:TextField;
private var upgrade3Yellow:Bitmap;
private var levelsSubmitScoreBtnHooverInterface:Class;
private var upgrade3BlueContainer:Sprite;
private var friendlyMessage:int;// = 0
private var mainEasyBtn:Bitmap;
private var mainVideoGalleryBtnHoover:Bitmap;
private var mainVideoGalleryBtnInterface:Class;
private var upgrade2Blue:Bitmap;
public var statusTargetMetGot:TextField;
private var upgrade2Green:Bitmap;
private var friendlyMessages:Array;
private var mainInsaneBtn:Bitmap;
private var upgrade2Red:Bitmap;
private var mainHighscoresBtnHooverInterface:Class;
private var levelsMainMenuBtnInterface:Class;
private var levelsStartBtn:Bitmap;
private var upgrade1RedContainer:Sprite;
private var mainMoreGamesBtnHooverInterface:Class;
private var mainEasyBtnInterface:Class;
private var mainHighscoresBtnInterface:Class;
private var menuBtnInterface:Class;
private var menuBtnHoover:Bitmap;
private var mainNormalBtnHooverInterface:Class;
private var upgrade2BlueContainer:Sprite;
private var levelsStartBtnContainer:Sprite;
public var modeIntromessage:TextField;
private var levelsMoreGamesBtn:Bitmap;
private var menuBarInterface:Class;
private var mainInsaneBtnContainer:Sprite;
private var upgrade3Text:TextField;
private var levelsSubmittedVideoBtnInterface:Class;
private var levelsSubmitVideoBtn:Bitmap;
private var soundMuteBtn:Bitmap;
private var mainHardBtn:Bitmap;
private var upgrade3Red:Bitmap;
private var mainVideoGalleryBtn:Bitmap;
private var upgradeGreyBubble:Class;
private var upgrade1Blue:Bitmap;
private var levelsSubmitScoreBtnContainer:Sprite;
private var levelsMainMenuBtn:Bitmap;
private var soundPlayInterface:Class;
public var statusTargetMetRequired:TextField;
private var submitScoreBtnHoover:Bitmap;
private var mainNormalBtnContainer:Sprite;
private var upgrade2Yellow:Bitmap;
private var levelsSubmitScoreBtnHoover:Bitmap;
private var upgrade2RedContainer:Sprite;
private var upgrade1BlueContainer:Sprite;
private var upgradeGreenBubble:Class;
private var mainNameInterface:Class;
private var mainNormalBtnHoover:Bitmap;
private var upgrade3Green:Bitmap;
public var statusMessage:TextField;
private var upgradeRedBubble:Class;
private var upgrade1GreenContainer:Sprite;
private var mainMenuBackgroundInterface:Class;
private var mainMoreGamesBtnContainer:Sprite;
private var mainEasyBtnHooverInterface:Class;
private var mainHighscoresBtn:Bitmap;
private var levelsSubmitVideoBtnHoover:Bitmap;
private var upgrade3YellowContainer:Sprite;
private var levelsMoreGamesBtnContainer:Sprite;
private var upgrade2Text:TextField;
private var mainName:Bitmap;
private var mainHardBtnContainer:Sprite;
private var levelsSubmitScoreBtn:Bitmap;
private var mainHardBtnHoover:Bitmap;
private var upgrade2GreenContainer:Sprite;
private var upgrade2YellowContainer:Sprite;
public var levelsSubmitVideoBtnContainer:Sprite;
private var submitScoreBtnContainer:Sprite;
public function InterfaceApplication(_arg1:NRApplication){
JAY = InterfaceApplication_JAY;
menuBarInterface = InterfaceApplication_menuBarInterface;
menuBtnInterface = InterfaceApplication_menuBtnInterface;
menuBtnHooverInterface = InterfaceApplication_menuBtnHooverInterface;
soundPlayInterface = InterfaceApplication_soundPlayInterface;
soundMuteInterface = InterfaceApplication_soundMuteInterface;
mainMenuBackgroundInterface = InterfaceApplication_mainMenuBackgroundInterface;
mainEasyBtnInterface = InterfaceApplication_mainEasyBtnInterface;
mainEasyBtnHooverInterface = InterfaceApplication_mainEasyBtnHooverInterface;
mainNormalBtnInterface = InterfaceApplication_mainNormalBtnInterface;
mainNormalBtnHooverInterface = InterfaceApplication_mainNormalBtnHooverInterface;
mainHardBtnInterface = InterfaceApplication_mainHardBtnInterface;
mainHardBtnHooverInterface = InterfaceApplication_mainHardBtnHooverInterface;
mainInsaneBtnInterface = InterfaceApplication_mainInsaneBtnInterface;
mainInsaneBtnHooverInterface = InterfaceApplication_mainInsaneBtnHooverInterface;
mainVideoGalleryBtnInterface = InterfaceApplication_mainVideoGalleryBtnInterface;
mainVideoGalleryBtnHooverInterface = InterfaceApplication_mainVideoGalleryBtnHooverInterface;
mainMoreGamesBtnInterface = InterfaceApplication_mainMoreGamesBtnInterface;
mainMoreGamesBtnHooverInterface = InterfaceApplication_mainMoreGamesBtnHooverInterface;
mainHighscoresBtnInterface = InterfaceApplication_mainHighscoresBtnInterface;
mainHighscoresBtnHooverInterface = InterfaceApplication_mainHighscoresBtnHooverInterface;
levelsStartBtnInterface = InterfaceApplication_levelsStartBtnInterface;
levelsStartBtnHooverInterface = InterfaceApplication_levelsStartBtnHooverInterface;
levelsSubmitScoreBtnInterface = InterfaceApplication_levelsSubmitScoreBtnInterface;
levelsSubmitScoreBtnHooverInterface = InterfaceApplication_levelsSubmitScoreBtnHooverInterface;
levelsSubmitVideoBtnInterface = InterfaceApplication_levelsSubmitVideoBtnInterface;
levelsSubmittedVideoBtnInterface = InterfaceApplication_levelsSubmittedVideoBtnInterface;
levelsSubmitVideoBtnHooverInterface = InterfaceApplication_levelsSubmitVideoBtnHooverInterface;
levelsMainMenuBtnInterface = InterfaceApplication_levelsMainMenuBtnInterface;
levelsMainMenuBtnHooverInterface = InterfaceApplication_levelsMainMenuBtnHooverInterface;
upgradeBlueBubble = InterfaceApplication_upgradeBlueBubble;
upgradeGreenBubble = InterfaceApplication_upgradeGreenBubble;
upgradeYellowBubble = InterfaceApplication_upgradeYellowBubble;
upgradeRedBubble = InterfaceApplication_upgradeRedBubble;
upgradeGreyBubble = InterfaceApplication_upgradeGreyBubble;
mainNameInterface = InterfaceApplication_mainNameInterface;
submitScoreBtnInterface = InterfaceApplication_submitScoreBtnInterface;
submitScoreBtnHooverInterface = InterfaceApplication_submitScoreBtnHooverInterface;
upgradesUsed = new Array();
friendlyMessages = new Array();
super();
this.gameApp = _arg1;
menuBar = new menuBarInterface();
this.addChild(menuBar);
jay = new JAY();
jay.x = 525;
jay.y = 325;
friendlyMessages.push("It is hard in the beginning - just keep trying ");
friendlyMessages.push(" ");
friendlyMessages.push("Pop at least as many bubbles as the target describes to clear the level. ");
friendlyMessages.push("You can submit your highscore at any time. Good luck! ");
friendlyMessages.push(" ");
friendlyMessages.push("A Combo is when specific bubbles pups each other. ");
friendlyMessages.push("try to do combos (like 1-2-3), as they will make the explosions bigger. ");
friendlyMessages.push(" ");
friendlyMessages.push("If you think the fancy colors in the background are, well fancy colors to no use at all, you're right :-) ");
friendlyMessages.push(" ");
friendlyMessages.push("In every level the number of bubbles is increased by 3. ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push("Don't loose faith, you can do it ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push("In level 10 you can choose one upgrade. Aren't you excited? ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push("Many tactics goes for this game - try to find your own. ");
friendlyMessages.push("I usually just click away, but that doesn't seem to be very effective. ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push("Have you ever tried to pup all bubbles on stage? You get in the HALL of FAME and things. Pretty cool! ");
friendlyMessages.push(" ");
friendlyMessages.push("No more messages, you're on your own now! ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push("well, not really. I just wanted to inform you that the insane mode really is insane. ");
friendlyMessages.push("It is! Okay, i'll leave you to your game now. ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push("You really want to beat that game, right? Perhaps you should just try the easy mode. ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push("Wow, i'm really impressed. You must be the most insisting person i have ewer met. ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push("You're still playing this game? Go get a life! ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
friendlyMessages.push(" ");
menuBtnContainer = new Sprite();
menuBtnContainer.y = 5;
this.addChild(menuBtnContainer);
menuBtn = new menuBtnInterface();
menuBtnHoover = new menuBtnHooverInterface();
menuBtnContainer.addChild(menuBtn);
menuBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, menuBtnRollOverEvent);
menuBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, menuBtnRollOutEvent);
menuBtnContainer.addEventListener(MouseEvent.MOUSE_UP, menuBtnMouseUpEvent);
mainMenuContainer = new Sprite();
this.addChild(mainMenuContainer);
mainMenuBackground = new mainMenuBackgroundInterface();
mainMenuContainer.addChild(mainMenuBackground);
mainEasyBtn = new mainEasyBtnInterface();
mainEasyBtnHoover = new mainEasyBtnHooverInterface();
mainEasyBtnContainer = new Sprite();
mainEasyBtnContainer.x = 210;
mainEasyBtnContainer.y = 80;
mainEasyBtnContainer.addChild(mainEasyBtn);
mainMenuContainer.addChild(mainEasyBtnContainer);
mainEasyBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, mainEasyBtnRollOverEvent);
mainEasyBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, mainEasyBtnRollOutEvent);
mainEasyBtnContainer.addEventListener(MouseEvent.MOUSE_UP, mainEasyBtnMouseUpEvent);
mainNormalBtn = new mainNormalBtnInterface();
mainNormalBtnHoover = new mainNormalBtnHooverInterface();
mainNormalBtnContainer = new Sprite();
mainNormalBtnContainer.x = 210;
mainNormalBtnContainer.y = 150;
mainNormalBtnContainer.addChild(mainNormalBtn);
mainMenuContainer.addChild(mainNormalBtnContainer);
mainNormalBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, mainNormalBtnRollOverEvent);
mainNormalBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, mainNormalBtnRollOutEvent);
mainNormalBtnContainer.addEventListener(MouseEvent.MOUSE_UP, mainNormalBtnMouseUpEvent);
mainHardBtn = new mainHardBtnInterface();
mainHardBtnHoover = new mainHardBtnHooverInterface();
mainHardBtnContainer = new Sprite();
mainHardBtnContainer.x = 210;
mainHardBtnContainer.y = 220;
mainHardBtnContainer.addChild(mainHardBtn);
mainMenuContainer.addChild(mainHardBtnContainer);
mainHardBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, mainHardBtnRollOverEvent);
mainHardBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, mainHardBtnRollOutEvent);
mainHardBtnContainer.addEventListener(MouseEvent.MOUSE_UP, mainHardBtnMouseUpEvent);
mainInsaneBtn = new mainInsaneBtnInterface();
mainInsaneBtnHoover = new mainInsaneBtnHooverInterface();
mainInsaneBtnContainer = new Sprite();
mainInsaneBtnContainer.x = 210;
mainInsaneBtnContainer.y = 290;
mainInsaneBtnContainer.addChild(mainInsaneBtn);
mainMenuContainer.addChild(mainInsaneBtnContainer);
mainInsaneBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, mainInsaneBtnRollOverEvent);
mainInsaneBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, mainInsaneBtnRollOutEvent);
mainInsaneBtnContainer.addEventListener(MouseEvent.MOUSE_UP, mainInsaneBtnMouseUpEvent);
mainVideoGalleryBtn = new mainVideoGalleryBtnInterface();
mainVideoGalleryBtnHoover = new mainVideoGalleryBtnHooverInterface();
mainVideoGalleryBtnContainer = new Sprite();
mainVideoGalleryBtnContainer.x = 210;
mainVideoGalleryBtnContainer.y = 360;
mainVideoGalleryBtnContainer.addChild(mainVideoGalleryBtn);
mainMenuContainer.addChild(mainVideoGalleryBtnContainer);
mainVideoGalleryBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, mainVideoGalleryBtnRollOverEvent);
mainVideoGalleryBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, mainVideoGalleryBtnRollOutEvent);
mainVideoGalleryBtnContainer.addEventListener(MouseEvent.MOUSE_UP, mainVideoGalleryBtnMouseUpEvent);
mainMoreGamesBtn = new mainMoreGamesBtnInterface();
mainMoreGamesBtnHoover = new mainMoreGamesBtnHooverInterface();
mainMoreGamesBtnContainer = new Sprite();
mainMoreGamesBtnContainer.x = 210;
mainMoreGamesBtnContainer.y = 430;
mainMoreGamesBtnContainer.addChild(mainMoreGamesBtn);
mainMenuContainer.addChild(mainMoreGamesBtnContainer);
mainMoreGamesBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, mainMoreGamesBtnRollOverEvent);
mainMoreGamesBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, mainMoreGamesBtnRollOutEvent);
mainMoreGamesBtnContainer.addEventListener(MouseEvent.MOUSE_UP, mainMoreGamesBtnMouseUpEvent);
mainHighscoresBtn = new mainHighscoresBtnInterface();
mainHighscoresBtnHoover = new mainHighscoresBtnHooverInterface();
mainHighscoresBtnContainer = new Sprite();
mainHighscoresBtnContainer.x = 350;
mainHighscoresBtnContainer.y = 430;
mainHighscoresBtnContainer.addChild(mainHighscoresBtn);
mainMenuContainer.addChild(mainHighscoresBtnContainer);
mainHighscoresBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, mainHighscoresBtnRollOverEvent);
mainHighscoresBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, mainHighscoresBtnRollOutEvent);
mainHighscoresBtnContainer.addEventListener(MouseEvent.MOUSE_UP, mainHighscoresBtnMouseUpEvent);
levelsStartBtn = new levelsStartBtnInterface();
levelsStartBtnHoover = new levelsStartBtnHooverInterface();
levelsStartBtnContainer = new Sprite();
levelsStartBtnContainer.x = 210;
levelsStartBtnContainer.y = 290;
levelsStartBtnContainer.addChild(levelsStartBtn);
mainMenuContainer.addChild(levelsStartBtnContainer);
levelsStartBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, levelsStartBtnRollOverEvent);
levelsStartBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, levelsStartBtnRollOutEvent);
levelsStartBtnContainer.addEventListener(MouseEvent.MOUSE_UP, levelsStartBtnMouseUpEvent);
levelsSubmitScoreBtn = new levelsSubmitScoreBtnInterface();
levelsSubmitScoreBtnHoover = new levelsSubmitScoreBtnHooverInterface();
levelsSubmitScoreBtnContainer = new Sprite();
levelsSubmitScoreBtnContainer.x = 210;
levelsSubmitScoreBtnContainer.y = 360;
levelsSubmitScoreBtnContainer.addChild(levelsSubmitScoreBtn);
mainMenuContainer.addChild(levelsSubmitScoreBtnContainer);
levelsSubmitScoreBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, levelsSubmitScoreBtnRollOverEvent);
levelsSubmitScoreBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, levelsSubmitScoreBtnRollOutEvent);
levelsSubmitScoreBtnContainer.addEventListener(MouseEvent.MOUSE_UP, levelsSubmitScoreBtnMouseUpEvent);
levelsSubmitVideoBtn = new levelsSubmitVideoBtnInterface();
levelsSubmittedVideoBtn = new levelsSubmittedVideoBtnInterface();
levelsSubmitVideoBtnHoover = new levelsSubmitVideoBtnHooverInterface();
levelsSubmitVideoBtnContainer = new Sprite();
levelsSubmitVideoBtnContainer.x = 210;
levelsSubmitVideoBtnContainer.y = 220;
levelsSubmitVideoBtnContainer.addChild(levelsSubmitVideoBtn);
mainMenuContainer.addChild(levelsSubmitVideoBtnContainer);
levelsSubmitVideoBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, levelsSubmitVideoBtnRollOverEvent);
levelsSubmitVideoBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, levelsSubmitVideoBtnRollOutEvent);
levelsSubmitVideoBtnContainer.addEventListener(MouseEvent.MOUSE_UP, levelsSubmitVideoBtnMouseUpEvent);
levelsMainMenuBtn = new levelsMainMenuBtnInterface();
levelsMainMenuBtnHoover = new levelsMainMenuBtnHooverInterface();
levelsMainMenuBtnContainer = new Sprite();
levelsMainMenuBtnContainer.x = 210;
levelsMainMenuBtnContainer.y = 430;
levelsMainMenuBtnContainer.addChild(levelsMainMenuBtn);
mainMenuContainer.addChild(levelsMainMenuBtnContainer);
levelsMainMenuBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, levelsMainMenuBtnRollOverEvent);
levelsMainMenuBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, levelsMainMenuBtnRollOutEvent);
levelsMainMenuBtnContainer.addEventListener(MouseEvent.MOUSE_UP, levelsMainMenuBtnMouseUpEvent);
levelsMoreGamesBtn = new mainMoreGamesBtnInterface();
levelsMoreGamesBtnHoover = new mainMoreGamesBtnHooverInterface();
levelsMoreGamesBtnContainer = new Sprite();
levelsMoreGamesBtnContainer.x = 350;
levelsMoreGamesBtnContainer.y = 430;
levelsMoreGamesBtnContainer.addChild(levelsMoreGamesBtn);
mainMenuContainer.addChild(levelsMoreGamesBtnContainer);
levelsMoreGamesBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, levelsMoreGamesBtnRollOverEvent);
levelsMoreGamesBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, levelsMoreGamesBtnRollOutEvent);
levelsMoreGamesBtnContainer.addEventListener(MouseEvent.MOUSE_UP, levelsMoreGamesBtnMouseUpEvent);
submitScoreBtnContainer;
submitScoreBtn = new submitScoreBtnInterface();
submitScoreBtnHoover = new submitScoreBtnHooverInterface();
submitScoreBtnContainer = new Sprite();
submitScoreBtnContainer.x = 210;
submitScoreBtnContainer.y = 260;
submitScoreBtnContainer.addChild(submitScoreBtn);
submitScoreBtnContainer.visible = false;
mainMenuContainer.addChild(submitScoreBtnContainer);
submitScoreBtnContainer.addEventListener(MouseEvent.MOUSE_OVER, submitScoreBtnRollOverEvent);
submitScoreBtnContainer.addEventListener(MouseEvent.MOUSE_OUT, submitScoreBtnRollOutEvent);
submitScoreBtnContainer.addEventListener(MouseEvent.MOUSE_UP, submitScoreBtnMouseUpEvent);
mainName = new mainNameInterface();
mainName.y = 5;
mainName.x = 210;
this.addChild(mainName);
points = new TextField();
var _local2:TextFormat = new TextFormat();
_local2.size = 12;
_local2.bold = true;
_local2.font = "Arial";
_local2.color = 0xFFFFFF;
points.defaultTextFormat = _local2;
points.x = 620;
points.y = 0;
points.selectable = false;
points.height = 20;
points.text = "points: 0";
this.addChild(points);
var _local3:TextFormat = new TextFormat();
_local3.size = 16;
_local3.bold = true;
_local3.font = "Arial";
_local3.color = 0x19D700;
statusTargetMet = new TextField();
statusTargetMet.defaultTextFormat = _local3;
statusTargetMet.selectable = false;
statusTargetMet.width = 268;
statusTargetMet.x = 300;
statusTargetMet.y = 20;
statusTargetMet.text = "LEVEL CLEARED";
this.addChild(statusTargetMet);
var _local4:TextFormat = new TextFormat();
_local4.size = 22;
_local4.bold = true;
_local4.font = "Arial";
_local4.color = 0xFFFFFF;
_local4.align = "right";
statusTargetMetGot = new TextField();
statusTargetMetGot.selectable = false;
statusTargetMetGot.defaultTextFormat = _local4;
statusTargetMetGot.width = 80;
statusTargetMetGot.x = 180;
statusTargetMetGot.y = 10;
statusTargetMetGot.text = "15";
this.addChild(statusTargetMetGot);
var _local5:TextFormat = new TextFormat();
_local5.size = 16;
_local5.bold = true;
_local5.font = "Arial";
_local5.color = 0xFFFFFF;
statusTargetMetRequired = new TextField();
statusTargetMetRequired.selectable = false;
statusTargetMetRequired.defaultTextFormat = _local5;
statusTargetMetRequired.width = 50;
statusTargetMetRequired.x = 260;
statusTargetMetRequired.y = 30;
statusTargetMetRequired.text = "10";
this.addChild(statusTargetMetRequired);
var _local6:TextFormat = new TextFormat();
_local6.size = 36;
_local6.bold = false;
_local6.font = "Verdana";
_local6.color = 0x212121;
statusTargetMetSlash = new TextField();
statusTargetMetSlash.selectable = false;
statusTargetMetSlash.defaultTextFormat = _local6;
statusTargetMetSlash.width = 20;
statusTargetMetSlash.x = 250;
statusTargetMetSlash.y = 7;
statusTargetMetSlash.text = "/";
this.addChild(statusTargetMetSlash);
var _local7:TextFormat = new TextFormat();
_local7.size = 36;
_local7.bold = false;
_local7.font = "Verdana";
_local7.color = 0x212121;
modeIntro = new TextField();
modeIntro.selectable = false;
modeIntro.defaultTextFormat = _local7;
modeIntro.width = 268;
modeIntro.x = 210;
modeIntro.y = 7;
modeIntro.text = "EASY";
this.addChild(modeIntro);
var _local8:TextFormat = new TextFormat();
_local8.size = 17;
_local8.bold = false;
_local8.font = "Verdana";
_local8.color = 0xFFFFFF;
modeIntromessage = new TextField();
modeIntromessage.selectable = false;
modeIntromessage.defaultTextFormat = _local8;
modeIntromessage.width = 268;
modeIntromessage.height = 150;
modeIntromessage.multiline = true;
modeIntromessage.wordWrap = true;
modeIntromessage.x = 210;
modeIntromessage.y = 70;
modeIntromessage.text = "In EASY mode you can make combos in three ways: By exploding bubbles in a row of increasing numbers, bubbles in a row of decreasing numbers or bubbles of the same color.";
this.addChild(modeIntromessage);
var _local9:TextFormat = new TextFormat();
_local9.size = 26;
_local9.bold = false;
_local9.font = "Verdana";
_local9.color = 0xFFFFFF;
statusLevel = new TextField();
statusLevel.selectable = false;
statusLevel.defaultTextFormat = _local9;
statusLevel.width = 268;
statusLevel.x = 210;
statusLevel.y = 90;
statusLevel.text = "NEXT LEVEL: 10";
this.addChild(statusLevel);
statusTarget = new TextField();
statusTarget.selectable = false;
statusTarget.defaultTextFormat = _local9;
statusTarget.width = 268;
statusTarget.x = 210;
statusTarget.y = 140;
statusTarget.height = 40;
statusTarget.text = "TARGET: 23";
this.addChild(statusTarget);
var _local10:TextFormat = new TextFormat();
_local10.size = 26;
_local10.bold = false;
_local10.font = "Verdana";
_local10.color = 0;
submitName = new TextField();
submitName.type = TextFieldType.INPUT;
submitName.height = 40;
submitName.background = true;
submitName.backgroundColor = 0xFFFFFF;
submitName.selectable = true;
submitName.defaultTextFormat = _local10;
submitName.width = 268;
submitName.visible = false;
submitName.x = 210;
submitName.y = 190;
submitName.text = "";
this.addChild(submitName);
upgrade1BlueContainer = new Sprite();
upgrade1BlueContainer.y = 210;
upgrade1BlueContainer.x = 210;
upgrade1BlueContainer.visible = false;
this.addChild(upgrade1BlueContainer);
upgrade1Blue = new upgradeBlueBubble();
upgrade1BlueContainer.addChild(upgrade1Blue);
upgrade1BlueContainer.addEventListener(MouseEvent.MOUSE_UP, upgrade1BlueMouseUpEvent);
upgrade1GreenContainer = new Sprite();
upgrade1GreenContainer.y = 210;
upgrade1GreenContainer.x = 280;
upgrade1GreenContainer.visible = false;
this.addChild(upgrade1GreenContainer);
upgrade1Green = new upgradeGreenBubble();
upgrade1GreenContainer.addChild(upgrade1Green);
upgrade1GreenContainer.addEventListener(MouseEvent.MOUSE_UP, upgrade1GreenMouseUpEvent);
upgrade1YellowContainer = new Sprite();
upgrade1YellowContainer.y = 210;
upgrade1YellowContainer.x = 350;
upgrade1YellowContainer.visible = false;
this.addChild(upgrade1YellowContainer);
upgrade1Yellow = new upgradeYellowBubble();
upgrade1YellowContainer.addChild(upgrade1Yellow);
upgrade1YellowContainer.addEventListener(MouseEvent.MOUSE_UP, upgrade1YellowMouseUpEvent);
upgrade1RedContainer = new Sprite();
upgrade1RedContainer.y = 210;
upgrade1RedContainer.x = 420;
upgrade1RedContainer.visible = false;
this.addChild(upgrade1RedContainer);
upgrade1Red = new upgradeRedBubble();
upgrade1RedContainer.addChild(upgrade1Red);
upgrade1RedContainer.addEventListener(MouseEvent.MOUSE_UP, upgrade1RedMouseUpEvent);
upgrade2BlueContainer = new Sprite();
upgrade2BlueContainer.y = 320;
upgrade2BlueContainer.x = 210;
upgrade2BlueContainer.visible = false;
this.addChild(upgrade2BlueContainer);
upgrade2Blue = new upgradeBlueBubble();
upgrade2BlueContainer.addChild(upgrade2Blue);
upgrade2BlueContainer.addEventListener(MouseEvent.MOUSE_UP, upgrade2BlueMouseUpEvent);
upgrade2GreenContainer = new Sprite();
upgrade2GreenContainer.y = 320;
upgrade2GreenContainer.x = 280;
upgrade2GreenContainer.visible = false;
this.addChild(upgrade2GreenContainer);
upgrade2Green = new upgradeGreenBubble();
upgrade2GreenContainer.addChild(upgrade2Green);
upgrade2GreenContainer.addEventListener(MouseEvent.MOUSE_UP, upgrade2GreenMouseUpEvent);
upgrade2YellowContainer = new Sprite();
upgrade2YellowContainer.y = 320;
upgrade2YellowContainer.x = 350;
upgrade2YellowContainer.visible = false;
this.addChild(upgrade2YellowContainer);
upgrade2Yellow = new upgradeYellowBubble();
upgrade2YellowContainer.addChild(upgrade2Yellow);
upgrade2YellowContainer.addEventListener(MouseEvent.MOUSE_UP, upgrade2YellowMouseUpEvent);
upgrade2RedContainer = new Sprite();
upgrade2RedContainer.y = 320;
upgrade2RedContainer.x = 420;
upgrade2RedContainer.visible = false;
this.addChild(upgrade2RedContainer);
upgrade2Red = new upgradeRedBubble();
upgrade2RedContainer.addChild(upgrade2Red);
upgrade2RedContainer.addEventListener(MouseEvent.MOUSE_UP, upgrade2RedMouseUpEvent);
upgrade3BlueContainer = new Sprite();
upgrade3BlueContainer.y = 430;
upgrade3BlueContainer.x = 210;
upgrade3BlueContainer.visible = false;
this.addChild(upgrade3BlueContainer);
upgrade3Blue = new upgradeBlueBubble();
upgrade3BlueContainer.addChild(upgrade3Blue);
upgrade3BlueContainer.addEventListener(MouseEvent.MOUSE_UP, upgrade3BlueMouseUpEvent);
upgrade3GreenContainer = new Sprite();
upgrade3GreenContainer.y = 430;
upgrade3GreenContainer.x = 280;
upgrade3GreenContainer.visible = false;
this.addChild(upgrade3GreenContainer);
upgrade3Green = new upgradeGreenBubble();
upgrade3GreenContainer.addChild(upgrade3Green);
upgrade3GreenContainer.addEventListener(MouseEvent.MOUSE_UP, upgrade3GreenMouseUpEvent);
upgrade3YellowContainer = new Sprite();
upgrade3YellowContainer.y = 430;
upgrade3YellowContainer.x = 350;
upgrade3YellowContainer.visible = false;
this.addChild(upgrade3YellowContainer);
upgrade3Yellow = new upgradeYellowBubble();
upgrade3YellowContainer.addChild(upgrade3Yellow);
upgrade3YellowContainer.addEventListener(MouseEvent.MOUSE_UP, upgrade3YellowMouseUpEvent);
upgrade3RedContainer = new Sprite();
upgrade3RedContainer.y = 430;
upgrade3RedContainer.x = 420;
upgrade3RedContainer.visible = false;
this.addChild(upgrade3RedContainer);
upgrade3Red = new upgradeRedBubble();
upgrade3RedContainer.addChild(upgrade3Red);
upgrade3RedContainer.addEventListener(MouseEvent.MOUSE_UP, upgrade3RedMouseUpEvent);
var _local11:TextFormat = new TextFormat();
_local11.size = 16;
_local11.bold = true;
_local11.font = "Arial";
_local11.color = 16493853;
upgrade1Text = new TextField();
upgrade1Text.selectable = false;
upgrade1Text.defaultTextFormat = _local11;
upgrade1Text.width = 268;
upgrade1Text.height = 20;
upgrade1Text.x = 210;
upgrade1Text.y = 180;
upgrade1Text.text = "LONGER LASTING EXPLOSIONS";
upgrade1Text.visible = false;
this.addChild(upgrade1Text);
upgrade2Text = new TextField();
upgrade2Text.selectable = false;
upgrade2Text.defaultTextFormat = _local11;
upgrade2Text.width = 268;
upgrade2Text.height = 20;
upgrade2Text.x = 210;
upgrade2Text.y = 290;
upgrade2Text.text = "BIGGER EXPLOSIONS";
upgrade2Text.visible = false;
this.addChild(upgrade2Text);
upgrade3Text = new TextField();
upgrade3Text.selectable = false;
upgrade3Text.defaultTextFormat = _local11;
upgrade3Text.width = 268;
upgrade3Text.height = 20;
upgrade3Text.x = 210;
upgrade3Text.y = 400;
upgrade3Text.text = "BUBBLE TELEPORTER";
upgrade3Text.visible = false;
this.addChild(upgrade3Text);
soundBtnContainer = new Sprite();
soundBtnContainer.y = 4;
soundBtnContainer.x = 60;
this.addChild(soundBtnContainer);
soundPlayBtn = new soundPlayInterface();
soundMuteBtn = new soundMuteInterface();
soundBtnContainer.addChild(soundPlayBtn);
soundBtnContainer.addEventListener(MouseEvent.MOUSE_UP, soundBtnMouseUpEvent);
this.hideMenuBetweenLevels();
this.hideModeIntro();
this.showMenuMain();
}
private function mainMoreGamesBtnRollOverEvent(_arg1:MouseEvent):void{
mainMoreGamesBtnContainer.removeChild(mainMoreGamesBtn);
mainMoreGamesBtnContainer.addChild(mainMoreGamesBtnHoover);
}
private function upgrade2GreenMouseUpEvent(_arg1:MouseEvent):void{
if (!gameApp.upgrade2Green){
gameApp.upgrade2Green = true;
gameApp.buildLevel();
this.hideMenuBetweenLevels();
this.hideSelectUpgrade();
upgrade2Green = new upgradeGreyBubble();
upgrade2GreenContainer.addChild(upgrade2Green);
};
}
private function mainHardBtnMouseUpEvent(_arg1:MouseEvent):void{
gameApp.deleteBubbles();
gameApp.mode = 3;
gameApp.level = 1;
gameApp.backGround.colorTransfer = new ColorTransform(1, 1, 1, 0, 1, 1, 1, 1);
gameApp.backGround.createParticles(1);
this.hideMenuMain();
this.showMenuBetweenLevels();
this.showModeIntro(3);
}
private function mainVideoGalleryBtnMouseUpEvent(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://media.freebreakgames.com/numbersreaction-2-video");
navigateToURL(_local2, "_blank");
}
private function mainInsaneBtnMouseUpEvent(_arg1:MouseEvent):void{
gameApp.deleteBubbles();
gameApp.mode = 4;
gameApp.level = 1;
gameApp.backGround.colorTransfer = new ColorTransform(1, 1, 1, 0, 1, 1, 1, 1);
gameApp.backGround.createParticles(1);
this.hideMenuMain();
this.showMenuBetweenLevels();
this.showModeIntro(4);
}
public function showModeIntro(_arg1:int):void{
switch (_arg1){
case 1:
modeIntro.text = "EASY";
modeIntro.textColor = 0x19D700;
modeIntromessage.text = "In EASY mode you can make combos in three ways: By exploding bubbles in a row of increasing numbers, bubbles in a row of decreasing numbers or bubbles of the same color.";
break;
case 2:
modeIntro.text = "NORMAL";
modeIntro.textColor = 0xF5FE00;
modeIntromessage.text = "In NORMAL mode you can make combos in two ways: By exploding bubbles in a row of increasing numbers or exploding bubbles in a row of decreasing numbers.";
break;
case 3:
modeIntro.text = "HARD";
modeIntro.textColor = 0x4E00FF;
modeIntromessage.text = "In HARD mode you can make combos in only one way: By exploding bubbles in a row of increasing numbers.";
break;
case 4:
modeIntro.text = "INSANE";
modeIntro.textColor = 0xFF0000;
modeIntromessage.text = "In INSANE mode you can make no combos at all. Thats why it is called insane. I wish you luck!";
break;
};
modeIntro.visible = true;
modeIntromessage.visible = true;
}
public function showFriendlyMessage():void{
if (friendlyMessage <= 220){
modeIntromessage.text = friendlyMessages[friendlyMessage++];
modeIntromessage.visible = true;
};
}
private function mainHighscoresBtnRollOverEvent(_arg1:MouseEvent):void{
mainHighscoresBtnContainer.removeChild(mainHighscoresBtn);
mainHighscoresBtnContainer.addChild(mainHighscoresBtnHoover);
}
private function levelsStartBtnMouseUpEvent(_arg1:MouseEvent):void{
this.hideMenuBetweenLevels();
if ((((((((((((((((((gameApp.level == 10)) || ((gameApp.level == 20)))) || ((gameApp.level == 30)))) || ((gameApp.level == 40)))) || ((gameApp.level == 50)))) || ((gameApp.level == 60)))) || ((gameApp.level == 70)))) || ((gameApp.level == 80)))) || ((gameApp.level == 90)))){
if (!upgradesUsed[(gameApp.level / 10)]){
upgradesUsed[(gameApp.level / 10)] = true;
this.showSelectUpgrade();
} else {
gameApp.buildLevel();
};
} else {
gameApp.buildLevel();
};
}
private function submitScoreBtnMouseUpEvent(_arg1:MouseEvent):void{
this.hideSubmitHighscore();
MochiScores.setBoardID("adc03c334bcf9ffd");
MochiScores.submit(10, this.submitName.text);
}
private function upgrade3GreenMouseUpEvent(_arg1:MouseEvent):void{
if (!gameApp.upgrade3Green){
gameApp.upgrade3Green = true;
gameApp.buildLevel();
this.hideMenuBetweenLevels();
this.hideSelectUpgrade();
upgrade3Green = new upgradeGreyBubble();
upgrade3GreenContainer.addChild(upgrade3Green);
};
}
public function showSubmitHighscore():void{
this.hideMenuBetweenLevels();
this.modeIntro.text = "ENTER NAME";
this.modeIntro.visible = true;
mainMenuContainer.visible = true;
submitName.visible = true;
submitScoreBtnContainer.visible = true;
}
private function levelsSubmitScoreBtnRollOutEvent(_arg1:MouseEvent):void{
levelsSubmitScoreBtnContainer.removeChild(levelsSubmitScoreBtnHoover);
levelsSubmitScoreBtnContainer.addChild(levelsSubmitScoreBtn);
}
private function mainHighscoresBtnMouseUpEvent(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://media.freebreakgames.com/numbersreaction-2-highscores");
navigateToURL(_local2, "_blank");
}
private function levelsMainMenuBtnMouseUpEvent(_arg1:MouseEvent):void{
gameApp.deleteBubbles();
this.hideMenuBetweenLevels();
this.showMenuMain();
}
private function levelsMainMenuBtnRollOverEvent(_arg1:MouseEvent):void{
levelsMainMenuBtnContainer.removeChild(levelsMainMenuBtn);
levelsMainMenuBtnContainer.addChild(levelsMainMenuBtnHoover);
}
private function menuBtnRollOutEvent(_arg1:MouseEvent):void{
menuBtnContainer.removeChild(menuBtnHoover);
menuBtnContainer.addChild(menuBtn);
}
private function submitScoreBtnRollOverEvent(_arg1:MouseEvent):void{
submitScoreBtnContainer.removeChild(submitScoreBtn);
submitScoreBtnContainer.addChild(submitScoreBtnHoover);
}
private function mainEasyBtnRollOverEvent(_arg1:MouseEvent):void{
mainEasyBtnContainer.removeChild(mainEasyBtn);
mainEasyBtnContainer.addChild(mainEasyBtnHoover);
}
private function menuBtnRollOverEvent(_arg1:MouseEvent):void{
menuBtnContainer.removeChild(menuBtn);
menuBtnContainer.addChild(menuBtnHoover);
}
private function mainNormalBtnMouseUpEvent(_arg1:MouseEvent):void{
gameApp.deleteBubbles();
gameApp.mode = 2;
gameApp.level = 1;
gameApp.backGround.colorTransfer = new ColorTransform(1, 1, 1, 0, 1, 1, 1, 1);
gameApp.backGround.createParticles(1);
this.hideMenuMain();
this.showMenuBetweenLevels();
this.showModeIntro(2);
}
public function hideLevelClearedMessage():void{
statusTargetMetSlash.visible = false;
statusTargetMetRequired.visible = false;
statusTargetMetGot.visible = false;
statusTargetMet.visible = false;
statusTarget.visible = false;
statusLevel.visible = false;
}
private function levelsMoreGamesBtnRollOutEvent(_arg1:MouseEvent):void{
levelsMoreGamesBtnContainer.removeChild(levelsMoreGamesBtnHoover);
levelsMoreGamesBtnContainer.addChild(levelsMoreGamesBtn);
}
private function mainMoreGamesBtnRollOutEvent(_arg1:MouseEvent):void{
mainMoreGamesBtnContainer.removeChild(mainMoreGamesBtnHoover);
mainMoreGamesBtnContainer.addChild(mainMoreGamesBtn);
}
private function upgrade3YellowMouseUpEvent(_arg1:MouseEvent):void{
if (!gameApp.upgrade3Yellow){
gameApp.upgrade3Yellow = true;
gameApp.buildLevel();
this.hideMenuBetweenLevels();
this.hideSelectUpgrade();
upgrade3Yellow = new upgradeGreyBubble();
upgrade3YellowContainer.addChild(upgrade3Yellow);
};
}
private function upgrade3RedMouseUpEvent(_arg1:MouseEvent):void{
if (!gameApp.upgrade3Red){
gameApp.upgrade3Red = true;
gameApp.buildLevel();
this.hideMenuBetweenLevels();
this.hideSelectUpgrade();
upgrade3Red = new upgradeGreyBubble();
upgrade3RedContainer.addChild(upgrade3Red);
};
}
private function levelsSubmitScoreBtnMouseUpEvent(_arg1:MouseEvent):void{
showSubmitHighscores();
this.hideMenuBetweenLevels();
this.hideMenuMain();
}
private function levelsMoreGamesBtnRollOverEvent(_arg1:MouseEvent):void{
levelsMoreGamesBtnContainer.removeChild(levelsMoreGamesBtn);
levelsMoreGamesBtnContainer.addChild(levelsMoreGamesBtnHoover);
}
private function levelsSubmitVideoBtnRollOutEvent(_arg1:MouseEvent):void{
if (levelsSubmitVideoBtnContainer.contains(levelsSubmitVideoBtnHoover)){
levelsSubmitVideoBtnContainer.removeChild(levelsSubmitVideoBtnHoover);
levelsSubmitVideoBtnContainer.addChild(levelsSubmitVideoBtn);
};
}
private function upgrade2RedMouseUpEvent(_arg1:MouseEvent):void{
if (!gameApp.upgrade2Red){
gameApp.upgrade2Red = true;
gameApp.buildLevel();
this.hideMenuBetweenLevels();
this.hideSelectUpgrade();
upgrade2Red = new upgradeGreyBubble();
upgrade2RedContainer.addChild(upgrade2Red);
};
}
public function hideMenuMain():void{
mainMenuContainer.visible = false;
mainEasyBtnContainer.visible = false;
mainNormalBtnContainer.visible = false;
mainHardBtnContainer.visible = false;
mainInsaneBtnContainer.visible = false;
mainVideoGalleryBtnContainer.visible = false;
mainMoreGamesBtnContainer.visible = false;
mainHighscoresBtnContainer.visible = false;
mainName.visible = false;
this.removeChild(jay);
}
public function showMenuBetweenLevels():void{
mainMenuContainer.visible = true;
levelsStartBtnContainer.visible = true;
levelsMainMenuBtnContainer.visible = true;
levelsSubmitScoreBtnContainer.visible = true;
levelsMoreGamesBtnContainer.visible = true;
if (levelsSubmitVideoBtnContainer.contains(levelsSubmittedVideoBtn)){
levelsSubmitVideoBtnContainer.removeChild(levelsSubmittedVideoBtn);
levelsSubmitVideoBtnContainer.addChild(levelsSubmitVideoBtn);
};
}
private function mainHardBtnRollOutEvent(_arg1:MouseEvent):void{
mainHardBtnContainer.removeChild(mainHardBtnHoover);
mainHardBtnContainer.addChild(mainHardBtn);
}
private function upgrade2YellowMouseUpEvent(_arg1:MouseEvent):void{
if (!gameApp.upgrade2Yellow){
gameApp.upgrade2Yellow = true;
gameApp.buildLevel();
this.hideMenuBetweenLevels();
this.hideSelectUpgrade();
upgrade2Yellow = new upgradeGreyBubble();
upgrade2YellowContainer.addChild(upgrade2Yellow);
};
}
private function mainEasyBtnRollOutEvent(_arg1:MouseEvent):void{
mainEasyBtnContainer.removeChild(mainEasyBtnHoover);
mainEasyBtnContainer.addChild(mainEasyBtn);
}
private function upgrade1RedMouseUpEvent(_arg1:MouseEvent):void{
if (!gameApp.upgrade1Red){
gameApp.upgrade1Red = true;
gameApp.buildLevel();
this.hideMenuBetweenLevels();
this.hideSelectUpgrade();
upgrade1Red = new upgradeGreyBubble();
upgrade1RedContainer.addChild(upgrade1Red);
};
}
private function submitScoreBtnRollOutEvent(_arg1:MouseEvent):void{
submitScoreBtnContainer.removeChild(submitScoreBtnHoover);
submitScoreBtnContainer.addChild(submitScoreBtn);
}
private function mainNormalBtnRollOverEvent(_arg1:MouseEvent):void{
mainNormalBtnContainer.removeChild(mainNormalBtn);
mainNormalBtnContainer.addChild(mainNormalBtnHoover);
}
public function showLevelClearedMessage(_arg1:Boolean, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
if (_arg1){
statusTarget.visible = true;
statusLevel.visible = true;
statusLevel.text = ("NEXT LEVEL: " + _arg5);
statusTarget.text = ("TARGET: " + _arg4);
statusTargetMet.text = "LEVEL CLEARED";
statusTargetMet.textColor = 0x19D700;
} else {
statusTargetMet.text = "LEVEL FAILED";
statusTargetMet.textColor = 0xFF0000;
};
statusTargetMetSlash.visible = true;
statusTargetMetRequired.text = _arg2.toString();
statusTargetMetRequired.visible = true;
statusTargetMetGot.text = _arg3.toString();
statusTargetMetGot.visible = true;
statusTargetMet.visible = true;
}
public function hideMenuBetweenLevels():void{
hideLevelClearedMessage();
hideModeIntro();
mainMenuContainer.visible = false;
levelsStartBtnContainer.visible = false;
levelsMainMenuBtnContainer.visible = false;
levelsSubmitScoreBtnContainer.visible = false;
levelsSubmitVideoBtnContainer.visible = false;
levelsMoreGamesBtnContainer.visible = false;
}
private function mainVideoGalleryBtnRollOutEvent(_arg1:MouseEvent):void{
mainVideoGalleryBtnContainer.removeChild(mainVideoGalleryBtnHoover);
mainVideoGalleryBtnContainer.addChild(mainVideoGalleryBtn);
}
private function mainInsaneBtnRollOutEvent(_arg1:MouseEvent):void{
mainInsaneBtnContainer.removeChild(mainInsaneBtnHoover);
mainInsaneBtnContainer.addChild(mainInsaneBtn);
}
public function hideSubmitHighscore():void{
this.showMenuMain();
submitName.visible = false;
submitScoreBtnContainer.visible = false;
}
private function levelsMoreGamesBtnMouseUpEvent(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.freebreakgames.com");
navigateToURL(_local2, "_blank");
}
private function levelsStartBtnRollOutEvent(_arg1:MouseEvent):void{
levelsStartBtnContainer.removeChild(levelsStartBtnHoover);
levelsStartBtnContainer.addChild(levelsStartBtn);
}
private function upgrade1YellowMouseUpEvent(_arg1:MouseEvent):void{
if (!gameApp.upgrade1Yellow){
gameApp.upgrade1Yellow = true;
gameApp.buildLevel();
this.hideMenuBetweenLevels();
this.hideSelectUpgrade();
upgrade1Yellow = new upgradeGreyBubble();
upgrade1YellowContainer.addChild(upgrade1Yellow);
};
}
public function hideModeIntro():void{
modeIntro.visible = false;
modeIntromessage.visible = false;
}
private function menuBtnMouseUpEvent(_arg1:MouseEvent):void{
gameApp.clickUsed = false;
gameApp.deleteBubbles();
gameApp.deleteExplodingBubbles();
this.showMenuBetweenLevels();
this.showLevelClearedMessage(false, ((3 * gameApp.level) + 1), 0, 0, 0);
}
private function levelsStartBtnRollOverEvent(_arg1:MouseEvent):void{
levelsStartBtnContainer.removeChild(levelsStartBtn);
levelsStartBtnContainer.addChild(levelsStartBtnHoover);
}
public function showSelectUpgrade():void{
mainMenuContainer.visible = true;
modeIntro.text = "UPGRADES";
modeIntro.visible = true;
modeIntromessage.text = "Click on a bubble to choose an upgrade to apply to all bubbles of that color.";
modeIntromessage.visible = true;
upgrade1BlueContainer.visible = true;
upgrade1GreenContainer.visible = true;
upgrade1YellowContainer.visible = true;
upgrade1RedContainer.visible = true;
upgrade2BlueContainer.visible = true;
upgrade2GreenContainer.visible = true;
upgrade2YellowContainer.visible = true;
upgrade2RedContainer.visible = true;
upgrade3BlueContainer.visible = true;
upgrade3GreenContainer.visible = true;
upgrade3YellowContainer.visible = true;
upgrade3RedContainer.visible = true;
upgrade1Text.visible = true;
upgrade2Text.visible = true;
upgrade3Text.visible = true;
}
private function mainHighscoresBtnRollOutEvent(_arg1:MouseEvent):void{
mainHighscoresBtnContainer.removeChild(mainHighscoresBtnHoover);
mainHighscoresBtnContainer.addChild(mainHighscoresBtn);
}
private function upgrade3BlueMouseUpEvent(_arg1:MouseEvent):void{
if (!gameApp.upgrade3Blue){
gameApp.upgrade3Blue = true;
gameApp.buildLevel();
this.hideMenuBetweenLevels();
this.hideSelectUpgrade();
upgrade3Blue = new upgradeGreyBubble();
upgrade3BlueContainer.addChild(upgrade3Blue);
};
}
private function mainHardBtnRollOverEvent(_arg1:MouseEvent):void{
mainHardBtnContainer.removeChild(mainHardBtn);
mainHardBtnContainer.addChild(mainHardBtnHoover);
}
private function mainInsaneBtnRollOverEvent(_arg1:MouseEvent):void{
mainInsaneBtnContainer.removeChild(mainInsaneBtn);
mainInsaneBtnContainer.addChild(mainInsaneBtnHoover);
}
private function upgrade1BlueMouseUpEvent(_arg1:MouseEvent):void{
if (!gameApp.upgrade1Blue){
gameApp.upgrade1Blue = true;
gameApp.buildLevel();
this.hideMenuBetweenLevels();
this.hideSelectUpgrade();
upgrade1Blue = new upgradeGreyBubble();
upgrade1BlueContainer.addChild(upgrade1Blue);
};
}
private function upgrade2BlueMouseUpEvent(_arg1:MouseEvent):void{
if (!gameApp.upgrade2Blue){
gameApp.upgrade2Blue = true;
gameApp.buildLevel();
this.hideMenuBetweenLevels();
this.hideSelectUpgrade();
upgrade2Blue = new upgradeGreyBubble();
upgrade2BlueContainer.addChild(upgrade2Blue);
};
}
public function showSubmitHighscores():void{
switch (gameApp.mode){
case 1:
MochiScores.showLeaderboard({boardID:"adc03c334bcf9ffd", score:gameApp.totalPoints, onClose:this.showMenuMain});
break;
case 2:
MochiScores.showLeaderboard({boardID:"8444d74fec49dcf3", score:gameApp.totalPoints, onClose:this.showMenuMain});
break;
case 3:
MochiScores.showLeaderboard({boardID:"f4d35c18c9012a89", score:gameApp.totalPoints, onClose:this.showMenuMain});
break;
case 4:
MochiScores.showLeaderboard({boardID:"9a1334a558f7f77c", score:gameApp.totalPoints, onClose:this.showMenuMain});
break;
};
}
private function levelsSubmitVideoBtnRollOverEvent(_arg1:MouseEvent):void{
if (levelsSubmitVideoBtnContainer.contains(levelsSubmitVideoBtn)){
levelsSubmitVideoBtnContainer.removeChild(levelsSubmitVideoBtn);
levelsSubmitVideoBtnContainer.addChild(levelsSubmitVideoBtnHoover);
};
}
private function mainMoreGamesBtnMouseUpEvent(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.freebreakgames.com");
navigateToURL(_local2, "_blank");
}
public function hideSelectUpgrade():void{
mainMenuContainer.visible = false;
modeIntro.visible = false;
modeIntromessage.visible = false;
upgrade1BlueContainer.visible = false;
upgrade1GreenContainer.visible = false;
upgrade1YellowContainer.visible = false;
upgrade1RedContainer.visible = false;
upgrade2BlueContainer.visible = false;
upgrade2GreenContainer.visible = false;
upgrade2YellowContainer.visible = false;
upgrade2RedContainer.visible = false;
upgrade3BlueContainer.visible = false;
upgrade3GreenContainer.visible = false;
upgrade3YellowContainer.visible = false;
upgrade3RedContainer.visible = false;
upgrade1Text.visible = false;
upgrade2Text.visible = false;
upgrade3Text.visible = false;
}
private function levelsMainMenuBtnRollOutEvent(_arg1:MouseEvent):void{
levelsMainMenuBtnContainer.removeChild(levelsMainMenuBtnHoover);
levelsMainMenuBtnContainer.addChild(levelsMainMenuBtn);
}
private function levelsSubmitScoreBtnRollOverEvent(_arg1:MouseEvent):void{
levelsSubmitScoreBtnContainer.removeChild(levelsSubmitScoreBtn);
levelsSubmitScoreBtnContainer.addChild(levelsSubmitScoreBtnHoover);
}
private function soundBtnMouseUpEvent(_arg1:MouseEvent):void{
if (gameApp.soundEnabled){
soundBtnContainer.removeChild(soundPlayBtn);
soundBtnContainer.addChild(soundMuteBtn);
gameApp.soundEnabled = false;
} else {
soundBtnContainer.removeChild(soundMuteBtn);
soundBtnContainer.addChild(soundPlayBtn);
gameApp.soundEnabled = true;
};
}
public function showMenuMain():void{
this.hideMenuBetweenLevels();
gameApp.totalPoints = 0;
points.text = "points: 0";
mainMenuContainer.visible = true;
mainEasyBtnContainer.visible = true;
mainNormalBtnContainer.visible = true;
mainHardBtnContainer.visible = true;
mainInsaneBtnContainer.visible = true;
mainVideoGalleryBtnContainer.visible = true;
mainMoreGamesBtnContainer.visible = true;
mainHighscoresBtnContainer.visible = true;
mainName.visible = true;
gameApp.upgrade1Blue = false;
gameApp.upgrade1Green = false;
gameApp.upgrade1Yellow = false;
gameApp.upgrade1Red = false;
gameApp.upgrade2Blue = false;
gameApp.upgrade2Green = false;
gameApp.upgrade2Yellow = false;
gameApp.upgrade2Red = false;
gameApp.upgrade3Blue = false;
gameApp.upgrade3Green = false;
gameApp.upgrade3Yellow = false;
gameApp.upgrade3Red = false;
upgrade1Blue = new upgradeBlueBubble();
upgrade1BlueContainer.addChild(upgrade1Blue);
upgrade1Green = new upgradeGreenBubble();
upgrade1GreenContainer.addChild(upgrade1Green);
upgrade1Red = new upgradeRedBubble();
upgrade1RedContainer.addChild(upgrade1Red);
upgrade1Yellow = new upgradeYellowBubble();
upgrade1YellowContainer.addChild(upgrade1Yellow);
upgrade2Blue = new upgradeBlueBubble();
upgrade2BlueContainer.addChild(upgrade2Blue);
upgrade2Green = new upgradeGreenBubble();
upgrade2GreenContainer.addChild(upgrade2Green);
upgrade2Red = new upgradeRedBubble();
upgrade2RedContainer.addChild(upgrade2Red);
upgrade2Yellow = new upgradeYellowBubble();
upgrade2YellowContainer.addChild(upgrade2Yellow);
upgrade3Blue = new upgradeBlueBubble();
upgrade3BlueContainer.addChild(upgrade3Blue);
upgrade3Green = new upgradeGreenBubble();
upgrade3GreenContainer.addChild(upgrade3Green);
upgrade3Red = new upgradeRedBubble();
upgrade3RedContainer.addChild(upgrade3Red);
upgrade3Yellow = new upgradeYellowBubble();
upgrade3YellowContainer.addChild(upgrade3Yellow);
var _local1:int;
while (_local1 < 10) {
upgradesUsed[_local1] = false;
_local1++;
};
this.addChild(jay);
}
private function mainNormalBtnRollOutEvent(_arg1:MouseEvent):void{
mainNormalBtnContainer.removeChild(mainNormalBtnHoover);
mainNormalBtnContainer.addChild(mainNormalBtn);
}
private function upgrade1GreenMouseUpEvent(_arg1:MouseEvent):void{
if (!gameApp.upgrade1Green){
gameApp.upgrade1Green = true;
gameApp.buildLevel();
this.hideMenuBetweenLevels();
this.hideSelectUpgrade();
upgrade1Green = new upgradeGreyBubble();
upgrade1GreenContainer.addChild(upgrade1Green);
};
}
private function levelsSubmitVideoBtnMouseUpEvent(_arg1:MouseEvent):void{
var _local2:URLRequest;
if (levelsSubmitVideoBtnContainer.contains(levelsSubmitVideoBtnHoover)){
gameApp.sendVideo();
levelsSubmitVideoBtnContainer.removeChild(levelsSubmitVideoBtnHoover);
levelsSubmitVideoBtnContainer.addChild(levelsSubmittedVideoBtn);
} else {
_local2 = new URLRequest("http://media.freebreakgames.com/numbersreaction-2-video");
navigateToURL(_local2, "_blank");
};
}
private function mainEasyBtnMouseUpEvent(_arg1:MouseEvent):void{
gameApp.deleteBubbles();
gameApp.mode = 1;
gameApp.level = 1;
gameApp.backGround.colorTransfer = new ColorTransform(1, 1, 1, 0, 1, 1, 1, 1);
gameApp.backGround.createParticles(1);
this.hideMenuMain();
this.showMenuBetweenLevels();
this.showModeIntro(1);
}
private function mainVideoGalleryBtnRollOverEvent(_arg1:MouseEvent):void{
mainVideoGalleryBtnContainer.removeChild(mainVideoGalleryBtn);
mainVideoGalleryBtnContainer.addChild(mainVideoGalleryBtnHoover);
}
}
}//package
Section 26
//InterfaceApplication_JAY (InterfaceApplication_JAY)
package {
import mx.core.*;
import flash.utils.*;
public class InterfaceApplication_JAY extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function InterfaceApplication_JAY(){
dataClass = InterfaceApplication_JAY_dataClass;
super();
initialWidth = (3000 / 20);
initialHeight = (3000 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package
Section 27
//InterfaceApplication_JAY_dataClass (InterfaceApplication_JAY_dataClass)
package {
import mx.core.*;
public class InterfaceApplication_JAY_dataClass extends ByteArrayAsset {
}
}//package
Section 28
//InterfaceApplication_levelsMainMenuBtnHooverInterface (InterfaceApplication_levelsMainMenuBtnHooverInterface)
package {
import mx.core.*;
public class InterfaceApplication_levelsMainMenuBtnHooverInterface extends BitmapAsset {
}
}//package
Section 29
//InterfaceApplication_levelsMainMenuBtnInterface (InterfaceApplication_levelsMainMenuBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_levelsMainMenuBtnInterface extends BitmapAsset {
}
}//package
Section 30
//InterfaceApplication_levelsStartBtnHooverInterface (InterfaceApplication_levelsStartBtnHooverInterface)
package {
import mx.core.*;
public class InterfaceApplication_levelsStartBtnHooverInterface extends BitmapAsset {
}
}//package
Section 31
//InterfaceApplication_levelsStartBtnInterface (InterfaceApplication_levelsStartBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_levelsStartBtnInterface extends BitmapAsset {
}
}//package
Section 32
//InterfaceApplication_levelsSubmitScoreBtnHooverInterface (InterfaceApplication_levelsSubmitScoreBtnHooverInterface)
package {
import mx.core.*;
public class InterfaceApplication_levelsSubmitScoreBtnHooverInterface extends BitmapAsset {
}
}//package
Section 33
//InterfaceApplication_levelsSubmitScoreBtnInterface (InterfaceApplication_levelsSubmitScoreBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_levelsSubmitScoreBtnInterface extends BitmapAsset {
}
}//package
Section 34
//InterfaceApplication_levelsSubmittedVideoBtnInterface (InterfaceApplication_levelsSubmittedVideoBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_levelsSubmittedVideoBtnInterface extends BitmapAsset {
}
}//package
Section 35
//InterfaceApplication_levelsSubmitVideoBtnHooverInterface (InterfaceApplication_levelsSubmitVideoBtnHooverInterface)
package {
import mx.core.*;
public class InterfaceApplication_levelsSubmitVideoBtnHooverInterface extends BitmapAsset {
}
}//package
Section 36
//InterfaceApplication_levelsSubmitVideoBtnInterface (InterfaceApplication_levelsSubmitVideoBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_levelsSubmitVideoBtnInterface extends BitmapAsset {
}
}//package
Section 37
//InterfaceApplication_mainEasyBtnHooverInterface (InterfaceApplication_mainEasyBtnHooverInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainEasyBtnHooverInterface extends BitmapAsset {
}
}//package
Section 38
//InterfaceApplication_mainEasyBtnInterface (InterfaceApplication_mainEasyBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainEasyBtnInterface extends BitmapAsset {
}
}//package
Section 39
//InterfaceApplication_mainHardBtnHooverInterface (InterfaceApplication_mainHardBtnHooverInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainHardBtnHooverInterface extends BitmapAsset {
}
}//package
Section 40
//InterfaceApplication_mainHardBtnInterface (InterfaceApplication_mainHardBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainHardBtnInterface extends BitmapAsset {
}
}//package
Section 41
//InterfaceApplication_mainHighscoresBtnHooverInterface (InterfaceApplication_mainHighscoresBtnHooverInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainHighscoresBtnHooverInterface extends BitmapAsset {
}
}//package
Section 42
//InterfaceApplication_mainHighscoresBtnInterface (InterfaceApplication_mainHighscoresBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainHighscoresBtnInterface extends BitmapAsset {
}
}//package
Section 43
//InterfaceApplication_mainInsaneBtnHooverInterface (InterfaceApplication_mainInsaneBtnHooverInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainInsaneBtnHooverInterface extends BitmapAsset {
}
}//package
Section 44
//InterfaceApplication_mainInsaneBtnInterface (InterfaceApplication_mainInsaneBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainInsaneBtnInterface extends BitmapAsset {
}
}//package
Section 45
//InterfaceApplication_mainMenuBackgroundInterface (InterfaceApplication_mainMenuBackgroundInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainMenuBackgroundInterface extends BitmapAsset {
}
}//package
Section 46
//InterfaceApplication_mainMoreGamesBtnHooverInterface (InterfaceApplication_mainMoreGamesBtnHooverInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainMoreGamesBtnHooverInterface extends BitmapAsset {
}
}//package
Section 47
//InterfaceApplication_mainMoreGamesBtnInterface (InterfaceApplication_mainMoreGamesBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainMoreGamesBtnInterface extends BitmapAsset {
}
}//package
Section 48
//InterfaceApplication_mainNameInterface (InterfaceApplication_mainNameInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainNameInterface extends BitmapAsset {
}
}//package
Section 49
//InterfaceApplication_mainNormalBtnHooverInterface (InterfaceApplication_mainNormalBtnHooverInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainNormalBtnHooverInterface extends BitmapAsset {
}
}//package
Section 50
//InterfaceApplication_mainNormalBtnInterface (InterfaceApplication_mainNormalBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainNormalBtnInterface extends BitmapAsset {
}
}//package
Section 51
//InterfaceApplication_mainVideoGalleryBtnHooverInterface (InterfaceApplication_mainVideoGalleryBtnHooverInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainVideoGalleryBtnHooverInterface extends BitmapAsset {
}
}//package
Section 52
//InterfaceApplication_mainVideoGalleryBtnInterface (InterfaceApplication_mainVideoGalleryBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_mainVideoGalleryBtnInterface extends BitmapAsset {
}
}//package
Section 53
//InterfaceApplication_menuBarInterface (InterfaceApplication_menuBarInterface)
package {
import mx.core.*;
public class InterfaceApplication_menuBarInterface extends BitmapAsset {
}
}//package
Section 54
//InterfaceApplication_menuBtnHooverInterface (InterfaceApplication_menuBtnHooverInterface)
package {
import mx.core.*;
public class InterfaceApplication_menuBtnHooverInterface extends BitmapAsset {
}
}//package
Section 55
//InterfaceApplication_menuBtnInterface (InterfaceApplication_menuBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_menuBtnInterface extends BitmapAsset {
}
}//package
Section 56
//InterfaceApplication_soundMuteInterface (InterfaceApplication_soundMuteInterface)
package {
import mx.core.*;
public class InterfaceApplication_soundMuteInterface extends BitmapAsset {
}
}//package
Section 57
//InterfaceApplication_soundPlayInterface (InterfaceApplication_soundPlayInterface)
package {
import mx.core.*;
public class InterfaceApplication_soundPlayInterface extends BitmapAsset {
}
}//package
Section 58
//InterfaceApplication_submitScoreBtnHooverInterface (InterfaceApplication_submitScoreBtnHooverInterface)
package {
import mx.core.*;
public class InterfaceApplication_submitScoreBtnHooverInterface extends BitmapAsset {
}
}//package
Section 59
//InterfaceApplication_submitScoreBtnInterface (InterfaceApplication_submitScoreBtnInterface)
package {
import mx.core.*;
public class InterfaceApplication_submitScoreBtnInterface extends BitmapAsset {
}
}//package
Section 60
//InterfaceApplication_upgradeBlueBubble (InterfaceApplication_upgradeBlueBubble)
package {
import mx.core.*;
public class InterfaceApplication_upgradeBlueBubble extends BitmapAsset {
}
}//package
Section 61
//InterfaceApplication_upgradeGreenBubble (InterfaceApplication_upgradeGreenBubble)
package {
import mx.core.*;
public class InterfaceApplication_upgradeGreenBubble extends BitmapAsset {
}
}//package
Section 62
//InterfaceApplication_upgradeGreyBubble (InterfaceApplication_upgradeGreyBubble)
package {
import mx.core.*;
public class InterfaceApplication_upgradeGreyBubble extends BitmapAsset {
}
}//package
Section 63
//InterfaceApplication_upgradeRedBubble (InterfaceApplication_upgradeRedBubble)
package {
import mx.core.*;
public class InterfaceApplication_upgradeRedBubble extends BitmapAsset {
}
}//package
Section 64
//InterfaceApplication_upgradeYellowBubble (InterfaceApplication_upgradeYellowBubble)
package {
import mx.core.*;
public class InterfaceApplication_upgradeYellowBubble extends BitmapAsset {
}
}//package
Section 65
//Main (Main)
package {
import flash.display.*;
import mochi.*;
public dynamic class Main extends MovieClip {
private var app2:ParticleApplication;
private var app:NRApplication;
public var interfaceApp:InterfaceApplication;
public function Main(){
MochiServices.connect("f4cad3f46d8615ff", this);
app2 = new ParticleApplication();
addChild(app2);
app = new NRApplication(app2, this);
addChild(app);
interfaceApp = new InterfaceApplication(app);
addChild(interfaceApp);
}
}
}//package
Section 66
//MochiAd (MochiAd)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return ("2.1");
}
public static function showTimedAd(_arg1:Object):void{
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var clip:Object;
var mc:MovieClip;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
var depth:Number = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = 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;
};
var lv:URLVariables = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
_arg1.removeChild(_arg1._mochiad);
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = 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 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
_local3 = true;
};
};
};
if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local6:Array;
var _local3:Object = _arg2.getBounds(_arg2.root);
var _local4:Number = 0;
var _local5:Number = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var mc:MovieClip;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
var DEFAULTS:Object = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
var clip:Object = options.clip;
var clipname:String = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
var server:String = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
var depth:Number = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
var lv:URLVariables = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
_arg1 = parseInt(_arg1.toString());
var _local3:Array = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
var _local4:Array = [];
var _local5:Number = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
var _local6:Object = _local3[1];
var _local7:Object = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local5:Array;
mc._endpoint = _arg1;
var _local2:Array = mc._queue;
delete mc._queue;
var _local3:Function = mc.doSend;
var _local4:Number = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
var _local5:Number = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
var _local6:LocalConnection = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var complete:Boolean;
var unloaded:Boolean;
var r:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = 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);
var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
var bar_color:Number = options.color;
delete options.color;
var bar_background:Number = options.background;
delete options.background;
var bar_outline:Number = options.outline;
delete options.outline;
var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1);
var backing:Object = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2);
var inside:Object = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3);
var outline:Object = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number = (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;
var f:Function = function (_arg1:Event):void{
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local11:Number;
if (!this.parent.parent){
delete this["onEnterFrame"];
return;
};
var _local1:Object = this.parent.parent.root;
var _local2:Object = this.parent._mochiad_ctr;
var _local3:Number = (getTimer() - this.started);
var _local4:Boolean;
var _local5:Number = _local1.loaderInfo.bytesTotal;
var _local6:Number = _local1.loaderInfo.bytesLoaded;
var _local7:Number = ((100 * _local6) / _local5);
var _local8:Number = ((100 * _local3) / chk.ad_msec);
var _local9:Object = this._mochiad_bar._inside;
var _local10:Number = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
_local4 = true;
};
};
};
if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
MochiAd.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
mc.removeEventListener(Event.ENTER_FRAME, f);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 67
//NRApplication (NRApplication)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import com.adobe.serialization.json.*;
import flash.media.*;
import flash.net.*;
public class NRApplication extends Sprite {
public var upgrade2Green:Boolean;
public var upgrade2Blue:Boolean;
private var bubblePngs:Array;
private var blue1:Class;
private var blue2:Class;
private var blue3:Class;
private var blue4:Class;
private var blue5:Class;
private var blue6:Class;
private var blue7:Class;
private var blue8:Class;
private var blue9:Class;
private var bitmap:Bitmap;
public var soundEnabled:Boolean;
private var yellow1:Class;
private var yellow3:Class;
private var yellow4:Class;
private var yellow5:Class;
private var yellow6:Class;
private var yellow7:Class;
private var yellow8:Class;
private var yellow9:Class;
public var totalPoints:int;
public var upgrade2Red:Boolean;
private var beginningTime:Number;
public var explodingBubbles:Array;
private var yellow2:Class;
public var backGround:ParticleApplication;
public var videoGallery:Object;
public var clickUsed:Boolean;
public var bubbles:Array;
public var upgrade1Yellow:Boolean;
public var upgrade1Green:Boolean;
public var upgrade3Red:Boolean;
private var green2:Class;
private var green4:Class;
private var green5:Class;
private var green6:Class;
private var green1:Class;
public var upgrade1Blue:Boolean;
private var green3:Class;
public var upgrade3Blue:Boolean;
private var green7:Class;
private var green8:Class;
private var green9:Class;
public var mode:int;
public var mainApp:Main;
public var upgrade2Yellow:Boolean;
public var upgrade3Green:Boolean;
private var bgChanged:Boolean;
public var level:int;
public var upgrade1Red:Boolean;
private var red1:Class;
private var red2:Class;
private var red3:Class;
private var red4:Class;
private var red5:Class;
private var red6:Class;
private var red7:Class;
private var red8:Class;
private var red9:Class;
private var BubbleSound:Class;
public var colorTransfers:Array;
public var bubbleSound:Sound;
public var upgrade3Yellow:Boolean;
public static const WIDTH:int = 700;
public static const HEIGHT:int = 500;
public function NRApplication(_arg1:ParticleApplication, _arg2:Main){
videoGallery = new Object();
bubblePngs = new Array();
red1 = NRApplication_red1;
red2 = NRApplication_red2;
red3 = NRApplication_red3;
red4 = NRApplication_red4;
red5 = NRApplication_red5;
red6 = NRApplication_red6;
red7 = NRApplication_red7;
red8 = NRApplication_red8;
red9 = NRApplication_red9;
blue1 = NRApplication_blue1;
blue2 = NRApplication_blue2;
blue3 = NRApplication_blue3;
blue4 = NRApplication_blue4;
blue5 = NRApplication_blue5;
blue6 = NRApplication_blue6;
blue7 = NRApplication_blue7;
blue8 = NRApplication_blue8;
blue9 = NRApplication_blue9;
green1 = NRApplication_green1;
green2 = NRApplication_green2;
green3 = NRApplication_green3;
green4 = NRApplication_green4;
green5 = NRApplication_green5;
green6 = NRApplication_green6;
green7 = NRApplication_green7;
green8 = NRApplication_green8;
green9 = NRApplication_green9;
yellow1 = NRApplication_yellow1;
yellow2 = NRApplication_yellow2;
yellow3 = NRApplication_yellow3;
yellow4 = NRApplication_yellow4;
yellow5 = NRApplication_yellow5;
yellow6 = NRApplication_yellow6;
yellow7 = NRApplication_yellow7;
yellow8 = NRApplication_yellow8;
yellow9 = NRApplication_yellow9;
BubbleSound = NRApplication_BubbleSound;
colorTransfers = new Array();
bubbles = new Array();
explodingBubbles = new Array();
super();
soundEnabled = true;
totalPoints = 0;
this.mainApp = _arg2;
mode = 2;
this.backGround = _arg1;
_arg1.colorTransfer = new ColorTransform(1, 1, 1, 0, 1, 1, 1, 1);
colorTransfers.push(new ColorTransform(1, 1.2, 1, 1, 2, 1, -1, -1));
colorTransfers.push(new ColorTransform(1, 1, 1, 1, -1, 1, 1, -1));
colorTransfers.push(new ColorTransform(1, 1, 1, 0, 1, 1, 1, 1));
colorTransfers.push(new ColorTransform(1, 1, 1, 1, -1, 1, -1, -1));
colorTransfers.push(new ColorTransform(1, 1, 1, 0.9, -1, 1, 1, -1));
colorTransfers.push(new ColorTransform(1, 1, 1, 0.99, -1, 1, 1, -1));
colorTransfers.push(new ColorTransform(1, 1, 1, 0.99, -1, 1, -1, -1));
colorTransfers.push(new ColorTransform(1, 1, 1, 0.99, -1, -1, 1, -1));
colorTransfers.push(new ColorTransform(1, 1, 1, 0.99, 1, -1, -1, -1));
colorTransfers.push(new ColorTransform(1, 1, 1, 1, -1, -1, 1, -1));
colorTransfers.push(new ColorTransform(1, 1, 1, 1, -1, 1, -1, -1));
colorTransfers.push(new ColorTransform(1, 1, 1, 1, 1, -1, -1, -1));
colorTransfers.push(new ColorTransform(1, 1, 1, 1, 1, 1, -5, -3));
colorTransfers.push(new ColorTransform(0.8, 0.7, 0.8, 1, 1, 1, 1, -1));
colorTransfers.push(new ColorTransform(0.9, 0.4, 0.7, 1, 1, 1, 1, -1));
colorTransfers.push(new ColorTransform(0.9, 0.4, 0.7, 1, 1, 100, 1, -1));
colorTransfers.push(new ColorTransform(0.9, 0.4, 0.7, 1, -1, 100, 50, -1));
init();
}
private function onMouseClick(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:int;
var _local4:int;
var _local5:Number;
if (((!(clickUsed)) && ((bubbles.length > 0)))){
_local2 = 1000;
_local3 = 0;
_local4 = 0;
while (_local4 < bubbles.length) {
_local5 = Point.distance(new Point(bubbles[_local4].x, bubbles[_local4].y), new Point(_arg1.stageX, _arg1.stageY));
if (_local5 < _local2){
_local2 = _local5;
_local3 = _local4;
};
_local4++;
};
bubbles[_local3].explode(1);
bubbles[_local3].starter = true;
this.recordVideo();
this.beginningTime = getTimer();
explodingBubbles.push(bubbles.splice(_local3, 1)[0]);
clickUsed = true;
};
}
public function removeBubble(_arg1:Bubble):void{
var _local2:String;
for (_local2 in explodingBubbles) {
if (explodingBubbles[_local2] == _arg1){
explodingBubbles.splice(_local2, 1);
break;
};
};
}
private function init():void{
bubblePngs.push(red1);
bubblePngs.push(red2);
bubblePngs.push(red3);
bubblePngs.push(red4);
bubblePngs.push(red5);
bubblePngs.push(red6);
bubblePngs.push(red7);
bubblePngs.push(red8);
bubblePngs.push(red9);
bubblePngs.push(blue1);
bubblePngs.push(blue2);
bubblePngs.push(blue3);
bubblePngs.push(blue4);
bubblePngs.push(blue5);
bubblePngs.push(blue6);
bubblePngs.push(blue7);
bubblePngs.push(blue8);
bubblePngs.push(blue9);
bubblePngs.push(green1);
bubblePngs.push(green2);
bubblePngs.push(green3);
bubblePngs.push(green4);
bubblePngs.push(green5);
bubblePngs.push(green6);
bubblePngs.push(green7);
bubblePngs.push(green8);
bubblePngs.push(green9);
bubblePngs.push(yellow1);
bubblePngs.push(yellow2);
bubblePngs.push(yellow3);
bubblePngs.push(yellow4);
bubblePngs.push(yellow5);
bubblePngs.push(yellow6);
bubblePngs.push(yellow7);
bubblePngs.push(yellow8);
bubblePngs.push(yellow9);
createBubbles(100, 0.1);
bgChanged = false;
clickUsed = false;
level = 1;
bitmap = new Bitmap(new BitmapData(WIDTH, HEIGHT, true, 0), PixelSnapping.AUTO, false);
addChild(bitmap);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
this.addEventListener(MouseEvent.MOUSE_UP, onMouseClick);
}
public function checkScore():void{
var _local1:* = bubbles.length;
var _local2:int = ((6 + returnLevelTarget(level)) - _local1);
deleteBubbles();
if (_local2 > returnLevelTarget(level)){
trace(_local1);
if (_local1 <= 0){
this.mainApp.interfaceApp.levelsSubmitVideoBtnContainer.visible = true;
};
totalPoints = (totalPoints + _local2);
mainApp.interfaceApp.points.text = ("points: " + totalPoints);
backGround.createParticles((level + 1));
if (level < 50){
mainApp.interfaceApp.showLevelClearedMessage(true, (returnLevelTarget(level) + 1), _local2, (returnLevelTarget((level + 1)) + 1), (level + 1));
mainApp.interfaceApp.showMenuBetweenLevels();
} else {
mainApp.interfaceApp.showSubmitHighscores();
};
level++;
} else {
mainApp.interfaceApp.showLevelClearedMessage(false, ((3 * level) + 1), _local2, 0, 0);
mainApp.interfaceApp.showMenuBetweenLevels();
mainApp.interfaceApp.showFriendlyMessage();
};
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
clickUsed = false;
}
public function deleteBubbles(){
while (bubbles.length >= 1) {
bubbles.pop().deleteBubble();
};
}
private function render():void{
var _local2:int;
var _local3:int;
var _local4:*;
var _local5:ColorTransform;
var _local1:int;
while (_local1 < explodingBubbles.length) {
_local2 = 0;
while (_local2 < bubbles.length) {
if (Point.distance(new Point(bubbles[_local2].x, bubbles[_local2].y), new Point(explodingBubbles[_local1].x, explodingBubbles[_local1].y)) < ((bubbles[_local2].width / 2) + (explodingBubbles[_local1].width / 2))){
if (soundEnabled){
_local4 = new BubbleSound();
_local4.play();
};
_local3 = explodingBubbles[_local1].combo;
switch (mode){
case 1:
if ((((((bubbles[_local2].number == (explodingBubbles[_local1].number + 1))) || ((bubbles[_local2].color == explodingBubbles[_local1].color)))) || ((bubbles[_local2].number == (explodingBubbles[_local1].number - 1))))){
_local3++;
} else {
_local3 = 1;
};
break;
case 2:
if ((((bubbles[_local2].number == (explodingBubbles[_local1].number + 1))) || ((bubbles[_local2].number == (explodingBubbles[_local1].number - 1))))){
_local3++;
} else {
_local3 = 1;
};
break;
case 3:
if (bubbles[_local2].number == (explodingBubbles[_local1].number + 1)){
_local3++;
} else {
_local3 = 1;
};
break;
case 4:
_local3 = 1;
break;
};
bubbles[_local2].videoTime = (getTimer() - this.beginningTime);
bubbles[_local2].explode(_local3);
explodingBubbles.push(bubbles.splice(_local2, 1)[0]);
if ((((((6 + (3 * level)) - bubbles.length) > (3 * level))) && (!(bgChanged)))){
bgChanged = true;
_local5 = backGround.colorTransfer;
while (_local5 == backGround.colorTransfer) {
_local5 = colorTransfers[Math.floor((Math.random() * colorTransfers.length))];
};
backGround.colorTransfer = _local5;
backGround.explosionEffect = 4;
};
};
_local2++;
};
_local1++;
};
}
private function onEnterFrame(_arg1:Event):void{
render();
if (((clickUsed) && ((explodingBubbles.length == 0)))){
trace("Game Over");
checkScore();
};
}
public function buildLevel(){
if (level < 25){
createBubbles((6 + (3 * level)), (0.6 - (0.015 * level)));
} else {
createBubbles((6 + (3 * level)), ((0.6 - (0.015 * 24)) - (0.004 * (level - 24))));
};
addEventListener(Event.ENTER_FRAME, onEnterFrame);
bgChanged = false;
}
public function recordVideo(){
var _local2:Bubble;
var _local3:Object;
trace("JSON___");
var _local1:Array = new Array();
for each (_local2 in bubbles) {
_local3 = new Object();
_local3.c = _local2.color;
_local3.n = _local2.number;
_local3.x = _local2.x;
_local3.y = _local2.y;
_local3.dx = _local2.speedX;
_local3.dy = _local2.speedY;
_local3.st = _local2.starter;
_local1.push(_local3);
};
videoGallery.bubbles = _local1;
videoGallery.level = this.level;
videoGallery.mode = this.mode;
videoGallery.u1 = upgrade1Blue;
videoGallery.u2 = upgrade1Green;
videoGallery.u3 = upgrade1Yellow;
videoGallery.u4 = upgrade1Red;
videoGallery.u5 = upgrade2Blue;
videoGallery.u6 = upgrade2Green;
videoGallery.u7 = upgrade2Yellow;
videoGallery.u8 = upgrade2Red;
videoGallery.u9 = upgrade3Blue;
videoGallery.u10 = upgrade3Green;
videoGallery.u11 = upgrade3Yellow;
videoGallery.u12 = upgrade3Red;
trace(JSON.encode(videoGallery));
}
private function createBubbles(_arg1:int, _arg2:Number):void{
var _local4:int;
var _local5:Boolean;
var _local6:Boolean;
var _local7:Boolean;
var _local8:int;
var _local9:Bubble;
var _local3:int;
while (_local3 < _arg1) {
_local4 = (Math.floor((Math.random() * 4)) + 1);
_local5 = false;
_local6 = false;
_local7 = false;
switch (_local4){
case 1:
if (upgrade1Red){
_local5 = true;
};
if (upgrade2Red){
_local6 = true;
};
if (upgrade3Red){
_local7 = true;
};
break;
case 2:
if (upgrade1Blue){
_local5 = true;
};
if (upgrade2Blue){
_local6 = true;
};
if (upgrade3Blue){
_local7 = true;
};
break;
case 3:
if (upgrade1Green){
_local5 = true;
};
if (upgrade2Green){
_local6 = true;
};
if (upgrade3Green){
_local7 = true;
};
break;
case 4:
if (upgrade1Yellow){
_local5 = true;
};
if (upgrade2Yellow){
_local6 = true;
};
if (upgrade3Yellow){
_local7 = true;
};
break;
};
_local8 = (Math.floor((Math.random() * 9)) + 1);
_local9 = new Bubble(new (bubblePngs[((((_local4 - 1) * 9) + _local8) - 1)]), _arg2, _local8, _local4, _local5, _local6, _local7);
bubbles.push(_local9);
addChild(_local9);
_local3++;
};
}
public function sendVideo():void{
trace("sending..");
var url = "http://freebreakgames.com/VideoGalleryPost.php";
var request:URLRequest = new URLRequest(url);
var variables:URLVariables = new URLVariables();
variables.mode = videoGallery.mode;
variables.level = videoGallery.level;
variables.video = JSON.encode(videoGallery);
request.data = variables;
request.method = URLRequestMethod.POST;
try {
sendToURL(request);
} catch(e:Error) {
trace(e.message);
};
}
public function returnLevelTarget(_arg1:int){
return ((3 * _arg1));
}
public function deleteExplodingBubbles(){
while (explodingBubbles.length >= 1) {
explodingBubbles.pop().deleteBubble();
};
}
}
}//package
Section 68
//NRApplication_blue1 (NRApplication_blue1)
package {
import mx.core.*;
public class NRApplication_blue1 extends BitmapAsset {
}
}//package
Section 69
//NRApplication_blue2 (NRApplication_blue2)
package {
import mx.core.*;
public class NRApplication_blue2 extends BitmapAsset {
}
}//package
Section 70
//NRApplication_blue3 (NRApplication_blue3)
package {
import mx.core.*;
public class NRApplication_blue3 extends BitmapAsset {
}
}//package
Section 71
//NRApplication_blue4 (NRApplication_blue4)
package {
import mx.core.*;
public class NRApplication_blue4 extends BitmapAsset {
}
}//package
Section 72
//NRApplication_blue5 (NRApplication_blue5)
package {
import mx.core.*;
public class NRApplication_blue5 extends BitmapAsset {
}
}//package
Section 73
//NRApplication_blue6 (NRApplication_blue6)
package {
import mx.core.*;
public class NRApplication_blue6 extends BitmapAsset {
}
}//package
Section 74
//NRApplication_blue7 (NRApplication_blue7)
package {
import mx.core.*;
public class NRApplication_blue7 extends BitmapAsset {
}
}//package
Section 75
//NRApplication_blue8 (NRApplication_blue8)
package {
import mx.core.*;
public class NRApplication_blue8 extends BitmapAsset {
}
}//package
Section 76
//NRApplication_blue9 (NRApplication_blue9)
package {
import mx.core.*;
public class NRApplication_blue9 extends BitmapAsset {
}
}//package
Section 77
//NRApplication_BubbleSound (NRApplication_BubbleSound)
package {
import mx.core.*;
public class NRApplication_BubbleSound extends SoundAsset {
}
}//package
Section 78
//NRApplication_green1 (NRApplication_green1)
package {
import mx.core.*;
public class NRApplication_green1 extends BitmapAsset {
}
}//package
Section 79
//NRApplication_green2 (NRApplication_green2)
package {
import mx.core.*;
public class NRApplication_green2 extends BitmapAsset {
}
}//package
Section 80
//NRApplication_green3 (NRApplication_green3)
package {
import mx.core.*;
public class NRApplication_green3 extends BitmapAsset {
}
}//package
Section 81
//NRApplication_green4 (NRApplication_green4)
package {
import mx.core.*;
public class NRApplication_green4 extends BitmapAsset {
}
}//package
Section 82
//NRApplication_green5 (NRApplication_green5)
package {
import mx.core.*;
public class NRApplication_green5 extends BitmapAsset {
}
}//package
Section 83
//NRApplication_green6 (NRApplication_green6)
package {
import mx.core.*;
public class NRApplication_green6 extends BitmapAsset {
}
}//package
Section 84
//NRApplication_green7 (NRApplication_green7)
package {
import mx.core.*;
public class NRApplication_green7 extends BitmapAsset {
}
}//package
Section 85
//NRApplication_green8 (NRApplication_green8)
package {
import mx.core.*;
public class NRApplication_green8 extends BitmapAsset {
}
}//package
Section 86
//NRApplication_green9 (NRApplication_green9)
package {
import mx.core.*;
public class NRApplication_green9 extends BitmapAsset {
}
}//package
Section 87
//NRApplication_red1 (NRApplication_red1)
package {
import mx.core.*;
public class NRApplication_red1 extends BitmapAsset {
}
}//package
Section 88
//NRApplication_red2 (NRApplication_red2)
package {
import mx.core.*;
public class NRApplication_red2 extends BitmapAsset {
}
}//package
Section 89
//NRApplication_red3 (NRApplication_red3)
package {
import mx.core.*;
public class NRApplication_red3 extends BitmapAsset {
}
}//package
Section 90
//NRApplication_red4 (NRApplication_red4)
package {
import mx.core.*;
public class NRApplication_red4 extends BitmapAsset {
}
}//package
Section 91
//NRApplication_red5 (NRApplication_red5)
package {
import mx.core.*;
public class NRApplication_red5 extends BitmapAsset {
}
}//package
Section 92
//NRApplication_red6 (NRApplication_red6)
package {
import mx.core.*;
public class NRApplication_red6 extends BitmapAsset {
}
}//package
Section 93
//NRApplication_red7 (NRApplication_red7)
package {
import mx.core.*;
public class NRApplication_red7 extends BitmapAsset {
}
}//package
Section 94
//NRApplication_red8 (NRApplication_red8)
package {
import mx.core.*;
public class NRApplication_red8 extends BitmapAsset {
}
}//package
Section 95
//NRApplication_red9 (NRApplication_red9)
package {
import mx.core.*;
public class NRApplication_red9 extends BitmapAsset {
}
}//package
Section 96
//NRApplication_yellow1 (NRApplication_yellow1)
package {
import mx.core.*;
public class NRApplication_yellow1 extends BitmapAsset {
}
}//package
Section 97
//NRApplication_yellow2 (NRApplication_yellow2)
package {
import mx.core.*;
public class NRApplication_yellow2 extends BitmapAsset {
}
}//package
Section 98
//NRApplication_yellow3 (NRApplication_yellow3)
package {
import mx.core.*;
public class NRApplication_yellow3 extends BitmapAsset {
}
}//package
Section 99
//NRApplication_yellow4 (NRApplication_yellow4)
package {
import mx.core.*;
public class NRApplication_yellow4 extends BitmapAsset {
}
}//package
Section 100
//NRApplication_yellow5 (NRApplication_yellow5)
package {
import mx.core.*;
public class NRApplication_yellow5 extends BitmapAsset {
}
}//package
Section 101
//NRApplication_yellow6 (NRApplication_yellow6)
package {
import mx.core.*;
public class NRApplication_yellow6 extends BitmapAsset {
}
}//package
Section 102
//NRApplication_yellow7 (NRApplication_yellow7)
package {
import mx.core.*;
public class NRApplication_yellow7 extends BitmapAsset {
}
}//package
Section 103
//NRApplication_yellow8 (NRApplication_yellow8)
package {
import mx.core.*;
public class NRApplication_yellow8 extends BitmapAsset {
}
}//package
Section 104
//NRApplication_yellow9 (NRApplication_yellow9)
package {
import mx.core.*;
public class NRApplication_yellow9 extends BitmapAsset {
}
}//package
Section 105
//Particle (Particle)
package {
public class Particle {
public var vx:Number;
public var vy:Number;
public var sx:Number;
public var sy:Number;
public function Particle(_arg1:Number=0, _arg2:Number=0){
this.sx = _arg1;
this.sy = _arg2;
}
}
}//package
Section 106
//ParticleApplication (ParticleApplication)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class ParticleApplication extends Sprite {
private var sinkeTal:int;
public var explosionEffect:Number;
private var forceYPhase:Number;
public var colorTransfer:ColorTransform;
private var bitmap:Bitmap;
private var particles:Array;
private var forceXPhase:Number;
public static const WIDTH:int = 700;
public static const HEIGHT:int = 500;
public static const PARTICLE_NUM:int = 1;
public function ParticleApplication(){
init();
}
private function init():void{
sinkeTal = 0;
explosionEffect = 2;
var _local1:Matrix = new Matrix();
_local1.createGradientBox(WIDTH, HEIGHT, (Math.PI / 2));
graphics.beginGradientFill(GradientType.LINEAR, [0x212121, 0x404040, 0], [1, 1, 1], [0, 132, 0xFF], _local1);
graphics.drawRect(0, 0, WIDTH, HEIGHT);
graphics.endFill();
forceXPhase = (Math.random() * Math.PI);
forceYPhase = (Math.random() * Math.PI);
particles = new Array();
createParticles(PARTICLE_NUM);
bitmap = new Bitmap(new BitmapData(WIDTH, HEIGHT, true, 0), PixelSnapping.AUTO, false);
addChild(bitmap);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function createParticles(_arg1:int):void{
var _local2:Particle;
var _local3:Number;
var _local4:Number;
while (particles.length > 0) {
particles.pop();
};
var _local5:int;
while (_local5 < _arg1) {
_local3 = (((Math.PI * 2) / _arg1) * _local5);
_local4 = ((1 + ((_local5 / _arg1) * 4)) * 1);
_local2 = new Particle((Math.cos(_local3) * 32), (Math.sin(_local3) * 32));
_local2.vx = (Math.sin(-(_local3)) * _local4);
_local2.vy = (-(Math.cos(_local3)) * _local4);
particles.push(_local2);
_local5++;
};
}
private function render():void{
var _local2:Particle;
var _local3:Particle;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local1:BitmapData = bitmap.bitmapData;
_local1.colorTransform(_local1.rect, colorTransfer);
var _local7:Shape = new Shape();
_local7.graphics.clear();
_local7.graphics.lineStyle(10, 0xFFFFFF, 1);
forceXPhase = (forceXPhase + 0.0085261);
forceYPhase = (forceYPhase + 0.000621);
var _local8:Number = (1000 + (((Math.sin(forceXPhase) * 500) * Math.sin(forceYPhase)) * Math.cos(forceXPhase)));
var _local9:Number = (1000 + (Math.sin(forceYPhase) * 500));
for each (_local2 in particles) {
_local7.graphics.moveTo(_local2.sx, _local2.sy);
_local2.vx = (_local2.vx - (_local2.sx / _local8));
_local2.vy = (_local2.vy - (_local2.sy / _local9));
_local2.sx = (_local2.sx + (_local2.vx * explosionEffect));
_local2.sy = (_local2.sy + (_local2.vy * explosionEffect));
_local7.graphics.lineTo(_local2.sx, _local2.sy);
};
if (explosionEffect > 1){
explosionEffect = (explosionEffect - 0.02);
};
_local1.draw(_local7, new Matrix(1, 0, Math.sin(forceYPhase), Math.cos(forceXPhase), (WIDTH >> 1), (HEIGHT >> 1)));
}
private function onEnterFrame(_arg1:Event):void{
if (sinkeTal++ > 1){
sinkeTal = 0;
render();
};
}
}
}//package
Section 107
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public dynamic class Preloader extends MovieClip {
private var did_load:Boolean;
public static var GAME_OPTIONS:Object = {id:"f4cad3f46d8615ff", res:"700x500"};
public static var MAIN_CLASS:String = "Main";
public function Preloader(){
var k:String;
super();
var f:Function = function (_arg1:IOErrorEvent):void{
};
loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
var opts:Object = {};
for (k in GAME_OPTIONS) {
opts[k] = GAME_OPTIONS[k];
};
opts.ad_started = function ():void{
did_load = true;
};
opts.ad_finished = function ():void{
var _local1:Class = Class(getDefinitionByName(MAIN_CLASS));
var _local2:Object = new (_local1);
parent.addChild((_local2 as DisplayObject));
if (_local2.Main){
_local2.Main(did_load);
};
};
opts.clip = this;
MochiAd.showPreGameAd(opts);
}
}
}//package