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;
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 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 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));
}
public static function hash(_arg1:String):String{
var _local2:ByteArray = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (hashBinary(_local2));
}
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);
}
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 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 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));
}
public static function hashBytes(_arg1:ByteArray):String{
return (hashBinary(_arg1));
}
}
}//package com.adobe.crypto
Section 2
//JSON (com.adobe.serialization.json.JSON)
package com.adobe.serialization.json {
public class JSON {
public static function decode(_arg1:String){
var _local2:JSONDecoder = new JSONDecoder(_arg1);
return (_local2.getValue());
}
public static function encode(_arg1:Object):String{
var _local2:JSONEncoder = new JSONEncoder(_arg1);
return (_local2.getString());
}
}
}//package com.adobe.serialization.json
Section 3
//JSONDecoder (com.adobe.serialization.json.JSONDecoder)
package com.adobe.serialization.json {
public class JSONDecoder {
private var value;
private var tokenizer:JSONTokenizer;
private var token:JSONToken;
public function JSONDecoder(_arg1:String){
tokenizer = new JSONTokenizer(_arg1);
nextToken();
value = parseValue();
}
private function parseObject():Object{
var _local2:String;
var _local1:Object = new Object();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
while (true) {
if (token.type == JSONTokenType.STRING){
_local2 = String(token.value);
nextToken();
if (token.type == JSONTokenType.COLON){
nextToken();
_local1[_local2] = parseValue();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting } or , but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting : but found " + token.value));
};
} else {
tokenizer.parseError(("Expecting string but found " + token.value));
};
};
return (null);
}
private function parseValue():Object{
if (token == null){
tokenizer.parseError("Unexpected end of input");
};
switch (token.type){
case JSONTokenType.LEFT_BRACE:
return (parseObject());
case JSONTokenType.LEFT_BRACKET:
return (parseArray());
case JSONTokenType.STRING:
case JSONTokenType.NUMBER:
case JSONTokenType.TRUE:
case JSONTokenType.FALSE:
case JSONTokenType.NULL:
return (token.value);
default:
tokenizer.parseError(("Unexpected " + token.value));
};
return (null);
}
private function nextToken():JSONToken{
return ((token = tokenizer.getNextToken()));
}
public function getValue(){
return (value);
}
private function parseArray():Array{
var _local1:Array = new Array();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
while (true) {
_local1.push(parseValue());
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting ] or , but found " + token.value));
};
};
return (null);
}
}
}//package com.adobe.serialization.json
Section 4
//JSONEncoder (com.adobe.serialization.json.JSONEncoder)
package com.adobe.serialization.json {
import flash.utils.*;
public class JSONEncoder {
private var jsonString:String;
public function JSONEncoder(_arg1){
jsonString = convertToString(_arg1);
}
private function escapeString(_arg1:String):String{
var _local3:String;
var _local6:String;
var _local7:String;
var _local2 = "";
var _local4:Number = _arg1.length;
var _local5:int;
while (_local5 < _local4) {
_local3 = _arg1.charAt(_local5);
switch (_local3){
case "\"":
_local2 = (_local2 + "\\\"");
break;
case "\\":
_local2 = (_local2 + "\\\\");
break;
case "\b":
_local2 = (_local2 + "\\b");
break;
case "\f":
_local2 = (_local2 + "\\f");
break;
case "\n":
_local2 = (_local2 + "\\n");
break;
case "\r":
_local2 = (_local2 + "\\r");
break;
case "\t":
_local2 = (_local2 + "\\t");
break;
default:
if (_local3 < " "){
_local6 = _local3.charCodeAt(0).toString(16);
_local7 = ((_local6.length == 2)) ? "00" : "000";
_local2 = (_local2 + (("\\u" + _local7) + _local6));
} else {
_local2 = (_local2 + _local3);
};
};
_local5++;
};
return ((("\"" + _local2) + "\""));
}
private function arrayToString(_arg1:Array):String{
var _local2 = "";
var _local3:int;
while (_local3 < _arg1.length) {
if (_local2.length > 0){
_local2 = (_local2 + ",");
};
_local2 = (_local2 + convertToString(_arg1[_local3]));
_local3++;
};
return ((("[" + _local2) + "]"));
}
public function getString():String{
return (jsonString);
}
private function objectToString(_arg1:Object):String{
var value:Object;
var key:String;
var v:XML;
var o = _arg1;
var s = "";
var classInfo:XML = describeType(o);
if (classInfo.@name.toString() == "Object"){
for (key in o) {
value = o[key];
if ((value is Function)){
} else {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(key) + ":") + convertToString(value)));
};
};
} else {
for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((escapeString(v.@name.toString()) + ":") + convertToString(o[v.@name])));
};
};
return ((("{" + s) + "}"));
}
private function convertToString(_arg1):String{
if ((_arg1 is String)){
return (escapeString((_arg1 as String)));
};
if ((_arg1 is Number)){
return ((isFinite((_arg1 as Number))) ? _arg1.toString() : "null");
} else {
if ((_arg1 is Boolean)){
return ((_arg1) ? "true" : "false");
} else {
if ((_arg1 is Array)){
return (arrayToString((_arg1 as Array)));
};
if ((((_arg1 is Object)) && (!((_arg1 == null))))){
return (objectToString(_arg1));
};
};
};
return ("null");
}
}
}//package com.adobe.serialization.json
Section 5
//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";
_location = _arg2;
_text = _arg3;
}
public function get location():int{
return (_location);
}
public function get text():String{
return (_text);
}
}
}//package com.adobe.serialization.json
Section 6
//JSONToken (com.adobe.serialization.json.JSONToken)
package com.adobe.serialization.json {
public class JSONToken {
private var _value:Object;
private var _type:int;
public function JSONToken(_arg1:int=-1, _arg2:Object=null){
_type = _arg1;
_value = _arg2;
}
public function get value():Object{
return (_value);
}
public function get type():int{
return (_type);
}
public function set type(_arg1:int):void{
_type = _arg1;
}
public function set value(_arg1:Object):void{
_value = _arg1;
}
}
}//package com.adobe.serialization.json
Section 7
//JSONTokenizer (com.adobe.serialization.json.JSONTokenizer)
package com.adobe.serialization.json {
public class JSONTokenizer {
private var loc:int;
private var ch:String;
private var obj:Object;
private var jsonString:String;
public function JSONTokenizer(_arg1:String){
jsonString = _arg1;
loc = 0;
nextChar();
}
private function skipComments():void{
if (ch == "/"){
nextChar();
switch (ch){
case "/":
do {
nextChar();
} while (((!((ch == "\n"))) && (!((ch == "")))));
nextChar();
break;
case "*":
nextChar();
while (true) {
if (ch == "*"){
nextChar();
if (ch == "/"){
nextChar();
break;
};
} else {
nextChar();
};
if (ch == ""){
parseError("Multi-line comment not closed");
};
};
break;
default:
parseError((("Unexpected " + ch) + " encountered (expecting '/' or '*' )"));
};
};
}
private function isDigit(_arg1:String):Boolean{
return ((((_arg1 >= "0")) && ((_arg1 <= "9"))));
}
private function readString():JSONToken{
var _local3:String;
var _local4:int;
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.STRING;
var _local2 = "";
nextChar();
while (((!((ch == "\""))) && (!((ch == ""))))) {
if (ch == "\\"){
nextChar();
switch (ch){
case "\"":
_local2 = (_local2 + "\"");
break;
case "/":
_local2 = (_local2 + "/");
break;
case "\\":
_local2 = (_local2 + "\\");
break;
case "b":
_local2 = (_local2 + "\b");
break;
case "f":
_local2 = (_local2 + "\f");
break;
case "n":
_local2 = (_local2 + "\n");
break;
case "r":
_local2 = (_local2 + "\r");
break;
case "t":
_local2 = (_local2 + "\t");
break;
case "u":
_local3 = "";
_local4 = 0;
while (_local4 < 4) {
if (!isHexDigit(nextChar())){
parseError((" Excepted a hex digit, but found: " + ch));
};
_local3 = (_local3 + ch);
_local4++;
};
_local2 = (_local2 + String.fromCharCode(parseInt(_local3, 16)));
break;
default:
_local2 = (_local2 + ("\\" + ch));
};
} else {
_local2 = (_local2 + ch);
};
nextChar();
};
if (ch == ""){
parseError("Unterminated string literal");
};
nextChar();
_local1.value = _local2;
return (_local1);
}
private function nextChar():String{
return ((ch = jsonString.charAt(loc++)));
}
public function getNextToken():JSONToken{
var _local2:String;
var _local3:String;
var _local4:String;
var _local1:JSONToken = new JSONToken();
skipIgnored();
switch (ch){
case "{":
_local1.type = JSONTokenType.LEFT_BRACE;
_local1.value = "{";
nextChar();
break;
case "}":
_local1.type = JSONTokenType.RIGHT_BRACE;
_local1.value = "}";
nextChar();
break;
case "[":
_local1.type = JSONTokenType.LEFT_BRACKET;
_local1.value = "[";
nextChar();
break;
case "]":
_local1.type = JSONTokenType.RIGHT_BRACKET;
_local1.value = "]";
nextChar();
break;
case ",":
_local1.type = JSONTokenType.COMMA;
_local1.value = ",";
nextChar();
break;
case ":":
_local1.type = JSONTokenType.COLON;
_local1.value = ":";
nextChar();
break;
case "t":
_local2 = ((("t" + nextChar()) + nextChar()) + nextChar());
if (_local2 == "true"){
_local1.type = JSONTokenType.TRUE;
_local1.value = true;
nextChar();
} else {
parseError(("Expecting 'true' but found " + _local2));
};
break;
case "f":
_local3 = (((("f" + nextChar()) + nextChar()) + nextChar()) + nextChar());
if (_local3 == "false"){
_local1.type = JSONTokenType.FALSE;
_local1.value = false;
nextChar();
} else {
parseError(("Expecting 'false' but found " + _local3));
};
break;
case "n":
_local4 = ((("n" + nextChar()) + nextChar()) + nextChar());
if (_local4 == "null"){
_local1.type = JSONTokenType.NULL;
_local1.value = null;
nextChar();
} else {
parseError(("Expecting 'null' but found " + _local4));
};
break;
case "\"":
_local1 = readString();
break;
default:
if (((isDigit(ch)) || ((ch == "-")))){
_local1 = readNumber();
} else {
if (ch == ""){
return (null);
};
parseError((("Unexpected " + ch) + " encountered"));
};
};
return (_local1);
}
private function skipWhite():void{
while (isWhiteSpace(ch)) {
nextChar();
};
}
public function parseError(_arg1:String):void{
throw (new JSONParseError(_arg1, loc, jsonString));
}
private function isWhiteSpace(_arg1:String):Boolean{
return ((((((((_arg1 == " ")) || ((_arg1 == "\t")))) || ((_arg1 == "\n")))) || ((_arg1 == "\r"))));
}
private function skipIgnored():void{
var _local1:int;
do {
_local1 = loc;
skipWhite();
skipComments();
} while (_local1 != loc);
}
private function isHexDigit(_arg1:String):Boolean{
var _local2:String = _arg1.toUpperCase();
return (((isDigit(_arg1)) || ((((_local2 >= "A")) && ((_local2 <= "F"))))));
}
private function readNumber():JSONToken{
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.NUMBER;
var _local2 = "";
if (ch == "-"){
_local2 = (_local2 + "-");
nextChar();
};
if (!isDigit(ch)){
parseError("Expecting a digit");
};
if (ch == "0"){
_local2 = (_local2 + ch);
nextChar();
if (isDigit(ch)){
parseError("A digit cannot immediately follow 0");
};
} else {
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
if (ch == "."){
_local2 = (_local2 + ".");
nextChar();
if (!isDigit(ch)){
parseError("Expecting a digit");
};
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
if ((((ch == "e")) || ((ch == "E")))){
_local2 = (_local2 + "e");
nextChar();
if ((((ch == "+")) || ((ch == "-")))){
_local2 = (_local2 + ch);
nextChar();
};
if (!isDigit(ch)){
parseError("Scientific notation number needs exponent value");
};
while (isDigit(ch)) {
_local2 = (_local2 + ch);
nextChar();
};
};
var _local3:Number = Number(_local2);
if (((isFinite(_local3)) && (!(isNaN(_local3))))){
_local1.value = _local3;
return (_local1);
};
parseError((("Number " + _local3) + " is not valid!"));
return (null);
}
}
}//package com.adobe.serialization.json
Section 8
//JSONTokenType (com.adobe.serialization.json.JSONTokenType)
package com.adobe.serialization.json {
public class JSONTokenType {
public static const NUMBER:int = 11;
public static const FALSE:int = 8;
public static const RIGHT_BRACKET:int = 4;
public static const NULL:int = 9;
public static const TRUE:int = 7;
public static const RIGHT_BRACE:int = 2;
public static const UNKNOWN:int = -1;
public static const COMMA:int = 0;
public static const LEFT_BRACKET:int = 3;
public static const STRING:int = 10;
public static const LEFT_BRACE:int = 1;
public static const COLON:int = 6;
}
}//package com.adobe.serialization.json
Section 9
//IntUtil (com.adobe.utils.IntUtil)
package com.adobe.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
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);
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
}
}//package com.adobe.utils
Section 10
//DefaultAPIConnector (com.newgrounds.components.DefaultAPIConnector)
package com.newgrounds.components {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class DefaultAPIConnector extends MovieClip {
public var viewLegalButton:SimpleButton;
public var closeButton:SimpleButton;
private var _initialized:Boolean;
public var viewLatestButton:SimpleButton;
public function DefaultAPIConnector(){
visible = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onCloseButtonClicked(_arg1:Event):void{
visible = false;
}
private function onHostBlocked(_arg1:NewgroundsAPIEvent):void{
gotoAndStop("bad_host");
visible = true;
}
public function initialize(_arg1:Object):void{
_initialized = true;
NewgroundsAPI.addEventListener(NewgroundsAPIEvent.MOVIE_CONNECTED, onMovieConnected);
NewgroundsAPI.addEventListener(NewgroundsAPIEvent.NEW_VERSION_AVAILABLE, onNewVersionAvailable);
NewgroundsAPI.addEventListener(NewgroundsAPIEvent.HOST_BLOCKED, onHostBlocked);
NewgroundsAPI.setMovieVersion(_arg1.movie_version);
NewgroundsAPI.connectMovie(root, _arg1.movie_id.toString(), _arg1.enc_key);
if (NewgroundsAPI.isNewgrounds()){
trace(((NewgroundsAPI.isNewgrounds() + " ") + NewgroundsAPI.hasUserSession()));
if (((!(NewgroundsAPI.hasUserSession())) && (!(NewgroundsAPI.debugMode)))){
gotoAndStop("no_login");
visible = true;
};
};
}
private function onNewVersionAvailable(_arg1:NewgroundsAPIEvent):void{
gotoAndStop("new_version");
visible = true;
}
private function onMovieConnected(_arg1:NewgroundsAPIEvent):void{
if (!_arg1.success){
gotoAndStop("no_connect");
visible = true;
};
}
private function onOfficialVersionClicked(_arg1:Event):void{
navigateToURL(new URLRequest(NewgroundsAPI.getOfficialVersionURL()), "_blank");
}
private function onEnterFrame(_arg1:Event):void{
var _local2:uint;
var _local3:uint;
if (((this.closeButton) && (!(this.closeButton.hasEventListener(MouseEvent.CLICK))))){
this.closeButton.addEventListener(MouseEvent.CLICK, onCloseButtonClicked);
};
if (((this.viewLatestButton) && (!(this.viewLatestButton.hasEventListener(MouseEvent.CLICK))))){
this.viewLatestButton.addEventListener(MouseEvent.CLICK, onOfficialVersionClicked);
};
if (((this.viewLegalButton) && (!(this.viewLegalButton.hasEventListener(MouseEvent.CLICK))))){
this.viewLegalButton.addEventListener(MouseEvent.CLICK, onOfficialVersionClicked);
};
if (((parent) && (visible))){
_local2 = parent.getChildIndex(this);
_local3 = (parent.numChildren - 1);
if (((parent) && (!((_local2 == _local3))))){
parent.setChildIndex(this, _local3);
};
};
}
}
}//package com.newgrounds.components
Section 11
//BaseN (com.newgrounds.BaseN)
package com.newgrounds {
import flash.utils.*;
public class BaseN {
private var _hashVal:Dictionary;
private var _hashIndex:String;
private var _base:Number;
public function BaseN(_arg1:String=null){
if (_arg1){
_hashIndex = _arg1;
} else {
_hashIndex = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
};
_base = _hashIndex.length;
_hashVal = new Dictionary();
var _local2:uint;
while (_local2 < _base) {
_hashVal[_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 + baseNEncoder(_local5[0], _arg2));
if (_local5.length > 1){
_local4 = (_local4 + ("." + baseNEncoder(_local5[1])));
};
return (_local4);
}
private function baseNDecoder(_arg1:String):uint{
var _local2:uint;
var _local3:uint;
while (_local3 < _arg1.length) {
_local2 = (_local2 * _base);
_local2 = (_local2 + _hashVal[_arg1.charAt(_local3)]);
_local3++;
};
return (_local2);
}
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 + baseNDecoder(_local3[0]));
if (_local3.length > 1){
_local2 = (_local2 + ".");
_local2 = (_local2 + 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 = (_hashIndex.charAt((_local4 % _base)) + _local3);
_local4 = (_local4 / _base);
};
if (_arg2){
while (_local3.length < _arg2) {
_local3 = (_hashIndex.charAt(0) + _local3);
};
};
return (_local3);
}
}
}//package com.newgrounds
Section 12
//NewgroundsAPI (com.newgrounds.NewgroundsAPI)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import com.adobe.serialization.json.*;
import flash.net.*;
import com.adobe.crypto.*;
import flash.system.*;
public class NewgroundsAPI {
private static const COMMANDS_WIKI_URL:String = "http://www.newgrounds.com/wiki/flashapi/commands/";
private static const PREVIEW_HOSTS:Array = ["localhost"];
private static const AD_TERMS_URL:String = "http://www.newgrounds.com/wiki/flashads/terms/";
private static const GATEWAY_URL:String = "http://www.ngads.com/gateway_v2.php";
private static var connected:Boolean;
private static var user_id:Number;
private static var _initialized:Boolean = false;
private static var user_email:String;
private static var publisher_id:Number;
private static var debug:Boolean;
private static var do_echo:Boolean = false;
private static var ad_url:String;
private static var session_id:String;
private static var timeoutTimer:Timer;
public static var errors:Dictionary = NewgroundsAPIError.init_codes();
private static var _medals:Array;
private static var user_name:String;
private static var tracker_id:uint;
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 movie_id:String;
private static var _eventDispatcher:EventDispatcher = new EventDispatcher();
private static var encryption_key:String;
private static var host:String;
private static var loaders:Array = [];
private static var compressor:BaseN = new BaseN(compression_radix);
private static var score_page_counts:Object = new Object();
private static var _preload:Boolean = true;
private static var version:String;
public static var periods:Object = getPeriodAliases();
private static var root:DisplayObject;
private static var compression_radix:String = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
private static var _preloadAssets:Array = [];
private static var sharedObjects:Object = new Object();
private static var save_file = null;
public static function setMovieVersion(_arg1:String):void{
if (((_arg1) && (!((_arg1 == ""))))){
version = _arg1;
};
}
public static function get preload():Boolean{
return (_preload);
}
public static function unlockMedal(_arg1:NewgroundsAPIMedal, _arg2:Boolean=false):void{
sendMessage((("Attempting to unlock '" + _arg1.name) + "'"));
if (_arg1.unlocked){
sendWarning((("Medal '" + _arg1.name) + "' is already unlocked!"));
return;
};
var _local3:Object = new Object();
_local3.medal_id = _arg1.id;
if (_arg2){
_local3.get_score = _arg2;
};
sendSecureCommand("unlockMedal", _local3);
}
public static function set preload(_arg1:Boolean):void{
_preload = _arg1;
}
private static function getHost():String{
return (host);
}
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 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 getMedalByName(_arg1:String):NewgroundsAPIMedal{
var _local2:NewgroundsAPIMedal;
for each (_local2 in _medals) {
if (_local2.name == _arg1){
return (_local2);
};
};
return (null);
}
public static function hasUserEmail():Boolean{
return (((!((user_email == null))) && (!((user_email == "")))));
}
public static function loadLocal(_arg1:String){
var _local2:SharedObject;
if (!sharedObjects[_arg1]){
sharedObjects[_arg1] = SharedObject.getLocal(((("ng_ap_secure_" + movie_id) + "_") + _arg1));
};
_local2 = sharedObjects[_arg1];
_local2.flush();
if (_local2.data[_arg1]){
return (decodeData(sharedObjects.data[_arg1]));
};
return (null);
}
public static function getYesterdaysScores(_arg1:String, _arg2:Object):void{
getScores(_arg1, "y", _arg2, "getYesterdaysScores");
}
private static function callListener(_arg1:String, _arg2:Boolean=true, _arg3=undefined):void{
dispatchEvent(new NewgroundsAPIEvent(_arg1, _arg2, _arg3));
}
public static function sendSecureCommand(_arg1:String, _arg2:Object, _arg3:Object=null, _arg4:Object=null):void{
if (((((!(debug)) && (!(hasUserSession())))) && (!(hasUserEmail())))){
sendError({command_id:getCommandID(_arg1)}, new NewgroundsAPIError("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 _local5 = "";
var _local6:uint;
while (_local6 < 16) {
_local5 = (_local5 + compression_radix.charAt(Math.floor((Math.random() * compression_radix.length))));
_local6++;
};
if (debug){
_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 = _local5;
_arg2.command_id = getCommandID(_arg1);
var _local7:String = MD5.hash(_local5);
var _local8:String = RC4.encrypt(JSON.encode(_arg2), encryption_key);
var _local9:String = (_local7 + _local8);
_arg3.secure = compressHex(_local9);
sendCommand("securePacket", _arg3, false, _arg4);
}
private static function echo(_arg1:String):void{
if (do_echo){
trace(_arg1);
};
}
public static function getThisMonthsScores(_arg1:String, _arg2:Object):void{
getScores(_arg1, "m", _arg2, "getThisMonthsScores");
}
public static function getScores(_arg1:String, _arg2:String, _arg3:Object=null, _arg4:String=null):void{
var _local5:String;
if (!_arg3){
_arg3 = new Object();
};
if (!hasUserSession()){
callListener(NewgroundsAPIEvent.SCORES_LOADED, false, new NewgroundsAPIError("SITE_ID_REQUIRED", (("Host '" + getHost()) + "' does not have high scores enabled")));
return;
};
_arg3.publisher_id = publisher_id;
_arg3.period = _arg2;
_arg3.score = _arg1;
if (_arg3.user_id){
_local5 = _arg2;
} else {
_local5 = (_arg2 + "-u");
};
if (score_page_counts[_local5] == undefined){
_arg3.request_page_count = true;
};
sendCommand("getScores", _arg3);
}
public static function createAd():NewgroundsAPIAd{
sendMessage("You may see a security sandbox violation. This is normal!");
return (new NewgroundsAPIAd(ad_url));
}
private static function dispatchEvent(_arg1:Event):void{
_eventDispatcher.dispatchEvent(_arg1);
echo(("Fired Event: " + _arg1.type));
}
private static function getCommandName(_arg1:String):String{
return (_arg1);
}
public static function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public static function getThisWeeksScores(_arg1:String, _arg2:Object):void{
getScores(_arg1, "w", _arg2, "getThisWeeksScores");
}
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);
}
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 setUserEmail(_arg1:String):void{
user_email = _arg1;
}
public static function hasUserSession():Boolean{
return (((((!((session_id == null))) && (!((session_id == ""))))) && (!((publisher_id == 0)))));
}
public static function get medals():Array{
return ((_medals) ? _medals.concat() : []);
}
public static function get bytesLoaded():uint{
var _local2:*;
var _local1:uint = root.loaderInfo.bytesLoaded;
if (_preload){
for each (_local2 in _preloadAssets) {
_local1 = (_local1 + _local2.bytesLoaded);
};
};
return (_local1);
}
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));
}
public static function connectMovie(_arg1:DisplayObject, _arg2:String, _arg3:String):void{
initialize(_arg1);
if (connected){
return;
};
timeoutTimer.start();
if (!_arg2){
fatalError("NewgroundsAPI.connectMovie() - missing required movie_id parameter", "connectMovie");
};
movie_id = String(_arg2);
tracker_id = uint(movie_id.substring(0, movie_id.indexOf(":")));
encryption_key = _arg3;
debug = !(isPublishedHost());
connected = true;
sendCommand("connectMovie", {host:getHost(), movie_version:version});
}
public static function checkFilePrivs(_arg1:String, _arg2:String):void{
var _local3:uint;
if (user_id){
_local3 = user_id;
} else {
_local3 = 0;
};
var _local4:Object = {folder:_arg1, filename:_arg2, user_id:_local3, publisher_id:publisher_id};
sendCommand("checkFilePrivs", _local4);
}
private static function sendMessage(_arg1:String, _arg2:Boolean=false):String{
var _local3:String = ("[NewgroundsAPI] :: " + _arg1);
if (_arg2){
return (_local3);
};
trace(_local3);
return (null);
}
private static function sendError(_arg1:Object, _arg2:NewgroundsAPIError):void{
trace(((((("[NewgroundsAPI ERROR] :: " + getCommandName(_arg1.command_id)) + "() - ") + _arg2.name) + ":\n\t\t\t\t") + _arg2.message));
}
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=NewgroundsAPI\n\n" + _arg1)));
}
public static function unlockMedalByName(_arg1:String, _arg2:Boolean=false):void{
var _local3:NewgroundsAPIMedal = getMedalByName(_arg1);
if (_local3){
unlockMedal(_local3, _arg2);
};
}
static function reportAssetFailed(_arg1):void{
var _local2:uint;
while (_local2 < _preloadAssets.length) {
if (_arg1 == _preloadAssets[_local2]){
_preloadAssets.splice(_local2, 1);
return;
};
_local2++;
};
}
public static function connectionTimeOut(_arg1:Event=null):void{
dispatchEvent(new NewgroundsAPIEvent(NewgroundsAPIEvent.MOVIE_CONNECTED, false, new NewgroundsAPIError("CONNECTION_FAILED", "Connection to NewgroundsAPI gateway timed out.")));
}
static function reportNewAsset(_arg1):void{
_preloadAssets.push(_arg1);
}
public static function unlockMedalById(_arg1:uint, _arg2:Boolean=false):void{
var _local3:NewgroundsAPIMedal = getMedalById(_arg1);
if (_local3){
unlockMedal(_local3, _arg2);
};
}
public static function hasPublisher():Boolean{
return (!((publisher_id == 0)));
}
private static function sendNotice(_arg1:String, _arg2:String=null):void{
if (_arg2){
_arg1 = (_arg1 + ((("\n[NewgroundsAPI NOTICE] :: \tSee " + COMMANDS_WIKI_URL) + _arg2.toLowerCase()) + " for additional information."));
};
trace(("[NewgroundsAPI NOTICE] :: " + _arg1));
}
public static function initialize(_arg1:DisplayObject):void{
var _local2:Object;
if (_initialized){
return;
};
_initialized = true;
NewgroundsAPI.root = _arg1;
timeoutTimer = new Timer(8000, 1);
if (_arg1.loaderInfo){
_local2 = _arg1.loaderInfo.parameters;
host = _arg1.loaderInfo.url;
};
if (_local2){
if (_local2.NewgroundsAPI_UserName){
user_name = _local2.NewgroundsAPI_UserName;
};
if (_local2.NewgroundsAPI_UserID){
user_id = _local2.NewgroundsAPI_UserID;
};
if (_local2.NewgroundsAPI_PublisherID){
publisher_id = _local2.NewgroundsAPI_PublisherID;
};
if (_local2.NewgroundsAPI_SessionID){
session_id = _local2.NewgroundsAPI_SessionID;
};
} else {
publisher_id = 1;
session_id = null;
user_id = 0;
user_name = "Guest";
};
if ((((host.indexOf("http://") > -1)) || ((host.indexOf("https://") > -1)))){
host = host.split("/")[2].toLowerCase();
} else {
host = "localhost";
};
}
public static function get debugMode():Boolean{
return (debug);
}
public static function getTodaysScores(_arg1:String, _arg2:Object):void{
getScores(_arg1, "t", _arg2, "getTodaysScores");
}
public static function get bytesTotal():uint{
var _local2:*;
var _local1:uint = root.loaderInfo.bytesTotal;
if (_preload){
for each (_local2 in _preloadAssets) {
_local1 = (_local1 + Math.max(_local2.bytesTotal, 1));
};
};
return (_local1);
}
public static function loadCustomLink(_arg1:String):void{
sendCommand("loadCustomLink", {host:getHost(), link:_arg1}, true);
}
public static function get percentLoaded():Number{
return ((bytesLoaded / bytesTotal));
}
public static function isPublishedHost():Boolean{
var _local1:String;
for each (_local1 in PREVIEW_HOSTS) {
if (getHost() == _local1){
return (false);
};
};
return (true);
}
public static function loadMySite():void{
sendCommand("loadMySite", {host:getHost()});
}
public static function getMedalById(_arg1:uint):NewgroundsAPIMedal{
var _local2:NewgroundsAPIMedal;
for each (_local2 in _medals) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
private static function loaderHandler(_arg1:Event):void{
var _local4:Object;
var _local5:NewgroundsAPIError;
var _local2:URLLoader = URLLoader(_arg1.target);
echo((("INPUT: \n" + _local2.data) + "\n"));
var _local3:uint;
while (_local3 < loaders.length) {
if (loaders[_local3] == _local2){
loaders.splice(_local3, 1);
break;
};
_local3++;
};
_local3 = 0;
while (_local3 < _preloadAssets.length) {
if (_preloadAssets[_local3] == _local2){
_preloadAssets.splice(_local3, 1);
break;
};
_local3++;
};
if (_local2.data){
_local4 = JSON.decode(_local2.data);
} else {
_local4 = {success:false};
};
if (!_local4.success){
_local5 = new NewgroundsAPIError(_local4.error_code, _local4.error_msg);
sendError(_local4, _local5);
} else {
doEvent(_local4);
};
}
public static function getOfficialVersionURL():String{
var _local1:String = ((((((GATEWAY_URL + "?tracker_id=") + movie_id) + "&command_id=") + getCommandID("loadOfficalVersion")) + "&seed=") + Math.random());
if (debug){
_local1 = (_local1 + "&debug=1");
};
return (_local1);
}
public static function loadNewgrounds():void{
sendCommand("loadNewgrounds", {host:getHost()}, true);
}
public static function saveFile(_arg1:String, _arg2:String, _arg3:Object, _arg4):void{
}
public static function decodeData(_arg1:String){
return (JSON.decode(RC4.decrypt(uncompressHex(_arg1), encryption_key)));
}
public static function getFiles(_arg1:String, _arg2:Object):void{
}
public static function logCustomEvent(_arg1:String):void{
sendCommand("logCustomEvent", {host:getHost(), event:_arg1});
}
private static function sendCommand(_arg1:String, _arg2:Object, _arg3:Boolean=false, _arg4:Object=null):void{
var _local6:String;
var _local8:String;
var _local9:Array;
var _local10:String;
var _local11:URLLoader;
if (((!(connected)) && (!((_arg1 == "connectMovie"))))){
_local8 = (("NewgroundsAPI." + _arg1) + "() - NewgroundsAPI.connectMovie() must be called before this command can be called\n");
fatalError(_local8, "connectMovie");
};
var _local5:URLVariables = new URLVariables();
_local5.command_id = getCommandID(_arg1);
_local5.tracker_id = movie_id;
if (debug){
_local5.debug = debug;
};
if ((((_arg1 == "connectMovie")) && (preload))){
_local5.preload = 1;
};
if (_arg2){
for (_local6 in _arg2) {
_local5[_local6] = _arg2[_local6];
};
};
if (_arg4){
for (_local6 in _arg4) {
_local5[_local6] = _arg4[_local6];
};
};
echo((("OUTPUT: \n" + JSON.encode(_local5)) + "\n"));
var _local7:URLRequest = new URLRequest((((GATEWAY_URL + "?seed=") + Math.random()) + "&"));
_local7.data = _local5;
if (_arg3){
_local7.method = URLRequestMethod.GET;
_local7.data = _local5;
navigateToURL(_local7, "_blank");
} else {
_local9 = new Array();
for (_local10 in _local5) {
_local9.push(((_local10 + "=") + escape(_local5[_local10])));
};
echo(((("POST " + GATEWAY_URL) + "?") + _local9.join("&")));
_local7.method = URLRequestMethod.POST;
_local11 = new URLLoader();
_local11.addEventListener(Event.COMPLETE, loaderHandler);
_local11.addEventListener(IOErrorEvent.IO_ERROR, loaderErrorHandler);
loaders.push(_local11);
_local11.load(_local7);
if ((((_arg1 == "connectMovie")) && (preload))){
reportNewAsset(_local11);
};
trace(_local7.data);
};
}
public static function postScore(_arg1:String, _arg2:Number, _arg3:Boolean):void{
sendSecureCommand("postScore", {score:_arg1, value:_arg2, get_best:_arg3});
}
public static function finishFileSave(_arg1:String, _arg2:String, _arg3:String, _arg4:Boolean, _arg5, _arg6):void{
}
private static function loaderErrorHandler(_arg1:Event):void{
var _local2:URLLoader = URLLoader(_arg1.target);
var _local3:uint;
while (_local3 < loaders.length) {
if (loaders[_local3] == _local2){
loaders.splice(_local3, 1);
break;
};
_local3++;
};
_local3 = 0;
while (_local3 < _preloadAssets.length) {
if (_preloadAssets[_local3] == _local2){
_preloadAssets.splice(_local3, 1);
break;
};
_local3++;
};
}
public static function encodeData(_arg1:Object):String{
return (compressHex(RC4.encrypt(JSON.encode(_arg1), encryption_key)));
}
public static function getThisYearsScores(_arg1:String, _arg2:Object):void{
getScores(_arg1, "y", _arg2, "getThisYearsScores");
}
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(NewgroundsAPIMedal.createFromObject(_local3));
_local2++;
};
};
}
private static function doEvent(_arg1:Object):void{
var _local2:String;
var _local3:Object;
var _local4:String;
var _local5:Boolean;
var _local6:String;
var _local7:NewgroundsAPIMedal;
switch (getCommandName(_arg1.command_id)){
case "connectMovie":
timeoutTimer.stop();
sendMessage("You have successfully connected to the Newgrounds API Gateway");
sendMessage((("Movie identified as \"" + _arg1.movie_name) + "\""));
callListener(NewgroundsAPIEvent.MOVIE_CONNECTED, _arg1.success, {movie_name:_arg1.movie_name});
_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(NewgroundsAPIEvent.ADS_APPROVED, false, new NewgroundsAPIError("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(NewgroundsAPIEvent.ADS_APPROVED, false, new NewgroundsAPIError("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!");
};
callListener(NewgroundsAPIEvent.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(NewgroundsAPIEvent.HOST_BLOCKED, true, {movie_url:unescape(_arg1.movie_url), redirect_url:getOfficialVersionURL()});
};
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(NewgroundsAPIEvent.NEW_VERSION_AVAILABLE, true, {movie_version:_arg1.movie_version, movie_url:unescape(_arg1.movie_url), redirect_url:getOfficialVersionURL()});
};
if (_arg1.request_portal_url){
sendCommand("setPortalID", {portal_url:host});
};
if (_arg1.medals){
populateMedals(_arg1.medals);
};
break;
case "logCustomEvent":
if (_arg1.success){
sendMessage((("Event '" + _arg1.event) + "' was logged."));
};
callListener(NewgroundsAPIEvent.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;
};
};
sendMessage((((((_local4 + " posted ") + _arg1.value) + " to '") + _arg1.score) + "'"));
_local3 = {score:_arg1.score, value:_arg1.value, username:_local4};
};
callListener(NewgroundsAPIEvent.SCORE_POSTED, _arg1.success, _local3);
break;
case "getScores":
if (_arg1.user_id){
_local6 = _arg1.period;
} else {
_local6 = (_arg1.period + "-u");
};
if (_arg1.total_pages){
score_page_counts[_local6] = _arg1.total_pages;
};
_local3.user_id = _arg1.user_id;
_local3.current_page = _arg1.current_page;
_local3.total_pages = score_page_counts[_local6];
_local3.scores = _arg1.scores;
_local3.period = getPeriodName(_arg1.period);
callListener(NewgroundsAPIEvent.SCORES_LOADED, _arg1.success, _local3);
break;
case "unlockMedal":
if (_medals){
_local7 = getMedalByName(_arg1.medal_name);
_local7.unlocked = true;
};
callListener(NewgroundsAPIEvent.MEDAL_UNLOCKED, _arg1.success, _local7);
break;
case "getMedals":
populateMedals(_arg1.medals);
callListener(NewgroundsAPIEvent.MEDALS_LOADED, _arg1.success, _local3);
break;
case "getFiles":
break;
case "getSystemFiles":
break;
case "saveFile":
save_file = null;
_local3 = {file_id:_arg1.file_id, filename:_arg1.filename, file_url:_arg1.file_url, thumbnail:_arg1.thumbnail, icon:_arg1.icon};
callListener(NewgroundsAPIEvent.FILE_SAVED, _arg1.success, _local3);
break;
case "checkFilePrivs":
if (save_file){
save_file.checkPrivs(_arg1);
} else {
_local3 = {filename:_arg1.filename, folder:_arg1.folder, can_read:_arg1.can_read, can_write:_arg1.can_write};
callListener(NewgroundsAPIEvent.FILE_PRIVS_LOADED, _arg1.success, _local3);
};
break;
};
}
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);
}
public static function loadMedals():void{
if (_medals){
dispatchEvent(new NewgroundsAPIEvent(NewgroundsAPIEvent.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, _arg3:uint=0):void{
var _local4:SharedObject;
if (!sharedObjects[_arg1]){
sharedObjects[_arg1] = SharedObject.getLocal(((("ng_ap_secure_" + movie_id) + "_") + _arg1));
};
_local4 = sharedObjects[_arg1];
_local4.data[_arg1] = encodeData(_arg2);
_local4.flush();
}
private static function getCommandID(_arg1:String):String{
return (_arg1);
}
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 hasEventListener(_arg1:String):Boolean{
return (_eventDispatcher.hasEventListener(_arg1));
}
public static function getAlltimeScores(_arg1:String, _arg2:Object):void{
getScores(_arg1, "a", _arg2, "getAlltimeScores");
}
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(("[NewgroundsAPI WARNING] :: " + _arg1));
}
public static function isNewgrounds():Boolean{
return ((((publisher_id == 1)) || ((getHost().toLowerCase().indexOf("ungrounded.net") > -1))));
}
}
}//package com.newgrounds
Section 13
//NewgroundsAPIAd (com.newgrounds.NewgroundsAPIAd)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class NewgroundsAPIAd extends Sprite {
private var _adURLLoader:URLLoader;
private var _ad:Loader;
private var _mask:Shape;
private static const REMOVED_FROM_STAGE:String = "removedFromStage";
private static var _currentAdUrl:URLRequest;
private static var _adResetTime:Number = 0;
public function NewgroundsAPIAd(_arg1:String){
Security.allowDomain("http://server.cpmstar.com");
Security.allowDomain("http://www.cpmstar.com");
Security.allowDomain("https://server.cpmstar.com");
Security.allowDomain("https://www.cpmstar.com");
Security.allowInsecureDomain("http://server.cpmstar.com");
Security.allowInsecureDomain("http://www.cpmstar.com");
Security.allowInsecureDomain("https://server.cpmstar.com");
Security.allowInsecureDomain("https://www.cpmstar.com");
var _local2:Shape = new Shape();
_local2.graphics.beginFill(0);
_local2.graphics.moveTo(0, 0);
_local2.graphics.lineTo(300, 0);
_local2.graphics.lineTo(300, 250);
_local2.graphics.lineTo(0, 250);
_local2.graphics.lineTo(0, 0);
_local2.graphics.endFill();
_mask = new Shape();
_mask.graphics.beginFill(0);
_mask.graphics.moveTo(0, 0);
_mask.graphics.lineTo(300, 0);
_mask.graphics.lineTo(300, 250);
_mask.graphics.lineTo(0, 250);
_mask.graphics.lineTo(0, 0);
_mask.graphics.endFill();
addChild(_local2);
addChild(_mask);
_adURLLoader = new URLLoader();
_adURLLoader.addEventListener(Event.COMPLETE, adURLHandler);
_adURLLoader.addEventListener(IOErrorEvent.IO_ERROR, adErrorHandler);
if (((_arg1) && (hasAdElapsed))){
if (_arg1.indexOf("?") > -1){
_currentAdUrl = new URLRequest(((_arg1 + "&random=") + Math.random()));
} else {
_currentAdUrl = new URLRequest(((_arg1 + "?random=") + Math.random()));
};
};
if (_currentAdUrl){
_adURLLoader.load(_currentAdUrl);
} else {
trace("[NewgroundsAPI] :: No ad feed URL supplied to Newgrounds API ad!");
};
if (NewgroundsAPI.isFlashVersion(9, 0, 28)){
addEventListener(REMOVED_FROM_STAGE, removeAdHandler);
};
}
private function adLoadedHandler(_arg1:Event):void{
trace("[NewgroundsAPI] :: Ad loaded!");
dispatchEvent(new NewgroundsAPIEvent(NewgroundsAPIEvent.AD_ATTACHED, true));
}
private function removeAdHandler(_arg1:Event):void{
removeAd();
}
private function adErrorHandler(_arg1:Event):void{
dispatchEvent(new NewgroundsAPIEvent(NewgroundsAPIEvent.AD_ATTACHED, false, new NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad")));
removeAd();
}
private function adURLErrorHandler(_arg1:Event):void{
trace("[NewgroundsAPI] :: Unable to load ad feed!");
}
private function loadAd(_arg1:String):void{
if (_ad){
removeAd();
};
_ad = new Loader();
addChild(_ad);
_ad.mask = _mask;
_ad.addEventListener(Event.COMPLETE, adLoadedHandler);
_ad.addEventListener(IOErrorEvent.IO_ERROR, adErrorHandler);
_ad.load(new URLRequest(_arg1));
}
public function removeAd():void{
if (_adURLLoader){
try {
_adURLLoader.close();
} catch(e:Error) {
};
};
if (_ad){
trace("[NewgroundsAPI] :: Ad removed");
try {
_ad.close();
} catch(e:Error) {
};
try {
Object(_ad).unloadAndStop(true);
} catch(e:Error) {
_ad.unload();
};
if (_ad.parent){
_ad.parent.removeChild(_ad);
};
};
_ad = null;
}
private function adURLHandler(_arg1:Event):void{
var _local2:URLLoader = URLLoader(_arg1.target);
if (_local2.data){
loadAd(String(_local2.data));
} else {
dispatchEvent(new NewgroundsAPIEvent(NewgroundsAPIEvent.AD_ATTACHED, false, new NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad")));
};
}
private function get hasAdElapsed():Boolean{
var _local1:Date = new Date();
if (_local1.getTime() >= _adResetTime){
_adResetTime = (_local1.getTime() + ((1000 * 60) * 5));
return (true);
};
return (false);
}
}
}//package com.newgrounds
Section 14
//NewgroundsAPIError (com.newgrounds.NewgroundsAPIError)
package com.newgrounds {
import flash.utils.*;
public class NewgroundsAPIError {
public var alias:String;
public var message:String;
public var name:String;
public var code:Number;// = 0
private static const always_caps:Array = new Array("API", "URL", "ID");
public static const error_names:Object = init_names();
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");
public static const error_codes:Object = init_codes();
public function NewgroundsAPIError(_arg1, _arg2:String){
if ((_arg1 is String)){
_arg1 = error_codes[_arg1];
} else {
if (!(_arg1 is uint)){
_arg1 = 0;
};
};
trace(_arg1);
code = _arg1;
message = _arg2;
name = error_names[_arg1];
trace(name);
alias = aliases[_arg1];
}
public function isError():Boolean{
return (true);
}
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);
}
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);
}
}
}//package com.newgrounds
Section 15
//NewgroundsAPIEvent (com.newgrounds.NewgroundsAPIEvent)
package com.newgrounds {
import flash.events.*;
public class NewgroundsAPIEvent extends Event {
private var _success:Boolean;
private var _target;
private var _data;
public static const AD_ATTACHED:String = "adAttached";
public static const NEW_VERSION_AVAILABLE:String = "newVersionAvailable";
public static const FILE_SAVED:String = "fileSaved";
public static const ADS_APPROVED:String = "adsApproved";
public static const MEDALS_LOADED:String = "medalsLoaded";
public static const MEDAL_UNLOCKED:String = "medalUnlocked";
public static const EVENT_LOGGED:String = "eventLogged";
public static const SCORES_LOADED:String = "scoresLoaded";
public static const SCORE_POSTED:String = "scorePosted";
public static const HOST_BLOCKED:String = "hostBlocked";
public static const MOVIE_CONNECTED:String = "movieConnected";
public static const FILE_PRIVS_LOADED:String = "filePrivsLoaded";
public function NewgroundsAPIEvent(_arg1:String, _arg2:Boolean=true, _arg3=undefined){
super(_arg1);
_data = _arg3;
_success = _arg2;
}
public function get data(){
return (_data);
}
public function get success():Boolean{
return (_success);
}
}
}//package com.newgrounds
Section 16
//NewgroundsAPIMedal (com.newgrounds.NewgroundsAPIMedal)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class NewgroundsAPIMedal {
private var _unlocked:Boolean;// = false
private var _iconLoader:Loader;
private var _difficultyId:uint;
private var _icon:BitmapData;
private var _value:uint;
private var _iconUrl:URLRequest;
private var _name:String;
private var _id:uint;
private static const DIFFICULT_NAMES:Array = [null, "Easy", "Moderate", "Challenging", "Difficult", "Brutal"];
private static const DEFAULT_ICON:BitmapData = new BitmapData(40, 40, false, 0);
public function NewgroundsAPIMedal(_arg1:uint, _arg2:String, _arg3:uint, _arg4:uint, _arg5:Boolean, _arg6:String){
_icon = DEFAULT_ICON;
super();
_id = _arg1;
_name = _arg2;
_value = _arg3;
_difficultyId = _arg4;
_unlocked = _arg5;
NewgroundsAPI.reportNewAsset(this);
_iconUrl = new URLRequest(_arg6);
_iconLoader = new Loader();
_iconLoader.contentLoaderInfo.addEventListener(Event.INIT, onIconLoaderInit);
_iconLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIconLoaderError);
_iconLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onIconLoaderComplete);
_iconLoader.load(_iconUrl, new LoaderContext(true));
}
public function get icon():BitmapData{
return (_icon);
}
public function set unlocked(_arg1:Boolean):void{
_unlocked = _arg1;
}
public function get bytesLoaded():uint{
return ((_iconLoader) ? _iconLoader.contentLoaderInfo.bytesLoaded : 0);
}
public function get name():String{
return (_name);
}
private function onIconLoaderComplete(_arg1:Event):void{
trace((((("[NewgroundsAPI] :: Successfully loaded medal icon for " + name) + " (") + _iconUrl.url.split("/").pop()) + ")"));
var _local2:Bitmap = (_iconLoader.content as Bitmap);
_icon = _local2.bitmapData;
_iconLoader.unload();
_iconLoader = null;
}
public function get bytesTotal():uint{
return ((_iconLoader) ? _iconLoader.contentLoaderInfo.bytesTotal : 0);
}
public function get id():uint{
return (_id);
}
public function unlock():void{
if (!_unlocked){
NewgroundsAPI.unlockMedal(this);
};
}
private function onIconLoaderError(_arg1:IOErrorEvent):void{
trace((((("[NewgroundsAPI WARNING] :: Failed to load medal icon for " + name) + " (") + _iconUrl.url.split("/").pop()) + ")"));
_iconLoader.unload();
_iconLoader = null;
NewgroundsAPI.reportAssetFailed(this);
}
private function onIconLoaderInit(_arg1:Event):void{
trace((((("[NewgroundsAPI] :: Loading medal icon for " + name) + " (") + _iconUrl.url.split("/").pop()) + ")"));
}
public function get unlocked():Boolean{
return (_unlocked);
}
public function createIconBitmap():Bitmap{
return (new Bitmap(icon));
}
public function toString():String{
return ("");
}
public function get value():uint{
return (_value);
}
public function get difficultyId():uint{
return (_difficultyId);
}
public function get difficulty():String{
return (DIFFICULT_NAMES[_difficultyId]);
}
public static function createFromObject(_arg1:Object):NewgroundsAPIMedal{
return (new NewgroundsAPIMedal(_arg1.medal_id, _arg1.medal_name, _arg1.medal_value, _arg1.medal_difficulty, _arg1.medal_unlocked, _arg1.medal_icon));
}
}
}//package com.newgrounds
Section 17
//RC4 (com.newgrounds.RC4)
package com.newgrounds {
public class RC4 {
private static var mykey:Array = new Array(0xFF);
private static var sbox:Array = new Array(0xFF);
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);
}
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));
}
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);
}
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 strToChars(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:uint;
while (_local3 < _arg1.length) {
_local2.push(_arg1.charCodeAt(_local3));
_local3++;
};
return (_local2);
}
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 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 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);
}
}
}//package com.newgrounds
Section 18
//NewgroundsAPI_Ad_Unit_1 (santafu_fla.NewgroundsAPI_Ad_Unit_1)
package santafu_fla {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class NewgroundsAPI_Ad_Unit_1 extends MovieClip {
public var background:MovieClip;
public function NewgroundsAPI_Ad_Unit_1(){
addFrameScript(0, frame1);
}
public function onAdsApproved(_arg1:NewgroundsAPIEvent):void{
addChild(NewgroundsAPI.createAd());
}
function frame1(){
NewgroundsAPI.addEventListener(NewgroundsAPIEvent.ADS_APPROVED, onAdsApproved);
background.visible = false;
}
}
}//package santafu_fla
Section 19
//Timeline_28 (santafu_fla.Timeline_28)
package santafu_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class Timeline_28 extends MovieClip {
public function Timeline_28(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package santafu_fla
Section 20
//Timeline_4 (santafu_fla.Timeline_4)
package santafu_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class Timeline_4 extends MovieClip {
public const AUTO_PLAY:Boolean = false;
public const FRAME_RATE_ADJUST:Boolean = true;
public const LOADER_FRAME_RATE:Number = 30;
public var playButton:SimpleButton;
public var ngButton:SimpleButton;
public var bar:MovieClip;
public var initialized:Boolean;
public var loadingComplete:Boolean;
public var movieFrameRate:Number;
public function Timeline_4(){
addFrameScript(0, frame1, 50, frame51);
}
public function playButtonClickHandler(_arg1:Event=null):void{
santafu(root).started = true;
}
function frame51(){
stop();
if (((playButton) && (!(playButton.hasEventListener(MouseEvent.CLICK))))){
playButton.addEventListener(MouseEvent.CLICK, playButtonClickHandler, false, 0, true);
};
}
public function ngButtonClickHandler(_arg1:Event):void{
navigateToURL(new URLRequest("http://www.newgrounds.com"), "_blank");
}
public function init():void{
if (initialized){
return;
};
movieFrameRate = 0;
if (((FRAME_RATE_ADJUST) && (stage))){
movieFrameRate = stage.frameRate;
stage.frameRate = LOADER_FRAME_RATE;
};
initialized = true;
stop();
if (((root) && ((root is MovieClip)))){
MovieClip(root).stop();
};
loadingComplete = false;
ngButton.addEventListener(MouseEvent.CLICK, ngButtonClickHandler, false, 0, true);
addEventListener(Event.ENTER_FRAME, enterFrameHandler, false, 0, true);
if (meetsVersion([9, 0, 28, 0])){
addEventListener(Event.REMOVED_FROM_STAGE, cleanup, false, 0, true);
};
enterFrameHandler();
}
public function cleanup(_arg1:Event=null){
if (initialized){
ngButton.removeEventListener(MouseEvent.CLICK, ngButtonClickHandler);
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
if (meetsVersion([9, 0, 28, 0])){
removeEventListener(Event.REMOVED_FROM_STAGE, cleanup);
};
if (movieFrameRate){
stage.frameRate = movieFrameRate;
movieFrameRate = 0;
};
};
initialized = false;
}
function frame1(){
initialized = false;
init();
}
public function meetsVersion(_arg1:Array):Boolean{
var _local2:Array = String(Capabilities.version.split(" ")[1]).split(",");
var _local3:uint;
while (_local3 < _arg1.length) {
if (uint(_local2[_local3]) > _arg1[_local3]){
return (true);
};
if (uint(_local2[_local3]) < _arg1[_local3]){
return (false);
};
_local3++;
};
return (true);
}
public function enterFrameHandler(_arg1:Event=null):void{
var _local2:Number;
if (((((!(movieFrameRate)) && (FRAME_RATE_ADJUST))) && (stage))){
movieFrameRate = stage.frameRate;
stage.frameRate = LOADER_FRAME_RATE;
};
if (!loadingComplete){
_local2 = 0;
if (loaderInfo){
_local2 = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
};
if (bar){
bar.scaleX = _local2;
};
if (_local2 == 1){
loadingComplete = true;
if (AUTO_PLAY){
startMovie();
} else {
gotoAndPlay("loaded");
};
};
};
}
public function startMovie():void{
cleanup();
if (((root) && ((root is MovieClip)))){
MovieClip(root).play();
};
dispatchEvent(new Event(Event.COMPLETE));
}
}
}//package santafu_fla
Section 21
//cbooster (cbooster)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cbooster extends MovieClip {
public var iside:int;
public var waittime:int;
public var ty:int;
public var superoffset:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var mstr:MovieClip;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var actionframe:int;
public var maxnrg:int;
public function cbooster(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactivate";
etype = "booster";
ty = -8;
waittime = 0;
maxnrg = 5;
nrg = 5;
iside = 1;
}
}
}//package
Section 22
//ccandyrang (ccandyrang)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class ccandyrang extends MovieClip {
public var loc:String;
public var img:MovieClip;
public var struck:Boolean;
public var actionframe:int;
public var bbHit:gblank;
public function ccandyrang(){
addFrameScript(0, frame1);
}
function frame1(){
actionframe = 0;
struck = false;
}
}
}//package
Section 23
//ccane (ccane)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class ccane extends MovieClip {
public var iside:int;
public var waittime:int;
public var ty:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var loc:int;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var mstr:MovieClip;
public var tmrex1:int;
public var tmrex2:int;
public var tmrex3:int;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var actionframe:int;
public var struck:Boolean;
public var moveframe:int;
public var maxnrg:int;
public function ccane(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactive";
etype = "cane";
ty = 32;
waittime = 0;
maxnrg = 1;
nrg = 1;
iside = 1;
loc = 0;
struck = false;
}
}
}//package
Section 24
//ccharselect (ccharselect)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class ccharselect extends MovieClip {
public var br:gcharselectraptor;
public var bs:gcharselectsanta;
public var bj:gcharselectjebus;
public function ccharselect(){
addFrameScript(0, frame1);
}
function frame1(){
bs.buttonMode = true;
bj.buttonMode = true;
br.buttonMode = true;
bs.addEventListener(MouseEvent.MOUSE_OVER, bover);
bj.addEventListener(MouseEvent.MOUSE_OVER, bover);
br.addEventListener(MouseEvent.MOUSE_OVER, bover);
bs.addEventListener(MouseEvent.MOUSE_OUT, bout);
br.addEventListener(MouseEvent.MOUSE_OUT, bout);
bj.addEventListener(MouseEvent.MOUSE_OUT, bout);
bs.addEventListener(MouseEvent.CLICK, bclik);
br.addEventListener(MouseEvent.CLICK, bclik);
bj.addEventListener(MouseEvent.CLICK, bclik);
}
public function bover(_arg1:MouseEvent){
if (_arg1.currentTarget.currentFrame == 3){
return;
};
_arg1.currentTarget.gotoAndStop(2);
}
public function bout(_arg1:MouseEvent){
if (_arg1.currentTarget.currentFrame == 3){
return;
};
_arg1.currentTarget.gotoAndStop(1);
}
public function bclik(_arg1:MouseEvent){
if (_arg1.currentTarget.currentFrame == 3){
return;
};
switch (_arg1.currentTarget.name){
case "bs":
santafu(root).ioffset = 0;
santafu(root).flipmode("playfield");
break;
case "bj":
santafu(root).ioffset = 17;
santafu(root).flipmode("playfield");
break;
case "br":
santafu(root).ioffset = 34;
santafu(root).flipmode("playfield");
break;
};
}
}
}//package
Section 25
//ccredits (ccredits)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class ccredits extends MovieClip {
public var bb:gblank;
public var txtb:TextField;
public var bo:gblank;
public function ccredits(){
addFrameScript(0, frame1);
}
public function bnout(_arg1:MouseEvent){
txtb.textColor = 0xFF00;
}
function frame1(){
bb.buttonMode = true;
bo.buttonMode = true;
txtb.mouseWheelEnabled = false;
bb.addEventListener(MouseEvent.MOUSE_OVER, bnover);
bb.addEventListener(MouseEvent.MOUSE_OUT, bnout);
bb.addEventListener(MouseEvent.CLICK, bnclik);
bo.addEventListener(MouseEvent.CLICK, bclik);
}
public function bclik(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.doctoroctoroc.com/8BitJesus/"), "_blank");
}
public function bnover(_arg1:MouseEvent){
txtb.textColor = 0xFF0000;
}
public function bnclik(_arg1:MouseEvent){
txtb.textColor = 0xFF0000;
santafu(root).flipmode("title");
}
}
}//package
Section 26
//cdad (cdad)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cdad extends MovieClip {
public var iside:int;
public var waittime:int;
public var ty:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var mstr:MovieClip;
public var tmrex1:int;
public var tmrex2:int;
public var tmrex3:int;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var actionframe:int;
public var struck:Boolean;
public var moveframe:int;
public var maxnrg:int;
public function cdad(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactive";
etype = "dad";
ty = 0;
waittime = 0;
maxnrg = 2;
nrg = 2;
iside = 1;
struck = false;
}
}
}//package
Section 27
//cendingjesus (cendingjesus)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cendingjesus extends MovieClip {
public var bb:gbaby;
public var p1:csanta;
public var tmrani:int;
public var lite:glight;
public var actionframe:int;
public function cendingjesus(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
actionframe = 0;
}
public function devisible(){
actionframe = 0;
lite.alpha = 0;
lite.visible = false;
p1.mstr.img.gotoAndStop(35);
bb.gotoAndStop(2);
bb.alpha = 1;
bb.visible = true;
p1.visible = false;
p1.alpha = 0;
}
}
}//package
Section 28
//cendingraptor (cendingraptor)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cendingraptor extends MovieClip {
public var tmrani:int;
public var h1:MovieClip;
public var h2:MovieClip;
public var h3:MovieClip;
public var h4:MovieClip;
public var h5:MovieClip;
public var txt:MovieClip;
public var actionframe:int;
public function cendingraptor(){
addFrameScript(0, frame1);
}
function frame1(){
actionframe = 0;
tmrani = 0;
}
public function devisible(){
txt.gotoAndStop(1);
h1.visible = false;
h2.visible = true;
h3.visible = true;
h4.visible = true;
h5.visible = true;
actionframe = 0;
}
}
}//package
Section 29
//cendingsanta (cendingsanta)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cendingsanta extends MovieClip {
public var but:MovieClip;
public var txts:TextField;
public var bg:MovieClip;
public var hl:MovieClip;
public var santa:MovieClip;
public var bs:gblank;
public var bgmovearray:Array;
public var soffset:int;
public var eyes:MovieClip;
public var doorlight:MovieClip;
public var txt:MovieClip;
public var splat:MovieClip;
public var endframe:int;
public var blak:MovieClip;
public var tmrend:int;
public var miss:MovieClip;
public function cendingsanta(){
addFrameScript(0, frame1);
}
public function devisible(){
txts.textColor = 0xFFFFFF;
blak.alpha = 0;
blak.visible = false;
but.visible = false;
bg.visible = false;
bg.enabled = false;
santa.x = 0;
santa.y = 0;
hl.enabled = false;
miss.enabled = false;
santa.enabled = false;
santa.gotoAndStop(1);
santa.visible = false;
eyes.gotoAndStop(1);
eyes.visible = false;
splat.gotoAndStop(1);
splat.visible = false;
hl.visible = false;
doorlight.visible = false;
miss.visible = false;
miss.gotoAndStop(1);
txt.gotoAndStop(1);
txt.visible = false;
soffset = 0;
endframe = 0;
}
function frame1(){
endframe = 0;
tmrend = 0;
soffset = 0;
bgmovearray = new Array();
bs.buttonMode = true;
txts.mouseWheelEnabled = false;
bs.addEventListener(MouseEvent.MOUSE_OVER, bover);
bs.addEventListener(MouseEvent.MOUSE_OUT, bout);
bs.addEventListener(MouseEvent.CLICK, bclik);
bgmovearray.push(bg);
bgmovearray.push(miss);
bgmovearray.push(santa);
}
public function bout(_arg1:MouseEvent){
txts.textColor = 0xFFFFFF;
}
public function bclik(_arg1:MouseEvent){
txts.textColor = 0xFF0000;
endframe = 106;
tmrend = 0;
}
public function bover(_arg1:MouseEvent){
txts.textColor = 0xFF0000;
}
}
}//package
Section 30
//cfarkus (cfarkus)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cfarkus extends MovieClip {
public var iside:int;
public var waittime:int;
public var ty:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var mstr:MovieClip;
public var tmrex1:int;
public var tmrex2:int;
public var tmrex3:int;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var actionframe:int;
public var struck:Boolean;
public var moveframe:int;
public var maxnrg:int;
public function cfarkus(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactive";
etype = "farkus";
ty = 3;
waittime = 0;
maxnrg = 12;
nrg = 12;
iside = 1;
struck = false;
}
}
}//package
Section 31
//cgameover (cgameover)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cgameover extends MovieClip {
public var fb6:MovieClip;
public var txtr:TextField;
public var f10:MovieClip;
public var f11:MovieClip;
public var lid:MovieClip;
public var f1:MovieClip;
public var f2:MovieClip;
public var f3:MovieClip;
public var f4:MovieClip;
public var f5:MovieClip;
public var f6:MovieClip;
public var f7:MovieClip;
public var f8:MovieClip;
public var f9:MovieClip;
public var fb9:MovieClip;
public var tmrtop:int;
public var f12:MovieClip;
public var tmrani:int;
public var fbarray:Array;
public var tmrbot:int;
public var ftarray:Array;
public var br:gblank;
public var fadeout:Boolean;
public var txtgo:MovieClip;
public var flik:MovieClip;
public var i:int;
public var skul:MovieClip;
public var fadeframe:int;
public var blak:MovieClip;
public var fb1:MovieClip;
public var fb2:MovieClip;
public var fb3:MovieClip;
public var fb4:MovieClip;
public var fb5:MovieClip;
public var fb7:MovieClip;
public var fb8:MovieClip;
public function cgameover(){
addFrameScript(0, frame1);
}
public function shiftbot(){
i = 0;
while (i < fbarray.length) {
if (!fbarray[i].visible){
fbarray[i].gotoAndStop(9);
fbarray[i].visible = true;
break;
};
if (fbarray[i].currentFrame == 1){
fbarray[i].gotoAndStop(9);
} else {
fbarray[i].prevFrame();
};
i++;
};
if (flik.currentFrame == 2){
flik.prevFrame();
} else {
flik.nextFrame();
};
}
public function bclik(_arg1:MouseEvent){
if (fadeout){
return;
};
fadeout = true;
blak.visible = true;
txtr.textColor = 0xFF0000;
}
public function shifttop(){
i = 0;
while (i < ftarray.length) {
if (!ftarray[i].visible){
ftarray[i].gotoAndStop(9);
ftarray[i].visible = true;
break;
};
if (ftarray[i].currentFrame == 1){
ftarray[i].gotoAndStop(9);
} else {
ftarray[i].prevFrame();
};
i++;
};
}
public function bover(_arg1:MouseEvent){
if (fadeout){
return;
};
txtr.textColor = 0xFF0000;
}
public function bout(_arg1:MouseEvent){
if (fadeout){
return;
};
txtr.textColor = 0xFFFFFF;
}
public function devisible(){
i = 0;
while (i < fbarray.length) {
fbarray[i].visible = false;
i++;
};
i = 0;
while (i < ftarray.length) {
ftarray[i].visible = false;
i++;
};
fadeout = false;
br.visible = false;
txtr.visible = false;
txtr.textColor = 0xFFFFFF;
}
function frame1(){
ftarray = new Array();
fbarray = new Array();
tmrtop = 0;
tmrbot = 0;
tmrani = 0;
fadeframe = 0;
fadeout = false;
br.buttonMode = true;
txtr.mouseWheelEnabled = false;
br.addEventListener(MouseEvent.MOUSE_OVER, bover);
br.addEventListener(MouseEvent.MOUSE_OUT, bout);
br.addEventListener(MouseEvent.CLICK, bclik);
i = 0;
i = 1;
while (i <= 12) {
ftarray.push(getChildByName(("f" + i)));
if (i < 10){
ftarray[(i - 1)].gotoAndStop(i);
} else {
ftarray[(i - 1)].gotoAndStop((i - 9));
};
i++;
};
i = 1;
while (i <= 9) {
fbarray.push(getChildByName(("fb" + i)));
fbarray[(i - 1)].gotoAndStop(i);
i++;
};
}
}
}//package
Section 32
//cgripper (cgripper)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cgripper extends MovieClip {
public var iside:int;
public var waittime:int;
public var ty:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var minienable:Boolean;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var mstr:gigripper;
public var tmrex1:int;
public var tmrex2:int;
public var tmrex3:int;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var actionframe:int;
public var struck:Boolean;
public var moveframe:int;
public var maxnrg:int;
public function cgripper(){
addFrameScript(0, frame1);
}
function frame1(){
minienable = true;
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactive";
etype = "gripper";
ty = -8;
waittime = 0;
maxnrg = 1;
nrg = 1;
iside = 1;
struck = false;
}
}
}//package
Section 33
//chopper (chopper)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class chopper extends MovieClip {
public var iside:int;
public var waittime:int;
public var ty:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var minienable:Boolean;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var mstr:gihopper;
public var tmrex1:int;
public var tmrex2:int;
public var tmrex3:int;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var actionframe:int;
public var struck:Boolean;
public var moveframe:int;
public var maxnrg:int;
public function chopper(){
addFrameScript(0, frame1);
}
function frame1(){
minienable = true;
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactive";
etype = "hopper";
ty = 22;
waittime = 0;
maxnrg = 1;
nrg = 1;
iside = 1;
struck = false;
}
}
}//package
Section 34
//chsentry (chsentry)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class chsentry extends MovieClip {
public var pp:gblank;
public var pq:gblank;
public var txtfinish:TextField;
public var xy:gblank;
public var xx:gblank;
public var fadetmr:int;
public var pd:gblank;
public var txtscore:TextField;
public var tstr:String;
public var bback:gblank;
public var fadeout:Boolean;
public var txtback:TextField;
public var a:gblank;
public var b:gblank;
public var c:gblank;
public var d:gblank;
public var e:gblank;
public var f:gblank;
public var g:gblank;
public var h:gblank;
public var i:int;
public var j:gblank;
public var k:gblank;
public var l:gblank;
public var m:gblank;
public var pand:gblank;
public var o:gblank;
public var p:gblank;
public var fadeframe:int;
public var r:gblank;
public var s:gblank;
public var t:gblank;
public var u:gblank;
public var v:gblank;
public var w:gblank;
public var q:gblank;
public var z:gblank;
public var n:gblank;
public var n0:gblank;
public var n1:gblank;
public var n3:gblank;
public var n4:gblank;
public var n5:gblank;
public var n6:gblank;
public var n7:gblank;
public var n8:gblank;
public var n9:gblank;
public var barfarray:Array;
public var n2:gblank;
public var pstar:gblank;
public var pheart:gblank;
public var bdone:gblank;
public var pe:gblank;
public var txtname:TextField;
public function chsentry(){
addFrameScript(0, frame1);
}
public function bbout(_arg1:MouseEvent){
txtback.textColor = 0xFFFFFF;
}
public function bbover(_arg1:MouseEvent){
txtback.textColor = 0xFF0000;
}
public function bdover(_arg1:MouseEvent){
txtfinish.textColor = 0xFF0000;
}
function frame1(){
stop();
txtname.text = "";
barfarray = new Array();
i = 0;
tstr = "";
bback.addEventListener(MouseEvent.MOUSE_OVER, bbover);
bback.addEventListener(MouseEvent.MOUSE_OUT, bbout);
bdone.addEventListener(MouseEvent.MOUSE_OVER, bdover);
bdone.addEventListener(MouseEvent.MOUSE_OUT, bdout);
i = 0;
while (i < numChildren) {
if (getChildAt(i).name.length < 7){
barfarray.push(getChildAt(i));
};
i++;
};
i = 0;
while (i < barfarray.length) {
barfarray[i].buttonMode = true;
barfarray[i].addEventListener(MouseEvent.CLICK, bclick);
i++;
};
}
public function bclick(_arg1:MouseEvent){
if (fadeout){
return;
};
if (txtname.text.length < 3){
if (_arg1.target.name.length == 1){
txtname.appendText(_arg1.target.name);
} else {
if (_arg1.target.name.charAt(0) == "p"){
switch (_arg1.target.name){
case "pp":
txtname.appendText(".");
break;
case "pq":
txtname.appendText("?");
break;
case "pe":
txtname.appendText("!");
break;
case "pheart":
txtname.appendText("@");
break;
case "pd":
txtname.appendText("$");
break;
case "pand":
txtname.appendText("&");
break;
case "pstar":
txtname.appendText("*");
break;
};
} else {
if ((((_arg1.target.name.charAt(0) == "n")) || ((_arg1.target.name.charAt(0) == "x")))){
txtname.appendText(_arg1.target.name.charAt(1));
};
};
};
};
if (_arg1.target.name == "bback"){
if (txtname.text.length == 3){
tstr = txtname.text;
txtname.text = (tstr.charAt(0) + tstr.charAt(1));
} else {
if (txtname.text.length == 2){
tstr = txtname.text;
txtname.text = tstr.charAt(0);
} else {
if (txtname.text.length == 1){
txtname.text = "";
};
};
};
};
if (_arg1.target.name == "bdone"){
if (txtname.text == ""){
txtname.text = "nul";
};
santafu(root).highscorename = txtname.text;
santafu(root).highscorerw("write");
fadeout = true;
};
}
public function bdout(_arg1:MouseEvent){
txtfinish.textColor = 0xFFFFFF;
}
}
}//package
Section 35
//chsview (chsview)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class chsview extends MovieClip {
public var h0:gheadicon;
public var h1:gheadicon;
public var h2:gheadicon;
public var h3:gheadicon;
public var h4:gheadicon;
public var h5:gheadicon;
public var h6:gheadicon;
public var h7:gheadicon;
public var bback:gblank;
public var h9:gheadicon;
public var txtback:TextField;
public var txtscores:TextField;
public var h8:gheadicon;
public var txtnames:TextField;
public function chsview(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
bback.buttonMode = true;
bback.addEventListener(MouseEvent.CLICK, bclik);
bback.addEventListener(MouseEvent.MOUSE_OVER, bover);
bback.addEventListener(MouseEvent.MOUSE_OUT, bout);
txtnames.mouseWheelEnabled = false;
txtback.mouseWheelEnabled = false;
txtscores.mouseWheelEnabled = false;
}
public function bout(_arg1:MouseEvent){
txtback.textColor = 0xFFFFFF;
}
public function bclik(_arg1:MouseEvent){
santafu(root).flipmode("title");
}
public function bover(_arg1:MouseEvent){
txtback.textColor = 0xFF0000;
}
}
}//package
Section 36
//cintro (cintro)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cintro extends MovieClip {
public var introframe:int;
public var i1:gintro1;
public var i2:gintro2;
public var i3:gintro3;
public var intromusic:int;
public function cintro(){
addFrameScript(0, frame1);
}
function frame1(){
introframe = 0;
intromusic = 0;
i1 = new gintro1();
i2 = new gintro2();
i3 = new gintro3();
addChild(i1);
addChild(i2);
addChild(i3);
}
public function devisible(){
var _local1:int = (intromusic + 1);
var _local2:* = i3.getChildByName(("b" + _local1));
i3.hed.x = (_local2.x - 40);
i3.hed.y = (_local2.y - 11);
i1.visible = true;
i2.visible = false;
i3.visible = false;
introframe = 0;
}
}
}//package
Section 37
//cjack (cjack)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cjack extends MovieClip {
public var iside:int;
public var waittime:int;
public var ty:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var mstr:MovieClip;
public var tmrex1:int;
public var tmrex2:int;
public var tmrex3:int;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var actionframe:int;
public var struck:Boolean;
public var moveframe:int;
public var maxnrg:int;
public function cjack(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactive";
etype = "jack";
ty = -8;
waittime = 0;
maxnrg = 15;
nrg = 15;
iside = 1;
struck = false;
}
}
}//package
Section 38
//cjackhead (cjackhead)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cjackhead extends MovieClip {
public var bbHit:gblank;
public var actionframe:int;
public var img:MovieClip;
public var struck:Boolean;
public function cjackhead(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package
Section 39
//claser (claser)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class claser extends MovieClip {
public var loc:String;
public var img:MovieClip;
public var struck:Boolean;
public var actionframe:int;
public var bbHit:gblank;
public function claser(){
addFrameScript(0, frame1);
}
function frame1(){
struck = false;
actionframe = 0;
}
}
}//package
Section 40
//clogo (clogo)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class clogo extends MovieClip {
public var logoframe:int;
public var tmrlogo:int;
public var logo:MovieClip;
public function clogo(){
addFrameScript(0, frame1);
}
function frame1(){
logo.alpha = 0;
logo.addEventListener(MouseEvent.CLICK, logoclik);
}
public function logoclik(_arg1:MouseEvent){
if (santafu(root).testmodo){
santafu(root).flipmode("title");
};
}
}
}//package
Section 41
//clvlbg (clvlbg)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class clvlbg extends MovieClip {
public var bgfire:gfireplace;
public var img:glvlbg;
public var smok3:gsmoke;
public var bgnat:cnat;
public var aHopper:Array;
public var aGripper:Array;
public var bgfireoverlay:gfireplaceoverlay;
public var smok1:gsmoke;
public var smok2:gsmoke;
public function clvlbg(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
aGripper = new Array();
aHopper = new Array();
}
}
}//package
Section 42
//cmistle (cmistle)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cmistle extends MovieClip {
public var iside:int;
public var waittime:int;
public var ty:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var mstr:gimistle;
public var tmrex1:int;
public var tmrex2:int;
public var tmrex3:int;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var actionframe:int;
public var struck:Boolean;
public var moveframe:int;
public var maxnrg:int;
public function cmistle(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactive";
etype = "mistle";
ty = -37;
waittime = 0;
maxnrg = 1;
nrg = 1;
iside = 1;
struck = false;
}
}
}//package
Section 43
//cmom (cmom)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cmom extends MovieClip {
public var iside:int;
public var waittime:int;
public var ty:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var mstr:MovieClip;
public var tmrex1:int;
public var tmrex2:int;
public var tmrex3:int;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var actionframe:int;
public var struck:Boolean;
public var moveframe:int;
public var maxnrg:int;
public function cmom(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactive";
etype = "mom";
ty = -4;
waittime = 0;
maxnrg = 2;
nrg = 2;
iside = 1;
struck = false;
}
}
}//package
Section 44
//cnat (cnat)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cnat extends MovieClip {
public var babyx:int;
public var img:gnat;
public var babyy:int;
public var superoffset:int;
public var suboffset:int;
public var baby:gbaby;
public var light:glight;
public function cnat(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
babyx = 184;
babyy = 75;
light.alpha = 0;
suboffset = 0;
superoffset = 0;
}
}
}//package
Section 45
//comega (comega)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class comega extends MovieClip {
public function comega(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 46
//comegasnd (comegasnd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class comegasnd extends MovieClip {
public function comegasnd(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 47
//cpipe (cpipe)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cpipe extends MovieClip {
public var loc:String;
public var bbHit:gblank;
public var img:MovieClip;
public function cpipe(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package
Section 48
//cplayfield (cplayfield)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cplayfield extends MovieClip {
public var hed:gheadicon;
public var marray:Array;
public var lifebar:glifebar;
public var txtlives:TextField;
public var s2:csnakeegg;
public var s3:csnakeegg;
public var s4:csnakeegg;
public var s6:csnakeegg;
public var s1:csnakeegg;
public var txtcomplete:TextField;
public var s7:csnakeegg;
public var s8:csnakeegg;
public var s5:csnakeegg;
public var txtp2:TextField;
public var bgcoverup:gcoverups;
public var txtscore:TextField;
public var txttime:TextField;
public var t2:ctree;
public var t3:ctree;
public var t4:ctree;
public var t5:ctree;
public var t6:ctree;
public var t7:ctree;
public var pSanta:csanta;
public var bg:clvlbg;
public var t8:ctree;
public var t1:ctree;
public var nmebar:gnmebar;
public var lvl3:glvl;
public var lvl4:glvl;
public var lvl5:glvl;
public var sarray:Array;
public var lvl2:glvl;
public var lvl1:glvl;
public var txttop:TextField;
public var m3:cmistle;
public var m4:cmistle;
public var m5:cmistle;
public var m6:cmistle;
public var m7:cmistle;
public var m8:cmistle;
public var m2:cmistle;
public var m1:cmistle;
public var tarray:Array;
public function cplayfield(){
addFrameScript(0, frame1);
}
function frame1(){
sarray = new Array();
tarray = new Array();
marray = new Array();
bg.img.cacheAsBitmap = true;
bgcoverup.cacheAsBitmap = true;
sarray.push(s1);
sarray.push(s2);
sarray.push(s3);
sarray.push(s4);
sarray.push(s5);
sarray.push(s6);
sarray.push(s7);
sarray.push(s8);
tarray.push(t1);
tarray.push(t2);
tarray.push(t3);
tarray.push(t4);
tarray.push(t5);
tarray.push(t6);
tarray.push(t7);
tarray.push(t8);
marray.push(m1);
marray.push(m2);
marray.push(m3);
marray.push(m4);
marray.push(m5);
marray.push(m6);
marray.push(m7);
marray.push(m8);
}
}
}//package
Section 49
//crudolph (crudolph)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class crudolph extends MovieClip {
public var iside:int;
public var waittime:int;
public var ty:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var mstr:MovieClip;
public var tmrex1:int;
public var tmrex2:int;
public var tmrex3:int;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var actionframe:int;
public var struck:Boolean;
public var moveframe:int;
public var maxnrg:int;
public function crudolph(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactive";
etype = "rudolph";
ty = -58;
waittime = 0;
maxnrg = 18;
nrg = 18;
iside = 1;
struck = false;
}
}
}//package
Section 50
//csanta (csanta)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class csanta extends MovieClip {
public var ty:int;
public var ducking:Boolean;
public var tmraction:int;
public var aniframe:int;
public var offset:int;
public var etype:String;
public var tmrani:int;
public var mstr:gsanta;
public var tmrex1:int;
public var tmrex3:int;
public var nrg:int;
public var tmrex2:int;
public var moveframe:int;
public var maxnrg:int;
public var iside:int;
public var waittime:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var eaction:String;
public var tmrmove:int;
public var tmrgrip:int;
public var jumping:Boolean;
public var actionframe:int;
public var struck:Boolean;
public function csanta(){
addFrameScript(0, frame1);
}
function frame1(){
aniframe = 0;
jumping = false;
ducking = false;
offset = 0;
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactive";
etype = "xmas";
ty = 0;
waittime = 0;
maxnrg = 20;
nrg = 20;
iside = 1;
struck = false;
}
}
}//package
Section 51
//csnake (csnake)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class csnake extends MovieClip {
public var iside:int;
public var waittime:int;
public var img:MovieClip;
public var ty:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var tmrex1:int;
public var tmrex3:int;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var bbHit:gblank;
public var tmrex2:int;
public var actionframe:int;
public var struck:Boolean;
public var moveframe:int;
public var maxnrg:int;
public function csnake(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactive";
etype = "snake";
ty = 0;
waittime = 0;
maxnrg = 2;
nrg = 2;
iside = 1;
struck = false;
}
}
}//package
Section 52
//csnakeegg (csnakeegg)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class csnakeegg extends MovieClip {
public var iside:int;
public var waittime:int;
public var ty:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var mstr:gisnakeegg;
public var tmrex1:int;
public var tmrex2:int;
public var tmrex3:int;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var actionframe:int;
public var struck:Boolean;
public var moveframe:int;
public var maxnrg:int;
public function csnakeegg(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactive";
etype = "snakeegg";
ty = 51;
waittime = 0;
maxnrg = 1;
nrg = 1;
iside = 1;
struck = false;
}
}
}//package
Section 53
//csylvia (csylvia)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class csylvia extends MovieClip {
public var p1:csanta;
public var tmrani:int;
public var chair:MovieClip;
public var txttop:MovieClip;
public var txtright:MovieClip;
public var txtleft:MovieClip;
public var revolutions:int;
public var moveframe:int;
public function csylvia(){
addFrameScript(0, frame1);
}
public function devisible(){
moveframe = 0;
revolutions = 0;
txttop.gotoAndStop(((santafu(root).ioffset / 17) + 1));
txtleft.gotoAndStop(((santafu(root).ioffset / 17) + 1));
txtright.gotoAndStop(((santafu(root).ioffset / 17) + 1));
chair.gotoAndStop(((santafu(root).ioffset / 17) + 1));
p1.mstr.img.gotoAndStop((santafu(root).ioffset + 1));
txtleft.visible = false;
txtright.visible = false;
}
function frame1(){
stop();
tmrani = 0;
moveframe = 0;
revolutions = 0;
}
}
}//package
Section 54
//ctitle (ctitle)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class ctitle extends MovieClip {
public var b1p:gtitle1p;
public var bng:gtitleng;
public var bhs:gtitlehs;
public var tree1:gtitletree;
public var tree2:gtitletree;
public var tmrtree:int;
public var bcredit:gtitlecredits;
public function ctitle(){
addFrameScript(0, frame1);
}
public function b1pclik(_arg1:MouseEvent){
santafu(root).flipmode("intro");
}
public function bover(_arg1:MouseEvent){
_arg1.target.gotoAndStop(2);
}
function frame1(){
b1p.buttonMode = true;
bcredit.buttonMode = true;
bhs.buttonMode = true;
bng.buttonMode = true;
b1p.addEventListener(MouseEvent.CLICK, b1pclik);
bcredit.addEventListener(MouseEvent.CLICK, bcreditclik);
b1p.addEventListener(MouseEvent.MOUSE_OVER, bover);
bcredit.addEventListener(MouseEvent.MOUSE_OVER, bover);
b1p.addEventListener(MouseEvent.MOUSE_OUT, bout);
bcredit.addEventListener(MouseEvent.MOUSE_OUT, bout);
bhs.addEventListener(MouseEvent.CLICK, bhsclik);
bng.addEventListener(MouseEvent.CLICK, bngclik);
bhs.addEventListener(MouseEvent.MOUSE_OVER, bover);
bng.addEventListener(MouseEvent.MOUSE_OVER, bover);
bhs.addEventListener(MouseEvent.MOUSE_OUT, bout);
bng.addEventListener(MouseEvent.MOUSE_OUT, bout);
}
public function bout(_arg1:MouseEvent){
_arg1.target.gotoAndStop(1);
}
public function bcreditclik(_arg1:MouseEvent){
santafu(root).flipmode("credits");
}
public function bhsclik(_arg1:MouseEvent){
santafu(root).flipmode("hsview");
}
public function bngclik(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.newgrounds.com"), "_blank");
}
}
}//package
Section 55
//ctree (ctree)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class ctree extends MovieClip {
public var iside:int;
public var waittime:int;
public var ty:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var mstr:gitree;
public var tmrex1:int;
public var tmrex2:int;
public var tmrex3:int;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var actionframe:int;
public var struck:Boolean;
public var moveframe:int;
public var maxnrg:int;
public function ctree(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "deactive";
etype = "tree";
ty = -9;
waittime = 0;
maxnrg = 1;
nrg = 1;
iside = 1;
struck = false;
}
}
}//package
Section 56
//cturbo (cturbo)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cturbo extends MovieClip {
public var iside:int;
public var waittime:int;
public var ty:int;
public var tmraction:int;
public var grip:int;
public var suboffset:int;
public var superoffset:int;
public var eaction:String;
public var etype:String;
public var tmrani:int;
public var mstr:MovieClip;
public var tmrex1:int;
public var tmrex2:int;
public var tmrex3:int;
public var tmrmove:int;
public var tmrgrip:int;
public var nrg:int;
public var actionframe:int;
public var moveframe:int;
public var maxnrg:int;
public function cturbo(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
tmrmove = 0;
tmrgrip = 0;
tmrex1 = 0;
tmrex2 = 0;
tmrex3 = 0;
moveframe = 0;
tmraction = 0;
actionframe = 0;
suboffset = 0;
superoffset = 0;
grip = 4;
eaction = "boss";
etype = "turbo";
ty = 0;
waittime = 0;
maxnrg = 10;
nrg = 10;
iside = 1;
}
}
}//package
Section 57
//cunlock (cunlock)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class cunlock extends MovieClip {
public var p1:csanta;
public var poffset:int;
public var txtu:TextField;
public var tmrani:int;
public var actionframe:int;
public function cunlock(){
addFrameScript(0, frame1);
}
function frame1(){
tmrani = 0;
actionframe = 0;
}
public function devisible(){
actionframe = 0;
if (santafu(root).ioffset == 0){
txtu.text = "jesus";
poffset = 17;
p1.mstr.img.gotoAndStop(18);
} else {
if (santafu(root).ioffset == 17){
txtu.text = "raptor jesus";
poffset = 34;
p1.mstr.img.gotoAndStop(35);
};
};
}
}
}//package
Section 58
//gbaby (gbaby)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gbaby extends MovieClip {
public function gbaby(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 59
//gblak (gblak)
package {
import flash.display.*;
public dynamic class gblak extends MovieClip {
}
}//package
Section 60
//gblank (gblank)
package {
import flash.display.*;
public dynamic class gblank extends MovieClip {
}
}//package
Section 61
//gbloodstar (gbloodstar)
package {
import flash.display.*;
public dynamic class gbloodstar extends MovieClip {
}
}//package
Section 62
//gblue (gblue)
package {
import flash.display.*;
public dynamic class gblue extends MovieClip {
}
}//package
Section 63
//gcharselectjebus (gcharselectjebus)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gcharselectjebus extends MovieClip {
public function gcharselectjebus(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 64
//gcharselectraptor (gcharselectraptor)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gcharselectraptor extends MovieClip {
public function gcharselectraptor(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 65
//gcharselectsanta (gcharselectsanta)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gcharselectsanta extends MovieClip {
public function gcharselectsanta(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 66
//gcoverups (gcoverups)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gcoverups extends MovieClip {
public function gcoverups(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 67
//gfireplace (gfireplace)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gfireplace extends MovieClip {
public function gfireplace(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 68
//gfireplaceoverlay (gfireplaceoverlay)
package {
import flash.display.*;
public dynamic class gfireplaceoverlay extends MovieClip {
}
}//package
Section 69
//ggripper (ggripper)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class ggripper extends MovieClip {
public function ggripper(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 70
//gheadicon (gheadicon)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gheadicon extends MovieClip {
public function gheadicon(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 71
//ghoppers (ghoppers)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class ghoppers extends MovieClip {
public function ghoppers(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 72
//gigripper (gigripper)
package {
import flash.display.*;
public dynamic class gigripper extends MovieClip {
public var bbHit:gblank;
public var img:ggripper;
public var bbHurt:gblank;
}
}//package
Section 73
//gihopper (gihopper)
package {
import flash.display.*;
public dynamic class gihopper extends MovieClip {
public var bbHit:gblank;
public var img:ghoppers;
public var bbHurt:gblank;
}
}//package
Section 74
//gimistle (gimistle)
package {
import flash.display.*;
public dynamic class gimistle extends MovieClip {
public var bbHit:gblank;
public var img:gmistle;
public var bbHurt:gblank;
}
}//package
Section 75
//gintro1 (gintro1)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gintro1 extends MovieClip {
public var txts:TextField;
public var bn:gblank;
public var bs:gblank;
public var txtn:TextField;
public function gintro1(){
addFrameScript(0, frame1);
}
public function bnover(_arg1:MouseEvent){
txtn.textColor = 0xFF0000;
}
function frame1(){
bs.buttonMode = true;
txts.mouseWheelEnabled = false;
bs.addEventListener(MouseEvent.MOUSE_OVER, bsover);
bs.addEventListener(MouseEvent.MOUSE_OUT, bsout);
bs.addEventListener(MouseEvent.CLICK, bsclik);
bn.buttonMode = true;
txtn.mouseWheelEnabled = false;
bn.addEventListener(MouseEvent.MOUSE_OVER, bnover);
bn.addEventListener(MouseEvent.MOUSE_OUT, bnout);
bn.addEventListener(MouseEvent.CLICK, bnclik);
}
public function bsover(_arg1:MouseEvent){
txts.textColor = 0xFF0000;
}
public function bnout(_arg1:MouseEvent){
txtn.textColor = 0xFFFFFF;
}
public function bnclik(_arg1:MouseEvent){
txtn.textColor = 0xFFFFFF;
santafu(root).icanread = true;
santafu(root).intronext();
}
public function bsclik(_arg1:MouseEvent){
txts.textColor = 0xFF0000;
santafu(root).intronext();
santafu(root).intronext();
}
public function bsout(_arg1:MouseEvent){
txts.textColor = 0xFFFFFF;
}
}
}//package
Section 76
//gintro2 (gintro2)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gintro2 extends MovieClip {
public var bn:gblank;
public var txtn:TextField;
public function gintro2(){
addFrameScript(0, frame1);
}
public function bnover(_arg1:MouseEvent){
txtn.textColor = 0xFF0000;
}
public function bnout(_arg1:MouseEvent){
txtn.textColor = 0xFFFFFF;
}
function frame1(){
bn.buttonMode = true;
txtn.mouseWheelEnabled = false;
bn.addEventListener(MouseEvent.MOUSE_OVER, bnover);
bn.addEventListener(MouseEvent.MOUSE_OUT, bnout);
bn.addEventListener(MouseEvent.CLICK, bnclik);
}
public function bnclik(_arg1:MouseEvent){
txtn.textColor = 0xFFFFFF;
santafu(root).intronext();
}
}
}//package
Section 77
//gintro3 (gintro3)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gintro3 extends MovieClip {
public var txtn:TextField;
public var hed:gheadicon;
public var bn:gblank;
public var b1:gblank;
public var b2:gblank;
public var b3:gblank;
public var b4:gblank;
public var b5:gblank;
public var b6:gblank;
public function gintro3(){
addFrameScript(0, frame1);
}
public function bnout(_arg1:MouseEvent){
txtn.textColor = 0xFFFFFF;
}
function frame1(){
bn.buttonMode = true;
txtn.mouseWheelEnabled = false;
bn.addEventListener(MouseEvent.MOUSE_OVER, bnover);
bn.addEventListener(MouseEvent.MOUSE_OUT, bnout);
bn.addEventListener(MouseEvent.CLICK, bnclik);
b1.buttonMode = true;
b2.buttonMode = true;
b3.buttonMode = true;
b4.buttonMode = true;
b5.buttonMode = true;
b6.buttonMode = true;
b1.addEventListener(MouseEvent.CLICK, bclik);
b2.addEventListener(MouseEvent.CLICK, bclik);
b3.addEventListener(MouseEvent.CLICK, bclik);
b4.addEventListener(MouseEvent.CLICK, bclik);
b5.addEventListener(MouseEvent.CLICK, bclik);
b6.addEventListener(MouseEvent.CLICK, bclik);
}
public function bclik(_arg1:MouseEvent){
var _local2:String = _arg1.target.name;
if (hed.x != (_arg1.target.y - 11)){
hed.x = (_arg1.target.x - 40);
hed.y = (_arg1.target.y - 11);
santafu(root).playmusic((_local2.charAt(1) - 1), true);
};
}
public function bnclik(_arg1:MouseEvent){
txtn.textColor = 0xFFFFFF;
santafu(root).flipmode("charselect");
}
public function bnover(_arg1:MouseEvent){
txtn.textColor = 0xFF0000;
}
}
}//package
Section 78
//gisnakeegg (gisnakeegg)
package {
import flash.display.*;
public dynamic class gisnakeegg extends MovieClip {
public var bbHit:gblank;
public var img:gsnakeegg;
}
}//package
Section 79
//gitree (gitree)
package {
import flash.display.*;
public dynamic class gitree extends MovieClip {
public var img:gtree;
public var bbHit:gblank;
public var bbfire:gblank;
public var bbHurt:gblank;
}
}//package
Section 80
//glifebar (glifebar)
package {
import flash.display.*;
public dynamic class glifebar extends MovieClip {
public var life:gred;
}
}//package
Section 81
//glight (glight)
package {
import flash.display.*;
public dynamic class glight extends MovieClip {
}
}//package
Section 82
//glvl (glvl)
package {
import flash.display.*;
public dynamic class glvl extends MovieClip {
public var img:gorange;
}
}//package
Section 83
//glvlbg (glvlbg)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class glvlbg extends MovieClip {
public function glvlbg(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 84
//gmedal (gmedal)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gmedal extends MovieClip {
public var tmrmedal:int;
public var txtpoints:TextField;
public var medalframe:int;
public var txtname:TextField;
public var bmpicon:Bitmap;
public function gmedal(){
addFrameScript(0, frame1);
}
function frame1(){
medalframe = 0;
}
public function forgebmp(){
bmpicon = new Bitmap();
bmpicon.x = 6;
bmpicon.y = 14;
addChild(bmpicon);
}
}
}//package
Section 85
//gmistle (gmistle)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gmistle extends MovieClip {
public function gmistle(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 86
//gnat (gnat)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gnat extends MovieClip {
public function gnat(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 87
//gnmebar (gnmebar)
package {
import flash.display.*;
public dynamic class gnmebar extends MovieClip {
public var life:gorange;
}
}//package
Section 88
//gorange (gorange)
package {
import flash.display.*;
public dynamic class gorange extends MovieClip {
}
}//package
Section 89
//gplayer (gplayer)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gplayer extends MovieClip {
public function gplayer(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 90
//gpoints (gpoints)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gpoints extends MovieClip {
public var txts:TextField;
public var tmrdis:int;
public var multi:int;
public function gpoints(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package
Section 91
//gpop (gpop)
package {
import flash.display.*;
public dynamic class gpop extends MovieClip {
}
}//package
Section 92
//gred (gred)
package {
import flash.display.*;
public dynamic class gred extends MovieClip {
}
}//package
Section 93
//gsanta (gsanta)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gsanta extends MovieClip {
public var img:gplayer;
public var bbKneelPunch:gblank;
public var bbPunch:gblank;
public var bbHurt:gblank;
public var bbKick:gblank;
public var bbKneelKick:gblank;
public var bbduck:gblank;
public function gsanta(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 94
//gshard (gshard)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gshard extends MovieClip {
public var bbHit:gblank;
public var struck:Boolean;
public var dir:int;
public function gshard(){
addFrameScript(0, frame1);
}
function frame1(){
struck = false;
}
}
}//package
Section 95
//gsmoke (gsmoke)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gsmoke extends MovieClip {
public function gsmoke(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 96
//gsnakeegg (gsnakeegg)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gsnakeegg extends MovieClip {
public function gsnakeegg(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 97
//gstrikestar (gstrikestar)
package {
import flash.display.*;
public dynamic class gstrikestar extends MovieClip {
}
}//package
Section 98
//gtitle1p (gtitle1p)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gtitle1p extends MovieClip {
public function gtitle1p(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 99
//gtitlecredits (gtitlecredits)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gtitlecredits extends MovieClip {
public function gtitlecredits(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 100
//gtitlehs (gtitlehs)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gtitlehs extends MovieClip {
public function gtitlehs(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 101
//gtitleng (gtitleng)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gtitleng extends MovieClip {
public function gtitleng(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 102
//gtitletree (gtitletree)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gtitletree extends MovieClip {
public function gtitletree(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 103
//gtree (gtree)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
public dynamic class gtree extends MovieClip {
public function gtree(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 104
//mbedroom (mbedroom)
package {
import flash.media.*;
public dynamic class mbedroom extends Sound {
}
}//package
Section 105
//mgyromite (mgyromite)
package {
import flash.media.*;
public dynamic class mgyromite extends Sound {
}
}//package
Section 106
//miceclimbers (miceclimbers)
package {
import flash.media.*;
public dynamic class miceclimbers extends Sound {
}
}//package
Section 107
//mkungfu (mkungfu)
package {
import flash.media.*;
public dynamic class mkungfu extends Sound {
}
}//package
Section 108
//mreindeer (mreindeer)
package {
import flash.media.*;
public dynamic class mreindeer extends Sound {
}
}//package
Section 109
//msanta (msanta)
package {
import flash.media.*;
public dynamic class msanta extends Sound {
}
}//package
Section 110
//mslalom (mslalom)
package {
import flash.media.*;
public dynamic class mslalom extends Sound {
}
}//package
Section 111
//s1up (s1up)
package {
import flash.media.*;
public dynamic class s1up extends Sound {
}
}//package
Section 112
//santafu (santafu)
package {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import com.newgrounds.components.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.ui.*;
public class santafu extends MovieClip {
var lastkey:int;// = 0
var xmasmode:Boolean;// = false
var bgsylvia:csylvia;
var tmrpoint:int;// = 0
var popscorearray:Array;
var mfxon:Boolean;// = true
public var poop:MovieClip;
var scorenamesarray:Array;
var endsmoveframe:int;// = 0
var jhfallarray:Array;
var hdistance:int;// = 0
var lvltimer:int;// = 0
var winchararray:Array;
var candyrangarray:Array;
var fadeframe:int;// = 0
public var started:Boolean;// = false
var tmraction:int;// = 0
var tmrlvlcomplete:int;// = 0
var xmasint:int;// = 60
var tmrendsani:int;// = 0
var gripperarray:Array;
var localstorage:SharedObject;
var bgendj:cendingjesus;
var bgcredits:ccredits;
var bfarkus:cfarkus;
var bgendr:cendingraptor;
var bgends:cendingsanta;
var highscorename:String;// = ""
var tmrcgrip:int;// = 0
var levelcomplete:Boolean;// = false
public var icanread:Boolean;// = false
var mistlearray:Array;
var canearray:Array;
public var API_Settings:Object;
var lives:int;// = 0
var targety:int;// = 266
public var tmr:Timer;
var snakearray:Array;
var sfxon:Boolean;// = true
var bgfadein:Boolean;// = false
var bgtitle:ctitle;
var bgarray:Array;
var shardarray:Array;
var testmodo:Boolean;// = false
var snakd:Boolean;// = false
var bgintro:cintro;
var bxmas:csanta;
var pipearray:Array;
var rnrg:Number;// = 0
var listenedarray:Array;
var treearray:Array;
var goframe:int;// = 0
public var txtplay:TextField;
var unlockj:Boolean;// = false
var elfh1:int;// = 0
var intertime:int;// = 0
var unlockr:Boolean;// = false
var elfh2:int;// = 0
var elfh3:int;// = 0
var medalarray:Array;
var rscour:Number;// = 0
var tmrtimer:int;// = 0
var rnmenrg:Number;// = 0
var bgcharselect:ccharselect;
var bgmsoundchannel:SoundChannel;
var bgmvolume:int;// = 100
var wavenum:int;// = 0
var endsint:int;// = 30
var holdingd:Boolean;// = false
var goint:int;// = 120
var holdingl:Boolean;// = false
var tmrstrike:int;// = 0
var pgripped:int;// = 0
var holdingr:Boolean;// = false
var holdingu:Boolean;// = false
var momarray:Array;
var hiscore:int;// = 0
public var ioffset:int;// = 0
var midlevel:Boolean;// = false
var tmrpipe:int;// = 0
var nmebooster:cbooster;
var rlevel:Number;// = 0
var tmrbloodstar:int;// = 0
var bghsentry:chsentry;
var laserarray:Array;
var tmrflash:int;// = 0
var tmrwaveout:int;// = 0
var tmrxmas:int;// = 0
var pactionframe:int;// = 0
public var bplay:gblank;
var tmrpop:int;// = 0
var preaction:Boolean;// = false
var hopperarray:Array;
var paction:String;// = ""
var soundarray:Array;
var riteration:Number;// = 0
var ostrikestar:gstrikestar;
var snakeeggarray:Array;
var bghsview:chsview;
var rlvltimer:Number;// = 0
var iteration:int;// = 0
var player:csanta;
var jhthrowarray:Array;
var lvlcompleteframe:int;// = 0
var bturbo:cturbo;
var scour:int;// = 0
var scorearray:Array;
var tmrnmeobj:int;// = 0
var bggameover:cgameover;
var tmrpointer:int;// = 0
var tmrfade:int;// = 0
var hdir:int;// = 1
var pjumpdir:int;// = 0
var dadarray:Array;
var waveactive:Boolean;// = false
var bjack:cjack;
var musicarray:Array;
public var txtload:TextField;
var tmrgripharm:int;// = 0
var pausetmr:int;// = 0
var disableweb:Boolean;// = false
var tmrpaction:int;// = 0
var bglogo:clogo;
var bgfadeout:Boolean;// = false
var lvlcompletetick:int;// = 60
var playermovechunk:Number;// = 4
var medalsarray:Array;
var minscore:int;// = 0
var opop:gpop;
var level:int;// = 0
var mothd:Boolean;// = false
var pjumpframe:int;// = 0
var nmearray:Array;
var moveinterval:int;// = 30
var tmrfireplace:int;// = 0
var tmrwave:int;// = 0
var neoscorenamesarray:Array;
var gamepaused:Boolean;// = false
var bgplayfield:cplayfield;
var elfg:int;// = 0
var nutcracked:Boolean;// = false
var bgblak:gblak;
var obloodstar:gbloodstar;
public var newgroundsAPIconnector:DefaultAPIConnector;
var medalapi:NewgroundsAPIMedal;
var bgunlock:cunlock;
var rlives:Number;// = 0
var gamestate:uint;// = 0
var xmasframe:int;// = 0
var tmrgrip:int;// = 0
var brudolph:crudolph;
var nutcrackers:int;// = 0
var xtragrip:int;// = 0
static const keyx:uint = 88;
static const statehsview:uint = 6;
static const sfxjackmelt:uint = 31;
static const sfxlvlstart:uint = 16;
static const sfxchop:uint = 33;
static const mfxbedroom:uint = 6;
static const sfxswitch:uint = 32;
static const sfxswordhit:uint = 24;
static const sfxhurt:uint = 9;
static const stateunlock:uint = 12;
static const sfxlaugh:uint = 2;
static const keyright:uint = 39;
static const sfxpointtally:uint = 19;
static const statecharselect:uint = 8;
static const sfxboomerang:uint = 0;
static const mfxgyromite:uint = 5;
static const keyup:uint = 38;
static const sfxsnakeegg:uint = 23;
static const sfxkick:uint = 13;
static const sfxgameover:uint = 39;
static const stategameover:uint = 7;
static const statesylvia:uint = 11;
static const sfxchain:uint = 27;
static const keynull:uint = 0;
static const statetitle:uint = 1;
static const sfxdead:uint = 1;
static const sfxlaser:uint = 21;
static const sfxrudolph:uint = 34;
static const stateendingj:uint = 13;
static const stateendingr:uint = 14;
static const stateendings:uint = 9;
static const stateplaying:uint = 2;
static const mfxkungfu:uint = 3;
static const keydown:uint = 40;
static const stateintro:uint = 4;
static const mfxreindeer:uint = 4;
static const stateloading:uint = 0;
static const sfxpause:uint = 18;
static const statehsentry:uint = 5;
static const sfxfarkus:uint = 35;
static const sfxlaughlong:uint = 30;
static const sfxcane:uint = 17;
static const sfxtree:uint = 25;
static const sfxlight:uint = 8;
static const sfxpipe:uint = 14;
static const mfxsanta:uint = 0;
static const sfxlvlcomplete:uint = 15;
static const sfxlaughlow:uint = 4;
static const sfxdoor:uint = 29;
static const statelogo:uint = 3;
static const sfxlaughhigh:uint = 3;
static const sfxturbo:uint = 36;
static const mfxiceclimbers:uint = 1;
static const sfxcomplete:uint = 38;
static const sfxpunch:uint = 20;
static const sfxjesus:uint = 11;
static const sfxunpause:uint = 26;
static const sfxhithard:uint = 7;
static const keyleft:uint = 37;
static const sfx1up:uint = 5;
static const mfxslalom:uint = 2;
static const statecredits:uint = 10;
static const sfxsnake:uint = 22;
static const sfxjack:uint = 10;
static const sfxvictory:uint = 37;
static const sfxhit:uint = 6;
static const keyp:uint = 80;
static const sfxjumpkick:uint = 12;
static const keyz:uint = 90;
static const sfxchainhigh:uint = 28;
public function santafu(){
bgarray = new Array();
medalarray = new Array();
gripperarray = new Array();
hopperarray = new Array();
dadarray = new Array();
momarray = new Array();
pipearray = new Array();
canearray = new Array();
nmearray = new Array();
soundarray = new Array();
musicarray = new Array();
listenedarray = new Array();
bgmsoundchannel = new SoundChannel();
snakeeggarray = new Array();
snakearray = new Array();
treearray = new Array();
mistlearray = new Array();
candyrangarray = new Array();
shardarray = new Array();
laserarray = new Array();
jhthrowarray = new Array();
jhfallarray = new Array();
popscorearray = new Array();
scorearray = new Array();
scorenamesarray = new Array();
neoscorenamesarray = new Array();
winchararray = new Array();
medalsarray = new Array();
super();
addFrameScript(0, frame1, 1, frame2);
Security.loadPolicyFile("http://www.rainbowcemetery.com/crossdomain.xml");
setInterval(RENDER, 0);
stage.addEventListener(KeyboardEvent.KEY_DOWN, userkeydown);
stage.addEventListener(KeyboardEvent.KEY_UP, userkeyup);
NewgroundsAPI.addEventListener(NewgroundsAPIEvent.MEDAL_UNLOCKED, onMedalUnlocked);
}
function silenttimer(_arg1:int){
if (lvltimer != Math.floor((rlvltimer / 3.42))){
rlvltimer = 0;
lvltimer = 0;
} else {
rlvltimer = (rlvltimer + (_arg1 * 3.42));
lvltimer = (rlvltimer / 3.42);
if (rlvltimer < 0){
rlvltimer = 0;
lvltimer = 0;
};
};
tstr = (lvltimer + "");
switch (tstr.length){
case 3:
tstr = ("0" + tstr);
break;
case 2:
tstr = ("00" + tstr);
break;
case 1:
tstr = ("000" + tstr);
break;
};
bgplayfield.txttime.text = tstr;
}
function unlockani(){
if ((gtmr() - bgunlock.tmrani) >= 150){
if (bgunlock.p1.mstr.img.currentFrame == (1 + bgunlock.poffset)){
bgunlock.p1.mstr.img.nextFrame();
} else {
bgunlock.p1.mstr.img.prevFrame();
};
if (bgunlock.actionframe == 0){
playsound(sfxjesus);
} else {
if (bgunlock.actionframe == 52){
flipmode("continue");
};
};
bgunlock.actionframe++;
bgunlock.tmrani = gtmr();
};
}
function moveobjects(){
var _local1:int;
_local1 = (pipearray.length - 1);
while (_local1 >= 0) {
pipeani(pipearray[_local1]);
if ((((pipearray[_local1].x > 612)) || ((pipearray[_local1].x < -100)))){
removeChild(pipearray[_local1]);
pipearray.splice(_local1, 1);
};
_local1--;
};
_local1 = (snakearray.length - 1);
while (_local1 >= 0) {
snakeani(snakearray[_local1]);
if ((((snakearray[_local1].x > 612)) || ((snakearray[_local1].x < -100)))){
removeChild(snakearray[_local1]);
snakearray.splice(_local1, 1);
};
_local1--;
};
_local1 = (shardarray.length - 1);
while (_local1 >= 0) {
shardani(shardarray[_local1]);
if (shardarray[_local1].y > 600){
removeChild(shardarray[_local1]);
shardarray.splice(_local1, 1);
};
_local1--;
};
_local1 = (candyrangarray.length - 1);
while (_local1 >= 0) {
candyrangani(candyrangarray[_local1]);
if (candyrangarray[_local1].x > 600){
removeChild(candyrangarray[_local1]);
candyrangarray.splice(_local1, 1);
};
_local1--;
};
_local1 = (jhthrowarray.length - 1);
while (_local1 >= 0) {
jhthrowani(jhthrowarray[_local1]);
if ((((jhthrowarray[_local1].x > 600)) || (!(jhthrowarray[_local1].visible)))){
removeChild(jhthrowarray[_local1]);
jhthrowarray.splice(_local1, 1);
};
_local1--;
};
_local1 = (jhfallarray.length - 1);
while (_local1 >= 0) {
jhfallani(jhfallarray[_local1]);
if (jhfallarray[_local1].y > 600){
removeChild(jhfallarray[_local1]);
jhfallarray.splice(_local1, 1);
};
_local1--;
};
_local1 = (laserarray.length - 1);
while (_local1 >= 0) {
laserani(laserarray[_local1]);
if ((((laserarray[_local1].x > 612)) || ((laserarray[_local1].x < -100)))){
removeChild(laserarray[_local1]);
laserarray.splice(_local1, 1);
};
_local1--;
};
_local1 = (popscorearray.length - 1);
while (_local1 >= 0) {
popscoreani(popscorearray[_local1]);
if (!popscorearray[_local1].visible){
removeChild(popscorearray[_local1]);
popscorearray.splice(_local1, 1);
};
_local1--;
};
}
function endlvlreset(){
var _local1:int;
summonpurge();
tmrlvlcomplete = gtmr();
if (player.y != targety){
};
paction = "";
holdingu = false;
holdingd = false;
holdingr = false;
holdingl = false;
lvlcompletetick = 60;
player.ducking = false;
wavenum = 0;
waveactive = false;
tmrwave = gtmr();
if (r("level") < 5){
if (r("nrg") >= 115){
unlockmedal("Santa Fu Disciple");
};
lvlcompleteframe = 0;
levelcomplete = true;
} else {
if (r("nrg") >= 115){
unlockmedal("Santa Fu Master");
};
lvlcompleteframe = 57;
levelcomplete = true;
};
}
function bosspulse(){
var _local1:int;
_local1 = 0;
while (_local1 < nmearray.length) {
if (nmearray[_local1].eaction == "waiting"){
nmearray[_local1].eaction = "deactive";
};
if (((!((nmearray[_local1].eaction == "dead"))) && (!((nmearray[_local1].eaction == "deactive"))))){
switch (nmearray[_local1].etype){
case "gripper":
case "hopper":
if ((((((((Math.abs((player.x - nmearray[_local1].x)) > 50)) && (!((nmearray[_local1].eaction == "grip"))))) && (!((nmearray[_local1].eaction == "flip"))))) && (!(nmearray[_local1].struck)))){
nmearray[_local1].mstr.img.gotoAndStop((1 + nmearray[_local1].superoffset));
nmearray[_local1].mstr.scaleX = (nmearray[_local1].mstr.scaleX * -1);
nmearray[_local1].eaction = "run";
};
break;
case "mom":
nmearray[_local1].mstr.img.gotoAndStop(1);
nmearray[_local1].mstr.scaleX = (nmearray[_local1].mstr.scaleX * -1);
nmearray[_local1].eaction = "run";
break;
case "dad":
nmearray[_local1].mstr.img.gotoAndStop(1);
if (nmearray[_local1].eaction != "retreat"){
nmearray[_local1].mstr.scaleX = (nmearray[_local1].mstr.scaleX * -1);
};
nmearray[_local1].eaction = "run";
break;
};
};
_local1++;
};
}
function nextlvl(_arg1:Boolean){
if (_arg1){
playmusic(bgintro.intromusic, true);
};
player.visible = true;
player.jumping = false;
pjumpframe = 0;
mothd = false;
snakd = false;
changelevel(1);
intertime = 0;
player.x = 251;
bgblak.visible = true;
reset(bgblak);
bgblak.alpha = 1;
bgfadein = true;
fadeframe = 0;
switch (r("level")){
case 1:
bgmove(-3168, true);
targety = 266;
changescale(1);
bgplayfield.bgcoverup.visible = true;
bgplayfield.bg.bgfire.visible = true;
bgplayfield.bg.bgnat.visible = false;
bgplayfield.bg.smok1.visible = false;
bgplayfield.bg.smok2.visible = false;
bgplayfield.bg.smok3.visible = false;
bgplayfield.bg.bgfireoverlay.visible = true;
bgplayfield.lvl5.img.visible = false;
bgplayfield.lvl2.img.visible = false;
bgplayfield.lvl3.img.visible = false;
bgplayfield.lvl4.img.visible = false;
nmebooster.mstr.scaleX = -1;
nmebooster.mstr.img.gotoAndStop(1);
nmebooster.visible = true;
nmebooster.eaction = "";
nmebooster.x = -2900;
nmebooster.y = 234;
nmebooster.nrg = 1;
nmearray.push(nmebooster);
bturbo.y = 243;
bturbo.x = -2912;
bturbo.mstr.img.gotoAndStop(1);
bturbo.mstr.scaleX = -1;
bturbo.eaction = "boss";
bturbo.visible = true;
bturbo.nrg = (bturbo.maxnrg + ((r("iteration") - 1) * 5));
nmearray.push(bturbo);
break;
case 2:
bgmove(0, true);
bgplayfield.lvl1.img.visible = true;
targety = 274;
changescale(-1);
bgplayfield.bg.bgfire.visible = false;
bgplayfield.bg.bgfireoverlay.visible = false;
bfarkus.x = 3384;
bfarkus.y = (targety + bfarkus.ty);
bfarkus.mstr.img.gotoAndStop(1);
bfarkus.mstr.scaleX = 1;
bfarkus.eaction = "boss";
bfarkus.visible = true;
bfarkus.nrg = (bfarkus.maxnrg + ((r("iteration") - 1) * 5));
nmearray.push(bfarkus);
break;
case 4:
targety = 274;
bgmove(0, true);
bgplayfield.lvl1.img.visible = true;
bgplayfield.lvl2.img.visible = true;
bgplayfield.lvl3.img.visible = true;
changescale(-1);
brudolph.x = 3384;
brudolph.y = (targety + brudolph.ty);
brudolph.mstr.img.gotoAndStop(1);
brudolph.mstr.scaleX = 1;
brudolph.eaction = "boss";
brudolph.visible = true;
brudolph.alpha = 1;
brudolph.nrg = (brudolph.maxnrg + ((r("iteration") - 1) * 5));
nmearray.push(brudolph);
break;
case 3:
targety = 274;
bgmove(-3168, true);
bgplayfield.lvl1.img.visible = true;
bgplayfield.lvl2.img.visible = true;
changescale(1);
bjack.y = (targety + bjack.ty);
bjack.x = -2912;
bjack.mstr.img.gotoAndStop(1);
bjack.mstr.scaleX = -1;
bjack.eaction = "boss";
bjack.visible = true;
bjack.alpha = 1;
bjack.nrg = (bjack.maxnrg + ((r("iteration") - 1) * 5));
nmearray.push(bjack);
break;
case 5:
bgmove(-3168, true);
targety = 266;
bgplayfield.lvl1.img.visible = true;
bgplayfield.lvl2.img.visible = true;
bgplayfield.lvl3.img.visible = true;
bgplayfield.lvl4.img.visible = true;
bgplayfield.bg.bgnat.visible = true;
bgplayfield.bg.smok1.visible = true;
bgplayfield.bg.smok2.visible = true;
bgplayfield.bg.smok3.visible = true;
bgplayfield.bg.bgnat.light.alpha = 0;
bgplayfield.bg.bgnat.baby.y = bgplayfield.bg.bgnat.babyy;
bgplayfield.bg.bgnat.baby.alpha = 1;
bgplayfield.bg.bgnat.suboffset = 0;
bxmas.y = targety;
bxmas.x = -2912;
if (player.offset == 0){
bxmas.offset = 17;
bgplayfield.bg.bgnat.superoffset = 0;
bgplayfield.bg.bgnat.baby.gotoAndStop(1);
} else {
if (player.offset == 17){
bxmas.offset = 0;
bgplayfield.bg.bgnat.superoffset = 4;
bgplayfield.bg.bgnat.baby.gotoAndStop(3);
} else {
if (player.offset == 34){
bxmas.offset = 17;
bgplayfield.bg.bgnat.superoffset = 0;
bgplayfield.bg.bgnat.baby.gotoAndStop(1);
};
};
};
bxmas.mstr.img.gotoAndStop((5 + bxmas.offset));
bxmas.mstr.scaleX = -1;
bxmas.eaction = "boss";
bxmas.visible = false;
bxmas.alpha = 0;
bxmas.nrg = (bxmas.maxnrg + ((r("iteration") - 1) * 5));
nmearray.push(bxmas);
xmasmode = false;
changescale(1);
bgplayfield.bgcoverup.visible = false;
break;
};
midlevel = false;
player.y = targety;
paction = "";
player.mstr.img.gotoAndStop((1 + player.offset));
bgplayfield.bg.img.gotoAndStop(level);
bgplayfield.bgcoverup.gotoAndStop(level);
rlvltimer = (2000 * 3.42);
lvltimer = 2000;
changetimer(0);
rnrg = (115 * 3.42);
bgplayfield.lifebar.life.width = 115;
rnmenrg = (115 * 3.42);
bgplayfield.nmebar.life.width = 115;
levelcomplete = false;
bgplayfield.visible = true;
}
function logoani(){
if ((gtmr() - bglogo.tmrlogo) >= 120){
switch (bglogo.logoframe){
case 1:
bglogo.logo.alpha = (bglogo.logo.alpha + 0.2);
highscorerw("read");
break;
case 0:
case 2:
case 3:
case 4:
case 27:
case 28:
case 29:
case 30:
case 31:
case 54:
case 55:
case 56:
case 57:
case 58:
bglogo.logo.alpha = (bglogo.logo.alpha + 0.2);
break;
case 21:
case 22:
case 23:
case 24:
case 25:
case 48:
case 49:
case 50:
case 51:
case 52:
case 75:
case 76:
case 77:
case 78:
case 79:
bglogo.logo.alpha = (bglogo.logo.alpha - 0.2);
break;
case 26:
case 53:
bglogo.logo.nextFrame();
bglogo.logo.x = (0x0100 - (bglogo.logo.width / 2));
bglogo.logo.y = (224 - (bglogo.logo.height / 2));
break;
case 83:
flipmode("title");
};
bglogo.logoframe++;
bglogo.tmrlogo = gtmr();
};
}
function gameoverani(){
switch (goframe){
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
goint = 120;
bggameover.blak.alpha = (bggameover.blak.alpha - 0.1);
break;
case 10:
case 14:
case 19:
goint = 30;
bggameover.lid.x = (bggameover.lid.x - 1);
break;
case 11:
case 15:
case 20:
bggameover.lid.x = (bggameover.lid.x + 1);
break;
case 12:
case 16:
case 21:
bggameover.lid.x = (bggameover.lid.x + 1);
break;
case 13:
case 17:
case 22:
bggameover.lid.x = (bggameover.lid.x - 1);
break;
case 13:
case 18:
case 23:
break;
case 24:
bggameover.skul.visible = true;
goint = 60;
break;
};
if ((((goframe > 32)) && ((bggameover.txtgo.alpha < 1)))){
bggameover.lid.y = (bggameover.lid.y - 8);
if (bggameover.lid.y <= -214){
bggameover.txtgo.alpha = (bggameover.txtgo.alpha + 0.05);
};
} else {
if ((((goframe > 32)) && ((bggameover.txtgo.alpha >= 1)))){
bggameover.blak.visible = false;
bggameover.txtr.visible = true;
bggameover.br.visible = true;
};
};
goframe++;
}
function userkeyup(_arg1:KeyboardEvent){
if (gamestate == stateplaying){
switch (_arg1.keyCode){
case keyright:
holdingr = false;
if (((((((((!(holdingl)) && (!(holdingd)))) && (!(holdingu)))) && ((paction == "")))) && ((player.mstr.img.currentFrame == (1 + player.offset))))){
};
break;
case keyleft:
holdingl = false;
if (((((((((!(holdingr)) && (!(holdingd)))) && (!(holdingu)))) && ((paction == "")))) && ((player.mstr.img.currentFrame == (1 + player.offset))))){
};
break;
case keydown:
holdingd = false;
if (((player.ducking) && ((paction == "")))){
player.ducking = false;
player.mstr.img.gotoAndStop((1 + player.offset));
};
break;
case keyup:
holdingu = false;
break;
};
if (_arg1.keyCode == lastkey){
lastkey = 0;
};
};
}
function changep2score(_arg1:int){
var _local2:String;
_local2 = "";
_local2 = (_arg1 + "");
switch (_local2.length){
case 5:
_local2 = ("0" + _local2);
break;
case 4:
_local2 = ("00" + _local2);
break;
case 3:
_local2 = ("000" + _local2);
break;
case 2:
_local2 = ("0000" + _local2);
break;
case 1:
_local2 = ("00000" + _local2);
break;
};
if (_local2.length > 6){
_local2 = _local2.substr((_local2.length - 6), 6);
};
bgplayfield.txtp2.text = ("2-" + _local2);
}
private function progressHandler(_arg1:ProgressEvent):void{
trace(((("progressHandler loaded:" + _arg1.bytesLoaded) + " total: ") + _arg1.bytesTotal));
}
function frame2(){
nextFrame();
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
trace(("ioErrorHandler: " + _arg1));
disableweb = true;
}
public function bplayover(_arg1:MouseEvent){
txtplay.textColor = 0xFF0000;
}
function frame1(){
stop();
stage.scaleMode = StageScaleMode.EXACT_FIT;
API_Settings = {movie_id:10159, enc_key:"1qTL7l3fkuaz3Vd8vnM4NxcoE6UMd5Yd", movie_version:"1"};
newgroundsAPIconnector.initialize(API_Settings);
txtload.mouseWheelEnabled = false;
txtplay.mouseWheelEnabled = false;
txtplay.textColor = 0xFF00;
txtplay.visible = false;
txtload.visible = false;
bplay.visible = false;
bplay.buttonMode = true;
bplay.addEventListener(MouseEvent.CLICK, bplayclick);
bplay.addEventListener(MouseEvent.MOUSE_OVER, bplayover);
bplay.addEventListener(MouseEvent.MOUSE_OUT, bplayout);
tmr = new Timer(0);
tmr.addEventListener(TimerEvent.TIMER, loading);
tmr.start();
}
function santaani(){
var _local1:int;
_local1 = 0;
if (!holdingd){
if (!player.jumping){
if (holdingl){
_local1 = -1;
changescale(1);
} else {
if (holdingr){
_local1 = 1;
changescale(-1);
};
};
};
} else {
if (!player.jumping){
player.mstr.img.gotoAndStop((8 + player.offset));
player.ducking = true;
if (holdingl){
changescale(1);
} else {
if (holdingr){
changescale(-1);
};
};
};
};
if (player.jumping){
if (pjumpdir != 0){
bgmove((4 * (pjumpdir * -1)), false);
};
if (pjumpframe < 6){
if (pjumpframe == 0){
player.mstr.img.gotoAndStop((12 + player.offset));
};
player.y = (player.y - 8);
if ((((((pjumpframe == 4)) && (!((paction == "jkick"))))) && (!((paction == "jpunch"))))){
player.mstr.img.gotoAndStop((13 + player.offset));
};
} else {
if ((((pjumpframe > 7)) && ((pjumpframe < 14)))){
if ((((((pjumpframe == 6)) && (!((paction == "jkick"))))) && (!((paction == "jpunch"))))){
player.mstr.img.gotoAndStop((12 + player.offset));
};
player.y = (player.y + 8);
if (pjumpframe == 13){
paction = "";
player.mstr.img.gotoAndStop((5 + player.offset));
player.jumping = false;
};
};
};
pjumpframe++;
};
if (_local1 != 0){
bgmove((playermovechunk * (_local1 * -1)), false);
player.tmrmove = gtmr();
if (((((gtmr() - player.tmrani) >= 120)) && ((pgripped <= 0)))){
if (player.mstr.img.currentFrame != (2 + player.offset)){
player.mstr.img.gotoAndStop((2 + player.offset));
} else {
if (player.mstr.img.currentFrame == (2 + player.offset)){
player.mstr.img.gotoAndStop((1 + player.offset));
};
};
player.tmrani = gtmr();
};
};
}
function r(_arg1:String):int{
var _local2:int;
_local2 = -1;
switch (_arg1){
case "iteration":
_local2 = (riteration / 3.42);
break;
case "level":
_local2 = (rlevel / 3.42);
break;
case "lives":
_local2 = (rlives / 3.42);
break;
case "time":
_local2 = (rlvltimer / 3.42);
break;
case "score":
_local2 = (rscour / 3.42);
break;
case "nrg":
_local2 = (rnrg / 3.42);
break;
case "nmenrg":
_local2 = (rnmenrg / 3.42);
break;
};
if (_local2 == -1){
trace(_arg1);
};
return (_local2);
}
function nextwave(){
var _local1:Array;
var _local2:int;
var _local4:int;
var _local5:int;
_local1 = new Array();
_local2 = 0;
var _local3:int;
_local4 = 0;
_local5 = 0;
var _local6:Boolean;
switch (r("level")){
case 1:
switch (wavenum){
case 0:
case 1:
_local1.push(gripperarray[0]);
_local1.push(gripperarray[1]);
_local1.push(gripperarray[2]);
_local1.push(gripperarray[3]);
break;
case 2:
_local1.push(gripperarray[0]);
_local1.push(gripperarray[1]);
_local1.push(gripperarray[2]);
if (dadarray[0].eaction == "deactive"){
_local1.push(dadarray[0]);
} else {
_local1.push(dadarray[1]);
};
wavenum = -1;
break;
};
break;
case 2:
if (!midlevel){
_local4 = randm(1, 3);
if (_local4 == 1){
_local2 = 0;
while (_local2 < snakeeggarray.length) {
if ((((snakeeggarray[_local2].visible == false)) && ((snakeeggarray[_local2].eaction == "deactive")))){
snakeeggarray[_local2].eaction = "drop";
_local1.push(snakeeggarray[_local2]);
break;
};
_local2++;
};
} else {
if (_local4 == 2){
_local2 = 0;
while (_local2 < treearray.length) {
if ((((treearray[_local2].visible == false)) && ((treearray[_local2].eaction == "deactive")))){
treearray[_local2].eaction = "drop";
_local1.push(treearray[_local2]);
break;
};
_local2++;
};
} else {
if (_local4 == 3){
_local2 = 0;
while (_local2 < mistlearray.length) {
if ((((mistlearray[_local2].visible == false)) && ((mistlearray[_local2].eaction == "deactive")))){
mistlearray[_local2].eaction = "drop";
_local1.push(mistlearray[_local2]);
break;
};
_local2++;
};
};
};
};
wavenum = -1;
tmrwave = (gtmr() - 800);
} else {
switch (wavenum){
case 0:
case 1:
if (randm(1, 8) == 1){
_local1.push(hopperarray[0]);
} else {
_local1.push(gripperarray[0]);
};
if (randm(1, 2) == 1){
_local1.push(hopperarray[1]);
} else {
_local1.push(gripperarray[1]);
};
if (randm(1, 8) == 1){
_local1.push(hopperarray[2]);
} else {
_local1.push(gripperarray[2]);
};
if (randm(1, 2) == 1){
_local1.push(hopperarray[3]);
} else {
_local1.push(gripperarray[3]);
};
break;
case 2:
if (randm(1, 8) == 1){
_local1.push(hopperarray[0]);
} else {
_local1.push(gripperarray[0]);
};
if (randm(1, 4) == 1){
_local1.push(hopperarray[1]);
} else {
_local1.push(gripperarray[1]);
};
if (randm(1, 8) == 1){
_local1.push(hopperarray[2]);
} else {
_local1.push(gripperarray[2]);
};
if (randm(1, 2) == 1){
_local2 = 0;
while (_local2 < dadarray.length) {
if ((((dadarray[_local2].visible == false)) && ((dadarray[_local2].eaction == "deactive")))){
_local1.push(dadarray[_local2]);
break;
};
_local2++;
};
} else {
_local1.push(gripperarray[3]);
};
wavenum = -1;
break;
};
};
break;
case 3:
switch (wavenum){
case 0:
case 1:
if (randm(1, 8) == 1){
_local1.push(hopperarray[0]);
} else {
_local1.push(gripperarray[0]);
};
if (randm(1, 2) == 1){
_local1.push(hopperarray[1]);
} else {
_local1.push(gripperarray[1]);
};
if (randm(1, 8) == 1){
_local1.push(hopperarray[2]);
} else {
_local1.push(gripperarray[2]);
};
if (randm(1, 2) == 1){
_local1.push(hopperarray[3]);
} else {
_local1.push(gripperarray[3]);
};
break;
case 2:
if (randm(1, 8) == 1){
_local1.push(hopperarray[0]);
} else {
_local1.push(gripperarray[0]);
};
if (randm(1, 4) == 1){
_local1.push(hopperarray[1]);
} else {
_local1.push(gripperarray[1]);
};
if (randm(1, 8) == 1){
_local1.push(hopperarray[2]);
} else {
_local1.push(gripperarray[2]);
};
if (momarray[0].eaction == "deactive"){
if (randm(1, 2) == 1){
_local2 = 0;
while (_local2 < dadarray.length) {
if ((((dadarray[_local2].visible == false)) && ((dadarray[_local2].eaction == "deactive")))){
_local1.push(dadarray[_local2]);
break;
};
_local2++;
};
} else {
_local1.push(momarray[0]);
};
} else {
_local2 = 0;
while (_local2 < dadarray.length) {
if ((((dadarray[_local2].visible == false)) && ((dadarray[_local2].eaction == "deactive")))){
_local1.push(dadarray[_local2]);
break;
};
_local2++;
};
};
wavenum = -1;
break;
};
break;
case 4:
if (!midlevel){
_local2 = 0;
while (_local2 < canearray.length) {
if (canearray[_local2].eaction == "deactive"){
canearray[_local2].loc = randm(1, 3);
_local1.push(canearray[_local2]);
break;
};
_local2++;
};
wavenum = -1;
tmrwave = (gtmr() - 500);
} else {
if (midlevel){
switch (wavenum){
case 0:
case 1:
if (randm(1, 8) == 1){
_local1.push(hopperarray[0]);
} else {
_local1.push(gripperarray[0]);
};
if (randm(1, 2) == 1){
_local1.push(hopperarray[1]);
} else {
_local1.push(gripperarray[1]);
};
if (randm(1, 8) == 1){
_local1.push(hopperarray[2]);
} else {
_local1.push(gripperarray[2]);
};
if (randm(1, 2) == 1){
_local1.push(hopperarray[3]);
} else {
_local1.push(gripperarray[3]);
};
break;
case 2:
if (randm(1, 8) == 1){
_local1.push(hopperarray[0]);
} else {
_local1.push(gripperarray[0]);
};
if (randm(1, 4) == 1){
_local1.push(hopperarray[1]);
} else {
_local1.push(gripperarray[1]);
};
if (randm(1, 8) == 1){
_local1.push(hopperarray[2]);
} else {
_local1.push(gripperarray[2]);
};
if (momarray[0].eaction == "deactive"){
if (randm(1, 2) == 1){
_local2 = 0;
while (_local2 < dadarray.length) {
if ((((dadarray[_local2].visible == false)) && ((dadarray[_local2].eaction == "deactive")))){
_local1.push(dadarray[_local2]);
break;
};
_local2++;
};
} else {
_local1.push(momarray[0]);
};
} else {
_local2 = 0;
while (_local2 < dadarray.length) {
if ((((dadarray[_local2].visible == false)) && ((dadarray[_local2].eaction == "deactive")))){
_local1.push(dadarray[_local2]);
break;
};
_local2++;
};
};
wavenum = -1;
break;
};
};
};
break;
case 5:
_local4 = randm(1, 4);
switch (_local4){
case 1:
_local5 = randm(2, 3);
if (_local5 == 1){
_local2 = 0;
while (_local2 < snakeeggarray.length) {
if ((((snakeeggarray[_local2].visible == false)) && ((snakeeggarray[_local2].eaction == "deactive")))){
snakeeggarray[_local2].eaction = "drop";
_local1.push(snakeeggarray[_local2]);
break;
};
_local2++;
};
} else {
if (_local5 == 2){
_local2 = 0;
while (_local2 < treearray.length) {
if ((((treearray[_local2].visible == false)) && ((treearray[_local2].eaction == "deactive")))){
treearray[_local2].eaction = "drop";
_local1.push(treearray[_local2]);
break;
};
_local2++;
};
} else {
if (_local5 == 3){
_local2 = 0;
while (_local2 < mistlearray.length) {
if ((((mistlearray[_local2].visible == false)) && ((mistlearray[_local2].eaction == "deactive")))){
mistlearray[_local2].eaction = "drop";
_local1.push(mistlearray[_local2]);
break;
};
_local2++;
};
};
};
};
wavenum = -1;
tmrwave = (gtmr() - 800);
break;
case 2:
_local2 = 0;
while (_local2 < canearray.length) {
if (canearray[_local2].eaction == "deactive"){
canearray[_local2].loc = randm(1, 3);
_local1.push(canearray[_local2]);
break;
};
_local2++;
};
wavenum = -1;
tmrwave = (gtmr() - 500);
break;
case 3:
if (randm(1, 8) == 1){
_local1.push(hopperarray[0]);
} else {
_local1.push(gripperarray[0]);
};
if (randm(1, 2) == 1){
_local1.push(hopperarray[1]);
} else {
_local1.push(gripperarray[1]);
};
if (randm(1, 8) == 1){
_local1.push(hopperarray[2]);
} else {
_local1.push(gripperarray[2]);
};
if (randm(1, 2) == 1){
_local1.push(hopperarray[3]);
} else {
_local1.push(gripperarray[3]);
};
break;
case 4:
if (randm(1, 8) == 1){
_local1.push(hopperarray[0]);
} else {
_local1.push(gripperarray[0]);
};
if (randm(1, 4) == 1){
_local1.push(hopperarray[1]);
} else {
_local1.push(gripperarray[1]);
};
if (randm(1, 8) == 1){
_local1.push(hopperarray[2]);
} else {
_local1.push(gripperarray[2]);
};
if (momarray[0].eaction == "deactive"){
if (randm(1, 2) == 1){
_local2 = 0;
while (_local2 < dadarray.length) {
if ((((dadarray[_local2].visible == false)) && ((dadarray[_local2].eaction == "deactive")))){
_local1.push(dadarray[_local2]);
break;
};
_local2++;
};
} else {
_local1.push(momarray[0]);
};
} else {
_local2 = 0;
while (_local2 < dadarray.length) {
if ((((dadarray[_local2].visible == false)) && ((dadarray[_local2].eaction == "deactive")))){
_local1.push(dadarray[_local2]);
break;
};
_local2++;
};
};
wavenum = -1;
break;
};
break;
};
_local2 = 0;
while (_local2 < _local1.length) {
if (_local1[_local2].eaction != "drop"){
_local1[_local2].eaction = "waiting";
};
_local1[_local2].actionframe = 0;
_local1[_local2].waittime = (_local2 * 520);
_local1[_local2].nrg = _local1[_local2].maxnrg;
_local1[_local2].tmrex1 = gtmr();
_local1[_local2].tmrex2 = gtmr();
_local1[_local2].tmrex3 = gtmr();
switch (_local1[_local2].etype){
case "gripper":
_local1[_local2].grip = 4;
_local1[_local2].suboffset = 0;
_local4 = randm(1, 3);
if (_local4 == 1){
_local1[_local2].superoffset = 0;
} else {
if (_local4 == 2){
_local1[_local2].superoffset = 6;
} else {
_local1[_local2].superoffset = 12;
};
};
break;
case "hopper":
_local1[_local2].suboffset = 0;
_local4 = randm(1, 3);
if (_local4 == 1){
_local1[_local2].superoffset = 0;
} else {
if (_local4 == 2){
_local1[_local2].superoffset = 5;
} else {
_local1[_local2].superoffset = 10;
};
};
break;
case "snakeegg":
case "tree":
case "mistle":
case "cane":
setwaveside(_local1[_local2]);
break;
};
_local1[_local2].mstr.img.gotoAndStop((1 + _local1[_local2].superoffset));
nmearray.push(_local1[_local2]);
_local2++;
};
tmrwaveout = gtmr();
waveactive = true;
wavenum++;
}
function jhthrowani(_arg1:DisplayObject){
if (!_arg1.struck){
_arg1.x = (_arg1.x + (playermovechunk + 2));
_arg1.img.rotation = (_arg1.img.rotation + 15);
} else {
switch (_arg1.actionframe){
case 0:
case 2:
case 4:
case 6:
case 8:
case 10:
_arg1.img.nextFrame();
break;
case 12:
_arg1.visible = false;
break;
};
_arg1.actionframe++;
};
if (((((_arg1.bbHit.hitTestObject(player.mstr.bbHurt)) && (!(trueduck())))) && (!(_arg1.struck)))){
hurtplayer(0);
changenrg(-15);
_arg1.struck = true;
};
}
public function highscorerw(_arg1:String){
var request:URLRequest;
var charletter:String;
var namebuild:String;
var zoneeater:String;
var gobetween:String;
var tscour:int;
var tei:int;
var txtin:String;
var rw = _arg1;
if (disableweb){
return;
};
var loader:URLLoader = new URLLoader();
configureListeners(loader);
var tdat:Date = new Date();
if (rw == "read"){
request = new URLRequest(("http://www.rainbowcemetery.com/santafu/scores.php?filename=sfs/sfs.sco&scoresize=10&action=VIEW&viewtype=BBLL&jerktype=" + tdat.time));
} else {
if (rw == "write"){
charletter = "s";
namebuild = "";
zoneeater = "";
gobetween = "";
if (ioffset == 17){
charletter = "j";
} else {
if (ioffset == 34){
charletter = "r";
};
};
highscorename = (charletter + highscorename);
switch (highscorename.length){
};
tscour = 0;
tscour = r("score");
tei = 0;
while (tei < highscorename.length) {
zoneeater = highscorename.charAt(tei);
if (zoneeater == "&"){
zoneeater = "-";
};
namebuild = (namebuild + zoneeater);
tei = (tei + 1);
};
trace(namebuild);
txtin = ((((("?filename=sfs/sfs.sco&scoresize=10&action=INSERT&winname=" + namebuild) + "&winscore=") + r("score")) + "&viewtype=BBLL&jerktype=") + tdat.time);
request = new URLRequest(("http://www.rainbowcemetery.com/santafu/scores.php" + txtin));
};
};
try {
loader.load(request);
} catch(error:Error) {
disableweb = true;
trace("Unable to load requested document.");
};
}
function summonpurge(){
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < nmearray.length) {
nmearray[_local1].eaction = "deactive";
nmearray[_local1].visible = false;
nmearray[_local1].enabled = false;
_local1++;
};
_local1 = (pipearray.length - 1);
while (_local1 >= 0) {
pipearray[_local1].visible = false;
_local1--;
};
_local1 = (candyrangarray.length - 1);
while (_local1 >= 0) {
candyrangarray[_local1].visible = false;
_local1--;
};
_local1 = (snakearray.length - 1);
while (_local1 >= 0) {
snakearray[_local1].visible = false;
_local1--;
};
_local1 = (shardarray.length - 1);
while (_local1 >= 0) {
shardarray[_local1].visible = false;
_local1--;
};
_local1 = (jhthrowarray.length - 1);
while (_local1 >= 0) {
jhthrowarray[_local1].visible = false;
_local1--;
};
_local1 = (jhfallarray.length - 1);
while (_local1 >= 0) {
jhfallarray[_local1].visible = false;
_local1--;
};
_local1 = (laserarray.length - 1);
while (_local1 >= 0) {
laserarray[_local1].visible = false;
_local1--;
};
_local1 = (popscorearray.length - 1);
while (_local1 >= 0) {
popscorearray[_local1].visible = false;
_local1--;
};
nmearray = new Array();
}
function endjani(){
if ((gtmr() - bgendj.tmrani) >= 120){
switch (bgendj.actionframe){
case 0:
playsound(sfxvictory);
break;
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
if (!bgendj.lite.visible){
bgendj.lite.visible = true;
};
bgendj.lite.alpha = (bgendj.lite.alpha + 0.05);
break;
case 27:
case 28:
case 29:
case 30:
case 31:
case 32:
case 33:
case 34:
case 35:
case 36:
bgendj.bb.alpha = (bgendj.bb.alpha - 0.1);
break;
case 37:
bgendj.bb.visible = false;
break;
case 38:
case 39:
case 40:
case 41:
case 42:
case 43:
case 44:
case 45:
case 46:
case 47:
if (!bgendj.p1.visible){
bgendj.p1.visible = true;
};
bgendj.p1.alpha = (bgendj.p1.alpha + 0.1);
break;
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
bgendj.lite.alpha = (bgendj.lite.alpha - 0.05);
break;
case 87:
if (unlockr){
flipmode("continue");
} else {
unlockr = true;
savelocalstorage();
flipmode("unlock");
};
break;
};
bgendj.actionframe++;
bgendj.tmrani = gtmr();
};
}
function snakeani(_arg1:csnake){
_arg1.x = (_arg1.x - ((playermovechunk + 2) * _arg1.img.scaleX));
_arg1.moveframe++;
if (_arg1.moveframe >= 4){
if (_arg1.img.currentFrame == 1){
_arg1.img.nextFrame();
} else {
_arg1.img.gotoAndStop(1);
};
_arg1.moveframe = 0;
};
if (((((_arg1.bbHit.hitTestObject(player.mstr.bbHurt)) && (_arg1.visible))) && (!(_arg1.struck)))){
obloodstar.x = (_arg1.x + (8 * _arg1.img.scaleX));
obloodstar.y = (_arg1.y - 8);
reset(obloodstar);
tmrbloodstar = gtmr();
obloodstar.visible = true;
_arg1.struck = true;
hurtplayer(0);
snakd = true;
changenrg(-15);
};
}
function lvlcompleteani(){
var _local1:int;
var _local2:int;
var _local3:Boolean;
var _local4:SoundTransform;
_local1 = 0;
_local2 = 0;
_local3 = false;
switch (r("level")){
case 1:
case 3:
_local1 = 16;
_local2 = -1;
break;
case 2:
case 4:
_local1 = -16;
_local2 = 1;
break;
};
if (player.jumping){
santaani();
return;
};
if ((gtmr() - tmrlvlcomplete) >= lvlcompletetick){
if (bgmvolume > 0){
bgmvolume = (bgmvolume - 2.5);
if (bgmvolume < 0){
bgmvolume = 0;
};
};
_local4 = new SoundTransform((bgmvolume / 100), 0);
bgmsoundchannel.soundTransform = _local4;
if (lvlcompleteframe < 16){
if (lvlcompleteframe == 0){
player.y = targety;
player.mstr.img.gotoAndStop((1 + player.offset));
};
bgmove((bgplayfield.bg.x + _local1), true);
player.x = (player.x + _local1);
if (lvlcompleteframe == 15){
lvlcompletetick = 60;
};
} else {
if ((((lvlcompleteframe >= 16)) && ((lvlcompleteframe < 38)))){
if (lvlcompleteframe == 16){
playsound(sfxlvlcomplete);
};
if ((lvlcompleteframe % 2) == 0){
if (player.mstr.img.currentFrame != (2 + player.offset)){
player.mstr.img.gotoAndStop((2 + player.offset));
} else {
player.mstr.img.gotoAndStop((1 + player.offset));
};
};
player.x = (player.x + (-1 * (_local1 / 4)));
if (lvlcompleteframe == 37){
lvlcompletetick = 240;
};
} else {
if (lvlcompleteframe == 38){
switch (r("level")){
case 1:
player.x = 152;
player.y = 251;
break;
case 3:
player.x = 152;
player.y = 0xFF;
break;
case 2:
player.x = 332;
player.y = 259;
break;
case 4:
player.x = 332;
player.y = 259;
break;
};
player.mstr.img.gotoAndStop((3 + player.offset));
} else {
if ((((lvlcompleteframe > 38)) && ((lvlcompleteframe < 56)))){
if ((lvlcompleteframe % 2) == 0){
player.x = (player.x + (4 * _local2));
player.y = (player.y - 4);
player.mstr.img.gotoAndStop((3 + player.offset));
} else {
player.x = (player.x + (12 * _local2));
player.y = (player.y - 12);
player.mstr.img.gotoAndStop((2 + player.offset));
};
} else {
if (lvlcompleteframe >= 56){
switch (lvlcompleteframe){
case 56:
player.visible = false;
lvlcompletetick = 3500;
playmusic(sfxcomplete, false);
break;
case 57:
_local3 = true;
if ((gtmr() - tmrpoint) >= 66){
playsound(sfxpointtally);
tmrpoint = gtmr();
};
if ((gtmr() - tmrpointer) >= 30){
if (r("nrg") > 0){
silentnrg(-2);
changescore(100);
} else {
if (r("time") > 0){
silenttimer(-25);
changescore(125);
} else {
_local3 = false;
lvlcompletetick = 2000;
};
};
tmrpointer = gtmr();
};
break;
case 58:
if (r("level") < 5){
switch (r("level")){
case 1:
case 3:
nextlvl(true);
break;
case 2:
case 4:
flipmode("sylvia");
break;
};
} else {
levelcomplete = false;
fadeframe = 0;
bgblak.alpha = 0;
bgblak.visible = true;
reset(bgblak);
bgfadeout = true;
};
break;
};
};
};
};
};
};
if (!_local3){
lvlcompleteframe++;
tmrlvlcomplete = gtmr();
};
};
}
function candyrangani(_arg1:ccandyrang){
var _local2:DisplayObject;
if (((((_arg1.actionframe % 21) == 0)) && (_arg1.visible))){
playsound(sfxboomerang);
};
var _local3:int;
if (_arg1.loc == "high"){
_local3 = 1;
} else {
_local3 = -1;
};
if (_arg1.actionframe <= 62){
_arg1.x = (_arg1.x - 6);
} else {
if ((((_arg1.actionframe >= 63)) && ((_arg1.actionframe <= 66)))){
_arg1.x = (_arg1.x - 1.5);
_arg1.y = (_arg1.y + (6.5 * _local3));
} else {
if ((((_arg1.actionframe >= 67)) && ((_arg1.actionframe <= 70)))){
_arg1.x = (_arg1.x + 1.5);
_arg1.y = (_arg1.y + (6.5 * _local3));
if (_arg1.struck){
_arg1.struck = false;
};
} else {
if (_arg1.actionframe > 70){
_arg1.x = (_arg1.x + 6);
};
};
};
};
_arg1.img.rotation = (_arg1.img.rotation - 30);
_arg1.actionframe++;
if (player.ducking){
_local2 = player.mstr.bbduck;
} else {
_local2 = player.mstr.bbHurt;
};
if (((((_arg1.bbHit.hitTestObject(_local2)) && (_arg1.visible))) && (!(_arg1.struck)))){
obloodstar.x = (_arg1.x + 4);
obloodstar.y = _arg1.y;
reset(obloodstar);
tmrbloodstar = gtmr();
obloodstar.visible = true;
_arg1.struck = true;
hurtplayer(0);
changenrg(-15);
};
}
public function bplayclick(_arg1:MouseEvent){
santafu(root).started = true;
}
private function onFlushStatus(_arg1:NetStatusEvent):void{
trace("User closed permission dialog...");
switch (_arg1.info.code){
case "SharedObject.Flush.Success":
trace("User granted permission -- value saved.");
break;
case "SharedObject.Flush.Failed":
trace("User denied permission -- value not saved.");
break;
};
localstorage.removeEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
}
function pausetoggle(){
if (!gamepaused){
playsound(sfxpause);
gamepaused = true;
pausetmr = getTimer();
bgmsoundchannel.stop();
} else {
playsound(sfxunpause);
playmusic(bgintro.intromusic, true);
intertime = (intertime + (getTimer() - pausetmr));
gamepaused = false;
};
}
function devisible(){
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < bgarray.length) {
bgarray[_local1].visible = false;
_local1++;
};
bgblak.visible = false;
_local1 = 0;
while (_local1 < gripperarray.length) {
gripperarray[_local1].visible = false;
hopperarray[_local1].visible = false;
dadarray[_local1].visible = false;
momarray[_local1].visible = false;
_local1++;
};
}
function changescore(_arg1:int){
var _local2:String;
var _local3:Boolean;
_local2 = "";
_local3 = false;
if (scour != r("score")){
rscour = 0;
scour = 0;
} else {
rscour = (rscour + (_arg1 * 3.42));
scour = r("score");
if (scour > hiscore){
_local3 = true;
};
};
_local2 = (scour + "");
switch (_local2.length){
case 5:
_local2 = ("0" + _local2);
break;
case 4:
_local2 = ("00" + _local2);
break;
case 3:
_local2 = ("000" + _local2);
break;
case 2:
_local2 = ("0000" + _local2);
break;
case 1:
_local2 = ("00000" + _local2);
break;
};
if (_local2.length > 6){
_local2 = _local2.substr((_local2.length - 6), 6);
};
if (_local3){
bgplayfield.txttop.text = ("top-" + _local2);
hiscore = scour;
};
bgplayfield.txtscore.text = ("1-" + _local2);
}
function strikeani(){
if ((gtmr() - tmrstrike) >= 120){
ostrikestar.visible = false;
};
}
function eggdropani(_arg1:DisplayObject){
var _local2:Point;
_arg1.y = (_arg1.y + (playermovechunk + 4));
if (_arg1.mstr.bbHit.hitTestObject(player.mstr.bbHurt)){
switch (_arg1.etype){
case "snakeegg":
opop.x = (_arg1.x - 4);
opop.y = _arg1.y;
break;
case "tree":
opop.x = (_arg1.x + 16);
opop.y = (_arg1.y + 50);
break;
case "mistle":
_local2 = _arg1.mstr.bbHit.localToGlobal(new Point(0, 0));
opop.x = (_local2.x - 4);
opop.y = (_local2.y - 4);
break;
};
playsound(sfxhit);
tmrpop = gtmr();
opop.visible = true;
_arg1.visible = false;
hurtplayer(0);
_arg1.struck = true;
changenrg(-15);
_arg1.eaction = "deactive";
} else {
if (_arg1.y >= (targety + _arg1.ty)){
_arg1.eaction = "";
};
};
}
function dadani(_arg1:DisplayObject, _arg2:int){
var _local3:cpipe;
if (_arg1.eaction == ""){
if (Math.abs((player.x - _arg1.x)) > 190){
_arg1.x = (_arg1.x + ((playermovechunk + 2) * (_arg1.mstr.scaleX * -1)));
_arg1.moveframe++;
};
if (_arg1.mstr.bbHurt.hitTestObject(player.mstr.bbHurt)){
_arg1.eaction = "retreatwait";
};
if ((((Math.abs((player.x - _arg1.x)) < 50)) && (!(_arg1.struck)))){
if (randm(1, 3) == 1){
_arg1.eaction = "retreatwait";
};
_arg1.struck = true;
} else {
if ((gtmr() - _arg1.tmrex2) >= 2000){
_arg1.actionframe = 0;
if (randm(1, 2) == 1){
_arg1.eaction = "throwhigh";
} else {
_arg1.eaction = "throwlow";
};
};
};
} else {
if (_arg1.eaction == "retreatwait"){
if ((gtmr() - _arg1.tmrex2) >= 500){
_arg1.eaction = "retreat";
_arg1.mstr.scaleX = (_arg1.mstr.scaleX * -1);
};
} else {
if (_arg1.eaction == "retreat"){
if (Math.abs((player.x - _arg1.x)) < 190){
_arg1.x = (_arg1.x + ((playermovechunk + 2) * (_arg1.mstr.scaleX * -1)));
_arg1.moveframe++;
} else {
_arg1.eaction = "";
_arg1.mstr.scaleX = (_arg1.mstr.scaleX * -1);
};
} else {
if (_arg1.eaction == "throwhigh"){
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(3);
break;
case 20:
playsound(sfxpipe);
_arg1.mstr.img.gotoAndStop(4);
_local3 = new cpipe();
_local3.loc = "high";
_local3.x = (_arg1.x - (12 * _arg1.mstr.scaleX));
_local3.y = (_arg1.y + 12);
_local3.img.scaleX = _arg1.mstr.scaleX;
addChild(_local3);
pipearray.push(_local3);
break;
case 23:
_arg1.struck = false;
_arg1.moveframe = 0;
_arg1.mstr.img.gotoAndStop(1);
_arg1.tmrex1 = gtmr();
_arg1.tmrex2 = gtmr();
_arg1.eaction = "";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "throwlow"){
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(5);
break;
case 20:
playsound(sfxpipe);
_arg1.mstr.img.gotoAndStop(6);
_local3 = new cpipe();
_local3.loc = "low";
_local3.x = (_arg1.x - (12 * _arg1.mstr.scaleX));
_local3.y = (_arg1.y + 53);
_local3.img.scaleX = _arg1.mstr.scaleX;
addChild(_local3);
pipearray.push(_local3);
break;
case 23:
_arg1.struck = false;
_arg1.moveframe = 0;
_arg1.mstr.img.gotoAndStop(1);
_arg1.tmrex1 = gtmr();
_arg1.tmrex2 = gtmr();
_arg1.eaction = "";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "run"){
nmerun(_arg1);
} else {
if (_arg1.eaction == "dead"){
nmedeadani(_arg1);
};
};
};
};
};
};
};
if (_arg1.moveframe >= 3){
if (((_arg1.mstr.img.currentFrame - _arg1.suboffset) - _arg1.superoffset) == 1){
_arg1.mstr.img.gotoAndStop(((2 + _arg1.suboffset) + _arg1.superoffset));
} else {
_arg1.mstr.img.gotoAndStop(((1 + _arg1.suboffset) + _arg1.superoffset));
};
_arg1.moveframe = 0;
};
}
function snakeeggani(_arg1:DisplayObject){
var _local2:csnake;
var _local3:Point;
if (_arg1.eaction == ""){
_arg1.actionframe = 0;
_arg1.eaction = "break";
};
if (_arg1.eaction == "break"){
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(2);
playsound(sfxsnakeegg);
break;
case 8:
_local2 = new csnake();
_local2.y = _arg1.y;
_local2.x = _arg1.x;
if (player.x < _arg1.x){
} else {
_local2.img.scaleX = -1;
};
addChild(_local2);
snakearray.push(_local2);
break;
case 12:
_arg1.visible = false;
_arg1.eaction = "deactive";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "dead"){
opop.x = (_arg1.x - 4);
opop.y = _arg1.y;
tmrpop = gtmr();
opop.visible = true;
_arg1.visible = false;
_arg1.eaction = "deactive";
};
};
}
public function bplayout(_arg1:MouseEvent){
if (currentFrame == 1){
txtplay.textColor = 0xFF00;
};
}
private function scoredld(_arg1:Event):void{
var _local6:String;
var _local2:URLLoader = URLLoader(_arg1.target);
var _local3:int;
var _local4:int;
trace(("completeHandler: " + _local2.data));
var _local5:String = _local2.data;
var _local7 = "";
scorearray = new Array();
scorenamesarray = new Array();
neoscorenamesarray = new Array();
winchararray = new Array();
_local3 = 0;
while (_local3 < _local5.length) {
_local6 = _local5.charAt(_local3);
if (_local6 != null){
if (_local6 == "-"){
_local6 = "&";
};
if (_local6 == "<"){
scorearray.push(_local7);
_local7 = "";
} else {
if (_local6 == ">"){
scorenamesarray.push(_local7);
_local7 = "";
} else {
_local7 = (_local7 + _local6);
};
};
};
_local3++;
};
_local4 = 0;
while (_local4 < scorenamesarray.length) {
neoscorenamesarray.push(scorenamesarray[_local4].substr(1, (scorenamesarray[_local4].length - 1)));
winchararray.push(scorenamesarray[_local4].charAt(0));
_local4++;
};
minscore = scorearray[(scorearray.length - 1)];
changetopscore(scorearray[0]);
changep2score(minscore);
bghsview.txtnames.text = "";
bghsview.txtscores.text = "";
_local3 = 0;
while (_local3 < scorearray.length) {
bghsview.txtnames.appendText((neoscorenamesarray[_local3] + "\n"));
bghsview.txtscores.appendText((scorearray[_local3] + "\n"));
if (winchararray[_local3] == "s"){
bghsview.getChildByName(("h" + _local3)).gotoAndStop(1);
} else {
if (winchararray[_local3] == "j"){
bghsview.getChildByName(("h" + _local3)).gotoAndStop(2);
} else {
if (winchararray[_local3] == "r"){
bghsview.getChildByName(("h" + _local3)).gotoAndStop(3);
};
};
};
_local3++;
};
}
function endsanis(){
var _local2:*;
var _local1:int;
if (endsmoveframe >= 4){
if ((((bgends.endframe > 92)) && ((bgends.endframe < 105)))){
if (bgmvolume > 0){
bgmvolume = (bgmvolume - 5);
if (bgmvolume < 0){
bgmvolume = 0;
};
};
_local2 = new SoundTransform((bgmvolume / 100), 0);
bgmsoundchannel.soundTransform = _local2;
};
if (bgends.miss.enabled){
if ((bgends.miss.currentFrame % 2) == 0){
bgends.miss.prevFrame();
} else {
bgends.miss.nextFrame();
};
};
if (bgends.hl.enabled){
bgends.hl.visible = !(bgends.hl.visible);
};
if (bgends.santa.enabled){
switch (bgends.soffset){
case 5:
playsound(sfxchain);
break;
case 8:
playsound(sfxchainhigh);
break;
case 11:
playsound(sfxchop);
break;
};
};
endsmoveframe = -1;
};
if (bgends.santa.enabled){
if (bgends.santa.currentFrame == (bgends.soffset + 2)){
bgends.santa.gotoAndStop(bgends.soffset);
} else {
bgends.santa.nextFrame();
};
};
if (bgends.bg.enabled){
if (bgends.bg.x == -4){
_local1 = 0;
while (_local1 < bgends.bgmovearray.length) {
bgends.bgmovearray[_local1].x = 0;
_local1++;
};
} else {
_local1 = 0;
while (_local1 < bgends.bgmovearray.length) {
bgends.bgmovearray[_local1].x = -4;
_local1++;
};
};
};
endsmoveframe++;
}
function init(){
var _local2:*;
var _local1:int;
bgtitle = new ctitle();
bgcharselect = new ccharselect();
bgplayfield = new cplayfield();
bggameover = new cgameover();
bgends = new cendingsanta();
bgintro = new cintro();
bghsview = new chsview();
bgcredits = new ccredits();
bglogo = new clogo();
bghsentry = new chsentry();
bgsylvia = new csylvia();
bgunlock = new cunlock();
bgendj = new cendingjesus();
bgendr = new cendingraptor();
bgblak = new gblak();
bgblak.width = 0x0200;
bgblak.height = 369;
bgblak.y = 79;
bgblak.visible = false;
addChild(bgblak);
bgarray.push(bgtitle);
bgarray.push(bgcharselect);
bgarray.push(bgplayfield);
bgarray.push(bggameover);
bgarray.push(bgends);
bgarray.push(bgintro);
bgarray.push(bghsview);
bgarray.push(bgcredits);
bgarray.push(bglogo);
bgarray.push(bghsentry);
bgarray.push(bgsylvia);
bgarray.push(bgunlock);
bgarray.push(bgendj);
bgarray.push(bgendr);
_local1 = 0;
while (_local1 < bgarray.length) {
addChild(bgarray[_local1]);
_local1++;
};
_local1 = 0;
while (_local1 < 8) {
gripperarray.push(new cgripper());
hopperarray.push(new chopper());
dadarray.push(new cdad());
momarray.push(new cmom());
canearray.push(new ccane());
_local1++;
};
_local1 = 0;
while (_local1 < gripperarray.length) {
addChild(gripperarray[_local1]);
addChild(hopperarray[_local1]);
addChild(dadarray[_local1]);
addChild(momarray[_local1]);
addChild(canearray[_local1]);
gripperarray[_local1].enabled = false;
hopperarray[_local1].enabled = false;
dadarray[_local1].enabled = false;
momarray[_local1].enabled = false;
canearray[_local1].enabled = false;
gripperarray[_local1].visible = false;
gripperarray[_local1].y = 600;
dadarray[_local1].visible = false;
dadarray[_local1].y = 600;
momarray[_local1].visible = false;
momarray[_local1].y = 600;
hopperarray[_local1].visible = false;
hopperarray[_local1].y = 600;
canearray[_local1].visible = false;
canearray[_local1].y = 600;
_local1++;
};
soundarray.push(new sboomerang());
soundarray.push(new sdead());
soundarray.push(new slaugh());
soundarray.push(new slaughhigh());
soundarray.push(new slaughlow());
soundarray.push(new s1up());
soundarray.push(new shit());
soundarray.push(new shithard());
soundarray.push(new slight());
soundarray.push(new shurt());
soundarray.push(new sjack());
soundarray.push(new sjesus());
soundarray.push(new sjumpkick());
soundarray.push(new skick());
soundarray.push(new spipe());
soundarray.push(new slvlcomplete());
soundarray.push(new slvlstart());
soundarray.push(new scane());
soundarray.push(new spause());
soundarray.push(new spointtally());
soundarray.push(new spunch());
soundarray.push(new slaser());
soundarray.push(new ssnake());
soundarray.push(new ssnakeegg());
soundarray.push(new sswordhit());
soundarray.push(new stree());
soundarray.push(new sunpause());
soundarray.push(new schain());
soundarray.push(new schainhigh());
soundarray.push(new sdoor());
soundarray.push(new slaughlong());
soundarray.push(new sjackmelt());
soundarray.push(new sswitch());
soundarray.push(new schop());
soundarray.push(new srudolph());
soundarray.push(new sfarkus());
soundarray.push(new sturbo());
soundarray.push(new svictory());
soundarray.push(new scomplete());
soundarray.push(new sgameover());
musicarray.push(new msanta());
musicarray.push(new miceclimbers());
musicarray.push(new mslalom());
musicarray.push(new mkungfu());
musicarray.push(new mreindeer());
musicarray.push(new mgyromite());
musicarray.push(new mbedroom());
bturbo = new cturbo();
bturbo.visible = false;
bfarkus = new cfarkus();
bfarkus.visible = false;
bjack = new cjack();
bjack.visible = false;
brudolph = new crudolph();
brudolph.visible = false;
bxmas = new csanta();
bxmas.visible = false;
nmebooster = new cbooster();
nmebooster.visible = false;
ostrikestar = new gstrikestar();
ostrikestar.visible = false;
obloodstar = new gbloodstar();
obloodstar.visible = false;
opop = new gpop();
opop.visible = false;
addChild(bturbo);
addChild(bfarkus);
addChild(bjack);
addChild(brudolph);
addChild(bxmas);
addChild(nmebooster);
addChild(ostrikestar);
addChild(obloodstar);
addChild(opop);
flipmode("logo");
}
function nmecheckmove(_arg1:DisplayObject, _arg2:int){
if (!_arg1.mstr.bbHurt.hitTestObject(player.mstr.bbHurt)){
_arg1.x = (_arg1.x + _arg2);
} else {
if ((((_arg1.etype == "turbo")) || ((_arg1.etype == "mom")))){
_arg1.eaction = "retreat";
} else {
if (_arg1.etype == "farkus"){
if (r("iteration") > 1){
_arg1.actionframe = 7;
_arg1.eaction = "punch";
};
} else {
if (_arg1.etype == "xmas"){
_arg1.actionframe = 0;
_arg1.eaction = "dpunch";
};
};
};
};
}
private function randm(_arg1:int, _arg2:int):int{
return (Math.floor(((((_arg2 - _arg1) + 1) * Math.random()) + _arg1)));
}
function natani(){
var _local1:int;
_local1 = (bgplayfield.bg.bgnat.suboffset + bgplayfield.bg.bgnat.superoffset);
if ((gtmr() - tmrfireplace) >= 360){
if (bgplayfield.bg.bgnat.img.currentFrame != (2 + _local1)){
bgplayfield.bg.bgnat.img.gotoAndStop((2 + _local1));
} else {
if (bgplayfield.bg.bgnat.img.currentFrame != (1 + _local1)){
bgplayfield.bg.bgnat.img.gotoAndStop((1 + _local1));
};
};
if (bgplayfield.bg.smok1.currentFrame == 6){
bgplayfield.bg.smok1.gotoAndStop(1);
} else {
bgplayfield.bg.smok1.nextFrame();
};
if (bgplayfield.bg.smok2.currentFrame == 6){
bgplayfield.bg.smok2.gotoAndStop(1);
} else {
bgplayfield.bg.smok2.nextFrame();
};
if (bgplayfield.bg.smok3.currentFrame == 6){
bgplayfield.bg.smok3.gotoAndStop(1);
} else {
bgplayfield.bg.smok3.nextFrame();
};
tmrfireplace = gtmr();
};
}
function hopperani(_arg1:DisplayObject, _arg2:int){
var _local4:DisplayObject;
var _local3:int;
if (_arg1.eaction == ""){
_arg1.x = (_arg1.x - ((playermovechunk + 2) * _arg1.mstr.scaleX));
if (Math.abs((player.x - _arg1.x)) <= 124){
if (((player.ducking) && (_arg1.minienable))){
if (randm(1, 8) <= r("iteration")){
_arg1.eaction = "flip";
_arg1.mstr.img.gotoAndStop((3 + _arg1.superoffset));
_arg1.moveframe = 0;
};
};
_arg1.minienable = false;
};
if (_arg1.actionframe == 0){
if (_arg1.mstr.bbHit.hitTestObject(player.mstr.bbHurt)){
_arg1.mstr.img.gotoAndStop((4 + _arg1.superoffset));
_arg1.eaction = "grip";
pgripped = 4;
tmrgrip = gtmr();
_arg1.grip = 4;
_arg1.tmrgrip = gtmr();
};
_local3 = 0;
while (_local3 < nmearray.length) {
if (((!((_local3 == _arg2))) && ((nmearray[_local3].eaction == "grip")))){
if (_arg1.mstr.bbHit.hitTestObject(nmearray[_local3].mstr.bbHit)){
_arg1.mstr.img.gotoAndStop((4 + _arg1.superoffset));
_arg1.eaction = "grip";
pgripped = 4;
tmrgrip = gtmr();
_arg1.grip = 4;
_arg1.tmrgrip = gtmr();
};
};
_local3++;
};
} else {
if ((((_arg1.x <= -50)) || ((_arg1.x >= 560)))){
_arg1.visible = false;
_arg1.eaction = "deactive";
};
};
if ((((_arg1.moveframe >= 4)) && ((_arg1.eaction == "")))){
if (((_arg1.mstr.img.currentFrame - _arg1.suboffset) - _arg1.superoffset) == 1){
_arg1.mstr.img.gotoAndStop(((2 + _arg1.suboffset) + _arg1.superoffset));
} else {
_arg1.mstr.img.gotoAndStop(((1 + _arg1.suboffset) + _arg1.superoffset));
};
_arg1.moveframe = -1;
};
_arg1.moveframe++;
} else {
if (_arg1.eaction == "flip"){
_arg1.x = (_arg1.x - ((playermovechunk + 2) * _arg1.mstr.scaleX));
if (_arg1.actionframe < 11){
_arg1.y = (_arg1.y - (playermovechunk + 2));
_arg1.mstr.rotation = (_arg1.mstr.rotation - (30 * _arg1.mstr.scaleX));
} else {
if ((((_arg1.actionframe >= 11)) && ((_arg1.y < (targety + _arg1.ty))))){
_arg1.y = (_arg1.y + (playermovechunk + 2));
_arg1.mstr.rotation = (_arg1.mstr.rotation - (30 * _arg1.mstr.scaleX));
} else {
if ((((_arg1.actionframe >= 11)) && ((_arg1.y >= (targety + _arg1.ty))))){
_arg1.mstr.rotation = 0;
_arg1.mstr.img.gotoAndStop((1 + _arg1.superoffset));
_arg1.eaction = "";
};
};
};
if (player.ducking){
_local4 = player.mstr.bbduck;
} else {
_local4 = player.mstr.bbHurt;
};
if (((_arg1.mstr.bbHit.hitTestObject(_local4)) && (!(_arg1.struck)))){
hurtplayer(0);
changenrg(-15);
_arg1.struck = true;
_arg1.actionframe = 4;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "run"){
nmerun(_arg1);
} else {
if (_arg1.eaction == "dead"){
nmedeadani(_arg1);
};
};
};
};
}
function changeiteration(_arg1:Number){
riteration = (riteration + (_arg1 * 3.42));
iteration = r("iteration");
if ((((iteration >= 0)) && ((iteration <= 9)))){
bgplayfield.txtcomplete.text = ("-" + (iteration - 1));
};
}
function moveenemies(){
var _local1:int;
_local1 = 0;
while (_local1 < nmearray.length) {
switch (nmearray[_local1].etype){
case "gripper":
gripperani(nmearray[_local1], _local1);
break;
case "dad":
dadani(nmearray[_local1], _local1);
break;
case "booster":
if (nmearray[_local1].eaction == "dead"){
nmedeadani(nmearray[_local1]);
};
break;
case "turbo":
turboani(nmearray[_local1], _local1);
break;
case "snakeegg":
if (nmearray[_local1].eaction == "drop"){
eggdropani(nmearray[_local1]);
} else {
snakeeggani(nmearray[_local1]);
};
break;
case "tree":
if (nmearray[_local1].eaction == "drop"){
eggdropani(nmearray[_local1]);
} else {
treeani(nmearray[_local1]);
};
break;
case "mistle":
if (nmearray[_local1].eaction == "drop"){
eggdropani(nmearray[_local1]);
} else {
mistleani(nmearray[_local1]);
};
break;
case "hopper":
hopperani(nmearray[_local1], _local1);
break;
case "farkus":
farkusani(nmearray[_local1], _local1);
break;
case "mom":
momani(nmearray[_local1], _local1);
break;
case "jack":
jackani(nmearray[_local1], _local1);
break;
case "cane":
caneani(nmearray[_local1], _local1);
break;
case "rudolph":
rudolphani(nmearray[_local1], _local1);
break;
case "xmas":
mrxmasani(nmearray[_local1], _local1);
break;
};
if (nmearray[_local1].eaction == "boss"){
bosswaiting(nmearray[_local1]);
};
_local1++;
};
}
public function loading(_arg1:TimerEvent){
if (santafu(root).started){
poop.visible = false;
removeChild(poop);
stage.quality = StageQuality.LOW;
tmr.stop();
nextFrame();
};
}
function shardani(_arg1:gshard){
var _local2:gblank;
_arg1.x = (_arg1.x + ((playermovechunk + 8) * _arg1.dir));
_arg1.y = (_arg1.y + (playermovechunk + 2));
if (player.ducking){
_local2 = player.mstr.bbduck;
} else {
_local2 = player.mstr.bbHurt;
};
if (((((_arg1.bbHit.hitTestObject(_local2)) && (_arg1.visible))) && (!(_arg1.struck)))){
obloodstar.x = _arg1.x;
obloodstar.y = _arg1.y;
reset(obloodstar);
tmrbloodstar = gtmr();
obloodstar.visible = true;
_arg1.struck = true;
hurtplayer(0);
changenrg(-15);
};
}
private function reset(_arg1:DisplayObject){
setChildIndex(_arg1, (numChildren - 1));
}
function mrxmasani(_arg1:DisplayObject, _arg2:int){
var _local6:cjackhead;
var _local7:gblank;
var _local8:gblank;
var _local9:gblank;
var _local3:Boolean;
var _local4:Boolean;
var _local5:int;
var _local10:Boolean;
if (_arg1.eaction == ""){
if (r("iteration") > 1){
_local9 = _arg1.mstr.bbKneelKick;
} else {
_local9 = _arg1.mstr.bbPunch;
};
if (_local9.hitTestObject(player.mstr.bbHurt)){
if (player.ducking){
_arg1.eaction = "supercombo";
} else {
_arg1.eaction = "attack";
};
_arg1.actionframe = 0;
} else {
if (_arg1.x < 96){
_arg1.eaction = "advance";
_arg1.actionframe = 0;
} else {
_local5 = randm(1, 4);
switch (_local5){
case 1:
_arg1.eaction = "advance";
break;
case 2:
_arg1.eaction = "retreat";
break;
};
_arg1.actionframe = 0;
_arg1.moveframe = 0;
};
};
};
if (_arg1.eaction == "advance"){
nmecheckmove(_arg1, (playermovechunk * (-1 * _arg1.mstr.scaleX)));
_arg1.moveframe++;
_arg1.actionframe++;
if (_arg1.actionframe >= 12){
_arg1.eaction = "";
};
_local3 = true;
} else {
if (_arg1.eaction == "retreat"){
_arg1.x = (_arg1.x - (playermovechunk * (-1 * _arg1.mstr.scaleX)));
_arg1.moveframe++;
_arg1.actionframe++;
if (_arg1.actionframe >= 12){
_arg1.eaction = "";
};
_local3 = true;
} else {
if (_arg1.eaction == "attack"){
_local5 = randm(1, 6);
switch (_local5){
case 1:
_arg1.eaction = "punch";
break;
case 2:
_arg1.eaction = "kick";
break;
case 3:
_arg1.eaction = "dpunch";
break;
case 4:
_arg1.eaction = "dkick";
break;
case 5:
_arg1.eaction = "jpunch";
break;
case 6:
_arg1.eaction = "jkick";
break;
};
} else {
if (_arg1.eaction == "punch"){
switch (_arg1.actionframe){
case 0:
case 8:
_arg1.mstr.img.gotoAndStop((5 + _arg1.offset));
break;
case 4:
_arg1.mstr.img.gotoAndStop((4 + _arg1.offset));
_local7 = _arg1.mstr.bbPunch;
_local4 = true;
break;
case 12:
_arg1.mstr.img.gotoAndStop((5 + _arg1.offset));
break;
case 20:
_arg1.moveframe = 0;
_arg1.actionframe = -1;
_arg1.eaction = "";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "kick"){
switch (_arg1.actionframe){
case 0:
case 8:
_arg1.mstr.img.gotoAndStop((7 + _arg1.offset));
break;
case 4:
_arg1.mstr.img.gotoAndStop((6 + _arg1.offset));
_local7 = _arg1.mstr.bbKick;
_local4 = true;
break;
case 12:
_arg1.mstr.img.gotoAndStop((5 + _arg1.offset));
break;
case 20:
_arg1.moveframe = 0;
_arg1.actionframe = -1;
_arg1.eaction = "";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "dpunch"){
switch (_arg1.actionframe){
case 0:
case 8:
_arg1.mstr.img.gotoAndStop((8 + _arg1.offset));
break;
case 4:
_arg1.mstr.img.gotoAndStop((9 + _arg1.offset));
_local7 = _arg1.mstr.bbKneelPunch;
_local4 = true;
break;
case 12:
_arg1.mstr.img.gotoAndStop((8 + _arg1.offset));
break;
case 20:
_arg1.moveframe = 0;
_arg1.actionframe = -1;
_arg1.eaction = "";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "dkick"){
switch (_arg1.actionframe){
case 0:
case 8:
_arg1.mstr.img.gotoAndStop((11 + _arg1.offset));
break;
case 4:
_arg1.mstr.img.gotoAndStop((10 + _arg1.offset));
_local7 = _arg1.mstr.bbKneelKick;
_local4 = true;
break;
case 12:
_arg1.mstr.img.gotoAndStop((8 + _arg1.offset));
break;
case 20:
_arg1.moveframe = 0;
_arg1.actionframe = -1;
_arg1.eaction = "";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "jpunch"){
switch (_arg1.actionframe){
case 0:
case 1:
case 2:
case 3:
_arg1.mstr.img.gotoAndStop((12 + _arg1.offset));
_arg1.y = (_arg1.y - 8);
break;
case 4:
case 5:
_arg1.mstr.img.gotoAndStop((13 + _arg1.offset));
_arg1.y = (_arg1.y - 8);
break;
case 6:
_arg1.mstr.img.gotoAndStop((14 + _arg1.offset));
_local7 = _arg1.mstr.bbPunch;
_local4 = true;
break;
case 8:
case 9:
_arg1.y = (_arg1.y + 8);
break;
case 10:
case 11:
_arg1.y = (_arg1.y + 8);
_arg1.mstr.img.gotoAndStop((13 + _arg1.offset));
break;
case 12:
_arg1.y = (_arg1.y + 8);
_arg1.mstr.img.gotoAndStop((12 + _arg1.offset));
break;
case 13:
_arg1.y = (_arg1.y + 8);
_arg1.mstr.img.gotoAndStop((5 + _arg1.offset));
break;
case 21:
_arg1.moveframe = 0;
_arg1.actionframe = -1;
_arg1.eaction = "";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "jkick"){
switch (_arg1.actionframe){
case 0:
case 1:
case 2:
case 3:
_arg1.mstr.img.gotoAndStop((12 + _arg1.offset));
_arg1.y = (_arg1.y - 8);
break;
case 4:
case 5:
_arg1.mstr.img.gotoAndStop((13 + _arg1.offset));
_arg1.y = (_arg1.y - 8);
break;
case 6:
_arg1.mstr.img.gotoAndStop((15 + _arg1.offset));
_local7 = _arg1.mstr.bbKick;
_local4 = true;
break;
case 8:
case 9:
_arg1.y = (_arg1.y + 8);
break;
case 10:
case 11:
_arg1.y = (_arg1.y + 8);
_arg1.mstr.img.gotoAndStop((13 + _arg1.offset));
break;
case 12:
_arg1.y = (_arg1.y + 8);
_arg1.mstr.img.gotoAndStop((12 + _arg1.offset));
break;
case 13:
_arg1.y = (_arg1.y + 8);
_arg1.mstr.img.gotoAndStop((5 + _arg1.offset));
break;
case 21:
_arg1.moveframe = 0;
_arg1.actionframe = -1;
_arg1.eaction = "";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "supercombo"){
switch (_arg1.actionframe){
case 0:
case 12:
case 20:
case 28:
case 36:
_arg1.mstr.img.gotoAndStop((6 + _arg1.offset));
_arg1.mstr.scaleX = -1;
_local7 = _arg1.mstr.bbKick;
_local4 = true;
break;
case 8:
case 16:
case 24:
case 32:
_arg1.mstr.img.gotoAndStop((7 + _arg1.offset));
_local7 = _arg1.mstr.bbKick;
if (_local7.hitTestObject(player.mstr.bbHurt)){
_local10 = true;
};
_local4 = true;
_arg1.mstr.scaleX = 1;
break;
case 37:
_arg1.mstr.img.gotoAndStop((7 + _arg1.offset));
break;
case 45:
_arg1.moveframe = 0;
_arg1.actionframe = -1;
_arg1.eaction = "";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "dead"){
if (_arg1.offset > 0){
if (_arg1.mstr.img.currentFrame != (17 + _arg1.offset)){
_arg1.actionframe = 0;
};
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop((17 + _arg1.offset));
break;
};
if (_arg1.actionframe > 24){
_arg1.y = (_arg1.y - 1);
_arg1.alpha = (_arg1.alpha - 0.01);
};
if (_arg1.alpha <= 0){
_arg1.eaction = "deactive";
_arg1.visible = false;
};
_arg1.actionframe++;
} else {
_arg1.mstr.img.gotoAndStop(17);
nmedeadani(_arg1);
};
};
};
};
};
};
};
};
};
};
};
};
if (_local4){
if (player.ducking){
_local8 = player.mstr.bbduck;
} else {
_local8 = player.mstr.bbHurt;
};
if (((_local7.hitTestObject(_local8)) || (_local10))){
if (_arg1.eaction == "supercombo"){
changenrg(-3);
if (_arg1.actionframe == 37){
hurtplayer(32);
} else {
hurtplayer(0);
};
} else {
changenrg(-10);
hurtplayer(16);
};
};
};
if (((_local3) && ((_arg1.moveframe >= 4)))){
if (_arg1.mstr.img.currentFrame == (1 + _arg1.offset)){
_arg1.mstr.img.nextFrame();
} else {
_arg1.mstr.img.gotoAndStop((1 + _arg1.offset));
};
_arg1.moveframe = 0;
};
}
function gripani(){
var _local1:int;
var _local2:Boolean;
if (pgripped > 0){
_local1 = 0;
while (_local1 < nmearray.length) {
if (nmearray[_local1].eaction == "grip"){
_local2 = true;
};
_local1++;
};
if (_local2){
if ((gtmr() - tmrgrip) >= 500){
if (pgripped < 4){
pgripped++;
};
tmrgrip = gtmr();
};
} else {
pgripped = 0;
};
};
}
function sylviaani(){
if ((gtmr() - bgsylvia.tmrani) >= 120){
if (bgsylvia.p1.mstr.img.currentFrame == (1 + ioffset)){
bgsylvia.p1.mstr.img.nextFrame();
} else {
bgsylvia.p1.mstr.img.prevFrame();
};
if (bgsylvia.moveframe >= 2){
bgsylvia.txtleft.visible = !(bgsylvia.txtleft.visible);
bgsylvia.moveframe = -1;
};
switch (bgsylvia.revolutions){
case 0:
case 22:
playsound(sfxlaugh);
break;
case 44:
bgsylvia.txtright.visible = true;
playsound(sfxlaugh);
break;
case 76:
flipmode("continue");
break;
};
bgsylvia.revolutions++;
bgsylvia.moveframe++;
bgsylvia.tmrani = gtmr();
};
}
function userkeydown(_arg1:KeyboardEvent){
var _local2:Boolean;
var _local3:Boolean;
var _local4:int;
_local2 = false;
_local3 = false;
_local4 = 0;
if (gamestate == stateplaying){
if (((((((((((((xmasmode) || (bgfadein))) || (bgfadeout))) || (levelcomplete))) || ((paction == "timeover")))) || ((paction == "dead")))) || ((paction == "hurt")))){
return;
};
if (pgripped <= 0){
switch (_arg1.keyCode){
case keyright:
holdingr = true;
if ((((((((paction == "kick")) || ((paction == "punch")))) || ((paction == "dkick")))) || ((paction == "dpunch")))){
changescale(-1);
};
holdingl = false;
break;
case keyleft:
holdingl = true;
if ((((((((paction == "kick")) || ((paction == "punch")))) || ((paction == "dkick")))) || ((paction == "dpunch")))){
changescale(1);
};
holdingr = false;
break;
case keydown:
holdingd = true;
holdingu = false;
break;
case keyup:
holdingu = true;
if ((((paction == "")) && ((player.jumping == false)))){
if (holdingl){
pjumpdir = -1;
} else {
if (holdingr){
pjumpdir = 1;
} else {
pjumpdir = 0;
};
};
pjumpframe = 0;
player.jumping = true;
player.ducking = false;
};
break;
case keyz:
case 65:
if ((((((paction == "")) || ((paction == "dkick")))) || ((paction == "kick")))){
if (((holdingd) && (!(player.jumping)))){
if ((((((paction == "")) || ((paction == "dkick")))) || ((paction == "kick")))){
if ((((((paction == "kick")) || ((paction == "dkick")))) && ((pactionframe < 2)))){
return;
};
if (paction == ""){
preaction = false;
} else {
preaction = true;
};
paction = "dkick";
_local2 = true;
};
} else {
if (player.jumping){
if ((((pjumpframe >= 3)) && ((pjumpframe < 10)))){
paction = "jkick";
_local2 = true;
};
} else {
if (!holdingd){
if ((((((paction == "")) || ((paction == "kick")))) || ((paction == "dkick")))){
if ((((((paction == "kick")) || ((paction == "dkick")))) && ((pactionframe < 2)))){
return;
};
if (paction == ""){
preaction = false;
} else {
preaction = true;
};
paction = "kick";
_local2 = true;
};
};
};
};
if (_local2){
tmrpaction = 0;
pactionframe = -1;
};
};
break;
case keyx:
case 83:
if ((((((paction == "")) || ((paction == "dpunch")))) || ((paction == "punch")))){
if (((holdingd) && (!(player.jumping)))){
if ((((((paction == "")) || ((paction == "dpunch")))) || ((paction == "punch")))){
if ((((((paction == "punch")) || ((paction == "dpunch")))) && ((pactionframe < 2)))){
return;
};
if (paction == ""){
preaction = false;
} else {
preaction = true;
};
paction = "dpunch";
_local2 = true;
};
} else {
if (player.jumping){
if ((((pjumpframe >= 3)) && ((pjumpframe < 10)))){
paction = "jpunch";
_local2 = true;
};
} else {
if (!holdingd){
if ((((((paction == "")) || ((paction == "punch")))) || ((paction == "dpunch")))){
if ((((((paction == "punch")) || ((paction == "dpunch")))) && ((pactionframe < 2)))){
return;
};
if (paction == ""){
preaction = false;
} else {
preaction = true;
};
paction = "punch";
_local2 = true;
};
};
};
};
if (_local2){
tmrpaction = 0;
pactionframe = -1;
};
};
break;
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
if (!gamepaused){
playmusic((_arg1.keyCode - 49), true);
} else {
bgintro.intromusic = (_arg1.keyCode - 49);
};
break;
};
} else {
switch (_arg1.keyCode){
case keyright:
holdingr = true;
holdingl = false;
break;
case keyleft:
holdingl = true;
holdingr = false;
break;
case keydown:
holdingd = true;
holdingu = false;
break;
};
if (_arg1.keyCode != lastkey){
pgripped--;
_local3 = true;
lastkey = _arg1.keyCode;
};
};
if (_arg1.keyCode == keyp){
if (((((((!((paction == "dead"))) && (!(levelcomplete)))) && (!(bgfadein)))) && (!(bgfadeout)))){
pausetoggle();
} else {
if (gamepaused){
pausetoggle();
};
};
};
if (((_local3) && ((pgripped <= 0)))){
_local4 = 0;
while (_local4 < nmearray.length) {
if (nmearray[_local4].eaction == "grip"){
nmearray[_local4].eaction = "dead";
};
_local4++;
};
};
};
}
function pipeani(_arg1:cpipe){
_arg1.x = (_arg1.x - ((playermovechunk + 4) * _arg1.img.scaleX));
_arg1.img.rotation = (_arg1.img.rotation - (20 * _arg1.img.scaleX));
if (((_arg1.bbHit.hitTestObject(player.mstr.bbHurt)) && (_arg1.visible))){
if ((((_arg1.loc == "high")) && (player.ducking))){
return;
};
obloodstar.x = (_arg1.x + (8 * _arg1.img.scaleX));
obloodstar.y = (_arg1.y - 8);
reset(obloodstar);
tmrbloodstar = gtmr();
obloodstar.visible = true;
_arg1.visible = false;
hurtplayer(0);
changenrg(-15);
};
}
function treeani(_arg1:DisplayObject){
var _local2:Point;
if (_arg1.eaction == ""){
_arg1.actionframe = 0;
_arg1.eaction = "fire";
playsound(sfxtree);
};
if (_arg1.eaction == "fire"){
if (_arg1.moveframe >= 2){
switch (_arg1.actionframe){
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
_arg1.mstr.img.nextFrame();
if (_arg1.actionframe == 0){
if (player.x < _arg1.x){
_arg1.mstr.scaleX = 1;
} else {
_arg1.mstr.scaleX = -1;
};
};
break;
case 10:
_arg1.mstr.img.nextFrame();
_arg1.mstr.img.nextFrame();
if (((_arg1.mstr.bbfire.hitTestObject(player.mstr.bbHurt)) && (!(_arg1.struck)))){
hurtplayer(0);
_arg1.struck = true;
changenrg(-20);
};
break;
case 11:
case 12:
case 13:
if (((_arg1.mstr.bbfire.hitTestObject(player.mstr.bbHurt)) && (!(_arg1.struck)))){
hurtplayer(0);
_arg1.struck = true;
changenrg(-20);
};
break;
case 14:
_arg1.mstr.img.gotoAndStop(9);
break;
case 18:
_arg1.actionframe = -1;
_arg1.eaction = "dead";
break;
};
_arg1.moveframe = -1;
_arg1.actionframe++;
};
_arg1.moveframe++;
} else {
if (_arg1.eaction == "dead"){
if (_arg1.mstr.img.currentFrame > 1){
if (_arg1.moveframe >= 4){
if (_arg1.mstr.img.currentFrame < 11){
_arg1.mstr.img.gotoAndStop(11);
} else {
if (_arg1.mstr.img.currentFrame < 16){
_arg1.mstr.img.nextFrame();
} else {
if (_arg1.mstr.img.currentFrame >= 16){
_arg1.visible = false;
_arg1.eaction = "deactive";
};
};
};
_arg1.moveframe = -1;
};
_arg1.moveframe++;
} else {
opop.x = (_arg1.x + 16);
opop.y = (_arg1.y + 50);
tmrpop = gtmr();
opop.visible = true;
_arg1.visible = false;
_arg1.eaction = "deactive";
};
};
};
}
function gripperani(_arg1:DisplayObject, _arg2:int){
var _local3:int;
if (_arg1.eaction == ""){
_arg1.x = (_arg1.x - ((playermovechunk + 2) * _arg1.mstr.scaleX));
if (Math.abs((player.x - _arg1.x)) <= 140){
_arg1.suboffset = 2;
};
if (_arg1.mstr.bbHit.hitTestObject(player.mstr.bbHurt)){
_arg1.mstr.img.gotoAndStop((5 + _arg1.superoffset));
_arg1.eaction = "grip";
pgripped = 4;
tmrgrip = gtmr();
_arg1.grip = 4;
_arg1.tmrgrip = gtmr();
};
_local3 = 0;
while (_local3 < nmearray.length) {
if (((!((_local3 == _arg2))) && ((nmearray[_local3].eaction == "grip")))){
if (_arg1.mstr.bbHit.hitTestObject(nmearray[_local3].mstr.bbHit)){
_arg1.mstr.img.gotoAndStop((5 + _arg1.superoffset));
_arg1.eaction = "grip";
pgripped = 4;
tmrgrip = gtmr();
_arg1.grip = 4;
_arg1.tmrgrip = gtmr();
};
};
_local3++;
};
if (((((gtmr() - _arg1.tmrani) >= 120)) && ((_arg1.eaction == "")))){
if (((_arg1.mstr.img.currentFrame - _arg1.suboffset) - _arg1.superoffset) == 1){
_arg1.mstr.img.gotoAndStop(((2 + _arg1.suboffset) + _arg1.superoffset));
} else {
_arg1.mstr.img.gotoAndStop(((1 + _arg1.suboffset) + _arg1.superoffset));
};
_arg1.tmrani = gtmr();
};
} else {
if (_arg1.eaction == "run"){
nmerun(_arg1);
} else {
if (_arg1.eaction == "dead"){
nmedeadani(_arg1);
};
};
};
}
function changenrg(_arg1:Number){
if (testmodo){
return;
};
if (mothd){
playsound(sfxcane);
mothd = false;
} else {
if (snakd){
playsound(sfxsnake);
snakd = false;
} else {
playsound(sfxhurt);
};
};
if ((((r("iteration") > 1)) && ((_arg1 < 0)))){
_arg1 = (_arg1 * r("iteration"));
};
rnrg = (rnrg + (_arg1 * 3.42));
if (rnrg < 0){
rnrg = 0;
};
bgplayfield.lifebar.life.width = Math.floor((rnrg / 3.42));
if ((((rnrg <= 0)) && (!((paction == "dead"))))){
playsound(sfxdead);
paction = "dead";
player.jumping = false;
player.ducking = false;
pjumpframe = 0;
player.mstr.img.gotoAndStop((17 + player.offset));
return;
};
}
function jhfallani(_arg1:DisplayObject){
if (_arg1.actionframe < 3){
_arg1.y = (_arg1.y - 4);
} else {
_arg1.y = (_arg1.y + 8);
};
_arg1.img.rotation = (_arg1.img.rotation - 15);
_arg1.x = (_arg1.x - 4);
_arg1.actionframe++;
}
function changetimer(_arg1:int){
var _local2:String;
if (testmodo){
return;
};
if (((!(levelcomplete)) && (!((paction == "dead"))))){
if (pgripped > 0){
soundlessnrg(-1);
};
};
if ((((rlvltimer <= 0)) && (!((paction == "dead"))))){
paction = "dead";
player.ducking = false;
player.jumping = false;
player.mstr.img.gotoAndStop((17 + player.offset));
return;
};
if (paction == "dead"){
return;
};
_local2 = "";
if (lvltimer != Math.floor((rlvltimer / 3.42))){
rlvltimer = 0;
lvltimer = 0;
} else {
rlvltimer = (rlvltimer + (_arg1 * 3.42));
lvltimer = (rlvltimer / 3.42);
};
_local2 = (lvltimer + "");
switch (_local2.length){
case 3:
_local2 = ("0" + _local2);
break;
case 2:
_local2 = ("00" + _local2);
break;
case 1:
_local2 = ("000" + _local2);
break;
};
bgplayfield.txttime.text = _local2;
}
function RENDER(){
var _local4:SoundTransform;
var _local5:DisplayObject;
var _local6:String;
var _local1:int;
var _local2:Boolean;
var _local3:int;
_local1 = 0;
while (_local1 < medalsarray.length) {
reset(medalsarray[_local1]);
_local1++;
};
_local1 = (medalsarray.length - 1);
while (_local1 >= 0) {
medalani(medalsarray[_local1]);
if (medalsarray[_local1].x > 0x0200){
removeChild(medalsarray[_local1]);
medalsarray.splice(_local1, 1);
};
_local1--;
};
if (gamestate == stateloading){
if (currentFrame == 3){
gatherlocalstorage();
init();
};
} else {
if (gamestate == statetitle){
if ((gtmr() - bgtitle.tmrtree) >= 300){
if (bgtitle.tree1.currentFrame == 3){
bgtitle.tree1.gotoAndStop(1);
bgtitle.tree2.gotoAndStop(1);
} else {
bgtitle.tree1.nextFrame();
bgtitle.tree2.nextFrame();
};
bgtitle.tmrtree = gtmr();
};
} else {
if (gamestate == statelogo){
logoani();
} else {
if (gamestate == statesylvia){
sylviaani();
} else {
if (gamestate == stateunlock){
unlockani();
} else {
if (gamestate == statehsentry){
if (bghsentry.fadeout){
if ((gtmr() - bghsentry.fadetmr) >= 150){
if (bghsentry.alpha > 0){
bghsentry.alpha = (bghsentry.alpha - 0.1);
} else {
flipmode("gameover");
};
bghsentry.fadeframe++;
bghsentry.fadetmr = gtmr();
};
};
} else {
if (gamestate == stateendings){
if ((gtmr() - bgends.tmrend) >= endsint){
endsani();
bgends.tmrend = gtmr();
};
if ((gtmr() - tmrendsani) >= 30){
endsanis();
tmrendsani = gtmr();
};
} else {
if (gamestate == stateendingj){
endjani();
} else {
if (gamestate == stateendingr){
endrani();
} else {
if (gamestate == stategameover){
if ((gtmr() - bggameover.tmrtop) >= 90){
bggameover.shifttop();
bggameover.tmrtop = gtmr();
};
if ((gtmr() - bggameover.tmrbot) >= 120){
bggameover.shiftbot();
bggameover.tmrbot = gtmr();
};
if (((((gtmr() - bggameover.tmrani) >= goint)) && (!(bggameover.br.visible)))){
gameoverani();
bggameover.tmrani = gtmr();
} else {
if (((bggameover.br.visible) && (bggameover.fadeout))){
if ((gtmr() - bggameover.tmrani) >= 60){
if (bggameover.blak.alpha >= 1){
if ((gtmr() - bggameover.tmrani) >= 480){
bgmsoundchannel.stop();
flipmode("title");
};
} else {
if (bgmvolume > 0){
bgmvolume = (bgmvolume - 5);
if (bgmvolume < 0){
bgmvolume = 0;
};
};
_local4 = new SoundTransform((bgmvolume / 100), 0);
bgmsoundchannel.soundTransform = _local4;
bggameover.blak.alpha = (bggameover.blak.alpha + 0.05);
bggameover.tmrani = gtmr();
};
};
};
};
} else {
if (gamestate == stateplaying){
if (gamepaused){
return;
};
if (((!((paction == "dead"))) && (!(bgfadein)))){
flashani();
};
gripani();
if (ostrikestar.visible){
strikeani();
};
if (obloodstar.visible){
bloodstarani();
};
if (opop.visible){
popani();
};
if (xmasmode){
xmasani();
natani();
} else {
if (levelcomplete){
lvlcompleteani();
} else {
if (bgfadein){
if (r("level") == 1){
fireani();
};
if ((gtmr() - tmrfade) >= 120){
if (bgblak.alpha > 0){
bgblak.alpha = (bgblak.alpha - 0.05);
};
fadeframe++;
tmrfade = gtmr();
};
if (fadeframe > 20){
tmrwave = gtmr();
bgblak.visible = false;
bgfadein = false;
};
} else {
if (bgfadeout){
if ((gtmr() - tmrfade) >= 120){
if (bgblak.alpha < 1){
bgblak.alpha = (bgblak.alpha + 0.05);
};
fadeframe++;
tmrfade = gtmr();
if (bgmvolume > 0){
bgmvolume = (bgmvolume - 5);
if (bgmvolume < 0){
bgmvolume = 0;
};
};
_local4 = new SoundTransform((bgmvolume / 100), 0);
bgmsoundchannel.soundTransform = _local4;
};
if (fadeframe > 23){
bgfadeout = false;
if (paction != "dead"){
switch (player.offset){
case 0:
flipmode("endings");
break;
case 17:
flipmode("endingj");
break;
case 34:
flipmode("endingr");
break;
};
} else {
changelevel(-1);
bgplayfield.visible = false;
endlvlreset();
if (r("lives") > 0){
nextlvl(true);
} else {
nextlvl(false);
};
changelife(-1);
};
};
} else {
if (paction != "dead"){
if ((gtmr() - tmrtimer) >= 50){
changetimer(-1);
tmrtimer = gtmr();
};
if (((!(waveactive)) && (((gtmr() - tmrwave) >= 2000)))){
switch (r("level")){
case 1:
if ((((bturbo.eaction == "boss")) || ((bturbo.eaction == "deactive")))){
nextwave();
};
break;
case 2:
if ((((bfarkus.eaction == "boss")) || ((bfarkus.eaction == "deactive")))){
nextwave();
};
break;
case 3:
if ((((bjack.eaction == "boss")) || ((bjack.eaction == "deactive")))){
nextwave();
};
break;
case 4:
if ((((brudolph.eaction == "boss")) || ((brudolph.eaction == "deactive")))){
nextwave();
};
break;
case 5:
if (bxmas.eaction == "boss"){
nextwave();
};
break;
};
};
_local1 = 0;
while (_local1 < nmearray.length) {
if (nmearray[_local1].eaction == "waiting"){
if ((gtmr() - tmrwaveout) >= nmearray[_local1].waittime){
setwaveside(nmearray[_local1]);
};
};
_local1++;
};
_local1 = (nmearray.length - 1);
while (_local1 >= 0) {
if (nmearray[_local1].eaction == "deactive"){
_local5 = nmearray[_local1];
nmearray.splice(_local1, 1);
_local5.enabled = false;
tmrwave = gtmr();
} else {
if ((((nmearray[_local1].etype == "gripper")) || ((nmearray[_local1].etype == "hopper")))){
_local2 = false;
} else {
if ((((nmearray[_local1].etype == "dad")) || ((nmearray[_local1].etype == "mom")))){
_local3++;
};
};
};
_local1--;
};
if (_local3 >= 2){
_local2 = false;
};
if (_local2){
waveactive = false;
};
};
if (((((!((paction == "hurt"))) && (!((paction == "dead"))))) && (!((paction == "timeover"))))){
santaaction();
};
if ((gtmr() - tmraction) >= moveinterval){
moveobjects();
moveenemies();
if ((((((paction == "")) || ((paction == "jkick")))) || ((paction == "jpunch")))){
santaani();
};
if (paction == "hurt"){
if (((((gtmr() - player.tmrani) >= 150)) && ((hdistance <= 0)))){
paction = "";
if (((!(holdingd)) || (player.jumping))){
player.ducking = false;
player.mstr.img.gotoAndStop((1 + player.offset));
} else {
player.ducking = true;
player.mstr.img.gotoAndStop((8 + player.offset));
};
} else {
if (hdistance > 0){
bgmove((8 * hdir), false);
hdistance = (hdistance - 8);
};
};
};
if (paction == "dead"){
_local6 = "";
if ((gtmr() - player.tmrani) >= 60){
player.x = (player.x + (player.mstr.scaleX * 8));
player.y = (player.y + 16);
if (player.y >= 600){
_local1 = 0;
while (_local1 < nmearray.length) {
switch (nmearray[_local1].etype){
case "turbo":
case "farkus":
case "jack":
case "rudolph":
case "xmas":
if (((((((!((nmearray[_local1].eaction == "dead"))) && (!((nmearray[_local1].eaction == "dying"))))) && (!((nmearray[_local1].eaction == "boss"))))) && (!((nmearray[_local1].eaction == "deactive"))))){
_local6 = nmearray[_local1].etype;
};
break;
};
_local1++;
};
if (_local6 != ""){
switch (_local6){
case "turbo":
case "jack":
playsound(sfxlaughlow);
break;
case "farkus":
case "rudolph":
playsound(sfxlaughhigh);
break;
case "xmas":
playsound(sfxlaugh);
break;
};
fadeframe = -5;
} else {
fadeframe = 0;
};
bgblak.alpha = 0;
bgblak.visible = true;
reset(bgblak);
bgmsoundchannel.stop();
bgfadeout = true;
};
player.tmrani = gtmr();
};
};
if (r("level") == 1){
fireani();
} else {
if (r("level") == 5){
natani();
};
};
tmraction = gtmr();
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
function bgmove(_arg1:int, _arg2:Boolean){
var _local3:Boolean;
var _local4:Boolean;
var _local5:int;
var _local6:int;
var _local7:int;
_local3 = true;
_local4 = false;
_local5 = 0;
_local6 = -256;
_local7 = 0;
if (_arg2){
bgplayfield.bg.x = _arg1;
bgplayfield.bgcoverup.x = _arg1;
} else {
if (pgripped > 0){
return;
};
_local7 = 0;
while (_local7 < nmearray.length) {
if (((((((nmearray[_local7].visible) && (!((nmearray[_local7].eaction == "dead"))))) && (!((nmearray[_local7].eaction == "dying"))))) && (!((nmearray[_local7].eaction == "deactive"))))){
if ((((nmearray[_local7].etype == "snakeegg")) || ((nmearray[_local7].etype == "mistle")))){
_local4 = true;
};
if ((((nmearray[_local7].etype == "tree")) && ((nmearray[_local7].y < ((targety + nmearray[_local7].ty) - 32))))){
_local4 = true;
};
if ((((nmearray[_local7].etype == "rudolph")) && ((nmearray[_local7].eaction == "block")))){
if (player.mstr.bbHurt.hitTestObject(nmearray[_local7].mstr.bbHit)){
if (_arg1 < 0){
return;
};
_local4 = true;
} else {
_local4 = true;
};
};
if ((((paction == "hurt")) && ((hdistance > 0)))){
_local4 = true;
};
if (!_local4){
if (player.mstr.bbHurt.hitTestObject(nmearray[_local7].mstr.bbHurt)){
if ((((nmearray[_local7].x < player.x)) && ((_arg1 > 0)))){
return;
};
if ((((nmearray[_local7].x > player.x)) && ((_arg1 < 0)))){
return;
};
};
};
};
_local4 = false;
_local7++;
};
switch (r("level")){
case 1:
case 3:
case 5:
if (r("level") == 5){
_local6 = 0;
};
if (bgplayfield.bg.x <= -3168){
bgplayfield.bg.x = -3168;
bgplayfield.bgcoverup.x = -3168;
if (_arg1 < 0){
if (player.x < 483){
_local5 = (_arg1 * -1);
};
_local3 = false;
} else {
if (player.x > 251){
_local5 = (_arg1 * -1);
_local3 = false;
};
};
} else {
if (bgplayfield.bg.x >= _local6){
bgplayfield.bg.x = _local6;
bgplayfield.bgcoverup.x = _local6;
if (_arg1 < 0){
if (player.x < 251){
_local5 = (_arg1 * -1);
_local3 = false;
};
} else {
if (player.x > 0){
_local5 = (_arg1 * -1);
} else {
player.x = 0;
endlvlreset();
};
_local3 = false;
};
};
};
break;
case 2:
case 4:
if (r("level") == 4){
if ((((bgplayfield.bg.x <= -1456)) && (!(midlevel)))){
midlevel = true;
};
} else {
if ((((bgplayfield.bg.x <= -1968)) && (!(midlevel)))){
midlevel = true;
};
};
if (bgplayfield.bg.x >= 0){
bgplayfield.bg.x = 0;
bgplayfield.bgcoverup.x = 0;
if (_arg1 > 0){
if (player.x > 0){
_local5 = (_arg1 * -1);
};
_local3 = false;
} else {
if (player.x < 251){
_local5 = (_arg1 * -1);
_local3 = false;
};
};
} else {
if (bgplayfield.bg.x <= -2912){
bgplayfield.bg.x = -2912;
bgplayfield.bgcoverup.x = -2912;
if (_arg1 > 0){
if (player.x > 251){
_local5 = (_arg1 * -1);
_local3 = false;
};
} else {
if (player.x < 483){
_local5 = (_arg1 * -1);
} else {
player.x = 483;
endlvlreset();
};
_local3 = false;
};
};
};
break;
};
if (_local3){
bgplayfield.bg.x = (bgplayfield.bg.x + _arg1);
bgplayfield.bgcoverup.x = (bgplayfield.bgcoverup.x + _arg1);
_local7 = 0;
while (_local7 < nmearray.length) {
nmearray[_local7].x = (nmearray[_local7].x + _arg1);
_local7++;
};
_local7 = 0;
while (_local7 < pipearray.length) {
pipearray[_local7].x = (pipearray[_local7].x + _arg1);
_local7++;
};
_local7 = 0;
while (_local7 < snakearray.length) {
snakearray[_local7].x = (snakearray[_local7].x + _arg1);
_local7++;
};
_local7 = 0;
while (_local7 < shardarray.length) {
shardarray[_local7].x = (shardarray[_local7].x + _arg1);
_local7++;
};
_local7 = 0;
while (_local7 < candyrangarray.length) {
candyrangarray[_local7].x = (candyrangarray[_local7].x + _arg1);
_local7++;
};
_local7 = 0;
while (_local7 < jhthrowarray.length) {
jhthrowarray[_local7].x = (jhthrowarray[_local7].x + _arg1);
_local7++;
};
_local7 = 0;
while (_local7 < jhfallarray.length) {
jhfallarray[_local7].x = (jhfallarray[_local7].x + _arg1);
_local7++;
};
_local7 = 0;
while (_local7 < laserarray.length) {
laserarray[_local7].x = (laserarray[_local7].x + _arg1);
_local7++;
};
if (ostrikestar.visible){
ostrikestar.x = (ostrikestar.x + _arg1);
};
if (obloodstar.visible){
obloodstar.x = (obloodstar.x + _arg1);
};
if (opop.visible){
opop.x = (opop.x + _arg1);
};
if ((((((((r("level") == 5)) && ((bxmas.eaction == "boss")))) && (!(_arg2)))) && ((bgplayfield.bg.x >= -147)))){
xmasframe = 0;
xmasmode = true;
};
} else {
player.x = (player.x + _local5);
};
};
}
private function openHandler(_arg1:Event):void{
trace(("openHandler: " + _arg1));
}
function jackani(_arg1:DisplayObject, _arg2:int){
var _local6:cjackhead;
var _local3:Boolean;
var _local4:Boolean;
var _local5:int;
if (_arg1.eaction == ""){
if (_arg1.x < 96){
_arg1.eaction = "advance";
_arg1.actionframe = 0;
} else {
_local5 = randm(1, 4);
switch (_local5){
case 1:
_arg1.eaction = "advance";
break;
case 2:
_arg1.eaction = "retreat";
break;
case 3:
_arg1.eaction = "throw";
break;
case 4:
_arg1.eaction = "smash";
break;
};
_arg1.actionframe = 0;
_arg1.moveframe = 0;
};
};
if (_arg1.eaction == "advance"){
nmecheckmove(_arg1, (playermovechunk * (-1 * _arg1.mstr.scaleX)));
_arg1.moveframe++;
_arg1.actionframe++;
if (_arg1.actionframe >= 12){
_arg1.eaction = "";
};
_local3 = true;
} else {
if (_arg1.eaction == "retreat"){
_arg1.x = (_arg1.x - (playermovechunk * (-1 * _arg1.mstr.scaleX)));
_arg1.moveframe++;
_arg1.actionframe++;
if (_arg1.actionframe >= 12){
_arg1.eaction = "";
};
_local3 = true;
} else {
if (_arg1.eaction == "throw"){
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(8);
break;
case 8:
_arg1.mstr.img.nextFrame();
break;
case 16:
playsound(sfxpipe);
_arg1.mstr.img.nextFrame();
_local6 = new cjackhead();
_local6.img.scaleX = -1;
_local6.img.gotoAndStop(1);
_local6.struck = false;
_local6.actionframe = 0;
_local6.y = _arg1.y;
_local6.x = (_arg1.x + 32);
addChild(_local6);
jhthrowarray.push(_local6);
break;
case 24:
_arg1.eaction = "regrow";
_arg1.actionframe = -1;
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "smash"){
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(15);
break;
case 24:
playsound(sfxjack);
_arg1.mstr.img.nextFrame();
break;
case 32:
_arg1.mstr.img.nextFrame();
if (_arg1.mstr.bbHit.hitTestObject(player.mstr.bbHurt)){
_local4 = true;
};
break;
case 24:
case 28:
case 36:
_arg1.mstr.img.nextFrame();
if (_arg1.mstr.bbHit.hitTestObject(player.mstr.bbHurt)){
_local4 = true;
};
break;
case 40:
case 44:
case 48:
_arg1.mstr.img.nextFrame();
break;
case 52:
_arg1.eaction = "";
_arg1.actionframe = -1;
_arg1.mstr.img.gotoAndStop(1);
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "regrow"){
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(11);
break;
case 6:
case 12:
case 18:
_arg1.mstr.img.nextFrame();
break;
case 30:
_arg1.eaction = "";
_arg1.actionframe = -1;
_arg1.mstr.img.gotoAndStop(1);
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "dead"){
if (_arg1.mstr.img.currentFrame < 24){
_arg1.actionframe = 0;
};
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(24);
break;
case 4:
case 8:
case 12:
case 16:
case 20:
case 24:
case 28:
_arg1.mstr.img.nextFrame();
break;
case 56:
_arg1.mstr.img.nextFrame();
_arg1.eaction = "dying";
break;
case 60:
case 64:
case 68:
case 72:
case 76:
case 80:
case 84:
case 88:
case 92:
case 96:
_arg1.alpha = (_arg1.alpha - 0.1);
break;
case 97:
_arg1.eaction = "deactive";
_arg1.visible = false;
break;
};
_arg1.actionframe++;
};
};
};
};
};
};
if ((((_arg1.moveframe >= 4)) && (_local3))){
if (_arg1.mstr.img.currentFrame == 6){
_arg1.mstr.img.gotoAndStop(1);
} else {
_arg1.mstr.img.nextFrame();
};
_arg1.moveframe = 0;
};
if (_local4){
hurtplayer(0);
changenrg(-10);
};
}
function nmedeadani(_arg1:DisplayObject){
switch (_arg1.etype){
case "gripper":
_arg1.mstr.img.gotoAndStop((6 + _arg1.superoffset));
break;
case "dad":
case "turbo":
case "mom":
_arg1.mstr.img.gotoAndStop((7 + _arg1.superoffset));
break;
case "booster":
_arg1.mstr.img.gotoAndStop(2);
break;
case "hopper":
_arg1.mstr.img.gotoAndStop((5 + _arg1.superoffset));
break;
case "farkus":
_arg1.mstr.img.gotoAndStop(10);
break;
};
if ((gtmr() - _arg1.tmrani) >= 60){
_arg1.x = (_arg1.x + (_arg1.mstr.scaleX * 8));
_arg1.y = (_arg1.y + 16);
if (_arg1.y >= 600){
_arg1.eaction = "deactive";
};
_arg1.tmrani = gtmr();
};
}
function changelevel(_arg1:Number){
rlevel = (rlevel + (_arg1 * 3.42));
level = r("level");
if (r("level") == 6){
changeiteration(1);
rlevel = 3.42;
level = 1;
};
}
function popani(){
if ((gtmr() - tmrpop) >= 150){
opop.visible = false;
};
}
private function configureListeners(_arg1:IEventDispatcher):void{
_arg1.addEventListener(Event.COMPLETE, scoredld);
_arg1.addEventListener(Event.OPEN, openHandler);
_arg1.addEventListener(ProgressEvent.PROGRESS, progressHandler);
_arg1.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_arg1.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
_arg1.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
}
function changetopscore(_arg1:int){
var _local2:String;
_local2 = "";
_local2 = (_arg1 + "");
switch (_local2.length){
case 5:
_local2 = ("0" + _local2);
break;
case 4:
_local2 = ("00" + _local2);
break;
case 3:
_local2 = ("000" + _local2);
break;
case 2:
_local2 = ("0000" + _local2);
break;
case 1:
_local2 = ("00000" + _local2);
break;
};
if (_local2.length > 6){
_local2 = _local2.substr((_local2.length - 6), 6);
};
bgplayfield.txttop.text = ("top-" + _local2);
hiscore = _arg1;
}
function gatherlocalstorage(){
localstorage = SharedObject.getLocal("SANTA-FU");
if (localstorage.size > 0){
unlockj = localstorage.data.jesus;
unlockr = localstorage.data.raptor;
};
trace(((("loaded localstorage - jesus: " + localstorage.data.jesus) + " raptor: ") + localstorage.data.raptor));
trace(localstorage.size);
}
public function unlockmedal(_arg1:String){
var _local2:Boolean;
var _local3:int;
_local2 = true;
_local3 = 0;
_local3 = 0;
while (_local3 < medalarray.length) {
if (_arg1 == medalarray[_local3]){
_local2 = false;
};
_local3++;
};
if (_local2){
NewgroundsAPI.unlockMedalByName(_arg1);
medalarray.push(_arg1);
};
}
function bosswaiting(_arg1:DisplayObject){
if (!_arg1.enabled){
_arg1.enabled = true;
};
switch (r("level")){
case 1:
case 3:
if (_arg1.x >= -180){
_arg1.eaction = "";
bosspulse();
};
break;
case 2:
case 4:
if (_arg1.x <= 700){
_arg1.eaction = "";
bosspulse();
};
break;
case 5:
break;
};
}
function setwaveside(_arg1:DisplayObject){
var _local2:int;
var _local3:int;
_local2 = 0;
_local3 = 0;
if (_arg1.enabled){
trace(_arg1);
_arg1.eaction = "deactive";
_arg1.visible = false;
return;
};
_local3 = 0;
while (_local3 < nmearray.length) {
if (((((nmearray[_local3].visible) && (!((nmearray[_local3].eaction == "dead"))))) && (!((nmearray[_local3].eaction == "deactive"))))){
if (nmearray[_local3].etype == "dad"){
if (nmearray[_local3].y < 448){
if (nmearray[_local3].eaction != "retreat"){
_local2 = (nmearray[_local3].mstr.scaleX * -1);
} else {
_local2 = nmearray[_local3].mstr.scaleX;
};
break;
};
};
};
_local3++;
};
if (_arg1.etype == "mom"){
switch (r("level")){
case 1:
case 3:
case 5:
_local2 = -1;
break;
case 2:
case 4:
_local2 = 1;
break;
};
};
if (_arg1.etype == "cane"){
if (randm(1, 2) == 1){
_local2 = 1;
} else {
_local2 = -1;
};
};
if (_local2 == 0){
switch (r("level")){
case 1:
case 3:
case 5:
if (bgplayfield.bg.x >= -256){
_local2 = 1;
} else {
if (bgplayfield.bg.x <= -3168){
_local2 = -1;
} else {
if (randm(1, 4) == 1){
_local2 = (player.mstr.scaleX * -1);
} else {
_local2 = player.mstr.scaleX;
};
};
};
break;
case 2:
case 4:
if (bgplayfield.bg.x >= 0){
_local2 = 1;
} else {
if (bgplayfield.bg.x <= -2192){
_local2 = -1;
} else {
if (randm(1, 4) == 1){
_local2 = (player.mstr.scaleX * -1);
} else {
_local2 = player.mstr.scaleX;
};
};
};
break;
};
};
_arg1.mstr.scaleX = _local2;
if (_arg1.eaction == "drop"){
switch (_arg1.etype){
case "snakeegg":
case "mistle":
_arg1.y = 80;
break;
case "tree":
_arg1.y = 19;
break;
};
_arg1.x = (player.x + (80 * randm(-1, 1)));
} else {
if (_arg1.etype == "cane"){
switch (_arg1.loc){
case 1:
_arg1.y = 140;
break;
case 2:
_arg1.y = 224;
break;
case 3:
_arg1.y = 368;
break;
};
if (_local2 == 1){
_arg1.x = 525;
_arg1.mstr.scaleX = 1;
} else {
_arg1.x = -55;
_arg1.mstr.scaleX = -1;
};
_arg1.waittime = 0;
_arg1.eaction = "";
} else {
_arg1.y = (targety + _arg1.ty);
if (_local2 == 1){
_arg1.x = 525;
} else {
_arg1.x = -55;
};
_arg1.waittime = 0;
_arg1.eaction = "";
};
};
if (_arg1.etype == "hopper"){
_arg1.minienable = true;
};
_arg1.enabled = true;
_arg1.actionframe = 0;
_arg1.mstr.rotation = 0;
_arg1.struck = false;
_arg1.tmrex1 = gtmr();
_arg1.tmrex2 = gtmr();
_arg1.tmrex3 = gtmr();
_arg1.visible = true;
}
function nmerun(_arg1:DisplayObject){
_arg1.x = (_arg1.x - ((playermovechunk + 2) * _arg1.mstr.scaleX));
if (_arg1.moveframe >= 4){
if ((_arg1.mstr.img.currentFrame - _arg1.superoffset) == 1){
_arg1.mstr.img.gotoAndStop((2 + _arg1.superoffset));
} else {
_arg1.mstr.img.gotoAndStop((1 + _arg1.superoffset));
};
_arg1.moveframe = -1;
};
_arg1.moveframe++;
if ((((_arg1.x < -100)) || ((_arg1.x > 612)))){
_arg1.eaction = "deactive";
_arg1.visible = false;
};
}
public function playsound(_arg1:int){
var _local2:SoundTransform;
if (!sfxon){
return;
};
_local2 = new SoundTransform(1, 0);
var _local3:SoundChannel = soundarray[_arg1].play(0, 0, _local2);
}
function changenmenrg(_arg1:Number){
rnmenrg = (rnmenrg + (_arg1 * 3.42));
if (rnmenrg < 0){
rnmenrg = 0;
};
bgplayfield.nmebar.life.width = Math.floor((rnmenrg / 3.42));
if (rnmenrg <= 0){
return;
};
}
function xmasani(){
var _local1:int;
if ((gtmr() - tmrxmas) >= xmasint){
switch (xmasframe){
case 0:
_local1 = 0;
while (_local1 < nmearray.length) {
if (nmearray[_local1].etype != "xmas"){
nmearray[_local1].actionframe = 0;
nmearray[_local1].eaction = "dead";
};
_local1++;
};
xmasint = 120;
(bgplayfield.bg.bgnat.light.alpha + 0.05);
break;
case 1:
playsound(sfxlight);
bgplayfield.bg.bgnat.light.alpha = (bgplayfield.bg.bgnat.light.alpha + 0.05);
break;
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
bgplayfield.bg.bgnat.light.alpha = (bgplayfield.bg.bgnat.light.alpha + 0.05);
break;
case 13:
bgplayfield.bg.bgnat.baby.alpha = (bgplayfield.bg.bgnat.baby.alpha - 0.1);
break;
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
bgplayfield.bg.bgnat.baby.alpha = (bgplayfield.bg.bgnat.baby.alpha - 0.1);
break;
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
case 29:
case 30:
case 31:
case 32:
bgplayfield.bg.bgnat.light.alpha = (bgplayfield.bg.bgnat.light.alpha - 0.05);
break;
case 33:
bxmas.x = 15;
bxmas.visible = true;
break;
case 34:
playsound(sfxjesus);
bxmas.alpha = (bxmas.alpha + 0.1);
break;
case 35:
case 36:
case 37:
case 38:
case 39:
case 40:
case 41:
case 42:
case 43:
bxmas.alpha = (bxmas.alpha + 0.1);
break;
case 44:
bgplayfield.bg.bgnat.suboffset = 6;
if (player.offset == 34){
bgplayfield.bg.bgnat.superoffset = 2;
};
bxmas.eaction = "";
xmasmode = false;
if (nmearray.length > 0){
playsound(sfxhit);
};
break;
};
xmasframe++;
tmrxmas = gtmr();
};
}
function savelocalstorage(){
localstorage.data.jesus = unlockj;
localstorage.data.raptor = unlockr;
var flushStatus:String;
try {
flushStatus = localstorage.flush();
} catch(error:Error) {
trace("Error...Could not write SharedObject to disk");
};
if (flushStatus != null){
switch (flushStatus){
case SharedObjectFlushStatus.PENDING:
trace("Requesting permission to save object..");
localstorage.addEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
break;
case SharedObjectFlushStatus.FLUSHED:
trace("Value flushed to disk");
break;
};
};
}
function silentnrg(_arg1:Number){
if (bgplayfield.lifebar.life.width != Math.floor((rnrg / 3.42))){
rnrg = 0;
bgplayfield.lifebar.life.width = 0;
} else {
rnrg = (rnrg + (_arg1 * 3.42));
if (rnrg < 0){
rnrg = 0;
};
bgplayfield.lifebar.life.width = Math.floor((rnrg / 3.42));
};
}
function changelife(_arg1:int){
if ((rlives + _arg1) < 0){
if (r("score") > minscore){
bghsentry.txtscore.text = (r("score") + "");
bghsentry.txtname.text = "";
flipmode("hsentry");
} else {
highscorerw("read");
flipmode("gameover");
};
return;
};
rlives = (rlives + (_arg1 * 3.42));
lives = (rlives / 3.42);
if ((((lives >= 0)) && ((lives <= 9)))){
bgplayfield.txtlives.text = ("-" + lives);
};
}
function santaaction(){
var _local2:gblank;
var _local3:int;
var _local1:int;
_local3 = 120;
if (holdingd){
if ((((paction == "punch")) || ((paction == "kick")))){
player.ducking = true;
};
};
if (((!((paction == "jkick"))) && (!((paction == "jpunch"))))){
if (pactionframe <= 3){
_local3 = 70;
} else {
_local3 = 160;
};
};
if ((gtmr() - tmrpaction) >= _local3){
switch (paction){
case "kick":
if (pactionframe == 0){
if (preaction){
playsound(sfxkick);
};
player.mstr.img.gotoAndStop((7 + player.offset));
} else {
if (pactionframe == 1){
if (!preaction){
playsound(sfxkick);
};
_local2 = player.mstr.bbKick;
player.mstr.img.gotoAndStop((6 + player.offset));
} else {
if (pactionframe == 2){
player.mstr.img.gotoAndStop((7 + player.offset));
} else {
if (pactionframe == 3){
player.mstr.img.gotoAndStop((5 + player.offset));
};
};
};
};
break;
case "dkick":
if (pactionframe == 0){
if (preaction){
playsound(sfxkick);
};
player.mstr.img.gotoAndStop((11 + player.offset));
} else {
if (pactionframe == 1){
if (!preaction){
playsound(sfxkick);
};
_local2 = player.mstr.bbKneelKick;
player.mstr.img.gotoAndStop((10 + player.offset));
} else {
if (pactionframe == 2){
player.mstr.img.gotoAndStop((11 + player.offset));
} else {
if (pactionframe == 3){
if (holdingd){
player.mstr.img.gotoAndStop((8 + player.offset));
} else {
player.mstr.img.gotoAndStop((5 + player.offset));
player.ducking = false;
};
};
};
};
};
break;
case "jkick":
if (pactionframe == 0){
player.mstr.img.gotoAndStop((15 + player.offset));
_local2 = player.mstr.bbKick;
playsound(sfxjumpkick);
} else {
if (pactionframe == 1){
player.mstr.img.gotoAndStop((13 + player.offset));
} else {
if (pactionframe == 2){
if (player.mstr.img.currentFrame > (5 + player.offset)){
player.mstr.img.gotoAndStop((12 + player.offset));
};
};
};
};
break;
case "punch":
if (pactionframe == 0){
if (preaction){
playsound(sfxpunch);
};
player.mstr.img.gotoAndStop((5 + player.offset));
} else {
if (pactionframe == 1){
if (!preaction){
playsound(sfxpunch);
};
_local2 = player.mstr.bbPunch;
player.mstr.img.gotoAndStop((4 + player.offset));
} else {
if (pactionframe == 2){
player.mstr.img.gotoAndStop((5 + player.offset));
} else {
if (pactionframe == 3){
player.mstr.img.gotoAndStop((5 + player.offset));
};
};
};
};
break;
case "dpunch":
if (pactionframe == 0){
if (preaction){
playsound(sfxpunch);
};
player.mstr.img.gotoAndStop((8 + player.offset));
} else {
if (pactionframe == 1){
if (!preaction){
playsound(sfxpunch);
};
_local2 = player.mstr.bbKneelPunch;
player.mstr.img.gotoAndStop((9 + player.offset));
} else {
if (pactionframe == 2){
player.mstr.img.gotoAndStop((8 + player.offset));
} else {
if (pactionframe == 3){
if (holdingd){
player.mstr.img.gotoAndStop((8 + player.offset));
} else {
player.mstr.img.gotoAndStop((5 + player.offset));
player.ducking = false;
};
};
};
};
};
break;
case "jpunch":
if (pactionframe == 0){
player.mstr.img.gotoAndStop((14 + player.offset));
_local2 = player.mstr.bbPunch;
playsound(sfxpunch);
} else {
if (pactionframe == 1){
player.mstr.img.gotoAndStop((13 + player.offset));
} else {
if (pactionframe == 2){
if ((((player.mstr.img.currentFrame > (5 + player.offset))) && (player.jumping))){
player.mstr.img.gotoAndStop((12 + player.offset));
};
};
};
};
break;
};
if (_local2 != null){
checkattackcollision(_local2);
};
if (pactionframe >= 3){
paction = "";
};
pactionframe++;
tmrpaction = gtmr();
};
}
function farkusani(_arg1:DisplayObject, _arg2:int){
var _local4:ccandyrang;
var _local6:Point;
var _local3:int;
var _local5:Boolean;
var _local7:Boolean;
var _local8:int = r("iteration");
if (_arg1.eaction == ""){
if (_arg1.x >= 412){
_arg1.eaction = "advance";
_arg1.actionframe = 0;
} else {
if (candyrangarray.length < _local8){
_local3 = randm(1, 5);
} else {
_local3 = randm(1, 3);
};
switch (_local3){
case 1:
_arg1.eaction = "advance";
break;
case 2:
if (_arg1.x >= 366){
_arg1.eaction = "advance";
} else {
_arg1.eaction = "retreat";
};
break;
case 3:
_arg1.eaction = "punch";
break;
case 4:
_arg1.eaction = "throwlow";
break;
case 5:
_arg1.eaction = "throwhigh";
break;
};
_arg1.actionframe = 0;
_arg1.moveframe = 0;
};
};
if (_arg1.eaction == "advance"){
nmecheckmove(_arg1, (-1 * playermovechunk));
_arg1.moveframe++;
_arg1.actionframe++;
if (_arg1.actionframe >= 12){
_arg1.eaction = "";
};
_local7 = true;
} else {
if (_arg1.eaction == "retreat"){
_arg1.x = (_arg1.x + playermovechunk);
_arg1.moveframe++;
_arg1.actionframe++;
if (_arg1.actionframe >= 12){
_arg1.eaction = "";
};
_local7 = true;
} else {
if (_arg1.eaction == "throwhigh"){
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(3);
break;
case 20:
_arg1.mstr.img.nextFrame();
_local4 = new ccandyrang();
_local4.loc = "high";
_local4.x = (_arg1.x - (12 * _arg1.mstr.scaleX));
_local4.y = _arg1.y;
addChild(_local4);
candyrangarray.push(_local4);
break;
case 24:
_arg1.mstr.img.gotoAndStop(1);
_arg1.eaction = "";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "throwlow"){
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(5);
break;
case 20:
_arg1.mstr.img.nextFrame();
_local4 = new ccandyrang();
_local4.loc = "low";
_local4.x = (_arg1.x - (12 * _arg1.mstr.scaleX));
_local4.y = (_arg1.y + 53);
addChild(_local4);
candyrangarray.push(_local4);
break;
case 24:
_arg1.mstr.img.gotoAndStop(1);
_arg1.eaction = "";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "punch"){
if (_arg1.moveframe > 2){
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(7);
break;
case 2:
case 4:
case 6:
case 8:
playsound(sfxfarkus);
_arg1.mstr.img.gotoAndStop(8);
if (_arg1.mstr.bbHit.hitTestObject(player.mstr.bbHurt)){
_local5 = true;
};
break;
case 3:
case 5:
case 7:
case 9:
playsound(sfxfarkus);
_arg1.mstr.img.gotoAndStop(9);
if (_arg1.mstr.bbHit.hitTestObject(player.mstr.bbHurt)){
_local5 = true;
};
break;
case 10:
_arg1.mstr.img.gotoAndStop(1);
_arg1.eaction = "retreat";
_arg1.actionframe = -1;
break;
};
_arg1.actionframe++;
_arg1.moveframe = -1;
};
_arg1.moveframe++;
} else {
if (_arg1.eaction == "dead"){
nmedeadani(_arg1);
};
};
};
};
};
};
if ((((_arg1.moveframe >= 4)) && (_local7))){
if (_arg1.mstr.img.currentFrame == 1){
_arg1.mstr.img.gotoAndStop(2);
} else {
_arg1.mstr.img.gotoAndStop(1);
};
_arg1.moveframe = 0;
};
if (_local5){
_local6 = _arg1.mstr.bbHit.localToGlobal(new Point(0, 0));
obloodstar.x = _local6.x;
obloodstar.y = _local6.y;
reset(obloodstar);
tmrbloodstar = gtmr();
obloodstar.visible = true;
hurtplayer(0);
changenrg(-2);
};
}
function popscore(_arg1:int, _arg2:int, _arg3:int){
var _local4:gpoints;
var _local5:int;
_local4 = new gpoints();
_local5 = Math.floor((_arg1 * (0.1 * (r("iteration") - 1))));
_local4.txts.text = (_arg1 + _local5);
_local4.tmrdis = gtmr();
_local4.x = _arg2;
_local4.y = (_arg3 - 24);
if (_arg1 >= 2000){
_local4.multi = 8;
} else {
_local4.multi = 1;
};
addChild(_local4);
popscorearray.push(_local4);
changescore((_arg1 + _local5));
}
function mistleani(_arg1:DisplayObject){
var _local2:gshard;
var _local3:Point;
var _local4:int;
if (_arg1.eaction == ""){
_arg1.actionframe = 0;
_arg1.tmrex1 = gtmr();
_arg1.eaction = "float";
};
if (_arg1.eaction == "float"){
if ((gtmr() - _arg1.tmrex1) <= 3000){
switch (_arg1.actionframe){
case 0:
case 1:
case 2:
case 3:
_arg1.y = (_arg1.y + 0.5);
break;
case 4:
case 5:
case 6:
_arg1.y = (_arg1.y - 0.5);
break;
case 7:
_arg1.y = (_arg1.y - 0.5);
_arg1.actionframe = -1;
break;
};
_arg1.actionframe++;
if (_arg1.mstr.bbHit.hitTestObject(player.mstr.bbHurt)){
playsound(sfxhit);
hurtplayer(0);
_arg1.struck = true;
changenrg(-15);
_arg1.eaction = "dead";
};
} else {
playsound(sfxtree);
_local3 = _arg1.mstr.bbHit.localToGlobal(new Point(0, 0));
_local4 = -1;
while (_local4 <= 1) {
_local2 = new gshard();
_local2.x = (_local3.x + 4);
_local2.y = (_local3.y + 4);
_local2.dir = _local4;
shardarray.push(_local2);
addChild(_local2);
_local4++;
};
_arg1.eaction = "dead";
};
} else {
if (_arg1.eaction == "dead"){
if (_arg1.mstr.img.currentFrame == 1){
_arg1.tmrex2 = gtmr();
_arg1.mstr.img.nextFrame();
} else {
if ((gtmr() - _arg1.tmrex2) >= 150){
_arg1.visible = false;
_arg1.eaction = "deactive";
};
};
};
};
}
function momani(_arg1:DisplayObject, _arg2:int){
var _local3:Boolean;
var _local4:Boolean;
var _local5:int;
if (_arg1.eaction == ""){
if (Math.abs((player.x - _arg1.x)) > 190){
_arg1.eaction = "advance";
_arg1.actionframe = 0;
} else {
_local5 = randm(1, 4);
switch (_local5){
case 1:
_arg1.eaction = "advance";
break;
case 2:
_arg1.eaction = "retreat";
break;
case 3:
_arg1.eaction = "hithigh";
break;
case 4:
_arg1.eaction = "hitlow";
break;
};
_arg1.actionframe = 0;
_arg1.moveframe = 0;
};
};
if (_arg1.eaction == "advance"){
nmecheckmove(_arg1, (playermovechunk * (-1 * _arg1.mstr.scaleX)));
_arg1.moveframe++;
_arg1.actionframe++;
if (_arg1.actionframe >= 12){
_arg1.eaction = "";
};
_local3 = true;
} else {
if (_arg1.eaction == "retreat"){
_arg1.x = (_arg1.x - (playermovechunk * (-1 * _arg1.mstr.scaleX)));
_arg1.moveframe++;
_arg1.actionframe++;
if (_arg1.actionframe >= 12){
_arg1.eaction = "";
};
_local3 = true;
} else {
if (_arg1.eaction == "hithigh"){
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(3);
break;
case 20:
playsound(sfxswordhit);
_arg1.mstr.img.nextFrame();
if (((_arg1.mstr.bbHit.hitTestObject(player.mstr.bbHurt)) && (!(player.ducking)))){
_local4 = true;
};
break;
case 21:
case 22:
case 23:
if (((_arg1.mstr.bbHit.hitTestObject(player.mstr.bbHurt)) && (!(player.ducking)))){
_local4 = true;
};
break;
case 24:
_arg1.struck = false;
_arg1.eaction = "";
_arg1.mstr.img.gotoAndStop(1);
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "hitlow"){
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(5);
break;
case 20:
playsound(sfxswordhit);
_arg1.mstr.img.nextFrame();
if (_arg1.mstr.bbHit.hitTestObject(player.mstr.bbHurt)){
_local4 = true;
};
break;
case 21:
case 22:
case 23:
if (((_arg1.mstr.bbHit.hitTestObject(player.mstr.bbHurt)) && (!(player.ducking)))){
_local4 = true;
};
break;
case 24:
_arg1.struck = false;
_arg1.eaction = "";
_arg1.mstr.img.gotoAndStop(1);
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "run"){
nmerun(_arg1);
} else {
if (_arg1.eaction == "dead"){
nmedeadani(_arg1);
};
};
};
};
};
};
if ((((_arg1.moveframe >= 4)) && (_local3))){
if (_arg1.mstr.img.currentFrame == 1){
_arg1.mstr.img.gotoAndStop(2);
} else {
_arg1.mstr.img.gotoAndStop(1);
};
_arg1.moveframe = 0;
};
if (((_local4) && (!(_arg1.struck)))){
if (_arg1.eaction == "hithigh"){
hitpoint = _arg1.mstr.bbHit.localToGlobal(new Point(10, 50));
} else {
if (_arg1.eaction == "hitlow"){
hitpoint = _arg1.mstr.bbHit.localToGlobal(new Point(10, 50));
};
};
obloodstar.x = hitpoint.x;
obloodstar.y = hitpoint.y;
reset(obloodstar);
tmrbloodstar = gtmr();
obloodstar.visible = true;
hurtplayer(0);
changenrg(-15);
_arg1.struck = true;
};
}
function soundlessnrg(_arg1:Number){
if ((((r("iteration") > 1)) && ((_arg1 < 0)))){
_arg1 = (_arg1 * r("iteration"));
};
rnrg = (rnrg + (_arg1 * 3.42));
if (rnrg < 0){
rnrg = 0;
};
bgplayfield.lifebar.life.width = Math.floor((rnrg / 3.42));
if ((((rnrg <= 0)) && (!((paction == "dead"))))){
playsound(sfxdead);
paction = "dead";
player.jumping = false;
player.ducking = false;
pjumpframe = 0;
player.mstr.img.gotoAndStop((17 + player.offset));
return;
};
}
function turboani(_arg1:DisplayObject, _arg2:int){
var _local4:Point;
var _local3:int;
var _local5:Boolean;
if (_arg1.eaction == ""){
if (_arg1.x <= 96){
_arg1.eaction = "superpunch";
playsound(sfxturbo);
} else {
_local3 = randm(1, 4);
switch (_local3){
case 1:
_arg1.eaction = "advance";
break;
case 2:
if (_arg1.x >= 96){
_arg1.eaction = "retreat";
} else {
_arg1.eaction = "advance";
};
break;
case 3:
_arg1.eaction = "punch";
break;
case 4:
_arg1.eaction = "superpunch";
playsound(sfxturbo);
break;
};
};
_arg1.actionframe = 0;
};
if (_arg1.eaction == "advance"){
nmecheckmove(_arg1, playermovechunk);
_arg1.moveframe++;
_arg1.actionframe++;
if (_arg1.actionframe >= 12){
_arg1.eaction = "";
};
} else {
if (_arg1.eaction == "retreat"){
_arg1.x = (_arg1.x - playermovechunk);
_arg1.moveframe++;
_arg1.actionframe++;
if (_arg1.actionframe >= 12){
_arg1.eaction = "";
};
} else {
if (_arg1.eaction == "punch"){
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(3);
break;
case 4:
_arg1.mstr.img.gotoAndStop(4);
_local5 = true;
break;
case 8:
_arg1.mstr.img.gotoAndStop(1);
_arg1.eaction = "";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "superpunch"){
if ((_arg1.actionframe % 2) == 0){
_arg1.mstr.img.gotoAndStop(5);
} else {
_arg1.mstr.img.gotoAndStop(6);
};
nmecheckmove(_arg1, (playermovechunk + 2));
_local5 = true;
switch (_arg1.actionframe){
case 15:
_arg1.mstr.img.gotoAndStop(1);
_arg1.eaction = "";
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "dead"){
nmedeadani(_arg1);
};
};
};
};
};
if (_local5){
if (((_arg1.mstr.bbHit.hitTestObject(player.mstr.bbHurt)) && ((player.ducking == false)))){
_local4 = _arg1.mstr.bbHit.localToGlobal(new Point(0, 0));
obloodstar.x = _local4.x;
obloodstar.y = _local4.y;
reset(obloodstar);
tmrbloodstar = gtmr();
obloodstar.visible = true;
hurtplayer(0);
if (_arg1.eaction == "punch"){
changenrg(-30);
} else {
if (_arg1.eaction == "superpunch"){
changenrg(-10);
};
};
};
};
if (_arg1.moveframe >= 4){
if (_arg1.mstr.img.currentFrame == 1){
_arg1.mstr.img.gotoAndStop(2);
} else {
_arg1.mstr.img.gotoAndStop(1);
};
_arg1.moveframe = 0;
};
}
function bloodstarani(){
if ((gtmr() - tmrbloodstar) >= 150){
obloodstar.visible = false;
};
}
function caneani(_arg1:DisplayObject, _arg2:int){
var _local3:gblank;
if (_arg1.eaction == ""){
_arg1.x = (_arg1.x - ((playermovechunk + 2) * _arg1.mstr.scaleX));
if (_arg1.y > (targety + _arg1.ty)){
_arg1.y = (_arg1.y - 2);
} else {
if (_arg1.y < (targety + _arg1.ty)){
_arg1.y = (_arg1.y + 2);
};
};
_arg1.moveframe++;
if (_arg1.moveframe >= 4){
if (_arg1.mstr.img.currentFrame == 1){
_arg1.mstr.img.nextFrame();
} else {
_arg1.mstr.img.gotoAndStop(1);
};
_arg1.moveframe = 0;
};
if (player.ducking){
_local3 = player.mstr.bbduck;
} else {
_local3 = player.mstr.bbHurt;
};
if (_arg1.mstr.bbHit.hitTestObject(_local3)){
hurtplayer(0);
mothd = true;
changenrg(-15);
_arg1.eaction = "dead";
_arg1.actionframe = 0;
} else {
if ((((_arg1.x > 592)) || ((_arg1.x < -80)))){
_arg1.visible = false;
_arg1.eaction = "deactive";
};
};
};
if (_arg1.eaction == "dead"){
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(3);
break;
case 4:
_arg1.mstr.img.nextFrame();
break;
case 8:
_arg1.visible = false;
_arg1.eaction = "deactive";
break;
};
_arg1.actionframe++;
};
}
function laserani(_arg1:claser){
_arg1.x = (_arg1.x - ((playermovechunk + 2) * _arg1.img.scaleX));
if (_arg1.img.currentFrame == 1){
_arg1.img.nextFrame();
} else {
_arg1.img.gotoAndStop(1);
};
if (((((_arg1.bbHit.hitTestObject(player.mstr.bbHurt)) && (_arg1.visible))) && (!(_arg1.struck)))){
if ((((_arg1.loc == "high")) && (trueduck()))){
return;
};
obloodstar.x = (_arg1.x + (8 * _arg1.img.scaleX));
obloodstar.y = _arg1.y;
reset(obloodstar);
tmrbloodstar = gtmr();
obloodstar.visible = true;
_arg1.struck = true;
hurtplayer(0);
changenrg(-15);
};
}
function trueduck():Boolean{
var _local1:Boolean;
_local1 = false;
if ((((player.mstr.img.currentFrame > (7 + player.offset))) && ((player.mstr.img.currentFrame < (12 + player.offset))))){
_local1 = true;
};
return (_local1);
}
function onMedalUnlocked(_arg1:NewgroundsAPIEvent):void{
trace(((((("Medal " + _arg1.data.name) + " - ") + _arg1.data.value) + "pts") + " unlocked!"));
var _local2:gmedal = new gmedal();
var _local3:Bitmap = new Bitmap();
_local2.txtname.text = _arg1.data.name;
_local2.txtpoints.text = _arg1.data.value;
_local2.forgebmp();
_local2.bmpicon.bitmapData = _arg1.data.icon;
_local2.x = 0x0200;
_local2.y = 370;
_local2.tmrmedal = gtmr();
addChild(_local2);
medalsarray.push(_local2);
}
function gtmr():int{
return ((getTimer() - intertime));
}
function popscoreani(_arg1:gpoints){
if ((gtmr() - _arg1.tmrdis) >= (360 * _arg1.multi)){
_arg1.visible = false;
};
}
public function intronext(){
switch (bgintro.introframe){
case 0:
bgintro.i1.visible = false;
bgintro.i2.visible = true;
break;
case 1:
bgintro.i2.visible = false;
bgintro.i3.visible = true;
playmusic(bgintro.intromusic, true);
break;
};
bgintro.introframe++;
}
private function httpStatusHandler(_arg1:HTTPStatusEvent):void{
trace(("httpStatusHandler: " + _arg1));
}
public function playmusic(_arg1:int, _arg2:Boolean){
var _local3:Boolean;
var _local4:int;
var _local5:int;
var _local6:SoundTransform;
if (!mfxon){
return;
};
_local3 = true;
_local4 = 0;
if (_arg2){
_local4 = 0;
while (_local4 < listenedarray.length) {
if (_arg1 == listenedarray[_local4]){
_local3 = false;
};
_local4++;
};
if (((_local3) && ((_arg1 < 6)))){
listenedarray.push(_arg1);
if (listenedarray.length >= 6){
unlockmedal("Sounds Good");
};
};
if (_arg1 < 6){
bgintro.intromusic = _arg1;
};
};
_local5 = 9999;
_local6 = new SoundTransform(1, 0);
bgmsoundchannel.stop();
if (_arg2){
bgmsoundchannel = musicarray[_arg1].play(0, _local5, _local6);
} else {
bgmsoundchannel = soundarray[_arg1].play(0, 0, _local6);
};
bgmvolume = 100;
}
function medalani(_arg1){
if ((gtmr() - _arg1.tmrmedal) >= 40){
if (_arg1.medalframe < 30){
_arg1.x = (_arg1.x - 8);
} else {
if (_arg1.medalframe >= 140){
_arg1.x = (_arg1.x + 8);
};
};
_arg1.medalframe++;
_arg1.tmrmedal = gtmr();
};
}
function rudolphani(_arg1:DisplayObject, _arg2:int){
var _local6:claser;
var _local3:Boolean;
var _local4:Boolean;
var _local5:int;
if (_arg1.eaction == ""){
if (_arg1.x > 362){
_arg1.eaction = "advance";
_arg1.actionframe = 0;
} else {
_local5 = randm(1, 5);
switch (_local5){
case 1:
_arg1.eaction = "advance";
break;
case 2:
_arg1.eaction = "retreat";
break;
case 3:
_arg1.eaction = "laserhigh";
break;
case 4:
_arg1.eaction = "laserlow";
break;
case 5:
_arg1.eaction = "block";
break;
};
_arg1.actionframe = 0;
_arg1.moveframe = 0;
};
};
if (_arg1.eaction == "advance"){
nmecheckmove(_arg1, (playermovechunk * -1));
_arg1.moveframe++;
_arg1.actionframe++;
if (_arg1.actionframe >= 12){
_arg1.eaction = "";
};
_local3 = true;
} else {
if (_arg1.eaction == "retreat"){
_arg1.x = (_arg1.x + playermovechunk);
_arg1.moveframe++;
_arg1.actionframe++;
if (_arg1.actionframe >= 12){
_arg1.eaction = "";
};
_local3 = true;
} else {
if (_arg1.eaction == "laserhigh"){
switch (_arg1.actionframe){
case 0:
case 16:
_arg1.mstr.img.gotoAndStop(9);
break;
case 8:
case 24:
_arg1.mstr.img.gotoAndStop(10);
break;
case 32:
playsound(sfxlaser);
_arg1.mstr.img.gotoAndStop(11);
_local6 = new claser();
_local6.img.gotoAndStop(1);
_local6.x = (_arg1.x - 30);
_local6.y = (_arg1.y + 60);
_local6.loc = "high";
addChild(_local6);
laserarray.push(_local6);
break;
case 33:
case 35:
case 37:
_arg1.mstr.img.nextFrame();
break;
case 34:
case 36:
case 38:
_arg1.mstr.img.prevFrame();
break;
case 39:
_arg1.mstr.img.gotoAndStop(1);
_arg1.eaction = "dazed";
if (r("iteration") > 1){
_arg1.actionframe = 31;
} else {
_arg1.actionframe = 15;
};
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "laserlow"){
switch (_arg1.actionframe){
case 0:
case 16:
_arg1.mstr.img.gotoAndStop(13);
break;
case 8:
case 24:
_arg1.mstr.img.gotoAndStop(14);
break;
case 32:
playsound(sfxlaser);
_arg1.mstr.img.gotoAndStop(15);
_local6 = new claser();
_local6.img.gotoAndStop(1);
_local6.x = (_arg1.x - 19);
_local6.y = (_arg1.y + 114);
_local6.loc = "low";
addChild(_local6);
laserarray.push(_local6);
break;
case 33:
case 35:
case 37:
_arg1.mstr.img.nextFrame();
break;
case 34:
case 36:
case 38:
_arg1.mstr.img.prevFrame();
break;
case 39:
_arg1.mstr.img.gotoAndStop(1);
_arg1.eaction = "dazed";
if (r("iteration") > 1){
_arg1.actionframe = 31;
} else {
_arg1.actionframe = 15;
};
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "block"){
switch (_arg1.actionframe){
case 0:
playsound(sfxrudolph);
_arg1.mstr.img.gotoAndStop(19);
_arg1.mstr.bbHurt.y = (_arg1.mstr.bbHurt.y + 40);
break;
case 2:
case 4:
case 6:
case 8:
case 10:
case 12:
case 14:
case 26:
case 28:
case 30:
case 32:
case 34:
_arg1.mstr.img.nextFrame();
break;
case 16:
case 18:
case 20:
case 22:
case 24:
_arg1.mstr.img.prevFrame();
break;
case 36:
_arg1.mstr.img.gotoAndStop(20);
_arg1.mstr.bbHurt.y = (_arg1.mstr.bbHurt.y - 40);
if (_arg1.mstr.bbHurt.hitTestObject(player.mstr.bbHurt)){
_local4 = true;
};
break;
case 38:
_arg1.mstr.img.prevFrame();
if (_arg1.mstr.bbHurt.hitTestObject(player.mstr.bbHurt)){
_local4 = true;
};
break;
case 40:
_arg1.mstr.img.gotoAndStop(1);
_arg1.eaction = "";
_arg1.actionframe = -1;
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "dazed"){
switch (_arg1.actionframe){
case 0:
case 32:
_arg1.mstr.img.gotoAndStop(17);
break;
case 16:
case 48:
_arg1.mstr.img.nextFrame();
break;
case 64:
_arg1.mstr.img.gotoAndStop(1);
_arg1.eaction = "";
_arg1.actionframe = -1;
break;
};
_arg1.actionframe++;
} else {
if (_arg1.eaction == "dead"){
if (_arg1.mstr.img.currentFrame < 27){
_arg1.actionframe = 0;
};
switch (_arg1.actionframe){
case 0:
_arg1.mstr.img.gotoAndStop(27);
break;
case 8:
case 24:
case 32:
case 64:
case 78:
case 82:
case 86:
case 90:
case 94:
case 98:
case 102:
_arg1.mstr.img.nextFrame();
break;
};
if (_arg1.actionframe == 32){
playsound(sfxhit);
};
if (_arg1.actionframe == 78){
playsound(sfxdead);
};
if (_arg1.actionframe >= 78){
_arg1.x = (_arg1.x + (playermovechunk + 12));
if (_arg1.x > 700){
_arg1.visible = false;
_arg1.eaction = "deactive";
};
};
_arg1.actionframe++;
};
};
};
};
};
};
};
if (((_local3) && ((_arg1.moveframe >= 4)))){
if (_arg1.eaction == "advance"){
if (_arg1.mstr.img.currentFrame >= 8){
_arg1.mstr.img.gotoAndStop(1);
} else {
_arg1.mstr.img.nextFrame();
};
} else {
if (_arg1.eaction == "retreat"){
if (_arg1.mstr.img.currentFrame == 1){
_arg1.mstr.img.gotoAndStop(8);
} else {
_arg1.mstr.img.prevFrame();
};
};
};
_arg1.moveframe = 0;
};
if (_local4){
hurtplayer(-40);
changenrg(-15);
};
}
private function securityErrorHandler(_arg1:SecurityErrorEvent):void{
trace(("securityErrorHandler: " + _arg1));
disableweb = true;
}
function endrani(){
if ((gtmr() - bgendr.tmrani) >= 360){
switch (bgendr.actionframe){
case 0:
playmusic(sfxvictory, false);
unlockmedal("Determined");
bgendr.h1.visible = true;
bgendr.h2.visible = false;
break;
case 1:
case 6:
case 11:
case 16:
case 21:
case 26:
bgendr.h2.visible = true;
bgendr.h3.visible = false;
break;
case 2:
case 7:
case 12:
case 17:
case 22:
case 27:
bgendr.h3.visible = true;
bgendr.h4.visible = false;
break;
case 3:
case 8:
case 13:
case 18:
case 23:
case 28:
bgendr.h4.visible = true;
bgendr.h5.visible = false;
break;
case 4:
case 9:
case 14:
case 19:
case 24:
bgendr.h5.visible = true;
bgendr.h1.visible = false;
break;
case 5:
case 10:
case 15:
case 20:
case 25:
bgendr.h1.visible = true;
bgendr.h2.visible = false;
break;
};
if (bgendr.actionframe == 13){
bgendr.txt.nextFrame();
};
if (bgendr.actionframe == 29){
flipmode("continue");
};
bgendr.tmrani = gtmr();
bgendr.actionframe++;
};
}
public function flipmode(_arg1:String){
var _local2:int;
_local2 = 0;
devisible();
switch (_arg1){
case "title":
bgtitle.b1p.gotoAndStop(1);
bgtitle.bcredit.gotoAndStop(1);
bgtitle.visible = true;
gamestate = statetitle;
break;
case "hsview":
bghsview.visible = true;
gamestate = statehsview;
break;
case "unlock":
bgunlock.devisible();
bgunlock.visible = true;
gamestate = stateunlock;
break;
case "sylvia":
bgsylvia.devisible();
bgsylvia.visible = true;
gamestate = statesylvia;
break;
case "hsentry":
bgmsoundchannel.stop();
bghsentry.alpha = 1;
bghsentry.fadeout = false;
bghsentry.fadeframe = 0;
bghsentry.visible = true;
gamestate = statehsentry;
break;
case "credits":
bgcredits.visible = true;
gamestate = statecredits;
break;
case "logo":
bglogo.logo.alpha = 0;
bglogo.logo.gotoAndStop(1);
bglogo.logo.x = (0x0100 - (bglogo.logo.width / 2));
bglogo.logo.y = (224 - (bglogo.logo.height / 2));
bglogo.logoframe = 0;
bglogo.tmrlogo = gtmr();
bglogo.visible = true;
gamestate = statelogo;
break;
case "intro":
bgintro.devisible();
bgintro.visible = true;
gamestate = stateintro;
break;
case "charselect":
bgcharselect.bs.gotoAndStop(1);
if (!unlockj){
bgcharselect.bj.gotoAndStop(3);
} else {
bgcharselect.bj.gotoAndStop(1);
};
if (!unlockr){
bgcharselect.br.gotoAndStop(3);
} else {
bgcharselect.br.gotoAndStop(1);
};
bgcharselect.visible = true;
gamestate = statecharselect;
break;
case "endings":
bgends.devisible();
bgends.visible = true;
endsmoveframe = 0;
gamestate = stateendings;
break;
case "endingj":
bgplayfield.visible = true;
bgendj.devisible();
reset(bgendj);
bgendj.visible = true;
gamestate = stateendingj;
break;
case "endingr":
bgplayfield.visible = true;
bgendr.devisible();
reset(bgendr);
bgendr.visible = true;
gamestate = stateendingr;
break;
case "gameover":
bggameover.skul.gotoAndStop(((player.offset / 17) + 1));
bggameover.devisible();
bggameover.skul.visible = false;
bggameover.txtgo.alpha = 0;
bggameover.lid.y = 0;
bggameover.blak.alpha = 1;
bggameover.visible = true;
goframe = 0;
playmusic(sfxgameover, false);
gamestate = stategameover;
break;
case "continue":
bgmsoundchannel.stop();
nextlvl(true);
bgplayfield.visible = true;
gamestate = stateplaying;
break;
case "playfield":
if (treearray.length == 0){
snakeeggarray = bgplayfield.sarray;
treearray = bgplayfield.tarray;
mistlearray = bgplayfield.marray;
};
_local2 = 0;
while (_local2 < treearray.length) {
snakeeggarray[_local2].visible = false;
snakeeggarray[_local2].enabled = false;
treearray[_local2].visible = false;
treearray[_local2].enabled = false;
mistlearray[_local2].visible = false;
mistlearray[_local2].enabled = false;
_local2++;
};
scour = 0;
rscour = 0;
level = 1;
rlevel = 3.42;
lives = 2;
rlives = (2 * 3.42);
iteration = 1;
riteration = 3.42;
changeiteration(0);
changescore(0);
changelife(0);
xmasmode = false;
bgplayfield.bg.bgnat.visible = false;
bgblak.visible = true;
reset(bgblak);
bgblak.alpha = 1;
bgfadein = true;
fadeframe = 0;
nmearray = new Array();
bgplayfield.visible = true;
bgplayfield.bg.img.gotoAndStop(1);
bgplayfield.bgcoverup.gotoAndStop(1);
bgplayfield.bg.bgfire.gotoAndStop(1);
bgplayfield.bg.smok1.visible = false;
bgplayfield.bg.smok2.visible = false;
bgplayfield.bg.smok3.visible = false;
bgplayfield.bg.smok1.alpha = 0.5;
bgplayfield.bg.smok2.alpha = 0.5;
bgplayfield.bg.smok3.alpha = 0.5;
levelcomplete = false;
bgmove(-3168, true);
player = bgplayfield.pSanta;
player.offset = ioffset;
bgplayfield.hed.gotoAndStop(((ioffset / 17) + 1));
player.mstr.img.gotoAndStop((1 + player.offset));
player.x = 251;
player.y = 266;
targety = 266;
bgplayfield.bg.bgfire.visible = true;
bgplayfield.bg.bgfireoverlay.visible = true;
bgplayfield.lvl2.img.visible = false;
bgplayfield.lvl3.img.visible = false;
bgplayfield.lvl4.img.visible = false;
bgplayfield.lvl5.img.visible = false;
bgplayfield.bgcoverup.visible = true;
wavenum = 0;
tmrwave = gtmr();
rlvltimer = (2000 * 3.42);
lvltimer = 2000;
changetimer(0);
rnrg = (115 * 3.42);
bgplayfield.lifebar.life.width = 115;
rnmenrg = (115 * 3.42);
bgplayfield.nmebar.life.width = 115;
nmebooster.mstr.scaleX = -1;
nmebooster.mstr.img.gotoAndStop(1);
nmebooster.visible = true;
nmebooster.eaction = "";
nmebooster.x = -2900;
nmebooster.y = 234;
nmebooster.nrg = 1;
nmearray.push(nmebooster);
bturbo.y = 243;
bturbo.x = -2912;
bturbo.mstr.img.gotoAndStop(1);
bturbo.mstr.scaleX = -1;
bturbo.eaction = "boss";
bturbo.visible = true;
bturbo.nrg = bturbo.maxnrg;
nmearray.push(bturbo);
gamestate = stateplaying;
changescale(1);
break;
};
}
function changescale(_arg1:int){
if (player.mstr.scaleX != _arg1){
player.mstr.scaleX = _arg1;
};
}
function hurtplayer(_arg1:int){
if (paction == "dead"){
return;
};
if (hdistance <= 0){
if (_arg1 < 0){
hdir = 1;
} else {
if (_arg1 > 0){
hdir = -1;
} else {
hdir = 0;
};
};
};
hdistance = (hdistance + Math.abs(_arg1));
player.tmrani = gtmr();
player.mstr.img.gotoAndStop((16 + player.offset));
paction = "hurt";
player.ducking = false;
}
function setnmexpos(_arg1:int, _arg2:int):int{
var _local3:int;
_local3 = 0;
switch (_arg2){
case -1:
_local3 = (-55 - (55 * _arg1));
break;
case 1:
_local3 = (525 + (55 * _arg1));
break;
};
return (_local3);
}
function elfcheck(){
if ((((((((elfg > 9)) && ((elfh1 > 9)))) && ((elfh2 > 9)))) && ((elfh3 > 9)))){
unlockmedal("Elfinator");
elfg = 0;
elfh1 = 0;
elfh2 = 0;
elfh3 = 0;
};
}
function checkattackcollision(_arg1:gblank){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:cjackhead;
var _local6:int;
var _local7:Boolean;
var _local8:Boolean;
var _local9:Boolean;
var _local10:DisplayObject;
var _local11:int;
var _local12:Point;
var _local13:Rectangle;
var _local14:Rectangle;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local6 = -1;
_local7 = false;
_local8 = false;
_local9 = false;
if (_arg1 == null){
return;
};
_local11 = ((r("iteration") - 1) * 5);
_local2 = 0;
while (_local2 < nmearray.length) {
_local10 = null;
_local9 = false;
_local7 = false;
if (nmearray[_local2].etype == "snakeegg"){
_local7 = true;
if ((((((targety + nmearray[_local2].ty) - nmearray[_local2].y) < 22)) && ((paction == "kick")))){
} else {
_local10 = nmearray[_local2].mstr.bbHit;
};
};
if (nmearray[_local2].etype == "tree"){
if (nmearray[_local2].mstr.img.currentFrame == 1){
if ((((((targety + nmearray[_local2].ty) - nmearray[_local2].y) < 22)) && ((paction == "kick")))){
} else {
_local10 = nmearray[_local2].mstr.bbHit;
};
_local7 = true;
} else {
if (nmearray[_local2].mstr.img.currentFrame < 8){
_local7 = true;
};
};
};
if (nmearray[_local2].etype == "hopper"){
if ((((nmearray[_local2].eaction == "")) || ((nmearray[_local2].eaction == "grip")))){
if (((!((paction == "dkick"))) && (!((paction == "dpunch"))))){
_local7 = true;
};
} else {
if (nmearray[_local2].eaction == "flip"){
if ((((paction == "dkick")) || ((paction == "dpunch")))){
_local7 = true;
};
};
};
if (nmearray[_local2].struck){
_local7 = true;
};
};
if ((((nmearray[_local2].etype == "mom")) && ((nmearray[_local2].eaction == "hitlow")))){
if (((!((paction == "dkick"))) && (!((paction == "dpunch"))))){
_local7 = true;
};
};
if (nmearray[_local2].etype == "xmas"){
if ((((nmearray[_local2].eaction == "dpunch")) || ((nmearray[_local2].eaction == "dkick")))){
if (((!((paction == "dkick"))) && (!((paction == "dpunch"))))){
_local7 = true;
};
} else {
if ((((nmearray[_local2].eaction == "jpunch")) || ((nmearray[_local2].eaction == "jkick")))){
if ((((paction == "dkick")) || ((paction == "dpunch")))){
_local7 = true;
};
};
};
};
if (nmearray[_local2].etype == "jack"){
if (nmearray[_local2].eaction == "regrow"){
_local7 = true;
};
if (((!((paction == "dkick"))) && (!((paction == "dpunch"))))){
if ((((((nmearray[_local2].eaction == "advance")) || ((nmearray[_local2].eaction == "retreat")))) || ((nmearray[_local2].eaction == "throw")))){
_local9 = true;
} else {
_local7 = true;
};
_local9 = true;
if (nmearray[_local2].eaction == "dying"){
_local7 = true;
_local9 = false;
};
};
};
if (nmearray[_local2].etype == "rudolph"){
if ((((nmearray[_local2].eaction == "block")) || ((paction == "dpunch")))){
_local7 = true;
};
};
if (!_local7){
_local10 = nmearray[_local2].mstr.bbHurt;
};
if (_local10 != null){
if (((((_arg1.hitTestObject(_local10)) && (!((nmearray[_local2].eaction == "dead"))))) && (nmearray[_local2].visible))){
if (!_local9){
nmearray[_local2].nrg--;
switch (nmearray[_local2].etype){
case "turbo":
case "farkus":
case "jack":
case "rudolph":
case "xmas":
playsound(sfxhithard);
break;
default:
playsound(sfxhit);
};
} else {
playsound(sfxtree);
_local5 = new cjackhead();
_local5.img.gotoAndStop(1);
_local5.img.scaleX = -1;
_local5.actionframe = 0;
_local5.struck = false;
_local5.x = (nmearray[_local2].x + 5);
_local5.y = nmearray[_local2].y;
addChild(_local5);
jhfallarray.push(_local5);
nmearray[_local2].eaction = "regrow";
nmearray[_local2].actionframe = 0;
};
if (_local7){
_local8 = true;
};
switch (nmearray[_local2].etype){
case "turbo":
changenmenrg(-((115 / (nmearray[_local2].maxnrg + _local11))));
if (nmearray[_local2].nrg <= 0){
playsound(sfxdead);
};
if (nmearray[_local2].nrg <= 0){
nmebooster.visible = true;
};
break;
case "farkus":
changenmenrg(-((115 / (nmearray[_local2].maxnrg + _local11))));
if (nmearray[_local2].nrg <= 0){
playsound(sfxdead);
};
nmearray[_local2].x = (nmearray[_local2].x + 16);
if (nmearray[_local2].eaction == "advance"){
nmearray[_local2].eaction = "";
};
break;
case "mom":
nmearray[_local2].x = (nmearray[_local2].x + (16 * nmearray[_local2].mstr.scaleX));
break;
case "jack":
if (((!((nmearray[_local2].eaction == "dying"))) && (!(_local9)))){
if (nmearray[_local2].eaction != "smash"){
nmearray[_local2].x = (nmearray[_local2].x + (16 * nmearray[_local2].mstr.scaleX));
};
if (nmearray[_local2].eaction == "advance"){
if (r("iteration") == 1){
nmearray[_local2].eaction = "";
} else {
nmearray[_local2].actionframe = 0;
nmearray[_local2].eaction = "smash";
};
};
changenmenrg(-((115 / (nmearray[_local2].maxnrg + _local11))));
if (nmearray[_local2].nrg <= 0){
playsound(sfxjackmelt);
};
} else {
if (nmearray[_local2].eaction == "dying"){
_local5 = new cjackhead();
_local5.img.gotoAndStop(2);
_local5.actionframe = 1;
_local5.struck = true;
_local5.img.scaleX = -1;
_local5.x = nmearray[_local2].x;
_local5.y = (nmearray[_local2].y + 51);
addChild(_local5);
jhthrowarray.push(_local5);
nmearray[_local2].mstr.img.nextFrame();
playsound(sfxdead);
};
};
break;
case "rudolph":
changenmenrg(-((115 / (nmearray[_local2].maxnrg + _local11))));
nmearray[_local2].x = (nmearray[_local2].x + 16);
if (nmearray[_local2].eaction == "advance"){
if (r("iteration") == 1){
nmearray[_local2].eaction = "";
} else {
nmearray[_local2].actionframe = 16;
nmearray[_local2].eaction = "laserlow";
};
};
break;
case "xmas":
changenmenrg(-((115 / (nmearray[_local2].maxnrg + _local11))));
if (nmearray[_local2].nrg <= 0){
playsound(sfxdead);
};
nmearray[_local2].x = (nmearray[_local2].x - 16);
if (nmearray[_local2].eaction == "advance"){
nmearray[_local2].eaction = "";
};
break;
};
if (nmearray[_local2].nrg <= 0){
_local3 = nmearray[_local2].x;
_local4 = nmearray[_local2].y;
if ((((nmearray[_local2].eaction == "retreat")) && ((nmearray[_local2].etype == "dad")))){
nmearray[_local2].mstr.scaleX = (nmearray[_local2].mstr.scaleX * -1);
};
nmearray[_local2].eaction = "dead";
if (paction == "dpunch"){
switch (nmearray[_local2].etype){
case "gripper":
case "dad":
case "turbo":
case "farkus":
case "jack":
case "xmas":
nutcrackers++;
if (nutcrackers >= 100){
unlockmedal("Nutcracker");
nutcrackers = 0;
};
break;
};
};
if (nmearray[_local2].enabled){
switch (nmearray[_local2].etype){
case "gripper":
if (((!((paction == "kick"))) && (!((paction == "dkick"))))){
popscore(200, _local3, _local4);
} else {
popscore(100, _local3, _local4);
};
if (nmearray[_local2].superoffset == 0){
elfg++;
};
elfcheck();
break;
case "hopper":
if (((!((paction == "kick"))) && (!((paction == "dkick"))))){
popscore(400, _local3, _local4);
} else {
popscore(200, _local3, _local4);
};
if (nmearray[_local2].superoffset == 0){
elfh1++;
};
if (nmearray[_local2].superoffset == 5){
elfh2++;
};
if (nmearray[_local2].superoffset == 10){
elfh3++;
};
elfcheck();
break;
case "dad":
if (((!((paction == "kick"))) && (!((paction == "dkick"))))){
popscore(800, _local3, _local4);
} else {
popscore(500, _local3, _local4);
};
break;
case "mom":
if (((!((paction == "kick"))) && (!((paction == "dkick"))))){
popscore(1000, _local3, _local4);
} else {
popscore(800, _local3, _local4);
};
break;
case "cane":
if (((!((paction == "kick"))) && (!((paction == "dkick"))))){
popscore(1000, _local3, _local4);
} else {
popscore(800, _local3, _local4);
};
break;
case "tree":
if (nmearray[_local2].mstr.img.currentFrame == 1){
popscore(200, _local3, (_local4 + 50));
} else {
popscore(1800, _local3, _local4);
};
break;
case "snakeegg":
popscore(500, _local3, _local4);
break;
case "mistle":
popscore(1000, _local3, _local4);
break;
case "turbo":
unlockmedal("Turbo Power");
popscore(2000, _local3, _local4);
break;
case "farkus":
unlockmedal("Oh Fudge");
popscore(4000, _local3, _local4);
break;
case "jack":
unlockmedal("Yellow Snow");
popscore(3000, _local3, _local4);
break;
case "rudolph":
unlockmedal("Paindeer");
popscore(8000, _local3, _local4);
break;
case "xmas":
unlockmedal("King O' Christmas!");
popscore(10000, _local3, _local4);
break;
};
};
};
_local6 = _local2;
};
_local7 = false;
};
_local2++;
};
if ((((_local6 >= 0)) && (!(_local8)))){
_local13 = _arg1.getRect(this);
_local14 = _local13.intersection(nmearray[_local6].mstr.bbHurt.getRect(this));
if (_local14.y == 0){
_local12 = _arg1.localToGlobal(new Point(0, 0));
} else {
_local12 = new Point((_local14.x + ((_local14.width / 2) * (-1 * player.mstr.scaleX))), _local14.y);
};
if (player.mstr.scaleX == -1){
};
reset(ostrikestar);
ostrikestar.x = _local12.x;
ostrikestar.y = _local12.y;
tmrstrike = gtmr();
ostrikestar.visible = true;
};
}
function endsani(){
switch (bgends.endframe){
case 0:
playmusic(mfxbedroom, true);
endsint = 2000;
break;
case 1:
bgends.eyes.visible = true;
break;
case 2:
bgends.txt.visible = true;
endsint = 4000;
break;
case 3:
playsound(sfxdoor);
bgends.santa.visible = true;
bgends.bg.visible = true;
bgends.doorlight.visible = true;
bgends.txt.visible = false;
bgends.eyes.gotoAndStop(2);
endsint = 1000;
break;
case 4:
case 6:
case 8:
case 10:
case 12:
case 14:
endsint = 120;
bgends.santa.x = (bgends.santa.x - 2);
break;
case 5:
case 7:
case 9:
case 11:
case 13:
case 15:
bgends.santa.x = (bgends.santa.x - 2);
if (bgends.santa.currentFrame == 2){
bgends.santa.prevFrame();
} else {
bgends.santa.nextFrame();
};
if (bgends.endframe == 15){
endsint = 1000;
};
break;
case 16:
bgends.santa.x = 0;
bgends.santa.gotoAndStop(3);
bgends.eyes.visible = false;
bgends.miss.visible = true;
bgends.doorlight.visible = false;
playsound(sfxswitch);
endsint = 1000;
break;
case 17:
playsound(sfxdead);
bgends.txt.gotoAndStop(2);
bgends.txt.visible = true;
bgends.santa.x = -16;
bgends.santa.gotoAndStop(4);
bgends.miss.enabled = true;
bgends.hl.enabled = true;
endsint = 30;
break;
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
bgends.santa.x = (bgends.santa.x + 4);
break;
case 24:
endsint = 2000;
break;
case 26:
bgends.txt.gotoAndStop(3);
bgends.santa.x = 0;
bgends.soffset = 5;
bgends.santa.gotoAndStop(5);
bgends.santa.enabled = true;
bgends.hl.enabled = false;
bgends.hl.visible = false;
bgends.miss.gotoAndStop(4);
endsint = 4000;
break;
case 27:
bgends.txt.gotoAndStop(4);
bgends.soffset = 8;
bgends.santa.gotoAndStop(8);
endsint = 30;
break;
case 28:
case 29:
case 30:
case 31:
case 32:
case 33:
case 34:
case 35:
case 36:
case 37:
case 38:
case 39:
case 40:
case 41:
case 42:
case 43:
bgends.santa.x = (bgends.santa.x - 8);
bgends.santa.y = (bgends.santa.y - 4);
break;
case 44:
bgends.santa.x = (bgends.santa.x - 8);
break;
case 45:
case 46:
case 47:
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
bgends.santa.x = (bgends.santa.x - 8);
bgends.santa.y = (bgends.santa.y + 4);
break;
case 57:
bgends.santa.x = 0;
bgends.santa.y = 0;
bgends.soffset = 11;
bgends.santa.gotoAndStop(11);
endsint = 60;
break;
case 58:
bgends.splat.visible = true;
bgends.bg.enabled = true;
break;
case 59:
case 60:
case 61:
case 62:
case 63:
case 64:
case 65:
case 66:
case 67:
case 68:
case 69:
case 70:
case 71:
case 72:
case 73:
case 74:
case 75:
case 76:
case 77:
case 78:
case 79:
case 80:
case 81:
case 82:
case 83:
case 84:
case 85:
case 86:
case 87:
case 88:
case 89:
case 90:
case 91:
bgends.splat.nextFrame();
break;
case 92:
bgends.santa.enabled = false;
bgends.miss.enabled = false;
bgends.bg.enabled = false;
endsint = 2000;
break;
case 93:
bgends.blak.visible = true;
endsint = 120;
break;
case 93:
case 94:
case 95:
case 96:
case 97:
case 98:
case 99:
case 100:
case 101:
case 102:
case 103:
bgends.blak.alpha = (bgends.blak.alpha + 0.1);
break;
case 104:
bgends.blak.alpha = 1;
endsint = 3000;
break;
case 105:
playmusic(sfxvictory, false);
bgends.but.visible = true;
endsint = 10000;
break;
case 106:
endsint = 0;
break;
case 107:
bgmsoundchannel.stop();
if (unlockj){
flipmode("continue");
} else {
unlockj = true;
savelocalstorage();
flipmode("unlock");
};
break;
};
bgends.endframe++;
}
function flashani(){
var _local1:glvl;
if ((gtmr() - tmrflash) >= 360){
switch (r("level")){
case 1:
_local1 = bgplayfield.lvl1;
break;
case 2:
_local1 = bgplayfield.lvl2;
break;
case 3:
_local1 = bgplayfield.lvl3;
break;
case 4:
_local1 = bgplayfield.lvl4;
break;
case 5:
_local1 = bgplayfield.lvl5;
break;
};
if (_local1 == null){
return;
};
_local1.img.visible = !(_local1.img.visible);
tmrflash = gtmr();
};
}
function fireani(){
if ((gtmr() - tmrfireplace) >= 120){
if (bgplayfield.bg.bgfire.currentFrame == 3){
bgplayfield.bg.bgfire.gotoAndStop(1);
} else {
bgplayfield.bg.bgfire.nextFrame();
};
tmrfireplace = gtmr();
};
}
}
}//package
Section 113
//sboomerang (sboomerang)
package {
import flash.media.*;
public dynamic class sboomerang extends Sound {
}
}//package
Section 114
//scane (scane)
package {
import flash.media.*;
public dynamic class scane extends Sound {
}
}//package
Section 115
//schain (schain)
package {
import flash.media.*;
public dynamic class schain extends Sound {
}
}//package
Section 116
//schainhigh (schainhigh)
package {
import flash.media.*;
public dynamic class schainhigh extends Sound {
}
}//package
Section 117
//schop (schop)
package {
import flash.media.*;
public dynamic class schop extends Sound {
}
}//package
Section 118
//scomplete (scomplete)
package {
import flash.media.*;
public dynamic class scomplete extends Sound {
}
}//package
Section 119
//sdead (sdead)
package {
import flash.media.*;
public dynamic class sdead extends Sound {
}
}//package
Section 120
//sdoor (sdoor)
package {
import flash.media.*;
public dynamic class sdoor extends Sound {
}
}//package
Section 121
//sfarkus (sfarkus)
package {
import flash.media.*;
public dynamic class sfarkus extends Sound {
}
}//package
Section 122
//sgameover (sgameover)
package {
import flash.media.*;
public dynamic class sgameover extends Sound {
}
}//package
Section 123
//shit (shit)
package {
import flash.media.*;
public dynamic class shit extends Sound {
}
}//package
Section 124
//shithard (shithard)
package {
import flash.media.*;
public dynamic class shithard extends Sound {
}
}//package
Section 125
//shurt (shurt)
package {
import flash.media.*;
public dynamic class shurt extends Sound {
}
}//package
Section 126
//sjack (sjack)
package {
import flash.media.*;
public dynamic class sjack extends Sound {
}
}//package
Section 127
//sjackmelt (sjackmelt)
package {
import flash.media.*;
public dynamic class sjackmelt extends Sound {
}
}//package
Section 128
//sjesus (sjesus)
package {
import flash.media.*;
public dynamic class sjesus extends Sound {
}
}//package
Section 129
//sjumpkick (sjumpkick)
package {
import flash.media.*;
public dynamic class sjumpkick extends Sound {
}
}//package
Section 130
//skick (skick)
package {
import flash.media.*;
public dynamic class skick extends Sound {
}
}//package
Section 131
//slaser (slaser)
package {
import flash.media.*;
public dynamic class slaser extends Sound {
}
}//package
Section 132
//slaugh (slaugh)
package {
import flash.media.*;
public dynamic class slaugh extends Sound {
}
}//package
Section 133
//slaughhigh (slaughhigh)
package {
import flash.media.*;
public dynamic class slaughhigh extends Sound {
}
}//package
Section 134
//slaughlong (slaughlong)
package {
import flash.media.*;
public dynamic class slaughlong extends Sound {
}
}//package
Section 135
//slaughlow (slaughlow)
package {
import flash.media.*;
public dynamic class slaughlow extends Sound {
}
}//package
Section 136
//slight (slight)
package {
import flash.media.*;
public dynamic class slight extends Sound {
}
}//package
Section 137
//slvlcomplete (slvlcomplete)
package {
import flash.media.*;
public dynamic class slvlcomplete extends Sound {
}
}//package
Section 138
//slvlstart (slvlstart)
package {
import flash.media.*;
public dynamic class slvlstart extends Sound {
}
}//package
Section 139
//spause (spause)
package {
import flash.media.*;
public dynamic class spause extends Sound {
}
}//package
Section 140
//spipe (spipe)
package {
import flash.media.*;
public dynamic class spipe extends Sound {
}
}//package
Section 141
//spointtally (spointtally)
package {
import flash.media.*;
public dynamic class spointtally extends Sound {
}
}//package
Section 142
//spunch (spunch)
package {
import flash.media.*;
public dynamic class spunch extends Sound {
}
}//package
Section 143
//srudolph (srudolph)
package {
import flash.media.*;
public dynamic class srudolph extends Sound {
}
}//package
Section 144
//ssnake (ssnake)
package {
import flash.media.*;
public dynamic class ssnake extends Sound {
}
}//package
Section 145
//ssnakeegg (ssnakeegg)
package {
import flash.media.*;
public dynamic class ssnakeegg extends Sound {
}
}//package
Section 146
//sswitch (sswitch)
package {
import flash.media.*;
public dynamic class sswitch extends Sound {
}
}//package
Section 147
//sswordhit (sswordhit)
package {
import flash.media.*;
public dynamic class sswordhit extends Sound {
}
}//package
Section 148
//stree (stree)
package {
import flash.media.*;
public dynamic class stree extends Sound {
}
}//package
Section 149
//sturbo (sturbo)
package {
import flash.media.*;
public dynamic class sturbo extends Sound {
}
}//package
Section 150
//sunpause (sunpause)
package {
import flash.media.*;
public dynamic class sunpause extends Sound {
}
}//package
Section 151
//svictory (svictory)
package {
import flash.media.*;
public dynamic class svictory extends Sound {
}
}//package