Section 1
//ANINTRO_196 (bokiFix1_fla.ANINTRO_196)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class ANINTRO_196 extends MovieClip {
public function ANINTRO_196(){
super();
addFrameScript(0, frame1, 65, frame66);
}
function frame1(){
}
function frame66(){
stop();
}
}
}//package bokiFix1_fla
Section 2
//badBtnMc_155 (bokiFix1_fla.badBtnMc_155)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class badBtnMc_155 extends MovieClip {
public function badBtnMc_155(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bokiFix1_fla
Section 3
//char_197 (bokiFix1_fla.char_197)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class char_197 extends MovieClip {
public function char_197(){
super();
addFrameScript(61, frame62);
}
function frame62(){
stop();
}
}
}//package bokiFix1_fla
Section 4
//entityBtnMc_152 (bokiFix1_fla.entityBtnMc_152)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class entityBtnMc_152 extends MovieClip {
public function entityBtnMc_152(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bokiFix1_fla
Section 5
//logorexr_198 (bokiFix1_fla.logorexr_198)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class logorexr_198 extends MovieClip {
public function logorexr_198(){
super();
addFrameScript(158, frame159);
}
function frame159(){
stop();
this.stage.frameRate = 30;
}
}
}//package bokiFix1_fla
Section 6
//NormalComplete_43 (bokiFix1_fla.NormalComplete_43)
package bokiFix1_fla {
import flash.display.*;
public dynamic class NormalComplete_43 extends MovieClip {
public var cb:SimpleButton;
public var like:SimpleButton;
public var go:SimpleButton;
public function NormalComplete_43(){
super();
}
}
}//package bokiFix1_fla
Section 7
//pieceBtnMc_148 (bokiFix1_fla.pieceBtnMc_148)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class pieceBtnMc_148 extends MovieClip {
public function pieceBtnMc_148(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bokiFix1_fla
Section 8
//pitBtnMc_161 (bokiFix1_fla.pitBtnMc_161)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class pitBtnMc_161 extends MovieClip {
public function pitBtnMc_161(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bokiFix1_fla
Section 9
//rocketBtnMc_158 (bokiFix1_fla.rocketBtnMc_158)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class rocketBtnMc_158 extends MovieClip {
public function rocketBtnMc_158(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bokiFix1_fla
Section 10
//testBtn_177 (bokiFix1_fla.testBtn_177)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class testBtn_177 extends MovieClip {
public function testBtn_177(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bokiFix1_fla
Section 11
//TESTbTN2_143 (bokiFix1_fla.TESTbTN2_143)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class TESTbTN2_143 extends MovieClip {
public function TESTbTN2_143(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bokiFix1_fla
Section 12
//VectorSmartObject_5_128 (bokiFix1_fla.VectorSmartObject_5_128)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class VectorSmartObject_5_128 extends MovieClip {
public function VectorSmartObject_5_128(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bokiFix1_fla
Section 13
//VectorSmartObjectcopy_131 (bokiFix1_fla.VectorSmartObjectcopy_131)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class VectorSmartObjectcopy_131 extends MovieClip {
public function VectorSmartObjectcopy_131(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bokiFix1_fla
Section 14
//VectorSmartObjectcopy2_134 (bokiFix1_fla.VectorSmartObjectcopy2_134)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class VectorSmartObjectcopy2_134 extends MovieClip {
public function VectorSmartObjectcopy2_134(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bokiFix1_fla
Section 15
//VectorSmartObjectcopy3_137 (bokiFix1_fla.VectorSmartObjectcopy3_137)
package bokiFix1_fla {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class VectorSmartObjectcopy3_137 extends MovieClip {
public function VectorSmartObjectcopy3_137(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package bokiFix1_fla
Section 16
//JSON (com.adobe.serialization.json.JSON)
package com.adobe.serialization.json {
public class JSON {
public function JSON(){
super();
}
public static function decode(s:String){
var decoder:JSONDecoder;
decoder = new JSONDecoder(s);
return (decoder.getValue());
}
public static function encode(o:Object):String{
var encoder:JSONEncoder;
encoder = new JSONEncoder(o);
return (encoder.getString());
}
}
}//package com.adobe.serialization.json
Section 17
//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(s:String){
super();
tokenizer = new JSONTokenizer(s);
nextToken();
value = parseValue();
}
private function nextToken():JSONToken{
return ((token = tokenizer.getNextToken()));
}
private function parseObject():Object{
var o:Object;
var key:String;
o = new Object();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (o);
};
while (true) {
if (token.type == JSONTokenType.STRING){
key = String(token.value);
nextToken();
if (token.type == JSONTokenType.COLON){
nextToken();
o[key] = parseValue();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACE){
return (o);
};
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 parseArray():Array{
var a:Array;
a = new Array();
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (a);
};
while (true) {
a.push(parseValue());
nextToken();
if (token.type == JSONTokenType.RIGHT_BRACKET){
return (a);
};
if (token.type == JSONTokenType.COMMA){
nextToken();
} else {
tokenizer.parseError(("Expecting ] or , but found " + token.value));
};
};
return (null);
}
public function getValue(){
return (value);
}
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);
}
}
}//package com.adobe.serialization.json
Section 18
//JSONEncoder (com.adobe.serialization.json.JSONEncoder)
package com.adobe.serialization.json {
import flash.utils.*;
public class JSONEncoder {
private var jsonString:String;
public function JSONEncoder(value){
super();
jsonString = convertToString(value);
}
private function arrayToString(a:Array):String{
var s:String;
var i:int;
s = "";
i = 0;
while (i < a.length) {
if (s.length > 0){
s = (s + ",");
};
s = (s + convertToString(a[i]));
i++;
};
return ((("[" + s) + "]"));
}
private function convertToString(value):String{
if ((value is String)){
return (escapeString((value as String)));
};
if ((value is Number)){
return ((isFinite((value as Number))) ? value.toString() : "null");
} else {
if ((value is Boolean)){
return ((value) ? "true" : "false");
} else {
if ((value is Array)){
return (arrayToString((value as Array)));
};
if ((((value is Object)) && (!((value == null))))){
return (objectToString(value));
};
};
};
return ("null");
}
private function escapeString(str:String):String{
var s:String;
var ch:String;
var len:Number;
var i:int;
var hexCode:String;
var zeroPad:String;
s = "";
len = str.length;
i = 0;
while (i < len) {
ch = str.charAt(i);
switch (ch){
case "\"":
s = (s + "\\\"");
break;
case "\\":
s = (s + "\\\\");
break;
case "\b":
s = (s + "\\b");
break;
case "\f":
s = (s + "\\f");
break;
case "\n":
s = (s + "\\n");
break;
case "\r":
s = (s + "\\r");
break;
case "\t":
s = (s + "\\t");
break;
default:
if (ch < " "){
hexCode = ch.charCodeAt(0).toString(16);
zeroPad = ((hexCode.length == 2)) ? "00" : "000";
s = (s + (("\\u" + zeroPad) + hexCode));
} else {
s = (s + ch);
};
};
i++;
};
return ((("\"" + s) + "\""));
}
private function objectToString(o:Object):String{
var s:String;
var classInfo:XML;
var value:Object;
var key:String;
var v:XML;
var o = o;
s = "";
classInfo = 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) + "}"));
}
public function getString():String{
return (jsonString);
}
}
}//package com.adobe.serialization.json
Section 19
//JSONParseError (com.adobe.serialization.json.JSONParseError)
package com.adobe.serialization.json {
public class JSONParseError extends Error {
private var _text:String;
private var _location:int;
public function JSONParseError(message:String="", location:int=0, text:String=""){
super(message);
name = "JSONParseError";
_location = location;
_text = text;
}
public function get text():String{
return (_text);
}
public function get location():int{
return (_location);
}
}
}//package com.adobe.serialization.json
Section 20
//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(type:int=-1, value:Object=null){
super();
_type = type;
_value = value;
}
public function set value(v:Object):void{
_value = v;
}
public function get value():Object{
return (_value);
}
public function set type(value:int):void{
_type = value;
}
public function get type():int{
return (_type);
}
}
}//package com.adobe.serialization.json
Section 21
//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(s:String){
super();
jsonString = s;
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(ch:String):Boolean{
return ((((ch >= "0")) && ((ch <= "9"))));
}
private function readNumber():JSONToken{
var token:JSONToken;
var input:String;
var num:Number;
token = new JSONToken();
token.type = JSONTokenType.NUMBER;
input = "";
if (ch == "-"){
input = (input + "-");
nextChar();
};
if (!isDigit(ch)){
parseError("Expecting a digit");
};
if (ch == "0"){
input = (input + ch);
nextChar();
if (isDigit(ch)){
parseError("A digit cannot immediately follow 0");
};
} else {
while (isDigit(ch)) {
input = (input + ch);
nextChar();
};
};
if (ch == "."){
input = (input + ".");
nextChar();
if (!isDigit(ch)){
parseError("Expecting a digit");
};
while (isDigit(ch)) {
input = (input + ch);
nextChar();
};
};
if ((((ch == "e")) || ((ch == "E")))){
input = (input + "e");
nextChar();
if ((((ch == "+")) || ((ch == "-")))){
input = (input + ch);
nextChar();
};
if (!isDigit(ch)){
parseError("Scientific notation number needs exponent value");
};
while (isDigit(ch)) {
input = (input + ch);
nextChar();
};
};
num = Number(input);
if (((isFinite(num)) && (!(isNaN(num))))){
token.value = num;
return (token);
};
parseError((("Number " + num) + " is not valid!"));
return (null);
}
private function nextChar():String{
return ((ch = jsonString.charAt(loc++)));
}
public function getNextToken():JSONToken{
var token:JSONToken;
var _local2:String;
var _local3:String;
var _local4:String;
token = new JSONToken();
skipIgnored();
switch (ch){
case "{":
token.type = JSONTokenType.LEFT_BRACE;
token.value = "{";
nextChar();
break;
case "}":
token.type = JSONTokenType.RIGHT_BRACE;
token.value = "}";
nextChar();
break;
case "[":
token.type = JSONTokenType.LEFT_BRACKET;
token.value = "[";
nextChar();
break;
case "]":
token.type = JSONTokenType.RIGHT_BRACKET;
token.value = "]";
nextChar();
break;
case ",":
token.type = JSONTokenType.COMMA;
token.value = ",";
nextChar();
break;
case ":":
token.type = JSONTokenType.COLON;
token.value = ":";
nextChar();
break;
case "t":
_local2 = ((("t" + nextChar()) + nextChar()) + nextChar());
if (_local2 == "true"){
token.type = JSONTokenType.TRUE;
token.value = true;
nextChar();
} else {
parseError(("Expecting 'true' but found " + _local2));
};
break;
case "f":
_local3 = (((("f" + nextChar()) + nextChar()) + nextChar()) + nextChar());
if (_local3 == "false"){
token.type = JSONTokenType.FALSE;
token.value = false;
nextChar();
} else {
parseError(("Expecting 'false' but found " + _local3));
};
break;
case "n":
_local4 = ((("n" + nextChar()) + nextChar()) + nextChar());
if (_local4 == "null"){
token.type = JSONTokenType.NULL;
token.value = null;
nextChar();
} else {
parseError(("Expecting 'null' but found " + _local4));
};
break;
case "\"":
token = readString();
break;
default:
if (((isDigit(ch)) || ((ch == "-")))){
token = readNumber();
} else {
if (ch == ""){
return (null);
};
parseError((("Unexpected " + ch) + " encountered"));
};
};
return (token);
}
private function skipWhite():void{
while (isWhiteSpace(ch)) {
nextChar();
};
}
private function isWhiteSpace(ch:String):Boolean{
return ((((((((ch == " ")) || ((ch == "\t")))) || ((ch == "\n")))) || ((ch == "\r"))));
}
public function parseError(message:String):void{
throw (new JSONParseError(message, loc, jsonString));
}
private function skipIgnored():void{
var originalLoc:int;
do {
originalLoc = loc;
skipWhite();
skipComments();
} while (originalLoc != loc);
}
private function isHexDigit(ch:String):Boolean{
var uc:String;
uc = ch.toUpperCase();
return (((isDigit(ch)) || ((((uc >= "A")) && ((uc <= "F"))))));
}
private function readString():JSONToken{
var token:JSONToken;
var string:String;
var _local5:String;
var i:int;
token = new JSONToken();
token.type = JSONTokenType.STRING;
string = "";
nextChar();
while (((!((ch == "\""))) && (!((ch == ""))))) {
if (ch == "\\"){
nextChar();
switch (ch){
case "\"":
string = (string + "\"");
break;
case "/":
string = (string + "/");
break;
case "\\":
string = (string + "\\");
break;
case "b":
string = (string + "\b");
break;
case "f":
string = (string + "\f");
break;
case "n":
string = (string + "\n");
break;
case "r":
string = (string + "\r");
break;
case "t":
string = (string + "\t");
break;
case "u":
_local5 = "";
i = 0;
while (i < 4) {
if (!isHexDigit(nextChar())){
parseError((" Excepted a hex digit, but found: " + ch));
};
_local5 = (_local5 + ch);
i++;
};
string = (string + String.fromCharCode(parseInt(_local5, 16)));
break;
default:
string = (string + ("\\" + ch));
};
} else {
string = (string + ch);
};
nextChar();
};
if (ch == ""){
parseError("Unterminated string literal");
};
nextChar();
token.value = string;
return (token);
}
}
}//package com.adobe.serialization.json
Section 22
//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;
public function JSONTokenType(){
super();
}
}
}//package com.adobe.serialization.json
Section 23
//Base64 (com.dynamicflash.util.Base64)
package com.dynamicflash.util {
import flash.utils.*;
public class Base64 {
public static const version:String = "1.1.0";
private static const BASE64_CHARS:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
public function Base64(){
super();
throw (new Error("Base64 class is static container only"));
}
public static function encode(data:String):String{
var bytes:ByteArray;
bytes = new ByteArray();
bytes.writeUTFBytes(data);
return (encodeByteArray(bytes));
}
public static function encodeByteArray(data:ByteArray):String{
var output:String;
var dataBuffer:Array;
var outputBuffer:Array;
var i:uint;
var j:uint;
var k:uint;
output = "";
outputBuffer = new Array(4);
data.position = 0;
while (data.bytesAvailable > 0) {
dataBuffer = new Array();
i = 0;
while ((((i < 3)) && ((data.bytesAvailable > 0)))) {
dataBuffer[i] = data.readUnsignedByte();
i++;
};
outputBuffer[0] = ((dataBuffer[0] & 252) >> 2);
outputBuffer[1] = (((dataBuffer[0] & 3) << 4) | (dataBuffer[1] >> 4));
outputBuffer[2] = (((dataBuffer[1] & 15) << 2) | (dataBuffer[2] >> 6));
outputBuffer[3] = (dataBuffer[2] & 63);
j = dataBuffer.length;
while (j < 3) {
outputBuffer[(j + 1)] = 64;
j++;
};
k = 0;
while (k < outputBuffer.length) {
output = (output + BASE64_CHARS.charAt(outputBuffer[k]));
k++;
};
};
return (output);
}
public static function decode(data:String):String{
var bytes:ByteArray;
bytes = decodeToByteArray(data);
return (bytes.readUTFBytes(bytes.length));
}
public static function decodeToByteArray(data:String):ByteArray{
var output:ByteArray;
var dataBuffer:Array;
var outputBuffer:Array;
var i:uint;
var j:uint;
var k:uint;
output = new ByteArray();
dataBuffer = new Array(4);
outputBuffer = new Array(3);
i = 0;
while (i < data.length) {
j = 0;
while ((((j < 4)) && (((i + j) < data.length)))) {
dataBuffer[j] = BASE64_CHARS.indexOf(data.charAt((i + j)));
j++;
};
outputBuffer[0] = ((dataBuffer[0] << 2) + ((dataBuffer[1] & 48) >> 4));
outputBuffer[1] = (((dataBuffer[1] & 15) << 4) + ((dataBuffer[2] & 60) >> 2));
outputBuffer[2] = (((dataBuffer[2] & 3) << 6) + dataBuffer[3]);
k = 0;
while (k < outputBuffer.length) {
if (dataBuffer[(k + 1)] == 64){
break;
};
output.writeByte(outputBuffer[k]);
k++;
};
i = (i + 4);
};
output.position = 0;
return (output);
}
}
}//package com.dynamicflash.util
Section 24
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.events.*;
import flash.display.*;
import flash.system.*;
import flash.net.*;
public class AdLoader extends Sprite {
private var contentspotid:String;
private var cpmstarLoader:Loader;
public function AdLoader(contentspotid:String){
super();
this.contentspotid = contentspotid;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(event:Event):void{
var cpmstarViewSWFUrl:String;
var container:DisplayObjectContainer;
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
cpmstarViewSWFUrl = "http://server.cpmstar.com/adviewas3.swf";
container = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((cpmstarViewSWFUrl + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function dispatchHandler(event:Event):void{
dispatchEvent(event);
}
}
}//package CPMStar
Section 25
//Log (SWFStats.Log)
package SWFStats {
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.external.*;
public final class Log {
private static const PingR:Timer = new Timer(30000);
private static const Random:Number = Math.random();
private static const PingF:Timer = new Timer(60000);
public static var GUID:String = "";
private static var Plays:int = 0;
private static var Enabled:Boolean = false;
private static var FirstPing:Boolean = true;
private static var Pings:int = 0;
public static var SourceUrl:String;
private static var HighestGoal:int = 0;
public static var SWFID:int = 0;
public function Log(){
super();
}
private static function GetCookie(n:String):int{
var cookie:SharedObject;
cookie = SharedObject.getLocal("swfstats");
if (cookie.data[n] == undefined){
return (0);
};
return (int(cookie.data[n]));
}
private static function SaveCookie(n:String, v:int):void{
var cookie:SharedObject;
cookie = SharedObject.getLocal("swfstats");
cookie.data[n] = v.toString();
cookie.flush();
}
public static function View(swfid:int=0, guid:String="", defaulturl:String=""):void{
var views:int;
SWFID = swfid;
GUID = guid;
Enabled = true;
if ((((SWFID == 0)) || ((GUID == "")))){
Enabled = false;
return;
};
if (((((!((defaulturl.indexOf("http://") == 0))) && (!((Security.sandboxType == "localWithNetwork"))))) && (!((Security.sandboxType == "localTrusted"))))){
Enabled = false;
return;
};
SourceUrl = GetUrl(defaulturl);
if ((((SourceUrl == null)) || ((SourceUrl == "")))){
Enabled = false;
return;
};
Security.allowDomain("http://tracker.swfstats.com/");
Security.allowInsecureDomain("http://tracker.swfstats.com/");
Security.loadPolicyFile("http://tracker.swfstats.com/crossdomain.xml");
Security.allowDomain("http://utils.swfstats.com/");
Security.allowInsecureDomain("http://utils.swfstats.com/");
Security.loadPolicyFile("http://utils.swfstats.com/crossdomain.xml");
views = GetCookie("views");
views++;
SaveCookie("views", views);
Send("View", ("views=" + views));
PingF.addEventListener(TimerEvent.TIMER, PingServer);
PingF.start();
}
public static function LevelCounterMetric(name:String, level):void{
if (!Enabled){
return;
};
Send("LevelMetric", ((("name=" + escape(name)) + "&level=") + level));
}
private static function Send(page:String, data:String):void{
var sendaction:URLLoader;
sendaction = new URLLoader();
sendaction.addEventListener(IOErrorEvent.IO_ERROR, ErrorHandler);
sendaction.addEventListener(HTTPStatusEvent.HTTP_STATUS, StatusChange);
sendaction.addEventListener(SecurityErrorEvent.SECURITY_ERROR, ErrorHandler);
sendaction.load(new URLRequest(((((((((((("http://tracker.swfstats.com/Games/" + page) + ".html?guid=") + GUID) + "&swfid=") + SWFID) + "&") + data) + "&url=") + SourceUrl) + "&") + Random)));
}
public static function Play():void{
if (!Enabled){
return;
};
Plays++;
Send("Play", ("plays=" + Plays));
}
private static function GetUrl(defaulturl:String):String{
var url:String;
var defaulturl = defaulturl;
if (ExternalInterface.available){
url = String(ExternalInterface.call("window.location.href.toString"));
//unresolved jump
var _slot1 = s;
url = defaulturl;
} else {
if (defaulturl.indexOf("http://") == 0){
url = defaulturl;
};
};
if ((((((url == null)) || ((url == "")))) || ((url == "null")))){
if ((((Security.sandboxType == "localWithNetwork")) || ((Security.sandboxType == "localTrusted")))){
url = "http://local-testing/";
} else {
url = null;
};
};
return (url);
}
private static function ErrorHandler(... _args):void{
Enabled = false;
}
public static function LevelRangedMetric(name:String, level, value:int):void{
if (!Enabled){
return;
};
Send("LevelMetricRanged", ((((("name=" + escape(name)) + "&level=") + level) + "&value=") + value));
}
private static function StatusChange(... _args):void{
}
public static function Goal(n:int, name:String):void{
}
private static function PingServer(... _args):void{
if (!Enabled){
return;
};
Pings++;
Send("Ping", (((FirstPing) ? "&firstping=yes" : "" + "&pings=") + Pings));
if (FirstPing){
PingF.stop();
PingR.addEventListener(TimerEvent.TIMER, PingServer);
PingR.start();
FirstPing = false;
};
}
public static function LevelAverageMetric(name:String, level, value:int):void{
if (!Enabled){
return;
};
Send("LevelMetricAverage", ((((("name=" + escape(name)) + "&level=") + level) + "&value=") + value));
}
public static function CustomMetric(name:String, group:String=null):void{
if (!Enabled){
return;
};
if (group == null){
group = "";
};
Send("CustomMetric", ((("name=" + escape(name)) + "&group=") + escape(group)));
}
}
}//package SWFStats
Section 26
//Tile (TileMap.Tile)
package TileMap {
import flash.display.*;
public class Tile {
public var obRef:Object;
public var solution:SolutionTile;
public var left:DisplayObject;
public var up:DisplayObject;
public var right:DisplayObject;
public var occupied:DisplayObject;
public var down:DisplayObject;
public var walkable:Boolean;
public var f:int;// = 0
public var g:int;// = 0
public var parent:Tile;
public var objects:Array;
public var h:int;// = 0
public var iRef:int;
public var x:int;// = 0
public var y:int;// = 0
public var arrayRef:Array;
public function Tile(walkable:Boolean=true){
g = 0;
h = 0;
f = 0;
x = 0;
y = 0;
objects = [];
super();
this.walkable = walkable;
}
public function addObject(object:Object):void{
objects.push(object);
}
public function removeObject(object:Object):void{
var i:int;
i = objects.indexOf(object);
objects.splice(i, 1);
}
}
}//package TileMap
Section 27
//TileMap (TileMap.TileMap)
package TileMap {
public class TileMap {
private var width:int;
private var height:int;
private var map:Array;
public function TileMap(width:int=0, height:int=0){
super();
this.width = width;
this.height = height;
initialize();
}
public function getMapArray():Array{
return (map);
}
public function getTile(x:int, y:int){
if (outOfBoundsCheck(x, y)){
return (map[x][y]);
};
}
public function setWalkable(x:int, y:int, walkable:Boolean):void{
if (outOfBoundsCheck(x, y)){
Tile(map[x][y]).walkable = walkable;
};
}
public function isWalkable(x:int, y:int):Boolean{
if (outOfBoundsCheck(x, y)){
return (Tile(map[x][y]).walkable);
};
return (false);
}
public function initialize():void{
var x:int;
var y:int;
map = new Array(width);
x = 0;
while (x < width) {
map[x] = new Array(height);
y = 0;
while (y < height) {
map[x][y] = new Tile();
map[x][y].x = x;
map[x][y].y = y;
y++;
};
x++;
};
}
public function outOfBoundsCheck(x:int, y:int):Boolean{
if ((((((((x < 0)) || ((x > (width - 1))))) || ((y < 0)))) || ((y > (height - 1))))){
return (false);
};
return (true);
}
public function getWidth():int{
return (width);
}
public function getHeight():int{
return (height);
}
}
}//package TileMap
Section 28
//ChatEvent (Tools.ChatEvent)
package Tools {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class ChatEvent extends MovieClip {
public var textToDisplay:Array;
public var text:TextField;
public var cont:TextField;
private var canDisplayNextTextPiece:Boolean;// = false
public var keepText:Boolean;// = false
public var shield:MovieClip;
public var chatEnded:Boolean;// = false
public var started:Boolean;// = false
public var removed:Boolean;// = false
private var nextNum:int;
public var Dialog_Background:MovieClip;
private var persistant:Boolean;// = false
private var nextText:int;// = 0
public function ChatEvent(myText:Array=null, persistant:Boolean=false){
nextText = 0;
canDisplayNextTextPiece = false;
chatEnded = false;
keepText = false;
started = false;
removed = false;
persistant = false;
super();
if (myText != null){
this.persistant = persistant;
this.text.text = "";
textToDisplay = myText;
};
}
public function eFrame(e:Event){
tick();
}
public function removeMe(){
if (!removed){
removeEventListener(Event.ENTER_FRAME, eFrame);
if (!persistant){
if (parent){
stage.removeEventListener(MouseEvent.MOUSE_UP, mDown);
parent.removeChild(this);
};
} else {
stage.removeEventListener(MouseEvent.MOUSE_UP, mDown);
removeChild(shield);
cont.visible = false;
};
removed = true;
};
}
public function tick(){
removeEventListener(Event.ENTER_FRAME, tick);
if (nextNum < textToDisplay[nextText].length){
this.text.text = (this.text.text + textToDisplay[nextText].charAt(nextNum));
nextNum++;
} else {
if (nextText < (textToDisplay.length - 1)){
if (!keepText){
canDisplayNextTextPiece = true;
} else {
nextText++;
nextNum = 0;
this.text.text = (this.text.text + ("\n" + "\n"));
};
} else {
chatEnded = true;
};
};
}
private function mDown(e:MouseEvent){
showText();
}
public function showText(){
var i:int;
if (canDisplayNextTextPiece){
nextText++;
nextNum = 0;
if (!keepText){
this.text.text = "";
} else {
this.text.text = (this.text.text + "\n");
};
canDisplayNextTextPiece = false;
} else {
if (chatEnded){
ended = true;
removeMe();
} else {
if (keepText){
this.text.text = "";
i = 0;
while (i <= (textToDisplay.length - 1)) {
this.text.text = (this.text.text + textToDisplay[i]);
if (i != nextText){
this.text.text = (this.text.text + ("\n" + "\n"));
};
i++;
};
chatEnded = true;
canDisplayNextTextPiece = false;
nextText = (textToDisplay.length - 1);
nextNum = textToDisplay[nextText].length;
addTaskAccept();
} else {
this.text.text = textToDisplay[nextText];
nextNum = textToDisplay[nextText].length;
};
};
};
}
public function startChat(){
stage.addEventListener(MouseEvent.MOUSE_DOWN, mDown);
started = true;
addEventListener(Event.ENTER_FRAME, eFrame);
}
}
}//package Tools
Section 29
//SoundManager (Tools.SoundManager)
package Tools {
import flash.media.*;
import flash.events.*;
import flash.display.*;
public class SoundManager {
private var fadeRate:Number;// = 0.01
private var eventTicker:Sprite;
private var soundArray:Array;
private var soundTrack:Sound;
private var soundPan:Number;
private var fadingOut:Boolean;// = false
private var volume:Number;// = 1
private var soundFade:Number;// = 0
private var soundChannel:SoundChannel;
private var fadingIn:Boolean;// = false
private static var instance:SoundManager;
public function SoundManager():void{
fadingIn = false;
fadingOut = false;
soundFade = 0;
fadeRate = 0.01;
volume = 1;
eventTicker = new Sprite();
soundArray = [];
super();
if (!instance){
instance = this;
} else {
trace("USE GET INSTANCE");
};
eventTicker.addEventListener(Event.ENTER_FRAME, tick);
}
public function playSound(sound:Sound, loops:int=0, volume:Number=1, start:Number=0, pan:Number=0){
var mySound:*;
var myChannel:SoundChannel;
mySound = sound;
myChannel = mySound.play(start, loops);
myChannel.soundTransform = new SoundTransform(volume, pan);
trace("PLAY SOUND");
}
private function manageTracks():void{
if (soundArray.length > 0){
if (((((!(fadingOut)) && (!((soundTrack == null))))) && (!(fadingIn)))){
stopTrack();
trace("STOP TRACK");
} else {
if (((!(fadingOut)) && (!(fadingIn)))){
playTrack(soundArray[(soundArray.length - 1)]);
soundArray = [];
trace("PLAY TRACK");
};
};
};
}
private function fadeIn(event:Event):void{
if ((((soundFade < volume)) && (fadingIn))){
soundFade = (soundFade + fadeRate);
soundChannel.soundTransform = new SoundTransform(soundFade, soundPan);
} else {
eventTicker.removeEventListener(Event.ENTER_FRAME, fadeIn);
fadingIn = false;
};
}
private function tick(e:Event):void{
manageTracks();
}
public function configure(fadeRate:Number, volume:Number){
this.fadeRate = fadeRate;
this.volume = volume;
}
public function stopTrack():void{
if (soundTrack){
eventTicker.addEventListener(Event.ENTER_FRAME, fadeOut);
fadingOut = true;
};
}
public function addTrack(track:Sound):void{
trace("ADDED TRACK");
soundArray.push(track);
}
private function fadeOut(event:Event):void{
if ((((soundFade > 0)) && (fadingOut))){
soundFade = (soundFade - fadeRate);
soundChannel.soundTransform = new SoundTransform(soundFade, soundPan);
} else {
eventTicker.removeEventListener(Event.ENTER_FRAME, fadeOut);
soundChannel.stop();
fadingOut = false;
soundTrack = null;
};
}
private function playTrack(track:Sound, loops:int=9999, startVolume:Number=0, start:Number=0, pan:Number=0):void{
soundTrack = track;
soundChannel = soundTrack.play(start, loops);
soundChannel.soundTransform = new SoundTransform(startVolume, pan);
soundFade = startVolume;
soundPan = pan;
eventTicker.addEventListener(Event.ENTER_FRAME, fadeIn);
fadingIn = true;
}
public static function getInstance():SoundManager{
if (!instance){
instance = new (SoundManager);
};
return (instance);
}
}
}//package Tools
Section 30
//arrowMc1 (arrowMc1)
package {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class arrowMc1 extends MovieClip {
public function arrowMc1(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 31
//arrowMc2 (arrowMc2)
package {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class arrowMc2 extends MovieClip {
public function arrowMc2(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 32
//arrowMc3 (arrowMc3)
package {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class arrowMc3 extends MovieClip {
public function arrowMc3(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 33
//arrowMc4 (arrowMc4)
package {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class arrowMc4 extends MovieClip {
public function arrowMc4(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 34
//assetHolder (assetHolder)
package {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class assetHolder extends MovieClip {
public function assetHolder(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 35
//bat_creature_impact_01 (bat_creature_impact_01)
package {
import flash.media.*;
public dynamic class bat_creature_impact_01 extends Sound {
public function bat_creature_impact_01(){
super();
}
}
}//package
Section 36
//BlueStar (BlueStar)
package {
import flash.display.*;
public dynamic class BlueStar extends MovieClip {
public function BlueStar(){
super();
}
}
}//package
Section 37
//brown_circle_impact_01 (brown_circle_impact_01)
package {
import flash.media.*;
public dynamic class brown_circle_impact_01 extends Sound {
public function brown_circle_impact_01(){
super();
}
}
}//package
Section 38
//button_hover_01 (button_hover_01)
package {
import flash.media.*;
public dynamic class button_hover_01 extends Sound {
public function button_hover_01(){
super();
}
}
}//package
Section 39
//button_hover_02 (button_hover_02)
package {
import flash.media.*;
public dynamic class button_hover_02 extends Sound {
public function button_hover_02(){
super();
}
}
}//package
Section 40
//catMc (catMc)
package {
import flash.display.*;
public dynamic class catMc extends MovieClip {
public function catMc(){
super();
}
}
}//package
Section 41
//click_01 (click_01)
package {
import flash.media.*;
public dynamic class click_01 extends Sound {
public function click_01(){
super();
}
}
}//package
Section 42
//die_fail_01 (die_fail_01)
package {
import flash.media.*;
public dynamic class die_fail_01 extends Sound {
public function die_fail_01(){
super();
}
}
}//package
Section 43
//die_fail_02 (die_fail_02)
package {
import flash.media.*;
public dynamic class die_fail_02 extends Sound {
public function die_fail_02(){
super();
}
}
}//package
Section 44
//EditorComplete (EditorComplete)
package {
import flash.display.*;
import flash.text.*;
public dynamic class EditorComplete extends MovieClip {
public var levelName:TextField;
public var quit:SimpleButton;
public var save:SimpleButton;
public var saveError:MovieClip;
public var share:SimpleButton;
public var go:SimpleButton;
public var code:TextField;
public var userName:TextField;
public function EditorComplete(){
super();
}
}
}//package
Section 45
//Entity (Entity)
package {
import flash.display.*;
import TileMap.*;
public class Entity extends MovieClip {
private var lastDir:String;
public var clip:MovieClip;
private var speed:Number;
public var xStep:Number;// = 0
private var level:Level;
public var evil:Boolean;
private var dir:String;
public var hitter:MovieClip;
public var yStep:Number;// = 0
public function Entity(dir:String, level:Level){
yStep = 0;
xStep = 0;
super();
evil = false;
lastDir = "";
speed = 3;
this.dir = dir;
this.level = level;
}
public function setSpeed(value:Number){
speed = value;
}
public function getDir(){
return (dir);
}
public function rotate(){
if (lastDir != dir){
if (dir == "down"){
clip.gotoAndStop(1);
} else {
if (dir == "left"){
clip.gotoAndStop(2);
} else {
if (dir == "up"){
clip.gotoAndStop(3);
} else {
if (dir == "right"){
clip.gotoAndStop(4);
};
};
};
};
lastDir = dir;
};
}
public function changeDir(value:String=""){
if (value == ""){
if (dir == "up"){
dir = "right";
} else {
if (dir == "right"){
dir = "down";
} else {
if (dir == "down"){
dir = "left";
} else {
if (dir == "left"){
dir = "up";
};
};
};
};
} else {
dir = value;
};
}
public function hitTest(){
var tile:Tile;
tile = level.getTileMap().getTile(Math.floor((x / level.getTileSize())), Math.floor((y / level.getTileSize())));
if (x == ((tile.x * level.getTileSize()) + (level.getTileSize() / 2))){
if (y == ((tile.y * level.getTileSize()) + (level.getTileSize() / 2))){
if (dir == "up"){
if (tile.up){
if (tile.right){
if (tile.left){
dir = "down";
} else {
dir = "left";
};
} else {
changeDir();
};
};
} else {
if (dir == "down"){
if (tile.down){
if (tile.left){
if (tile.right){
dir = "up";
} else {
dir = "right";
};
} else {
changeDir();
};
};
};
};
if (dir == "right"){
if (tile.right){
if (tile.down){
if (tile.up){
dir = "left";
} else {
dir = "up";
};
} else {
changeDir();
};
};
} else {
if (dir == "left"){
if (tile.left){
if (tile.up){
if (tile.down){
dir = "right";
} else {
dir = "down";
};
} else {
changeDir();
};
};
};
};
};
};
}
public function update(){
hitTest();
rotate();
move();
}
public function move(){
if (dir == "up"){
yStep = (yStep - speed);
} else {
if (dir == "down"){
yStep = (yStep + speed);
} else {
if (dir == "right"){
xStep = (xStep + speed);
} else {
if (dir == "left"){
xStep = (xStep - speed);
};
};
};
};
y = yStep;
x = xStep;
}
public function testAgainst(arr:Array):Boolean{
var ob:Entity;
for each (ob in arr) {
if (hitter.hitTestPoint(ob.x, ob.y)){
return (true);
};
};
return (false);
}
}
}//package
Section 46
//GamerSafe (GamerSafe)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
public class GamerSafe extends Sprite {
private const _storedPasscode:String = "G191ffcca2441a68b51197ee2eaf810d7cdf1c9647:1273004791";
private const _storedHashseed:String = "caf98806a528726a851ab93b63f0fc2f6ad9fe9f";
private var _evt_onScoreSubmitted:Function;// = null
private var _stageHeight:Number;// = 400
private var _evt_onLevelVaultLevelRated:Function;// = null
private var _evt_onOtherGameProfileReceived:Function;// = null
private var _evt_onLevelVaultLevelEdited:Function;// = null
private var _evt_onMetaData:Function;// = null
private var _levelVaultTempAttributes:Object;
private var _evt_accountChange:Function;// = null
private var _evt_onRegistrationFormClosed:Function;// = null
private var _evt_apiReady:Function;// = null
private var _evt_itemPurchase:Function;// = null
private var _context:LoaderContext;
private var _evt_onLevelVaultLevelStringsSet:Function;// = null
private var _evt_login:Function;// = null
private var _evt_onScoreboardError:Function;// = null
private var _levelVaultLastError:String;// = ""
private var _evt_beginSession:Function;// = null
private var _gamerSafe:Object;// = null
private var _evt_onLevelVaultLevelNumericsSet:Function;// = null
private var _evt_confYes:Function;// = null
private var _status:String;// = "Loading"
private var _inUse:Boolean;// = false
private var _loaded:Boolean;// = false
private var _evt_useChanged:Function;// = null
private var _loader:Loader;
private var _request:URLRequest;
private var _evt_onLoginFormClosed:Function;// = null
private var _referrer:String;// = ""
private var _evt_itemPurchaseFailed:Function;// = null
private var _tmpSkin:Object;
private var _stage:Stage;
private var _evt_onUnregisteredName:Function;// = null
private var _evt_onLevelVaultGotLevel:Function;// = null
private var _evt_useEnded:Function;// = null
private var _evt_networkingError:Function;// = null
private var _evt_loginFailed:Function;// = null
private var _evt_onLevelVaultLevelCreated:Function;// = null
private var _evt_onLevelVaultGotLevels:Function;// = null
private var _evt_onScoreboardRecieved:Function;// = null
private var _evt_onConsumptionCompleted:Function;// = null
private var _evt_onLevelVaultLevelNumericsIncremented:Function;// = null
private var _evt_useStarted:Function;// = null
private var _stageWidth:Number;// = 550
private var _evt_onMetaDataError:Function;// = null
private var _evt_beginSessionFailed:Function;// = null
private var _evt_confNo:Function;// = null
private var _evt_onLevelVaultLevelDeleted:Function;// = null
private var _evt_onLevelVaultLevelFlagged:Function;// = null
private var _evt_onLevelVaultLevelAttributesChanged:Function;// = null
public static const EVT_OTHER_GAME_PROFILE_RECEIVED:String = "other_game_profile_received";
public static const EVT_LEVELVAULT_LEVEL_FLAGGED:String = "level_flagged";
public static const EVT_ITEM_PURCHASE_FAILED:String = "item_purchase_failed";
public static const EVT_LEVELVAULT_GOT_SINGLE_LEVEL:String = "got_level";
public static const EVT_BEGIN_SESSION_FAILED:String = "begin_session_failed";
public static const EVT_ACCOUNT_CHANGE:String = "account_change";
public static const EVT_SCOREBOARD_ENTRIES_RECEIVED:String = "scoreboard_entries_received";
public static const EVT_LEVELVAULT_LEVEL_NUMERICS_INCREMENTED:String = "level_numerics_incremented";
public static const EVT_LEVELVAULT_LEVEL_CREATED:String = "level_created";
public static const EVT_METADATA:String = "metadata";
public static const META_SORT_ASC:int = 1;
public static const EVT_LEVELVAULT_LEVEL_RATED:String = "level_rated";
public static const EVT_LEVELVAULT_LEVEL_STRINGS_SET:String = "level_strings_set";
public static const EVT_ITEM_PURCHASE:String = "item_purchase";
public static const EVT_LEVELVAULT_LEVEL_NUMERICS_SET:String = "level_numerics_set";
public static const EVT_REGISTRATION_FORM_CLOSED:String = "register_close";
public static const EVT_BEGIN_SESSION:String = "begin_session";
public static const EVT_LEVELVAULT_LEVEL_DELETED:String = "level_deleted";
public static const EVT_LOGIN:String = "login";
public static const EVT_LOGIN_FORM_CLOSED:String = "login_close";
public static const EVT_LEVELVAULT_GOT_LEVELS:String = "got_levels";
public static const META_SORT_DESC:int = 2;
public static const EVT_NETWORKING_ERROR:String = "networking_error";
public static const EVT_METADATA_ERROR:String = "metadata_error";
public static const version:String = "01";
public static const EVT_LEVELVAULT_LEVEL_EDITED:String = "level_edited";
public static const EVT_SCOREBOARD_ENTRIES_ERROR:String = "scoreboard_entries_error";
public static const EVT_CONSUMPTION_COMPLETED:String = "consumption_completed";
public static const EVT_LOGIN_FAILED:String = "login_failed";
public static const EVT_UNREGISTERED_NAME:String = "unregistered_name";
public static const EVT_SCOREBOARD_ENTRY_SUBMITTED:String = "scoreboard_entry_submitted";
protected static var _instance:GamerSafe = null;
public function GamerSafe(parent){
var parent = parent;
_status = "Loading";
_loaded = false;
_stageWidth = 550;
_stageHeight = 400;
_inUse = false;
_tmpSkin = {};
_levelVaultTempAttributes = {};
_levelVaultLastError = "";
_referrer = "";
_loader = new Loader();
_context = new LoaderContext(true);
_request = new URLRequest((("http://components.gamersafe.com/GamerSafe." + version) + ".swf"));
_evt_networkingError = null;
_evt_accountChange = null;
_evt_login = null;
_evt_loginFailed = null;
_evt_beginSession = null;
_evt_beginSessionFailed = null;
_evt_itemPurchase = null;
_evt_itemPurchaseFailed = null;
_evt_apiReady = null;
_evt_confYes = null;
_evt_confNo = null;
_evt_useStarted = null;
_evt_useEnded = null;
_evt_useChanged = null;
_evt_onScoreboardError = null;
_evt_onScoreboardRecieved = null;
_evt_onScoreSubmitted = null;
_evt_onMetaData = null;
_evt_onMetaDataError = null;
_evt_onUnregisteredName = null;
_evt_onConsumptionCompleted = null;
_evt_onRegistrationFormClosed = null;
_evt_onLoginFormClosed = null;
_evt_onOtherGameProfileReceived = null;
_evt_onLevelVaultGotLevel = null;
_evt_onLevelVaultGotLevels = null;
_evt_onLevelVaultLevelAttributesChanged = null;
_evt_onLevelVaultLevelCreated = null;
_evt_onLevelVaultLevelEdited = null;
_evt_onLevelVaultLevelDeleted = null;
_evt_onLevelVaultLevelFlagged = null;
_evt_onLevelVaultLevelRated = null;
_evt_onLevelVaultLevelNumericsIncremented = null;
_evt_onLevelVaultLevelNumericsSet = null;
_evt_onLevelVaultLevelStringsSet = null;
_gamerSafe = null;
super();
if (_instance == null){
_instance = this;
} else {
trace("GamerSafe: Instance Error: The GamerSafe class is a singleton and should only be constructed once. Use Gamersafe.instance instead.");
return;
};
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_context.applicationDomain = ApplicationDomain.currentDomain;
_status = "Downloading";
_loader.load(_request, _context);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoadingError);
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadingComplete);
//unresolved jump
var _slot1 = s;
_status = "Failed";
trace("Security error - GamerSafe library cannot load");
_loader = null;
addEventListener(Event.ADDED_TO_STAGE, setupStage);
if ((((((parent is Sprite)) || ((parent is MovieClip)))) || ((parent is Stage)))){
parent.addChild(this);
} else {
trace("Incompatible parent!");
};
}
public function get loaded():Boolean{
return (_loaded);
}
public function levelVaultRegisterPersistentErrorCallback(callback:Function, ... _args):void{
var a:Array;
var i:*;
a = [];
a.push(callback);
for each (i in _args) {
a.push(i);
};
(_gamerSafe.levelVaultRegisterPersistentErrorCallback as Function).apply(this, a);
}
public function levelVaultRegisterErrorCallback(callback:Function, ... _args):void{
var a:Array;
var i:*;
a = [];
a.push(callback);
for each (i in _args) {
a.push(i);
};
(_gamerSafe.levelVaultRegisterErrorCallback as Function).apply(this, a);
}
public function set highScore(value:Number):void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.highScore = value;
}
private function e_onBeginSessionFailed(e:Event):void{
if (_evt_beginSessionFailed != null){
_evt_beginSessionFailed();
};
dispatchEvent(e);
}
public function levelVaultIncrementNumerics(levelOrLevelId, keys:Array):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultIncrementNumerics(levelOrLevelId, keys));
}
public function levelVaultGetLastSelectedLevel():Object{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", null));
};
return (_gamerSafe.levelVaultGetLastSelectedLevel());
}
public function get onOtherGameProfileReceived():Function{
return (_evt_onOtherGameProfileReceived);
}
public function get gamerTestMode():Boolean{
if (_loaded == false){
return (false);
};
return (_gamerSafe.gamerTestMode);
}
public function get onUseStarted():Function{
return (_evt_useStarted);
}
public function hasAchievement(achievementId:int):Boolean{
if (_loaded == false){
return (false);
};
if (inSession == false){
return (false);
};
return (_gamerSafe.hasAchievement(achievementId));
}
public function get failed():Boolean{
if (_loaded == false){
return (false);
};
return (_gamerSafe.failed);
}
private function e_onOtherGameProfileReceived(e:Event):void{
if (_evt_onOtherGameProfileReceived != null){
_evt_onOtherGameProfileReceived();
};
dispatchEvent(e);
}
private function e_onRegistrationFormClosed(e:Event):void{
if (_evt_onRegistrationFormClosed != null){
_evt_onRegistrationFormClosed();
};
dispatchEvent(e);
}
private function e_onBeginSession(e:Event):void{
if (_evt_beginSession != null){
_evt_beginSession();
};
dispatchEvent(e);
}
public function showStatusBar(configuration:Object=null):void{
if (_loaded == false){
return;
};
_gamerSafe.showStatusBar(configuration);
}
private function e_onLevelVaultLevelStringsSet(e:Event):void{
if (_evt_onLevelVaultLevelStringsSet != null){
_evt_onLevelVaultLevelStringsSet();
};
dispatchEvent(e);
}
private function e_onLevelVaultLevelNumericsIncremented(e:Event):void{
if (_evt_onLevelVaultLevelNumericsIncremented != null){
_evt_onLevelVaultLevelNumericsIncremented();
};
dispatchEvent(e);
}
public function closeItemInterface():void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.closeItemInterface();
}
public function get onMetaDataError():Function{
return (_evt_onMetaDataError);
}
public function set onOtherGameProfileReceived(func:Function):void{
_evt_onOtherGameProfileReceived = func;
}
private function e_onLevelVaultLevelEdited(e:Event):void{
if (_evt_onLevelVaultLevelEdited != null){
_evt_onLevelVaultLevelEdited();
};
dispatchEvent(e);
}
public function get latestItemConsumptionInfo():Object{
if (_loaded == false){
return (null);
};
return (_gamerSafe.getLatestItemConsumptionInfo());
}
public function levelVaultFetchLevelByID(levelId:int):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultFetchLevelByID(levelId));
}
private function e_onMetaDataError(e:Event):void{
if (_evt_onMetaDataError != null){
_evt_onMetaDataError();
};
dispatchEvent(e);
}
public function set onLevelVaultLevelEdited(func:Function):void{
_evt_onLevelVaultLevelEdited = func;
}
public function get onBeginSessionFailed():Function{
return (_evt_beginSessionFailed);
}
public function get levelVaultLastSelectedLevelsReceipt():int{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", 0));
};
return (_gamerSafe.levelVaultLastSelectedLevelsReceipt);
}
private function get levelVaultEventObject():EventDispatcher{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", null));
};
return (_gamerSafe.levelVaultEventObject);
}
private function e_onUseEnded(e):void{
if (_inUse == false){
return;
};
_inUse = false;
if (_evt_useChanged != null){
_evt_useChanged();
};
if (_evt_useEnded != null){
_evt_useEnded();
};
dispatchEvent(new Event("inUseEnded"));
dispatchEvent(new Event("inUseChanged"));
}
public function set onScoreSubmitted(func:Function):void{
_evt_onScoreSubmitted = func;
}
public function set onUseStarted(func:Function):void{
_evt_useStarted = func;
}
public function get onUseEnded():Function{
return (_evt_useEnded);
}
public function set onMetaData(func:Function):void{
_evt_onMetaData = func;
}
public function get onAccountChange():Function{
return (_evt_accountChange);
}
private function e_onConfirmNo(e:Event):void{
if (_evt_confNo != null){
_evt_confNo();
};
dispatchEvent(new Event("confirmedNo"));
}
public function get onLevelVaultLevelNumericsIncremented():Function{
return (_evt_onLevelVaultLevelNumericsIncremented);
}
public function get onItemPurchase():Function{
return (_evt_itemPurchase);
}
public function set onScoreboardRecieved(func:Function):void{
_evt_onScoreboardRecieved = func;
}
public function levelVaultSetExpiringStringAttribute(levelOrLevelId, key:String, value:String, expires:String):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (levelVaultSetExpiringStringAttributes(levelOrLevelId, [key], [value], [expires]));
}
public function bestowAchievement(achievementId:uint):Boolean{
if (_loaded == false){
return (false);
};
_gamerSafe.bestowAchievement(achievementId);
return (true);
}
public function get onLogin():Function{
return (_evt_login);
}
private function e_onAccountChange(e:Event):void{
if (_evt_accountChange != null){
_evt_accountChange();
};
dispatchEvent(e);
}
public function levelVaultGetLevelsByDateCreated(start_date:String, end_date:String, ascending:Boolean=true, limit:uint=20, offset:uint=0):int{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", 0));
};
return (_gamerSafe.levelVaultGetLevelsByDateCreated(start_date, end_date, ascending, limit, offset));
}
public function hasItem(itemId:int):Boolean{
if (_loaded == false){
return (false);
};
if (inSession == false){
return (false);
};
return (_gamerSafe.hasItem(itemId));
}
public function requestMetaDataByType(metatype:int, maxPlayers:int=1000):void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.requestMetaDataByType(metatype, maxPlayers);
}
public function get levelVaultLastEditedLevelID():uint{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", 0));
};
return (_gamerSafe.levelVaultGetLastEditedLevelID());
}
public function levelVaultSetStringAttributes(levelOrLevelId, keys:Array, data:Array):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultSetStringAttributes(levelOrLevelId, keys, data));
}
public function get username():String{
if (_loaded == false){
return ("GamerSafe");
};
return (_gamerSafe.username);
}
public function levelVaultSetExpiringNumericAttribute(levelOrLevelId, key:String, value:Number, expires:String):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (levelVaultSetExpiringNumericAttributes(levelOrLevelId, [key], [value], [expires]));
}
public function set onMetaDataError(func:Function):void{
_evt_onMetaDataError = func;
}
private function e_onConfirmYes(e:Event):void{
if (_evt_confYes != null){
_evt_confYes();
};
dispatchEvent(new Event("confirmedYes"));
}
public function get onLevelVaultLevelDeleted():Function{
return (_evt_onLevelVaultLevelDeleted);
}
public function levelVaultSetAttributes(levelOrLevelId, attributes:Object):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultSetAttributes(levelOrLevelId, attributes));
}
public function set onUseEnded(func:Function):void{
_evt_useEnded = func;
}
public function set onUseChanged(func:Function):void{
_evt_useChanged = func;
}
private function e_onLevelVaultLevelAttributesChanged(e:Event):void{
if (_evt_onLevelVaultLevelAttributesChanged != null){
_evt_onLevelVaultLevelAttributesChanged();
};
dispatchEvent(e);
}
public function levelVaultGetLevelsByRating(min_rating:Number, max_rating:Number, ascending:Boolean=true, limit:uint=20, offset:uint=0):int{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", 0));
};
return (_gamerSafe.levelVaultGetLevelsByRating(min_rating, max_rating, ascending, limit, offset));
}
public function requestOtherGameProfile(otherGamePasscode:String):void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.requestOtherGameProfile(otherGamePasscode);
}
public function set onBeginSessionFailed(func:Function):void{
_evt_beginSessionFailed = func;
}
public function get onLevelVaultLevelStringsSet():Function{
return (_evt_onLevelVaultLevelStringsSet);
}
public function set onLevelVaultLevelRated(func:Function):void{
_evt_onLevelVaultLevelRated = func;
}
private function e_onUnregisteredName(e:Event):void{
if (_evt_onUnregisteredName != null){
_evt_onUnregisteredName();
};
dispatchEvent(e);
}
public function levelVaultRateLevel(levelOrLevelId, rating:uint):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultRateLevel(levelOrLevelId, rating));
}
private function levelVaultCreateLevelFromObject(level:Object):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultCreateLevelFromObject(level));
}
public function get onBeginSession():Function{
return (_evt_beginSession);
}
public function consumeItem(itemId:int, numToConsume:int):void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.consumeItem(itemId, numToConsume);
}
public function get levelVaultReady():Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultReady);
}
public function levelVaultRegisterCallback(callback:Function, ... _args):void{
var a:Array;
var i:*;
a = [];
a.push(callback);
for each (i in _args) {
a.push(i);
};
(_gamerSafe.levelVaultRegisterCallback as Function).apply(this, a);
}
public function get signupUrl():String{
if (_loaded == false){
return ("");
};
return (_gamerSafe.signupUrl);
}
public function get onLevelVaultLevelFlagged():Function{
return (_evt_onLevelVaultLevelFlagged);
}
public function get levelVaultShareCookie():String{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", null));
};
return (_gamerSafe.levelVaultShareCookie);
}
public function set onAccountChange(func:Function):void{
_evt_accountChange = func;
}
public function levelVaultFail(reason:String, returnValue=false){
trace("[ LevelVault Error:", reason, "]");
_levelVaultLastError = reason;
return (returnValue);
}
public function set onApiReady(func:Function):void{
_evt_apiReady = func;
}
public function set onLevelVaultLevelNumericsIncremented(func:Function):void{
_evt_onLevelVaultLevelNumericsIncremented = func;
}
public function levelVaultGetLevelsByDateModified(start_date:String, end_date:String, ascending:Boolean=true, limit:uint=20, offset:uint=0):int{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", 0));
};
return (_gamerSafe.levelVaultGetLevelsByDateModified(start_date, end_date, ascending, limit, offset));
}
public function set onItemPurchase(func:Function):void{
_evt_itemPurchase = func;
}
private function e_onLevelVaultGotLevel(e:Event):void{
if (_evt_onLevelVaultGotLevel != null){
_evt_onLevelVaultGotLevel();
};
dispatchEvent(e);
}
public function get onConsumptionCompleted():Function{
return (_evt_onConsumptionCompleted);
}
private function e_onLevelVaultLevelNumericsSet(e:Event):void{
if (_evt_onLevelVaultLevelNumericsSet != null){
_evt_onLevelVaultLevelNumericsSet();
};
dispatchEvent(e);
}
public function get levelVaultLastCreatedLevelID():uint{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", 0));
};
return (_gamerSafe.levelVaultGetLastCreatedLevelID());
}
public function get wantsNewsletter():Boolean{
if (_loaded == false){
return (false);
};
return (_gamerSafe.wantsNewsletter);
}
public function get onConfirmNo():Function{
return (_evt_confNo);
}
public function enable():void{
if (_status == "Disabled"){
_status = "Ready";
_loaded = true;
};
}
public function get paymentUrl():String{
if (_loaded == false){
return ("");
};
return (_gamerSafe.paymentUrl);
}
public function logout():void{
if (_loaded == false){
return;
};
_gamerSafe.logout();
}
public function set partner(partner:String):void{
if (_loaded == false){
return;
};
_gamerSafe.setPartner(partner);
}
public function get latestScoreboardEntries():Object{
if (_loaded == false){
return (null);
};
return (_gamerSafe.getLatestScoreboardEntries());
}
private function e_onScoreboardError(e:Event):void{
if (_evt_onScoreboardError != null){
_evt_onScoreboardError();
};
dispatchEvent(e);
}
public function set onItemPurchaseFailed(func:Function):void{
_evt_itemPurchaseFailed = func;
}
public function get onLoginFailed():Function{
return (_evt_loginFailed);
}
public function levelVaultGetLastSelectedLevels():Array{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", []));
};
return (_gamerSafe.levelVaultGetLastSelectedLevels());
}
public function get latestItemPurchaseInfo():Object{
if (_loaded == false){
return (null);
};
return (_gamerSafe.getLatestItemPurchaseInfo());
}
public function set onLogin(func:Function):void{
_evt_login = func;
}
private function beginSession(gamePasscode:String, gameHashseed:String):Boolean{
if (_loaded == false){
return (false);
};
_gamerSafe.beginSession(gamePasscode, gameHashseed, _referrer);
return (true);
}
public function get onRegistrationFormClosed():Function{
return (_evt_onRegistrationFormClosed);
}
public function get inSession():Boolean{
if (_loaded == false){
return (false);
};
return (_gamerSafe.inSession);
}
private function onLoadingError(e:IOErrorEvent):void{
_loaded = false;
_status = "Failed";
trace("Failed to load GamerSafe");
}
public function setRegistrationDefaults(defaults:Object):void{
if (_loaded == false){
return;
};
_gamerSafe.setRegisterDefaults(defaults);
}
public function levelVaultGetLevelRating(level:Object=null):Number{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", 0));
};
return (_gamerSafe.levelVaultGetLevelRating(level));
}
public function get onLevelVaultGotLevel():Function{
return (_evt_onLevelVaultGotLevel);
}
public function get gamerXP():uint{
if (_loaded == false){
return (0);
};
return (_gamerSafe.gamerXP);
}
public function levelVaultGetLevelsByNumericData(key:String, min:Number, max:Number, ascending:Boolean=true, limit:uint=20, offset:uint=0):int{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", 0));
};
return (_gamerSafe.levelVaultGetLevelsByNumericData(key, min, max, ascending, limit, offset));
}
public function levelVaultIncrementNumeric(levelOrLevelId, key:String):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultIncrementNumeric(levelOrLevelId, key));
}
public function get latestOtherGameProfile():Object{
if (_loaded == false){
return (null);
};
return (_gamerSafe.getLatestOtherGameProfile());
}
public function setMetaData(metatype:int, value:Number):void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
if (!loggedIn){
return;
};
_gamerSafe.setMetaData(metatype, value);
}
private function e_onUseStarted(e):void{
if (_inUse == true){
return;
};
_inUse = true;
if (_evt_useChanged != null){
_evt_useChanged();
};
if (_evt_useStarted != null){
_evt_useStarted();
};
dispatchEvent(new Event("inUseStarted"));
dispatchEvent(new Event("inUseChanged"));
}
public function set onLevelVaultLevelAttributesChanged(func:Function):void{
_evt_onLevelVaultLevelAttributesChanged = func;
}
private function levelVaultSetTempAttributes(e:Event):void{
removeEventListener(GamerSafe.EVT_LEVELVAULT_LEVEL_CREATED, levelVaultSetTempAttributes);
levelVaultSetAttributes(levelVaultLastCreatedLevelID, _levelVaultTempAttributes);
_levelVaultTempAttributes = {};
}
public function set onLevelVaultLevelDeleted(func:Function):void{
_evt_onLevelVaultLevelDeleted = func;
}
public function set onScoreboardError(func:Function):void{
_evt_onScoreboardError = func;
}
public function set autoLogin(value:Boolean):void{
if (_loaded == false){
return;
};
_gamerSafe.autoLogin = value;
}
private function e_onScoreboardRecieved(e:Event):void{
if (_evt_onScoreboardRecieved != null){
_evt_onScoreboardRecieved();
};
dispatchEvent(e);
}
public function levelVaultCreateLevel(levelData):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
if (loggedIn == false){
return (levelVaultFail("You must be logged in to create levels"));
};
if ((levelData is ByteArray)){
return (levelVaultCreateLevelFromBytes(levelData));
};
return (levelVaultCreateLevelFromObject(levelData));
}
public function flashBar():void{
if (_loaded == false){
return;
};
_gamerSafe.flashBar();
}
public function levelVaultFlagLevel(levelOrLevelId):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultFlagLevel(levelOrLevelId));
}
public function set achievementPopupPosition(point:Point):void{
if (_loaded == false){
return;
};
_gamerSafe.achievementPopupPosition = point;
}
public function showScoreSubmit(score:Number, extra:String, showAsTime:Boolean=false, scoreboardID:int=-1):void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.showScoreSubmitPrompt(score, extra, scoreboardID, showAsTime);
}
private function levelVaultCreateLevelFromBytes(levelData:ByteArray):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultCreateLevel(levelData));
}
public function hideInterface():void{
if (_loaded == false){
return;
};
_gamerSafe.visible = false;
}
public function set onUnregisteredName(func:Function):void{
_evt_onUnregisteredName = func;
}
public function get highScore():Number{
if (_loaded == false){
return (0);
};
if (inSession == false){
return (0);
};
return (_gamerSafe.highScore);
}
public function get inUse():Boolean{
return (_inUse);
}
public function levelVaultEditLevel(levelOrLevelId, levelData:ByteArray):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
if (loggedIn == false){
return (levelVaultFail("You must be logged in to edit levels"));
};
return (_gamerSafe.levelVaultEditLevel(levelOrLevelId, levelData));
}
public function get account():Object{
if (_loaded == false){
return (null);
};
return (_gamerSafe.account);
}
public function levelVaultSetNumericAttributes(levelOrLevelId, keys:Array, data:Array):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultSetNumericAttributes(levelOrLevelId, keys, data));
}
public function set savedGame(save:String):void{
if (_loaded == false){
return;
};
_gamerSafe.savedGame = save;
}
public function levelVaultGetLevelNumRatings(level:Object=null):int{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", 0));
};
return (_gamerSafe.levelVaultGetLevelNumRatings(level));
}
public function get applicationDomain():ApplicationDomain{
return (_loader.contentLoaderInfo.applicationDomain);
}
public function set onLevelVaultLevelStringsSet(func:Function):void{
_evt_onLevelVaultLevelStringsSet = func;
}
public function get iconUrl():String{
if (_loaded == false){
return ("");
};
return (_gamerSafe.iconUrl);
}
private function e_onNetworkingError(e:Event):void{
if (_evt_networkingError != null){
_evt_networkingError();
};
dispatchEvent(e);
}
public function showRegistrationForm():void{
if (_loaded == false){
return;
};
_gamerSafe.showRegistrationForm();
}
private function e_onLevelVaultLevelCreated(e:Event):void{
if (_evt_onLevelVaultLevelCreated != null){
_evt_onLevelVaultLevelCreated();
};
dispatchEvent(e);
}
public function get onScoreSubmitted():Function{
return (_evt_onScoreSubmitted);
}
public function get onMetaData():Function{
return (_evt_onMetaData);
}
public function get loggedIn():Boolean{
if (_loaded == false){
return (false);
};
return (_gamerSafe.loggedIn);
}
public function set onBeginSession(func:Function):void{
_evt_beginSession = func;
}
public function get onScoreboardRecieved():Function{
return (_evt_onScoreboardRecieved);
}
public function set onLevelVaultLevelFlagged(func:Function):void{
_evt_onLevelVaultLevelFlagged = func;
}
private function e_onLoginFormClosed(e:Event):void{
if (_evt_onLoginFormClosed != null){
_evt_onLoginFormClosed();
};
dispatchEvent(e);
}
public function get onLevelVaultLevelEdited():Function{
return (_evt_onLevelVaultLevelEdited);
}
private function e_onMetaData(e:Event):void{
if (_evt_onMetaData != null){
_evt_onMetaData();
};
dispatchEvent(e);
}
private function e_onItemPurchaseFailed(e:Event):void{
if (_evt_itemPurchaseFailed != null){
_evt_itemPurchaseFailed();
};
dispatchEvent(e);
}
public function setStyle(name:String, value):void{
var o:Object;
if (_loaded == false){
_tmpSkin[name] = value;
return;
};
o = new Object();
o[name] = value;
_gamerSafe.setSkin(o);
}
public function showScoreboard(scoreboardId:int=-1):void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.showScoreboard(scoreboardId);
}
public function levelVaultSetStringAttribute(levelOrLevelId, key:String, value:String):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultSetStringAttribute(levelOrLevelId, key, value));
}
public function showLogin(configuration:Object=null):void{
if (_loaded == false){
return;
};
_gamerSafe.showLogin(configuration);
}
public function requestMetaDataByValue(metatype:int, minValue:Number, maxValue:Number, maxPlayers:int=-1, sortOrder:int=1):void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.requestMetaDataByValue(metatype, minValue, maxValue, maxPlayers, sortOrder);
}
private function setupStage(e:Event):void{
if (stage == null){
return;
};
_stage = stage;
_stage.addEventListener(Event.RESIZE, resizeStage);
_stageWidth = stage.stageWidth;
_stageHeight = stage.stageHeight;
if (root != null){
_referrer = root.loaderInfo.loaderURL;
};
if (loaded){
_gamerSafe.componentWidth = _stageWidth;
_gamerSafe.componentHeight = _stageHeight;
_stage.addChild((_gamerSafe as Sprite));
};
}
public function get onUseChanged():Function{
return (_evt_useChanged);
}
public function saveToScoreboard(score:Number, extra:String, scoreboardID:int=-1, unregistered_name:String=""):void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.saveToScoreboard(score, extra, scoreboardID, unregistered_name);
}
public function get onLevelVaultLevelRated():Function{
return (_evt_onLevelVaultLevelRated);
}
private function e_onConsumptionCompleted(e:Event):void{
if (_evt_onConsumptionCompleted != null){
_evt_onConsumptionCompleted();
};
dispatchEvent(e);
}
public function set onConfirmYes(func:Function):void{
_evt_confYes = func;
}
public function get FAQUrl():String{
if (_loaded == false){
return ("");
};
return (_gamerSafe.FAQUrl);
}
public function bestowFreeItem(itemID:int):Boolean{
if (_loaded == false){
return (false);
};
_gamerSafe.bestowFreeItem(itemID);
return (true);
}
public function set onLevelVaultGotLevels(func:Function):void{
_evt_onLevelVaultGotLevels = func;
}
public function get countryCode():String{
if (_loaded == false){
return ("");
};
if (inSession == false){
return ("");
};
return (_gamerSafe.countryCode);
}
public function get onApiReady():Function{
return (_evt_apiReady);
}
public function levelVaultSetNumericAttribute(levelOrLevelId, key:String, value:Number):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultSetNumericAttribute(levelOrLevelId, key, value));
}
public function levelVaultDeleteLevel(levelOrLevelId):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultDeleteLevel(levelOrLevelId));
}
private function resizeStage(e:Event):void{
if (loaded == false){
return;
};
_stageWidth = _stage.stageWidth;
_stageHeight = _stage.stageHeight;
_gamerSafe.componentWidth = _stageWidth;
_gamerSafe.componentHeight = _stageHeight;
}
private function onLoadingComplete(e:Event):void{
var levelVaultListener:EventDispatcher;
_status = "Ready";
_loaded = true;
_gamerSafe = (_loader.content as Object);
_gamerSafe.componentWidth = _stageWidth;
_gamerSafe.componentHeight = _stageHeight;
_gamerSafe.setSkin(_tmpSkin);
_gamerSafe.addEventListener(EVT_NETWORKING_ERROR, e_onNetworkingError);
_gamerSafe.addEventListener(EVT_ACCOUNT_CHANGE, e_onAccountChange);
_gamerSafe.addEventListener(EVT_LOGIN, e_onLogin);
_gamerSafe.addEventListener(EVT_LOGIN_FAILED, e_onLoginFailed);
_gamerSafe.addEventListener(EVT_BEGIN_SESSION, e_onBeginSession);
_gamerSafe.addEventListener(EVT_BEGIN_SESSION_FAILED, e_onBeginSessionFailed);
_gamerSafe.addEventListener(EVT_ITEM_PURCHASE, e_onItemPurchase);
_gamerSafe.addEventListener(EVT_ITEM_PURCHASE_FAILED, e_onItemPurchaseFailed);
_gamerSafe.addEventListener("yes", e_onConfirmYes);
_gamerSafe.addEventListener("no", e_onConfirmNo);
_gamerSafe.addEventListener("dialog_begin", e_onUseStarted);
_gamerSafe.addEventListener("dialog_end", e_onUseEnded);
_gamerSafe.addEventListener(EVT_SCOREBOARD_ENTRIES_ERROR, e_onScoreboardError);
_gamerSafe.addEventListener(EVT_SCOREBOARD_ENTRIES_RECEIVED, e_onScoreboardRecieved);
_gamerSafe.addEventListener(EVT_SCOREBOARD_ENTRY_SUBMITTED, e_onScoreSubmitted);
_gamerSafe.addEventListener(EVT_METADATA, e_onMetaData);
_gamerSafe.addEventListener(EVT_METADATA_ERROR, e_onMetaDataError);
_gamerSafe.addEventListener(EVT_UNREGISTERED_NAME, e_onUnregisteredName);
_gamerSafe.addEventListener(EVT_CONSUMPTION_COMPLETED, e_onConsumptionCompleted);
_gamerSafe.addEventListener(EVT_REGISTRATION_FORM_CLOSED, e_onRegistrationFormClosed);
_gamerSafe.addEventListener(EVT_LOGIN_FORM_CLOSED, e_onLoginFormClosed);
_gamerSafe.addEventListener(EVT_OTHER_GAME_PROFILE_RECEIVED, e_onOtherGameProfileReceived);
levelVaultListener = levelVaultEventObject;
levelVaultListener.addEventListener(EVT_LEVELVAULT_GOT_LEVELS, e_onLevelVaultGotLevels);
levelVaultListener.addEventListener(EVT_LEVELVAULT_GOT_SINGLE_LEVEL, e_onLevelVaultGotLevel);
levelVaultListener.addEventListener(EVT_LEVELVAULT_LEVEL_CREATED, e_onLevelVaultLevelCreated);
levelVaultListener.addEventListener(EVT_LEVELVAULT_LEVEL_DELETED, e_onLevelVaultLevelDeleted);
levelVaultListener.addEventListener(EVT_LEVELVAULT_LEVEL_EDITED, e_onLevelVaultLevelEdited);
levelVaultListener.addEventListener(EVT_LEVELVAULT_LEVEL_FLAGGED, e_onLevelVaultLevelFlagged);
levelVaultListener.addEventListener(EVT_LEVELVAULT_LEVEL_RATED, e_onLevelVaultLevelRated);
levelVaultListener.addEventListener(EVT_LEVELVAULT_LEVEL_NUMERICS_SET, e_onLevelVaultLevelNumericsSet);
levelVaultListener.addEventListener(EVT_LEVELVAULT_LEVEL_STRINGS_SET, e_onLevelVaultLevelStringsSet);
levelVaultListener.addEventListener(EVT_LEVELVAULT_LEVEL_NUMERICS_INCREMENTED, e_onLevelVaultLevelNumericsIncremented);
levelVaultListener.addEventListener(EVT_LEVELVAULT_LEVEL_NUMERICS_SET, e_onLevelVaultLevelAttributesChanged);
levelVaultListener.addEventListener(EVT_LEVELVAULT_LEVEL_STRINGS_SET, e_onLevelVaultLevelAttributesChanged);
levelVaultListener.addEventListener(EVT_LEVELVAULT_LEVEL_NUMERICS_INCREMENTED, e_onLevelVaultLevelAttributesChanged);
if (_stage != null){
_stage.addChild((_gamerSafe as Sprite));
};
if (root != null){
_referrer = root.loaderInfo.loaderURL;
};
if (_storedPasscode != ""){
beginSession(_storedPasscode, _storedHashseed);
};
showStatusBar();
e_onApiReady(new Event("apiReady"));
}
public function showAchievements(configuration:Object=null):void{
if (_loaded == false){
return;
};
_gamerSafe.showAchievements(configuration);
}
public function requestMetaDataForAccount(accountID:int=-1):void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.requestMetaDataForAccount(accountID);
}
private function get sprite():Sprite{
if (_loaded == false){
return (null);
};
return (_gamerSafe.sprite);
}
public function levelVaultGetLevelData(level:Object=null):ByteArray{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", null));
};
return (_gamerSafe.levelVaultGetLevelData(level));
}
private function e_onApiReady(e:Event):void{
if (_evt_apiReady != null){
_evt_apiReady();
};
dispatchEvent(e);
}
public function get onItemPurchaseFailed():Function{
return (_evt_itemPurchaseFailed);
}
public function set onConsumptionCompleted(func:Function):void{
_evt_onConsumptionCompleted = func;
}
private function e_onScoreSubmitted(e:Event):void{
if (_evt_onScoreSubmitted != null){
_evt_onScoreSubmitted();
};
dispatchEvent(e);
}
public function get onLevelVaultLevelAttributesChanged():Function{
return (_evt_onLevelVaultLevelAttributesChanged);
}
public function disable():void{
if (_status == "Ready"){
_status = "Disabled";
_loaded = false;
};
}
private function e_onLogin(e:Event):void{
if (_evt_login != null){
_evt_login();
};
flashBar();
dispatchEvent(e);
}
private function e_onLevelVaultGotLevels(e:Event):void{
if (_evt_onLevelVaultGotLevels != null){
_evt_onLevelVaultGotLevels();
};
dispatchEvent(e);
}
public function get autoLogin():Boolean{
if (_loaded == false){
return (false);
};
return (_gamerSafe.autoLogin);
}
public function getItemById(item_id:int):Object{
var _items:Array;
var i:Object;
if (_loaded == false){
return (null);
};
if (inSession == false){
return (null);
};
_items = items;
for each (i in _items) {
if (i.id == item_id){
return (i);
};
};
return (null);
}
public function set wantsNewsletter(wants:Boolean):void{
if (_loaded == true){
_gamerSafe.wantsNewsletter = wants;
};
}
public function set onConfirmNo(func:Function):void{
_evt_confNo = func;
}
public function get onUnregisteredName():Function{
return (_evt_onUnregisteredName);
}
public function get unregisteredName():String{
if (_loaded == false){
return ("");
};
return (_gamerSafe.unregisteredName);
}
public function get achievementPopupPosition():Point{
if (_loaded == false){
return (new Point(0, 0));
};
return (_gamerSafe.achievementPopupPosition);
}
public function levelVaultGetLevelID(level:Object=null):uint{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", null));
};
return (_gamerSafe.levelVaultGetLevelID(level));
}
public function get savedGame():String{
if (_loaded == false){
return ("");
};
if (_gamerSafe.savedGame == null){
return ("");
};
return (_gamerSafe.savedGame);
}
public function showMessageBox(title:String, text:String, isConfirm:Boolean=true):void{
if (_loaded == false){
return;
};
_gamerSafe.messageBox(title, text, isConfirm);
}
public function get onScoreboardError():Function{
return (_evt_onScoreboardError);
}
public function get achievements():Array{
if (_loaded == false){
return ([]);
};
if (inSession == false){
return ([]);
};
return (_gamerSafe.achievementList);
}
public function set onNetworkingError(func:Function):void{
_evt_networkingError = func;
}
public function get startingTime():Date{
if (_loaded == false){
return (null);
};
if (inSession == false){
return (null);
};
return (_gamerSafe.startingTime);
}
public function levelVaultSetExpiringStringAttributes(levelOrLevelId, keys:Array, data:Array, expires:Array):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultSetExpiringStringAttributes(levelOrLevelId, keys, data, expires));
}
public function levelVaultGetLevelAsObject(level:Object=null):Object{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", null));
};
return (_gamerSafe.levelVaultGetLevelAsObject(level));
}
public function get gamerGold():uint{
if (_loaded == false){
return (0);
};
return (_gamerSafe.gamerGold);
}
private function e_onLoginFailed(e:Event):void{
if (_evt_loginFailed != null){
_evt_loginFailed();
};
dispatchEvent(e);
}
public function set onLoginFailed(func:Function):void{
_evt_loginFailed = func;
}
public function set onRegistrationFormClosed(func:Function):void{
_evt_onRegistrationFormClosed = func;
}
public function get onLevelVaultGotLevels():Function{
return (_evt_onLevelVaultGotLevels);
}
public function levelVaultCreateLevelWithAttributes(levelData, attributes:Object):Boolean{
if (levelVaultCreateLevel(levelData)){
_levelVaultTempAttributes = attributes;
addEventListener(GamerSafe.EVT_LEVELVAULT_LEVEL_CREATED, levelVaultSetTempAttributes);
return (true);
};
return (levelVaultFail(_levelVaultLastError));
}
public function get onConfirmYes():Function{
return (_evt_confYes);
}
public function set onLevelVaultLevelCreated(func:Function):void{
_evt_onLevelVaultLevelCreated = func;
}
public function login(username:String, password:String, rememberMe:Boolean=false):void{
if (_loaded == false){
return;
};
_gamerSafe.login(username, password, rememberMe);
}
public function levelVaultGetLevelAttributes(level:Object=null):Array{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", []));
};
return (_gamerSafe.levelVaultGetLevelAttributes(level));
}
public function levelVaultSetExpiringNumericAttributes(levelOrLevelId, keys:Array, data:Array, expires:Array):Boolean{
if (_loaded == false){
return (levelVaultFail("API not yet loaded"));
};
return (_gamerSafe.levelVaultSetExpiringNumericAttributes(levelOrLevelId, keys, data, expires));
}
public function set onLoginFormClosed(func:Function):void{
_evt_onLoginFormClosed = func;
}
private function e_onLevelVaultLevelDeleted(e:Event):void{
if (_evt_onLevelVaultLevelDeleted != null){
_evt_onLevelVaultLevelDeleted();
};
dispatchEvent(e);
}
public function tryAutoLogin():void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.tryAutoLogin();
}
public function levelVaultGetLevelAsCustomObject(type:Class, level:Object=null){
if (_loaded == false){
return (levelVaultFail("API not yet loaded", null));
};
return (_gamerSafe.levelVaultGetLevelAsCustomObject(type, level));
}
public function set onLevelVaultGotLevel(func:Function):void{
_evt_onLevelVaultGotLevel = func;
}
public function requestScoreboardEntries(scoreboardID:int=-1):void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.requestScoreboardEntries(scoreboardID);
}
public function set onLevelVaultLevelNumericsSet(func:Function):void{
_evt_onLevelVaultLevelNumericsSet = func;
}
public function showShop(configuration:Object=null):void{
if (_loaded == false){
return;
};
_gamerSafe.showShop(configuration);
}
public function get onNetworkingError():Function{
return (_evt_networkingError);
}
public function hideStatusBar():void{
if (_loaded == false){
return;
};
_gamerSafe.hideStatusBar();
}
public function get levelVaultLastError():String{
return (_levelVaultLastError);
}
private function e_onLevelVaultLevelRated(e:Event):void{
if (_evt_onLevelVaultLevelStringsSet != null){
_evt_onLevelVaultLevelStringsSet();
};
dispatchEvent(e);
}
public function levelVaultGetLevelsByStringData(key:String, value:String, ascending:Boolean=true, limit:uint=20, offset:uint=0):int{
if (_loaded == false){
return (levelVaultFail("API not yet loaded", 0));
};
return (_gamerSafe.levelVaultGetLevelsByStringData(key, value, ascending, limit, offset));
}
public function closeScoreboard():void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.closeScoreboard();
}
public function showPopup(text:String, configuration:Object=null):void{
if (_loaded == false){
return;
};
_gamerSafe.showPopup(text, configuration);
}
public function get onLevelVaultLevelCreated():Function{
return (_evt_onLevelVaultLevelCreated);
}
public function get latestMetaDataResult():Array{
if (_loaded == false){
return ([]);
};
return (_gamerSafe.metaData);
}
public function purchaseItem(itemID:int, priceID:int=0):Boolean{
if (_loaded == false){
return (false);
};
return (_gamerSafe.purchaseItem(itemID, priceID));
}
public function requestUnregisteredName():void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.requestUnregisteredUserName();
}
public function get onLoginFormClosed():Function{
return (_evt_onLoginFormClosed);
}
public function getConsumptionsAvailable(itemId:int):int{
if (_loaded == false){
return (0);
};
if (inSession == false){
return (0);
};
return (_gamerSafe.getConsumptionsAvailable(itemId));
}
private function e_onLevelVaultLevelFlagged(e:Event):void{
if (_evt_onLevelVaultLevelFlagged != null){
_evt_onLevelVaultLevelFlagged();
};
dispatchEvent(e);
}
public function get items():Array{
if (_loaded == false){
return ([]);
};
if (inSession == false){
return ([]);
};
return (_gamerSafe.itemList);
}
public function get gamerPoints():uint{
if (_loaded == false){
return (0);
};
return (_gamerSafe.gamerPoints);
}
public function get onLevelVaultLevelNumericsSet():Function{
return (_evt_onLevelVaultLevelNumericsSet);
}
private function e_onItemPurchase(e:Event):void{
if (_evt_itemPurchase != null){
_evt_itemPurchase();
};
dispatchEvent(e);
}
public function purchaseItemInterface(itemId:int, priceID:int=0):void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.purchaseItemInterface(itemId, priceID);
}
public function get status():String{
return (_status);
}
public function get isGamerGoldPurchaseDisabled():Boolean{
if (_loaded == false){
return (true);
};
return (_gamerSafe.isGamerGoldPurchasingDisabled);
}
public function setShopCategoryVisible(category:int, visible:Boolean):void{
if (_loaded == false){
return;
};
_gamerSafe.setShopCategoryVisible(category, visible);
}
public static function get api():GamerSafe{
if (_instance == null){
trace("GamerSafe: Instance Error: Attempted to get instance before initial construction.");
return (null);
};
return (_instance);
}
public static function get apiLoaded():Boolean{
return (!((_instance == null)));
}
}
}//package
Section 47
//gui (gui)
package {
import flash.display.*;
public dynamic class gui extends MovieClip {
public var bad:MovieClip;
public var left:MovieClip;
public var entity:MovieClip;
public var right:MovieClip;
public var pUp:arrowMc1;
public var pDown:arrowMc3;
public var quit:SimpleButton;
public var pLeft:arrowMc4;
public var reload:SimpleButton;
public var test:MovieClip;
public var down:MovieClip;
public var up:MovieClip;
public var pRight:arrowMc2;
public var pit:MovieClip;
public var rocket:MovieClip;
public var piece:MovieClip;
public function gui(){
super();
}
}
}//package
Section 48
//help1 (help1)
package {
import flash.display.*;
public dynamic class help1 extends MovieClip {
public function help1(){
super();
}
}
}//package
Section 49
//helpL1 (helpL1)
package {
import flash.display.*;
public dynamic class helpL1 extends MovieClip {
public function helpL1(){
super();
}
}
}//package
Section 50
//highMc (highMc)
package {
import flash.display.*;
public dynamic class highMc extends MovieClip {
public function highMc(){
super();
}
}
}//package
Section 51
//hitter (hitter)
package {
import flash.display.*;
public dynamic class hitter extends MovieClip {
public function hitter(){
super();
}
}
}//package
Section 52
//Intro (Intro)
package {
import flash.events.*;
import flash.display.*;
import SWFStats.*;
import flash.net.*;
import CPMStar.*;
import flash.text.*;
public class Intro extends MovieClip {
public var loader:MovieClip;
private var count:int;
public var cb:SimpleButton;
public var start:SimpleButton;
public var max:int;
public var callBack:Function;
public var adBox:MovieClip;
public var pct:TextField;
public function Intro(s:Stage, func:Function, showad:Boolean=true):void{
var CPMStarContentSpotID:String;
var ad:DisplayObject;
super();
addFrameScript(0, frame1, 1, frame2);
if (showad){
CPMStarContentSpotID = "2766Q7538611B";
ad = new AdLoader(CPMStarContentSpotID);
adBox.addChild(ad);
adBox.addEventListener(MouseEvent.CLICK, trackAd);
} else {
adBox.visible = false;
};
x = 320;
y = 240;
count = 0;
callBack = func;
s.addChild(this);
this.stage.frameRate = 25;
max = 250;
loader.gotoAndStop(1);
addEventListener(Event.ENTER_FRAME, tick);
start.visible = false;
cb.addEventListener(MouseEvent.CLICK, goBuddy);
}
public function tickMe(e:Event){
count++;
if (count == max){
removeEventListener(Event.ENTER_FRAME, tickMe);
stage.removeChild(this);
callBack.apply();
};
}
public function goSite(e:MouseEvent){
var targetURL:URLRequest;
targetURL = new URLRequest("http://www.gaminghero.com");
navigateToURL(targetURL, "_blank");
}
private function startGame(e:MouseEvent){
Log.Play();
addEventListener(Event.ENTER_FRAME, tickMe);
gotoAndPlay(2);
}
function frame1(){
stop();
}
public function tick(e:Event):void{
var loadedData:Number;
var allData:Number;
var percent:Number;
loadedData = this.stage.loaderInfo.bytesLoaded;
allData = this.stage.loaderInfo.bytesTotal;
percent = Math.round(((loadedData / allData) * 100));
loader.gotoAndStop(percent);
pct.text = (percent.toString() + "%");
if (loadedData >= allData){
start.visible = true;
start.addEventListener(MouseEvent.CLICK, startGame);
removeEventListener(Event.ENTER_FRAME, tick);
};
}
function frame2(){
stop();
}
public function goBuddy(e:MouseEvent){
var targetURL:URLRequest;
targetURL = new URLRequest("http://www.coolbuddy.com/?cid=220");
navigateToURL(targetURL, "_blank");
Log.CustomMetric("sponsor home", "link track");
Log.CustomMetric("sponsor total", "link track");
}
private function trackAd(e:MouseEvent){
Log.CustomMetric("ad clicked", "link track");
}
}
}//package
Section 53
//Level (Level)
package {
import Tools.*;
import flash.events.*;
import flash.utils.*;
import com.adobe.serialization.json.*;
import flash.display.*;
import TileMap.*;
import SWFStats.*;
import com.dynamicflash.util.*;
import flash.net.*;
public class Level extends Sprite {
private var userMode:MovieClip;
private var editDir:String;
private var rockets:Array;
private var solIcon:MovieClip;
private var allObjects:Array;
private var gameStarted:Boolean;
private var pits:Array;
private var compiledOb:Object;
private var saveScreen:MovieClip;
private var sprite:Sprite;
private var editMode:Boolean;
private var editGui:MovieClip;
private var upAmount:int;
private var badEntities:Array;
private var solutionsPlaced:Array;
private var loadScreen:MovieClip;
private var complete:MovieClip;
private var standardGui:MovieClip;
private var leftAmount:int;
private var pieces:Array;
private var solutionLayer:Sprite;
private var levelNum:int;
private var levelCode:String;
private var solutionTiles:Array;
private var downAmount:int;
public var wonGame:Boolean;
private var rightAmount:int;
private var entities:Array;
private var tileMap:TileMap;
private var tileSize:int;
private var editObject:String;
public function Level(editMode:Boolean=false, code:String="", userLevel:MovieClip=null, levelNum:int=0){
super();
this.levelNum = levelNum;
wonGame = false;
userMode = userLevel;
if (editMode){
gameStarted = false;
createBlankLevel();
addBorders();
startEditMode();
} else {
startLevel(code);
};
if (userMode){
};
}
private function guiStandardUpdate(e:Event){
var nx:int;
var ny:int;
if (((((editObject) && (!(gameStarted)))) && (solIcon))){
if (editObject == "solution"){
nx = Math.floor((mouseX / tileSize));
ny = Math.floor((mouseY / tileSize));
solIcon.x = ((nx * tileSize) + (tileSize / 2));
solIcon.y = ((ny * tileSize) + (tileSize / 2));
solIcon.mouseEnabled = false;
solIcon.mouseChildren = false;
if (editDir == "up"){
if (upAmount > 0){
solIcon.visible = true;
solIcon.gotoAndStop(1);
} else {
solIcon.visible = false;
};
};
if (editDir == "down"){
if (downAmount > 0){
solIcon.visible = true;
solIcon.gotoAndStop(2);
} else {
solIcon.visible = false;
};
};
if (editDir == "right"){
if (rightAmount > 0){
solIcon.visible = true;
solIcon.gotoAndStop(3);
} else {
solIcon.visible = false;
};
};
if (editDir == "left"){
if (leftAmount > 0){
solIcon.visible = true;
solIcon.gotoAndStop(4);
} else {
solIcon.visible = false;
};
};
if ((((((((nx < 0)) || ((ny < 0)))) || ((nx > (tileMap.getWidth() - 1))))) || ((ny > (tileMap.getHeight() - 1))))){
solIcon.visible = false;
};
} else {
solIcon.visible = false;
};
};
if (editDir == "up"){
standardGui.pUp.gotoAndStop(2);
} else {
standardGui.pUp.gotoAndStop(1);
};
if (editDir == "down"){
standardGui.pDown.gotoAndStop(2);
} else {
standardGui.pDown.gotoAndStop(1);
};
if (editDir == "right"){
standardGui.pRight.gotoAndStop(2);
} else {
standardGui.pRight.gotoAndStop(1);
};
if (editDir == "left"){
standardGui.pLeft.gotoAndStop(2);
} else {
standardGui.pLeft.gotoAndStop(1);
};
standardGui.upTxt.mouseEnabled = false;
standardGui.downTxt.mouseEnabled = false;
standardGui.leftTxt.mouseEnabled = false;
standardGui.rightTxt.mouseEnabled = false;
if (upAmount > 0){
standardGui.pUp.visible = true;
standardGui.upTxt.visible = true;
standardGui.upTxt.text = ("x" + upAmount.toString());
} else {
standardGui.pUp.visible = false;
standardGui.upTxt.visible = false;
};
if (downAmount > 0){
standardGui.pDown.visible = true;
standardGui.downTxt.visible = true;
standardGui.downTxt.text = ("x" + downAmount.toString());
} else {
standardGui.pDown.visible = false;
standardGui.downTxt.visible = false;
};
if (rightAmount > 0){
standardGui.pRight.visible = true;
standardGui.rightTxt.visible = true;
standardGui.rightTxt.text = ("x" + rightAmount.toString());
} else {
standardGui.pRight.visible = false;
standardGui.rightTxt.visible = false;
};
if (leftAmount > 0){
standardGui.pLeft.visible = true;
standardGui.leftTxt.visible = true;
standardGui.leftTxt.text = ("x" + leftAmount.toString());
} else {
standardGui.pLeft.visible = false;
standardGui.leftTxt.visible = false;
};
if (gameStarted){
standardGui.start.gotoAndStop(2);
} else {
standardGui.start.gotoAndStop(1);
};
}
private function saveLevel(e:MouseEvent){
var l:String;
var o:Object;
if (((Main.getInstance().loggedIn) && (Main.getInstance().gamerSafeReady))){
Main.getInstance().tracer("CREATING LEVELS");
l = (levelCode as String);
o = new Object();
o.data = l;
GamerSafe.api.levelVaultCreateLevelWithAttributes(o, {data:levelCode, name:complete.levelName.text, plays:0, creator:complete.userName.text});
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_LEVEL_CREATED, levelSaved);
saveScreen = new loadingScreen();
saveScreen.txt.text = "Saving Level...";
saveScreen.cancel.addEventListener(MouseEvent.CLICK, cancelMe);
addChild(saveScreen);
complete.save.visible = false;
} else {
complete.saveError.visible = true;
};
}
public function getStandardGui():MovieClip{
return (standardGui);
}
private function closeEdit(e:MouseEvent){
removeChild(complete);
Main.getInstance().removeChild(this);
Main.getInstance().addMain();
}
public function getPieces():Array{
return (pieces);
}
private function changeStateLeft(e:MouseEvent){
editDir = "left";
}
private function changeStateEnt(e:MouseEvent){
editObject = "entity";
}
private function startLevel(s:String){
createLevel(s);
addStandardGui();
}
public function quitLevel(e:MouseEvent){
this.parent.removeChild(this);
Main.getInstance().addMain();
}
private function testPitEntities(r:MovieClip){
var en:Entity;
for each (en in entities) {
if (en.hitter.hitTestObject(r.hitter)){
gameOver();
SoundManager.getInstance().playSound(new brown_circle_impact_01());
SoundManager.getInstance().playSound(new die_fail_01());
};
};
}
private function test(e:MouseEvent){
if (!gameStarted){
levelCode = compileObjects();
runGame();
editGui.test.gotoAndStop(2);
} else {
gameOver();
editGui.test.gotoAndStop(1);
};
}
public function getEditGui():MovieClip{
return (editGui);
}
private function drawTiles(){
sprite.addChild(new tileBg());
}
private function addListeners(){
editGui.piece.addEventListener(MouseEvent.CLICK, changeStatePiece);
editGui.entity.addEventListener(MouseEvent.CLICK, changeStateEnt);
editGui.bad.addEventListener(MouseEvent.CLICK, changeStateBad);
editGui.rocket.addEventListener(MouseEvent.CLICK, changeStateRock);
editGui.pit.addEventListener(MouseEvent.CLICK, changeStatePit);
editGui.up.addEventListener(MouseEvent.CLICK, changeStateUp);
editGui.right.addEventListener(MouseEvent.CLICK, changeStateRight);
editGui.down.addEventListener(MouseEvent.CLICK, changeStateDown);
editGui.left.addEventListener(MouseEvent.CLICK, changeStateLeft);
editGui.pUp.addEventListener(MouseEvent.CLICK, changeStateSup);
editGui.pRight.addEventListener(MouseEvent.CLICK, changeStateSright);
editGui.pDown.addEventListener(MouseEvent.CLICK, changeStateSdown);
editGui.pLeft.addEventListener(MouseEvent.CLICK, changeStateSleft);
editGui.addEventListener(Event.ENTER_FRAME, guiUpdate);
addEventListener(MouseEvent.CLICK, addObject);
editGui.test.addEventListener(MouseEvent.CLICK, test);
editGui.reload.addEventListener(MouseEvent.CLICK, loadCode);
}
private function addBadEntity(x:int, y:int, startDir:String, container:Sprite){
var tile:Tile;
var e:Entity;
var mc:MovieClip;
tile = tileMap.getTile(x, y);
if (!tile.occupied){
e = new Entity(startDir, this);
mc = new catMc();
e.addChild(mc);
e.clip = mc;
e.rotate();
e.x = ((x * tileSize) + (tileSize / 2));
e.y = ((y * tileSize) + (tileSize / 2));
e.yStep = e.y;
e.xStep = e.x;
e.evil = true;
e.hitter = new hitter();
e.addChild(e.hitter);
badEntities.push(e);
container.addChild(e);
tile.occupied = e;
tile.arrayRef = badEntities;
tile.iRef = (badEntities.length - 1);
trace((badEntities.length - 1));
} else {
trace(tile.iRef);
sprite.removeChild(tile.occupied);
tile.occupied = null;
tile.arrayRef[tile.iRef] = null;
};
}
public function begin(e:MouseEvent){
if (((!(gameStarted)) && (!(editMode)))){
runGame();
} else {
gameOver();
};
}
public function createBlankLevel(){
compiledOb = new Object();
sprite = new Sprite();
sprite.x = 3;
sprite.y = 5;
solutionLayer = new Sprite();
addChild(sprite);
tileMap = new TileMap(12, 9);
pieces = [];
entities = [];
rockets = [];
pits = [];
solutionsPlaced = [];
solutionTiles = [];
badEntities = [];
tileSize = 45;
drawTiles();
sprite.addChild(solutionLayer);
solIcon = new tileIcon();
solutionLayer.addChild(solIcon);
solIcon.visible = false;
}
private function changeStatePiece(e:MouseEvent){
editObject = "piece";
}
private function changeStateSleft(e:MouseEvent){
editObject = "solution";
editDir = "left";
}
private function update(){
var en:Entity;
var b:Entity;
var r:MovieClip;
var p:MovieClip;
trace(badEntities.length);
for each (en in entities) {
en.update();
testAgainstTiles(en);
};
for each (b in badEntities) {
b.update();
testAgainstTiles(b);
if (b.testAgainst(entities)){
SoundManager.getInstance().playSound(new bat_creature_impact_01());
SoundManager.getInstance().playSound(new die_fail_02());
gameOver();
};
};
for each (r in rockets) {
testRocketEntities(r);
testRocketBadEntities(r);
};
for each (p in pits) {
testPitEntities(p);
testPitBadEntities(p);
};
}
private function addPiece(x:int, y:int, dir:String, container:Sprite, push:Boolean=true, border:Boolean=false){
var p:MovieClip;
var placed:Boolean;
var i:int;
p = new piece();
placed = false;
p.ox = x;
p.oy = y;
if (!border){
if ((((dir == "up")) && ((y < 1)))){
return (null);
};
if ((((dir == "down")) && ((y >= (tileMap.getHeight() - 1))))){
return (null);
};
if ((((dir == "left")) && ((x < 1)))){
return (null);
};
if ((((dir == "right")) && ((x >= (tileMap.getWidth() - 1))))){
return (null);
};
};
if (dir == "up"){
placed = true;
p.x = ((x * tileSize) + (tileSize / 2));
p.y = (y * tileSize);
if (tileMap.getTile(x, y)){
if (tileMap.getTile(x, y).up){
p = tileMap.getTile(x, y).up;
placed = false;
tileMap.getTile(x, y).up = null;
} else {
tileMap.getTile(x, y).up = p;
};
};
if (tileMap.getTile(x, (y - 1))){
if (tileMap.getTile(x, (y - 1)).down){
p = tileMap.getTile(x, (y - 1)).down;
placed = false;
tileMap.getTile(x, (y - 1)).down = null;
} else {
tileMap.getTile(x, (y - 1)).down = p;
};
};
};
if (dir == "down"){
p.x = ((x * tileSize) + (tileSize / 2));
p.y = ((y + 1) * tileSize);
placed = true;
if (tileMap.getTile(x, y)){
if (tileMap.getTile(x, y).down){
p = tileMap.getTile(x, y).down;
placed = false;
tileMap.getTile(x, y).down = null;
} else {
tileMap.getTile(x, y).down = p;
};
};
if (tileMap.getTile(x, (y + 1))){
if (tileMap.getTile(x, (y + 1)).up){
p = tileMap.getTile(x, (y + 1)).up;
placed = false;
tileMap.getTile(x, (y + 1)).up = null;
} else {
tileMap.getTile(x, (y + 1)).up = p;
};
};
};
if (dir == "right"){
p.rotation = (p.rotation + 90);
p.x = ((x + 1) * tileSize);
p.y = ((y * tileSize) + (tileSize / 2));
placed = true;
if (tileMap.getTile(x, y)){
if (tileMap.getTile(x, y).right){
p = tileMap.getTile(x, y).right;
placed = false;
tileMap.getTile(x, y).right = null;
} else {
tileMap.getTile(x, y).right = p;
};
};
if (tileMap.getTile((x + 1), y)){
if (tileMap.getTile((x + 1), y).left){
p = tileMap.getTile((x + 1), y).left;
placed = false;
tileMap.getTile((x + 1), y).left = null;
} else {
tileMap.getTile((x + 1), y).left = p;
};
};
};
if (dir == "left"){
p.rotation = (p.rotation + 90);
p.x = (x * tileSize);
p.y = ((y * tileSize) + (tileSize / 2));
placed = true;
if (tileMap.getTile(x, y)){
if (tileMap.getTile(x, y).left){
p = tileMap.getTile(x, y).left;
placed = false;
tileMap.getTile(x, y).left = null;
} else {
tileMap.getTile(x, y).left = p;
};
};
if (tileMap.getTile((x - 1), y)){
if (tileMap.getTile((x - 1), y).right){
p = tileMap.getTile((x - 1), y).right;
placed = false;
tileMap.getTile((x - 1), y).right = null;
} else {
tileMap.getTile((x - 1), y).right = p;
};
};
};
if (placed){
p.dir = dir;
if (push){
pieces.push(p);
};
container.addChild(p);
} else {
if (push){
i = pieces.indexOf(p);
pieces.splice(i, 1);
};
container.removeChild(p);
};
}
private function addRocket(x:int, y:int, container:Sprite){
var tile:Tile;
var r:MovieClip;
tile = tileMap.getTile(x, y);
if (!tile.occupied){
r = new MovieClip();
r.addChild(new rocket());
r.x = ((x * tileSize) + (tileSize / 2));
r.y = ((y * tileSize) + (tileSize / 2));
r.hitter = new hitter();
r.addChild(r.hitter);
rockets.push(r);
container.addChild(r);
tile.occupied = r;
tile.arrayRef = rockets;
tile.iRef = (rockets.length - 1);
} else {
sprite.removeChild(tile.occupied);
tile.occupied = null;
tile.arrayRef[tile.iRef] = null;
};
}
public function goWalk(e:MouseEvent){
var targetURL:URLRequest;
targetURL = new URLRequest("http://www.coolbuddy.com/games/community/game_walkthrough.asp?cat=2156");
navigateToURL(targetURL, "_blank");
Log.CustomMetric("sponsor walkthrough", "link track");
Log.CustomMetric("sponsor total", "link track");
}
private function addGui(){
editObject = "entity";
editDir = "up";
editGui = new gui();
editGui.y = 0;
addChildAt(editGui, 0);
checkGui();
}
private function processCode(e:MouseEvent){
trace("UNCOMPRESSED STRING: ");
trace(uncompress(loadScreen.code.text));
if (uncompress(loadScreen.code.text) != ""){
levelCode = loadScreen.code.text;
removeChild(sprite);
createLevel(levelCode);
removeChild(loadScreen);
addEventListener(MouseEvent.CLICK, addObject);
};
}
private function closeLoad(e:MouseEvent){
removeChild(loadScreen);
addEventListener(MouseEvent.CLICK, addObject);
}
private function closeNormal(e:MouseEvent){
removeChild(complete);
Main.getInstance().removeChild(this);
if (!userMode){
if (Main.getInstance().puzzleScreen.levelNum < 29){
Main.getInstance().puzzleScreen.addLevel((Main.getInstance().puzzleScreen.levelNum + 1));
} else {
Main.getInstance().removeChild(Main.getInstance().puzzleScreen);
Main.getInstance().addMain();
SoundManager.getInstance().addTrack(new Track1());
};
} else {
SoundManager.getInstance().addTrack(new Track1());
Main.getInstance().addMain();
};
}
private function testRocketBadEntities(r:MovieClip){
var b:Entity;
for each (b in badEntities) {
if (b.hitter.hitTestObject(r.hitter)){
gameOver();
SoundManager.getInstance().playSound(new bat_creature_impact_01());
SoundManager.getInstance().playSound(new die_fail_02());
};
};
}
private function changeStateDown(e:MouseEvent){
editDir = "down";
}
private function checkGui(){
if (editObject == "piece"){
editGui.piece.gotoAndStop(2);
} else {
editGui.piece.gotoAndStop(1);
};
if (editObject == "entity"){
editGui.entity.gotoAndStop(2);
} else {
editGui.entity.gotoAndStop(1);
};
if (editObject == "bad"){
editGui.bad.gotoAndStop(2);
} else {
editGui.bad.gotoAndStop(1);
};
if (editObject == "rock"){
editGui.rocket.gotoAndStop(2);
} else {
editGui.rocket.gotoAndStop(1);
};
if (editObject == "pit"){
editGui.pit.gotoAndStop(2);
} else {
editGui.pit.gotoAndStop(1);
};
if ((((editObject == "solution")) && ((editDir == "down")))){
editGui.pDown.gotoAndStop(2);
} else {
editGui.pDown.gotoAndStop(1);
};
if ((((editObject == "solution")) && ((editDir == "up")))){
editGui.pUp.gotoAndStop(2);
} else {
editGui.pUp.gotoAndStop(1);
};
if ((((editObject == "solution")) && ((editDir == "right")))){
editGui.pRight.gotoAndStop(2);
} else {
editGui.pRight.gotoAndStop(1);
};
if ((((editObject == "solution")) && ((editDir == "left")))){
editGui.pLeft.gotoAndStop(2);
} else {
editGui.pLeft.gotoAndStop(1);
};
if (editDir == "up"){
editGui.up.gotoAndStop(2);
} else {
editGui.up.gotoAndStop(1);
};
if (editDir == "down"){
editGui.down.gotoAndStop(2);
} else {
editGui.down.gotoAndStop(1);
};
if (editDir == "right"){
editGui.right.gotoAndStop(2);
} else {
editGui.right.gotoAndStop(1);
};
if (editDir == "left"){
editGui.left.gotoAndStop(2);
} else {
editGui.left.gotoAndStop(1);
};
if (gameStarted){
editGui.test.gotoAndStop(2);
} else {
editGui.test.gotoAndStop(1);
};
}
private function changeStatePit(e:MouseEvent){
editObject = "pit";
}
public function runGame(){
gameStarted = true;
addEventListener(Event.ENTER_FRAME, tick);
}
private function addPit(x:int, y:int, container:Sprite){
var tile:Tile;
var r:MovieClip;
tile = tileMap.getTile(x, y);
if (!tile.occupied){
r = new MovieClip();
r.addChild(new pit());
r.x = ((x * tileSize) + (tileSize / 2));
r.y = ((y * tileSize) + (tileSize / 2));
r.hitter = new hitter();
r.addChild(r.hitter);
pits.push(r);
container.addChild(r);
tile.occupied = r;
tile.arrayRef = pits;
tile.iRef = (pits.length - 1);
} else {
sprite.removeChild(tile.occupied);
tile.occupied = null;
tile.arrayRef[tile.iRef] = null;
};
}
private function changeStateUp(e:MouseEvent){
editDir = "up";
}
private function addSolution(x:int, y:int, startDir:String, push:Boolean, container:Sprite){
var canPlace:Boolean;
var tile:Tile;
var e:SolutionTile;
var i:int;
canPlace = false;
tile = tileMap.getTile(x, y);
if ((((startDir == "up")) && ((upAmount > 0)))){
upAmount--;
canPlace = true;
};
if ((((startDir == "down")) && ((downAmount > 0)))){
downAmount--;
canPlace = true;
};
if ((((startDir == "right")) && ((rightAmount > 0)))){
rightAmount--;
canPlace = true;
};
if ((((startDir == "left")) && ((leftAmount > 0)))){
leftAmount--;
canPlace = true;
};
if (((!(tile.solution)) && (canPlace))){
e = new SolutionTile(startDir, this);
e.x = ((x * tileSize) + (tileSize / 2));
e.y = ((y * tileSize) + (tileSize / 2));
if (push){
solutionTiles.push(e);
};
solutionsPlaced.push(e);
container.addChild(e);
tile.solution = e;
} else {
if (tile.solution){
if (canPlace){
if (startDir == "up"){
upAmount = (upAmount + 1);
} else {
if (startDir == "down"){
downAmount = (downAmount + 1);
} else {
if (startDir == "right"){
rightAmount = (rightAmount + 1);
} else {
if (startDir == "left"){
leftAmount = (leftAmount + 1);
};
};
};
};
};
if (tile.solution.getDir() == "up"){
upAmount = (upAmount + 1);
} else {
if (tile.solution.getDir() == "down"){
downAmount = (downAmount + 1);
} else {
if (tile.solution.getDir() == "right"){
rightAmount = (rightAmount + 1);
} else {
if (tile.solution.getDir() == "left"){
leftAmount = (leftAmount + 1);
};
};
};
};
container.removeChild(tile.solution);
i = solutionsPlaced.indexOf(tile.solution);
solutionsPlaced.splice(i, 1);
if (push){
i = solutionTiles.indexOf(tile.solution);
solutionTiles.splice(i, 1);
};
tile.solution = null;
};
};
}
private function gameWon(){
var num:int;
trace("GAME WON");
wonGame = true;
endGame();
SoundManager.getInstance().playSound(new win_end_01());
if (editMode){
removeEventListener(MouseEvent.CLICK, addObject);
complete = new EditorComplete();
complete.code.text = levelCode;
complete.quit.addEventListener(MouseEvent.CLICK, closeEdit);
complete.go.addEventListener(MouseEvent.MOUSE_UP, closeComplete);
complete.save.addEventListener(MouseEvent.CLICK, saveLevel);
complete.share.addEventListener(MouseEvent.CLICK, Main.getInstance().shareCode);
complete.saveError.visible = false;
complete.save.visible = true;
addChild(complete);
} else {
removeEventListener(MouseEvent.CLICK, addObject);
complete = new NormalComplete();
complete.mc.go.addEventListener(MouseEvent.CLICK, closeNormal);
complete.mc.cb.addEventListener(MouseEvent.CLICK, Main.getInstance().goBuddy);
complete.mc.like.addEventListener(MouseEvent.CLICK, Main.getInstance().goFb);
num = (levelNum + 1);
trace(num);
Main.getInstance().getLevels()[("complete" + levelNum.toString())] = true;
if (!userMode){
Main.getInstance().getLevels()[("level" + num.toString())] = true;
};
if (levelNum >= 5){
num++;
if (!userMode){
Main.getInstance().getLevels()[("level" + num.toString())] = true;
};
};
Main.getInstance().updateSharedOb();
addChild(complete);
};
}
public function addObject(e:MouseEvent){
var mx:int;
var my:int;
var tile:Tile;
mx = Math.floor(((mouseX - x) / tileSize));
my = Math.floor(((mouseY - y) / tileSize));
tile = tileMap.getTile(mx, my);
if (tile){
addItem(tile, mx, my);
} else {
trace("INVALID TILE");
};
sortDepths();
}
public function getTileSize():int{
return (tileSize);
}
public function sortDepths(){
var o:DisplayObject;
var i:int;
var p:Object;
allObjects = [];
for each (o in pieces) {
allObjects.push(o);
};
for each (o in entities) {
allObjects.push(o);
};
for each (o in badEntities) {
allObjects.push(o);
};
for each (o in rockets) {
allObjects.push(o);
};
for each (o in pits) {
allObjects.push(o);
};
allObjects.sortOn(["y", "x"]);
i = 20;
for each (o in allObjects) {
if (((!((o == null))) && (o.parent))){
p = o.parent;
p.setChildIndex(o, i);
i++;
};
};
}
public function startEditMode(){
addGui();
addListeners();
upAmount = 999;
downAmount = 999;
rightAmount = 999;
leftAmount = 999;
editMode = true;
}
private function changeStateSdown(e:MouseEvent){
editObject = "solution";
editDir = "down";
}
public function reset(){
removeChild(sprite);
createLevel(levelCode);
}
public function addItem(tile:Tile, x:int, y:int){
trace("ADD OB");
if (((editObject) && (!(gameStarted)))){
if (editObject == "piece"){
addPiece(x, y, editDir, sprite);
};
if (editObject == "entity"){
addEntity(x, y, editDir, sprite);
};
if (editObject == "bad"){
addBadEntity(x, y, editDir, sprite);
};
if (editObject == "rock"){
addRocket(x, y, sprite);
};
if (editObject == "pit"){
addPit(x, y, sprite);
};
if (editObject == "solution"){
addSolution(x, y, editDir, true, solutionLayer);
};
};
}
private function levelSaved(e:Event){
GamerSafe.api.removeEventListener(GamerSafe.EVT_LEVELVAULT_LEVEL_CREATED, levelSaved);
removeChild(saveScreen);
}
private function closeComplete(e:MouseEvent){
removeChild(complete);
reset();
addEventListener(MouseEvent.CLICK, addObject);
}
public function endGame(){
gameStarted = false;
removeEventListener(Event.ENTER_FRAME, tick);
}
private function addStandardListeners(){
standardGui.pUp.addEventListener(MouseEvent.CLICK, changeStateSup);
standardGui.pRight.addEventListener(MouseEvent.CLICK, changeStateSright);
standardGui.pDown.addEventListener(MouseEvent.CLICK, changeStateSdown);
standardGui.pLeft.addEventListener(MouseEvent.CLICK, changeStateSleft);
standardGui.addEventListener(Event.ENTER_FRAME, guiStandardUpdate);
addEventListener(MouseEvent.CLICK, addObject);
standardGui.start.addEventListener(MouseEvent.CLICK, begin);
standardGui.walk.addEventListener(MouseEvent.CLICK, goWalk);
}
private function compileObjects():String{
var i:int;
var s:String;
var e:Entity;
var o:Object;
var p:MovieClip;
var r:MovieClip;
var st:SolutionTile;
i = 0;
while (i < entities.length) {
if (entities[i] == null){
entities.splice(i, 1);
i--;
};
i++;
};
i = 0;
while (i < entities.length) {
e = entities[i];
o = new Object();
o.x = Math.floor((e.x / tileSize));
o.y = Math.floor((e.y / tileSize));
o.dir = e.getDir();
o.type = "entity";
compiledOb[("e" + i.toString())] = o;
i++;
};
i = 0;
while (i < badEntities.length) {
if (badEntities[i] == null){
badEntities.splice(i, 1);
i--;
};
i++;
};
i = 0;
while (i < badEntities.length) {
e = badEntities[i];
o = new Object();
o.x = Math.floor((e.x / tileSize));
o.y = Math.floor((e.y / tileSize));
o.dir = e.getDir();
o.type = "bad";
compiledOb[("b" + i.toString())] = o;
trace("bad");
i++;
};
i = 0;
while (i < pieces.length) {
if (pieces[i] == null){
pieces.splice(i, 1);
i--;
};
i++;
};
i = 0;
while (i < pieces.length) {
p = pieces[i];
o = new Object();
o.x = p.ox;
o.y = p.oy;
o.dir = p.dir;
trace(p.dir);
o.type = "piece";
compiledOb[("p" + i.toString())] = o;
i++;
};
trace((pieces.length + " PIECES"));
i = 0;
while (i < rockets.length) {
if (rockets[i] == null){
rockets.splice(i, 1);
i--;
};
i++;
};
i = 0;
while (i < rockets.length) {
r = rockets[i];
o = new Object();
o.x = Math.floor((r.x / tileSize));
o.y = Math.floor((r.y / tileSize));
o.type = "rock";
compiledOb[("r" + i.toString())] = o;
i++;
};
i = 0;
while (i < pits.length) {
if (pits[i] == null){
pits.splice(i, 1);
i--;
};
i++;
};
i = 0;
while (i < pits.length) {
r = pits[i];
o = new Object();
o.x = Math.floor((r.x / tileSize));
o.y = Math.floor((r.y / tileSize));
o.type = "pit";
compiledOb[("pt" + i.toString())] = o;
i++;
};
i = 0;
while (i < solutionTiles.length) {
st = solutionsPlaced[i];
o = new Object();
o.x = Math.floor((st.x / tileSize));
o.y = Math.floor((st.y / tileSize));
o.dir = st.getDir();
o.type = "sol";
compiledOb[("sol" + i.toString())] = o;
i++;
};
trace((solutionTiles.length + " SOLUTIONS COMPILED"));
s = JSON.encode(compiledOb);
s = compress(s);
trace(s);
return (s);
}
private function fallInPit(e:Entity){
var i:int;
SoundManager.getInstance().playSound(new brown_circle_impact_01());
i = badEntities.indexOf(e);
badEntities.splice(i, 1);
sprite.removeChild(e);
}
private function testPitBadEntities(r:MovieClip){
var b:Entity;
for each (b in badEntities) {
if (b.hitter.hitTestObject(r.hitter)){
fallInPit(b);
};
};
}
private function changeStateBad(e:MouseEvent){
editObject = "bad";
}
public function getTileMap():TileMap{
return (tileMap);
}
private function tick(e:Event){
update();
update();
sortDepths();
}
private function changeStateSright(e:MouseEvent){
editObject = "solution";
editDir = "right";
}
private function cancelMe(e:MouseEvent){
GamerSafe.api.removeEventListener(GamerSafe.EVT_LEVELVAULT_LEVEL_CREATED, levelSaved);
removeChild(saveScreen);
}
public function getSprite():Sprite{
return (sprite);
}
private function changeStateSup(e:MouseEvent){
editObject = "solution";
editDir = "up";
}
private function enterRocket(e:Entity){
var i:int;
i = entities.indexOf(e);
entities.splice(i, 1);
sprite.removeChild(e);
if (entities.length == 0){
gameWon();
};
}
private function changeStateRock(e:MouseEvent){
editObject = "rock";
}
private function changeStateRight(e:MouseEvent){
editDir = "right";
}
private function addStandardGui(){
editDir = "";
editObject = "solution";
standardGui = new sGui();
standardGui.y = 0;
addChildAt(standardGui, 0);
addStandardListeners();
}
private function guiUpdate(e:Event){
checkGui();
}
private function gameOver(){
trace("GAME OVER");
endGame();
reset();
}
private function testRocketEntities(r:MovieClip){
var en:Entity;
for each (en in entities) {
if (en.hitter.hitTestObject(r.hitter)){
enterRocket(en);
SoundManager.getInstance().playSound(new pop_up_01());
};
};
}
public function createLevel(str:String){
var o:Object;
var ob:Object;
var str = str;
if (!editMode){
upAmount = 0;
downAmount = 0;
rightAmount = 0;
leftAmount = 0;
};
levelCode = str;
createBlankLevel();
str = uncompress(str);
ob = JSON.decode(str);
//unresolved jump
var _slot1 = e;
trace("JSON ERROR");
for each (o in ob) {
if (o.type == "piece"){
trace(o.x, o.y, o.dir);
addPiece(o.x, o.y, o.dir, sprite);
};
if (o.type == "entity"){
addEntity(o.x, o.y, o.dir, sprite);
};
if (o.type == "bad"){
addBadEntity(o.x, o.y, o.dir, sprite);
};
if (o.type == "rock"){
addRocket(o.x, o.y, sprite);
};
if (o.type == "pit"){
addPit(o.x, o.y, sprite);
};
if ((((o.type == "sol")) && (editMode))){
addSolution(o.x, o.y, o.dir, true, solutionLayer);
} else {
if (o.type == "sol"){
trace("SOLUTON ITEM");
if (o.dir == "up"){
upAmount++;
};
if (o.dir == "down"){
downAmount++;
};
if (o.dir == "left"){
leftAmount++;
};
if (o.dir == "right"){
rightAmount++;
};
};
};
};
trace(upAmount, downAmount, leftAmount, rightAmount);
trace(solutionTiles.length, solutionsPlaced.length, "SOLUTIONS");
addBorders();
sortDepths();
}
private function addBorders(){
var x:int;
var y:int;
x = 0;
while (x < tileMap.getWidth()) {
y = 0;
while (y < tileMap.getHeight()) {
if (y == 0){
addPiece(x, y, "up", sprite, false, true);
};
if (y == (tileMap.getHeight() - 1)){
addPiece(x, y, "down", sprite, false, true);
};
if (x == 0){
addPiece(x, y, "left", sprite, false, true);
};
if (x == (tileMap.getWidth() - 1)){
addPiece(x, y, "right", sprite, false, true);
};
y++;
};
x++;
};
}
private function loadCode(e:MouseEvent){
removeEventListener(MouseEvent.CLICK, addObject);
loadScreen = new LoadScreen();
addChild(loadScreen);
loadScreen.go.addEventListener(MouseEvent.MOUSE_UP, processCode);
loadScreen.quit.addEventListener(MouseEvent.MOUSE_UP, closeLoad);
}
private function addEntity(x:int, y:int, startDir:String, container:Sprite){
var tile:Tile;
var e:Entity;
var mc:MovieClip;
tile = tileMap.getTile(x, y);
if (!tile.occupied){
e = new Entity(startDir, this);
mc = new mouseMc();
e.addChild(mc);
e.clip = mc;
e.rotate();
e.x = ((x * tileSize) + (tileSize / 2));
e.y = ((y * tileSize) + (tileSize / 2));
e.yStep = e.y;
e.xStep = e.x;
e.setSpeed(4.5);
e.hitter = new hitter();
e.addChild(e.hitter);
entities.push(e);
container.addChild(e);
tile.occupied = e;
tile.arrayRef = entities;
tile.iRef = (entities.length - 1);
} else {
sprite.removeChild(tile.occupied);
tile.occupied = null;
tile.arrayRef[tile.iRef] = null;
};
}
private function testAgainstTiles(e:Entity){
var tile:Tile;
tile = getTileMap().getTile(Math.floor((e.x / tileSize)), Math.floor((e.y / tileSize)));
if (e.x == ((tile.x * tileSize) + (tileSize / 2))){
if (e.y == ((tile.y * tileSize) + (tileSize / 2))){
if (tile.solution){
if (tile.solution.getDir() == "up"){
e.changeDir("up");
} else {
if (tile.solution.getDir() == "right"){
e.changeDir("right");
} else {
if (tile.solution.getDir() == "down"){
e.changeDir("down");
} else {
if (tile.solution.getDir() == "left"){
e.changeDir("left");
};
};
};
};
};
};
};
}
public static function compress(str:String):String{
var bytes:ByteArray;
bytes = new ByteArray();
bytes.writeUTFBytes(str);
bytes.compress();
return (Base64.encodeByteArray(bytes));
}
public static function uncompress(str:String):String{
var decode:ByteArray;
var str = str;
decode = Base64.decodeToByteArray(str);
if (decode){
try {
decode.uncompress();
//unresolved jump
var _slot1 = e;
var _local4:* = "";
//unresolved jump
0;
return (_local4);
} finally {
var _local5:* = decode.toString();
//unresolved jump
2;
return (_local5);
};
};
return ("");
}
}
}//package
Section 54
//levelBtn (levelBtn)
package {
import flash.display.*;
public dynamic class levelBtn extends SimpleButton {
public function levelBtn(){
super();
}
}
}//package
Section 55
//levelItem (levelItem)
package {
import flash.display.*;
import flash.text.*;
public dynamic class levelItem extends MovieClip {
public var lname:TextField;
public var uname:TextField;
public var rating:TextField;
public var plays:TextField;
public function levelItem(){
super();
}
}
}//package
Section 56
//levelMc (levelMc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class levelMc extends MovieClip {
public var lock:MovieClip;
public var complete:MovieClip;
public var num:TextField;
public function levelMc(){
super();
}
}
}//package
Section 57
//levelSelect (levelSelect)
package {
import Tools.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import SWFStats.*;
import flash.net.*;
public class levelSelect extends MovieClip {
private var codes:Array;
private var helpClip:MovieClip;
public var cb:SimpleButton;
public var levelNum:int;
private var chat:ChatEvent;
public var quit:SimpleButton;
private var level:Level;
private var buttons:Array;
public var preview:MovieClip;
public var user:SimpleButton;
private var pBm:Bitmap;
public var gw:SimpleButton;
public function levelSelect(){
super();
if (Main.getInstance().currentFrame >= 3){
setCodes();
setButtons();
user.addEventListener(MouseEvent.CLICK, goUser);
pBm = new Bitmap(new BitmapData(100, 100, true, 0));
preview.addChild(pBm);
cb.addEventListener(MouseEvent.CLICK, Main.getInstance().goBuddy);
gw.addEventListener(MouseEvent.CLICK, goWood);
};
}
private function setCodes(){
codes = ["eNqF0c0KwyAQBOB3mbMHE/OHr5OYVhoSsZZWQt69QQztFmuOCx+zA7PivkwccsULsmTwkIJh0BYSVl+uDgzOG7WfO8TGYIqoRdDtoSc1fmGjVa8CL0l4ccaPLg3t8o+LyGvKHyaBLf/FUdilv4W0Lt01mWZagrs8rsjrKosVT9cYluf84Wp22vkQXhN/ukhDBswvsr0BGDyamw==", "eNqN0MEKwjAQBNB/mXMOSdqC5HfqaoPFhriCoeTfLTFaTAx4Xd4Ow6xwHcyKB0wncLQeBncHgQCjBDg42i7O0kiIAm7IWKlSD7UmWemZTvzy/cfTlS2HFK/yw+GPLl7u+Ev4ZbyktD4DWab1ddptmWVriJ1vKiXrVk/9YzNZYm/PE7c35veDrsoyYnwCn3F6lA==", "e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G7ZBF0Ol688BWcWrclTGBzWgaAGB9WhqwGCXU/9C1QIK11NrF7OeseIP4BcXXCGmk31PJ5vy5NSji0m+DLiYiQOoT2+jgy59NPmgyrOQc1x7vfWtzp9PAzxqrF0oGl6tTGStY0+32o3rQTRzbzAVbpI5rFrkXgsvY39Ti9f9n/f7jJe5l6HxoOtwJVIEm465RiV3NMd3gIVgeGhgcq5gVIgn85nV49MSRXT/qKEvkguXjFst0wkD+NQkXL7aa3fOT2B2cUHCJz0Lnfyow/7nUpPWBGSa8hJNWoTyVimssmP17DybWXfNZrYZebiJxbgSaPk8TwGdJ7YhUpWxHxtRLuLJafWhofch2WYN38ZisgR6C7+uRrSSDJ/9v3PJWCEUwI3E5kMNRAtXQs9SFqKqh6MewKcYDeBdKlLQKkUwN8hDs7xMlJwhFbwTGJ2q9rRi9qTS8N4+zyOIPvfnqFv8FT++z7v5eJM+xC8iOqss+MHIXygZ7RNZCxUsu1gTCGYmqcF1kpX2xLAzd0pgrTh9yKA1ya2b8O0tQoLDLEWK+E5gr8gFDzjzP1ys6krisH/5edtZT+wlGQ3VUqLpKInAE1buPHAtSWsV0OblT3FBbV6YPPE/RLZUBh9Kp9MnzNea7A=="];
}
private function removeEditor(e:MouseEvent){
var b:MovieClip;
Main.getInstance().removeChild(level);
for each (b in buttons) {
removeChild(b);
};
setButtons();
SoundManager.getInstance().addTrack(new Track1());
}
private function pLevel(e:MouseEvent){
var t:Object;
var i:int;
var bmd:BitmapData;
var m:Matrix;
t = e.target;
while (t.parent != this) {
t = t.parent;
};
i = buttons.indexOf(t);
level = new Level(false, codes[i]);
bmd = new BitmapData((level.getSprite().width * 0.3), (level.getSprite().height * 0.3), true, 0);
m = new Matrix();
m.scale(0.3, 0.3);
bmd.draw(level.getSprite(), m);
pBm.bitmapData = bmd;
}
private function removeEditor2(e:MouseEvent){
var b:MovieClip;
Main.getInstance().removeChild(level);
for each (b in buttons) {
removeChild(b);
};
setButtons();
SoundManager.getInstance().addTrack(new Track1());
Main.getInstance().removeChild(this);
Main.getInstance().goEdit();
}
public function addLevel(i:int){
levelNum = i;
level = new Level(false, codes[i], null, (i + 1));
Main.getInstance().addChild(level);
level.getStandardGui().quit.addEventListener(MouseEvent.CLICK, removeEditor);
level.getStandardGui().lvl.addEventListener(MouseEvent.CLICK, removeEditor2);
addChat();
level.getStandardGui().level.text = ("Level " + (i + 1).toString());
}
private function checkLevel(e:Event){
if ((levelNum + 1) == 1){
if (chat.chatEnded){
helpClip = new helpL1();
level.addChild(helpClip);
helpClip.x = level.getSprite().x;
helpClip.y = level.getSprite().y;
removeEventListener(Event.ENTER_FRAME, checkLevel);
};
};
}
private function startLevel(e:MouseEvent){
var i:int;
SoundManager.getInstance().addTrack(new Track2());
i = buttons.indexOf(e.target.parent);
addLevel(i);
}
private function checkChat(e:Event){
if (level.wonGame){
if (chat.parent){
chat.parent.removeChild(chat);
};
removeEventListener(Event.ENTER_FRAME, checkChat);
} else {
if (helpClip){
helpClip.parent.setChildIndex(helpClip, (helpClip.parent.numChildren - 1));
};
if (((chat) && (chat.parent))){
chat.parent.setChildIndex(chat, (chat.parent.numChildren - 1));
};
};
}
private function addChat(){
if ((levelNum + 1) == 1){
chat = new ChatEvent(["Welcome to Boki Boki!", (("See that cute little green creature on the map? Thats a Boki!" + "\n") + "The Boki are peaceful, loving creatures but they are not very smart and often forget how to get back Home. It's up to you to help them get back to their Homes safely!"), (("The Boki change direction when they hit walls." + "\n") + "You can also make the Boki change direction by placing down Tiles!"), (("Click the TILE on the right hand side and then click the glowing spot" + "\n") + "When you have placed your Tile press PLAY to start")], true);
level.addChild(chat);
chat.startChat();
addEventListener(Event.ENTER_FRAME, checkLevel);
addEventListener(Event.ENTER_FRAME, checkChat);
};
if ((levelNum + 1) == 2){
chat = new ChatEvent(["Well done you got the first Boki home safely! Now let's help another!", (("Oh No! See that brown circle on the map? That's a Pit, anything that walks over Pit is doomed!" + "\n") + "Place the Tile before the Pit to get the Boki home safely.")], true);
level.addChild(chat);
chat.startChat();
addEventListener(Event.ENTER_FRAME, checkLevel);
addEventListener(Event.ENTER_FRAME, checkChat);
};
if ((levelNum + 1) == 3){
chat = new ChatEvent(["Oh look there's a whole bunch of Boki that need to get home here!", (("Which Home should you send them to though?" + "\n") + "Just make sure each Boki get's to any Home so they are happy and safe.")], true);
level.addChild(chat);
chat.startChat();
addEventListener(Event.ENTER_FRAME, checkLevel);
addEventListener(Event.ENTER_FRAME, checkChat);
};
if ((levelNum + 1) == 4){
chat = new ChatEvent([(("Oh no there's a Pirdy trying to eat that Boki!" + "\n") + "The Pirdy is the purple bird over there, we cannot let it eat this innocent Boki!"), (("Like Boki, the Pirdy will also change direction when they go over Tiles." + "\n") + "Try using one Tile to send the Pirdy to the Pit or away from the Boki! Then use the other Tile to get the Boki Home.")], true);
level.addChild(chat);
chat.startChat();
addEventListener(Event.ENTER_FRAME, checkLevel);
addEventListener(Event.ENTER_FRAME, checkChat);
};
if ((levelNum + 1) == 5){
chat = new ChatEvent(["Great work so far, look's like your all set to continue sending Boki home safely!", (("This level is a bit more difficult now you are doing well." + "\n") + "Good Luck!")], false);
level.addChild(chat);
chat.startChat();
addEventListener(Event.ENTER_FRAME, checkLevel);
addEventListener(Event.ENTER_FRAME, checkChat);
};
}
public function goWood(e:MouseEvent){
var targetURL:URLRequest;
targetURL = new URLRequest("http://www.girlswood.com");
navigateToURL(targetURL, "_blank");
Log.CustomMetric("sponsor girlswood", "link track");
Log.CustomMetric("sponsor total", "link track");
}
private function setButtons(){
var num:int;
var y:int;
var x:int;
var b:MovieClip;
var n:int;
buttons = [];
num = 1;
y = 0;
while (y < 5) {
x = 0;
while (x < 6) {
b = new levelMc();
n = (x * y);
b.num.text = num.toString();
b.num.mouseEnabled = false;
b.x = (225 + (x * 65));
b.y = (100 + (y * 59));
b.addEventListener(MouseEvent.MOUSE_OVER, pLevel);
buttons.push(b);
addChild(b);
trace(Main.getInstance().getLevels()[("level" + num.toString())], num);
if (Main.getInstance().getLevels()[("level" + num.toString())]){
b.lock.visible = false;
b.addEventListener(MouseEvent.CLICK, startLevel);
};
if (!Main.getInstance().getLevels()[("complete" + num.toString())]){
b.complete.visible = false;
} else {
b.complete.mouseEnabled = false;
};
num++;
x++;
};
y++;
};
}
private function goUser(e:MouseEvent){
var targetURL:URLRequest;
targetURL = new URLRequest("http://www.coolbuddy.com/games/games/Game_cat.asp?cat=New%20Addition");
navigateToURL(targetURL, "_blank");
Log.CustomMetric("sponsor games (level select)", "link track");
Log.CustomMetric("sponsor total", "link track");
}
}
}//package
Section 58
//loadingScreen (loadingScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class loadingScreen extends MovieClip {
public var txt:TextField;
public var cancel:SimpleButton;
public function loadingScreen(){
super();
}
}
}//package
Section 59
//LoadScreen (LoadScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LoadScreen extends MovieClip {
public var quit:SimpleButton;
public var go:SimpleButton;
public var code:TextField;
public function LoadScreen(){
super();
}
}
}//package
Section 60
//logoBtn (logoBtn)
package {
import flash.display.*;
public dynamic class logoBtn extends SimpleButton {
public function logoBtn(){
super();
}
}
}//package
Section 61
//lvlEditorBtn (lvlEditorBtn)
package {
import flash.display.*;
public dynamic class lvlEditorBtn extends SimpleButton {
public function lvlEditorBtn(){
super();
}
}
}//package
Section 62
//Main (Main)
package {
import Tools.*;
import flash.events.*;
import flash.display.*;
import SWFStats.*;
import flash.net.*;
import flash.text.*;
public class Main extends MovieClip {
public var texty:TextField;
public var gamerSafeReady:Boolean;// = false
public var loggedIn:Boolean;// = false
private var startScreen:MovieClip;
private var levels:Object;
public var puzzleScreen:MovieClip;
private var blockStuff:Boolean;// = false
private var level:Level;
private var codeScreen:MovieClip;
private var menuScreen:MovieClip;
private var mySharedObject:SharedObject;
public var _gamerSafe:GamerSafe;
private static var instance:Main;
public function Main(){
var allowed_sites:Array;
var site:String;
var allowed_site:String;
var domain:String;
var domain_idx:int;
var intro:Intro;
_gamerSafe = new GamerSafe(this);
loggedIn = false;
gamerSafeReady = false;
blockStuff = false;
super();
addFrameScript(0, frame1, 2, frame3);
Log.View(924, "a3e01ba84f31", root.loaderInfo.loaderURL);
addEventListener(Event.ENTER_FRAME, checkGamersafe);
allowed_sites = ["cdn.kaisergames.de", "kaisergames.de"];
for each (site in allowed_sites) {
allowed_site = site;
domain = this.root.loaderInfo.url.split("/")[2];
domain_idx = domain.indexOf(allowed_site);
if (((!((domain_idx == -1))) && ((domain_idx == (domain.length - allowed_site.length))))){
blockStuff = true;
};
};
if (blockStuff){
intro = new Intro(stage, callBack, false);
} else {
intro = new Intro(stage, callBack, true);
};
instance = this;
}
public function updateSharedOb(){
mySharedObject.data.levels = levels;
mySharedObject.flush();
}
public function sessionStarted(e:Event){
tracer("SESSION BEGIN");
trace("SESSION BEGIN");
gamerSafeReady = true;
GamerSafe.api.addEventListener(GamerSafe.EVT_LOGIN, logged);
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_GOT_LEVELS, testFunc);
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_GOT_SINGLE_LEVEL, gotLevel);
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_GOT_LEVELS, gotLevels);
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_LEVEL_CREATED, createdLevel);
GamerSafe.api.addEventListener(GamerSafe.EVT_NETWORKING_ERROR, netFail);
}
private function goCode(e:MouseEvent){
codeScreen = new PlayCode();
addChild(codeScreen);
removeChild(menuScreen);
codeScreen.quit.addEventListener(MouseEvent.CLICK, closeCode);
codeScreen.go.addEventListener(MouseEvent.CLICK, goCodeLevel);
}
public function addMain(){
SoundManager.getInstance().addTrack(new Track1());
addChild(menuScreen);
menuScreen.editor.addEventListener(MouseEvent.CLICK, goEditor);
menuScreen.puzzle.addEventListener(MouseEvent.CLICK, goPuzzle);
menuScreen.code.addEventListener(MouseEvent.CLICK, goCode);
menuScreen.more.addEventListener(MouseEvent.CLICK, goCodes);
menuScreen.myLogo.addEventListener(MouseEvent.CLICK, goSite);
}
public function gotLevels(e:Event){
var arr:Array;
var lvl:Object;
tracer("GOT LEVEL GROUP");
trace("GOT LEVEL GROUP");
arr = GamerSafe.api.levelVaultGetLastSelectedLevels();
for each (lvl in arr) {
tracer(lvl.Attributes.data);
tracer(lvl.Attributes.title);
trace(lvl.Attributes.data);
trace(lvl.Attributes.name);
};
}
public function goCodes(e:MouseEvent){
var targetURL:URLRequest;
targetURL = new URLRequest("http://coolbuddy.com/games/community/Game_forum.asp?cat=2156");
navigateToURL(targetURL, "_blank");
Log.CustomMetric("sponsor get codes", "link track");
Log.CustomMetric("sponsor total", "link track");
}
private function traceLevels(){
tracer("FETCHING LEVELS BY RATING");
GamerSafe.api.levelVaultGetLevelsByRating(0, 99);
}
private function checkGamersafe(e:Event){
if (((GamerSafe.apiLoaded) && (GamerSafe.api.loaded))){
GamerSafe.api.hideInterface();
removeEventListener(Event.ENTER_FRAME, checkGamersafe);
};
}
private function removeEditor(e:MouseEvent){
removeChild(level);
addMain();
}
private function closeCode(e:MouseEvent){
removeChild(codeScreen);
addMain();
}
public function goEdit(){
level = new Level(true);
SoundManager.getInstance().addTrack(new Track2());
addChild(level);
level.getEditGui().quit.addEventListener(MouseEvent.CLICK, removeEditor);
}
public function netFail(e:Event){
tracer("NET FAILED");
trace("NET FAILED");
}
function frame3(){
stop();
}
private function SetLevels(){
var i:int;
levels = new Object();
i = 1;
while (i <= 30) {
if (i == 1){
levels[("level" + i.toString())] = true;
} else {
levels[("level" + i.toString())] = false;
};
levels[("complete" + i.toString())] = false;
i++;
};
}
function frame1(){
stop();
}
public function gotLevel(e:Event){
tracer("GOT SINGLE LEVEL");
trace("GOT SINGLE LEVEL");
}
public function goSite(e:MouseEvent){
var targetURL:URLRequest;
targetURL = new URLRequest("http://www.gaminghero.com");
navigateToURL(targetURL, "_blank");
Log.CustomMetric("developer home", "link track");
}
public function createdLevel(e:Event){
tracer("CREATED LEVEL");
trace("CREATED LEVEL");
}
private function callBack(){
play();
addEventListener(Event.ENTER_FRAME, checkFrames);
}
public function logged(e:Event){
trace("LOGGED IN");
tracer("LOGGED IN");
loggedIn = true;
}
private function goEditor(e:MouseEvent){
removeChild(menuScreen);
level = new Level(true);
SoundManager.getInstance().addTrack(new Track2());
addChild(level);
level.getEditGui().quit.addEventListener(MouseEvent.CLICK, removeEditor);
}
private function testLoad(e:Event){
}
private function addFunction(){
startScreen = new StartScreen();
menuScreen = new MenuScreen();
addMain();
addEventListener(Event.ENTER_FRAME, tick);
GamerSafe.api.addEventListener("login", testLoad);
GamerSafe.api.addEventListener(GamerSafe.EVT_BEGIN_SESSION, sessionStarted);
GamerSafe.api.addEventListener(GamerSafe.EVT_LOGIN, logged);
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_GOT_LEVELS, testFunc);
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_GOT_SINGLE_LEVEL, gotLevel);
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_GOT_LEVELS, gotLevels);
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_LEVEL_CREATED, createdLevel);
GamerSafe.api.addEventListener(GamerSafe.EVT_NETWORKING_ERROR, netFail);
loadData();
}
private function goPuzzle(e:MouseEvent){
puzzleScreen = new levelSelect();
addChild(puzzleScreen);
removeChild(menuScreen);
puzzleScreen.quit.addEventListener(MouseEvent.CLICK, removePuzzle);
createLvel();
traceLevels();
}
public function tick(e:Event){
}
public function goEdit2(e:MouseEvent){
removeChild(menuScreen);
level = new Level(true);
SoundManager.getInstance().addTrack(new Track2());
addChild(level);
level.getEditGui().quit.addEventListener(MouseEvent.CLICK, removeEditor);
}
public function testFunc(e:Event){
}
private function loadData(){
mySharedObject = SharedObject.getLocal("bokibokidataaa");
if (mySharedObject.data.levels){
levels = mySharedObject.data.levels;
} else {
SetLevels();
};
}
private function goCodeLevel(e:MouseEvent){
level = new Level(false, codeScreen.code.text, new MovieClip());
addChild(level);
SoundManager.getInstance().addTrack(new Track2());
level.getStandardGui().quit.addEventListener(MouseEvent.CLICK, removeEditor);
level.getStandardGui().lvl.addEventListener(MouseEvent.CLICK, removeEditor);
level.getStandardGui().lvl.addEventListener(MouseEvent.CLICK, goEdit2);
removeChild(codeScreen);
}
public function goBuddy(e:MouseEvent){
var targetURL:URLRequest;
targetURL = new URLRequest("http://www.coolbuddy.com");
navigateToURL(targetURL, "_blank");
Log.CustomMetric("sponsor home", "link track");
Log.CustomMetric("sponsor total", "link track");
}
public function gotoMain(e:MouseEvent){
removeChild(startScreen);
addMain();
}
private function traceLastLevel(){
var o:Object;
o = GamerSafe.api.levelVaultGetLastSelectedLevel();
tracer((o.toString() + " Level"));
}
public function tracer(i:String){
texty.text = (texty.text + "\n");
texty.text = (texty.text + i);
setChildIndex(texty, (numChildren - 1));
trace("TRACERED");
}
public function shareCode(e:MouseEvent){
var targetURL:URLRequest;
targetURL = new URLRequest("http://coolbuddy.com/games/community/Game_paste_forum.asp?cat=2156");
navigateToURL(targetURL, "_blank");
Log.CustomMetric("sponsor paste code", "link track");
Log.CustomMetric("sponsor total", "link track");
}
public function goFb(e:MouseEvent){
var targetURL:URLRequest;
targetURL = new URLRequest("http://www.facebook.com/pages/Coolbuddy-Games/177306910591");
navigateToURL(targetURL, "_blank");
Log.CustomMetric("sponsor facebook", "link track");
Log.CustomMetric("sponsor total", "link track");
}
private function createLvel(){
}
private function checkFrames(e:Event){
if (currentFrame >= 3){
addFunction();
removeEventListener(Event.ENTER_FRAME, checkFrames);
};
}
public function getLevels(){
return (levels);
}
private function removePuzzle(e:MouseEvent){
removeChild(puzzleScreen);
addMain();
}
public static function getInstance():Main{
return (instance);
}
}
}//package
Section 63
//MenuScreen (MenuScreen)
package {
import flash.display.*;
public dynamic class MenuScreen extends MovieClip {
public var puzzle:SimpleButton;
public var editor:SimpleButton;
public var more:SimpleButton;
public var myLogo:logoBtn;
public var code:SimpleButton;
public function MenuScreen(){
super();
}
}
}//package
Section 64
//mouseMc (mouseMc)
package {
import flash.display.*;
public dynamic class mouseMc extends MovieClip {
public function mouseMc(){
super();
}
}
}//package
Section 65
//NinjaV3 (NinjaV3)
package {
import flash.display.*;
public dynamic class NinjaV3 extends MovieClip {
public function NinjaV3(){
super();
}
}
}//package
Section 66
//NormalComplete (NormalComplete)
package {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
import flash.geom.*;
import flash.net.*;
import flash.text.*;
import flash.external.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class NormalComplete extends MovieClip {
public var removed:int;
public var mc:MovieClip;
public function NormalComplete(){
super();
addFrameScript(0, frame1, 29, frame30);
}
function frame1(){
removed = 0;
addEventListener(Event.ENTER_FRAME, tick);
}
public function remove(e:Event){
var mc:MovieClip;
mc = (e.target as MovieClip);
if (mc.currentFrame == mc.totalFrames){
removeChild(mc);
mc.removeEventListener(Event.ENTER_FRAME, remove);
};
}
function frame30(){
stop();
}
public function tick(e:Event){
var ef:MovieClip;
if (Math.random() > 0.92){
ef = new starEffect();
addChild(ef);
ef.x = (25 + (Math.random() * (640 - 50)));
ef.y = (25 + (Math.random() * (480 - 50)));
ef.addEventListener(Event.ENTER_FRAME, remove);
ef.height = (ef.height * 1.5);
ef.width = (ef.width * 1.5);
removed++;
};
if (removed >= 7){
removeEventListener(Event.ENTER_FRAME, tick);
};
}
}
}//package
Section 67
//NunV3 (NunV3)
package {
import flash.display.*;
public dynamic class NunV3 extends MovieClip {
public function NunV3(){
super();
}
}
}//package
Section 68
//piece (piece)
package {
import flash.display.*;
public dynamic class piece extends MovieClip {
public function piece(){
super();
}
}
}//package
Section 69
//pit (pit)
package {
import flash.display.*;
public dynamic class pit extends MovieClip {
public function pit(){
super();
}
}
}//package
Section 70
//Place_item_01 (Place_item_01)
package {
import flash.media.*;
public dynamic class Place_item_01 extends Sound {
public function Place_item_01(){
super();
}
}
}//package
Section 71
//place_item_02 (place_item_02)
package {
import flash.media.*;
public dynamic class place_item_02 extends Sound {
public function place_item_02(){
super();
}
}
}//package
Section 72
//PlayCode (PlayCode)
package {
import flash.display.*;
import flash.text.*;
public dynamic class PlayCode extends MovieClip {
public var quit:SimpleButton;
public var go:SimpleButton;
public var code:TextField;
public function PlayCode(){
super();
}
}
}//package
Section 73
//pop_up_01 (pop_up_01)
package {
import flash.media.*;
public dynamic class pop_up_01 extends Sound {
public function pop_up_01(){
super();
}
}
}//package
Section 74
//puzzleBtn (puzzleBtn)
package {
import flash.display.*;
public dynamic class puzzleBtn extends SimpleButton {
public function puzzleBtn(){
super();
}
}
}//package
Section 75
//quit2 (quit2)
package {
import flash.display.*;
public dynamic class quit2 extends MovieClip {
public function quit2(){
super();
}
}
}//package
Section 76
//rocket (rocket)
package {
import flash.display.*;
public dynamic class rocket extends MovieClip {
public function rocket(){
super();
}
}
}//package
Section 77
//sGui (sGui)
package {
import flash.display.*;
import flash.text.*;
public dynamic class sGui extends MovieClip {
public var lvl:lvlEditorBtn;
public var pUp:arrowMc1;
public var pDown:arrowMc3;
public var start:MovieClip;
public var quit:SimpleButton;
public var downTxt:TextField;
public var level:TextField;
public var pLeft:arrowMc4;
public var pRight:arrowMc2;
public var rightTxt:TextField;
public var walk:SimpleButton;
public var upTxt:TextField;
public var leftTxt:TextField;
public function sGui(){
super();
}
}
}//package
Section 78
//SolutionTile (SolutionTile)
package {
import flash.display.*;
public class SolutionTile extends Sprite {
private var level:Level;
private var dir:String;
public function SolutionTile(dir:String, level:Level){
super();
this.dir = dir;
this.level = level;
addChild(new arrowMc2());
if (dir == "up"){
addChild(new arrowMc1());
} else {
if (dir == "right"){
addChild(new arrowMc2());
} else {
if (dir == "down"){
addChild(new arrowMc3());
} else {
if (dir == "left"){
addChild(new arrowMc4());
};
};
};
};
}
public function getDir():String{
return (dir);
}
}
}//package
Section 79
//starEffect (starEffect)
package {
import flash.display.*;
public dynamic class starEffect extends MovieClip {
public function starEffect(){
super();
}
}
}//package
Section 80
//StartScreen (StartScreen)
package {
import flash.display.*;
public dynamic class StartScreen extends MovieClip {
public function StartScreen(){
super();
}
}
}//package
Section 81
//tileBg (tileBg)
package {
import flash.display.*;
public dynamic class tileBg extends MovieClip {
public function tileBg(){
super();
}
}
}//package
Section 82
//tileIcon (tileIcon)
package {
import flash.display.*;
public dynamic class tileIcon extends MovieClip {
public var pUp:arrowMc1;
public var pDown:arrowMc3;
public var pLeft:arrowMc4;
public var pRight:arrowMc2;
public function tileIcon(){
super();
}
}
}//package
Section 83
//Track1 (Track1)
package {
import flash.media.*;
public dynamic class Track1 extends Sound {
public function Track1(){
super();
}
}
}//package
Section 84
//Track2 (Track2)
package {
import flash.media.*;
public dynamic class Track2 extends Sound {
public function Track2(){
super();
}
}
}//package
Section 85
//UserLevels (UserLevels)
package {
import Tools.*;
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
public class UserLevels extends MovieClip {
public var r2:MovieClip;
public var r3:MovieClip;
public var previous:SimpleButton;
public var next:SimpleButton;
public var r5:MovieClip;
public var r4:MovieClip;
private var codes:Array;
public var levelSelected:Object;
private var saveScreen:MovieClip;
public var recent:SimpleButton;
public var cb:SimpleButton;
public var start:SimpleButton;
private var levelBmd:BitmapData;
public var quit:SimpleButton;
private var levelList:Array;
private var highlighter:MovieClip;
public var rated:SimpleButton;
private var offset:int;
private var levelInPlay:Level;
public var holder:MovieClip;
private var mode:String;
public var level:Level;
public var preview:MovieClip;
public var played:SimpleButton;
private var levelBm:Bitmap;
public var r1:MovieClip;
public function UserLevels(){
super();
highlighter = new highMc();
offset = 0;
mode = "Recent";
recent.addEventListener(MouseEvent.CLICK, goRecent);
rated.addEventListener(MouseEvent.CLICK, goRated);
played.addEventListener(MouseEvent.CLICK, goPlayed);
start.addEventListener(MouseEvent.CLICK, startLevel);
quit.addEventListener(MouseEvent.CLICK, quitUser);
next.addEventListener(MouseEvent.CLICK, nextLevels);
previous.addEventListener(MouseEvent.CLICK, previousLevels);
r1.addEventListener(MouseEvent.CLICK, rateL1);
r2.addEventListener(MouseEvent.CLICK, rateL2);
r3.addEventListener(MouseEvent.CLICK, rateL3);
r4.addEventListener(MouseEvent.CLICK, rateL4);
r5.addEventListener(MouseEvent.CLICK, rateL5);
getLevels();
levelBm = new Bitmap(new BitmapData(100, 100, true, 0));
preview.addChild(levelBm);
cb.addEventListener(MouseEvent.CLICK, Main.getInstance().goBuddy);
}
public function gotLevels(e:Event){
var num:int;
var pos:Number;
var arr:Array;
var lvl:Object;
var ba:ByteArray;
var o:Object;
var l:String;
var item:MovieClip;
levelList = [];
codes = [];
num = 1;
pos = 0;
arr = GamerSafe.api.levelVaultGetLastSelectedLevels();
removeChild(holder);
holder = new MovieClip();
addChild(holder);
holder.x = 264.1;
holder.y = 84;
for each (lvl in arr) {
trace(lvl.Data);
o = lvl.Data.readObject();
trace(o);
l = o.data;
codes.push(l);
trace("READ CODE");
trace((l + " CODE"));
item = new levelItem();
item.gotoAndStop(num);
levelList.push(lvl);
item.index = levelList.indexOf(lvl);
if (lvl.Attributes.name){
item.lname.text = lvl.Attributes.name;
};
item.plays.text = lvl.Attributes.plays;
if (lvl.Attributes.creator){
item.uname.text = lvl.Attributes.creator;
};
item.rating.text = Math.round(lvl.AvgRating);
holder.addChild(item);
item.y = pos;
pos = (pos + 17.4);
if (num == 1){
num = 2;
} else {
num = 1;
};
item.addEventListener(MouseEvent.CLICK, switchSelected);
};
GamerSafe.api.removeEventListener(GamerSafe.EVT_LEVELVAULT_GOT_LEVELS, gotLevels);
if (saveScreen.parent){
removeChild(saveScreen);
};
}
private function switchSelected(e:MouseEvent){
var target:Object;
var i:int;
var m:Matrix;
target = e.target;
if (!(target.parent) != this){
target = target.parent;
};
if (highlighter.parent){
highlighter.parent.removeChild(highlighter);
};
target.addChild(highlighter);
i = target.index;
levelSelected = levelList[i];
level = new Level(false, codes[i], this);
level.getStandardGui().level.text = levelSelected.Attributes.name;
levelBmd = new BitmapData((level.getSprite().width * 0.3), (level.getSprite().height * 0.3), true, 0);
m = new Matrix();
m.scale(0.3, 0.3);
levelBmd.draw(level.getSprite(), m);
levelBm.bitmapData = levelBmd;
}
public function getLastLevel(){
var i:int;
i = levelList.indexOf(levelSelected);
if (codes[i]){
level = new Level(false, codes[i], this);
} else {
level = null;
};
}
public function previousLevels(e:MouseEvent){
offset = (offset - 20);
if (offset < 0){
offset = 0;
};
getLevels();
}
private function rateL1(e:MouseEvent){
if (level){
GamerSafe.api.levelVaultRateLevel(levelSelected, 1);
};
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_LEVEL_RATED, ratedGame);
}
private function rateL4(e:MouseEvent){
if (level){
GamerSafe.api.levelVaultRateLevel(levelSelected, 4);
};
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_LEVEL_RATED, ratedGame);
}
public function quitLevel2(e:MouseEvent){
Main.getInstance().removeChild(level);
SoundManager.getInstance().addTrack(new Track1());
getLastLevel();
getLevels();
Main.getInstance().removeChild(this);
Main.getInstance().goEdit();
}
public function goRecent(e:MouseEvent){
offset = 0;
mode = "Recent";
getLevels();
}
private function rateL5(e:MouseEvent){
if (level){
GamerSafe.api.levelVaultRateLevel(levelSelected, 5);
};
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_LEVEL_RATED, ratedGame);
}
public function quitLevel(e:MouseEvent){
Main.getInstance().removeChild(level);
SoundManager.getInstance().addTrack(new Track1());
getLastLevel();
getLevels();
}
public function goRated(e:MouseEvent){
offset = 0;
mode = "Rated";
getLevels();
}
public function getLevels(){
if (mode == "Recent"){
GamerSafe.api.levelVaultGetLevelsByDateCreated("2005-01-01 00:00:00", "4005-01-01 00:00:00", false, 20, offset);
};
if (mode == "Rated"){
GamerSafe.api.levelVaultGetLevelsByRating(0, 99, false, 20, offset);
};
if (mode == "Played"){
GamerSafe.api.levelVaultGetLevelsByNumericData("plays", 0, 999999999999999, false, 20, offset);
};
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_GOT_LEVELS, gotLevels);
if (((!(saveScreen)) || (!(saveScreen.parent)))){
saveScreen = new loadingScreen();
saveScreen.txt.text = "Loading Levels...";
saveScreen.cancel.addEventListener(MouseEvent.CLICK, cancelMe);
addChild(saveScreen);
};
}
public function startLevel(e:MouseEvent){
if (level){
GamerSafe.api.levelVaultIncrementNumeric(levelSelected, "plays");
Main.getInstance().addChild(level);
level.getStandardGui().lvl.addEventListener(MouseEvent.CLICK, quitLevel2);
SoundManager.getInstance().addTrack(new Track2());
};
}
private function rateL2(e:MouseEvent){
if (level){
GamerSafe.api.levelVaultRateLevel(levelSelected, 2);
};
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_LEVEL_RATED, ratedGame);
}
public function nextLevels(e:MouseEvent){
offset = (offset + 20);
trace(offset, GamerSafe.api.levelVaultLastCreatedLevelID);
getLevels();
}
private function rateL3(e:MouseEvent){
if (level){
GamerSafe.api.levelVaultRateLevel(levelSelected, 3);
};
GamerSafe.api.addEventListener(GamerSafe.EVT_LEVELVAULT_LEVEL_RATED, ratedGame);
}
private function cancelMe(e:MouseEvent){
GamerSafe.api.removeEventListener(GamerSafe.EVT_LEVELVAULT_GOT_LEVELS, gotLevels);
if (saveScreen.parent){
removeChild(saveScreen);
};
}
private function ratedGame(e:Event){
trace("RATED");
getLevels();
}
public function quitUser(e:MouseEvent){
Main.getInstance().removeChild(this);
}
public function goPlayed(e:MouseEvent){
offset = 0;
mode = "Played";
getLevels();
}
}
}//package
Section 86
//win_end_01 (win_end_01)
package {
import flash.media.*;
public dynamic class win_end_01 extends Sound {
public function win_end_01(){
super();
}
}
}//package
Section 87
//win_end_02 (win_end_02)
package {
import flash.media.*;
public dynamic class win_end_02 extends Sound {
public function win_end_02(){
super();
}
}
}//package