Section 1
//MD5 (com.adobe.crypto.MD5)
package com.adobe.crypto {
import flash.utils.*;
import com.adobe.utils.*;
public class MD5 {
public static var digest:ByteArray;
public static function hash(_arg1:String):String{
var _local2:ByteArray = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (hashBinary(_local2));
}
public static function hashBytes(_arg1:ByteArray):String{
return (hashBinary(_arg1));
}
public static function hashBinary(_arg1:ByteArray):String{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local2 = 1732584193;
var _local3 = -271733879;
var _local4 = -1732584194;
var _local5 = 271733878;
var _local10:Array = createBlocks(_arg1);
var _local11:int = _local10.length;
var _local12:int;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
digest = new ByteArray();
digest.writeInt(_local2);
digest.writeInt(_local3);
digest.writeInt(_local4);
digest.writeInt(_local5);
digest.position = 0;
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private static function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private static function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function createBlocks(_arg1:ByteArray):Array{
var _local2:Array = new Array();
var _local3:int = (_arg1.length * 8);
var _local4 = 0xFF;
var _local5:int;
while (_local5 < _local3) {
_local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((_arg1[(_local5 / 8)] & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32)));
_local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3;
return (_local2);
}
}
}//package com.adobe.crypto
Section 2
//PNGEncoder (com.adobe.images.PNGEncoder)
package com.adobe.images {
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class PNGEncoder {
private static var crcTable:Array;
private static var crcTableComputed:Boolean = false;
public static function encode(_arg1:BitmapData):ByteArray{
var _local6:uint;
var _local7:int;
var _local2:ByteArray = new ByteArray();
_local2.writeUnsignedInt(2303741511);
_local2.writeUnsignedInt(218765834);
var _local3:ByteArray = new ByteArray();
_local3.writeInt(_arg1.width);
_local3.writeInt(_arg1.height);
_local3.writeUnsignedInt(134610944);
_local3.writeByte(0);
writeChunk(_local2, 1229472850, _local3);
var _local4:ByteArray = new ByteArray();
var _local5:int;
while (_local5 < _arg1.height) {
_local4.writeByte(0);
if (!_arg1.transparent){
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | 0xFF)));
_local7++;
};
} else {
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel32(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | (_local6 >>> 24))));
_local7++;
};
};
_local5++;
};
_local4.compress();
writeChunk(_local2, 1229209940, _local4);
writeChunk(_local2, 1229278788, null);
return (_local2);
}
private static function writeChunk(_arg1:ByteArray, _arg2:uint, _arg3:ByteArray):void{
var _local8:uint;
var _local9:uint;
var _local10:uint;
if (!crcTableComputed){
crcTableComputed = true;
crcTable = [];
_local9 = 0;
while (_local9 < 0x0100) {
_local8 = _local9;
_local10 = 0;
while (_local10 < 8) {
if ((_local8 & 1)){
_local8 = uint((uint(3988292384) ^ uint((_local8 >>> 1))));
} else {
_local8 = uint((_local8 >>> 1));
};
_local10++;
};
crcTable[_local9] = _local8;
_local9++;
};
};
var _local4:uint;
if (_arg3 != null){
_local4 = _arg3.length;
};
_arg1.writeUnsignedInt(_local4);
var _local5:uint = _arg1.position;
_arg1.writeUnsignedInt(_arg2);
if (_arg3 != null){
_arg1.writeBytes(_arg3);
};
var _local6:uint = _arg1.position;
_arg1.position = _local5;
_local8 = 4294967295;
var _local7:int;
while (_local7 < (_local6 - _local5)) {
_local8 = uint((crcTable[((_local8 ^ _arg1.readUnsignedByte()) & uint(0xFF))] ^ uint((_local8 >>> 8))));
_local7++;
};
_local8 = uint((_local8 ^ uint(4294967295)));
_arg1.position = _local6;
_arg1.writeUnsignedInt(_local8);
}
}
}//package com.adobe.images
Section 3
//JSON (com.adobe.serialization.json.JSON)
package com.adobe.serialization.json {
public class JSON {
public static function encode(_arg1:Object):String{
var _local2:JSONEncoder = new JSONEncoder(_arg1);
return (_local2.getString());
}
public static function decode(_arg1:String){
var _local2:JSONDecoder = new JSONDecoder(_arg1);
return (_local2.getValue());
}
}
}//package com.adobe.serialization.json
Section 4
//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){
this.tokenizer = new JSONTokenizer(_arg1);
this.nextToken();
this.value = this.parseValue();
}
public function getValue(){
return (this.value);
}
private function nextToken():JSONToken{
return ((this.token = this.tokenizer.getNextToken()));
}
private function parseArray():Array{
var _local1:Array = new Array();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
while (true) {
_local1.push(this.parseValue());
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
if (this.token.type == JSONTokenType.COMMA){
this.nextToken();
} else {
this.tokenizer.parseError(("Expecting ] or , but found " + this.token.value));
};
};
return (null);
}
private function parseObject():Object{
var _local2:String;
var _local1:Object = new Object();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
while (true) {
if (this.token.type == JSONTokenType.STRING){
_local2 = String(this.token.value);
this.nextToken();
if (this.token.type == JSONTokenType.COLON){
this.nextToken();
_local1[_local2] = this.parseValue();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
if (this.token.type == JSONTokenType.COMMA){
this.nextToken();
} else {
this.tokenizer.parseError(("Expecting } or , but found " + this.token.value));
};
} else {
this.tokenizer.parseError(("Expecting : but found " + this.token.value));
};
} else {
this.tokenizer.parseError(("Expecting string but found " + this.token.value));
};
};
return (null);
}
private function parseValue():Object{
if (this.token == null){
this.tokenizer.parseError("Unexpected end of input");
};
switch (this.token.type){
case JSONTokenType.LEFT_BRACE:
return (this.parseObject());
case JSONTokenType.LEFT_BRACKET:
return (this.parseArray());
case JSONTokenType.STRING:
case JSONTokenType.NUMBER:
case JSONTokenType.TRUE:
case JSONTokenType.FALSE:
case JSONTokenType.NULL:
return (this.token.value);
default:
this.tokenizer.parseError(("Unexpected " + this.token.value));
};
return (null);
}
}
}//package com.adobe.serialization.json
Section 5
//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){
this.jsonString = this.convertToString(_arg1);
}
public function getString():String{
return (this.jsonString);
}
private function convertToString(_arg1):String{
if ((_arg1 is String)){
return (this.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 (this.arrayToString((_arg1 as Array)));
};
if ((((_arg1 is Object)) && (!((_arg1 == null))))){
return (this.objectToString(_arg1));
};
};
};
return ("null");
}
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 + this.convertToString(_arg1[_local3]));
_local3++;
};
return ((("[" + _local2) + "]"));
}
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 + ((this.escapeString(key) + ":") + this.convertToString(value)));
};
};
} else {
for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((this.escapeString(v.@name.toString()) + ":") + this.convertToString(o[v.@name])));
};
};
return ((("{" + s) + "}"));
}
}
}//package com.adobe.serialization.json
Section 6
//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);
name = "JSONParseError";
this._location = _arg2;
this._text = _arg3;
}
public function get location():int{
return (this._location);
}
public function get text():String{
return (this._text);
}
}
}//package com.adobe.serialization.json
Section 7
//JSONToken (com.adobe.serialization.json.JSONToken)
package com.adobe.serialization.json {
public class JSONToken {
private var _type:int;
private var _value:Object;
public function JSONToken(_arg1:int=-1, _arg2:Object=null){
this._type = _arg1;
this._value = _arg2;
}
public function get type():int{
return (this._type);
}
public function set type(_arg1:int):void{
this._type = _arg1;
}
public function get value():Object{
return (this._value);
}
public function set value(_arg1:Object):void{
this._value = _arg1;
}
}
}//package com.adobe.serialization.json
Section 8
//JSONTokenizer (com.adobe.serialization.json.JSONTokenizer)
package com.adobe.serialization.json {
public class JSONTokenizer {
private var obj:Object;
private var jsonString:String;
private var loc:int;
private var ch:String;
public function JSONTokenizer(_arg1:String){
this.jsonString = _arg1;
this.loc = 0;
this.nextChar();
}
public function getNextToken():JSONToken{
var _local2:String;
var _local3:String;
var _local4:String;
var _local1:JSONToken = new JSONToken();
this.skipIgnored();
switch (this.ch){
case "{":
_local1.type = JSONTokenType.LEFT_BRACE;
_local1.value = "{";
this.nextChar();
break;
case "}":
_local1.type = JSONTokenType.RIGHT_BRACE;
_local1.value = "}";
this.nextChar();
break;
case "[":
_local1.type = JSONTokenType.LEFT_BRACKET;
_local1.value = "[";
this.nextChar();
break;
case "]":
_local1.type = JSONTokenType.RIGHT_BRACKET;
_local1.value = "]";
this.nextChar();
break;
case ",":
_local1.type = JSONTokenType.COMMA;
_local1.value = ",";
this.nextChar();
break;
case ":":
_local1.type = JSONTokenType.COLON;
_local1.value = ":";
this.nextChar();
break;
case "t":
_local2 = ((("t" + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local2 == "true"){
_local1.type = JSONTokenType.TRUE;
_local1.value = true;
this.nextChar();
} else {
this.parseError(("Expecting 'true' but found " + _local2));
};
break;
case "f":
_local3 = (((("f" + this.nextChar()) + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local3 == "false"){
_local1.type = JSONTokenType.FALSE;
_local1.value = false;
this.nextChar();
} else {
this.parseError(("Expecting 'false' but found " + _local3));
};
break;
case "n":
_local4 = ((("n" + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local4 == "null"){
_local1.type = JSONTokenType.NULL;
_local1.value = null;
this.nextChar();
} else {
this.parseError(("Expecting 'null' but found " + _local4));
};
break;
case "\"":
_local1 = this.readString();
break;
default:
if (((this.isDigit(this.ch)) || ((this.ch == "-")))){
_local1 = this.readNumber();
} else {
if (this.ch == ""){
return (null);
};
this.parseError((("Unexpected " + this.ch) + " encountered"));
};
};
return (_local1);
}
private function readString():JSONToken{
var _local3:String;
var _local4:int;
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.STRING;
var _local2 = "";
this.nextChar();
while (((!((this.ch == "\""))) && (!((this.ch == ""))))) {
if (this.ch == "\\"){
this.nextChar();
switch (this.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 (!this.isHexDigit(this.nextChar())){
this.parseError((" Excepted a hex digit, but found: " + this.ch));
};
_local3 = (_local3 + this.ch);
_local4++;
};
_local2 = (_local2 + String.fromCharCode(parseInt(_local3, 16)));
break;
default:
_local2 = (_local2 + ("\\" + this.ch));
};
} else {
_local2 = (_local2 + this.ch);
};
this.nextChar();
};
if (this.ch == ""){
this.parseError("Unterminated string literal");
};
this.nextChar();
_local1.value = _local2;
return (_local1);
}
private function readNumber():JSONToken{
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.NUMBER;
var _local2 = "";
if (this.ch == "-"){
_local2 = (_local2 + "-");
this.nextChar();
};
if (!this.isDigit(this.ch)){
this.parseError("Expecting a digit");
};
if (this.ch == "0"){
_local2 = (_local2 + this.ch);
this.nextChar();
if (this.isDigit(this.ch)){
this.parseError("A digit cannot immediately follow 0");
};
} else {
while (this.isDigit(this.ch)) {
_local2 = (_local2 + this.ch);
this.nextChar();
};
};
if (this.ch == "."){
_local2 = (_local2 + ".");
this.nextChar();
if (!this.isDigit(this.ch)){
this.parseError("Expecting a digit");
};
while (this.isDigit(this.ch)) {
_local2 = (_local2 + this.ch);
this.nextChar();
};
};
if ((((this.ch == "e")) || ((this.ch == "E")))){
_local2 = (_local2 + "e");
this.nextChar();
if ((((this.ch == "+")) || ((this.ch == "-")))){
_local2 = (_local2 + this.ch);
this.nextChar();
};
if (!this.isDigit(this.ch)){
this.parseError("Scientific notation number needs exponent value");
};
while (this.isDigit(this.ch)) {
_local2 = (_local2 + this.ch);
this.nextChar();
};
};
var _local3:Number = Number(_local2);
if (((isFinite(_local3)) && (!(isNaN(_local3))))){
_local1.value = _local3;
return (_local1);
};
this.parseError((("Number " + _local3) + " is not valid!"));
return (null);
}
private function nextChar():String{
return ((this.ch = this.jsonString.charAt(this.loc++)));
}
private function skipIgnored():void{
var _local1:int;
do {
_local1 = this.loc;
this.skipWhite();
this.skipComments();
} while (_local1 != this.loc);
}
private function skipComments():void{
if (this.ch == "/"){
this.nextChar();
switch (this.ch){
case "/":
do {
this.nextChar();
} while (((!((this.ch == "\n"))) && (!((this.ch == "")))));
this.nextChar();
break;
case "*":
this.nextChar();
while (true) {
if (this.ch == "*"){
this.nextChar();
if (this.ch == "/"){
this.nextChar();
break;
};
} else {
this.nextChar();
};
if (this.ch == ""){
this.parseError("Multi-line comment not closed");
};
};
break;
default:
this.parseError((("Unexpected " + this.ch) + " encountered (expecting '/' or '*' )"));
};
};
}
private function skipWhite():void{
while (this.isWhiteSpace(this.ch)) {
this.nextChar();
};
}
private function isWhiteSpace(_arg1:String):Boolean{
return ((((((((_arg1 == " ")) || ((_arg1 == "\t")))) || ((_arg1 == "\n")))) || ((_arg1 == "\r"))));
}
private function isDigit(_arg1:String):Boolean{
return ((((_arg1 >= "0")) && ((_arg1 <= "9"))));
}
private function isHexDigit(_arg1:String):Boolean{
var _local2:String = _arg1.toUpperCase();
return (((this.isDigit(_arg1)) || ((((_local2 >= "A")) && ((_local2 <= "F"))))));
}
public function parseError(_arg1:String):void{
throw (new JSONParseError(_arg1, this.loc, this.jsonString));
}
}
}//package com.adobe.serialization.json
Section 9
//JSONTokenType (com.adobe.serialization.json.JSONTokenType)
package com.adobe.serialization.json {
public class JSONTokenType {
public static const UNKNOWN:int = -1;
public static const COMMA:int = 0;
public static const LEFT_BRACE:int = 1;
public static const RIGHT_BRACE:int = 2;
public static const LEFT_BRACKET:int = 3;
public static const RIGHT_BRACKET:int = 4;
public static const COLON:int = 6;
public static const TRUE:int = 7;
public static const FALSE:int = 8;
public static const NULL:int = 9;
public static const STRING:int = 10;
public static const NUMBER:int = 11;
}
}//package com.adobe.serialization.json
Section 10
//IntUtil (com.adobe.utils.IntUtil)
package com.adobe.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local4:int;
var _local5:int;
var _local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
}
}//package com.adobe.utils
Section 11
//KongregateEvent (com.kongregate.as3.client.events.KongregateEvent)
package com.kongregate.as3.client.events {
import flash.events.*;
public class KongregateEvent extends Event {
public static const COMPLETE:String = "component_api_available";
public function KongregateEvent(_arg1:String){
super(_arg1);
}
}
}//package com.kongregate.as3.client.events
Section 12
//AbstractShadowService (com.kongregate.as3.client.services.AbstractShadowService)
package com.kongregate.as3.client.services {
import flash.events.*;
public class AbstractShadowService extends EventDispatcher {
protected function alert(_arg1:String, _arg2:String, _arg3="", _arg4:String=""):void{
trace(((((((("Kongregate API: " + _arg1) + ".") + _arg2) + "(") + _arg3) + ") ") + _arg4));
}
}
}//package com.kongregate.as3.client.services
Section 13
//HighScoreServiceShadow (com.kongregate.as3.client.services.HighScoreServiceShadow)
package com.kongregate.as3.client.services {
public class HighScoreServiceShadow extends AbstractShadowService implements IHighScoreServices {
private var mode:String;
public function HighScoreServiceShadow(){
mode = "";
}
public function submit(_arg1:Number, _arg2:String=null):void{
alert("IHighScoreServices", "submit", arguments);
}
public function connect():Boolean{
alert("IKongregateServices", "connect");
return (true);
}
public function requestList(_arg1:Function):void{
alert("IHighScoreServices", "requestList", "", (("[Mode: " + mode) + "]"));
_arg1({success:false});
}
public function setMode(_arg1:String):void{
alert("IHighScoreServices", "setMode", arguments);
this.mode = _arg1;
}
}
}//package com.kongregate.as3.client.services
Section 14
//IHighScoreServices (com.kongregate.as3.client.services.IHighScoreServices)
package com.kongregate.as3.client.services {
public interface IHighScoreServices {
function setMode(_arg1:String):void;
function submit(_arg1:Number, _arg2:String=null):void;
function requestList(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 15
//IKongregateServices (com.kongregate.as3.client.services.IKongregateServices)
package com.kongregate.as3.client.services {
import flash.events.*;
public interface IKongregateServices extends IEventDispatcher {
function getPlayerInfo(_arg1:Function):void;
function connect(_arg1:Number=-1):Boolean;
}
}//package com.kongregate.as3.client.services
Section 16
//IStatServices (com.kongregate.as3.client.services.IStatServices)
package com.kongregate.as3.client.services {
public interface IStatServices {
function submitArray(_arg1:Array):void;
function submit(_arg1:String, _arg2:Number):void;
}
}//package com.kongregate.as3.client.services
Section 17
//IUserServices (com.kongregate.as3.client.services.IUserServices)
package com.kongregate.as3.client.services {
public interface IUserServices {
function getName():String;
function getPlayerInfo(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 18
//KongregateServiceShadow (com.kongregate.as3.client.services.KongregateServiceShadow)
package com.kongregate.as3.client.services {
public class KongregateServiceShadow extends AbstractShadowService implements IKongregateServices {
public function getName():String{
alert("IKongregateServices", "getName");
return ("Guest");
}
public function connect(_arg1:Number=-1):Boolean{
alert("IKongregateServices", "connect", arguments);
return (true);
}
public function getPlayerInfo(_arg1:Function):void{
alert("IKongregateServices", "getPlayerInfo");
_arg1(new Object());
}
}
}//package com.kongregate.as3.client.services
Section 19
//StatServiceShadow (com.kongregate.as3.client.services.StatServiceShadow)
package com.kongregate.as3.client.services {
public class StatServiceShadow extends AbstractShadowService implements IStatServices {
public function submitArray(_arg1:Array):void{
alert("IStatServices", "submitArray", arguments);
}
public function submit(_arg1:String, _arg2:Number):void{
alert("IStatServices", "submitStat", arguments);
}
}
}//package com.kongregate.as3.client.services
Section 20
//UserServiceShadow (com.kongregate.as3.client.services.UserServiceShadow)
package com.kongregate.as3.client.services {
public class UserServiceShadow extends AbstractShadowService implements IUserServices {
public function getName():String{
alert("UserService", "getName");
return ("Guest");
}
public function getPlayerInfo(_arg1:Function):void{
alert("UserService", "getPlayerInfo");
_arg1({isGuest:true, name:"Guest", points:0, level:0, isMode:false, isAdmin:false, isDeveloper:false, avatarPath:"", chatAvatarPath:""});
}
}
}//package com.kongregate.as3.client.services
Section 21
//IAPIBootstrap (com.kongregate.as3.client.IAPIBootstrap)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
public interface IAPIBootstrap {
function init(_arg1:Event=null, _arg2:Stage=null):void;
function hideLog():void;
function showLog(_arg1:int=0):void;
}
}//package com.kongregate.as3.client
Section 22
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import com.kongregate.as3.client.services.*;
import flash.net.*;
import com.kongregate.as3.client.events.*;
import flash.system.*;
import flash.errors.*;
public class KongregateAPI extends Sprite {
private const VERSION:Number = 1;
private var loader:Loader;
private var loadedDomain:ApplicationDomain;
private static const CLASS_USER:String = "com.kongregate.as3.client.services.UserServices";
private static const CLASS_STATS:String = "com.kongregate.as3.client.services.StatServices";
private static const CLASS_SERVICES:String = "com.kongregate.as3.client.services.KongregateServices";
private static const CLASS_SCORES:String = "com.kongregate.as3.client.services.HighScoreServices";
private static const DEBUG_API_URL:String = "//Linuxpc/kongregate/public/flash/API_AS3.swf";
private static var _connected:Boolean;
private static var kUser:IUserServices;
private static var _loaded:Boolean;
private static var kServices:IKongregateServices;
private static var kScores:IHighScoreServices;
private static var mInstance:KongregateAPI;
private static var kStats:IStatServices;
private static var kAPI:IAPIBootstrap;
public function KongregateAPI(){
if (mInstance != null){
throw (new Error("Warning: KongregateAPI has been added to stage more than once or accessed improperly. Use getInstance() or a stage reference to access."));
};
mInstance = this;
this.addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
public function get loaded():Boolean{
return (_loaded);
}
public function get connected():Boolean{
return (_connected);
}
private function alertConnected(_arg1:TimerEvent=null):void{
var _local2:KongregateEvent;
var _local3:Boolean;
_local2 = new KongregateEvent(KongregateEvent.COMPLETE);
_local3 = this.dispatchEvent(_local2);
}
private function init(_arg1:Event):void{
var _local2:Object;
var _local3:String;
var _local4:URLRequest;
var _local5:LoaderContext;
this.removeEventListener(Event.ADDED_TO_STAGE, init);
_loaded = false;
_connected = false;
_local2 = LoaderInfo(root.loaderInfo).parameters;
_local3 = _local2.api_path;
if (_local3 == null){
trace("Alert: Kongregate API could not be loaded, due to local testing. API will load when the game is uploaded.");
createShadowServices();
return;
};
Security.allowDomain("*.kongregate.com");
Security.allowDomain("kongregatetrunk.com");
_local4 = new URLRequest(_local3);
_local5 = new LoaderContext(false);
_local5.applicationDomain = ApplicationDomain.currentDomain;
_local5.securityDomain = SecurityDomain.currentDomain;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.load(_local4, _local5);
}
public function get api():IAPIBootstrap{
return (kAPI);
}
private function loadComplete(_arg1:Event):void{
getServices();
}
public function get scores():IHighScoreServices{
return (kScores);
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
throw (new IOError(("API file not found. " + _arg1)));
}
public function get services():IKongregateServices{
return (kServices);
}
public function get stats():IStatServices{
return (kStats);
}
private function createShadowServices():void{
var _local1:Timer;
trace(">>> Kongregate Shadow Services instantiated for local development..");
kServices = new KongregateServiceShadow();
kScores = new HighScoreServiceShadow();
kStats = new StatServiceShadow();
kUser = new UserServiceShadow();
_local1 = new Timer(200, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, alertConnected);
_local1.start();
_connected = true;
}
public function get user():IUserServices{
return (kUser);
}
private function getServices():void{
var _local1:ApplicationDomain;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = ApplicationDomain.currentDomain;
kAPI = IAPIBootstrap(loader.getChildAt(0));
this.addChild(loader);
_local2 = _local1.getDefinition(CLASS_SERVICES);
trace(_local2);
kServices = _local2.getInstance();
_local3 = _local1.getDefinition(CLASS_SCORES);
kScores = _local3.getInstance();
_local4 = _local1.getDefinition(CLASS_STATS);
kStats = _local4.getInstance();
_local5 = _local1.getDefinition(CLASS_USER);
kUser = _local5.getInstance();
kServices.connect(VERSION);
_loaded = true;
_connected = true;
alertConnected();
}
public static function getInstance():KongregateAPI{
if (!mInstance){
throw (new IllegalOperationError("You must add the Kongregate API component to the stage before attempting to access it."));
};
return (mInstance);
}
}
}//package com.kongregate.as3.client
Section 23
//APIConnector (com.newgrounds.components.APIConnector)
package com.newgrounds.components {
import flash.events.*;
import flash.display.*;
import com.newgrounds.*;
import flash.utils.*;
public class APIConnector extends MovieClip {
public var errorDialog:MovieClip;
public var background:MovieClip;
public var viewLatestButton:SimpleButton;
public var closeButton:SimpleButton;
public var viewAuthorizedButton:SimpleButton;
private var _initialized:Boolean;
private var _movieId:String;
private var _encryptionKey:String;
private var _movieVersion:String;
private var _showConnectingPopup:Boolean;// = true
private var _useErrorPopup:Boolean;// = true
private var _medalPopup:MedalPopup;
private var _popDelay:Timer;
public function APIConnector(){
this._popDelay = new Timer(3000, 1);
super();
addFrameScript(0, this.frame1, 6, this.frame7, 7, this.frame8);
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
this.useErrorPopup = true;
this.useMedalPopup = true;
this._popDelay.addEventListener(TimerEvent.TIMER, this.errorTimerHandler);
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
if (stage){
addEventListener(Event.RENDER, this.renderHandler);
stage.invalidate();
} else {
this.clear();
};
}
public function get movieId():String{
return (this._movieId);
}
public function set movieId(_arg1:String):void{
this._movieId = _arg1;
}
public function get encryptionKey():String{
return (this._encryptionKey);
}
public function set encryptionKey(_arg1:String):void{
this._encryptionKey = _arg1;
}
public function get movieVersion():String{
return (this._movieVersion);
}
public function set movieVersion(_arg1:String):void{
this._movieVersion = _arg1;
}
public function get debugMode():Boolean{
return (API.debugMode);
}
public function set debugMode(_arg1:Boolean):void{
API.debugMode = true;
}
public function get useMedalPopup():Boolean{
return (!((this._medalPopup == null)));
}
public function set useMedalPopup(_arg1:Boolean):void{
if (((_arg1) && (!(this._medalPopup)))){
this._medalPopup = new MedalPopup();
addChild(this._medalPopup);
} else {
if (((!(_arg1)) && (this._medalPopup))){
removeChild(this._medalPopup);
this._medalPopup = null;
};
};
}
public function get useErrorPopup():Boolean{
return (this._useErrorPopup);
}
public function set useErrorPopup(_arg1:Boolean):void{
this._useErrorPopup = _arg1;
API.addEventListener(APIEvent.API_CONNECTED, this.movieConnectedHandler);
if (this._useErrorPopup){
API.addEventListener(APIEvent.NEW_VERSION_AVAILABLE, this.newVersionAvailableHandler);
API.addEventListener(APIEvent.HOST_BLOCKED, this.hostBlockedHandler);
} else {
API.removeEventListener(APIEvent.NEW_VERSION_AVAILABLE, this.newVersionAvailableHandler);
API.removeEventListener(APIEvent.HOST_BLOCKED, this.hostBlockedHandler);
};
}
public function get showConnectingPopup():Boolean{
return (this._showConnectingPopup);
}
public function set showConnectingPopup(_arg1:Boolean):void{
this._showConnectingPopup = _arg1;
if (((!(_arg1)) && ((((currentLabel == "connecting")) || ((currentLabel == "connected")))))){
this.clear();
};
}
public function clear():void{
gotoAndStop("idle");
}
public function connect():void{
API.setVersion(this._movieVersion);
API.connect(root.loaderInfo, this._movieId, this._encryptionKey);
visible = true;
if (this.showConnectingPopup){
gotoAndStop("connecting");
};
}
private function renderHandler(_arg1:Event):void{
removeEventListener(Event.RENDER, this.renderHandler);
this.clear();
this.connect();
}
private function movieConnectedHandler(_arg1:APIEvent):void{
if (_arg1.success){
if (((((((API.isPublishedHost()) && (API.IsCompatible()))) && (!(API.hasUserSession())))) && (!(API.debugMode)))){
gotoAndStop("no_login");
this._popDelay.start();
visible = true;
} else {
if (this.showConnectingPopup){
gotoAndStop("connected");
};
};
} else {
gotoAndStop("no_connect");
this._popDelay.start();
visible = true;
};
}
private function newVersionAvailableHandler(_arg1:APIEvent):void{
gotoAndStop("new_version");
visible = true;
this.centerOnStage();
}
private function hostBlockedHandler(_arg1:APIEvent):void{
gotoAndStop("bad_host");
visible = true;
this.centerOnStage();
}
private function closeButtonClickHandler(_arg1:Event):void{
this.clear();
}
private function officialVersionClickHandler(_arg1:Event):void{
API.loadOfficialVersion();
}
private function enterFrameHandler(_arg1:Event):void{
this.forceAlwaysOnTop();
}
private function initButtons():void{
if (this.viewLatestButton){
this.viewLatestButton.addEventListener(MouseEvent.CLICK, this.officialVersionClickHandler);
};
if (this.viewAuthorizedButton){
this.viewAuthorizedButton.addEventListener(MouseEvent.CLICK, this.officialVersionClickHandler);
};
if (this.closeButton){
this.closeButton.addEventListener(MouseEvent.CLICK, this.closeButtonClickHandler);
};
}
private function forceAlwaysOnTop():void{
var myIndex:uint;
var topIndex:uint;
if (((parent) && (visible))){
try {
myIndex = parent.getChildIndex(this);
topIndex = (parent.numChildren - 1);
if (myIndex != topIndex){
parent.setChildIndex(this, topIndex);
};
} catch(e:Error) {
};
};
}
private function centerOnStage():void{
if (stage){
x = (stage.stageWidth / 2);
y = (stage.stageHeight / 2);
};
}
private function errorTimerHandler(_arg1:TimerEvent):void{
if (this.errorDialog){
this.errorDialog.gotoAndPlay("closeme");
} else {
this.clear();
};
}
function frame1(){
stop();
}
function frame7(){
this.initButtons();
}
function frame8(){
this.initButtons();
}
}
}//package com.newgrounds.components
Section 24
//FlashAd (com.newgrounds.components.FlashAd)
package com.newgrounds.components {
import flash.events.*;
import flash.display.*;
import com.newgrounds.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class FlashAd extends Sprite {
public var background:MovieClip;
private var _showBackground:Boolean;
private var _adURLLoader:URLLoader;
private var _adRect:Sprite;
private var _mask:Shape;
private var _ad:Loader;
private static const DEBUG_AD_URL:String = "http://www.ngads.com/adtest.php";
private static const REMOVED_FROM_STAGE:String = "removedFromStage";
private static var _adResetTime:uint = 0;
private static var _adURL:URLRequest;
public function FlashAd(_arg1:Boolean=true){
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
this._adRect = new Sprite();
this._adRect.graphics.beginFill(0);
this._adRect.graphics.moveTo(0, 0);
this._adRect.graphics.lineTo(300, 0);
this._adRect.graphics.lineTo(300, 250);
this._adRect.graphics.lineTo(0, 250);
this._adRect.graphics.lineTo(0, 0);
this._adRect.graphics.endFill();
this._mask = new Shape();
this._mask.graphics.beginFill(0);
this._mask.graphics.moveTo(0, 0);
this._mask.graphics.lineTo(300, 0);
this._mask.graphics.lineTo(300, 250);
this._mask.graphics.lineTo(0, 250);
this._mask.graphics.lineTo(0, 0);
this._mask.graphics.endFill();
addChild(this._adRect);
this._adRect.addChild(this._mask);
this._adRect.visible = false;
x = Math.round(x);
y = Math.round(y);
scaleX = 1;
scaleY = 1;
if (this.background){
if (this.background.ngLinkButton){
this.background.ngLinkButton.addEventListener(MouseEvent.CLICK, this.linkClickHandler);
};
if (this.background.loadingClip){
this.background.loadingClip.visible = false;
};
};
if (API.isFlashVersion(9, 0, 28)){
addEventListener(REMOVED_FROM_STAGE, this.onRemovedFromStage);
};
if (API.adsApproved){
this.loadAdFeed(API.adFeedURL);
} else {
API.addEventListener(APIEvent.ADS_APPROVED, this.onAdsApproved, false, 0, true);
};
this.showBackground = _arg1;
}
public function get showBackground():Boolean{
return (this._showBackground);
}
public function set showBackground(_arg1:Boolean):void{
this._showBackground = _arg1;
if (this.background){
this.background.visible = _arg1;
this._adRect.mask = (_arg1) ? this.background.adMask : null;
};
}
public function removeAd():void{
removeEventListener(REMOVED_FROM_STAGE, this.onRemovedFromStage);
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
if (this._adURLLoader){
try {
this._adURLLoader.close();
} catch(e:Error) {
};
};
if (this._adRect){
this._adRect.visible = false;
};
if (this._ad){
trace("[NewgroundsAPI] :: Ad removed");
try {
this._ad.close();
} catch(e:Error) {
};
try {
Object(this._ad).unloadAndStop(true);
} catch(e:Error) {
_ad.unload();
};
if (this._ad.parent){
this._ad.parent.removeChild(this._ad);
};
};
this._ad = null;
}
private function onAdsApproved(_arg1:APIEvent):void{
API.removeEventListener(APIEvent.ADS_APPROVED, this.onAdsApproved, false);
if (_arg1.success){
this.loadAdFeed(API.adFeedURL);
} else {
trace("[NewgroundsAPI] :: No ad feed URL supplied to Newgrounds API ad!");
};
}
private function loadAdFeed(_arg1:String):void{
var adFeedURL = _arg1;
this._adURLLoader = new URLLoader();
this._adURLLoader.addEventListener(Event.COMPLETE, this.onAdFeedLoaded);
this._adURLLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
this._adURLLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onAdError);
if (!adFeedURL){
trace("[Newgrounds API] :: Invalid feed URL!");
return;
};
if (this.hasAdElapsed){
if (adFeedURL.indexOf("?") > -1){
_adURL = new URLRequest(((adFeedURL + "&random=") + Math.random()));
} else {
_adURL = new URLRequest(((adFeedURL + "?random=") + Math.random()));
};
};
try {
this._adURLLoader.load(_adURL);
} catch(e:Error) {
onAdError(null);
};
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = true;
};
}
private function loadAd(_arg1:String):void{
if (this._ad){
this.removeAd();
};
this._ad = new Loader();
this._ad.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onAdLoaded);
this._ad.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
this._ad.load(new URLRequest(_arg1), new LoaderContext(false, new ApplicationDomain(null)));
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = true;
};
}
private function onAdFeedLoaded(_arg1:Event):void{
var _local2:URLLoader = URLLoader(_arg1.target);
if (((_local2.data) && (!((_local2.data == ""))))){
this.loadAd((_local2.data as String));
} else {
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, false, new APIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad")));
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
};
}
private function onAdFeedError(_arg1:Event):void{
trace("[NewgroundsAPI] :: Unable to load ad feed!");
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
}
private function onAdError(_arg1:Event):void{
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, false, new APIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad")));
this.removeAd();
}
private function onAdLoaded(_arg1:Event):void{
this._adRect.addChild(this._ad);
this._ad.mask = this._mask;
this._adRect.visible = true;
if (this.background){
if (this._showBackground){
this._adRect.mask = this.background.adMask;
};
if (this.background.loadingClip){
this.background.loadingClip.visible = false;
};
};
trace("[NewgroundsAPI] :: Ad loaded!");
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, true));
}
private function onRemovedFromStage(_arg1:Event):void{
this.removeAd();
}
private function get hasAdElapsed():Boolean{
if (getTimer() >= _adResetTime){
_adResetTime = (getTimer() + ((1000 * 60) * 5));
return (true);
};
return (false);
}
private function linkClickHandler(_arg1:MouseEvent):void{
API.loadNewgrounds();
}
}
}//package com.newgrounds.components
Section 25
//MedalPopup (com.newgrounds.components.MedalPopup)
package com.newgrounds.components {
import flash.events.*;
import flash.display.*;
import com.newgrounds.*;
import flash.utils.*;
import flash.text.*;
public class MedalPopup extends MovieClip {
public var medalNameText:TextField;
public var medalValueText:TextField;
public var medalContainer:Sprite;
private var _initialized:Boolean;
private var _medal:Medal;
private var _medalIcon:Bitmap;
private var _medalQueue:Array;
private var _popDelay:Timer;
public function MedalPopup(){
this._medalQueue = [];
this._popDelay = new Timer(3000, 1);
super();
addFrameScript(0, this.frame1, 9, this.frame10, 18, this.frame19);
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
visible = false;
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
stop();
API.addEventListener(APIEvent.MEDAL_UNLOCKED, this.onMedalUnlocked, false, 0, true);
this._popDelay.addEventListener(TimerEvent.TIMER, this.timerHandler);
}
public function get popupTime():Number{
return ((this._popDelay.delay / 1000));
}
public function set popupTime(_arg1:Number):void{
if (isNaN(_arg1)){
_arg1 = 3;
};
this._popDelay.delay = (_arg1 * 1000);
}
private function enterFrameHandler(_arg1:Event):void{
var myIndex:uint;
var topIndex:uint;
var event = _arg1;
if (((this._medalQueue.length) && (!(visible)))){
this._medal = this._medalQueue.pop();
this._popDelay.start();
gotoAndPlay("medal_show");
visible = true;
};
if (((visible) && (parent))){
try {
myIndex = parent.getChildIndex(this);
topIndex = (parent.numChildren - 1);
if (myIndex != topIndex){
parent.setChildIndex(this, topIndex);
};
} catch(error:Error) {
};
};
}
private function onMedalUnlocked(_arg1:APIEvent):void{
if (((((_arg1.success) && (_arg1.data))) && ((_arg1.data is Medal)))){
this._medalQueue.push(Medal(_arg1.data));
};
}
private function showMedalInfo():void{
if (!this._medal){
return;
};
if (this.medalContainer){
this._medalIcon = this._medal.createIconBitmap();
this.medalContainer.addChild(this._medalIcon);
};
if (this.medalNameText){
this.medalNameText.text = this._medal.name;
};
if (this.medalValueText){
this.medalValueText.text = (this._medal.value.toString() + "pts");
};
this._popDelay.start();
stop();
}
private function timerHandler(_arg1:TimerEvent):void{
if (((this._medalIcon) && (this._medalIcon.parent))){
this._medalIcon.parent.removeChild(this._medalIcon);
this._medalIcon = null;
};
gotoAndPlay("medal_hide");
this._popDelay.stop();
}
function frame1(){
stop();
}
function frame10(){
this.showMedalInfo();
stop();
}
function frame19(){
stop();
visible = false;
}
}
}//package com.newgrounds.components
Section 26
//PreloaderBar (com.newgrounds.components.PreloaderBar)
package com.newgrounds.components {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class PreloaderBar extends MovieClip {
public var bar:DisplayObject;
public var playButton:DisplayObject;
private var _autoPlay:Boolean;// = false
public function PreloaderBar(){
addFrameScript(51, this.frame52);
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
gotoAndStop("LOAD");
if (this.bar){
this.bar.scaleX = 0;
};
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
}
public function onPlayButtonClicked(_arg1:MouseEvent):void{
this.startMovie();
}
public function get autoPlay():Boolean{
return (this._autoPlay);
}
public function set autoPlay(_arg1:Boolean):void{
this._autoPlay = _arg1;
}
private function enterFrameHandler(_arg1:Event):void{
var _local2:Number;
if (((root) && (root.loaderInfo))){
if ((root is MovieClip)){
MovieClip(root).stop();
};
_local2 = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
if (this.bar){
this.bar.scaleX = _local2;
};
if (_local2 == 1){
removeEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
if (this.autoPlay){
this.startMovie();
} else {
gotoAndPlay("COMPLETE_STOP");
};
};
};
}
private function playButtonReady():void{
stop();
if (this.playButton){
this.playButton.addEventListener(MouseEvent.CLICK, this.playButtonClicked);
} else {
this.startMovie();
};
}
private function playButtonClicked(_arg1:MouseEvent):void{
this.startMovie();
}
private function startMovie():void{
if (((root) && ((root is MovieClip)))){
MovieClip(root).play();
};
dispatchEvent(new Event(Event.COMPLETE));
}
function frame52(){
stop();
if (this.playButton){
this.playButton.addEventListener(MouseEvent.CLICK, this.onPlayButtonClicked);
} else {
this.startMovie();
};
}
}
}//package com.newgrounds.components
Section 27
//API (com.newgrounds.API)
package com.newgrounds {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import com.newgrounds.components.*;
import com.adobe.serialization.json.*;
import flash.net.*;
import com.adobe.crypto.*;
import com.adobe.images.*;
import flash.system.*;
public class API {
public static const VERSION:String = "2.8";
private static const GATEWAY_URL:String = "http://www.ngads.com/gateway_v2.php";
private static const AD_TERMS_URL:String = "http://www.newgrounds.com/wiki/flashads/terms/";
private static const COMMANDS_WIKI_URL:String = "http://www.newgrounds.com/wiki/flashapi/commands/";
private static var do_echo:Boolean = false;
private static var _debug:Boolean = true;
private static var _connected:Boolean = false;
private static var _isMetadataLoaded:Boolean = false;
private static var _preloadComplete:Boolean = false;
private static var _adsApproved:Boolean = false;
private static var _saveGroupId:uint;
private static var _saveFileId:uint;
private static var _trackerId:uint;
private static var _movieId:String;
private static var _encryptionKey:String;
private static var _url:String;
private static var _host:String;
private static var connected:Boolean;
private static var version:String;
private static var ad_url:String;
private static var publisher_id:uint;
private static var session_id:String;
private static var user_email:String;
private static var user_name:String;
private static var user_id:uint;
private static var userpage_format:String;
private static var _medals:Array;
private static var timeoutTimer:Timer = new Timer(8000, 1);
private static var _userpageFormat:String;
private static var _scoreboards:Array = new Array();
private static var _bridge:Bridge;
private static var _saveFile:SaveFile;
private static var _imageFilePath:String;
private static var _saveFilePath:String;
private static var _saveGroups:Array = [];
private static var root:DisplayObject;
private static var _eventDispatcher:EventDispatcher = new EventDispatcher();
private static var score_page_counts:Object = new Object();
private static var compression_radix:String = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
private static var compressor:BaseN = new BaseN(compression_radix);
public static var errors:Dictionary = APIError.init_codes();
private static var sharedObjects:Dictionary = new Dictionary();
private static var _preloadAssets:Array = [];
public static var periods:Object = getPeriodAliases();
private static var period_aliases:Object = {t:{name:"Today", alias:"TODAY"}, p:{name:"Yesterday", alias:"YESTERDAY"}, w:{name:"This Week", alias:"THIS_WEEK"}, m:{name:"This Month", alias:"THIS_MONTH"}, y:{name:"This Year", alias:"THIS_YEAR"}, a:{name:"All-Time", alias:"ALL_TIME"}};
private static var secureCommand:String;
public static function get adFeedURL():String{
return (ad_url);
}
public static function get preloadComplete():Boolean{
return (_preloadComplete);
}
private static function assertConnected():Boolean{
if (!_connected){
return (false);
};
return (true);
}
public static function setVersion(_arg1:String):void{
if (((_arg1) && (!((_arg1 == ""))))){
version = _arg1;
};
}
public static function setUserEmail(_arg1:String):void{
user_email = _arg1;
}
public static function get debugMode():Boolean{
return (_debug);
}
public static function set debugMode(_arg1:Boolean):void{
_debug = _arg1;
}
public static function getTrackerID():uint{
return (_trackerId);
}
public static function getUserID():uint{
return (user_id);
}
public static function getUserName():String{
return (user_name);
}
public static function isConnected():Boolean{
return (_connected);
}
public static function getOfficialURL():String{
var _local1:String = ((((((GATEWAY_URL + "?tracker_id=") + _movieId) + "&command_id=") + getCommandID("loadOfficalVersion")) + "&seed=") + Math.random());
if (debugMode){
_local1 = (_local1 + "&debug=1");
};
return (_local1);
}
public static function get adsApproved():Boolean{
return (_adsApproved);
}
public static function hasUserSession():Boolean{
return (((((!((session_id == null))) && (!((session_id == ""))))) && (!((publisher_id == 0)))));
}
public static function isNewgrounds():Boolean{
return ((((publisher_id == 1)) || ((getHost().toLowerCase().indexOf("ungrounded.net") > -1))));
}
public static function IsCompatible():Boolean{
return (!((publisher_id == 0)));
}
public static function hasUserEmail():Boolean{
return (((!((user_email == null))) && (!((user_email == "")))));
}
public static function connectionTimeOut(_arg1:Event=null):void{
dispatchEvent(new APIEvent(APIEvent.API_CONNECTED, false, new APIError("CONNECTION_FAILED", "Connection to NewgroundsAPI gateway timed out.")));
}
public static function connect(_arg1:LoaderInfo, _arg2:String, _arg3:String=null):void{
var loaderInfo = _arg1;
var m_id = _arg2;
var encrypt_key = _arg3;
if (!loaderInfo){
fatalError("Null loaderInfo paremeter passed in to connectMovie!", "");
return;
};
try {
if (loaderInfo.loader){
loaderInfo = loaderInfo.loader.loaderInfo;
};
} catch(error:Error) {
};
_url = loaderInfo.url;
_host = _url;
if ((((_host.indexOf("http://") > -1)) || ((_host.indexOf("https://") > -1)))){
_host = _host.split("/")[2].toLowerCase();
} else {
_host = "localhost";
};
var flashVars:Object = loaderInfo.parameters;
if (isPublishedHost()){
debugMode = false;
};
if (((!(debugMode)) && (flashVars))){
if (flashVars.NewgroundsAPI_UserName){
user_name = flashVars.NewgroundsAPI_UserName;
};
if (flashVars.NewgroundsAPI_UserID){
user_id = flashVars.NewgroundsAPI_UserID;
};
if (flashVars.NewgroundsAPI_PublisherID){
publisher_id = flashVars.NewgroundsAPI_PublisherID;
} else {
publisher_id = 1;
};
if (flashVars.NewgroundsAPI_UserpageFormat){
_userpageFormat = flashVars.NewgroundsAPI_UserpageFormat;
};
if (flashVars.NewgroundsAPI_SessionID){
session_id = flashVars.NewgroundsAPI_SessionID;
};
if (flashVars.NewgroundsAPI_SaveGroupID){
_saveGroupId = flashVars.NewgroundsAPI_SaveGroupID;
};
if (flashVars.NewgroundsAPI_SaveFileID){
_saveFileId = flashVars.NewgroundsAPI_SaveFileID;
};
if (flashVars.NewgroundsAPI_SandboxID){
_bridge = new Bridge(flashVars.NewgroundsAPI_SandboxID);
};
} else {
publisher_id = 1;
session_id = "D3bu64p1U53R";
user_id = 10;
user_name = "API-Debugger";
};
if (connected){
return;
};
timeoutTimer.start();
if (!m_id){
fatalError("NewgroundsAPI.connectMovie() - missing required movieId parameter", "connectMovie");
};
_movieId = String(m_id);
_trackerId = uint(_movieId.substring(0, _movieId.indexOf(":")));
_encryptionKey = encrypt_key;
connected = true;
sendCommand("connectMovie", {host:getHost(), movie_version:version});
}
private static function getHost():String{
return (_host);
}
public static function isPublishedHost():Boolean{
return (((!((getHost() == "localhost"))) && ((getHost().indexOf("file://") == -1))));
}
public static function loadUserPage(_arg1:uint=0, _arg2:String=null):Boolean{
var _local3:String;
if ((((_arg1 == 0)) && ((_arg2 == null)))){
if (hasUserSession()){
_arg1 = user_id;
_arg2 = user_name;
} else {
return (false);
};
};
if (publisher_id == 1){
_local3 = (("http://" + _arg2.toLowerCase()) + ".newgrounds.com");
navigateToURL(new URLRequest(_local3), "_blank");
return (true);
};
if (userpage_format){
_local3 = userpage_format;
_local3 = _local3.split(":user_id:").join(_arg1.toString());
_local3 = _local3.split(":user_name:").join(escape(_arg2));
navigateToURL(new URLRequest(_local3), "_blank");
return (true);
};
return (false);
}
public static function loadNewgrounds():void{
sendCommand("loadNewgrounds", {host:getHost()}, true);
}
public static function loadOfficialVersion():void{
navigateToURL(new URLRequest(getOfficialURL()));
}
public static function loadMySite():void{
sendCommand("loadMySite", {host:getHost()}, true);
}
public static function loadCustomLink(_arg1:String):void{
sendCommand("loadCustomLink", {host:getHost(), link:_arg1}, true);
}
public static function logCustomEvent(_arg1:String):void{
sendCommand("logCustomEvent", {host:getHost(), event:_arg1});
}
public static function getScoreBoardByName(_arg1:String):ScoreBoard{
var _local2:ScoreBoard;
for each (_local2 in _scoreboards) {
if (_local2.name == _arg1){
return (_local2);
};
};
return (null);
}
public static function getScoreBoardById(_arg1:uint):ScoreBoard{
var _local2:ScoreBoard;
for each (_local2 in _scoreboards) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public static function postScore(_arg1:String, _arg2:uint, _arg3:String=""):void{
if (((!(_arg1)) || ((_arg1 == "")))){
sendError({command_id:getCommandID("postScore")}, new APIError("MISSING_PARAM", "missing required parameter(s)"));
return;
};
if (_arg3 == null){
_arg3 = "";
};
sendSecureCommand("postScore", {user_name:user_name, board:_arg1, value:_arg2, publisher_id:publisher_id, tag:_arg3});
}
public static function loadScores(_arg1:ScoreBoard, _arg2:String=null):void{
var _local3 = "loadScores";
if (!_arg1.id){
sendError({command_id:getCommandID(_local3)}, new APIError("MISSING_PARAM", "missing required ScoreBoard instance"));
return;
};
var _local4:Object = {};
_local4.publisher_id = publisher_id;
_local4.period = _arg1.period;
_local4.board = _arg1.id;
_local4.num_results = _arg1.num_results;
_local4.page = _arg1.page;
if (((!(_arg2)) || ((_arg2 == "")))){
_local4.tag = _arg1.tag;
} else {
_local4.tag = _arg2;
};
sendCommand(_local3, _local4);
}
public static function loadScoresInRange(_arg1:String, _arg2:String="All-Time", _arg3:uint=1, _arg4:uint=10):void{
if (((!(_arg1)) || ((_arg1 == "")))){
sendError({command_id:getCommandID("postScore")}, new APIError("MISSING_PARAM", "missing required parameter(s)"));
return;
};
var _local5:ScoreBoard = getScoreBoardByName(_arg1);
if (_local5){
_local5.loadScoresInRange(_arg2, _arg3, _arg4);
} else {
sendWarning((("loadScoresInRange: Scoreboard " + _arg1) + " could not be found."));
};
}
private static function populateMedals(_arg1:Array):void{
var _local2:uint;
var _local3:Object;
if (_medals === null){
_medals = new Array();
_local2 = 0;
while (_local2 < _arg1.length) {
_local3 = _arg1[_local2];
_medals.push(Medal.createFromObject(_local3));
_local2++;
};
};
sendMessage("Medals loaded!");
}
private static function populateSaveGroups(_arg1:Array):void{
var _local3:SaveGroup;
_saveGroups = [];
var _local2:uint;
while (_local2 < _arg1.length) {
_local3 = SaveGroup.createFromObject(_arg1[_local2]);
_saveGroups.push(_local3);
_local2++;
};
}
private static function populateScoreBoards(_arg1:Array):void{
_scoreboards = [];
var _local2:uint;
while (_local2 < _arg1.length) {
_scoreboards.push(new ScoreBoard(_arg1[_local2].id, _arg1[_local2].name, ""));
_local2++;
};
}
public static function get medals():Array{
return ((_medals) ? _medals.concat() : []);
}
public static function getMedalById(_arg1:uint):Medal{
var _local2:Medal;
for each (_local2 in _medals) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public static function getMedalByName(_arg1:String):Medal{
var _local2:Medal;
for each (_local2 in _medals) {
if (_local2.name == _arg1){
return (_local2);
};
};
return (null);
}
public static function unlockMedal(_arg1:String):void{
var _local3:Object;
var _local4:Object;
if (((!(_arg1)) || ((_arg1 == "")))){
sendError({command_id:getCommandID("unlockMedal")}, new APIError("MISSING_PARAM", "missing required medal name"));
return;
};
var _local2:Medal = getMedalByName(_arg1);
if (!_local2){
sendMessage(("No medal with name: " + _arg1));
return;
};
if (((hasUserSession()) || (debugMode))){
sendMessage((("Attempting to unlock '" + _local2.name) + "'"));
if (_local2.unlocked){
sendWarning((("Medal '" + _local2.name) + "' is already unlocked!"));
return;
};
_local3 = new Object();
_local3.medal_id = _local2.id;
sendSecureCommand("unlockMedal", _local3);
} else {
sendMessage(("Locally unlocking " + _local2.name));
if (_local2.unlocked){
sendWarning((("Medal '" + _local2.name) + "' is already unlocked!"));
return;
};
_local2.unlocked = true;
_local4 = loadLocal("medals_unlocked");
if (!_local4){
_local4 = new Object();
};
_local4[_local2.id.toString()] = true;
saveLocal("medals_unlocked", _local4);
callListener(APIEvent.MEDAL_UNLOCKED, true, _local2);
};
}
public static function loadMedals():void{
if (_medals){
dispatchEvent(new APIEvent(APIEvent.MEDALS_LOADED, true, medals));
return;
};
var _local1:Object = new Object();
if (hasUserSession()){
_local1.publisher_id = publisher_id;
_local1.user_id = user_id;
};
sendCommand("getMedals", _local1);
}
public static function saveLocal(_arg1:String, _arg2:Object, _arg3:uint=0):void{
var sharedObj:SharedObject;
var save_id = _arg1;
var save_data = _arg2;
var size_allocation = _arg3;
try {
if (!sharedObjects[save_id]){
sharedObjects[save_id] = SharedObject.getLocal(((("ng_ap_secure_" + _trackerId) + "_") + save_id));
};
sharedObj = sharedObjects[save_id];
sharedObj.data[save_id] = encodeData(save_data);
sharedObj.flush();
} catch(e:Error) {
sendWarning(("saveLocal ERROR: " + e));
};
}
public static function loadLocal(_arg1:String):Object{
var sharedObj:SharedObject;
var save_id = _arg1;
try {
if (!sharedObjects[save_id]){
sharedObjects[save_id] = SharedObject.getLocal(((("ng_ap_secure_" + _trackerId) + "_") + save_id));
};
sharedObj = sharedObjects[save_id];
if (((((sharedObj) && (sharedObj.data))) && (sharedObj.data[save_id]))){
return (decodeData(sharedObj.data[save_id]));
} else {
return (null);
};
} catch(e:Error) {
sendWarning(("loadLocal ERROR: " + e));
};
return (null);
}
public static function encodeData(_arg1:Object):String{
return (compressHex(RC4.encrypt(JSON.encode(_arg1), _encryptionKey)));
}
public static function decodeData(_arg1:String){
return (JSON.decode(RC4.decrypt(uncompressHex(_arg1), _encryptionKey)));
}
private static function compressHex(_arg1:String):String{
var _local2:uint = (_arg1.length % 6);
var _local3 = "";
var _local4:uint;
while (_local4 < _arg1.length) {
_local3 = (_local3 + compressor.encode(uint(("0x" + _arg1.substr(_local4, 6))), 4));
_local4 = (_local4 + 6);
};
return ((_local2.toString() + _local3));
}
private static function uncompressHex(_arg1:String):String{
var _local4:uint;
var _local6:String;
var _local7:uint;
var _local8:String;
var _local2:uint = uint(_arg1.charAt(0));
var _local3 = "";
var _local5:uint = 1;
while (_local5 < _arg1.length) {
_local6 = _arg1.substr(_local5, 4);
_local7 = uint(compressor.decode(_local6));
_local8 = _local7.toString(16);
if ((_local5 + 4) < _arg1.length){
_local4 = 6;
} else {
_local4 = _local2;
};
while (_local8.length < _local4) {
_local8 = ("0" + _local8);
};
_local3 = (_local3 + _local8);
_local5 = (_local5 + 4);
};
return (_local3);
}
public static function getSaveGroupById(_arg1:uint):SaveGroup{
if (((!(_saveGroups)) || ((_saveGroups.length < 1)))){
sendWarning("No save groups found");
return (null);
};
var _local2:uint;
while (_local2 < _saveGroups.length) {
if (_saveGroups[_local2].id == _arg1){
return (_saveGroups[_local2]);
};
_local2++;
};
return (null);
}
public static function getSaveGroupByName(_arg1:String):SaveGroup{
if (((!(_saveGroups)) || ((_saveGroups.length < 1)))){
sendWarning("No save groups found");
return (null);
};
var _local2:uint;
while (_local2 < _saveGroups.length) {
if (_saveGroups[_local2].name == _arg1){
return (_saveGroups[_local2]);
};
_local2++;
};
return (null);
}
public static function createSaveQuery(_arg1:String):SaveGroupQuery{
var _local2:SaveGroup = getSaveGroupByName(_arg1);
if (_local2){
return (_local2.createQuery());
};
return (null);
}
public static function executeSaveQuery(_arg1:SaveGroupQuery):void{
sendCommand("lookupSaveFiles", {publisher_id:publisher_id, group_id:_arg1.groupId, query:JSON.encode(_arg1.toObject())}, false, null, _arg1);
}
public static function checkFilePrivledges(_arg1:SaveFile):void{
sendCommand("checkFilePrivs", {group:_arg1.groupId, filename:_arg1.name, user_id:(user_id) ? user_id : 0, publisher_id:publisher_id});
}
public static function newSaveFile(_arg1:String):SaveFile{
var _local2:SaveGroup = getSaveGroupByName(_arg1);
if (_local2){
return (new SaveFile(_local2));
};
sendError({command_id:"newSaveFile"}, new APIError("INVALID_SAVE_GROUP", (("'" + _local2) + "' is not a valid save group.")));
return (null);
}
public static function saveFile(_arg1:SaveFile, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:Object = _arg1.toObject();
_local4.user_name = user_name;
if (_arg1.id){
_local4.save_id = _arg1.id;
};
_local4.overwrite = (_arg3) ? 1 : 0;
if (_arg2){
_local4.draft = 1;
};
var _local5:ByteArray = new ByteArray();
if ((_arg1.contents is ByteArray)){
_local5.writeByte(0);
_local5.writeBytes(_arg1.contents);
} else {
_local5.writeByte(1);
_local5.writeObject(_arg1.contents);
};
_local5.compress();
var _local6:Object = new Object();
_local6.file = _local5;
if (_arg1.thumbnail){
_local6.thumbnail = PNGEncoder.encode(_arg1.thumbnail);
};
sendSecureCommand("saveFile", _local4, null, _local6, _arg1);
}
public static function rateSaveFile(_arg1:SaveFile, _arg2:SaveRating, _arg3:Number):void{
sendSecureCommand("rateSaveFile", {group:_arg1.groupId, save_id:_arg1.id, rating_id:_arg2.id, vote:_arg3, user_id:user_id}, null, null, _arg1);
}
public static function loadSaveFile(_arg1:Number, _arg2:Boolean=true){
var _local3:Object = {publisher_id:publisher_id, save_id:_arg1, get_contents:_arg2};
trace(JSON.encode(_local3));
sendCommand("loadSaveFile", _local3);
}
private static function doEvent(_arg1:Object):void{
var _local2:String;
var _local3:Object;
var _local4:String;
var _local5:Boolean;
var _local6:ScoreBoard;
var _local7:Array;
var _local8:*;
var _local9:String;
var _local10:Medal;
var _local11:SaveGroup;
var _local12:Object;
var _local13:Object;
var _local14:Object;
var _local15:SaveFile;
var _local16:uint;
var _local17:Object;
var _local18:uint;
switch (getCommandName(_arg1.command_id)){
case "connectMovie":
timeoutTimer.stop();
if (_arg1.success){
sendMessage("You have successfully connected to the Newgrounds API Gateway");
sendMessage((("Movie identified as \"" + _arg1.movie_name) + "\""));
callListener(APIEvent.API_CONNECTED, _arg1.success, {title:_arg1.movie_name});
} else {
callListener(APIEvent.API_CONNECTED, _arg1.success, {});
return;
};
_local5 = false;
if (_arg1.ad_status === -1){
_local2 = "This movie was not approved to run Flash Ads.";
sendWarning(_local2);
sendWarning((("visit " + AD_TERMS_URL) + " to view our approval guidelines"));
if (!_arg1.ad_url){
callListener(APIEvent.ADS_APPROVED, false, new APIError("FLASH_ADS_NOT_APPROVED", _local2));
} else {
_local5 = true;
};
} else {
if (_arg1.ad_status === 0){
_local2 = "Flash Ads are currently awaiting approval.";
sendNotice(_local2);
if (!_arg1.ad_url){
callListener(APIEvent.ADS_APPROVED, false, new APIError("FLASH_ADS_NOT_APPROVED", _local2));
} else {
_local5 = true;
};
};
};
if (_arg1.ad_url){
ad_url = unescape(_arg1.ad_url);
if (!_local5){
sendMessage("This movie has been approved to run Flash Ads!");
};
_adsApproved = true;
callListener(APIEvent.ADS_APPROVED, true);
};
if (_arg1.deny_host){
_local2 = (getHost() + " does not have permission to run this movie!");
sendWarning(_local2);
sendWarning(("\tUpdate your API configuration to unblock " + getHost()));
callListener(APIEvent.HOST_BLOCKED, true, {real_url:unescape(_arg1.movie_url), url:getOfficialURL()});
};
if (_arg1.movie_version){
sendWarning("According to your API Configuration, this version is out of date.");
if (version){
sendWarning(("\tThe this movie is version " + version));
};
sendWarning(("\tThe most current version is " + _arg1.movie_version));
callListener(APIEvent.NEW_VERSION_AVAILABLE, true, {version:_arg1.movie_version, real_url:unescape(_arg1.movie_url), url:getOfficialURL()});
};
if (_arg1.request_portal_url){
sendCommand("setPortalID", {portal_url:_url});
};
sendCommand("preloadSettings", {publisher_id:publisher_id, user_id:user_id});
break;
case "preloadSettings":
if (_arg1.medals){
populateMedals(_arg1.medals);
if (((!(hasUserSession())) && (!(debugMode)))){
echo("Checking for SharedObject Medals...");
_local8 = loadLocal("medals_unlocked");
if (_local8){
for (_local9 in _local8) {
if (_local8[_local9]){
_local10 = getMedalById(uint(_local9));
echo(("Now unlocking " + _local10.name));
_local10.unlocked = true;
};
};
};
};
};
if (_arg1.save_groups){
populateSaveGroups(_arg1.save_groups);
};
if (_arg1.save_file_path){
_saveFilePath = (_arg1.save_file_path + "/");
};
if (_arg1.image_file_path){
_imageFilePath = (_arg1.image_file_path + "/");
};
if (_arg1.score_boards){
populateScoreBoards(_arg1.score_boards);
};
sendMessage("Metadata loaded!");
callListener(APIEvent.METADATA_LOADED, _arg1.success);
if (((_saveFileId) && (_saveGroupId))){
_local11 = getSaveGroupById(_saveGroupId);
if (_local11){
callListener(APIEvent.FILE_REQUESTED, true, {save_id:_saveFileId, group:_local11});
};
};
_preloadComplete = true;
break;
case "logCustomEvent":
if (_arg1.success){
sendMessage((("Event '" + _arg1.event) + "' was logged."));
};
callListener(APIEvent.EVENT_LOGGED, _arg1.success, {event:_arg1.event});
break;
case "postScore":
if (_arg1.success){
_local4 = "User";
if (user_email){
_local4 = user_email;
} else {
if (user_name){
_local4 = user_name;
};
};
_local6 = getScoreBoardById(_arg1.board);
if (_local6){
sendMessage((((((_local4 + " posted ") + _arg1.value) + " to '") + _local6.name) + "'"));
};
if (_arg1.best_scores){
_local12 = {today:_arg1.best_scores.D, yesterday:_arg1.best_scores.P, week:_arg1.best_scores.W, year:_arg1.best_scores.Y, all_time:_arg1.best_scores.A};
} else {
_local12 = {};
};
if (_arg1.best_ranks){
_local13 = {today:_arg1.best_ranks.D, yesterday:_arg1.best_ranks.P, week:_arg1.best_ranks.W, year:_arg1.best_ranks.Y, all_time:_arg1.best_ranks.A};
} else {
_local13 = {};
};
if (_arg1.num_scores){
_local14 = {today:_arg1.num_scores.D, yesterday:_arg1.num_scores.P, week:_arg1.num_scores.W, year:_arg1.num_scores.Y, all_time:_arg1.num_scores.A};
} else {
_local14 = {};
};
_local3 = {score:_arg1.score, value:_arg1.value, username:_local4, best_scores:_local12, best_ranks:_local13, num_scores:_local14};
};
callListener(APIEvent.SCORE_POSTED, _arg1.success, _local3);
break;
case "loadScores":
_local3 = new Object();
_local6 = getScoreBoardById(_arg1.board);
if (_local6){
_local6.setScores(_arg1.scores, _arg1.period, _arg1.page, _arg1.num_results, _arg1.num_scores);
};
callListener(APIEvent.SCORES_LOADED, _arg1.success, _local6);
break;
case "unlockMedal":
if (_medals){
_local10 = getMedalByName(_arg1.medal_name);
if (_local10.unlocked){
return;
};
_local10.unlocked = true;
callListener(APIEvent.MEDAL_UNLOCKED, _arg1.success, _local10);
};
break;
case "getMedals":
if (_arg1.success){
populateMedals(_arg1.medals);
};
callListener(APIEvent.MEDALS_LOADED, _arg1.success, _local3);
break;
case "loadSaveFile":
if (_arg1.success){
trace(JSON.encode(_arg1));
_local11 = getSaveGroupById(_arg1.group_id);
_local15 = new SaveFile(_local11);
_local15.id = _arg1.file.save_id;
_local15.name = _arg1.file.filename;
_local15.fileUrl = (_saveFilePath + _arg1.file.file);
_local15.thumbnailUrl = (_imageFilePath + _arg1.file.thumb);
_local15.authorName = _arg1.file.user_name;
_local15.authorId = _arg1.file.user_id;
_local15.setStatus(_arg1.file.status);
_local15.description = _arg1.file.description;
if (((_arg1.file.keys) && (_arg1.file.keys.length))){
_local16 = 0;
while (_local16 < _arg1.file.keys.length) {
_local15.setKey(_arg1.file.keys[_local16].id, _arg1.file.keys[_local16].value);
_local16++;
};
};
if (((_arg1.file.ratings) && (_arg1.file.ratings.length))){
_local16 = 0;
while (_local16 < _arg1.file.ratings.length) {
_local15.setRating(_arg1.file.ratings[_local16].id, _arg1.file.ratings[_local16].votes, _arg1.file.ratings[_local16].score);
_local16++;
};
};
if (_arg1.get_contents){
_local15.loadContents();
};
};
callListener(APIEvent.FILE_INITIALIZED, _arg1.success, _local15);
break;
case "lookupSaveFiles":
_local7 = [];
if (((_arg1.success) && (_arg1.files))){
_local16 = 0;
while (_local16 < _arg1.files.length) {
_local17 = _arg1.files[_local16];
_local15 = new SaveFile(getSaveGroupById(_arg1.group_id));
_local15.name = _local17.filename;
_local15.id = _local17.save_id;
_local15.description = _local17.description;
_local15.thumbnailUrl = (_imageFilePath + _local17.thumb);
_local15.fileUrl = (_saveFilePath + _local17.file);
_local15.authorName = _local17.user_name;
_local15.authorId = _local17.user_id;
_local15.setStatus(_local17.status);
if (((_local17.keys) && (_local17.keys.length))){
_local18 = 0;
while (_local18 < _local17.keys.length) {
_local15.setKey(_local17.keys[_local18].id, _local17.keys[_local18].value);
_local18++;
};
};
if (((_local17.ratings) && (_local17.ratings.length))){
_local18 = 0;
while (_local18 < _local17.ratings.length) {
_local15.setRating(_local17.ratings[_local18].id, _local17.ratings[_local18].votes, _local17.ratings[_local18].score);
_local18++;
};
};
_local7.push(_local15);
_local16++;
};
};
_arg1.owner.dispatchEvent(new APIEvent(APIEvent.QUERY_COMPLETE, _arg1.success, _local7));
break;
case "rateSaveFile":
_local15 = _arg1.owner;
_arg1.success = ((_arg1.success) && (!(_arg1.already_voted)));
if (_arg1.success){
_local15.setRating(_arg1.rating_id, _arg1.votes, _arg1.score);
};
_arg1.file = _local15;
_local15.dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, _arg1.success, _arg1));
break;
case "saveFile":
_local3 = {};
if (_arg1.success){
_local3 = {save_id:_arg1.save_id, filename:_arg1.filename, file_url:_arg1.file_url, thumbnail:_arg1.thumbnail, icon:_arg1.icon};
SaveFile(_arg1.owner).fileSaved(_local3);
};
_arg1.owner.dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, _arg1.success, _local3));
break;
case "checkFilePrivs":
_local3 = {filename:_arg1.filename, folder:_arg1.folder, can_read:_arg1.can_read, can_write:_arg1.can_write};
callListener(APIEvent.FILE_PRIVS_LOADED, _arg1.success, _local3);
break;
};
}
public static function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:uint=0, _arg5:Boolean=false):void{
_eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public static function hasEventListener(_arg1:String):Boolean{
return (_eventDispatcher.hasEventListener(_arg1));
}
public static function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
private static function dispatchEvent(_arg1:Event):void{
_eventDispatcher.dispatchEvent(_arg1);
echo(("Fired Event: " + _arg1.type));
}
static function callListener(_arg1:String, _arg2:Boolean=true, _arg3=undefined):void{
dispatchEvent(new APIEvent(_arg1, _arg2, _arg3));
if (_bridge){
_bridge.sendEvent(_arg1, {success:_arg2, data:_arg3});
};
}
private static function getCommandName(_arg1:String):String{
return (_arg1);
}
private static function getCommandID(_arg1:String):String{
return (_arg1);
}
private static function getPeriodAliases():Object{
var _local2:String;
var _local1:Object = new Object();
for (_local2 in period_aliases) {
_local1[period_aliases[_local2].alias] = _local2;
};
return (_local1);
}
public static function getPeriodName(_arg1:String):String{
var _local2:String;
for (_local2 in period_aliases) {
if (_local2 == _arg1){
return (period_aliases[_local2].name);
};
};
return (null);
}
public static function getPeriodAlias(_arg1:String):String{
var _local2:String;
for (_local2 in period_aliases) {
if (_local2 == _arg1){
return (period_aliases[_local2].alias);
};
};
return (null);
}
private static function sendError(_arg1:Object, _arg2:APIError):void{
var _local3:String = ((((("[NewgroundsAPI ERROR] :: " + getCommandName(_arg1.command_id)) + "() - ") + _arg2.name) + ":\n\t\t\t\t") + _arg2.message);
trace(_local3);
if (_bridge){
_bridge.sendEvent("trace", {data:_local3});
};
}
private static function sendWarning(_arg1:String, _arg2:String=null):void{
if (_arg2){
_arg1 = (_arg1 + ((("\n[NewgroundsAPI WARNING] :: \tSee " + COMMANDS_WIKI_URL) + _arg2.toLowerCase()) + " for additional information."));
};
trace(_arg1);
if (_bridge){
_bridge.sendEvent("trace", {data:_arg1});
};
}
private static function sendNotice(_arg1:String, _arg2:String=null):void{
var _local3:String;
if (_arg2){
_arg1 = (_arg1 + ((("\n[NewgroundsAPI NOTICE] :: \tSee " + COMMANDS_WIKI_URL) + _arg2.toLowerCase()) + " for additional information."));
};
trace(_arg1);
if (_bridge){
_bridge.sendEvent("trace", {data:_arg1});
};
}
private static function fatalError(_arg1:String, _arg2:String):void{
if (_arg2){
_arg1 = (_arg1 + ((("\n\tSee " + COMMANDS_WIKI_URL) + _arg2.toLowerCase()) + " for additional information."));
};
throw (new Error(("***ERROR*** class=API\n\n" + _arg1)));
}
public static function sendSecureCommand(_arg1:String, _arg2:Object, _arg3:Object=null, _arg4:Object=null, _arg5=null):void{
if (((((!(debugMode)) && (!(hasUserSession())))) && (!(hasUserEmail())))){
sendError({command_id:getCommandID(_arg1)}, new APIError("IDENTIFICATION_REQUIRED", (("You must be logged in or provide an e-mail address ( using NewgroundsAPI.setUserEmail(\"name@domain.com\"); ) to use " + _arg1) + "().")));
return;
};
if (!_arg1){
fatalError("Missing command", "sendSecureCommand");
};
if (!_arg2){
fatalError("Missing secure_params", "sendSecureCommand");
};
if (!_arg3){
_arg3 = new Object();
};
var _local6 = "";
var _local7:uint;
while (_local7 < 16) {
_local6 = (_local6 + compression_radix.charAt(Math.floor((Math.random() * compression_radix.length))));
_local7++;
};
if (((debugMode) && (!(session_id)))){
_arg2.session_id = "";
} else {
_arg2.session_id = session_id;
};
_arg2.as_version = 3;
_arg2.user_email = user_email;
_arg2.publisher_id = publisher_id;
_arg2.seed = _local6;
_arg2.command_id = getCommandID(_arg1);
var _local8:String = MD5.hash(_local6);
var _local9:String = RC4.encrypt(JSON.encode(_arg2), _encryptionKey);
var _local10:String = (_local8 + _local9);
_arg3.secure = compressHex(_local10);
secureCommand = _arg1;
sendCommand("securePacket", _arg3, false, _arg4, _arg5);
}
public static function stopPendingCommands():void{
SmartURLLoader.closeAll();
}
private static function onCommandComplete(_arg1:Event):void{
var response:Object;
var error:APIError;
var e = _arg1;
var loader:SmartURLLoader = SmartURLLoader(e.target);
echo((("INPUT: \n" + loader.response) + "\n"));
var i:uint;
while (i < _preloadAssets.length) {
if (_preloadAssets[i] == loader){
_preloadAssets.splice(i, 1);
break;
};
i = (i + 1);
};
try {
response = JSON.decode(loader.response);
} catch(error:Error) {
response = {success:false};
};
if (!response){
response = {command_id:loader._command, success:false};
};
response.owner = loader.owner;
if (((!(response)) || (!(response.success)))){
trace(("Error: " + response));
error = new APIError(response.error_code, response.error_msg);
sendError(response, error);
if (response.command_id){
doEvent(response);
};
} else {
doEvent(response);
};
}
private static function onCommandError(_arg1:Event):void{
var _local2:Object = {success:false};
var _local3:SmartURLLoader = SmartURLLoader(_arg1.target);
_local2.owner = _local3.owner;
var _local4:uint;
while (_local4 < _preloadAssets.length) {
if (_preloadAssets[_local4] == _local3){
_preloadAssets.splice(_local4, 1);
break;
};
_local4++;
};
if (_local3._command){
_local2.command_id = _local3._command;
doEvent(_local2);
};
}
private static function sendCommand(_arg1:String, _arg2:Object, _arg3:Boolean=false, _arg4:Object=null, _arg5=null):void{
var _local7:String;
var _local8:String;
var _local9:String;
if (((!(connected)) && (!((_arg1 == "connectMovie"))))){
_local7 = (("NewgroundsAPI." + _arg1) + "() - NewgroundsAPI.connectMovie() must be called before this command can be called\n");
fatalError(_local7, "connectMovie");
};
var _local6:SmartURLLoader = new SmartURLLoader();
_local6.addVariable("command_id", getCommandID(_arg1));
_local6.addVariable("tracker_id", _movieId);
if (debugMode){
_local6.addVariable("debug", 1);
};
if (_arg2){
for (_local8 in _arg2) {
_local6.addVariable(_local8, _arg2[_local8]);
};
};
if (_arg4){
for (_local9 in _arg4) {
_local6.addFile(_local9, _arg4[_local9], _local9);
};
};
if (_arg3){
_local6.method = URLRequestMethod.GET;
} else {
_local6.method = URLRequestMethod.POST;
};
_local6.preventCache = true;
if (_arg3){
_local6.openBrowser = true;
_local6.method = URLRequestMethod.GET;
} else {
_local6.addEventListener(Event.COMPLETE, onCommandComplete);
_local6.addEventListener(IOErrorEvent.IO_ERROR, onCommandError);
_local6.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onCommandError);
_local6.method = URLRequestMethod.POST;
};
if (_arg2.secure){
_local6._command = secureCommand;
} else {
_local6._command = getCommandID(_arg1);
};
_local6.owner = _arg5;
_local6.load(GATEWAY_URL);
}
public static function isFlashVersion(_arg1:uint, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0):Boolean{
var _local6:Array = Capabilities.version.split(" ")[1].split(",");
var _local7:Array = arguments;
var _local8:uint;
while (_local8 < _local7.length) {
_local6[_local8] = uint(_local6[_local8]);
_local8++;
};
_local8 = 0;
while (_local8 < _local7.length) {
if (_local6[_local8] > _local7[_local8]){
return (true);
};
if (_local6[_local8] < _local7[_local8]){
return (false);
};
_local8++;
};
return (true);
}
public static function createAd():FlashAd{
sendMessage("You may see a security sandbox violation. This is normal!");
return (new FlashAd());
}
public static function sendMessage(_arg1:String, _arg2:Boolean=false):void{
var _local3:String = ("[NewgroundsAPI] :: " + _arg1);
trace(_local3);
if (_bridge){
_bridge.sendEvent("trace", {data:_local3});
};
}
private static function echo(_arg1:String):void{
if (do_echo){
trace(_arg1);
};
}
}
}//package com.newgrounds
Section 28
//APIError (com.newgrounds.APIError)
package com.newgrounds {
import flash.utils.*;
public class APIError {
public var code:Number;// = 0
public var message:String;
public var name:String;
public var alias:String;
public static const aliases:Array = new Array("UNKNOWN_ERROR", "INVALID_API_ID", "MISSING_PARAM", "INVALID_STAT_ID", "INVALID_COMMAND_ID", "FLASH_ADS_NOT_APPROVED", "PERMISSION_DENIED", "IDENTIFICATION_REQUIRED", "INVALID_EMAIL_ADDRESS", "BANNED_USER", "SESSION_EXPIRED", "INVALID_SCORE", "INVALID_MEDAL", "INVALID_FOLDER", "FILE_NOT_FOUND", "SITE_ID_REQUIRED", "UPLOAD_IN_PROGRESS", "USER_CANCELLED", "CONFIRM_REQUEST", "CONNECTION_FAILED");
private static const always_caps:Array = new Array("API", "URL", "ID");
public static const error_codes:Object = init_codes();
public static const error_names:Object = init_names();
public function APIError(_arg1, _arg2:String){
if ((_arg1 is String)){
_arg1 = error_codes[_arg1];
} else {
if (!(_arg1 is uint)){
_arg1 = 0;
};
};
this.code = _arg1;
this.message = _arg2;
this.name = error_names[_arg1];
this.alias = aliases[_arg1];
}
public function isError():Boolean{
return (true);
}
public static function init_codes():Dictionary{
var _local1:Dictionary = new Dictionary();
var _local2:uint;
while (_local2 < aliases.length) {
_local1[aliases[_local2]] = _local2;
_local2++;
};
return (_local1);
}
private static function init_names():Array{
var _local3:Array;
var _local4:uint;
var _local5:String;
var _local1:Array = new Array();
var _local2:uint;
while (_local2 < aliases.length) {
_local3 = aliases[_local2].toLowerCase().split("_");
_local4 = 0;
while (_local4 < _local3.length) {
_local3[_local4] = (_local3[_local4].substr(0, 1).toUpperCase() + _local3[_local4].substr(1, _local3[_local4].length));
for each (_local5 in always_caps) {
if (_local3[_local4].toUpperCase() == _local5){
_local3[_local4] = _local3[_local4].toUpperCase();
};
};
_local4++;
};
_local1[_local2] = _local3.join(" ");
_local2++;
};
return (_local1);
}
}
}//package com.newgrounds
Section 29
//APIEvent (com.newgrounds.APIEvent)
package com.newgrounds {
import flash.events.*;
public class APIEvent extends Event {
private var _data;
private var _success:Boolean;
private var _target;
private var _error:APIError;
public static const API_CONNECTED:String = "movieConnected";
public static const ADS_APPROVED:String = "adsApproved";
public static const AD_ATTACHED:String = "adAttached";
public static const HOST_BLOCKED:String = "hostBlocked";
public static const NEW_VERSION_AVAILABLE:String = "newVersionAvailable";
public static const EVENT_LOGGED:String = "eventLogged";
public static const SCORE_POSTED:String = "scorePosted";
public static const SCORES_LOADED:String = "scoresLoaded";
public static const MEDAL_UNLOCKED:String = "medalUnlocked";
public static const MEDALS_LOADED:String = "medalsLoaded";
public static const METADATA_LOADED:String = "metadataLoaded";
public static const FILE_PRIVS_LOADED:String = "filePrivsLoaded";
public static const FILE_SAVED:String = "fileSaved";
public static const FILE_LOADED:String = "fileLoaded";
public static const FILE_INITIALIZED:String = "fileInitialized";
public static const FILE_REQUESTED:String = "fileRequested";
public static const QUERY_COMPLETE:String = "queryComplete";
public static const VOTE_COMPLETE:String = "voteComplete";
public function APIEvent(_arg1:String, _arg2:Boolean=true, _arg3=undefined){
super(_arg1);
this._data = _arg3;
this._success = _arg2;
}
public function get success():Boolean{
return (this._success);
}
public function get data(){
return (this._data);
}
}
}//package com.newgrounds
Section 30
//BaseN (com.newgrounds.BaseN)
package com.newgrounds {
import flash.utils.*;
public class BaseN {
private var _hashIndex:String;
private var _hashVal:Dictionary;
private var _base:Number;
public function BaseN(_arg1:String=null){
if (_arg1){
this._hashIndex = _arg1;
} else {
this._hashIndex = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
};
this._base = this._hashIndex.length;
this._hashVal = new Dictionary();
var _local2:uint;
while (_local2 < this._base) {
this._hashVal[this._hashIndex.charAt(_local2)] = _local2;
_local2++;
};
}
public function encode(_arg1:Number, _arg2:uint=1):String{
var _local3:String = _arg1.toString();
var _local4 = "";
if (_local3.charAt(0) == "-"){
_local4 = "-";
_local3 = _local3.substring(1);
};
var _local5:Array = _local3.split(".", 2);
_local4 = (_local4 + this.baseNEncoder(_local5[0], _arg2));
if (_local5.length > 1){
_local4 = (_local4 + ("." + this.baseNEncoder(_local5[1])));
};
return (_local4);
}
public function decode(_arg1:String):Number{
var _local2 = "";
if (_arg1.charAt(0) == "-"){
_local2 = "-";
_arg1 = _arg1.substring(1);
};
var _local3:Array = _arg1.split(".", 2);
_local2 = (_local2 + this.baseNDecoder(_local3[0]));
if (_local3.length > 1){
_local2 = (_local2 + ".");
_local2 = (_local2 + this.baseNDecoder(_local3[1]));
};
return (Number(_local2));
}
private function baseNEncoder(_arg1:uint, _arg2:uint=1):String{
var _local3 = "";
var _local4:uint = _arg1;
while (_local4 != 0) {
_local3 = (this._hashIndex.charAt((_local4 % this._base)) + _local3);
_local4 = (_local4 / this._base);
};
if (_arg2){
while (_local3.length < _arg2) {
_local3 = (this._hashIndex.charAt(0) + _local3);
};
};
return (_local3);
}
private function baseNDecoder(_arg1:String):uint{
var _local2:uint;
var _local3:uint;
while (_local3 < _arg1.length) {
_local2 = (_local2 * this._base);
_local2 = (_local2 + this._hashVal[_arg1.charAt(_local3)]);
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds
Section 31
//Bridge (com.newgrounds.Bridge)
package com.newgrounds {
import flash.events.*;
import flash.net.*;
public class Bridge {
private var _inConnection:LocalConnection;
private var _outConnection:LocalConnection;
private var _widgetId:String;
public function Bridge(_arg1:String){
this._widgetId = _arg1;
this._inConnection = new LocalConnection();
this._outConnection = new LocalConnection();
this._inConnection.client = this;
this._inConnection.connect(("rec_" + this._widgetId));
this._outConnection.addEventListener(StatusEvent.STATUS, this.onStatus);
}
public function sendCommand(_arg1:String, _arg2:Object):void{
if (this._outConnection){
this._outConnection.send(this._widgetId, "sendCommand", _arg1, this.scrubParameters(_arg2));
};
}
public function sendEvent(_arg1:String, _arg2:Object):void{
if (this._outConnection){
this._outConnection.send(this._widgetId, "sendEvent", _arg1, this.scrubParameters(_arg2));
};
}
public function receiveEvent(_arg1:String, _arg2:Object):void{
API.callListener(_arg1, _arg2.success, _arg2.data);
}
public function scrubParameters(_arg1:Object):Object{
var _local3:String;
var _local2:Object = new Object();
for (_local3 in _arg1) {
if ((((((((((_arg1[_local3] is String)) || ((_arg1[_local3] is Number)))) || ((_arg1[_local3] is uint)))) || ((_arg1[_local3] is int)))) || ((_arg1[_local3] is Boolean)))){
_local2[_local3] = _arg1[_local3];
};
};
return (_local2);
}
private function onStatus(_arg1:Event):void{
}
}
}//package com.newgrounds
Section 32
//Medal (com.newgrounds.Medal)
package com.newgrounds {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class Medal {
private var _id:uint;
private var _name:String;
private var _value:uint;
private var _difficultyId:uint;
private var _unlocked:Boolean;// = false
private var _iconUrl:URLRequest;
private var _iconLoader:Loader;
private var _icon:BitmapData;
private static const DEFAULT_ICON:BitmapData = new BitmapData(50, 50, false, 0);
private static const DIFFICULT_NAMES:Array = [null, "Easy", "Moderate", "Challenging", "Difficult", "Brutal"];
public function Medal(_arg1:uint, _arg2:String, _arg3:uint, _arg4:uint, _arg5:Boolean, _arg6:String){
var id = _arg1;
var name = _arg2;
var value = _arg3;
var difficulty = _arg4;
var unlocked = _arg5;
var iconUrl = _arg6;
this._icon = DEFAULT_ICON;
super();
this._id = id;
this._name = name;
this._value = value;
this._difficultyId = difficulty;
this._unlocked = unlocked;
if (iconUrl){
this._iconUrl = new URLRequest(iconUrl);
this._iconLoader = new Loader();
this._iconLoader.contentLoaderInfo.addEventListener(Event.INIT, this.onIconLoaderInit);
this._iconLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onIconLoaderError);
this._iconLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onIconLoaderError);
this._iconLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onIconLoaderComplete);
try {
this._iconLoader.load(this._iconUrl, new LoaderContext(true));
} catch(e:Error) {
onIconLoaderError(null);
};
};
}
public function get difficulty():String{
return (DIFFICULT_NAMES[this._difficultyId]);
}
public function get difficultyId():uint{
return (this._difficultyId);
}
public function get icon():BitmapData{
return (this._icon);
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get unlocked():Boolean{
return (this._unlocked);
}
public function set unlocked(_arg1:Boolean):void{
this._unlocked = _arg1;
}
public function get value():uint{
return (this._value);
}
public function get bytesLoaded():uint{
return ((this._iconLoader) ? this._iconLoader.contentLoaderInfo.bytesLoaded : 0);
}
public function get bytesTotal():uint{
return ((this._iconLoader) ? this._iconLoader.contentLoaderInfo.bytesTotal : 0);
}
private function onIconLoaderInit(_arg1:Event):void{
}
private function onIconLoaderError(_arg1:IOErrorEvent):void{
trace((((("[NewgroundsAPI WARNING] :: Failed to load medal icon for " + this.name) + " (") + this._iconUrl.url.split("/").pop()) + ")"));
this._iconLoader.unload();
this._iconLoader = null;
}
private function onIconLoaderComplete(_arg1:Event):void{
var _local2:Bitmap = (this._iconLoader.content as Bitmap);
this._icon = _local2.bitmapData;
this._iconLoader.unload();
this._iconLoader = null;
}
public function unlock():void{
if (!this._unlocked){
API.unlockMedal(this._name);
};
}
public function createIconBitmap():Bitmap{
return (new Bitmap(this.icon));
}
public function toString():String{
return (this._name);
}
public static function createFromObject(_arg1:Object):Medal{
return (new Medal(_arg1.medal_id, _arg1.medal_name, _arg1.medal_value, _arg1.medal_difficulty, _arg1.medal_unlocked, _arg1.medal_icon));
}
}
}//package com.newgrounds
Section 33
//RC4 (com.newgrounds.RC4)
package com.newgrounds {
public class RC4 {
private static var sbox:Array = new Array(0xFF);
private static var mykey:Array = new Array(0xFF);
public static function encrypt(_arg1:String, _arg2:String):String{
var _local3:Array = strToChars(_arg1);
var _local4:Array = strToChars(_arg2);
var _local5:Array = calculate(_local3, _local4);
return (charsToHex(_local5));
}
public static function encryptbin(_arg1:String, _arg2:String):Array{
var _local3:Array = strToChars(_arg1);
var _local4:Array = strToChars(_arg2);
var _local5:Array = calculate(_local3, _local4);
return (_local5);
}
public static function decrypt(_arg1:String, _arg2:String):String{
var _local3:Array = hexToChars(_arg1);
var _local4:Array = strToChars(_arg2);
var _local5:Array = calculate(_local3, _local4);
return (charsToStr(_local5));
}
private static function initialize(_arg1:Array):void{
var _local3:uint;
var _local2:uint;
var _local4:uint = _arg1.length;
var _local5:uint;
while (_local5 <= 0xFF) {
mykey[_local5] = _arg1[(_local5 % _local4)];
sbox[_local5] = _local5;
_local5++;
};
_local5 = 0;
while (_local5 <= 0xFF) {
_local2 = (((_local2 + sbox[_local5]) + mykey[_local5]) % 0x0100);
_local3 = sbox[_local5];
sbox[_local5] = sbox[_local2];
sbox[_local2] = _local3;
_local5++;
};
}
private static function calculate(_arg1:Array, _arg2:Array):Array{
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local10:uint;
initialize(_arg2);
var _local3:uint;
var _local4:uint;
var _local5:Array = new Array();
var _local9:uint;
while (_local9 < _arg1.length) {
_local3 = ((_local3 + 1) % 0x0100);
_local4 = ((_local4 + sbox[_local3]) % 0x0100);
_local7 = sbox[_local3];
sbox[_local3] = sbox[_local4];
sbox[_local4] = _local7;
_local10 = ((sbox[_local3] + sbox[_local4]) % 0x0100);
_local6 = sbox[_local10];
_local8 = (_arg1[_local9] ^ _local6);
_local5.push(_local8);
_local9++;
};
return (_local5);
}
private static function charsToHex(_arg1:Array):String{
var _local2:String = new String("");
var _local3:Array = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local4:uint;
while (_local4 < _arg1.length) {
_local2 = (_local2 + (_local3[(_arg1[_local4] >> 4)] + _local3[(_arg1[_local4] & 15)]));
_local4++;
};
return (_local2);
}
private static function hexToChars(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:uint = ((_arg1.substr(0, 2))=="0x") ? 2 : 0;
while (_local3 < _arg1.length) {
_local2.push(parseInt(_arg1.substr(_local3, 2), 16));
_local3 = (_local3 + 2);
};
return (_local2);
}
private static function charsToStr(_arg1:Array):String{
var _local2:String = new String("");
var _local3:uint;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(_arg1[_local3]));
_local3++;
};
return (_local2);
}
private static function strToChars(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:uint;
while (_local3 < _arg1.length) {
_local2.push(_arg1.charCodeAt(_local3));
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds
Section 34
//SaveFile (com.newgrounds.SaveFile)
package com.newgrounds {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
public class SaveFile extends EventDispatcher {
private var _filename:String;
private var _id:uint;
private var _description:String;
private var _contents;
private var _loader:SmartURLLoader;
private var _group:SaveGroup;
private var _keys:Dictionary;
private var _ratings:Dictionary;
private var _fileUrl:String;
private var _thumbnail:BitmapData;
private var _thumbnailUrl:String;
private var _authorId:uint;
private var _authorName:String;
private var _contentSize:uint;
private var _status:uint;
public static const STATUS_PRIVATE = 1;
public static const STATUS_SHARED = 2;
public static const STATUS_UNAPPROVED = 3;
public static const STATUS_APPROVED = 4;
public function SaveFile(_arg1:SaveGroup){
this._keys = new Dictionary();
this._ratings = new Dictionary();
this._group = _arg1;
this._description = "";
}
public function get name():String{
return (this._filename);
}
public function set name(_arg1:String):void{
this._filename = _arg1;
}
public function get id():uint{
return (this._id);
}
public function set id(_arg1:uint):void{
this._id = _arg1;
}
public function get description():String{
return (this._description);
}
public function set description(_arg1:String):void{
this._description = _arg1;
}
public function get contents(){
return (this._contents);
}
public function set contents(_arg1):void{
this._contents = _arg1;
this._contentSize = 0;
}
public function get thumbnailUrl():String{
return (this._thumbnailUrl);
}
public function set thumbnailUrl(_arg1:String):void{
this._thumbnailUrl = _arg1;
}
public function get fileUrl():String{
return (this._fileUrl);
}
public function set fileUrl(_arg1:String):void{
this._fileUrl = _arg1;
}
public function get thumbnail():BitmapData{
return (this._thumbnail);
}
public function set thumbnail(_arg1:BitmapData):void{
if (this._thumbnail){
this._thumbnail.dispose();
};
this._thumbnail = _arg1.clone();
}
public function loadThumbnail():Loader{
var _local1:Loader = new Loader();
if (this._thumbnailUrl){
_local1.load(new URLRequest(this._thumbnailUrl));
};
return (_local1);
}
public function get bytesLoaded():uint{
return ((this._loader) ? this._loader.bytesLoaded : this._contentSize);
}
public function get bytesTotal():uint{
return ((this._loader) ? this._loader.bytesTotal : this._contentSize);
}
public function get status():uint{
return (this._status);
}
function setStatus(_arg1:uint):void{
this._status = _arg1;
}
public function get groupId():uint{
return (this._group.id);
}
public function get groupName():String{
return (this._group.name);
}
public function get groupType():uint{
return (this._group.type);
}
public function get authorName():String{
return (this._authorName);
}
public function set authorName(_arg1:String):void{
this._authorName = _arg1;
}
public function get authorId():uint{
return (this._authorId);
}
public function set authorId(_arg1:uint):void{
this._authorId = _arg1;
}
public function get shared():Boolean{
return (true);
}
public function setKey(_arg1, _arg2):void{
var _local3:SaveKey;
if ((_arg1 is String)){
_local3 = this._group.getKeyByName(_arg1);
} else {
_local3 = this._group.getKeyById(_arg1);
};
if (_local3){
this._keys[_local3] = {id:_local3.id, val:_arg2};
};
}
public function getKey(_arg1){
var _local2:SaveKey;
if ((_arg1 is String)){
_local2 = this._group.getKeyByName(_arg1);
} else {
_local2 = this._group.getKeyById(_arg1);
};
if (_local2){
return (this._keys[_local2]);
};
return (null);
}
public function setRating(_arg1, _arg2:Number, _arg3:Number):void{
var _local4:SaveRating;
if ((_arg1 is String)){
_local4 = this._group.getRatingByName(_arg1);
} else {
_local4 = this._group.getRatingById(_arg1);
};
if (_local4){
this._ratings[_local4] = {id:_local4.id, name:_local4.name, votes:_arg2, score:_arg3};
};
}
public function getRating(_arg1):Object{
var _local2:SaveRating;
if ((_arg1 is String)){
_local2 = this._group.getRatingByName(_arg1);
} else {
_local2 = this._group.getRatingById(_arg1);
};
if (_local2){
return (this._ratings[_local2]);
};
return (null);
}
public function sendRating(_arg1:String, _arg2:Number):void{
var _local3:SaveRating = this._group.getRatingByName(_arg1);
if (!_local3){
trace((("[NewgroundsAPISaveFile] " + _arg1) + " is not a recognized save file"));
return;
};
if ((((_arg2 < _local3.minValue)) || ((_arg2 > _local3.maxValue)))){
trace(((("[NewgroundsAPISaveFile] Vote must be between " + _local3.minValue) + " and ") + _local3.maxValue));
return;
};
_local3.voted = true;
API.rateSaveFile(this, _local3, _arg2);
}
override public function toString():String{
var _local2:Object;
var _local3:Object;
var _local1 = (((((("Save File " + this._filename) + " ID: ") + this._id) + "\n ") + this._description) + "\n");
for each (_local2 in this._keys) {
_local1 = (_local1 + ((((" " + this._group.getKeyById(_local2.id).name) + ": ") + _local2.val) + "\n"));
};
for each (_local3 in this._ratings) {
_local1 = (_local1 + ((((((" " + this._group.getRatingById(_local3.id).name) + "\n Score: ") + _local3.score) + " Votes: ") + _local3.votes) + "\n"));
};
return (_local1);
}
public function toObject():Object{
var _local2:Object;
var _local1:Object = {group:this.groupId, filename:this.name, description:this.description, shared:true};
_local1.keys = [];
for each (_local2 in this._keys) {
_local1.keys.push({id:_local2.id, value:_local2.val});
};
return (_local1);
}
public function save(_arg1:Boolean=false, _arg2:Boolean=false):void{
API.saveFile(this, _arg1, _arg2);
}
public function loadContents():void{
if (this._fileUrl){
this._loader = new SmartURLLoader();
this._loader.responseFormat = URLLoaderDataFormat.BINARY;
this._loader.addEventListener(Event.COMPLETE, this.onContentsLoaded);
this._loader.addEventListener(IOErrorEvent.IO_ERROR, this.onContentsError);
this._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onContentsError);
this._loader.load(this._fileUrl);
};
}
private function onContentsError(_arg1:Event):void{
this._loader = null;
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, false));
this._contentSize = 0;
}
private function onContentsLoaded(_arg1:Event):void{
var _local2:ByteArray = _arg1.target.response;
this._contentSize = _local2.length;
_local2.uncompress();
var _local3:uint = _local2.readUnsignedByte();
if (_local3 == 0){
this._contents = new ByteArray();
this._contents.writeBytes(_local2, 1);
} else {
this._contents = _local2.readObject();
};
this._loader = null;
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, true, this.contents));
}
public function loadAuthorPage(){
API.loadUserPage(this._authorId, this._authorName);
}
function fileSaved(_arg1:Object):void{
this._id = _arg1.save_id;
this._thumbnailUrl = _arg1.thumbnail;
this._fileUrl = _arg1.file_url;
}
}
}//package com.newgrounds
Section 35
//SaveGroup (com.newgrounds.SaveGroup)
package com.newgrounds {
public class SaveGroup {
private var _name:String;
private var _id:uint;
private var _type:uint;
private var _keys:Array;
private var _ratings:Array;
private var _files:Array;
public static const TYPE_SYSTEM:uint = 0;
public static const TYPE_PRIVATE:uint = 1;
public static const TYPE_PUBLIC:uint = 2;
public static const TYPE_MODERATED:uint = 3;
public function SaveGroup(_arg1:uint, _arg2:String, _arg3:uint){
this._name = _arg2;
this._id = _arg1;
this._type = _arg3;
this._ratings = [];
this._keys = [];
this._files = [];
}
public function get name():String{
return (this._name);
}
public function get id():uint{
return (this._id);
}
public function get type():uint{
return (this._type);
}
public function get keys():Array{
return (this._keys.concat());
}
public function get ratings():Array{
return (this._ratings.concat());
}
public function addRating(_arg1:SaveRating):void{
this._ratings.push(_arg1);
}
public function getRatingById(_arg1:uint):SaveRating{
var _local2:uint;
while (_local2 < this._ratings.length) {
if (this._ratings[_local2].id == _arg1){
return (this._ratings[_local2]);
};
_local2++;
};
return (null);
}
public function getRatingByName(_arg1:String):SaveRating{
var _local2:uint;
while (_local2 < this._ratings.length) {
if (this._ratings[_local2].name == _arg1){
return (this._ratings[_local2]);
};
_local2++;
};
return (null);
}
public function addKey(_arg1:SaveKey):void{
this._keys.push(_arg1);
}
public function getKeyById(_arg1:uint):SaveKey{
var _local2:uint;
while (_local2 < this._keys.length) {
if (this._keys[_local2].id == _arg1){
return (this._keys[_local2]);
};
_local2++;
};
return (null);
}
public function getKeyByName(_arg1:String):SaveKey{
var _local2:uint;
while (_local2 < this._keys.length) {
if (this._keys[_local2].name == _arg1){
return (this._keys[_local2]);
};
_local2++;
};
return (null);
}
public function createQuery():SaveGroupQuery{
return (new SaveGroupQuery(this));
}
public function toString():String{
return ((((((("SaveGroup { name: " + this._name) + ", id: ") + this._id) + ", keys: ") + this._keys) + "}"));
}
public static function createFromObject(_arg1:Object):SaveGroup{
var _local4:Object;
var _local5:Object;
var _local2:SaveGroup = new SaveGroup(_arg1.group_id, _arg1.group_name, _arg1.group_type);
var _local3:uint;
while (_local3 < _arg1.keys.length) {
_local4 = _arg1.keys[_local3];
_local2.addKey(new SaveKey(_local4.id, _local4.name, _local4.type));
_local3++;
};
_local3 = 0;
while (_local3 < _arg1.ratings.length) {
_local5 = _arg1.ratings[_local3];
_local2.addRating(new SaveRating(_local5.id, _local5.name, _local5.float, _local5.min, _local5.max));
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds
Section 36
//SaveGroupQuery (com.newgrounds.SaveGroupQuery)
package com.newgrounds {
import flash.events.*;
public class SaveGroupQuery extends EventDispatcher {
private var _group:SaveGroup;
private var _groupBy:Array;
private var _lookupKeys:Array;
private var _lookupRatings:Array;
private var _fileConditions:Array;
private var _keyConditions:Array;
private var _ratingConditions:Array;
private var _sortConditions:Array;
private var _page:uint;
private var _resultsPerPage:uint;
private var _randomizeResults:Boolean;
public static const TABLE_FILES:uint = 1;
public static const TABLE_KEYS:uint = 2;
public static const TABLE_RATINGS:uint = 3;
public static const FILE_ID:uint = 0;
public static const AUTHOR_ID:uint = 1;
public static const AUTHOR_NAME:uint = 2;
public static const FILE_NAME:uint = 3;
public static const CREATED_ON:uint = 4;
public static const UPDATED_ON:uint = 5;
public static const TOTAL_VIEWS:uint = 6;
public static const FILE_STATUS:uint = 7;
public static const SCORE:String = "score";
public static const TOTAL_VOTES:String = "votes";
public function SaveGroupQuery(_arg1:SaveGroup){
this._group = _arg1;
this.reset();
}
public function get group():SaveGroup{
return (this._group);
}
public function get groupId():uint{
return (this._group.id);
}
public function get resultsPerPage():uint{
return (this._resultsPerPage);
}
public function set resultsPerPage(_arg1:uint):void{
this._resultsPerPage = _arg1;
}
public function get page():uint{
return (this._page);
}
public function set page(_arg1:uint):void{
this._page = _arg1;
}
public function get isRandomized():Boolean{
return (this._randomizeResults);
}
public function set isRandomized(_arg1:Boolean):void{
this._randomizeResults = _arg1;
}
public function reset():void{
this._fileConditions = [];
this._keyConditions = [];
this._ratingConditions = [];
this._sortConditions = [];
this._groupBy = [];
this._lookupKeys = [];
this._lookupRatings = [];
this._randomizeResults = false;
this._resultsPerPage = 20;
this._page = 1;
}
public function includeKey(_arg1:String):void{
var _local2:SaveKey = this._group.getKeyByName(_arg1);
if (_local2){
this._lookupKeys.push(_local2.id);
};
}
public function includeRating(_arg1:String):void{
var _local2:SaveRating = this._group.getRatingByName(_arg1);
if (_local2){
this._lookupRatings.push(_local2.id);
};
}
public function excludeKey(_arg1:String):void{
var _local2:SaveKey = this._group.getKeyByName(_arg1);
var _local3:uint;
while (_local3 < this._lookupKeys.length) {
if (this._lookupKeys[_local3] == _local2.id){
this._lookupKeys.splice(_local3, 1);
return;
};
_local3++;
};
}
public function excludeRating(_arg1:String):void{
var _local2:SaveRating = this._group.getRatingByName(_arg1);
var _local3:uint;
while (_local3 < this._lookupRatings.length) {
if (this._lookupRatings[_local3] == _local2.id){
this._lookupRatings.splice(_local3, 1);
return;
};
_local3++;
};
}
public function groupBy(_arg1:uint):void{
this._groupBy.push({table:TABLE_FILES, field:_arg1});
}
public function groupByRating(_arg1:String):void{
var _local2:SaveRating = this._group.getRatingByName(_arg1);
if (!_local2){
return;
};
this._groupBy.push({table:TABLE_RATINGS, field:_local2.id});
}
public function groupByKey(_arg1:String):void{
var _local2:SaveKey = this._group.getKeyByName(_arg1);
if (!_local2){
return;
};
this._groupBy.push({table:TABLE_KEYS, field:_local2.id});
}
public function addFileCondition(_arg1:uint, _arg2:String, _arg3):void{
this._fileConditions.push({field:_arg1, operator:_arg2, value:_arg3});
}
public function addKeyCondition(_arg1:String, _arg2:String, _arg3):void{
var _local4:SaveKey = this._group.getKeyByName(_arg1);
if (!_local4){
return;
};
if (!this.checkValue(_arg3, _local4.type)){
return;
};
this._keyConditions.push({key_id:_local4.id, operator:_arg2, value:_arg3});
}
public function addRatingCondition(_arg1:String, _arg2:String, _arg3, _arg4:String="score"):void{
var _local5:SaveRating = this._group.getRatingByName(_arg1);
if (!_local5){
return;
};
this._ratingConditions.push({rating_id:_local5.id, operator:_arg2, value:_arg3, column:_arg4});
}
private function addSortCondition(_arg1:uint, _arg2:uint, _arg3:Boolean=false, _arg4=null):void{
var _local5:Object = {table:_arg1, field:_arg2, desc:_arg3};
if (_arg4){
_local5.extra = _arg4;
};
this._sortConditions.push(_local5);
}
public function sortOn(_arg1:uint, _arg2:Boolean=false):void{
this.addSortCondition(TABLE_FILES, _arg1, _arg2);
}
public function sortOnKey(_arg1:String, _arg2:Boolean=false):void{
this.addSortCondition(TABLE_KEYS, this._group.getKeyByName(_arg1).id, _arg2);
}
public function sortOnRating(_arg1:String, _arg2:Boolean=false, _arg3:String="score"):void{
this.addSortCondition(TABLE_RATINGS, this._group.getRatingByName(_arg1).id, _arg2, _arg3);
}
public function execute():void{
API.executeSaveQuery(this);
}
private function checkValue(_arg1, _arg2:uint):Boolean{
return (true);
}
override public function toString():String{
return ("");
}
public function toObject():Object{
var _local1:Object = {page:this._page, num_results:this._resultsPerPage};
if (this.isRandomized){
_local1.randomize = 1;
};
if (((this._fileConditions) && ((this._fileConditions.length > 0)))){
_local1.file_conditions = this._fileConditions;
};
if (((this._keyConditions) && ((this._keyConditions.length > 0)))){
_local1.key_conditions = this._keyConditions;
};
if (((this._ratingConditions) && ((this._ratingConditions.length > 0)))){
_local1.rating_conditions = this._ratingConditions;
};
if (((this._sortConditions) && ((this._sortConditions.length > 0)))){
_local1.sort_conditions = this._sortConditions;
};
if (((this._lookupKeys) && ((this._lookupKeys.length > 0)))){
_local1.lookup_keys = this._lookupKeys;
};
if (((this._lookupRatings) && ((this._lookupRatings.length > 0)))){
_local1.lookup_ratings = this._lookupRatings;
};
if (((this._groupBy) && ((this._groupBy.length > 0)))){
_local1.group_by = this._groupBy;
};
return (_local1);
}
}
}//package com.newgrounds
Section 37
//SaveKey (com.newgrounds.SaveKey)
package com.newgrounds {
public class SaveKey {
private var _id:uint;
private var _name:String;
private var _type:uint;
public static const TYPE_FLOAT:uint = 1;
public static const TYPE_INTEGER:uint = 2;
public static const TYPE_STRING:uint = 3;
public static const TYPE_BOOLEAN:uint = 4;
public function SaveKey(_arg1:uint, _arg2:String, _arg3:uint){
this._id = _arg1;
this._name = _arg2;
this._type = _arg3;
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get type():uint{
return (this._type);
}
public function isValueValid(_arg1):Boolean{
if (this._type == TYPE_INTEGER){
return ((((_arg1 is int)) || ((_arg1 is uint))));
};
if (this._type == TYPE_FLOAT){
return ((((((_arg1 is int)) || ((_arg1 is uint)))) || ((_arg1 is Number))));
};
if (this._type == TYPE_STRING){
return ((_arg1 is String));
};
if (this._type == TYPE_BOOLEAN){
return ((((((((_arg1 is Boolean)) || ((_arg1 === 0)))) || ((_arg1 === 1)))) || ((_arg1 == ""))));
};
return (false);
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 38
//SaveRating (com.newgrounds.SaveRating)
package com.newgrounds {
public class SaveRating {
private var _id:uint;
private var _name:String;
private var _minValue:Number;
private var _maxValue:Number;
private var _isFloat:Boolean;
private var _voted:Boolean;
public function SaveRating(_arg1:uint, _arg2:String, _arg3:Boolean, _arg4:Number=-INF, _arg5:Number=INF){
this._id = _arg1;
this._name = _arg2;
this._isFloat = _arg3;
this._minValue = _arg4;
this._maxValue = _arg5;
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get minValue():Number{
return (this._minValue);
}
public function get maxValue():Number{
return (this._maxValue);
}
public function get isFloat():Boolean{
return (this._isFloat);
}
public function get voted():Boolean{
return (this._voted);
}
public function set voted(_arg1:Boolean):void{
this._voted = _arg1;
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 39
//Score (com.newgrounds.Score)
package com.newgrounds {
public class Score {
private var _board:ScoreBoard;
private var _position:uint;
private var _username:String;
private var _value:String;
private var _numeric_value:uint;
private var _tag:String;
public function Score(_arg1:ScoreBoard, _arg2:Number, _arg3:String, _arg4:String, _arg5:uint, _arg6:String){
this._board = _arg1;
this._position = _arg2;
this._username = _arg3;
this._value = _arg4;
this._numeric_value = _arg5;
this._tag = _arg6;
}
public function get board():ScoreBoard{
return (this._board);
}
public function get position():uint{
return (this._position);
}
public function get username():String{
return (this._username);
}
public function get value():String{
return (this._value);
}
public function get numeric_value():uint{
return (this._numeric_value);
}
public function get tag():String{
return (this._tag);
}
}
}//package com.newgrounds
Section 40
//ScoreBoard (com.newgrounds.ScoreBoard)
package com.newgrounds {
import flash.events.*;
public class ScoreBoard extends EventDispatcher {
private var _name:String;
private var _id:uint;
private var _scores:Array;
private var _period:String;// = "Today"
private var _num_results:uint;// = 10
private var _numScores:uint;
private var _desiredNumResults:uint;
private var _startRank:uint;
private var _endRank:uint;
private var _page:uint;// = 1
private var _tag:String;
public function ScoreBoard(_arg1:uint, _arg2:String, _arg3:String){
this._name = _arg2;
this._id = _arg1;
this._scores = [];
this._tag = _arg3;
}
public function exists():Boolean{
return ((this._id > 0));
}
public function get id():Number{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get period():String{
return (this._period);
}
public function get page():uint{
return (this._page);
}
public function get num_results():uint{
return (this._num_results);
}
public function get scores():Array{
return (this._scores);
}
public function get tag():String{
return (this._tag);
}
public function get num_scores():uint{
return (this._numScores);
}
public function postScore(_arg1:uint):void{
API.postScore(this._name, _arg1);
}
public function loadScores(_arg1:String="Today", _arg2:uint=1, _arg3:uint=10):void{
this._period = _arg1;
if (((!(this._period)) || ((this._period == "")))){
this._period = ScoreBoardPeriod.TODAY;
};
this._page = _arg2;
this._num_results = _arg3;
this._desiredNumResults = 0;
API.loadScores(this);
}
public function loadScoresInRange(_arg1:String="Today", _arg2:uint=1, _arg3:uint=10):void{
if (_arg2 == 0){
_arg2 = 1;
};
if (_arg3 < _arg2){
_arg3 = _arg2;
};
this._period = _arg1;
if (((!(this._period)) || ((this._period == "")))){
this._period = ScoreBoardPeriod.TODAY;
};
this._desiredNumResults = ((_arg3 - _arg2) + 1);
this._num_results = this._desiredNumResults;
while (int(((_arg2 - 1) / this._num_results)) != int(((_arg3 - 1) / this._num_results))) {
this._num_results++;
};
this._page = ((_arg2 - 1) / this._num_results);
this._startRank = _arg2;
this._endRank = _arg3;
this._page++;
API.loadScores(this);
}
function setScores(_arg1:Array, _arg2:String, _arg3:Number, _arg4:Number, _arg5:uint):void{
var _local7:uint;
this._period = _arg2;
this._page = _arg3;
this._num_results = _arg4;
this._numScores = _arg5;
this._scores = [];
var _local6:uint;
while (_local6 < _arg1.length) {
_local7 = (((this._num_results * (this._page - 1)) + 1) + _local6);
if (((!(this._desiredNumResults)) || ((((_local7 >= this._startRank)) && ((_local7 <= this._endRank)))))){
this._scores.push(new Score(this, _local7, _arg1[_local6].username, _arg1[_local6].value, _arg1[_local6].numeric_value, _arg1[_local6].tag));
};
_local6++;
};
this._num_results = this._scores.length;
}
}
}//package com.newgrounds
Section 41
//ScoreBoardPeriod (com.newgrounds.ScoreBoardPeriod)
package com.newgrounds {
public class ScoreBoardPeriod {
public static const TODAY:String = "Today";
public static const WEEK:String = "This Week";
public static const MONTH:String = "This Month";
public static const YEAR:String = "This Year";
public static const ALL_TIME:String = "All-Time";
}
}//package com.newgrounds
Section 42
//SmartURLLoader (com.newgrounds.SmartURLLoader)
package com.newgrounds {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.errors.*;
public class SmartURLLoader extends EventDispatcher {
private var _variables:Dictionary;
private var _files:Dictionary;
private var _hasVariables:Boolean;
private var _method:String;// = "GET"
private var _urlRequest:URLRequest;
private var _urlLoader:URLLoader;
private var _dataFormat:String;// = "text"
private var _openBrowser:Boolean;// = false
private var _preventCache:Boolean;// = false
var _command:String;
public var owner;
private static const CRLF:String = "
";
private static var _loaders:Dictionary = new Dictionary();
public function SmartURLLoader(){
this._urlRequest = new URLRequest();
this._variables = new Dictionary();
}
public function get responseFormat():String{
return (this._dataFormat);
}
public function set responseFormat(_arg1:String):void{
this._dataFormat = _arg1;
}
public function get response(){
return (this._urlLoader.data);
}
public function get hasFiles():Boolean{
return (Boolean(this._files));
}
public function get method():String{
return (this._method);
}
public function set method(_arg1:String):void{
if (((this.hasFiles) && ((_arg1 == URLRequestMethod.GET)))){
throw (new IllegalOperationError("GET cannot be used to upload files."));
};
this._method = _arg1;
}
public function get openBrowser():Boolean{
return (this._openBrowser);
}
public function set openBrowser(_arg1:Boolean):void{
this._openBrowser = _arg1;
}
public function get preventCache():Boolean{
return (this._preventCache);
}
public function set preventCache(_arg1:Boolean):void{
this._preventCache = _arg1;
}
public function get bytesLoaded():uint{
return ((this._urlLoader) ? this._urlLoader.bytesLoaded : 0);
}
public function get bytesTotal():uint{
return ((this._urlLoader) ? this._urlLoader.bytesTotal : 0);
}
public function addVariable(_arg1:String, _arg2=""):void{
this._variables[_arg1] = _arg2;
if (_arg2){
this._hasVariables = true;
};
}
public function addFile(_arg1:String, _arg2:ByteArray, _arg3:String, _arg4:String="application/octect-stream"):void{
this.method = URLRequestMethod.POST;
if (!this._files){
this._files = new Dictionary();
};
this._files[_arg1] = new File(_arg1, _arg2, _arg3, _arg4);
}
public function clearVariables():void{
this._variables = new Dictionary();
}
public function clearFiles():void{
this._files = null;
}
public function load(_arg1:String):void{
var urlVariables:URLVariables;
var key:String;
var boundary:String;
var i:uint;
var event:SecurityErrorEvent;
var url = _arg1;
this._urlRequest.url = url;
if (this._preventCache){
url = (url + ("?seed=" + Math.random()));
if (this._hasVariables){
url = (url + "&");
};
};
this._urlRequest.method = this._method;
if ((((this._urlRequest.method == URLRequestMethod.GET)) || (!(this.hasFiles)))){
this._urlRequest.contentType = "application/x-www-form-urlencoded";
if (this._hasVariables){
urlVariables = new URLVariables();
for (key in this._variables) {
urlVariables[key] = this._variables[key];
};
this._urlRequest.data = urlVariables;
};
} else {
boundary = "";
i = 0;
while (i < 32) {
boundary = (boundary + String.fromCharCode(uint((97 + (Math.random() * 25)))));
i = (i + 1);
};
this._urlRequest.contentType = (("multipart/form-data; boundary=\"" + boundary) + "\"");
this._urlRequest.data = this.buildMultipartData(boundary);
};
if (this.openBrowser){
navigateToURL(this._urlRequest, "_blank");
} else {
this._urlLoader = new URLLoader();
this._urlLoader.dataFormat = this._dataFormat;
this._urlLoader.addEventListener(Event.COMPLETE, this.onComplete);
this._urlLoader.addEventListener(ProgressEvent.PROGRESS, this.onProgress);
this._urlLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onIOError);
this._urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, this.onHTTPStatus);
this._urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onSecurityError);
_loaders[this._urlLoader] = this;
try {
this._urlLoader.load(this._urlRequest);
} catch(error:Error) {
event = new SecurityErrorEvent(SecurityErrorEvent.SECURITY_ERROR, false, false, error.message);
onSecurityError(event);
};
};
}
public function close():void{
try {
this._urlLoader.close();
} catch(e:Error) {
};
}
public function dispose():void{
this.close();
this._files = null;
this._variables = null;
if (this._urlLoader){
this._urlLoader.removeEventListener(Event.COMPLETE, this.onComplete);
this._urlLoader.removeEventListener(ProgressEvent.PROGRESS, this.onProgress);
this._urlLoader.removeEventListener(IOErrorEvent.IO_ERROR, this.onIOError);
this._urlLoader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, this.onHTTPStatus);
this._urlLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onSecurityError);
this._urlLoader = null;
};
this._urlRequest = null;
delete _loaders[this];
}
private function buildMultipartData(_arg1:String):ByteArray{
var _local3:String;
var _local4:File;
var _local2:ByteArray = new ByteArray();
_local2.endian = Endian.BIG_ENDIAN;
_arg1 = ("--" + _arg1);
for (_local3 in this._variables) {
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(((("Content-Disposition: form-data; name=\"" + _local3) + "\"") + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeUTFBytes((this._variables[_local3] + CRLF));
};
if (this.hasFiles){
for each (_local4 in this._files) {
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(("Content-Disposition: form-data; name=\"Filename\"" + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeUTFBytes((_local4.fileName + CRLF));
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(((((("Content-Disposition: form-data; name=\"" + _local4.dataField) + "\"; filename=\"") + _local4.fileName) + "\"") + CRLF));
_local2.writeUTFBytes((("Content-Type: " + _local4.contentType) + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeBytes(_local4.data);
_local2.writeUTFBytes(CRLF);
};
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(("Content-Disposition: form-data; name=\"Upload\"" + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeUTFBytes(("Submit Query" + CRLF));
};
_local2.writeUTFBytes((_arg1 + "--"));
_local2.position = 0;
_local2.position = 0;
return (_local2);
}
private function onComplete(_arg1:Event):void{
dispatchEvent(_arg1);
this.dispose();
}
private function onProgress(_arg1:ProgressEvent):void{
dispatchEvent(_arg1);
}
private function onIOError(_arg1:IOErrorEvent):void{
dispatchEvent(_arg1);
this.dispose();
}
private function onSecurityError(_arg1:SecurityErrorEvent):void{
dispatchEvent(_arg1);
this.dispose();
}
private function onHTTPStatus(_arg1:HTTPStatusEvent):void{
dispatchEvent(_arg1);
}
public static function closeAll():void{
var _local1:SmartURLLoader;
for each (_local1 in _loaders) {
if (_local1){
_local1.dispose();
};
};
_loaders = new Dictionary();
}
}
}//package com.newgrounds
import flash.utils.*;
class File {
private var fileName:String;
private var data:ByteArray;
private var dataField:String;
private var contentType:String;
private function File(_arg1:String, _arg2:ByteArray, _arg3:String="Filedata", _arg4:String="application/octet-stream"){
this.fileName = _arg1;
this.data = _arg2;
this.dataField = _arg3;
this.contentType = _arg4;
}
}
Section 43
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 44
//NewgroundsAPIAsset_API_Conencted_11 (PreloaderBar_fla.NewgroundsAPIAsset_API_Conencted_11)
package PreloaderBar_fla {
import flash.display.*;
import com.newgrounds.components.*;
public dynamic class NewgroundsAPIAsset_API_Conencted_11 extends MovieClip {
public function NewgroundsAPIAsset_API_Conencted_11(){
addFrameScript(36, this.frame37);
}
function frame37(){
APIConnector(parent).clear();
}
}
}//package PreloaderBar_fla
Section 45
//NewgroundsAPIAsset_ConnectingAPI_9 (PreloaderBar_fla.NewgroundsAPIAsset_ConnectingAPI_9)
package PreloaderBar_fla {
import flash.display.*;
public dynamic class NewgroundsAPIAsset_ConnectingAPI_9 extends MovieClip {
public function NewgroundsAPIAsset_ConnectingAPI_9(){
addFrameScript(9, this.frame10);
}
function frame10(){
stop();
}
}
}//package PreloaderBar_fla
Section 46
//NewgroundsAPIAsset_Connection_Error_14 (PreloaderBar_fla.NewgroundsAPIAsset_Connection_Error_14)
package PreloaderBar_fla {
import flash.display.*;
import com.newgrounds.components.*;
public dynamic class NewgroundsAPIAsset_Connection_Error_14 extends MovieClip {
public function NewgroundsAPIAsset_Connection_Error_14(){
addFrameScript(9, this.frame10, 20, this.frame21);
}
function frame10(){
stop();
}
function frame21(){
APIConnector(parent).clear();
}
}
}//package PreloaderBar_fla
Section 47
//NewgroundsAPIAsset_FlashAd_Container_41 (PreloaderBar_fla.NewgroundsAPIAsset_FlashAd_Container_41)
package PreloaderBar_fla {
import flash.events.*;
import flash.display.*;
import com.newgrounds.*;
public dynamic class NewgroundsAPIAsset_FlashAd_Container_41 extends MovieClip {
public var adMask:MovieClip;
public var ngLinkButton:SimpleButton;
public function NewgroundsAPIAsset_FlashAd_Container_41(){
addFrameScript(0, this.frame1, 10, this.frame11);
}
public function onNGLinkClicked(_arg1:MouseEvent):void{
API.loadNewgrounds();
}
function frame1(){
this.ngLinkButton.addEventListener(MouseEvent.CLICK, this.onNGLinkClicked);
}
function frame11(){
gotoAndPlay(1);
}
}
}//package PreloaderBar_fla
Section 48
//NewgroundsAPIAsset_Load_Indicator_10 (PreloaderBar_fla.NewgroundsAPIAsset_Load_Indicator_10)
package PreloaderBar_fla {
import flash.events.*;
import flash.display.*;
public dynamic class NewgroundsAPIAsset_Load_Indicator_10 extends MovieClip {
public function NewgroundsAPIAsset_Load_Indicator_10(){
addFrameScript(0, this.frame1);
}
public function onEnterFrame(_arg1:Event):void{
if (((visible) && (stage))){
rotation = (rotation + 30);
} else {
removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
};
}
function frame1(){
addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
}
}//package PreloaderBar_fla
Section 49
//NewgroundsAPIAsset_Login_Warning_12 (PreloaderBar_fla.NewgroundsAPIAsset_Login_Warning_12)
package PreloaderBar_fla {
import flash.display.*;
import com.newgrounds.components.*;
public dynamic class NewgroundsAPIAsset_Login_Warning_12 extends MovieClip {
public function NewgroundsAPIAsset_Login_Warning_12(){
addFrameScript(9, this.frame10, 20, this.frame21);
}
function frame10(){
stop();
}
function frame21(){
APIConnector(parent).clear();
}
}
}//package PreloaderBar_fla
Section 50
//Timeline_5 (PreloaderBar_fla.Timeline_5)
package PreloaderBar_fla {
import flash.display.*;
public dynamic class Timeline_5 extends MovieClip {
public function Timeline_5(){
addFrameScript(39, this.frame40);
}
function frame40(){
stop();
}
}
}//package PreloaderBar_fla
Section 51
//HolderMC_8 (SpaceGame_fla.HolderMC_8)
package SpaceGame_fla {
import flash.display.*;
public dynamic class HolderMC_8 extends MovieClip {
public function HolderMC_8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package SpaceGame_fla
Section 52
//logo_4 (SpaceGame_fla.logo_4)
package SpaceGame_fla {
import flash.display.*;
public dynamic class logo_4 extends MovieClip {
public function logo_4(){
addFrameScript(100, frame101);
}
function frame101(){
stop();
}
}
}//package SpaceGame_fla
Section 53
//placeholder2_288 (SpaceGame_fla.placeholder2_288)
package SpaceGame_fla {
import flash.display.*;
public dynamic class placeholder2_288 extends MovieClip {
public var instruct1:SimpleButton;
public var challenge1:SimpleButton;
public var impossible1:SimpleButton;
public var credits1:SimpleButton;
public var normal1:SimpleButton;
public function placeholder2_288(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package SpaceGame_fla
Section 54
//seethroughExclusive_83 (SpaceGame_fla.seethroughExclusive_83)
package SpaceGame_fla {
import flash.display.*;
public dynamic class seethroughExclusive_83 extends MovieClip {
public function seethroughExclusive_83(){
addFrameScript(0, frame1);
}
function frame1(){
if (PulaPula.locked == false){
this.alpha = 0;
};
}
}
}//package SpaceGame_fla
Section 55
//BeginGame (BeginGame)
package {
import flash.events.*;
import flash.display.*;
public class BeginGame extends MovieClip {
var clicked:Boolean;// = false
public function BeginGame(){
gotoAndStop(1);
addEventListener(Event.ENTER_FRAME, update);
}
public function update(_arg1:Event):void{
if (!clicked){
gotoAndStop(1);
};
if (clicked == true){
play();
};
if (currentFrame == 10){
gotoAndStop(10);
};
}
function set _clicked(_arg1:Boolean):void{
clicked = _arg1;
}
}
}//package
Section 56
//BeginGame2 (BeginGame2)
package {
import flash.display.*;
public dynamic class BeginGame2 extends MovieClip {
}
}//package
Section 57
//Blade (Blade)
package {
import flash.media.*;
public dynamic class Blade extends Sound {
}
}//package
Section 58
//BoostSound (BoostSound)
package {
import flash.media.*;
public dynamic class BoostSound extends Sound {
}
}//package
Section 59
//Bouncer (Bouncer)
package {
import flash.events.*;
import flash.display.*;
public class Bouncer extends MovieClip {
public var tubes1:MovieClip;
public var glass1:MovieClip;
public var eye1:MovieClip;
private var _Yvelocity:Number;// = 0
private var Yaccelerator:Number;// = 0.5
private var _Xvelocity:Number;// = 0
private var _BouncerPad:BouncerPad;
private var death:Boolean;// = false
private var bounce:Boolean;// = false
private var fire:Boolean;// = false
private var supercount:uint;// = 0
public function Bouncer(){
gotoAndStop(1);
_BouncerPad = new BouncerPad();
_BouncerPad.x = (_BouncerPad.x - ((this.width / 2) - 1));
_BouncerPad.y = (_BouncerPad.y + ((this.height / 2) - 2));
addChild(_BouncerPad);
addEventListener(Event.ENTER_FRAME, update);
}
public function update(_arg1:Event):void{
this.glass1.gotoAndStop(1);
this.eye1.gotoAndStop(1);
this.tubes1.gotoAndStop(0);
if (bounce){
play();
};
if (currentFrame == 15){
gotoAndStop(1);
bounce = false;
};
if (fire){
this.glass1.gotoAndStop(supercount);
this.eye1.gotoAndStop(supercount);
this.tubes1.gotoAndStop(supercount);
supercount++;
};
if (supercount == 15){
this.glass1.gotoAndStop(1);
this.eye1.gotoAndStop(1);
this.tubes1.gotoAndStop(1);
fire = false;
supercount = 0;
};
if (this.y > 610){
death = true;
};
if (!death){
if ((((this.y >= 300)) || ((_Yvelocity >= 0)))){
this.y = (this.y + _Yvelocity);
};
};
if (_Yvelocity < 12){
_Yvelocity = (_Yvelocity + Yaccelerator);
};
if (_Yvelocity >= 12){
_Yvelocity = 12;
};
this.x = (this.x + _Xvelocity);
if (_Xvelocity > 0){
_Xvelocity = (_Xvelocity - 0.1);
};
if (_Xvelocity < 0){
_Xvelocity = (_Xvelocity + 0.1);
};
if (death){
this.y = (this.y + 10);
rotation = (rotation + 10);
};
if (!death){
rotation = 0;
};
}
function set _bounce(_arg1:Boolean):void{
bounce = _arg1;
}
function set Yvelocity(_arg1:Number):void{
_Yvelocity = _arg1;
}
function get Yvelocity():Number{
return (_Yvelocity);
}
function get Xvelocity():Number{
return (_Xvelocity);
}
public function setXvelocity(_arg1:Number):void{
if ((((_Xvelocity < 5)) && ((_Xvelocity > -5)))){
_Xvelocity = (_Xvelocity + _arg1);
};
}
function set Xvelocity(_arg1:Number):void{
_Xvelocity = _arg1;
}
function get BouncePad():BouncerPad{
return (_BouncerPad);
}
function get _Death():Boolean{
return (death);
}
function set _Death(_arg1:Boolean){
death = _arg1;
}
function set _Fire(_arg1:Boolean){
fire = _arg1;
}
function set _supercount(_arg1:uint){
supercount = _arg1;
}
}
}//package
Section 60
//BouncerPad (BouncerPad)
package {
import flash.display.*;
public class BouncerPad extends MovieClip {
}
}//package
Section 61
//bullet (bullet)
package {
import flash.events.*;
import flash.display.*;
public class bullet extends MovieClip {
private var gravity:Number;// = -0.4
private var velocity:Number;// = 15
public function bullet(){
addEventListener(Event.ENTER_FRAME, update);
}
public function update(_arg1:Event):void{
this.y = (this.y - velocity);
this.rotation = (this.rotation + 5);
velocity = (velocity + gravity);
}
}
}//package
Section 62
//Catapult (Catapult)
package {
import flash.events.*;
import flash.display.*;
public class Catapult extends MovieClip {
private var hit:Boolean;// = false
public function Catapult(){
addEventListener(Event.ENTER_FRAME, update);
gotoAndStop(1);
}
function get _hit():Boolean{
return (hit);
}
function set _hit(_arg1:Boolean):void{
hit = _arg1;
}
public function update(_arg1:Event):void{
if (hit){
play();
};
if (currentFrame == 5){
gotoAndStop(5);
};
}
}
}//package
Section 63
//CatapultSound (CatapultSound)
package {
import flash.media.*;
public dynamic class CatapultSound extends Sound {
}
}//package
Section 64
//CaveManSmall (CaveManSmall)
package {
import flash.events.*;
import flash.display.*;
public class CaveManSmall extends MovieClip {
public var rightarm:MovieClip;
public var cavePad1:MovieClip;
public var glow:MovieClip;
public var leftarm:MovieClip;
private var _Yvelocity:Number;// = 0
private var Yaccelerator:Number;// = 0.5
private var _Xvelocity:Number;// = 0
private var _BouncerPad:BouncerPad;
private var death:Boolean;// = false
private var bounce:Boolean;// = false
private var fire:Boolean;// = false
private var supercount:uint;// = 0
private var Invincible:Boolean;// = false
private var rider:Boolean;// = false
private var platformSound:PlatformBounce2;
public function CaveManSmall(){
gotoAndStop(1);
_BouncerPad = new BouncerPad();
_BouncerPad.x = (_BouncerPad.x - ((this.width / 2) - 1));
_BouncerPad.y = (_BouncerPad.y + ((this.height / 2) - 2));
this.rightarm.gotoAndStop(1);
this.leftarm.gotoAndStop(1);
addChild(_BouncerPad);
addEventListener(Event.ENTER_FRAME, update);
platformSound = new PlatformBounce2();
}
public function update(_arg1:Event):void{
if (bounce){
this.rightarm.gotoAndStop(1);
};
if (currentFrame == 2){
platformSound.play();
};
if (currentFrame == 35){
gotoAndStop(1);
bounce = false;
};
if (fire){
this.rightarm.gotoAndStop(supercount);
supercount++;
};
if (supercount == 15){
this.rightarm.gotoAndStop(1);
fire = false;
supercount = 0;
};
if (this.y > 610){
};
if (!death){
if ((((this.y >= 300)) || ((_Yvelocity >= 0)))){
this.y = (this.y + _Yvelocity);
};
};
if (_Yvelocity < 12){
_Yvelocity = (_Yvelocity + Yaccelerator);
};
if (_Yvelocity >= 12){
_Yvelocity = 12;
};
this.x = (this.x + _Xvelocity);
_Xvelocity = (_Xvelocity * 0.95);
if (death){
this.y = (this.y + 10);
rotation = (rotation + 10);
};
if (!death){
rotation = 0;
};
}
function set _bounce(_arg1:Boolean):void{
bounce = _arg1;
}
function set Yvelocity(_arg1:Number):void{
_Yvelocity = _arg1;
}
function get Yvelocity():Number{
return (_Yvelocity);
}
function get Xvelocity():Number{
return (_Xvelocity);
}
public function setXvelocity(_arg1:Number):void{
if ((((_Xvelocity < 5)) && ((_Xvelocity > -5)))){
_Xvelocity = (_Xvelocity + _arg1);
};
}
function set Xvelocity(_arg1:Number):void{
_Xvelocity = _arg1;
}
function get BouncePad():BouncerPad{
return (_BouncerPad);
}
function get _Death():Boolean{
return (death);
}
function set _Death(_arg1:Boolean){
death = _arg1;
}
function set _Fire(_arg1:Boolean){
fire = _arg1;
}
function set _supercount(_arg1:uint){
supercount = _arg1;
}
function set invincible(_arg1:Boolean):void{
Invincible = _arg1;
}
function get invincible():Boolean{
return (Invincible);
}
function set Rider(_arg1:Boolean):void{
rider = _arg1;
}
function get Rider():Boolean{
return (rider);
}
}
}//package
Section 65
//CaveRider (CaveRider)
package {
import flash.display.*;
public dynamic class CaveRider extends MovieClip {
}
}//package
Section 66
//ChallengeScreen (ChallengeScreen)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.media.*;
public class ChallengeScreen extends MovieClip {
public var challenge9:SimpleButton;
public var challenge6:SimpleButton;
public var challenge7:SimpleButton;
public var challenge4:SimpleButton;
public var challenge5:SimpleButton;
public var challenge2:SimpleButton;
public var challenge3:SimpleButton;
public var challenge10:SimpleButton;
public var menu1:MainMenu;
public var challenge11:SimpleButton;
public var challenge1:SimpleButton;
public var challenge12:SimpleButton;
public var challenge13:SimpleButton;
public var challenge14:SimpleButton;
public var challenge8:SimpleButton;
private var menu:Boolean;// = false
private var challengeNum:int;// = 1
private var challengeLaunch:Boolean;// = false
private var challengeSound:ChallengeSound;
private var channel:SoundChannel;
private var transform1:SoundTransform;
public function ChallengeScreen(){
challengeSound = new ChallengeSound();
transform1 = new SoundTransform(1, 0);
super();
addFrameScript(39, frame40);
menu1.addEventListener(MouseEvent.CLICK, goToMenu);
challenge1.addEventListener(MouseEvent.CLICK, launchChallenge1);
challenge2.addEventListener(MouseEvent.CLICK, launchChallenge2);
challenge3.addEventListener(MouseEvent.CLICK, launchChallenge3);
challenge4.addEventListener(MouseEvent.CLICK, launchChallenge4);
challenge5.addEventListener(MouseEvent.CLICK, launchChallenge5);
challenge6.addEventListener(MouseEvent.CLICK, launchChallenge6);
challenge7.addEventListener(MouseEvent.CLICK, launchChallenge7);
challenge8.addEventListener(MouseEvent.CLICK, launchChallenge8);
challenge9.addEventListener(MouseEvent.CLICK, launchChallenge9);
challenge10.addEventListener(MouseEvent.CLICK, launchChallenge10);
challenge11.addEventListener(MouseEvent.CLICK, launchChallenge11);
challenge12.addEventListener(MouseEvent.CLICK, launchChallenge12);
challenge13.addEventListener(MouseEvent.CLICK, launchChallenge13);
challenge14.addEventListener(MouseEvent.CLICK, launchChallenge14);
channel = challengeSound.play(0, 10);
channel.soundTransform = transform1;
}
function goToMenu(_arg1:MouseEvent){
menu = true;
removeListeners();
}
function launchChallenge1(_arg1:MouseEvent){
challengeNum = 1;
challengeLaunch = true;
removeListeners();
}
function launchChallenge2(_arg1:MouseEvent){
var _local2:URLRequest;
if (!PulaPula.locked){
challengeNum = 4;
challengeLaunch = true;
removeListeners();
} else {
trace("GAMDLK");
_local2 = new URLRequest("http://www.happytree.com/games/jumpinggames/jumpinggames.html?utm_source=games&utm_medium=exclusives&utm_campaign=enigmaspace");
navigateToURL(_local2, "_blank");
};
}
function launchChallenge3(_arg1:MouseEvent){
challengeNum = 7;
challengeLaunch = true;
removeListeners();
}
function launchChallenge4(_arg1:MouseEvent){
var _local2:URLRequest;
if (!PulaPula.locked){
challengeNum = 10;
challengeLaunch = true;
removeListeners();
} else {
_local2 = new URLRequest("http://www.happytree.com/games/jumpinggames/jumpinggames.html?utm_source=games&utm_medium=exclusives&utm_campaign=enigmaspace");
navigateToURL(_local2, "_blank");
};
}
function launchChallenge5(_arg1:MouseEvent){
challengeNum = 13;
challengeLaunch = true;
removeListeners();
}
function launchChallenge6(_arg1:MouseEvent){
var _local2:URLRequest;
if (!PulaPula.locked){
challengeNum = 16;
challengeLaunch = true;
removeListeners();
} else {
_local2 = new URLRequest("http://www.happytree.com/games/jumpinggames/jumpinggames.html?utm_source=games&utm_medium=exclusives&utm_campaign=enigmaspace");
navigateToURL(_local2, "_blank");
};
}
function launchChallenge7(_arg1:MouseEvent){
challengeNum = 19;
challengeLaunch = true;
removeListeners();
}
function launchChallenge8(_arg1:MouseEvent){
var _local2:URLRequest;
if (!PulaPula.locked){
challengeNum = 22;
challengeLaunch = true;
removeListeners();
} else {
_local2 = new URLRequest("http://www.happytree.com/games/jumpinggames/jumpinggames.html?utm_source=games&utm_medium=exclusives&utm_campaign=enigmaspace");
navigateToURL(_local2, "_blank");
};
}
function launchChallenge9(_arg1:MouseEvent){
challengeNum = 25;
challengeLaunch = true;
removeListeners();
}
function launchChallenge10(_arg1:MouseEvent){
var _local2:URLRequest;
if (!PulaPula.locked){
challengeNum = 28;
challengeLaunch = true;
removeListeners();
} else {
_local2 = new URLRequest("http://www.happytree.com/games/jumpinggames/jumpinggames.html?utm_source=games&utm_medium=exclusives&utm_campaign=enigmaspace");
navigateToURL(_local2, "_blank");
};
}
function launchChallenge11(_arg1:MouseEvent){
challengeNum = 31;
challengeLaunch = true;
removeListeners();
}
function launchChallenge12(_arg1:MouseEvent){
var _local2:URLRequest;
if (!PulaPula.locked){
challengeNum = 34;
challengeLaunch = true;
removeListeners();
} else {
_local2 = new URLRequest("http://www.happytree.com/games/jumpinggames/jumpinggames.html?utm_source=games&utm_medium=exclusives&utm_campaign=enigmaspace");
navigateToURL(_local2, "_blank");
};
}
function launchChallenge13(_arg1:MouseEvent){
challengeNum = 37;
challengeLaunch = true;
removeListeners();
}
function launchChallenge14(_arg1:MouseEvent){
var _local2:URLRequest;
if (!PulaPula.locked){
challengeNum = 40;
challengeLaunch = true;
removeListeners();
} else {
_local2 = new URLRequest("http://www.happytree.com/games/jumpinggames/jumpinggames.html?utm_source=games&utm_medium=exclusives&utm_campaign=enigmaspace");
navigateToURL(_local2, "_blank");
};
}
function get _Menu():Boolean{
return (menu);
}
function get ChallengeLaunch():Boolean{
return (challengeLaunch);
}
function get ChallengeNum():int{
return (challengeNum);
}
public function removeListeners():void{
menu1.removeEventListener(MouseEvent.CLICK, goToMenu);
challenge1.removeEventListener(MouseEvent.CLICK, launchChallenge1);
challenge2.removeEventListener(MouseEvent.CLICK, launchChallenge2);
challenge3.removeEventListener(MouseEvent.CLICK, launchChallenge3);
challenge4.removeEventListener(MouseEvent.CLICK, launchChallenge4);
challenge5.removeEventListener(MouseEvent.CLICK, launchChallenge5);
challenge6.removeEventListener(MouseEvent.CLICK, launchChallenge6);
challenge7.removeEventListener(MouseEvent.CLICK, launchChallenge7);
challenge8.removeEventListener(MouseEvent.CLICK, launchChallenge8);
challenge9.removeEventListener(MouseEvent.CLICK, launchChallenge9);
challenge10.removeEventListener(MouseEvent.CLICK, launchChallenge10);
SoundMixer.stopAll();
}
function frame40(){
gotoAndStop(40);
}
}
}//package
Section 67
//ChallengeSound (ChallengeSound)
package {
import flash.media.*;
public dynamic class ChallengeSound extends Sound {
}
}//package
Section 68
//DragonFire (DragonFire)
package {
import flash.media.*;
public dynamic class DragonFire extends Sound {
}
}//package
Section 69
//DragonRoar (DragonRoar)
package {
import flash.media.*;
public dynamic class DragonRoar extends Sound {
}
}//package
Section 70
//Enemy (Enemy)
package {
import flash.events.*;
import flash.display.*;
public class Enemy extends MovieClip {
private var Mcounter:uint;// = 0
private var enemT:uint;// = 1
private var _hit:Boolean;// = false
private var _kill:Boolean;// = false
public function Enemy(){
var _local1:uint = (Math.random() * 150);
Mcounter = _local1;
addEventListener(Event.ENTER_FRAME, update);
this.scaleX = 0.6;
this.scaleY = 0.6;
}
public function update(_arg1:Event):void{
if (_kill == true){
this.y = (this.y + 5);
this.rotation = (this.rotation + 10);
};
}
function set hit(_arg1:Boolean):void{
_hit = _arg1;
}
function get hit():Boolean{
return (_hit);
}
function set kill(_arg1:Boolean):void{
_kill = _arg1;
}
function get kill():Boolean{
return (_kill);
}
public function get_E():uint{
return (enemT);
}
public function removeListeners():void{
removeEventListener(Event.ENTER_FRAME, update);
}
}
}//package
Section 71
//Enemy2 (Enemy2)
package {
import flash.events.*;
public class Enemy2 extends Enemy {
private var Mcounter:uint;// = 0
private var enemT:uint;// = 1
private var _hit:Boolean;// = false
private var _kill:Boolean;// = false
private var _move:Boolean;// = false
public function Enemy2(){
this.scaleX = 0.2;
this.scaleY = 0.2;
var _local1:uint = (Math.random() * 150);
Mcounter = _local1;
addEventListener(Event.ENTER_FRAME, update);
}
override public function update(_arg1:Event):void{
if (!_move){
this.x = (this.x - 4);
if (this.x < 80){
this.scaleX = -0.2;
_move = true;
this.x = (this.x + 10);
};
};
if (_move){
this.x = (this.x + 4);
if (this.x > 520){
this.scaleX = 0.2;
_move = false;
this.x = (this.x - 10);
};
};
if (_kill == true){
gotoAndStop(50);
this.y = (this.y + 5);
this.rotation = (this.rotation + 10);
};
if (currentFrame == 20){
gotoAndStop(1);
play();
};
}
override function set kill(_arg1:Boolean):void{
_kill = _arg1;
}
override function get kill():Boolean{
return (_kill);
}
override public function removeListeners():void{
removeEventListener(Event.ENTER_FRAME, update);
}
}
}//package
Section 72
//Enemy4 (Enemy4)
package {
import flash.events.*;
import flash.display.*;
public class Enemy4 extends Enemy {
public var teeth:MovieClip;
private var Mcounter:uint;// = 0
private var enemT:uint;// = 1
private var _hit:Boolean;// = false
private var _kill:Boolean;// = false
private var hitcounter:int;// = 0
private var snapTeeth:SnapTeeth;
public function Enemy4(){
snapTeeth = new SnapTeeth();
super();
this.scaleX = 0.4;
this.scaleY = 0.4;
var _local1:uint = (Math.random() * 150);
Mcounter = _local1;
addEventListener(Event.ENTER_FRAME, update);
}
public function _hitcounter():void{
hitcounter++;
gotoAndPlay(26);
}
override public function update(_arg1:Event):void{
if (_kill == true){
gotoAndStop(50);
this.y = (this.y + 5);
this.rotation = (this.rotation + 10);
};
if (hitcounter > 1){
_kill = true;
};
if (currentFrame == 20){
gotoAndStop(0);
};
}
override function set kill(_arg1:Boolean):void{
_kill = _arg1;
}
override function get kill():Boolean{
return (_kill);
}
}
}//package
Section 73
//Enemy5 (Enemy5)
package {
import flash.events.*;
public class Enemy5 extends Enemy {
private var Mcounter:uint;// = 0
private var enemT:uint;// = 1
private var _hit:Boolean;// = false
private var _kill:Boolean;// = false
public function Enemy5(){
this.scaleX = 0.25;
this.scaleY = 0.25;
var _local1:uint = (Math.random() * 150);
Mcounter = _local1;
addEventListener(Event.ENTER_FRAME, update);
}
override public function update(_arg1:Event):void{
this.rotation = (this.rotation + 5);
if (_kill == true){
gotoAndStop(20);
this.y = (this.y + 5);
this.rotation = (this.rotation + 10);
};
}
override function set kill(_arg1:Boolean):void{
_kill = _arg1;
}
override function get kill():Boolean{
return (_kill);
}
}
}//package
Section 74
//exclusive (exclusive)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class exclusive extends SimpleButton {
public function exclusive(){
this.addEventListener(MouseEvent.CLICK, callLink);
}
function callLink(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.happytree.com/games/jumpinggames/jumpinggames.html?utm_source=games&utm_medium=exclusives&utm_campaign=enigmaspace");
navigateToURL(_local2, "_blank");
}
}
}//package
Section 75
//ExplosionRocket (ExplosionRocket)
package {
import flash.display.*;
public dynamic class ExplosionRocket extends MovieClip {
}
}//package
Section 76
//FallingSound (FallingSound)
package {
import flash.media.*;
public dynamic class FallingSound extends Sound {
}
}//package
Section 77
//Fan (Fan)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public class Fan extends MovieClip {
private var Mcounter:uint;// = 0
private var fantype:uint;// = 0
private var xchange:int;// = 5
private var windDragon:WindDragon;
private var channel:SoundChannel;
private var transform1:SoundTransform;
public function Fan(){
windDragon = new WindDragon();
transform1 = new SoundTransform(0.3, 1);
super();
fantype = 1;
this.x = 450;
addEventListener(Event.ENTER_FRAME, update);
}
public function update(_arg1:Event):void{
if (currentFrame == 30){
channel = windDragon.play(0, 1);
channel.soundTransform = transform1;
};
}
function get _type():uint{
return (fantype);
}
function set _type(_arg1:uint):void{
fantype = _arg1;
}
function get _xchange():int{
return (xchange);
}
public function removeListeners():void{
removeEventListener(Event.ENTER_FRAME, update);
}
}
}//package
Section 78
//Fan3 (Fan3)
package {
import flash.events.*;
import flash.media.*;
public class Fan3 extends Fan {
private var Mcounter:uint;// = 0
private var fantype:uint;// = 0
private var xchange:int;// = -5
private var windDragon:WindDragon;
private var channel:SoundChannel;
private var transform1:SoundTransform;
public function Fan3(){
windDragon = new WindDragon();
transform1 = new SoundTransform(0.3, -1);
super();
fantype = 3;
this.scaleX = -1;
this.x = 100;
xchange = -5;
addEventListener(Event.ENTER_FRAME, update);
}
override public function update(_arg1:Event):void{
if (currentFrame == 30){
channel = windDragon.play();
channel.soundTransform = transform1;
};
}
override function get _type():uint{
return (fantype);
}
override function set _type(_arg1:uint):void{
fantype = _arg1;
}
override function get _xchange():int{
return (xchange);
}
}
}//package
Section 79
//Fanup (Fanup)
package {
public class Fanup extends Fan {
private var Mcounter:uint;// = 0
private var fantype:uint;// = 0
public function Fanup(){
fantype = 3;
}
override function get _type():uint{
return (fantype);
}
override function set _type(_arg1:uint):void{
fantype = _arg1;
}
}
}//package
Section 80
//FatMonster (FatMonster)
package {
import flash.media.*;
public dynamic class FatMonster extends Sound {
}
}//package
Section 81
//FireBall (FireBall)
package {
import flash.display.*;
public class FireBall extends MovieClip {
public function FireBall(){
cacheAsBitmap = true;
}
}
}//package
Section 82
//FireDragon (FireDragon)
package {
import flash.events.*;
import flash.media.*;
public class FireDragon extends Enemy {
private var Mcounter:uint;// = 0
private var enemT:uint;// = 1
private var _hit:Boolean;// = false
private var _kill:Boolean;// = false
private var hitcounter:int;// = 0
private var channel:SoundChannel;
private var transform1:SoundTransform;
public function FireDragon(){
transform1 = new SoundTransform(0.2, 1);
super();
var _local1:uint = (Math.random() * 150);
addEventListener(Event.ENTER_FRAME, update);
this.x = 400;
this.scaleX = 1;
this.scaleY = 1;
}
public function _hitcounter():void{
hitcounter++;
}
override public function update(_arg1:Event):void{
if (_kill == true){
gotoAndStop(50);
this.y = (this.y + 5);
this.rotation = (this.rotation + 10);
};
if (hitcounter > 5){
_kill = true;
};
}
override function set kill(_arg1:Boolean):void{
_kill = _arg1;
}
override function get kill():Boolean{
return (_kill);
}
override public function removeListeners():void{
removeEventListener(Event.ENTER_FRAME, update);
}
}
}//package
Section 83
//FmmLogo (FmmLogo)
package {
import flash.display.*;
public dynamic class FmmLogo extends MovieClip {
}
}//package
Section 84
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 85
//GameOver (GameOver)
package {
import flash.display.*;
public dynamic class GameOver extends MovieClip {
public function GameOver(){
addFrameScript(19, frame20);
}
function frame20(){
gotoAndStop(20);
}
}
}//package
Section 86
//heightBlock (heightBlock)
package {
import flash.display.*;
public class heightBlock extends MovieClip {
public function heightBlock(){
cacheAsBitmap = true;
}
}
}//package
Section 87
//HurtSound (HurtSound)
package {
import flash.media.*;
public dynamic class HurtSound extends Sound {
}
}//package
Section 88
//JumpGame (JumpGame)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
public class JumpGame extends MovieClip {
public var life1:Life;
public var block1:heightBlock;
public var life2:Life;
public var block2:heightBlock;
public var life3:Life;
public var block3:heightBlock;
public var soundOnOff:MovieClip;
public var quit1:QuitButton;
public var title1:TextField;
public var pause1:PauseButton;
public var p001:Pad;
public var Toggle1:ToggleKeyboard;
public var restart1:restartButton;
public var htext:TextField;
private var platforms:Array;
private var fakePlatforms:Array;
private var catapults:Array;
private var rocks:Array;
private var bullets:Array;
private var fans:Array;
private var enemies:Array;
private var spikes:Array;
private var _Left:Boolean;// = false
private var _Right:Boolean;// = false
private var _Fire:Boolean;// = false
private var running:Boolean;// = false
private var bounce1:CaveManSmall;
private var meters:uint;// = 0
private var marker;// = 1
private var marker0;// = 0
private var difficulty:uint;// = 2
private var difficulty0:uint;// = 1
private var initial:uint;// = 1
private var initial0:uint;// = 0
private var marker_reset:uint;// = 100
private var firewait:uint;// = 0
private var counter1:uint;// = 0
private var counter2:uint;// = 0
private var textSprite:Sprite;
private var gameSprite:Sprite;
private var game2Sprite:Sprite;
private var diceroll:uint;// = 0
private var dice:Boolean;// = true
private var slowcounter:uint;// = 0
private var challengeLocation:int;// = 1
private var challengeCounter:int;// = 0
private var lives:int;// = 3
private var game2:Boolean;// = false
private var G_over:GameOver;
private var YouWin1:YouWin;
private var GameScore:Score;
private var playAgain:PlayAgain;
private var mainMenu:MainMenu;
private var gscore:TextField;
private var death:Boolean;// = false
private var restart:Boolean;// = false
private var challenge:Boolean;// = false
private var impossible:Boolean;// = false
private var nextChallenge:Boolean;// = false
private var DisplayGameOver:Boolean;// = false
private var ChallengeComplete:Boolean;// = false
private var temporaryInvincible:Boolean;// = false
private var KeyboardMouse:Boolean;
private var soundOn:Boolean;
private var temporaryInvincibleTimer:int;// = 50
private var Boost:TinyDragon;
private var Boost2:RideDragon;
private var lifeBoost:LifeBoost;
private var WinGame1:WinGame;
private var caveRider:CaveRider;
private var Next1:NEXTInstruction;
private var gameMusic:Loop2;
private var gameMusic2:Loop1;
private var fallingSound:FallingSound;
private var hurtSound:HurtSound;
private var snapTeeth:SnapTeeth;
private var fatMonster:FatMonster;
private var tinyMonster:TinyMonster;
private var dragonFire:DragonFire;
private var dragonRoar:DragonRoar;
private var woosh:Woosh;
private var punch:Punch;
private var blade:Blade;
private var crack:PlatformDie;
private var phase:Phase;
private var boostSound:BoostSound;
private var channel:SoundChannel;
private var platformChannel:SoundChannel;
private var boostChannel:SoundChannel;
private var enemyChannel:SoundChannel;
private var enemyChannel2:SoundChannel;
private var channelBouncer:SoundChannel;
private var transform1:SoundTransform;
private var challengeNumber:int;// = 0
public function JumpGame(_arg1:Boolean, _arg2:Boolean):void{
var _local6:Pad;
var _local7:Boolean;
var _local8:uint;
var _local9:uint;
platforms = [];
fakePlatforms = [];
catapults = [];
rocks = [];
bullets = [];
fans = [];
enemies = [];
spikes = [];
KeyboardMouse = PulaPula.KeyboardMouse;
soundOn = PulaPula.soundOn;
gameMusic = new Loop2();
gameMusic2 = new Loop1();
fallingSound = new FallingSound();
hurtSound = new HurtSound();
snapTeeth = new SnapTeeth();
fatMonster = new FatMonster();
tinyMonster = new TinyMonster();
dragonFire = new DragonFire();
dragonRoar = new DragonRoar();
woosh = new Woosh();
punch = new Punch();
blade = new Blade();
crack = new PlatformDie();
phase = new Phase();
boostSound = new BoostSound();
transform1 = new SoundTransform(0.2, 0);
super();
scrollRect = new Rectangle(0, 0, 600, 600);
challenge = _arg1;
impossible = _arg2;
if (((challenge) && (!(impossible)))){
marker_reset = 600;
title1.text = ("Challenge " + Math.floor(((challengeLocation + 2) / 3)));
challengeNumber = Math.floor(((challengeLocation + 2) / 3));
lives = 1;
};
if (impossible){
marker_reset = 600;
title1.text = "Impossible ";
lives = 3;
};
textSprite = new Sprite();
gameSprite = new Sprite();
game2Sprite = new Sprite();
addChild(game2Sprite);
addChild(gameSprite);
addChild(textSprite);
textSprite.addChild(block1);
textSprite.addChild(block2);
textSprite.addChild(block3);
textSprite.addChild(title1);
gscore = new TextField();
gscore.x = 157;
gscore.y = 312;
textSprite.addChild(gscore);
textSprite.addChild(htext);
bounce1 = new CaveManSmall();
textSprite.addChild(bounce1);
textSprite.addChild(life1);
textSprite.addChild(life2);
textSprite.addChild(life3);
textSprite.addChild(pause1);
textSprite.addChild(soundOnOff);
textSprite.addChild(quit1);
textSprite.addChild(restart1);
textSprite.addChild(Toggle1);
bounce1.x = 300;
bounce1.y = 450;
var _local3:Wall = new Wall();
var _local4:Wall = new Wall();
_local3.x = -2;
_local3.y = 0;
_local4.x = -2;
_local4.y = -598;
game2Sprite.addChild(_local3);
game2Sprite.addChild(_local4);
rocks.push(_local3);
rocks.push(_local4);
gameSprite.addChild(p001);
platforms.push(p001);
addEventListener(Event.ENTER_FRAME, Game1OnLoop);
addEventListener(Event.ENTER_FRAME, clickControl);
pause1.addEventListener(MouseEvent.CLICK, pauseGame);
soundOnOff.addEventListener(MouseEvent.CLICK, ToggleSound);
Toggle1.addEventListener(MouseEvent.CLICK, ToggleKeyboard1);
quit1.addEventListener(MouseEvent.CLICK, QuitGame);
restart1.addEventListener(MouseEvent.CLICK, RestartGame);
if (KeyboardMouse){
Toggle1.gotoAndStop(2);
};
if (!KeyboardMouse){
Toggle1.gotoAndStop(1);
};
if (soundOn){
soundOnOff.gotoAndStop(1);
};
if (!soundOn){
soundOnOff.gotoAndStop(2);
};
var _local5:uint;
while (_local5 < 20) {
_local6 = new Pad();
_local7 = false;
_local6.x = (100 + (Math.random() * 400));
_local6.y = (-600 + (Math.random() * 1200));
_local8 = 0;
while (_local8 < platforms.length) {
if (_local6.hitTestObject(platforms[_local8])){
_local7 = true;
};
_local8++;
};
_local9 = 0;
while (_local9 < fakePlatforms.length) {
if (_local6.hitTestObject(fakePlatforms[_local9])){
_local7 = true;
};
_local9++;
};
if (_local7 == false){
platforms.push(_local6);
gameSprite.addChild(_local6);
} else {
_local5--;
};
_local5++;
};
if (((((!(challenge)) && (!(impossible)))) || (challenge))){
channel = gameMusic.play(0, 20);
};
if (((impossible) && (!(challenge)))){
channel = gameMusic2.play(0, 15);
};
channel.soundTransform = transform1;
}
public function downControl(_arg1:KeyboardEvent):void{
if (KeyboardMouse){
if (_arg1.keyCode == 39){
_Left = true;
};
if (_arg1.keyCode == 37){
_Right = true;
};
};
if (_arg1.keyCode == 32){
_Fire = true;
};
if (_arg1.keyCode == 80){
pauseGame2();
};
if (_arg1.keyCode == 83){
ToggleSound2();
};
if (_arg1.keyCode == 75){
ToggleKeyboard2();
};
if (_arg1.keyCode == 82){
RestartGame2();
};
if (_arg1.keyCode == 81){
QuitGame2();
};
}
public function upControl(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 39){
_Left = false;
};
if (_arg1.keyCode == 37){
_Right = false;
};
}
public function clickControl(_arg1:Event):void{
running = true;
bounce1._Death = false;
meters = 0;
difficulty = 2;
initial = 1;
difficulty0 = 1;
initial0 = 1;
removeEventListener(Event.ENTER_FRAME, clickControl);
addListeners();
}
public function get_Bouncer():CaveManSmall{
return (bounce1);
}
public function get _death():Boolean{
return (death);
}
public function set _death(_arg1:Boolean){
death = _arg1;
}
public function get _restart():Boolean{
return (restart);
}
public function set _restart(_arg1:Boolean){
restart = _arg1;
}
public function get _nextChallenge():Boolean{
return (nextChallenge);
}
public function set ChallengeLocation(_arg1:int){
challengeLocation = _arg1;
}
public function get ChallengeLocation():int{
return (challengeLocation);
}
public function get ChallengeCounter():int{
return (challengeCounter);
}
public function get Challenge():Boolean{
return (challenge);
}
public function get Impossible():Boolean{
return (impossible);
}
public function Game1OnLoop(_arg1:Event):void{
if (!soundOn){
SoundMixer.stopAll();
};
if (!running){
bounce1.Yvelocity = 0;
bounce1.Xvelocity = 0;
};
if (challenge){
title1.text = ("Challenge " + (((challengeLocation - challengeCounter) + 2) / 3));
};
if (running){
if (((!(challenge)) && (!(impossible)))){
randomize();
};
if (challenge){
challengeMode();
};
if (impossible){
ImpossibleMode();
};
movePlayer();
scrollObjects();
createFans();
createRocks();
createFakePlatforms();
updateSpikes();
updateEnemies();
updatePlatforms();
updateBullets();
updateCatapults();
updateLives();
if (Boost != null){
updateBoost();
};
if (Boost2 != null){
updateBoost2();
};
if (!KeyboardMouse){
if (mouseX > ((bounce1.x + 10) + bounce1.Xvelocity)){
bounce1.setXvelocity(0.75);
};
if (mouseX < ((bounce1.x + 10) + bounce1.Xvelocity)){
bounce1.setXvelocity(-0.75);
};
};
};
if (temporaryInvincible){
if (temporaryInvincibleTimer > 0){
bounce1.invincible = true;
bounce1.glow.alpha = 0.25;
} else {
bounce1.glow.alpha = 0;
bounce1.invincible = false;
temporaryInvincible = false;
temporaryInvincibleTimer = 150;
};
temporaryInvincibleTimer--;
};
if (bounce1.y > 610){
if (lives < 1){
bounce1._Death = true;
if (bounce1.y == 611){
channelBouncer = fallingSound.play();
};
} else {
channelBouncer = fallingSound.play();
bounce1.x = 300;
bounce1.y = -10;
temporaryInvincible = true;
lives--;
};
};
if (((((bounce1._Death) && ((bounce1.y > 750)))) || (((((((challenge) || (impossible))) && ((bounce1.y < -200)))) && (!(DisplayGameOver)))))){
bounce1._Death = false;
DisplayGameOver = true;
GameScore = new Score();
GameScore.x = 310;
GameScore.y = 180;
PulaPula.kongregate.stats.submit("Score", meters);
GameScore.meterstext.text = (meters + " meters");
textSprite.addChild(GameScore);
if (((!(challenge)) || ((bounce1.y > 700)))){
G_over = new GameOver();
G_over.x = 310;
G_over.y = 100;
textSprite.addChild(G_over);
} else {
if (((challenge) && ((bounce1.y < -10)))){
YouWin1 = new YouWin();
YouWin1.x = 310;
YouWin1.y = 150;
PulaPula.kongregate.stats.submit("Completed Mission", challengeNumber);
textSprite.addChild(YouWin1);
if (challengeLocation <= 42){
Next1 = new NEXTInstruction();
Next1.x = 310;
Next1.y = 300;
textSprite.addChild(Next1);
Next1.addEventListener(MouseEvent.CLICK, NextChallenge);
};
};
};
playAgain = new PlayAgain();
playAgain.x = 310;
playAgain.y = 400;
textSprite.addChild(playAgain);
playAgain.addEventListener(MouseEvent.CLICK, RestartGame);
mainMenu = new MainMenu();
mainMenu.x = 310;
mainMenu.y = 460;
textSprite.addChild(mainMenu);
mainMenu.addEventListener(MouseEvent.CLICK, gameOver);
bounce1.y = 400;
bounce1.x = -200;
running = false;
};
}
public function gameOver(_arg1:MouseEvent):void{
death = true;
removeEverything();
}
public function RestartGame(_arg1:MouseEvent):void{
restart = true;
removeEverything();
}
public function RestartGame2():void{
restart = true;
removeEverything();
}
public function QuitGame(_arg1:MouseEvent):void{
death = true;
removeEverything();
}
public function QuitGame2():void{
death = true;
removeEverything();
}
public function NextChallenge(_arg1:MouseEvent):void{
nextChallenge = true;
removeEverything();
}
public function pauseGame(_arg1:MouseEvent):void{
if ((((pause1.currentFrame == 1)) && (!(bounce1._Death)))){
running = false;
pause1.gotoAndStop(2);
} else {
if ((((pause1.currentFrame == 2)) && (!(bounce1._Death)))){
running = true;
pause1.gotoAndStop(1);
};
};
}
public function pauseGame2():void{
if ((((pause1.currentFrame == 1)) && (!(bounce1._Death)))){
running = false;
pause1.gotoAndStop(2);
} else {
if ((((pause1.currentFrame == 2)) && (!(bounce1._Death)))){
running = true;
pause1.gotoAndStop(1);
};
};
}
public function ToggleSound(_arg1:MouseEvent):void{
if (soundOnOff.currentFrame == 1){
soundOn = false;
PulaPula.soundOn = false;
soundOnOff.gotoAndStop(2);
} else {
if (soundOnOff.currentFrame == 2){
soundOn = true;
PulaPula.soundOn = true;
soundOnOff.gotoAndStop(1);
if (((((!(challenge)) && (!(impossible)))) || (challenge))){
channel = gameMusic.play(0, 10);
};
if (((impossible) && (!(challenge)))){
channel = gameMusic2.play(0, 10);
};
channel.soundTransform = transform1;
};
};
}
public function ToggleSound2():void{
if (soundOnOff.currentFrame == 1){
soundOn = false;
PulaPula.soundOn = false;
soundOnOff.gotoAndStop(2);
} else {
if (soundOnOff.currentFrame == 2){
soundOn = true;
PulaPula.soundOn = true;
soundOnOff.gotoAndStop(1);
if (((((!(challenge)) && (!(impossible)))) || (challenge))){
channel = gameMusic.play(0, 10);
};
if (((impossible) && (!(challenge)))){
channel = gameMusic2.play(0, 10);
};
channel.soundTransform = transform1;
};
};
}
public function ToggleKeyboard1(_arg1:MouseEvent):void{
if (Toggle1.currentFrame == 1){
KeyboardMouse = true;
PulaPula.KeyboardMouse = true;
Toggle1.gotoAndStop(2);
} else {
if (Toggle1.currentFrame == 2){
KeyboardMouse = false;
PulaPula.KeyboardMouse = false;
Toggle1.gotoAndStop(1);
};
};
}
public function ToggleKeyboard2():void{
if (Toggle1.currentFrame == 1){
KeyboardMouse = true;
PulaPula.KeyboardMouse = true;
Toggle1.gotoAndStop(2);
} else {
if (Toggle1.currentFrame == 2){
KeyboardMouse = false;
PulaPula.KeyboardMouse = false;
Toggle1.gotoAndStop(1);
};
};
}
public function createRocks():void{
var _local2:Wall;
var _local1:uint;
while (_local1 < rocks.length) {
if (rocks[_local1].y > 600){
if (rocks[_local1].x < 200){
_local2 = new Wall();
_local2.y = (rocks[_local1].y - 1198);
_local2.x = -2;
game2Sprite.removeChild(rocks[_local1]);
rocks.splice(_local1, 1);
rocks.push(_local2);
game2Sprite.addChild(_local2);
};
};
_local1++;
};
}
public function removeEverything():void{
SoundMixer.stopAll();
removeEventListener(Event.ENTER_FRAME, Game1OnLoop);
pause1.removeEventListener(MouseEvent.CLICK, pauseGame);
soundOnOff.removeEventListener(MouseEvent.CLICK, ToggleSound);
quit1.removeEventListener(MouseEvent.CLICK, QuitGame);
restart1.removeEventListener(MouseEvent.CLICK, RestartGame);
Toggle1.removeEventListener(MouseEvent.CLICK, ToggleKeyboard1);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, downControl);
stage.removeEventListener(MouseEvent.CLICK, throwRock);
stage.removeEventListener(KeyboardEvent.KEY_UP, upControl);
if (mainMenu != null){
mainMenu.removeEventListener(MouseEvent.CLICK, gameOver);
textSprite.removeChild(mainMenu);
mainMenu = null;
};
if (Next1 != null){
Next1.removeEventListener(MouseEvent.CLICK, NextChallenge);
textSprite.removeChild(Next1);
Next1 = null;
};
if (playAgain != null){
playAgain.removeEventListener(MouseEvent.CLICK, RestartGame);
textSprite.removeChild(playAgain);
playAgain = null;
};
if (WinGame1 != null){
gameSprite.removeChild(WinGame1);
WinGame1.removeEventListener(Event.ENTER_FRAME, WinGameChallenge);
WinGame1 = null;
};
textSprite.removeChild(block1);
textSprite.removeChild(block2);
textSprite.removeChild(block3);
textSprite.removeChild(title1);
textSprite.removeChild(gscore);
textSprite.removeChild(htext);
textSprite.removeChild(life1);
textSprite.removeChild(life2);
textSprite.removeChild(life3);
textSprite.removeChild(pause1);
textSprite.removeChild(soundOnOff);
textSprite.removeChild(Toggle1);
textSprite.removeChild(quit1);
textSprite.removeChild(restart1);
if (G_over != null){
textSprite.removeChild(G_over);
G_over = null;
};
if (YouWin1 != null){
textSprite.removeChild(YouWin1);
YouWin1 = null;
};
if (GameScore != null){
textSprite.removeChild(GameScore);
GameScore = null;
};
var _local1:int = platforms.length;
var _local2:int;
while (_local2 < _local1) {
gameSprite.removeChild(platforms[0]);
platforms[0].removeListeners();
platforms.splice(0, 1);
_local2++;
};
var _local3:int = fakePlatforms.length;
_local2 = 0;
while (_local2 < _local3) {
gameSprite.removeChild(fakePlatforms[0]);
fakePlatforms.splice(0, 1);
_local2++;
};
var _local4:int = enemies.length;
_local2 = 0;
while (_local2 < _local4) {
gameSprite.removeChild(enemies[0]);
enemies[0].removeListeners();
enemies.splice(0, 1);
_local2++;
};
var _local5:int = catapults.length;
_local2 = 0;
while (_local2 < _local5) {
gameSprite.removeChild(catapults[0]);
catapults.splice(0, 1);
_local2++;
};
var _local6:int = rocks.length;
_local2 = 0;
while (_local2 < _local6) {
game2Sprite.removeChild(rocks[0]);
rocks.splice(0, 1);
_local2++;
};
var _local7:int = bullets.length;
_local2 = 0;
while (_local2 < _local7) {
textSprite.removeChild(bullets[0]);
bullets.splice(0, 1);
_local2++;
};
var _local8:int = fans.length;
_local2 = 0;
while (_local2 < _local8) {
gameSprite.removeChild(fans[0]);
fans[0].removeListeners();
fans.splice(0, 1);
_local2++;
};
var _local9:int = spikes.length;
_local2 = 0;
while (_local2 < _local9) {
gameSprite.removeChild(spikes[0]);
spikes.splice(0, 1);
_local2++;
};
if (Boost != null){
gameSprite.removeChild(Boost);
Boost = null;
};
if (Boost2 != null){
gameSprite.removeChild(Boost2);
Boost2 = null;
};
if (caveRider != null){
textSprite.removeChild(caveRider);
caveRider = null;
};
if (bounce1 != null){
textSprite.removeChild(bounce1);
bounce1 = null;
};
if (lifeBoost != null){
textSprite.removeChild(lifeBoost);
lifeBoost = null;
};
removeChild(gameSprite);
removeChild(textSprite);
}
public function movePlayer():void{
var _local1:bullet;
if (_Left){
bounce1.setXvelocity(0.75);
};
if (_Right){
bounce1.setXvelocity(-0.75);
};
if ((((_Fire == true)) && ((firewait == 0)))){
_local1 = new bullet();
_local1.x = (bounce1.x + 20);
_local1.y = (bounce1.y - 20);
bullets.push(_local1);
bounce1._Fire = true;
bounce1._supercount = 0;
channelBouncer = woosh.play();
textSprite.addChild(_local1);
};
if (_Fire){
firewait++;
};
if (firewait == 5){
_Fire = false;
firewait = 0;
};
}
public function get _meters():uint{
return (meters);
}
public function scrollObjects():void{
var _local1:uint;
var _local2:uint;
if (bounce1.y < 300){
if (bounce1.Yvelocity < 0){
meters = (meters - bounce1.Yvelocity);
marker = (marker - bounce1.Yvelocity);
marker0 = (marker0 - bounce1.Yvelocity);
if (marker > marker_reset){
marker = 0;
};
htext.text = ("height " + meters);
_local1 = 0;
while (_local1 < fakePlatforms.length) {
fakePlatforms[_local1].y = (fakePlatforms[_local1].y - bounce1.Yvelocity);
_local1++;
};
_local1 = 0;
while (_local1 < platforms.length) {
platforms[_local1].y = (platforms[_local1].y - bounce1.Yvelocity);
_local1++;
};
_local2 = 0;
while (_local2 < rocks.length) {
rocks[_local2].y = (rocks[_local2].y - bounce1.Yvelocity);
_local2++;
};
_local2 = 0;
while (_local2 < catapults.length) {
catapults[_local2].y = (catapults[_local2].y - bounce1.Yvelocity);
_local2++;
};
_local2 = 0;
while (_local2 < fans.length) {
fans[_local2].y = (fans[_local2].y - bounce1.Yvelocity);
_local2++;
};
_local2 = 0;
while (_local2 < enemies.length) {
enemies[_local2].y = (enemies[_local2].y - bounce1.Yvelocity);
_local2++;
};
_local2 = 0;
while (_local2 < spikes.length) {
spikes[_local2].y = (spikes[_local2].y - bounce1.Yvelocity);
_local2++;
};
if (Boost != null){
if (!Boost.Active){
Boost.y = (Boost.y - bounce1.Yvelocity);
};
};
if (Boost2 != null){
if (!Boost2.Active){
Boost2.y = (Boost2.y - bounce1.Yvelocity);
};
};
if (lifeBoost != null){
lifeBoost.y = (lifeBoost.y - bounce1.Yvelocity);
};
if (WinGame1 != null){
WinGame1.y = (WinGame1.y - bounce1.Yvelocity);
};
};
};
}
public function createFans():void{
var _local1:uint;
while (_local1 < fans.length) {
if (fans[_local1].hitTestObject(bounce1)){
if ((((fans[_local1]._type == 1)) || ((fans[_local1]._type == 2)))){
bounce1.x = (bounce1.x - fans[_local1]._xchange);
};
if (fans[_local1]._type == 3){
bounce1.x = (bounce1.x - fans[_local1]._xchange);
};
};
if (fans[_local1].y > (600 + fans[_local1].height)){
gameSprite.removeChild(fans[_local1]);
fans[_local1].removeListeners();
fans.splice(_local1, 1);
};
_local1++;
};
}
public function createFakePlatforms():void{
var _local1:uint;
while (_local1 < fakePlatforms.length) {
if (fakePlatforms[_local1].hitTestObject(bounce1.BouncePad)){
if (bounce1.Yvelocity > 0){
platformChannel = crack.play();
fakePlatforms[_local1].hit = true;
};
if (fakePlatforms[_local1].y > (600 + fakePlatforms[_local1].height)){
gameSprite.removeChild(fakePlatforms[_local1]);
fakePlatforms.splice(_local1, 1);
};
};
_local1++;
};
}
public function updateSpikes():void{
var _local1:uint;
while (_local1 < spikes.length) {
if (spikes[_local1].hitTestObject(bounce1.cavePad1)){
if (!bounce1.invincible){
if (lives < 1){
bounce1._Death = true;
} else {
lives--;
channelBouncer = hurtSound.play();
bounce1.Yvelocity = -10;
temporaryInvincible = true;
};
};
};
if (spikes[_local1].y > (600 + spikes[_local1].height)){
gameSprite.removeChild(spikes[_local1]);
spikes.splice(_local1, 1);
};
if ((spikes[_local1] is FireBall)){
spikes[_local1].x = (spikes[_local1].x - 10);
if (spikes[_local1].x < -50){
gameSprite.removeChild(spikes[_local1]);
spikes.splice(_local1, 1);
};
};
_local1++;
};
}
public function updateEnemies():void{
var _local2:uint;
var _local3:*;
var _local4:int;
var _local5:*;
var _local1:uint;
while (_local1 < enemies.length) {
if (enemies[_local1].hitTestObject(bounce1.cavePad1)){
if (enemies[_local1].kill == false){
if (bounce1.Yvelocity < 0){
if (!bounce1.invincible){
if (lives < 1){
bounce1._Death = true;
} else {
lives--;
channelBouncer = hurtSound.play();
bounce1.Yvelocity = -10;
temporaryInvincible = true;
};
};
};
if (bounce1.Yvelocity >= 0){
if (enemies[_local1].hitTestObject(bounce1.BouncePad)){
bounce1._bounce = true;
if (bounce1.Rider){
caveRider.gotoAndPlay(1);
};
enemyChannel2 = punch.play();
bounce1.gotoAndPlay(1);
bounce1.Yvelocity = -14;
enemies[_local1].hit = true;
enemies[_local1].kill = true;
enemies[_local1].y = (enemies[_local1].y + 10);
};
};
};
};
_local2 = 0;
while (_local2 < bullets.length) {
if (enemies[_local1].hitTestObject(bullets[_local2])){
enemies[_local1].kill = true;
if ((((((enemies[_local1] is Enemy4)) || ((enemies[_local1] is FireDragon)))) || ((enemies[_local1] is Monstrinho)))){
enemies[_local1].kill = false;
enemies[_local1]._hitcounter();
enemyChannel2 = punch.play();
};
textSprite.removeChild(bullets[_local2]);
bullets.splice(_local2, 1);
};
_local2++;
};
if (enemies[_local1].y > (600 + enemies[_local1].height)){
gameSprite.removeChild(enemies[_local1]);
enemies.splice(_local1, 1);
};
if ((enemies[_local1] is Enemy4)){
if (enemies[_local1].currentFrame < 15){
if (enemies[_local1].teeth.currentFrame == 5){
if ((((enemies[_local1].y > 50)) && ((enemies[_local1].y < 600)))){
enemyChannel = fatMonster.play(0, 1);
};
};
};
};
if ((enemies[_local1] is Enemy5)){
if (enemies[_local1].currentFrame == 2){
enemyChannel = tinyMonster.play(0, 1);
};
};
if ((enemies[_local1] is FireDragon)){
if (currentFrame == 2){
enemyChannel2 = dragonFire.play();
};
if ((((((((((enemies[_local1].currentFrame == 5)) || ((enemies[_local1].currentFrame == 10)))) || ((enemies[_local1].currentFrame == 15)))) || ((enemies[_local1].currentFrame == 20)))) || ((enemies[_local1].currentFrame == 25)))){
_local3 = new FireBall();
_local3.x = enemies[_local1].x;
_local3.y = enemies[_local1].y;
_local3.rotation = 90;
spikes.push(_local3);
gameSprite.addChild(_local3);
};
};
if ((enemies[_local1] is Monstrinho)){
_local4 = (Math.random() * 10);
if ((((enemies[_local1].currentFrame == 6)) && ((_local4 == 5)))){
_local5 = new MonsterProjectile();
_local5.x = (enemies[_local1].x + 20);
_local5.y = (enemies[_local1].y + 10);
enemies.push(_local5);
gameSprite.addChild(_local5);
};
};
_local1++;
};
}
public function updatePlatforms():void{
var _local1:uint;
while (_local1 < platforms.length) {
if (platforms[_local1].get_padT() == 4){
if (platforms[_local1].currentFrame == 10){
platformChannel = crack.play();
};
};
if (platforms[_local1].get_padT() == 3){
if (platforms[_local1].currentFrame == 6){
platformChannel = crack.play();
};
};
if (platforms[_local1].get_padT() == 5){
if (platforms[_local1].currentFrame == 10){
platformChannel = phase.play();
};
};
if (platforms[_local1].get_padT() == 8){
if (((platforms[_local1].hitTestObject(bounce1.BouncePad)) && ((bounce1.Yvelocity >= 0)))){
if (platforms[_local1]._kill2 == true){
if (!bounce1.invincible){
if (lives < 1){
bounce1._Death = true;
} else {
lives--;
channelBouncer = hurtSound.play();
bounce1.Yvelocity = -10;
temporaryInvincible = true;
};
};
};
};
};
if (platforms[_local1].hitTestObject(bounce1.BouncePad)){
if (bounce1.Yvelocity >= 0){
bounce1._bounce = true;
if (bounce1.Rider){
caveRider.gotoAndPlay(1);
};
bounce1.gotoAndPlay(1);
bounce1.Yvelocity = -16;
platforms[_local1].hit = true;
};
};
if (platforms[_local1].get_padT() == 8){
if (platforms[_local1].currentFrame == 25){
enemyChannel = blade.play();
};
};
if (platforms[_local1].get_padT() == 7){
if (((platforms[_local1].spike1.hitTestObject(bounce1.cavePad1)) && ((bounce1.Yvelocity < 0)))){
if (!bounce1.invincible){
if (lives < 1){
bounce1._Death = true;
} else {
lives--;
channelBouncer = hurtSound.play();
bounce1.Yvelocity = -10;
temporaryInvincible = true;
};
};
};
};
if (platforms[_local1].y > (600 + platforms[_local1].height)){
gameSprite.removeChild(platforms[_local1]);
platforms.splice(_local1, 1);
};
_local1++;
};
}
public function updateBullets():void{
var _local1:uint;
while (_local1 < bullets.length) {
if (bullets[_local1].y > 700){
textSprite.removeChild(bullets[_local1]);
bullets.splice(_local1, 1);
};
_local1++;
};
}
public function updateCatapults():void{
var _local1:uint;
while (_local1 < catapults.length) {
if (catapults[_local1].hitTestObject(bounce1.BouncePad)){
bounce1._bounce = true;
if (bounce1.Rider){
caveRider.gotoAndPlay(1);
};
bounce1.gotoAndPlay(1);
bounce1.Yvelocity = -28;
catapults[_local1]._hit = true;
};
if (catapults[_local1].y > (600 + catapults[_local1].height)){
gameSprite.removeChild(catapults[_local1]);
catapults.splice(_local1, 1);
};
_local1++;
};
}
public function updateLives():void{
if (lives >= 1){
life1.gotoAndStop(1);
} else {
life1.gotoAndStop(2);
};
if (lives >= 2){
life2.gotoAndStop(1);
} else {
life2.gotoAndStop(2);
};
if (lives >= 3){
life3.gotoAndStop(1);
} else {
life3.gotoAndStop(3);
};
if ((((lifeBoost == null)) && ((lives < 3)))){
if ((((((((((meters > 5000)) && ((meters < 5100)))) || ((((meters > 10000)) && ((meters < 10100)))))) || ((((meters > 15000)) && ((meters < 15100)))))) || ((((meters > 20000)) && ((meters < 20100)))))){
lifeBoost = new LifeBoost();
lifeBoost.x = (50 + (Math.random() * 300));
lifeBoost.y = -100;
textSprite.addChild(lifeBoost);
};
} else {
if (lifeBoost != null){
if (lifeBoost.hitTestObject(bounce1)){
lives++;
textSprite.removeChild(lifeBoost);
lifeBoost = null;
} else {
if (lifeBoost.y > (600 + lifeBoost.height)){
textSprite.removeChild(lifeBoost);
lifeBoost = null;
};
};
};
};
}
public function throwRock(_arg1:MouseEvent):void{
_Fire = true;
}
public function updateBoost():void{
if (Boost != null){
if (Boost.hitTestObject(bounce1)){
if (Boost.TimeLeft == 148){
platformChannel = boostSound.play();
};
if (Boost.TimeLeft > 0){
if (Boost2 != null){
Boost2.y = (Boost2.y + (bounce1.height + 10));
bounce1.alpha = 1;
Boost2.x = 700;
gameSprite.removeChild(Boost2);
Boost2 = null;
};
bounce1.Yvelocity = -20;
Boost.TimeLeft--;
Boost.y = (bounce1.y - 60);
Boost.x = (bounce1.x + 16);
Boost.Active = true;
bounce1.rightarm.gotoAndStop(16);
bounce1.leftarm.gotoAndStop(2);
bounce1.invincible = true;
} else {
Boost.Active = false;
bounce1.leftarm.gotoAndStop(1);
bounce1.rightarm.gotoAndStop(1);
bounce1.invincible = false;
};
};
if (Boost.y > (600 + Boost.height)){
gameSprite.removeChild(Boost);
Boost = null;
};
};
}
public function updateBoost2():void{
if (Boost2 != null){
if (((Boost2.hitTestObject(bounce1)) && ((Boost2.TimeLeft > 0)))){
Boost2.Active = true;
bounce1.alpha = 0;
bounce1.Rider = true;
Boost2.gotoAndStop(2);
caveRider = new CaveRider();
caveRider.x = bounce1.x;
caveRider.y = bounce1.y;
textSprite.addChild(caveRider);
};
if (((Boost2.Active) && ((Boost2.TimeLeft > 0)))){
if (Boost2.TimeLeft == 100){
boostChannel = boostSound.play();
};
bounce1.invincible = true;
caveRider.x = bounce1.x;
caveRider.y = bounce1.y;
bounce1.Yvelocity = -20;
if (caveRider.currentFrame > 34){
caveRider.gotoAndStop(1);
};
Boost2.TimeLeft--;
};
if (Boost2.TimeLeft == 0){
bounce1.alpha = 1;
textSprite.removeChild(caveRider);
caveRider = null;
Boost2.gotoAndStop(1);
Boost2.Active = false;
Boost2.x = bounce1.x;
Boost2.y = ((bounce1.y + bounce1.height) + 10);
bounce1.Rider = false;
bounce1.invincible = false;
Boost2.TimeLeft--;
};
if (Boost2.y > (600 + Boost2.height)){
gameSprite.removeChild(Boost2);
Boost2 = null;
};
};
}
public function randomize():void{
var _local1:uint;
var _local2:uint;
var _local3:Fan;
var _local4:FireDragon;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:Pad;
var _local9:Boolean;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Catapult;
var _local14:Enemy4;
var _local15:Enemy5;
var _local16:*;
var _local17:int;
var _local18:uint;
if (marker == 0){
if ((((meters > 2000)) && ((meters <= 4000)))){
initial0 = 1;
difficulty0 = 2;
};
if ((((meters > 4000)) && ((meters <= 5000)))){
initial0 = 1;
difficulty0 = 3;
};
if ((((meters > 5000)) && ((meters <= 6000)))){
initial0 = 1;
difficulty0 = 4;
};
if ((((meters > 6000)) && ((meters <= 7000)))){
initial0 = 2;
difficulty0 = 5;
};
if ((((meters > 7000)) && ((meters <= 8000)))){
initial0 = 3;
difficulty0 = 3;
};
if ((((meters > 8000)) && ((meters <= 9000)))){
initial0 = 6;
difficulty0 = 4;
};
if ((((meters > 9000)) && ((meters <= 10000)))){
initial0 = 6;
difficulty0 = 4;
};
if ((((meters > 10000)) && ((meters <= 12000)))){
initial0 = 7;
difficulty0 = 5;
};
if ((((meters > 12000)) && ((meters <= 14000)))){
initial0 = 10;
difficulty0 = 3;
};
if ((((meters > 14000)) && ((meters <= 16000)))){
initial0 = 12;
difficulty0 = 3;
};
if ((((meters > 16000)) && ((meters <= 18000)))){
initial0 = 14;
difficulty0 = 4;
};
if ((((meters > 18000)) && ((meters <= 20000)))){
initial0 = 18;
difficulty0 = 1;
};
if (meters > 20000){
initial0 = 10;
difficulty0 = 9;
};
_local1 = (initial0 + (Math.random() * difficulty0));
if (_local1 == 1){
difficulty = 3;
marker_reset = 120;
};
if (_local1 == 2){
difficulty = 8;
marker_reset = 140;
};
if (_local1 == 3){
difficulty = 1;
initial = 7;
marker_reset = 200;
};
if (_local1 == 3){
difficulty = 1;
initial = 6;
marker_reset = 200;
};
if (_local1 == 3){
difficulty = 1;
initial = 5;
marker_reset = 200;
};
if (_local1 == 4){
difficulty = 3;
initial = 9;
marker_reset = 160;
};
if (_local1 == 5){
difficulty = 10;
marker_reset = 160;
};
if (_local1 == 6){
difficulty = 2;
initial = 5;
marker_reset = 140;
};
if (_local1 == 7){
difficulty = 1;
initial = 8;
marker_reset = 200;
};
if (_local1 == 8){
difficulty = 7;
initial = 6;
marker_reset = 200;
};
if (_local1 == 9){
difficulty = 6;
initial = 5;
marker_reset = 200;
};
if (_local1 == 10){
difficulty = 1;
initial = 10;
marker_reset = 180;
};
if (_local1 == 11){
difficulty = 2;
initial = 5;
marker_reset = 180;
};
if (_local1 == 12){
difficulty = 4;
marker_reset = 600;
};
if (_local1 == 13){
difficulty = 1;
initial = 11;
marker_reset = 200;
};
if (_local1 == 14){
difficulty = 1;
initial = 10;
marker_reset = 200;
};
if (_local1 == 15){
difficulty = 4;
marker_reset = 600;
};
if (_local1 == 16){
difficulty = 1;
initial = 11;
marker_reset = 180;
};
if (_local1 == 17){
difficulty = 2;
initial = 10;
marker_reset = 200;
};
if (_local1 == 18){
difficulty = 4;
marker_reset = 600;
};
_local2 = (Math.random() * 20);
if (_local2 == 1){
if (((!((difficulty == 4))) && ((meters > 9000)))){
_local3 = new Fan();
_local3.y = -100;
fans.push(_local3);
gameSprite.addChild(_local3);
};
};
if (_local2 == 2){
if (((!((difficulty == 4))) && ((meters > 12000)))){
_local4 = new FireDragon();
_local4.y = -160;
enemies.push(_local4);
gameSprite.addChild(_local4);
};
};
};
if (marker == 0){
marker = 1;
if (difficulty != 4){
_local5 = 0;
while (_local5 < 3) {
_local7 = (initial + (Math.random() * difficulty));
_local8 = new Pad();
switch (_local7){
case 0:
_local8 = new Pad();
break;
case 1:
_local8 = new Pad();
break;
case 2:
_local8 = new Pad();
break;
case 3:
_local8 = new Pad();
break;
case 4:
_local8 = new Pad6();
break;
case 5:
_local8 = new Pad1();
break;
case 6:
_local8 = new Pad2();
break;
case 7:
_local8 = new Pad3();
break;
case 8:
_local8 = new Pad4();
break;
case 9:
_local8 = new Pad();
break;
case 10:
_local8 = new Pad5();
break;
case 11:
_local8 = new Pad7();
break;
case 12:
_local8 = new Pad8();
break;
};
_local9 = false;
_local8.x = (100 + (Math.random() * 400));
_local8.y = (-100 + (Math.random() * 100));
_local10 = 0;
while (_local10 < platforms.length) {
if (_local8.hitTestObject(platforms[_local10])){
_local9 = true;
};
_local10++;
};
_local11 = 0;
while (_local11 < fakePlatforms.length) {
if (_local8.hitTestObject(fakePlatforms[_local11])){
_local9 = true;
};
_local11++;
};
if (_local9 == false){
if (_local7 != 4){
platforms.push(_local8);
_local12 = (Math.random() * 20);
if ((((_local12 < 3)) && (((((!((_local7 == 5))) && (!((_local7 == 6))))) && (!((_local7 == 10))))))){
_local13 = new Catapult();
_local13.x = _local8.x;
_local13.y = _local8.y;
catapults.push(_local13);
gameSprite.addChild(_local13);
};
if ((((((_local12 == 3)) && ((meters > 7000)))) && (((((!((_local7 == 5))) && (!((_local7 == 6))))) && (!((_local7 == 10))))))){
_local14 = new Enemy4();
_local14.x = _local8.x;
_local14.y = (_local8.y - 10);
enemies.push(_local14);
gameSprite.addChild(_local14);
};
if ((((((_local12 == 4)) && ((meters > 5000)))) && (((((!((_local7 == 5))) && (!((_local7 == 6))))) && (!((_local7 == 10))))))){
_local15 = new Enemy5();
_local15.x = _local8.x;
_local15.y = (_local8.y - 20);
enemies.push(_local15);
gameSprite.addChild(_local15);
};
if ((((((((((_local12 >= 18)) && ((Boost == null)))) && ((Boost2 == null)))) && ((meters > 6000)))) && (((((!((_local7 == 5))) && (!((_local7 == 6))))) && (!((_local7 == 10))))))){
Boost = new TinyDragon();
Boost.x = (_local8.x + 20);
Boost.y = (_local8.y - 80);
gameSprite.addChild(Boost);
};
if ((((((((((((_local12 < 18)) && ((_local12 >= 16)))) && ((Boost2 == null)))) && ((Boost == null)))) && ((meters > 5000)))) && (((((!((_local7 == 5))) && (!((_local7 == 6))))) && (!((_local7 == 10))))))){
Boost2 = new RideDragon();
Boost2.x = (_local8.x + 20);
Boost2.y = (_local8.y - 80);
gameSprite.addChild(Boost2);
};
} else {
fakePlatforms.push(_local8);
};
gameSprite.addChild(_local8);
} else {
_local5--;
};
_local5++;
};
_local6 = (Math.random() * 30);
if ((((_local6 > 25)) && ((meters > 6000)))){
_local16 = new Enemy();
_local17 = (1 + (Math.random() * 6));
switch (_local17){
case 0:
_local16 = new Enemy();
break;
case 1:
_local16 = new Enemy2();
break;
case 2:
_local16 = new Enemy();
break;
case 3:
_local16 = new Enemy2();
break;
case 6:
if (meters > 10000){
_local16 = new Monstrinho();
};
};
_local16.y = -100;
_local16.x = (100 + (Math.random() * 350));
enemies.push(_local16);
gameSprite.addChild(_local16);
};
} else {
_local18 = (Math.random() * 30);
decodeSegments(_local18);
};
};
}
public function decodeSegments(_arg1:uint):void{
var _local4:*;
var _local2:uint = _arg1;
var _local3:* = new Seg1();
if (_local2 == 1){
_local3 = new Seg1();
};
if (_local2 == 2){
_local3 = new Seg2();
};
if (_local2 == 3){
_local3 = new Seg3();
};
if (_local2 == 4){
_local3 = new Seg4();
};
if (_local2 == 5){
_local3 = new Seg5();
};
if (_local2 == 6){
_local3 = new Seg6();
};
if (_local2 == 7){
_local3 = new Seg7();
};
if (_local2 == 8){
_local3 = new Seg8();
};
if (_local2 == 9){
_local3 = new Seg9();
};
if (_local2 == 10){
_local3 = new Seg10();
};
if (_local2 == 11){
_local3 = new Seg11();
};
if (_local2 == 12){
_local3 = new Seg12();
};
if (_local2 == 13){
_local3 = new Seg13();
};
if (_local2 == 14){
_local3 = new Seg14();
};
if (_local2 == 15){
_local3 = new Seg15();
};
if (_local2 == 16){
_local3 = new Seg16();
};
if (_local2 == 17){
_local3 = new Seg17();
};
if (_local2 == 18){
_local3 = new Seg18();
};
if (_local2 == 19){
_local3 = new Seg19();
};
if (_local2 == 20){
_local3 = new Seg20();
};
if (_local2 == 21){
_local3 = new Seg21();
};
if (_local2 == 22){
_local3 = new Seg22();
};
if (_local2 == 23){
_local3 = new Seg23();
};
if (_local2 == 24){
_local3 = new Seg24();
};
if (_local2 == 25){
_local3 = new Seg25();
};
if (_local2 == 26){
_local3 = new Seg26();
};
if (_local2 == 27){
_local3 = new Seg27();
};
if (_local2 == 28){
_local3 = new Seg28();
};
if (_local2 == 29){
_local3 = new Seg29();
};
if (_local2 == 30){
_local3 = new Seg30();
};
if (_local2 == 31){
_local3 = new Seg31();
};
if (_local2 == 32){
_local3 = new Seg32();
};
if (_local2 == 33){
_local3 = new Seg33();
};
if (_local2 == 34){
_local3 = new Seg34();
};
if (_local2 == 35){
_local3 = new Seg35();
};
if (_local2 == 36){
_local3 = new Seg36();
};
if (_local2 == 37){
_local3 = new Seg37();
};
if (_local2 == 38){
_local3 = new Seg38();
};
if (_local2 == 39){
_local3 = new Seg39();
};
if (_local2 == 40){
_local3 = new Seg40();
};
if (_local2 == 41){
_local3 = new Seg41();
};
if (_local2 == 42){
_local3 = new Seg42();
};
while (_local3.numChildren > 0) {
_local4 = _local3.getChildAt(0);
_local3.getChildAt(0).y = (_local4.y - 600);
_local4.x = (_local4.x + 100);
if ((_local4 is Pad)){
if ((_local4 is Pad6)){
} else {
platforms.push(_local4);
gameSprite.addChild(_local4);
};
};
if ((_local4 is Enemy)){
if ((_local4 is FireDragon)){
_local4.x = 400;
};
enemies.push(_local4);
gameSprite.addChild(_local4);
};
if ((_local4 is Fan)){
_local4.x = 450;
if ((_local4 is Fan3)){
_local4.x = 150;
};
fans.push(_local4);
gameSprite.addChild(_local4);
};
if ((_local4 is Pad6)){
fakePlatforms.push(_local4);
gameSprite.addChild(_local4);
};
if ((_local4 is Catapult)){
catapults.push(_local4);
gameSprite.addChild(_local4);
};
if ((_local4 is SpikeSide)){
spikes.push(_local4);
gameSprite.addChild(_local4);
};
};
}
public function challengeMode():void{
var _local1:uint;
if (marker == 0){
marker = 1;
marker_reset = 600;
_local1 = challengeLocation;
if (challengeCounter < 3){
decodeSegments(_local1);
} else {
if (challengeCounter == 3){
WinGame1 = new WinGame();
WinGame1.x = 300;
WinGame1.y = -200;
gameSprite.addChild(WinGame1);
WinGame1.addEventListener(Event.ENTER_FRAME, WinGameChallenge);
};
};
challengeLocation++;
challengeCounter++;
};
}
public function ImpossibleMode():void{
var _local1:uint;
if (marker == 0){
marker = 1;
marker_reset = 600;
_local1 = challengeLocation;
if (challengeCounter < 31){
decodeSegments(_local1);
} else {
if (challengeCounter == 29){
WinGame1 = new WinGame();
WinGame1.x = 300;
WinGame1.y = -200;
gameSprite.addChild(WinGame1);
WinGame1.addEventListener(Event.ENTER_FRAME, WinGameChallenge);
};
};
challengeLocation++;
challengeCounter++;
};
}
public function WinGameChallenge(_arg1:Event):void{
if (((WinGame1.hitTestObject(bounce1)) || (ChallengeComplete))){
if (!ChallengeComplete){
platformChannel = boostSound.play();
};
ChallengeComplete = true;
bounce1.y = (bounce1.y - 17);
WinGame1.y = (bounce1.y - 60);
WinGame1.x = (bounce1.x + 16);
bounce1.rightarm.gotoAndStop(16);
bounce1.leftarm.gotoAndStop(2);
};
}
public function addListeners():void{
stage.addEventListener(KeyboardEvent.KEY_DOWN, downControl);
stage.addEventListener(MouseEvent.CLICK, throwRock);
stage.addEventListener(KeyboardEvent.KEY_UP, upControl);
stage.focus = this;
}
}
}//package
Section 89
//Life (Life)
package {
import flash.display.*;
public class Life extends MovieClip {
public function Life(){
gotoAndStop(1);
cacheAsBitmap = true;
}
}
}//package
Section 90
//LifeBoost (LifeBoost)
package {
import flash.display.*;
public dynamic class LifeBoost extends MovieClip {
}
}//package
Section 91
//Loop1 (Loop1)
package {
import flash.media.*;
public dynamic class Loop1 extends Sound {
}
}//package
Section 92
//Loop2 (Loop2)
package {
import flash.media.*;
public dynamic class Loop2 extends Sound {
}
}//package
Section 93
//LoopMedium (LoopMedium)
package {
import flash.media.*;
public dynamic class LoopMedium extends Sound {
}
}//package
Section 94
//MainMenu (MainMenu)
package {
import flash.display.*;
public dynamic class MainMenu extends SimpleButton {
}
}//package
Section 95
//MonsterProjectile (MonsterProjectile)
package {
import flash.events.*;
public class MonsterProjectile extends Enemy {
public function MonsterProjectile(){
scaleX = 1;
scaleY = 1;
addEventListener(Event.ENTER_FRAME, update);
}
override public function update(_arg1:Event):void{
this.y = (this.y + 5);
}
}
}//package
Section 96
//Monstrinho (Monstrinho)
package {
import flash.events.*;
public class Monstrinho extends Enemy {
private var Mcounter:uint;// = 0
private var enemT:uint;// = 1
private var _hit:Boolean;// = false
private var _kill:Boolean;// = false
private var hitcounter:int;// = 0
private var _move:Boolean;// = false
public function Monstrinho(){
scaleX = 1;
scaleY = 1;
addEventListener(Event.ENTER_FRAME, updateM);
}
public function _hitcounter():void{
hitcounter++;
gotoAndPlay(20);
}
public function updateM(_arg1:Event):void{
if ((((this.y > 200)) && ((this.y < 600)))){
this.y = (this.y - 2);
};
if (!_move){
this.x = (this.x - 4);
if (this.x < 80){
_move = true;
this.x = (this.x + 10);
};
};
if (_move){
this.x = (this.x + 4);
if (this.x > 520){
_move = false;
this.x = (this.x - 10);
};
};
if (_kill == true){
gotoAndStop(12);
this.y = (this.y + 5);
this.rotation = (this.rotation + 10);
};
if (hitcounter > 4){
_kill = true;
};
if (currentFrame == 10){
gotoAndPlay(1);
};
}
override public function removeListeners():void{
removeEventListener(Event.ENTER_FRAME, updateM);
}
}
}//package
Section 97
//Mountain (Mountain)
package {
import flash.display.*;
public dynamic class Mountain extends MovieClip {
}
}//package
Section 98
//NewgroundsAPIAsset_big_popup_background (NewgroundsAPIAsset_big_popup_background)
package {
import flash.display.*;
public dynamic class NewgroundsAPIAsset_big_popup_background extends MovieClip {
public var tl:MovieClip;
public var br:MovieClip;
public var tr:MovieClip;
public var l:MovieClip;
public var shadow:MovieClip;
public var r:MovieClip;
public var b:MovieClip;
public var bl:MovieClip;
public var t:MovieClip;
public var c:MovieClip;
}
}//package
Section 99
//NEXTInstruction (NEXTInstruction)
package {
import flash.display.*;
public dynamic class NEXTInstruction extends SimpleButton {
}
}//package
Section 100
//Pad (Pad)
package {
import flash.events.*;
import flash.display.*;
public class Pad extends MovieClip {
private var Mcounter:uint;// = 0
private var _hit:Boolean;// = false
private var _kill:Boolean;// = false
private var padT:uint;// = 1
public function Pad(){
padT = 0;
var _local1:uint = (1 + (Math.random() * 5));
gotoAndStop(_local1);
addEventListener(Event.ENTER_FRAME, update2);
cacheAsBitmap = true;
}
public function update2(_arg1:Event):void{
if (_kill){
};
}
function set hit(_arg1:Boolean):void{
_hit = _arg1;
}
function get hit():Boolean{
return (_hit);
}
function set kill(_arg1:Boolean):void{
_kill = _arg1;
}
function get kill():Boolean{
return (_kill);
}
public function get_padT():uint{
return (padT);
}
public function removeListeners():void{
removeEventListener(Event.ENTER_FRAME, update2);
}
}
}//package
Section 101
//Pad1 (Pad1)
package {
import flash.events.*;
public class Pad1 extends Pad {
private var Mcounter:uint;// = 0
private var padT:uint;// = 1
public function Pad1(){
padT = 1;
gotoAndPlay(1);
var _local1:uint = (Math.random() * 150);
Mcounter = _local1;
addEventListener(Event.ENTER_FRAME, update);
}
public function update(_arg1:Event):void{
if (Mcounter <= 80){
this.x = (this.x + 2);
} else {
this.x = (this.x - 2);
};
if (Mcounter > 160){
Mcounter = 0;
};
Mcounter++;
}
override public function get_padT():uint{
return (padT);
}
override public function removeListeners():void{
removeEventListener(Event.ENTER_FRAME, update);
}
}
}//package
Section 102
//Pad2 (Pad2)
package {
import flash.events.*;
public class Pad2 extends Pad {
private var Mcounter:uint;// = 0
private var padT:uint;// = 1
public function Pad2(){
padT = 2;
var _local1:uint = (Math.random() * 230);
Mcounter = _local1;
addEventListener(Event.ENTER_FRAME, update);
}
public function update(_arg1:Event):void{
if (Mcounter <= 120){
this.y = (this.y + 2);
} else {
this.y = (this.y - 2);
};
if (Mcounter > 240){
Mcounter = 0;
};
Mcounter++;
}
override public function get_padT():uint{
return (padT);
}
}
}//package
Section 103
//Pad3 (Pad3)
package {
import flash.events.*;
public class Pad3 extends Pad {
private var Mcounter:uint;// = 0
private var padT:uint;// = 1
public function Pad3(){
padT = 3;
gotoAndStop(1);
addEventListener(Event.ENTER_FRAME, update);
}
public function update(_arg1:Event):void{
if (hit){
play();
};
if (currentFrame == 11){
gotoAndStop(11);
this.kill = true;
};
}
override public function get_padT():uint{
return (padT);
}
}
}//package
Section 104
//Pad4 (Pad4)
package {
import flash.events.*;
public class Pad4 extends Pad {
private var Mcounter:uint;// = 0
private var padT:uint;// = 1
public function Pad4(){
padT = 4;
addEventListener(Event.ENTER_FRAME, update);
gotoAndStop(1);
}
public function update(_arg1:Event):void{
if (hit){
nextFrame();
hit = false;
};
if (currentFrame == 5){
play();
};
if (currentFrame == 15){
gotoAndStop(15);
this.kill = true;
};
}
override public function get_padT():uint{
return (padT);
}
}
}//package
Section 105
//Pad5 (Pad5)
package {
import flash.events.*;
public class Pad5 extends Pad {
private var Mcounter:uint;// = 0
private var padT:uint;// = 1
public function Pad5(){
padT = 5;
var _local1:uint = (Math.random() * 20);
gotoAndStop(_local1);
play();
}
public function update(_arg1:Event):void{
}
override public function get_padT():uint{
return (padT);
}
}
}//package
Section 106
//Pad6 (Pad6)
package {
import flash.events.*;
public class Pad6 extends Pad {
private var Mcounter:uint;// = 0
private var padT:uint;// = 1
public function Pad6(){
padT = 6;
gotoAndStop(1);
addEventListener(Event.ENTER_FRAME, update);
}
public function update(_arg1:Event):void{
if (hit){
play();
};
if (currentFrame == 6){
gotoAndStop(6);
this.kill = true;
};
}
override public function get_padT():uint{
return (padT);
}
}
}//package
Section 107
//Pad7 (Pad7)
package {
import flash.events.*;
import flash.display.*;
public class Pad7 extends Pad {
public var spike1:MovieClip;
private var Mcounter:uint;// = 0
private var padT:uint;// = 7
public function Pad7(){
padT = 7;
addEventListener(Event.ENTER_FRAME, update);
}
public function update(_arg1:Event):void{
if (hit){
play();
};
if (currentFrame == 10){
gotoAndStop(10);
this.kill = true;
};
}
override public function get_padT():uint{
return (padT);
}
}
}//package
Section 108
//Pad8 (Pad8)
package {
import flash.events.*;
public class Pad8 extends Pad {
private var Mcounter:uint;// = 0
private var padT:uint;// = 8
private var kill2:Boolean;// = true
public function Pad8(){
var _local1:uint = (Math.random() * 60);
gotoAndPlay(_local1);
padT = 8;
addEventListener(Event.ENTER_FRAME, update);
}
public function update(_arg1:Event):void{
if ((((this.currentFrame > 35)) && ((this.currentFrame < 55)))){
kill2 = true;
} else {
kill2 = false;
};
}
override public function get_padT():uint{
return (padT);
}
public function get _kill2():Boolean{
return (kill2);
}
}
}//package
Section 109
//PauseButton (PauseButton)
package {
import flash.display.*;
public class PauseButton extends MovieClip {
public function PauseButton(){
gotoAndStop(1);
}
}
}//package
Section 110
//Phase (Phase)
package {
import flash.media.*;
public dynamic class Phase extends Sound {
}
}//package
Section 111
//PlatformBounce (PlatformBounce)
package {
import flash.media.*;
public dynamic class PlatformBounce extends Sound {
}
}//package
Section 112
//PlatformBounce2 (PlatformBounce2)
package {
import flash.media.*;
public dynamic class PlatformBounce2 extends Sound {
}
}//package
Section 113
//PlatformDie (PlatformDie)
package {
import flash.media.*;
public dynamic class PlatformDie extends Sound {
}
}//package
Section 114
//PlayAgain (PlayAgain)
package {
import flash.display.*;
public dynamic class PlayAgain extends SimpleButton {
}
}//package
Section 115
//PlayButton2 (PlayButton2)
package {
import flash.display.*;
public dynamic class PlayButton2 extends MovieClip {
}
}//package
Section 116
//PulaPula (PulaPula)
package {
import flash.events.*;
import flash.display.*;
import com.kongregate.as3.client.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
public class PulaPula extends MovieClip {
public var loader_txt:TextField;
public var bar_mc:MovieClip;
public var spele_logo:MovieClip;
public var splash:MovieClip;
public var speleLinkButton:SimpleButton;
public var playButton:SimpleButton;
private var jump1:JumpGame;
private var loaded:Boolean;// = true
private var start1:StartMenu;
private var train1:TrainingInstructions;
private var challenge1:ChallengeScreen;
private var lockedChallenge:int;// = 0
public static var locked:Boolean = true;
public static var KeyboardMouse:Boolean = false;
public static var soundOn:Boolean = true;
public static var kongregate:KongregateAPI = new KongregateAPI();
public function PulaPula(){
addFrameScript(0, frame1, 2, frame3, 3, frame4);
siteLock();
this.addChild(kongregate);
stage.stageFocusRect = false;
addEventListener(Event.ENTER_FRAME, loadProgress);
}
public function callLink(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.happytree.com/games/jumpinggames/jumpinggames.html?utm_source=games&utm_medium=exclusives&utm_campaign=enigmaspace");
navigateToURL(_local2, "_blank");
}
public function loading(_arg1:Event):void{
var _local2:Number = this.stage.loaderInfo.bytesTotal;
var _local3:Number = this.stage.loaderInfo.bytesLoaded;
bar_mc.scaleX = (_local3 / _local2);
if (_local2 == _local3){
playButton.alpha = 1;
playButton.addEventListener(MouseEvent.CLICK, clickPlay);
this.removeEventListener(Event.ENTER_FRAME, loading);
};
}
public function clickPlay(_arg1:MouseEvent):void{
playButton.removeEventListener(MouseEvent.CLICK, clickPlay);
removeChild(playButton);
gotoAndStop(3);
}
public function callLink2(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.rozgames.webs.com");
navigateToURL(_local2, "_blank");
}
public function nextFrameNow(_arg1:Event):void{
if (splash.currentFrame >= 184){
gotoAndStop(4);
this.removeEventListener(Event.ENTER_FRAME, nextFrameNow);
this.removeEventListener(MouseEvent.CLICK, callLink2);
};
}
function loadProgress(_arg1:Event){
var _local2:int = this.root.loaderInfo.bytesLoaded;
var _local3:int = this.root.loaderInfo.bytesTotal;
var _local4:int = (_local2 / 0x0400);
var _local5:int = (_local3 / 0x0400);
if ((((_local2 >= _local3)) && ((this.currentFrame == 4)))){
removeEventListener(Event.ENTER_FRAME, loadProgress);
start1 = new StartMenu();
start1.x = 300;
start1.y = 300;
addChild(start1);
addEventListener(Event.ENTER_FRAME, startNormal);
};
}
function siteLock():void{
var _local1:uint;
while (_local1 < stage.loaderInfo.loaderURL.length) {
if (stage.loaderInfo.loaderURL.substr(_local1, 9) == "happytree"){
locked = false;
break;
};
if (stage.loaderInfo.loaderURL.substr(_local1, 5) == "spele"){
locked = false;
break;
};
if (stage.loaderInfo.loaderURL.substr(_local1, 6) == "spiels"){
locked = false;
break;
};
if (stage.loaderInfo.loaderURL.substr(_local1, 8) == "rozgames"){
locked = false;
break;
};
if (stage.loaderInfo.loaderURL.substr(_local1, 8) == "keygames"){
locked = false;
break;
};
if (stage.loaderInfo.loaderURL.substr(_local1, 8) == "www"){
locked = false;
break;
};
locked = false;
_local1++;
};
if (locked){
lockedChallenge = 3;
};
}
public function GameLoop(_arg1:Event):void{
var _local2:Boolean;
var _local3:Boolean;
var _local4:*;
if (jump1._death){
SoundMixer.stopAll();
removeChild(jump1);
removeEventListener(Event.ENTER_FRAME, GameLoop);
start1 = new StartMenu();
start1.x = 300;
start1.y = 300;
addChild(start1);
addEventListener(Event.ENTER_FRAME, startNormal);
};
if (jump1._restart){
SoundMixer.stopAll();
_local2 = jump1.Challenge;
_local3 = jump1.Impossible;
_local4 = (jump1.ChallengeLocation - jump1.ChallengeCounter);
removeChild(jump1);
jump1 = new JumpGame(_local2, _local3);
jump1.ChallengeLocation = _local4;
jump1.x = 0;
jump1.y = 0;
addChild(jump1);
};
if (jump1._nextChallenge){
SoundMixer.stopAll();
_local4 = (jump1.ChallengeLocation - (jump1.ChallengeCounter - 3));
removeChild(jump1);
jump1 = new JumpGame(true, false);
jump1.ChallengeLocation = (_local4 + lockedChallenge);
jump1.x = 0;
jump1.y = 0;
addChild(jump1);
};
}
public function TrainLoop(_arg1:Event):void{
if (train1._Menu){
removeChild(train1);
removeEventListener(Event.ENTER_FRAME, TrainLoop);
start1 = new StartMenu();
start1.x = 300;
start1.y = 300;
addChild(start1);
addEventListener(Event.ENTER_FRAME, startNormal);
};
}
public function ChallengeLoop(_arg1:Event):void{
if (challenge1._Menu){
removeChild(challenge1);
removeEventListener(Event.ENTER_FRAME, ChallengeLoop);
start1 = new StartMenu();
start1.x = 300;
start1.y = 300;
addChild(start1);
addEventListener(Event.ENTER_FRAME, startNormal);
};
if (challenge1.ChallengeLaunch){
jump1 = new JumpGame(true, false);
jump1.ChallengeLocation = challenge1.ChallengeNum;
jump1.x = 0;
jump1.y = 0;
addChild(jump1);
addEventListener(Event.ENTER_FRAME, GameLoop);
removeChild(challenge1);
removeEventListener(Event.ENTER_FRAME, ChallengeLoop);
};
}
public function startNormal(_arg1:Event):void{
var _local2:Boolean;
if (start1._launch1){
removeEventListener(Event.ENTER_FRAME, startNormal);
start1.removeListeners();
removeChild(start1);
jump1 = new JumpGame(false, false);
jump1.x = 0;
jump1.y = 0;
addChild(jump1);
addEventListener(Event.ENTER_FRAME, GameLoop);
};
if (start1._launchI){
removeEventListener(Event.ENTER_FRAME, startNormal);
start1.removeListeners();
removeChild(start1);
train1 = new TrainingInstructions();
train1.x = 300;
train1.y = 300;
addChild(train1);
addEventListener(Event.ENTER_FRAME, TrainLoop);
};
if (start1._launchC){
start1.removeListeners();
removeEventListener(Event.ENTER_FRAME, startNormal);
removeChild(start1);
challenge1 = new ChallengeScreen();
challenge1.x = 300;
challenge1.y = 300;
addChild(challenge1);
addEventListener(Event.ENTER_FRAME, ChallengeLoop);
};
if (start1._launchImp){
removeEventListener(Event.ENTER_FRAME, startNormal);
start1.removeListeners();
removeChild(start1);
_local2 = false;
jump1 = new JumpGame(false, true);
jump1.ChallengeLocation = 1;
jump1.x = 0;
jump1.y = 0;
addChild(jump1);
addEventListener(Event.ENTER_FRAME, GameLoop);
};
}
function frame1(){
stop();
speleLinkButton.addEventListener(MouseEvent.CLICK, callLink);
this.addEventListener(Event.ENTER_FRAME, loading);
}
function frame3(){
stop();
this.addEventListener(Event.ENTER_FRAME, nextFrameNow);
addEventListener(MouseEvent.CLICK, callLink2);
}
function frame4(){
stop();
}
}
}//package
Section 117
//Punch (Punch)
package {
import flash.media.*;
public dynamic class Punch extends Sound {
}
}//package
Section 118
//QuitButton (QuitButton)
package {
import flash.display.*;
public dynamic class QuitButton extends SimpleButton {
}
}//package
Section 119
//restartButton (restartButton)
package {
import flash.display.*;
public dynamic class restartButton extends SimpleButton {
}
}//package
Section 120
//RideDragon (RideDragon)
package {
import flash.display.*;
public class RideDragon extends MovieClip {
private var active:Boolean;// = false
private var timeLeft:int;// = 75
public function RideDragon(){
gotoAndStop(1);
}
function get Active():Boolean{
return (active);
}
function set Active(_arg1:Boolean):void{
active = _arg1;
}
function get TimeLeft():int{
return (timeLeft);
}
function set TimeLeft(_arg1:int):void{
timeLeft = _arg1;
}
}
}//package
Section 121
//Score (Score)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Score extends MovieClip {
public var meterstext:TextField;
public function Score(){
addFrameScript(19, frame20);
}
function frame20(){
gotoAndStop(20);
}
}
}//package
Section 122
//Seg1 (Seg1)
package {
import flash.display.*;
public class Seg1 extends MovieClip {
}
}//package
Section 123
//Seg10 (Seg10)
package {
import flash.display.*;
public dynamic class Seg10 extends MovieClip {
}
}//package
Section 124
//Seg11 (Seg11)
package {
import flash.display.*;
public dynamic class Seg11 extends MovieClip {
}
}//package
Section 125
//Seg12 (Seg12)
package {
import flash.display.*;
public dynamic class Seg12 extends MovieClip {
}
}//package
Section 126
//Seg13 (Seg13)
package {
import flash.display.*;
public dynamic class Seg13 extends MovieClip {
}
}//package
Section 127
//Seg14 (Seg14)
package {
import flash.display.*;
public dynamic class Seg14 extends MovieClip {
}
}//package
Section 128
//Seg15 (Seg15)
package {
import flash.display.*;
public dynamic class Seg15 extends MovieClip {
}
}//package
Section 129
//Seg16 (Seg16)
package {
import flash.display.*;
public dynamic class Seg16 extends MovieClip {
}
}//package
Section 130
//Seg17 (Seg17)
package {
import flash.display.*;
public dynamic class Seg17 extends MovieClip {
}
}//package
Section 131
//Seg18 (Seg18)
package {
import flash.display.*;
public dynamic class Seg18 extends MovieClip {
}
}//package
Section 132
//Seg19 (Seg19)
package {
import flash.display.*;
public dynamic class Seg19 extends MovieClip {
}
}//package
Section 133
//Seg2 (Seg2)
package {
import flash.display.*;
public dynamic class Seg2 extends MovieClip {
}
}//package
Section 134
//Seg20 (Seg20)
package {
import flash.display.*;
public dynamic class Seg20 extends MovieClip {
}
}//package
Section 135
//Seg21 (Seg21)
package {
import flash.display.*;
public dynamic class Seg21 extends MovieClip {
}
}//package
Section 136
//Seg22 (Seg22)
package {
import flash.display.*;
public dynamic class Seg22 extends MovieClip {
}
}//package
Section 137
//Seg23 (Seg23)
package {
import flash.display.*;
public dynamic class Seg23 extends MovieClip {
}
}//package
Section 138
//Seg24 (Seg24)
package {
import flash.display.*;
public dynamic class Seg24 extends MovieClip {
}
}//package
Section 139
//Seg25 (Seg25)
package {
import flash.display.*;
public dynamic class Seg25 extends MovieClip {
}
}//package
Section 140
//Seg26 (Seg26)
package {
import flash.display.*;
public dynamic class Seg26 extends MovieClip {
}
}//package
Section 141
//Seg27 (Seg27)
package {
import flash.display.*;
public dynamic class Seg27 extends MovieClip {
}
}//package
Section 142
//Seg28 (Seg28)
package {
import flash.display.*;
public dynamic class Seg28 extends MovieClip {
}
}//package
Section 143
//Seg29 (Seg29)
package {
import flash.display.*;
public dynamic class Seg29 extends MovieClip {
}
}//package
Section 144
//Seg3 (Seg3)
package {
import flash.display.*;
public dynamic class Seg3 extends MovieClip {
}
}//package
Section 145
//Seg30 (Seg30)
package {
import flash.display.*;
public dynamic class Seg30 extends MovieClip {
}
}//package
Section 146
//Seg31 (Seg31)
package {
import flash.display.*;
public dynamic class Seg31 extends MovieClip {
}
}//package
Section 147
//Seg32 (Seg32)
package {
import flash.display.*;
public dynamic class Seg32 extends MovieClip {
}
}//package
Section 148
//Seg33 (Seg33)
package {
import flash.display.*;
public dynamic class Seg33 extends MovieClip {
}
}//package
Section 149
//Seg34 (Seg34)
package {
import flash.display.*;
public dynamic class Seg34 extends MovieClip {
}
}//package
Section 150
//Seg35 (Seg35)
package {
import flash.display.*;
public dynamic class Seg35 extends MovieClip {
}
}//package
Section 151
//Seg36 (Seg36)
package {
import flash.display.*;
public dynamic class Seg36 extends MovieClip {
}
}//package
Section 152
//Seg37 (Seg37)
package {
import flash.display.*;
public dynamic class Seg37 extends MovieClip {
}
}//package
Section 153
//Seg38 (Seg38)
package {
import flash.display.*;
public dynamic class Seg38 extends MovieClip {
}
}//package
Section 154
//Seg39 (Seg39)
package {
import flash.display.*;
public dynamic class Seg39 extends MovieClip {
}
}//package
Section 155
//Seg4 (Seg4)
package {
import flash.display.*;
public dynamic class Seg4 extends MovieClip {
}
}//package
Section 156
//Seg40 (Seg40)
package {
import flash.display.*;
public dynamic class Seg40 extends MovieClip {
}
}//package
Section 157
//Seg41 (Seg41)
package {
import flash.display.*;
public dynamic class Seg41 extends MovieClip {
}
}//package
Section 158
//Seg42 (Seg42)
package {
import flash.display.*;
public dynamic class Seg42 extends MovieClip {
}
}//package
Section 159
//Seg5 (Seg5)
package {
import flash.display.*;
public dynamic class Seg5 extends MovieClip {
}
}//package
Section 160
//Seg6 (Seg6)
package {
import flash.display.*;
public dynamic class Seg6 extends MovieClip {
}
}//package
Section 161
//Seg7 (Seg7)
package {
import flash.display.*;
public dynamic class Seg7 extends MovieClip {
public var p3:Pad;
public var p4:Pad;
}
}//package
Section 162
//Seg8 (Seg8)
package {
import flash.display.*;
public dynamic class Seg8 extends MovieClip {
public var p1:Pad;
public var p2:Pad;
public var p3:Pad;
public var p4:Pad;
public var p5:Pad;
public var p6:Pad;
}
}//package
Section 163
//Seg9 (Seg9)
package {
import flash.display.*;
public dynamic class Seg9 extends MovieClip {
public var p1:Pad;
public var p2:Pad;
public var p3:Pad;
public var p4:Pad;
public var p5:Pad;
public var p6:Pad;
}
}//package
Section 164
//Segment (Segment)
package {
import flash.display.*;
public class Segment extends MovieClip {
}
}//package
Section 165
//Segment1 (Segment1)
package {
public class Segment1 extends Segment {
public var pl001:Pad;
public var pl002:Pad1;
public var pl003:Pad;
public var pl004:Pad;
public var pl005:Pad;
public var pl006:Pad;
public var pl007:Pad4;
public var pl008:Pad2;
}
}//package
Section 166
//Shot (Shot)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Shot extends MovieClip {
private var dy:Number;
private var lastTime:int;
private var dead:Boolean;
public function Shot(_arg1, _arg2:Number, _arg3:Number){
this.x = _arg1;
this.y = (_arg2 + 60);
dy = _arg3;
lastTime = getTimer();
addEventListener(Event.ENTER_FRAME, moveShot);
}
public function moveShot(_arg1:Event){
var _local2:int = (getTimer() - lastTime);
this.y = (this.y + ((dy * _local2) / -5000));
if (this.y < 0){
deleteShot();
};
}
public function get _dead():Boolean{
return (dead);
}
public function deleteShot(){
dead = true;
removeEventListener(Event.ENTER_FRAME, moveShot);
}
}
}//package
Section 167
//Slate (Slate)
package {
import flash.display.*;
public dynamic class Slate extends MovieClip {
}
}//package
Section 168
//SnapTeeth (SnapTeeth)
package {
import flash.media.*;
public dynamic class SnapTeeth extends Sound {
}
}//package
Section 169
//SpikeSide (SpikeSide)
package {
import flash.display.*;
public class SpikeSide extends MovieClip {
public function SpikeSide(){
cacheAsBitmap = true;
}
}
}//package
Section 170
//StartMenu (StartMenu)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.media.*;
public class StartMenu extends MovieClip {
public var instruct1:SimpleButton;
public var challenge1:SimpleButton;
public var impossible1:SimpleButton;
public var credits1:SimpleButton;
public var normal1:SimpleButton;
private var launch1:Boolean;// = false
private var launchI:Boolean;// = false
private var launchC:Boolean;// = false
private var launchImp:Boolean;// = false
private var gameMusic:LoopMedium;
public function StartMenu(){
gameMusic = new LoopMedium();
super();
addEventListener(Event.ENTER_FRAME, update);
normal1.addEventListener(MouseEvent.CLICK, launchNormal);
challenge1.addEventListener(MouseEvent.CLICK, launchChallenge);
instruct1.addEventListener(MouseEvent.CLICK, launchInstruct);
impossible1.addEventListener(MouseEvent.CLICK, launchImpossible);
credits1.addEventListener(MouseEvent.CLICK, creditsFunction);
gameMusic.play(0, 10);
}
public function update(_arg1:Event):void{
if (currentFrame > 99){
gotoAndPlay(75);
};
}
function launchNormal(_arg1:MouseEvent){
launch1 = true;
}
function launchChallenge(_arg1:MouseEvent){
launchC = true;
}
function launchInstruct(_arg1:MouseEvent){
launchI = true;
}
function creditsFunction(_arg1:MouseEvent){
var _local2:URLRequest = new URLRequest("http://rozgames.webs.com");
navigateToURL(_local2, "_blank");
}
function launchImpossible(_arg1:MouseEvent){
var _local2:URLRequest;
if (!PulaPula.locked){
launchImp = true;
} else {
_local2 = new URLRequest("http://www.happytree.com/games/jumpinggames/jumpinggames.html?utm_source=games&utm_medium=exclusives&utm_campaign=enigmaspace");
navigateToURL(_local2, "_blank");
};
}
public function get _launch1():Boolean{
return (launch1);
}
public function get _launchI():Boolean{
return (launchI);
}
public function get _launchC():Boolean{
return (launchC);
}
public function get _launchImp():Boolean{
return (launchImp);
}
public function removeListeners():void{
SoundMixer.stopAll();
removeEventListener(Event.ENTER_FRAME, update);
removeEventListener(MouseEvent.CLICK, launchNormal);
removeEventListener(MouseEvent.CLICK, launchInstruct);
removeEventListener(MouseEvent.CLICK, launchChallenge);
removeEventListener(MouseEvent.CLICK, launchImpossible);
removeEventListener(MouseEvent.CLICK, creditsFunction);
}
}
}//package
Section 171
//SteppingStone (SteppingStone)
package {
import flash.display.*;
public dynamic class SteppingStone extends MovieClip {
}
}//package
Section 172
//Symbol46 (Symbol46)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class Symbol46 extends MovieClip {
public function Symbol46(){
this.addEventListener(MouseEvent.CLICK, callLink);
}
function callLink(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("www.rozgames.webs.com");
navigateToURL(_local2, "_blank");
}
}
}//package
Section 173
//TinyDragon (TinyDragon)
package {
import flash.display.*;
public class TinyDragon extends MovieClip {
private var active:Boolean;// = false
private var timeLeft:int;// = 150
function get Active():Boolean{
return (active);
}
function set Active(_arg1:Boolean):void{
active = _arg1;
}
function get TimeLeft():int{
return (timeLeft);
}
function set TimeLeft(_arg1:int):void{
timeLeft = _arg1;
}
}
}//package
Section 174
//TinyMonster (TinyMonster)
package {
import flash.media.*;
public dynamic class TinyMonster extends Sound {
}
}//package
Section 175
//ToggleKeyboard (ToggleKeyboard)
package {
import flash.display.*;
public class ToggleKeyboard extends MovieClip {
public function ToggleKeyboard(){
gotoAndStop(1);
}
}
}//package
Section 176
//TrainingInstructions (TrainingInstructions)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public class TrainingInstructions extends MovieClip {
public var menu1:MainMenu;
public var next1:NEXTInstruction;
private var menu:Boolean;// = false
private var trainLoop:TrainLoop;
private var channel:SoundChannel;
public function TrainingInstructions(){
trainLoop = new TrainLoop();
super();
gotoAndStop(1);
menu1.addEventListener(MouseEvent.CLICK, goToMenu);
next1.addEventListener(MouseEvent.CLICK, goToNextFrame);
channel = trainLoop.play(0, 30);
}
function goToMenu(_arg1:MouseEvent){
menu = true;
removeListeners();
}
function get _Menu():Boolean{
return (menu);
}
function goToNextFrame(_arg1:MouseEvent){
nextFrame();
if (currentFrame > 3){
removeEventListener(MouseEvent.CLICK, goToNextFrame);
};
}
public function removeListeners():void{
menu1.removeEventListener(MouseEvent.CLICK, goToMenu);
if (currentFrame != 4){
removeEventListener(MouseEvent.CLICK, goToNextFrame);
};
SoundMixer.stopAll();
}
}
}//package
Section 177
//TrainLoop (TrainLoop)
package {
import flash.media.*;
public dynamic class TrainLoop extends Sound {
}
}//package
Section 178
//Wall (Wall)
package {
import flash.display.*;
public class Wall extends MovieClip {
private var _Wall1:Boolean;// = false
public function Wall(){
var _local1:int = (1 + (Math.random() * 5));
gotoAndStop(_local1);
cacheAsBitmap = true;
}
function get _Wall():Boolean{
return (_Wall1);
}
function set _Wall(_arg1:Boolean):void{
_Wall1 = _arg1;
}
}
}//package
Section 179
//Wall2 (Wall2)
package {
public class Wall2 extends Wall {
public function Wall2(){
cacheAsBitmap = true;
}
}
}//package
Section 180
//Wall2Collide (Wall2Collide)
package {
import flash.display.*;
public dynamic class Wall2Collide extends MovieClip {
}
}//package
Section 181
//WallCracks (WallCracks)
package {
import flash.display.*;
public class WallCracks extends MovieClip {
public function WallCracks(){
var _local1:int = (1 + (Math.random() * 20));
gotoAndStop(_local1);
cacheAsBitmap;
this.x = (Math.random() * 100);
this.y = (this.y + (Math.random() * 10));
}
}
}//package
Section 182
//WindDragon (WindDragon)
package {
import flash.media.*;
public dynamic class WindDragon extends Sound {
}
}//package
Section 183
//WinGame (WinGame)
package {
import flash.display.*;
public dynamic class WinGame extends MovieClip {
}
}//package
Section 184
//Woosh (Woosh)
package {
import flash.media.*;
public dynamic class Woosh extends Sound {
}
}//package
Section 185
//YouWin (YouWin)
package {
import flash.display.*;
public dynamic class YouWin extends MovieClip {
public function YouWin(){
addFrameScript(19, frame20);
}
function frame20(){
gotoAndStop(20);
}
}
}//package