Section 1
//Dir (com.gamingyourway.Dungeon.Dir)
package com.gamingyourway.Dungeon {
import flash.geom.*;
public class Dir {
public static const NUM_BASEDIR:int = 4;
public static const NORTH:int = 0;
public static const SOUTH:int = 2;
public static const WEST:int = 3;
public static const OFFSET:Array = [new Point(0, -1), new Point(1, 0), new Point(0, 1), new Point(-1, 0)];
public static const EAST:int = 1;
public static function turnLeft(_arg1:int):int{
var _local2:int;
_local2 = WEST;
switch (_arg1){
case EAST:
_local2 = NORTH;
break;
case SOUTH:
_local2 = EAST;
break;
case WEST:
_local2 = SOUTH;
break;
};
return (_local2);
}
public static function shortName(_arg1:int):String{
return (Dir.name(_arg1).charAt(0).toUpperCase());
}
public static function name(_arg1:int):String{
var _local2:String;
_local2 = "north";
switch (_arg1){
case EAST:
_local2 = "east";
break;
case SOUTH:
_local2 = "south";
break;
case WEST:
_local2 = "west";
break;
};
return (_local2);
}
public static function getOppositeDir(_arg1:int):int{
var _local2:int;
_local2 = SOUTH;
switch (_arg1){
case EAST:
_local2 = WEST;
break;
case SOUTH:
_local2 = NORTH;
break;
case WEST:
_local2 = EAST;
break;
};
return (_local2);
}
public static function getDirOffset(_arg1:int):Point{
return (Dir.OFFSET[_arg1]);
}
public static function dir(_arg1:int):int{
var _local2:int;
_local2 = 0;
switch (_arg1){
case EAST:
_local2 = 90;
break;
case SOUTH:
_local2 = 180;
break;
case WEST:
_local2 = 270;
break;
};
return (_local2);
}
public static function getDirFromPoint(_arg1:Point, _arg2:Point):int{
var _local3:int;
_local3 = -1;
if (_arg1.x < _arg2.x){
_local3 = Dir.EAST;
};
if (_arg1.x > _arg2.x){
_local3 = Dir.WEST;
};
if (_arg1.y < _arg2.y){
_local3 = Dir.SOUTH;
};
if (_arg1.y > _arg2.y){
_local3 = Dir.NORTH;
};
return (_local3);
}
public static function turnRight(_arg1:int):int{
var _local2:int;
_local2 = EAST;
switch (_arg1){
case EAST:
_local2 = SOUTH;
break;
case SOUTH:
_local2 = WEST;
break;
case WEST:
_local2 = NORTH;
break;
};
return (_local2);
}
}
}//package com.gamingyourway.Dungeon
Section 2
//Pathfinder2D (com.gamingyourway.Pathfinder.Pathfinder2D)
package com.gamingyourway.Pathfinder {
import flash.geom.*;
public class Pathfinder2D {
private var _objPath:Object;
private var _aMap:Array;
private var _pEnd:Point;
private var _pStart:Point;
private var _iDepth:int;
private var _iLevel:int;
public static var LEVEL_MED:int = 1;
public static var LEVEL_LOW:int = 0;
public static var LEVEL_HIGH:int = 2;
public function Pathfinder2D(_arg1:Array, _arg2:Point, _arg3:Point, _arg4:int, _arg5:int){
this._aMap = new Array();
this._pStart = new Point(0, 0);
this._pEnd = new Point(0, 0);
this._iDepth = 100;
this._iLevel = Pathfinder2D.LEVEL_LOW;
if (_arg1 != null){
this.init(_arg1, _arg2, _arg3, _arg4, _arg5);
};
}
public function get aMap():Array{
return (this._aMap);
}
public function get pEnd():Point{
return (this._pEnd);
}
public function init(_arg1:Array, _arg2:Point, _arg3:Point, _arg4:int=-1, _arg5:int=-1):void{
if (_arg1 != null){
this._aMap = _arg1;
};
if (_arg2 != null){
this._pStart = _arg2;
};
if (_arg3 != null){
this._pEnd = _arg3;
};
if (_arg4 != -1){
this._iDepth = _arg4;
};
if (_arg5 != -1){
this._iLevel = _arg5;
};
}
public function get pStart():Point{
return (this._pStart);
}
public function set pEnd(_arg1:Point){
this._pEnd = _arg1;
}
public function get iDepth():int{
return (this._iDepth);
}
public function get iLevel():int{
return (this._iLevel);
}
public function get bHasPath():Boolean{
return ((((this._objPath.iWeight > 0)) && ((this._objPath.iWeight < this._iDepth))));
}
private function sortPath(_arg1:Object, _arg2:Object):Number{
var _local3:Number;
_local3 = 0;
if (_arg1.weight < _arg2.weight){
_local3 = -1;
} else {
if (_arg1.weight > _arg2.weight){
_local3 = 1;
};
};
return (_local3);
}
public function set pStart(_arg1:Point){
this._pStart = _arg1;
}
public function toString():String{
var _local1:int;
var _local2:String;
_local2 = "[";
_local1 = 0;
while (_local1 < this._objPath.aPathX.length) {
_local2 = (_local2 + (((("[" + this._objPath.aPathX[_local1]) + ",") + this._objPath.aPathY[_local1]) + "]"));
_local2 = (_local2 + ((_local1)<(this._objPath.aPathX.length - 1)) ? ", " : "");
_local1++;
};
_local2 = (_local2 + "];");
return (_local2);
}
private function searchPath(_arg1:Point, _arg2:Point, _arg3:Boolean, _arg4:Boolean):Object{
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Array;
var _local9:Array;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
_local5 = _arg1.x;
_local6 = _arg1.y;
_local7 = 0;
_local8 = new Array();
_local9 = new Array();
_local10 = _arg2.x;
_local11 = _arg2.y;
_local12 = 0;
_local13 = 0;
while (true) {
if ((((_local5 == _local8[(_local7 - 4)])) && ((_local6 == _local9[(_local7 - 4)])))){
_local7 = 10000;
break;
};
_local12 = _local8[(_local7 - 1)];
_local13 = _local9[(_local7 - 1)];
_local8.push(_local5);
_local9.push(_local6);
_local7++;
if ((((_local10 == _local5)) && ((_local11 == _local6)))){
break;
};
if (_local7 > this._iDepth){
_local7 = 10000;
break;
};
if (_arg3){
if ((((((_local5 < _local10)) && (!((_local12 == (_local5 + 1)))))) && (this._aMap[(_local5 + 1)][_local6]))){
_local5++;
continue;
};
if ((((((_local5 > _local10)) && (!((_local12 == (_local5 - 1)))))) && (this._aMap[(_local5 - 1)][_local6]))){
_local5--;
continue;
};
if ((((((_local6 < _local11)) && (!((_local13 == (_local6 + 1)))))) && (this._aMap[_local5][(_local6 + 1)]))){
_local6++;
continue;
};
if ((((((_local6 > _local11)) && (!((_local13 == (_local6 - 1)))))) && (this._aMap[_local5][(_local6 - 1)]))){
_local6--;
continue;
};
if ((((((_local5 == _local10)) && (((_local5 + 1) < this._aMap.length)))) && (((_local5 - 1) >= 0)))){
if (((!((_local12 == (_local5 + 1)))) && (this._aMap[(_local5 + 1)][_local6]))){
_local5++;
continue;
};
if (((!((_local12 == (_local5 - 1)))) && (this._aMap[(_local5 - 1)][_local6]))){
_local5--;
continue;
};
} else {
if ((((((_local6 == _local11)) && (((_local6 - 1) >= 0)))) && (((_local6 + 1) < this._aMap[0].length)))){
if (((!((_local13 == (_local6 + 1)))) && (this._aMap[_local5][(_local6 + 1)]))){
_local6++;
continue;
};
if (((!((_local13 == (_local6 - 1)))) && (this._aMap[_local5][(_local6 - 1)]))){
_local6--;
continue;
};
};
};
if (((((_local5 + 1) < this._aMap.length)) && (((_local5 - 1) >= 0)))){
if ((((((_local5 > _local10)) && (!((_local12 == (_local5 + 1)))))) && (this._aMap[(_local5 + 1)][_local6]))){
_local5++;
continue;
} else {
if (((!((_local12 == (_local5 - 1)))) && (this._aMap[(_local5 - 1)][_local6]))){
_local5--;
continue;
};
};
};
if (((((_local6 + 1) < this._aMap[0].length)) && (((_local6 - 1) >= 0)))){
if ((((((_local6 > _local11)) && (!((_local13 == (_local6 + 1)))))) && (this._aMap[_local5][(_local6 + 1)]))){
_local6++;
continue;
} else {
if (((!((_local13 == (_local6 - 1)))) && (this._aMap[_local5][(_local6 - 1)]))){
_local6--;
continue;
};
};
};
} else {
if ((((((_local6 < _local11)) && (!((_local13 == (_local6 + 1)))))) && (this._aMap[_local5][(_local6 + 1)]))){
_local6++;
continue;
};
if ((((((_local6 > _local11)) && (!((_local13 == (_local6 - 1)))))) && (this._aMap[_local5][(_local6 - 1)]))){
_local6--;
continue;
};
if ((((((_local5 < _local10)) && (!((_local12 == (_local5 + 1)))))) && (this._aMap[(_local5 + 1)][_local6]))){
_local5++;
continue;
};
if ((((((_local5 > _local10)) && (!((_local12 == (_local5 - 1)))))) && (this._aMap[(_local5 - 1)][_local6]))){
_local5--;
continue;
};
if ((((((_local6 == _local11)) && (((_local6 - 1) >= 0)))) && (((_local6 + 1) < this._aMap[0].length)))){
if (((!((_local13 == (_local6 - 1)))) && (this._aMap[_local5][(_local6 - 1)]))){
_local6--;
continue;
};
if (((!((_local13 == (_local6 + 1)))) && (this._aMap[_local5][(_local6 + 1)]))){
_local6++;
continue;
};
} else {
if ((((((_local5 == _local10)) && (((_local5 + 1) < this._aMap.length)))) && (((_local5 - 1) >= 0)))){
if (((!((_local12 == (_local5 - 1)))) && (this._aMap[(_local5 - 1)][_local6]))){
_local5--;
continue;
};
if (((!((_local12 == (_local5 + 1)))) && (this._aMap[(_local5 + 1)][_local6]))){
_local5++;
continue;
};
};
};
if (((((_local6 + 1) < this._aMap[0].length)) && (((_local6 - 1) >= 0)))){
if ((((((_local6 < _local11)) && (!((_local13 == (_local6 - 1)))))) && (this._aMap[_local5][(_local6 - 1)]))){
_local6--;
continue;
} else {
if (((!((_local13 == (_local6 + 1)))) && (this._aMap[_local5][(_local6 + 1)]))){
_local6++;
continue;
};
};
};
if (((((_local5 + 1) < this._aMap.length)) && (((_local5 - 1) >= 0)))){
if ((((((_local5 < _local10)) && (!((_local12 == (_local5 - 1)))))) && (this._aMap[(_local5 - 1)][_local6]))){
_local5--;
continue;
} else {
if (((!((_local12 == (_local5 + 1)))) && (this._aMap[(_local5 + 1)][_local6]))){
_local5++;
continue;
};
};
};
};
_local7 = 10000;
};
if (((_arg4) && ((_local7 < 10000)))){
_local8.reverse();
_local9.reverse();
};
return ({aPathX:_local8, aPathY:_local9, iWeight:_local7, bDir:_arg3});
}
public function set iLevel(_arg1:int){
this._iLevel = _arg1;
}
public function set iDepth(_arg1:int){
this._iDepth = _arg1;
}
public function get objPath():Object{
return (this._objPath);
}
public function set aMap(_arg1:Array){
this._aMap = _arg1;
}
public function findPath():Object{
var _local1:Array;
var _local2:Number;
_local1 = new Array();
_local1[0] = this.searchPath(this._pStart, this._pEnd, true, false);
if (this._iLevel > 0){
_local1[1] = this.searchPath(this._pStart, this._pEnd, false, false);
};
if (this._iLevel > 1){
_local1[2] = this.searchPath(this._pEnd, this._pStart, true, true);
};
if (this._iLevel > 2){
_local1[3] = this.searchPath(this._pEnd, this._pStart, false, true);
};
_local1.sortOn("iWeight", Array.NUMERIC);
this._objPath = {aPathX:_local1[0].aPathX, aPathY:_local1[0].aPathY, iWeight:_local1[0].iWeight};
return (_local1[0]);
}
}
}//package com.gamingyourway.Pathfinder
Section 3
//mywMedalData (com.medalyourway.DataType.mywMedalData)
package com.medalyourway.DataType {
public class mywMedalData {
private var _strDate:String;
private var _iType:uint;
private var _strIcon:String;
private var _strKey:String;
private var _strName:String;
private var _strText:String;
public static const MEDALVALUE_GOLD:uint = 100;
public static const MEDALTYPE_BRONZE:uint = 0;
public static const MEDALTYPE_GOLD:uint = 2;
public static const MEDALVALUE_SILVER:uint = 50;
public static const MEDALTYPE_SILVER:uint = 1;
public static const MEDALVALUE_BRONZE:uint = 25;
public function mywMedalData(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:uint){
this._strKey = _arg1;
this._strName = _arg2;
this._strText = _arg3;
this._strIcon = _arg4;
this._iType = _arg5;
this._strDate = "";
}
public function setAchieved(_arg1:String):void{
this._strDate = _arg1;
}
public function get iType():uint{
return (this._iType);
}
public function get strText():String{
return (this._strText);
}
public function get strDate():String{
return (this._strDate);
}
public function get strIcon():String{
return (this._strIcon);
}
public function get strKey():String{
return (this._strKey);
}
public function get bAchieved():Boolean{
return (!((this._strDate == "")));
}
public function get iValue():uint{
var _local1:uint;
_local1 = 0;
if (this._strDate != ""){
switch (this._iType){
case mywMedalData.MEDALTYPE_BRONZE:
_local1 = mywMedalData.MEDALVALUE_BRONZE;
break;
case mywMedalData.MEDALTYPE_SILVER:
_local1 = mywMedalData.MEDALVALUE_SILVER;
break;
case mywMedalData.MEDALTYPE_GOLD:
_local1 = mywMedalData.MEDALVALUE_GOLD;
break;
};
};
return (_local1);
}
public function get strName():String{
return (this._strName);
}
}
}//package com.medalyourway.DataType
Section 4
//mywUserHandle (com.medalyourway.mywUserHandle)
package com.medalyourway {
import com.medalyourway.DataType.*;
public final class mywUserHandle {
private var _strLogin:String;
private var _objDataDict:Object;
private var _aMedals:Array;
private var _fnLoginCallback:Function;
private var _strPassword:String;
private var _iUserID:int;
private var _objMedalDict:Object;
private var _aMedalDisplayCache:Array;
public function mywUserHandle(){
this._iUserID = -1;
this._strLogin = "";
this._strPassword = "";
this._aMedals = new Array();
this._aMedalDisplayCache = new Array();
this._objMedalDict = new Object();
this._objDataDict = new Object();
}
public function readSaveData(_arg1:Object):void{
var _local2:int;
if (_arg1 != null){
_local2 = 0;
while (_local2 < _arg1.medal.length) {
(this._aMedals[this._objMedalDict[_arg1.medal[_local2].key]] as mywMedalData).setAchieved(_arg1.medal[_local2].date);
_local2++;
};
if (_arg1.data != null){
this._objDataDict = _arg1.data;
};
};
}
public function getMedal(_arg1:String):mywMedalData{
return (((this._objMedalDict[_arg1])!=null) ? this._aMedals[this._objMedalDict[_arg1]] : new mywMedalData("", "", "", "", 0));
}
public function get aMedalCache():Array{
return (this._aMedalDisplayCache);
}
public function get bIsLoggedIn():Boolean{
return (((((!((this._strLogin == ""))) && (!((this._strPassword == ""))))) && (!((this._iUserID == 0)))));
}
public function set data(_arg1:Object):void{
this._objDataDict = _arg1;
}
public function addMedal(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:uint):void{
var _local6:uint;
var _local7:mywMedalData;
_local6 = this._aMedals.length;
_local7 = new mywMedalData(_arg1, _arg2, _arg3, _arg4, _arg5);
if (this._objMedalDict[_arg1] == null){
this._objMedalDict[_arg1] = _local6;
} else {
_local6 = this._objMedalDict[_arg1];
};
this._aMedals[_local6] = _local7;
}
public function login(_arg1:String, _arg2:String, _arg3:Function):void{
}
public function get data():Object{
return (this._objDataDict);
}
public function getSaveData():Object{
var _local1:Array;
var _local2:Object;
var _local3:mywMedalData;
var _local4:int;
_local1 = new Array();
_local4 = 0;
while (_local4 < this._aMedals.length) {
_local3 = (this._aMedals[_local4] as mywMedalData);
_local2 = new Object();
_local2.key = _local3.strKey;
_local2.date = _local3.strDate;
_local1.push(_local2);
_local4++;
};
return ({medal:_local1, data:this._objDataDict});
}
}
}//package com.medalyourway
Section 5
//ColorUtil (de.drygoods.Graphics.ColorUtil)
package de.drygoods.Graphics {
import flash.geom.*;
import flash.display.*;
public class ColorUtil {
public static function setBrightness(_arg1:DisplayObject, _arg2:int=0, _arg3:int=0, _arg4:int=0){
_arg1.transform.colorTransform = new ColorTransform(1, 1, 1, 1, _arg2, _arg3, _arg4, 0);
}
public static function setRGBA(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0xFF):uint{
return (((((_arg4 << 24) | (_arg1 << 16)) | (_arg2 << 8)) | _arg3));
}
public static function getRGB(_arg1:int):Object{
return ({r:((_arg1 >> 16) & 0xFF), g:((_arg1 >> 8) & 0xFF), b:(_arg1 & 0xFF)});
}
public static function getRGBA(_arg1:uint):Object{
return ({a:((_arg1 >> 24) & 0xFF), r:((_arg1 >> 16) & 0xFF), g:((_arg1 >> 8) & 0xFF), b:(_arg1 & 0xFF)});
}
public static function setRGB(_arg1:int=0, _arg2:int=0, _arg3:int=0):uint{
return ((((_arg1 << 16) | (_arg2 << 8)) | _arg3));
}
public static function setBrightness2(_arg1:DisplayObject, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1){
_arg1.transform.colorTransform = new ColorTransform(_arg2, _arg3, _arg4, 1, 0, 0, 0, 0);
}
}
}//package de.drygoods.Graphics
Section 6
//VisualUtil (de.drygoods.Graphics.VisualUtil)
package de.drygoods.Graphics {
import flash.text.*;
public class VisualUtil {
public static function txtGetWidth(_arg1:TextField):int{
return (_arg1.textWidth);
}
public static function txtGetHeight(_arg1:TextField):int{
return (_arg1.textHeight);
}
public static function txtGetRight(_arg1:TextField):int{
return ((_arg1.textWidth + _arg1.x));
}
public static function txtAlignRight(_arg1:TextField, _arg2:int, _arg3:int):void{
_arg1.x = (_arg2 - txtGetWidth(_arg1));
}
}
}//package de.drygoods.Graphics
Section 7
//MersenneTwister (de.drygoods.Random.MersenneTwister)
package de.drygoods.Random {
public class MersenneTwister {
private const MATRIX_A:uint = 2567483615;
private const UPPER_MASK:uint = 2147483648;
private const LOWER_MASK:uint = 2147483647;
private const M:int = 397;
private const N:int = 624;
private const MAX_RAND_INT:uint = 2147483647;
private const MAX_RAND_FLOAT:uint = 2147483648;
private var mag01:Array;
private var mti:int;
private var mt:Array;
private static var _allowInstantiation:Boolean;
private static var _instance:MersenneTwister;
public function MersenneTwister():void{
mag01 = [0, MATRIX_A];
mt = new Array();
mti = (N + 1);
super();
if (!MersenneTwister._allowInstantiation){
throw (new Error("Error: Instantiation failed: Use MersenneTwister.getInstance() instead of new."));
};
}
private function init_by_array(_arg1:Array, _arg2:uint):void{
var _local3:int;
var _local4:int;
var _local5:int;
this.init_genrand(19650218);
_local3 = 1;
_local4 = 0;
_local5 = int(((N)>_arg2) ? N : _arg2);
while (_local5 > 0) {
mt[_local3] = uint(((uint((mt[_local3] ^ ((mt[(_local3 - 1)] ^ (mt[(_local3 - 1)] >> 30)) * 1664525))) + _arg1[_local4]) + _local4));
mt[_local3] = (mt[_local3] & 4294967295);
_local3++;
_local4++;
if (_local3 >= N){
mt[0] = mt[(N - 1)];
_local3 = 1;
};
if (_local4 >= _arg2){
_local4 = 0;
};
_local5--;
};
_local5 = (N - 1);
while (_local5 > 0) {
mt[_local3] = uint((uint((mt[_local3] ^ ((mt[(_local3 - 1)] ^ (mt[(_local3 - 1)] >> 30)) * 1566083941))) - _local3));
mt[_local3] = (mt[_local3] & 4294967295);
_local3++;
if (_local3 >= N){
mt[0] = mt[(N - 1)];
_local3 = 1;
};
_local5--;
};
mt[0] = 2147483648;
}
public function get MaxRandomInt():int{
return (2147483647);
}
private function genrand_int32():uint{
var _local1:uint;
var _local2:int;
if (mti >= N){
if (mti == (N + 1)){
this.init_genrand(5489);
};
_local2 = 0;
while (_local2 < (N - M)) {
_local1 = ((mt[_local2] & UPPER_MASK) | (mt[(_local2 + 1)] & LOWER_MASK));
mt[_local2] = ((mt[(_local2 + M)] ^ (_local1 >> 1)) ^ mag01[(_local1 & 1)]);
_local2++;
};
while (_local2 < (N - 1)) {
_local1 = ((mt[_local2] & UPPER_MASK) | (mt[(_local2 + 1)] & LOWER_MASK));
mt[_local2] = ((mt[(_local2 + (M - N))] ^ (_local1 >> 1)) ^ mag01[(_local1 & 1)]);
_local2++;
};
_local1 = ((mt[(N - 1)] & UPPER_MASK) | (mt[0] & LOWER_MASK));
mt[(N - 1)] = ((mt[(M - 1)] ^ (_local1 >> 1)) ^ mag01[(_local1 & 1)]);
mti = 0;
};
_local1 = mt[mti++];
_local1 = (_local1 ^ (_local1 >> 11));
_local1 = (_local1 ^ ((_local1 << 7) & 2636928640));
_local1 = (_local1 ^ ((_local1 << 15) & 4022730752));
_local1 = (_local1 ^ (_local1 >> 18));
return (_local1);
}
private function genrand_real2():Number{
return ((this.genrand_int32() * (1 / MAX_RAND_FLOAT)));
}
public function Next():int{
return (this.genrand_int31());
}
public function Initialise(_arg1:int=4357, _arg2:Array=null):void{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
if (_arg2 == null){
this.init_genrand(uint(_arg1));
} else {
_local4 = 0;
while (_local4 < _arg2.length) {
_local3.push(uint(_arg2[_local4]));
_local4++;
};
this.init_by_array(_local3, _local3.length);
};
}
public function NextFloat(_arg1:Boolean=false):Number{
var _local2:Number;
_local2 = 0;
if (_arg1){
_local2 = Number(genrand_real1());
} else {
_local2 = Number(genrand_real2());
};
return (_local2);
}
public function Range(_arg1:int=0, _arg2:int=2147483647):int{
var _local3:int;
if (_arg1 > _arg2){
_local3 = _arg2;
_arg2 = _arg1;
_arg1 = _local3;
};
return (int(Math.floor(((((_arg2 - _arg1) + 1) * this.genrand_real2()) + _arg1))));
}
private function init_genrand(_arg1:uint):void{
mt[0] = (_arg1 & 4294967295);
mti = 1;
while (mti < N) {
mt[mti] = uint(((1812433253 * (mt[(mti - 1)] ^ (mt[(mti - 1)] >> 30))) + mti));
mt[mti] = (mt[mti] & 4294967295);
mti++;
};
}
private function genrand_real1():Number{
return ((this.genrand_int32() * (1 / (MAX_RAND_FLOAT - 1))));
}
private function genrand_int31():int{
return (int((this.genrand_int32() >> 1)));
}
public static function getInstance():MersenneTwister{
if (MersenneTwister._instance == null){
MersenneTwister._allowInstantiation = true;
MersenneTwister._instance = new (MersenneTwister);
MersenneTwister._allowInstantiation = false;
};
return (MersenneTwister._instance);
}
}
}//package de.drygoods.Random
Section 8
//EventUtil (de.drygoods.Util.EventUtil)
package de.drygoods.Util {
import flash.events.*;
import flash.display.*;
public class EventUtil {
public static function setButtonEventsFull(_arg1:SimpleButton, _arg2:Function, _arg3:Function, _arg4:Function, _arg5:Function, _arg6:Boolean=true):void{
if (_arg6){
_arg1.addEventListener(MouseEvent.MOUSE_OVER, _arg2);
_arg1.addEventListener(MouseEvent.MOUSE_OUT, _arg3);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, _arg4);
_arg1.addEventListener(MouseEvent.MOUSE_UP, _arg5);
} else {
_arg1.removeEventListener(MouseEvent.MOUSE_OVER, _arg2);
_arg1.removeEventListener(MouseEvent.MOUSE_OUT, _arg3);
_arg1.removeEventListener(MouseEvent.MOUSE_DOWN, _arg4);
_arg1.removeEventListener(MouseEvent.MOUSE_UP, _arg5);
};
}
public static function setButtonEvents(_arg1:SimpleButton, _arg2:Function, _arg3:Boolean=true):void{
EventUtil.setButtonEventsFull(_arg1, _arg2, _arg2, _arg2, _arg2, _arg3);
}
}
}//package de.drygoods.Util
Section 9
//FPSCounter (de.drygoods.Util.FPSCounter)
package de.drygoods.Util {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class FPSCounter extends Sprite {
private var _iMin:uint;
private var _iPos:uint;
private var _iMax:uint;
private var _bmpGraph:Bitmap;
private var _iMaxFPS:uint;
private var _iLength:uint;
private var _txtFPS:TextField;
private var _bmpPaintbox:BitmapData;
private var _iFPS:uint;
private var _iLastTime:uint;
public function FPSCounter(_arg1:uint, _arg2:int=0, _arg3:int=0, _arg4:uint=60){
this.name = "fpsCounter";
this.x = _arg2;
this.y = _arg3;
this._iMaxFPS = _arg1;
this._iLength = _arg4;
this.mouseEnabled = false;
this.mouseChildren = false;
this.reset();
this.addBox((_arg4 + 2), (_arg1 + 12));
this.addText((_arg1 + 10));
}
public function stop():void{
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
public function start():void{
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
private function reset():void{
this._iLastTime = getTimer();
this._iFPS = 0;
this._iMax = 0;
this._iMin = (this._iMaxFPS + 10);
this._iPos = 0;
}
private function addBox(_arg1:uint, _arg2:uint):void{
graphics.lineStyle(0, 0xFFFFFF);
graphics.beginFill(0);
graphics.drawRect(0, 0, (_arg1 + 1), (_arg2 + 1));
this._bmpPaintbox = new BitmapData(_arg1, _arg2, false, 0);
this._bmpGraph = new Bitmap();
this._bmpGraph.x = 1;
this._bmpGraph.y = 1;
this._bmpGraph.bitmapData = this._bmpPaintbox;
this.addChild(this._bmpGraph);
}
private function addText(_arg1:uint):void{
var _local2:TextFormat;
_local2 = new TextFormat();
this._txtFPS = new TextField();
this._txtFPS.x = 0;
this._txtFPS.y = (_arg1 - 11);
this._txtFPS.text = "30";
this._txtFPS.selectable = false;
this._txtFPS.textColor = 0xFFFFFF;
_local2.color = 0xFFFFFF;
_local2.font = "_sans";
_local2.size = 9;
this._txtFPS.setTextFormat(_local2);
this._txtFPS.defaultTextFormat = _local2;
this.addChild(this._txtFPS);
}
override public function toString():String{
return ("de.drygoods.Util.FPSCounter");
}
public function get bmp():BitmapData{
return (this._bmpGraph.bitmapData);
}
private function onEnterFrame(_arg1:Event):void{
if ((getTimer() - this._iLastTime) <= 1000){
this._iFPS++;
} else {
this._iLastTime = getTimer();
this._iMax = Math.max(this._iMax, this._iFPS);
this._iMin = Math.min(this._iMin, this._iFPS);
this._bmpPaintbox.lock();
this._bmpPaintbox.setPixel(this._iPos, ((this._iMaxFPS + 5) - this._iMax), 0xFF00);
this._bmpPaintbox.setPixel(this._iPos, ((this._iMaxFPS + 5) - this._iMin), 0xFF0000);
this._bmpPaintbox.setPixel(this._iPos, ((this._iMaxFPS + 5) - this._iFPS), 0xFFFFFF);
this._bmpPaintbox.unlock();
this._iPos++;
if (this._iPos >= this._iLength){
this._bmpPaintbox.fillRect(this._bmpPaintbox.rect, 0);
this._iPos = 0;
this._iMax = 0;
this._iMin = (this._iMaxFPS + 10);
};
this._txtFPS.text = ((((String(this._iFPS) + " >") + String(this._iMin)) + " <") + String(this._iMax));
this._iFPS = 0;
};
}
}
}//package de.drygoods.Util
Section 10
//MathUtil (de.drygoods.Util.MathUtil)
package de.drygoods.Util {
import flash.geom.*;
public class MathUtil {
public static const PI2:Number = 0.0174532925199433;
public static function lineIntersect(_arg1:Object, _arg2:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Boolean;
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local3 = 0;
_local4 = 0;
_local5 = false;
_local6 = 1E-7;
_local7 = -((_arg1.y2 - _arg1.y1));
_local9 = (_arg1.x2 - _arg1.x1);
_local11 = ((_arg1.x1 * _arg1.y2) - (_arg1.x2 * _arg1.y1));
_local8 = -((_arg2.y2 - _arg2.y1));
_local10 = (_arg2.x2 - _arg2.x1);
_local12 = ((_arg2.x1 * _arg2.y2) - (_arg2.x2 * _arg2.y1));
_local13 = ((_local7 * _local10) - (_local8 - _local9));
if (Math.abs(_local13) < _local6){
_local14 = ((_local9 * _local12) - (_local10 * _local11));
_local15 = ((_local11 * _local8) - (_local12 * _local7));
_local3 = (_local14 / _local13);
_local4 = (_local15 / _local13);
} else {
_local5 = true;
};
return ({x:_local3, y:_local4, Error:_local5});
}
public static function distance(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
_local5 = (_arg4 - _arg2);
_local6 = (_arg3 - _arg1);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
public static function rnd(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
public static function sgn(_arg1:Number):Number{
return (((_arg1)==0) ? 0 : ((_arg1)<0) ? -1 : 1);
}
public static function distancePoint(_arg1:Point, _arg2:Point):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg2.y - _arg1.y);
_local4 = (_arg2.x - _arg1.x);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
}
}//package de.drygoods.Util
Section 11
//SoundUtil (de.drygoods.Util.SoundUtil)
package de.drygoods.Util {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public class SoundUtil {
private var _bEnableMusic:Boolean;
private var _iVolumeSFX:Number;
private var _aSound:Array;
private var _spDummy:Sprite;
private var _bEnableSFX:Boolean;
private var _iVolumeMusic:Number;
private var _iVolumeMaster:Number;
private var _aPlaying:Array;
private var _objSound:Object;
private static var _allowInstantiation:Boolean;
private static var _instance:SoundUtil;
public function SoundUtil():void{
if (!SoundUtil._allowInstantiation){
throw (new Error("Error: Instantiation failed: Use SoundUtil.getInstance() instead of new."));
};
this.init(true, 1);
}
private function _stopMusic(_arg1:String, _arg2:Number=0):void{
var _local3:SoundChannel;
if (this._objSound[_arg1] != null){
if (((this._objSound[_arg1].bIsPlaying) || (this._objSound[_arg1].bDelay))){
if (this._objSound[_arg1].bDelay){
this._objSound[_arg1].bDelay = false;
TweenUtil.to(this._objSound[_arg1], 0.01, {x:0});
} else {
if (_arg2 > 0){
this._objSound[_arg1].spDummy.x = 1;
TweenUtil.to(this._objSound[_arg1].spDummy, _arg2, {x:0, onUpdate:this.onFadeMusic, onUpdateParams:[_arg1], onComplete:this._stopMusic, onCompleteParams:[_arg1]});
} else {
this._objSound[_arg1].bIsPlaying = false;
_local3 = (this._objSound[_arg1].chChannel as SoundChannel);
_local3.stop();
_local3.removeEventListener(Event.SOUND_COMPLETE, this.onSoundComplete);
};
};
};
};
}
public function setEnabled(_arg1:Boolean, _arg2:Number):void{
this._bEnableMusic = _arg1;
this._bEnableMusic = _arg1;
if (_arg1){
TweenUtil.to(this._spDummy, _arg2, {x:1, onUpdate:this.fadeMaster});
} else {
TweenUtil.to(this._spDummy, _arg2, {x:0, onUpdate:this.fadeMaster});
};
}
public function init(_arg1:Boolean, _arg2:Number):void{
this._aSound = new Array();
this._objSound = new Object();
this._aPlaying = new Array();
this._bEnableSFX = _arg1;
this._bEnableMusic = _arg1;
this._iVolumeMaster = _arg2;
this._iVolumeSFX = 1;
this._iVolumeMusic = 1;
this._spDummy = new Sprite();
this._spDummy.x = 1;
}
private function _playMusic(_arg1:String, _arg2:Number=0, _arg3:Number=0, _arg4:int=9999):void{
var _local5:SoundChannel;
if (this._objSound[_arg1] != null){
if (!this._objSound[_arg1].bIsPlaying){
if (_arg3 > 0){
this._objSound[_arg1].bDelay = true;
TweenUtil.to(this._objSound[_arg1], _arg3, {onComplete:this._playMusic, onCompleteParams:[_arg1, _arg2]});
} else {
_local5 = (this._aSound[this._objSound[_arg1].id] as Sound).play(0, _arg4);
_local5.addEventListener(Event.SOUND_COMPLETE, this.onSoundComplete);
this._objSound[_arg1].chChannel = _local5;
this._objSound[_arg1].bIsPlaying = true;
this._objSound[_arg1].bDelay = false;
if (_arg2 > 0){
this._objSound[_arg1].spDummy.x = 0;
this.onFadeMusic(_arg1);
TweenUtil.to(this._objSound[_arg1].spDummy, _arg2, {x:1, onUpdate:this.onFadeMusic, onUpdateParams:[_arg1]});
};
};
};
};
}
private function fadeMaster():void{
SoundMixer.soundTransform = new SoundTransform(this._spDummy.x);
}
public function add(_arg1:String, _arg2:Boolean):void{
var _local3:Class;
var _local4:Sound;
var _local5:int;
_local3 = (getDefinitionByName(_arg1) as Class);
_local4 = new (_local3);
_local5 = this._aSound.length;
this._aSound.push(_local4);
this._objSound[_arg1] = {id:_local5, bIsMusic:_arg2, bDelay:false};
if (_arg2){
this._objSound[_arg1].spDummy = new Sprite();
};
}
private function onFadeMusic(_arg1):void{
var _local2:SoundTransform;
if (this._objSound[_arg1] != null){
_local2 = new SoundTransform(this._objSound[_arg1].spDummy.x);
this._objSound[_arg1].chChannel.soundTransform = _local2;
};
}
private function onSoundComplete(_arg1:Event):void{
var _local2:String;
for (_local2 in this._objSound) {
if (this._objSound[_local2].bIsMusic){
if (this._objSound[_local2].chChannel == _arg1.target){
this._objSound[_local2].chChannel.removeEventListener(Event.SOUND_COMPLETE, this.onSoundComplete);
this._objSound[_local2].bIsPlaying = false;
};
};
};
}
private function _playSFX(_arg1:String, _arg2:Number=0):void{
if (this._objSound[_arg1] != null){
if (_arg2 > 0){
this._objSound[_arg1].bDelay = true;
TweenUtil.to(this._objSound[_arg1], _arg2, {onComplete:this._playSFX, onCompleteParams:[_arg1]});
} else {
this._objSound[_arg1].bDelay = false;
(this._aSound[this._objSound[_arg1].id] as Sound).play();
};
};
}
public function get bEnabled():Boolean{
return (_bEnableMusic);
}
public static function playMusic(_arg1:String, _arg2:Number=0, _arg3:Number=0, _arg4:int=9999):void{
SoundUtil.getInstance()._playMusic(_arg1, _arg2, _arg3, _arg4);
}
public static function playSFX(_arg1:String, _arg2:Number=0):void{
SoundUtil.getInstance()._playSFX(_arg1, _arg2);
}
public static function stopMusic(_arg1:String, _arg2:Number=0):void{
SoundUtil.getInstance()._stopMusic(_arg1, _arg2);
}
public static function getInstance():SoundUtil{
if (SoundUtil._instance == null){
SoundUtil._allowInstantiation = true;
SoundUtil._instance = new (SoundUtil);
SoundUtil._allowInstantiation = false;
};
return (SoundUtil._instance);
}
}
}//package de.drygoods.Util
Section 12
//StrUtil (de.drygoods.Util.StrUtil)
package de.drygoods.Util {
import flash.geom.*;
public class StrUtil {
public static const MORPH_WORD:uint = 1;
public static const MORPH_CHAR:uint = 0;
public static const MORPH_LINE:uint = 2;
public static function isoDateTime(_arg1:Date=null):String{
var _local2:Date;
var _local3:String;
_local2 = ((_arg1)==null) ? new Date() : _arg1;
_local3 = ((StrUtil.format(_local2.getFullYear()) + StrUtil.format((_local2.getMonth() + 1))) + StrUtil.format(_local2.getDate()));
_local3 = (_local3 + "T");
_local3 = (_local3 + StrUtil.format(_local2.getHours()));
_local3 = (_local3 + StrUtil.format(_local2.getMinutes()));
_local3 = (_local3 + StrUtil.format(_local2.getSeconds()));
_local3 = (_local3 + StrUtil.format(_local2.getMilliseconds(), 3));
return (_local3);
}
public static function replace(_arg1:String, _arg2:String, _arg3:String):String{
var _local4:String;
var _local5:Array;
var _local6:Number;
_local4 = _arg1;
if (_arg1.indexOf(_arg2) != -1){
_local4 = "";
_local5 = new Array();
_local5 = _arg1.split(_arg2);
_local6 = 0;
while (_local6 < (_local5.length - 1)) {
_local4 = (_local4 + (_local5[_local6] + _arg3));
_local6++;
};
_local4 = (_local4 + _local5[(_local5.length - 1)]);
};
return (_local4);
}
public static function escapeZinc(_arg1:String):String{
return (_arg1.split(",").join("@c@").split("&").join("@amp@").split("\"").join("@q@"));
}
public static function left(_arg1:String, _arg2:int):String{
var _local3:String;
_local3 = _arg1;
if (_local3.length >= _arg2){
_local3 = _local3.slice(0, _arg2);
};
return (_local3);
}
public static function isoDifToString(_arg1:String, _arg2:String, _arg3:String):String{
var _local4:Number;
var _local5:String;
var _local6:String;
var _local7:String;
var _local8:String;
_local4 = (StrUtil.isoToSeconds(_arg2) - StrUtil.isoToSeconds(_arg1));
if (_arg3 == null){
_arg3 = "hoh mim ses";
};
_local6 = String(Math.floor((_local4 / 3600)));
_local4 = (_local4 % 3600);
_local7 = String(Math.floor((_local4 / 60)));
_local4 = (_local4 % 60);
_local8 = String(_local4);
_local5 = StrUtil.replace(_arg3, "ho", _local6);
_local5 = StrUtil.replace(_local5, "mi", _local7);
_local5 = StrUtil.replace(_local5, "se", _local8);
return (_local5);
}
private static function morphTextChar(_arg1:String, _arg2:String, _arg3:Boolean, _arg4:String, _arg5:String):Array{
var _local6:Array;
var _local7:Array;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:String;
var _local13:String;
_local6 = new Array();
_local7 = new Array();
_local10 = Math.max(_arg1.length, _arg2.length);
_local12 = ((_arg4)=="") ? "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.# * +~@ !$ % & / () = ? -_ < > | " : _arg4;
_local13 = "";
if (_arg3){
_local8 = 0;
while (_local8 < _local10) {
_local7.push(_local8);
_local13 = "";
_local9 = 0;
while (_local9 < _local10) {
if (_local9 <= _local8){
_local13 = (_local13 + _local12.charAt(MathUtil.rnd(0, (_local12.length - 1))));
} else {
if (_local9 < _arg1.length){
_local13 = (_local13 + _arg1.charAt(_local9));
};
};
_local9++;
};
_local6.push((_arg5 + _local13));
_local8++;
};
};
_local8 = 0;
while (_local8 < _local10) {
_local7.push(_local8);
_local13 = "";
_local9 = 0;
while (_local9 < _local10) {
if (_local9 <= _local8){
_local13 = (_local13 + _arg2.charAt(_local9));
} else {
if (_local9 < _arg2.length){
_local13 = (_local13 + _local12.charAt(MathUtil.rnd(0, (_local12.length - 1))));
};
};
_local9++;
};
_local6.push((_arg5 + _local13));
_local8++;
};
return (_local6);
}
public static function cInt(_arg1:String):int{
var _local2:String;
var _local3:Number;
_local2 = _arg1;
_local3 = Number(_arg1);
if (_local2.length > 1){
while (_local2.charAt(0) == "0") {
_local2 = _local2.slice(1);
};
if (_local2 == ""){
_local2 = "0";
};
if (isNaN(Number(_local2))){
_local3 = 0;
} else {
_local3 = int(_local2);
};
};
return (_local3);
}
public static function crop(_arg1:String, _arg2:Number):String{
var _local3:*;
var _local4:Number;
_local3 = _arg1;
if (_arg1.length > _arg2){
_local4 = _arg2;
while (_local4 < _arg1.length) {
if (_arg1.charAt(_local4) == " "){
_local3 = StrUtil.left(_arg1, _local4);
break;
};
_local4++;
};
};
return (_local3);
}
public static function compressString(_arg1:String, _arg2:uint=2, _arg3:uint=3){
var _local4:Array;
var _local5:String;
var _local6:String;
var _local7:uint;
var _local8:uint;
_local4 = new Array();
_local5 = "";
_local6 = (_arg2 + "|");
_local7 = 0;
while (_local7 < _arg1.length) {
if ((_local7 + _arg2) < _arg1.length){
_local5 = _arg1.substr(_local7, _arg2);
} else {
_local5 = _arg1.substr(_local7);
};
if (_local4.length > 0){
if (_local4[(_local4.length - 1)][0] == _local5){
var _local9 = _local4[(_local4.length - 1)];
var _local10 = 1;
var _local11 = (_local9[_local10] + 1);
_local9[_local10] = _local11;
} else {
_local4.push([_local5, 1]);
};
} else {
_local4.push([_local5, 1]);
};
_local7 = (_local7 + _arg2);
};
_local7 = 0;
while (_local7 < _local4.length) {
if (_local4[_local7][1] >= _arg3){
_local6 = (_local6 + ((("[" + int(_local4[_local7][1]).toString(32)) + _local4[_local7][0]) + "]"));
} else {
_local8 = 0;
while (_local8 < _local4[_local7][1]) {
_local6 = (_local6 + _local4[_local7][0]);
_local8++;
};
};
_local7++;
};
return (_local6);
}
public static function decompressString(_arg1:String, _arg2:uint=2):String{
var _local3:Array;
var _local4:Boolean;
var _local5:uint;
var _local6:uint;
var _local7:String;
var _local8:String;
var _local9:String;
var _local10:String;
_local3 = new Array();
_local4 = false;
_local7 = "";
_local8 = "";
_local9 = "";
_local10 = "";
_arg1 = _arg1.substr((_arg1.indexOf("|") + 1));
_local5 = 0;
while (_local5 < _arg1.length) {
_local7 = _arg1.charAt(_local5);
if (_local7 == "["){
_local4 = true;
_local7 = "";
};
if (_local4){
if (_local7 == "]"){
_local4 = false;
_local9 = _local8.substr((_local8.length - _arg2));
_local8 = _local8.substr(0, (_local8.length - _arg2));
_local6 = 0;
while (_local6 < parseInt(_local8, 32)) {
_local10 = (_local10 + _local9);
_local6++;
};
_local8 = "";
} else {
_local8 = (_local8 + _local7);
};
} else {
_local10 = (_local10 + _local7);
};
_local5++;
};
return (_local10);
}
public static function morphText(_arg1:String, _arg2:String, _arg3:uint=0, _arg4:Boolean=true, _arg5:String="", _arg6:String=""):Array{
var _local7:Array;
_local7 = new Array();
switch (_arg3){
case MORPH_CHAR:
_local7 = StrUtil.morphTextChar(_arg1, _arg2, _arg4, _arg5, _arg6);
break;
case MORPH_LINE:
_local7 = StrUtil.morphTextSplit(_arg1, _arg2, "\n", _arg4, _arg5, _arg6);
break;
case MORPH_WORD:
_local7 = StrUtil.morphTextSplit(_arg1, _arg2, " ", _arg4, _arg5, _arg6);
break;
};
return (_local7);
}
public static function rndString(_arg1:uint, _arg2:uint=0, _arg3:uint=0):String{
var _local4:String;
var _local5:String;
var _local6:String;
var _local7:uint;
_local5 = "";
_local6 = "";
switch (_arg3){
case 0:
_local4 = "abcdefghijklmnopqrstuvwxyz0123456789";
break;
case 1:
_local4 = "0123456789";
break;
case 2:
_local4 = "abcdefghijklmnopqrstuvwxyz";
break;
};
_local7 = 0;
while (_local7 < _arg1) {
_local6 = _local4.charAt(MathUtil.rnd(0, (_local4.length - 1)));
_local5 = (_local5 + ((_arg2)==0) ? ((MathUtil.rnd(1, 100))>50) ? _local6 : _local6.toUpperCase() : ((_arg2)==1) ? _local6.toUpperCase() : _local6);
_local7++;
};
return (_local5);
}
public static function pad(_arg1:String=" ", _arg2:int=1):String{
var _local3:String;
_local3 = "";
_arg1 = _arg1.charAt(0);
while (_local3.length < _arg2) {
_local3 = (_local3 + _arg1);
};
return (_local3);
}
public static function right(_arg1:String, _arg2:int):String{
var _local3:String;
_local3 = _arg1;
if (_local3.length >= _arg2){
_local3 = _local3.slice((_local3.length - _arg2));
};
return (_local3);
}
private static function morphTextSplit(_arg1:String, _arg2:String, _arg3:String, _arg4:Boolean, _arg5:String, _arg6:String):Array{
var _local7:Array;
var _local8:Array;
var _local9:Array;
var _local10:String;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:String;
_local7 = new Array();
_local8 = _arg1.split(_arg3);
_local9 = _arg2.split(_arg3);
_local10 = ((_arg5)=="") ? "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.# * +~@ !$ % & / () = ? -_ < > | " : _arg5;
_local11 = Math.max(_local8.length, _local9.length);
_local12 = 0;
while (_local12 < _local11) {
_local14 = "";
_local13 = 0;
while (_local13 < _local11) {
if (_local13 <= _local12){
if (_local13 < _local8.length){
_local14 = (_local14 + (StrUtil.rndString(_local8[_local13].length, 2, 2) + _arg3));
} else {
_local14 = (_local14 + _arg3);
};
} else {
if (_local13 < _local8.length){
_local14 = (_local14 + (_local8[_local13] + _arg3));
} else {
_local14 = (_local14 + _arg3);
};
};
_local13++;
};
_local14 = StrUtil.replace((_local14 + _arg3), (_arg3 + _arg3), "");
_local7.push((_arg6 + _local14));
_local12++;
};
_local12 = 0;
while (_local12 < _local11) {
_local14 = "";
_local13 = 0;
while (_local13 < _local11) {
if (_local13 <= _local12){
if (_local13 < _local9.length){
_local14 = (_local14 + (_local9[_local13] + _arg3));
} else {
_local14 = (_local14 + _arg3);
};
} else {
if (_local13 < _local9.length){
_local14 = (_local14 + (StrUtil.rndString(_local9[_local13].length, 2, 2) + _arg3));
} else {
_local14 = (_local14 + _arg3);
};
};
_local13++;
};
_local14 = StrUtil.replace((_local14 + _arg3), (_arg3 + _arg3), "");
_local7.push((_arg6 + _local14));
_local12++;
};
return (_local7);
}
public static function contains(_arg1:String, _arg2:String):Boolean{
return (!((_arg1.lastIndexOf(_arg2) == -1)));
}
public static function cRect(_arg1:String):Rectangle{
var _local2:Array;
var _local3:Rectangle;
_local3 = new Rectangle(0, 0, 0, 0);
if (_arg1.lastIndexOf(",") != -1){
_arg1 = StrUtil.replace(StrUtil.replace(_arg1, "(", ""), ")", "");
_local2 = _arg1.split(",");
if (_local2.length == 4){
_local3.x = parseFloat(_local2[0]);
_local3.y = parseFloat(_local2[1]);
_local3.width = parseFloat(_local2[2]);
_local3.height = parseFloat(_local2[3]);
};
};
return (_local3);
}
public static function trim(_arg1:String):String{
var _local2:String;
_local2 = _arg1;
if (_local2.length >= 0){
while (_local2.charAt(0) == " ") {
_local2 = _local2.slice(1);
};
while (_local2.charAt((_local2.length - 1)) == " ") {
_local2 = _local2.slice(0, (_local2.length - 1));
};
};
return (_local2);
}
public static function capitalize(_arg1:String):String{
return ((_arg1.charAt(0).toUpperCase() + _arg1.substring(1, _arg1.length).toLowerCase()));
}
public static function cBool(_arg1:String):Boolean{
return ((_arg1.toLowerCase() == "true"));
}
public static function isoToDate(_arg1:String):Date{
var _local2:Date;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local2 = new Date();
_local3 = StrUtil.cInt(_arg1.substr(0, 4));
_local4 = StrUtil.cInt(_arg1.substr(4, 2));
_local5 = StrUtil.cInt(_arg1.substr(6, 2));
_local6 = StrUtil.cInt(_arg1.substr(9, 2));
_local7 = StrUtil.cInt(_arg1.substr(11, 2));
_local8 = StrUtil.cInt(_arg1.substr(13, 2));
_local2.setFullYear(_local3, (_local4 - 1), _local5);
_local2.setHours(_local6);
_local2.setMinutes(_local7);
_local2.setSeconds(_local8);
return (_local2);
}
public static function part(_arg1:String, _arg2:String, _arg3:int):String{
var _local4:String;
var _local5:Array;
_local4 = _arg1;
if (contains(_arg1, _arg2)){
_local5 = _arg1.split(_arg2);
if (_local5.length > _arg3){
_local4 = _local5[_arg3];
};
};
return (_local4);
}
public static function cPoint(_arg1:String):Point{
var _local2:Array;
var _local3:Point;
_local3 = new Point(0, 0);
if (_arg1.lastIndexOf(",") != -1){
_arg1 = StrUtil.replace(StrUtil.replace(_arg1, "(", ""), ")", "");
_local2 = _arg1.split(",");
if (_local2.length == 2){
_local3.x = parseFloat(_local2[0]);
_local3.y = parseFloat(_local2[1]);
};
};
return (_local3);
}
public static function seperate(_arg1:String, _arg2:String):String{
var _local3:Number;
var _local4:String;
var _local5:String;
_local3 = 0;
_local4 = _arg1;
_local5 = "";
if (_arg2 == null){
_arg2 = ".";
};
if (_local4.length > 3){
_local3 = (_local4.length - 1);
while (_local3 > -1) {
_local5 = ((((((_local4.length - _local3) % 3))==0) ? _arg2 : "" + _local4.charAt(_local3)) + _local5);
_local3--;
};
} else {
_local5 = _arg1;
};
if (_local5.charAt(0) == _arg2){
_local5 = _local5.substring(1);
};
return (_local5);
}
public static function format(_arg1:Object, _arg2:int=2):String{
var _local3:String;
_local3 = String(_arg1);
while (_local3.length < _arg2) {
_local3 = ("0" + _local3);
};
return (_local3);
}
public static function padLeft(_arg1:String, _arg2:String=" ", _arg3:int=1):String{
var _local4:String;
_local4 = _arg1;
_arg2 = _arg2.charAt(0);
while (_local4.length < _arg3) {
_local4 = (_arg2 + _local4);
};
return (_local4);
}
public static function isoToShortDateString(_arg1:String, _arg2:String):String{
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:String;
_local3 = ((((_arg1 == "")) || ((_arg1 == null)))) ? StrUtil.isoDateTime() : _arg1;
_local4 = ((((_arg2 == "")) || ((_arg2 == null)))) ? "yr/mo/dy ho:mih" : _arg2;
_local6 = _local4;
_local6 = StrUtil.replace(_local6, "yr", _local3.substr(0, 4));
_local6 = StrUtil.replace(_local6, "mo", _local3.substr(4, 2));
_local6 = StrUtil.replace(_local6, "dy", _local3.substr(6, 2));
_local6 = StrUtil.replace(_local6, "ho", _local3.substr(9, 2));
_local6 = StrUtil.replace(_local6, "mi", _local3.substr(11, 2));
_local6 = StrUtil.replace(_local6, "se", _local3.substr(13, 2));
_local6 = StrUtil.replace(_local6, "ms", _local3.substr(15, 3));
return (_local6);
}
public static function getFilename(_arg1:String):String{
var _local2:*;
_local2 = _arg1;
if (_arg1.lastIndexOf("\\") != -1){
if (_arg1.lastIndexOf("\\") < _arg1.length){
_local2 = _arg1.substring((_arg1.lastIndexOf("\\") + 1));
};
};
return (_local2);
}
public static function isoToSeconds(_arg1:String, _arg2:Number=2000):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local3 = _arg2;
_local4 = StrUtil.cInt(_arg1.substr(0, 4));
_local5 = StrUtil.cInt(_arg1.substr(4, 2));
_local6 = StrUtil.cInt(_arg1.substr(6, 2));
_local7 = StrUtil.cInt(_arg1.substr(9, 2));
_local8 = StrUtil.cInt(_arg1.substr(11, 2));
_local9 = StrUtil.cInt(_arg1.substr(13, 2));
_local10 = 0;
_local10 = (Math.round(((_local4 - _local3) * 364.25)) * 86400);
_local10 = (_local10 + (Math.round((_local5 * ((((_local4 % 4))==0) ? 365 : 364 / 12))) * 86400));
_local10 = (_local10 + (_local6 * 86400));
_local10 = (_local10 + (_local7 * 3600));
_local10 = (_local10 + (_local8 * 60));
_local10 = (_local10 + _local9);
return (_local10);
}
}
}//package de.drygoods.Util
Section 13
//TweenUtil (de.drygoods.Util.TweenUtil)
package de.drygoods.Util {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public class TweenUtil {
public var delay:Number;
protected var _initted:Boolean;
protected var _subTweens:Array;
public var startTime:uint;
public var target:Object;
public var duration:Number;
protected var _hst:Boolean;
protected var _active:Boolean;
public var vars:Object;
public var tweens:Object;
public var initTime:uint;
protected static var _all:Dictionary = new Dictionary();
private static var _timer:Timer = new Timer(2000);
private static var _sprite:Sprite = new Sprite();
public static var killDelayedCallsTo:Function = killTweensOf;
public static var version:Number = 6.03;
private static var _listening:Boolean;
public function TweenUtil(_arg1:Object, _arg2:Number, _arg3:Object){
if (_arg1 == null){
return;
};
if (((((!((_arg3.overwrite == false))) && (!((_arg1 == null))))) || ((_all[_arg1] == undefined)))){
delete _all[_arg1];
_all[_arg1] = new Dictionary();
};
_all[_arg1][this] = this;
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.target = _arg1;
if (!(this.vars.ease is Function)){
this.vars.ease = easeOut;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
if (this.vars.mcColor != null){
this.vars.tint = this.vars.mcColor;
};
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
};
this.tweens = {};
this._subTweens = [];
this._hst = (_initted = false);
this._active = (((_arg2 == 0)) && ((this.delay == 0)));
this.initTime = getTimer();
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (_active))){
initTweenVals();
this.startTime = getTimer();
if (_active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
};
if (((!(_listening)) && (!(_active)))){
_sprite.addEventListener(Event.ENTER_FRAME, executeAll);
_timer.addEventListener("timer", killGarbage);
_timer.start();
_listening = true;
};
}
protected function addSubTween(_arg1:Function, _arg2:Object, _arg3:Object, _arg4:Object=null):void{
var _local5:String;
_subTweens.push({proxy:_arg1, target:_arg2, info:_arg4});
for (_local5 in _arg3) {
if (_arg2.hasOwnProperty(_local5)){
if (typeof(_arg3[_local5]) == "number"){
this.tweens[((("st" + _subTweens.length) + "_") + _local5)] = {o:_arg2, p:_local5, s:_arg2[_local5], c:(_arg3[_local5] - _arg2[_local5])};
} else {
this.tweens[((("st" + _subTweens.length) + "_") + _local5)] = {o:_arg2, p:_local5, s:_arg2[_local5], c:Number(_arg3[_local5])};
};
};
};
_hst = true;
}
public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:Boolean;
var _local4:String;
var _local5:Array;
var _local6:int;
var _local7:ColorTransform;
var _local8:*;
var _local9:Object;
_local3 = (this.target is DisplayObject);
if ((this.target is Array)){
_local5 = ((this.vars.endArray) || ([]));
_local6 = 0;
while (_local6 < _local5.length) {
if (((!((this.target[_local6] == _local5[_local6]))) && (!((this.target[_local6] == undefined))))){
this.tweens[_local6.toString()] = {o:this.target, p:_local6.toString(), s:this.target[_local6], c:(_local5[_local6] - this.target[_local6])};
};
_local6++;
};
} else {
for (_local4 in this.vars) {
if ((((((((((((((((((((((((((((((((((((((_local4 == "ease")) || ((_local4 == "delay")))) || ((_local4 == "overwrite")))) || ((_local4 == "onComplete")))) || ((_local4 == "onCompleteParams")))) || ((_local4 == "onCompleteScope")))) || ((_local4 == "runBackwards")))) || ((_local4 == "onUpdate")))) || ((_local4 == "onUpdateParams")))) || ((_local4 == "onUpdateScope")))) || ((_local4 == "autoAlpha")))) || ((_local4 == "onStart")))) || ((_local4 == "onStartParams")))) || ((_local4 == "onStartScope")))) || ((_local4 == "renderOnStart")))) || ((_local4 == "easeParams")))) || ((_local4 == "mcColor")))) || ((_local4 == "type")))) || (((_arg1) && (!((_arg2.indexOf(((" " + _local4) + " ")) == -1))))))){
} else {
if ((((_local4 == "tint")) && (_local3))){
_local7 = this.target.transform.colorTransform;
_local8 = new ColorTransform();
if (this.vars.alpha != undefined){
_local8.alphaMultiplier = this.vars.alpha;
delete this.vars.alpha;
delete this.tweens.alpha;
} else {
_local8.alphaMultiplier = this.target.alpha;
};
if (((!((this.vars[_local4] == null))) && (!((this.vars[_local4] == ""))))){
_local8.color = this.vars[_local4];
};
addSubTween(tintProxy, {progress:0}, {progress:1}, {target:this.target, color:_local7, endColor:_local8});
} else {
if ((((_local4 == "frame")) && (_local3))){
addSubTween(frameProxy, {frame:this.target.currentFrame}, {frame:this.vars[_local4]}, {target:this.target});
} else {
if ((((_local4 == "volume")) && (((_local3) || ((this.target is SoundChannel)))))){
addSubTween(volumeProxy, this.target.soundTransform, {volume:this.vars[_local4]}, {target:this.target});
} else {
if (this.target.hasOwnProperty(_local4)){
if (typeof(this.vars[_local4]) == "number"){
this.tweens[_local4] = {o:this.target, p:_local4, s:this.target[_local4], c:(this.vars[_local4] - this.target[_local4])};
} else {
this.tweens[_local4] = {o:this.target, p:_local4, s:this.target[_local4], c:Number(this.vars[_local4])};
};
};
};
};
};
};
};
};
if (this.vars.runBackwards == true){
for (_local4 in this.tweens) {
_local9 = this.tweens[_local4];
this.tweens[_local4].s = (_local9.s + _local9.c);
_local9.c = (_local9.c * -1);
};
};
if (typeof(this.vars.autoAlpha) == "number"){
this.target.visible = !((((this.vars.runBackwards == true)) && ((this.target.alpha == 0))));
};
_initted = true;
}
public function get active():Boolean{
if (_active){
return (true);
};
if (((getTimer() - this.initTime) / 1000) > this.delay){
_active = true;
this.startTime = (this.initTime + (this.delay * 1000));
if (!_initted){
initTweenVals();
} else {
if (typeof(this.vars.autoAlpha) == "number"){
this.target.visible = true;
};
};
if (this.vars.onStart != null){
this.vars.onStart.apply(this.vars.onStartScope, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
return (true);
//unresolved jump
};
return (false);
}
public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:String;
var _local6:uint;
_local2 = ((_arg1 - this.startTime) / 1000);
if (_local2 > this.duration){
_local2 = this.duration;
};
_local3 = this.vars.ease(_local2, 0, 1, this.duration);
for (_local5 in this.tweens) {
_local4 = this.tweens[_local5];
_local4.o[_local4.p] = (_local4.s + (_local3 * _local4.c));
};
if (_hst){
_local6 = 0;
while (_local6 < _subTweens.length) {
_subTweens[_local6].proxy(_subTweens[_local6]);
_local6++;
};
};
if (this.vars.onUpdate != null){
this.vars.onUpdate.apply(this.vars.onUpdateScope, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function complete(_arg1:Boolean=false):void{
if (!_arg1){
this.startTime = 0;
render((this.duration * 1000));
return;
};
if ((((typeof(this.vars.autoAlpha) == "number")) && ((this.target.alpha == 0)))){
this.target.visible = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(this.vars.onCompleteScope, this.vars.onCompleteParams);
};
removeTween(this);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4=null):TweenUtil{
return (new TweenUtil(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, onCompleteScope:_arg4, overwrite:false}));
}
public static function frameProxy(_arg1:Object):void{
_arg1.info.target.gotoAndStop(Math.round(_arg1.target.frame));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenUtil{
_arg3.runBackwards = true;
return (new TweenUtil(_arg1, _arg2, _arg3));
}
public static function executeAll(_arg1:Event=null):void{
var _local2:Dictionary;
var _local3:uint;
var _local4:Object;
var _local5:Object;
_local2 = _all;
_local3 = getTimer();
for (_local4 in _local2) {
for (_local5 in _local2[_local4]) {
if (((!((_local2[_local4][_local5] == undefined))) && (_local2[_local4][_local5].active))){
_local2[_local4][_local5].render(_local3);
if (_local2[_local4] == undefined){
break;
};
};
};
};
}
protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function volumeProxy(_arg1:Object):void{
_arg1.info.target.soundTransform = _arg1.target;
}
public static function removeTween(_arg1:TweenUtil=null):void{
if (((!((_arg1 == null))) && (!((_all[_arg1.target] == undefined))))){
delete _all[_arg1.target][_arg1];
};
}
public static function killGarbage(_arg1:TimerEvent):void{
var _local2:uint;
var _local3:Boolean;
var _local4:Object;
var _local5:Object;
var _local6:Object;
_local2 = 0;
for (_local4 in _all) {
_local3 = false;
for (_local5 in _all[_local4]) {
_local3 = true;
break;
};
if (!_local3){
delete _all[_local4];
} else {
_local2++;
};
};
if (_local2 == 0){
_sprite.removeEventListener(Event.ENTER_FRAME, executeAll);
_timer.removeEventListener("timer", killGarbage);
_timer.stop();
_listening = false;
};
}
public static function tintProxy(_arg1:Object):void{
var _local2:Number;
var _local3:Number;
_local2 = _arg1.target.progress;
_local3 = (1 - _local2);
_arg1.info.target.transform.colorTransform = new ColorTransform(((_arg1.info.color.redMultiplier * _local3) + (_arg1.info.endColor.redMultiplier * _local2)), ((_arg1.info.color.greenMultiplier * _local3) + (_arg1.info.endColor.greenMultiplier * _local2)), ((_arg1.info.color.blueMultiplier * _local3) + (_arg1.info.endColor.blueMultiplier * _local2)), ((_arg1.info.color.alphaMultiplier * _local3) + (_arg1.info.endColor.alphaMultiplier * _local2)), ((_arg1.info.color.redOffset * _local3) + (_arg1.info.endColor.redOffset * _local2)), ((_arg1.info.color.greenOffset * _local3) + (_arg1.info.endColor.greenOffset * _local2)), ((_arg1.info.color.blueOffset * _local3) + (_arg1.info.endColor.blueOffset * _local2)), ((_arg1.info.color.alphaOffset * _local3) + (_arg1.info.endColor.alphaOffset * _local2)));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenUtil{
return (new TweenUtil(_arg1, _arg2, _arg3));
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Object;
var _local4:*;
if (((!((_arg1 == null))) && (!((_all[_arg1] == undefined))))){
if (_arg2){
_local3 = _all[_arg1];
for (_local4 in _local3) {
_local3[_local4].complete(false);
};
};
delete _all[_arg1];
};
}
}
}//package de.drygoods.Util
Section 14
//Linear (fl.motion.easing.Linear)
package fl.motion.easing {
public class Linear {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.motion.easing
Section 15
//Sine (fl.motion.easing.Sine)
package fl.motion.easing {
public class Sine {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
}
}//package fl.motion.easing
Section 16
//_mcSound_41 (nutsnbolts_maxgames_fla._mcSound_41)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class _mcSound_41 extends MovieClip {
public function _mcSound_41(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 17
//mcArrow_84 (nutsnbolts_maxgames_fla.mcArrow_84)
package nutsnbolts_maxgames_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcArrow_84 extends MovieClip {
public var txtUnit:TextField;
public function mcArrow_84(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 18
//mcBattery_83 (nutsnbolts_maxgames_fla.mcBattery_83)
package nutsnbolts_maxgames_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcBattery_83 extends MovieClip {
public var txtUnit:TextField;
public function mcBattery_83(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 19
//mcBeam_0_56 (nutsnbolts_maxgames_fla.mcBeam_0_56)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcBeam_0_56 extends MovieClip {
public function mcBeam_0_56(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 20
//mcBeam_1_55 (nutsnbolts_maxgames_fla.mcBeam_1_55)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcBeam_1_55 extends MovieClip {
public function mcBeam_1_55(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 21
//mcBeam_2_58 (nutsnbolts_maxgames_fla.mcBeam_2_58)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcBeam_2_58 extends MovieClip {
public function mcBeam_2_58(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 22
//mcBeam_3_57 (nutsnbolts_maxgames_fla.mcBeam_3_57)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcBeam_3_57 extends MovieClip {
public function mcBeam_3_57(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 23
//mcBolts_78 (nutsnbolts_maxgames_fla.mcBolts_78)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcBolts_78 extends MovieClip {
public var mcBody:MovieClip;
public var btnBolts:SimpleButton;
public var mcSleep:MovieClip;
public function mcBolts_78(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 24
//mcBoltsBody_79 (nutsnbolts_maxgames_fla.mcBoltsBody_79)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcBoltsBody_79 extends MovieClip {
public function mcBoltsBody_79(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 25
//mcBtnSwap_85 (nutsnbolts_maxgames_fla.mcBtnSwap_85)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcBtnSwap_85 extends MovieClip {
public function mcBtnSwap_85(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 26
//mcMapContainer_48 (nutsnbolts_maxgames_fla.mcMapContainer_48)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcMapContainer_48 extends MovieClip {
public var mcBeam_4_0:MovieClip;
public var mcBeam_4_1:MovieClip;
public var mcBeam_4_2:MovieClip;
public var mcPlatform_3_0:MovieClip;
public var mcPlatform_3_1:MovieClip;
public var mcBeam_4_5:MovieClip;
public var mcPlatform_3_4:MovieClip;
public var mcPlatform_3_5:MovieClip;
public var mcPlatform_3_2:MovieClip;
public var mcBeam_4_6:MovieClip;
public var mcPlatform_3_6:MovieClip;
public var mcPlatform_3_3:MovieClip;
public var mcBeam_4_4:MovieClip;
public var mcBeam_4_3:MovieClip;
public var mcBeam_3_0:MovieClip;
public var mcBeam_3_2:MovieClip;
public var mcPlatform_2_3:MovieClip;
public var mcBeam_3_1:MovieClip;
public var mcBeam_3_6:MovieClip;
public var mcPlatform_2_4:MovieClip;
public var mcPlatform_2_5:MovieClip;
public var mcPlatform_2_1:MovieClip;
public var mcPlatform_2_6:MovieClip;
public var mcPlatform_2_0:MovieClip;
public var mcBeam_3_4:MovieClip;
public var mcPlatform_2_2:MovieClip;
public var mcBeam_3_3:MovieClip;
public var mcBeam_3_5:MovieClip;
public var mcBeam_2_1:MovieClip;
public var mcPlatform_1_0:MovieClip;
public var mcBolts:MovieClip;
public var mcBeam_2_0:MovieClip;
public var mcPlatform_1_5:MovieClip;
public var mcPlatform_1_2:MovieClip;
public var mcPlatform_1_3:MovieClip;
public var mcPlatform_1_4:MovieClip;
public var mcPlatform_1_6:MovieClip;
public var mcBeam_2_3:MovieClip;
public var mcPlatform_1_1:MovieClip;
public var mcBeam_2_5:MovieClip;
public var mcBeam_2_2:MovieClip;
public var mcBeam_2_4:MovieClip;
public var mcBeam_1_0:MovieClip;
public var mcBeam_1_1:MovieClip;
public var mcBeam_1_2:MovieClip;
public var mcPlatform_0_0:MovieClip;
public var mcPlatform_0_1:MovieClip;
public var mcPlatform_0_2:MovieClip;
public var mcPlatform_0_3:MovieClip;
public var mcPlatform_0_5:MovieClip;
public var mcPlatform_0_6:MovieClip;
public var mcBeam_1_3:MovieClip;
public var mcBeam_1_4:MovieClip;
public var mcBeam_1_5:MovieClip;
public var mcBeam_2_6:MovieClip;
public var mcPlatform_0_4:MovieClip;
public var mcBeam_1_6:MovieClip;
public var mcBeam_0_1:MovieClip;
public var mcBeam_0_2:MovieClip;
public var mcBeam_0_4:MovieClip;
public var mcBeam_0_6:MovieClip;
public var mcBeam_0_0:MovieClip;
public var mcBeam_0_5:MovieClip;
public var mcBeam_0_3:MovieClip;
public var mcNuts:MovieClip;
public var mcPlatform_6_1:MovieClip;
public var mcPlatform_6_2:MovieClip;
public var mcPlatform_6_3:MovieClip;
public var mcPlatform_6_5:MovieClip;
public var mcPlatform_6_6:MovieClip;
public var mcPlatform_6_0:MovieClip;
public var mcPlatform_6_4:MovieClip;
public var mcBeam_6_1:MovieClip;
public var mcBeam_6_2:MovieClip;
public var mcPlatform_5_1:MovieClip;
public var mcPlatform_5_2:MovieClip;
public var mcPlatform_5_5:MovieClip;
public var mcPlatform_5_0:MovieClip;
public var mcPlatform_5_4:MovieClip;
public var mcBeam_6_0:MovieClip;
public var mcPlatform_5_3:MovieClip;
public var mcBeam_6_3:MovieClip;
public var mcBeam_6_6:MovieClip;
public var mcPlatform_5_6:MovieClip;
public var mcBeam_6_4:MovieClip;
public var mcBeam_5_0:MovieClip;
public var mcBeam_5_1:MovieClip;
public var mcBeam_5_2:MovieClip;
public var mcPlatform_4_0:MovieClip;
public var mcPlatform_4_1:MovieClip;
public var mcPlatform_4_2:MovieClip;
public var mcBeam_5_6:MovieClip;
public var mcPlatform_4_4:MovieClip;
public var mcPlatform_4_5:MovieClip;
public var mcPlatform_4_6:MovieClip;
public var mcBeam_5_3:MovieClip;
public var mcBeam_5_4:MovieClip;
public var mcPlatform_4_3:MovieClip;
public var mcBeam_5_5:MovieClip;
public var mcBeam_6_5:MovieClip;
public var mcPointer:MovieClip;
}
}//package nutsnbolts_maxgames_fla
Section 27
//mcNut_52 (nutsnbolts_maxgames_fla.mcNut_52)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcNut_52 extends MovieClip {
public function mcNut_52(){
addFrameScript(12, frame13, 70, frame71);
}
function frame71(){
visible = false;
stop();
}
function frame13(){
gotoAndPlay(1);
}
}
}//package nutsnbolts_maxgames_fla
Section 28
//mcNut_Copy_53 (nutsnbolts_maxgames_fla.mcNut_Copy_53)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcNut_Copy_53 extends MovieClip {
public function mcNut_Copy_53(){
addFrameScript(12, frame13);
}
function frame13(){
gotoAndPlay(1);
}
}
}//package nutsnbolts_maxgames_fla
Section 29
//mcNuts_72 (nutsnbolts_maxgames_fla.mcNuts_72)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcNuts_72 extends MovieClip {
public var btnNuts:SimpleButton;
public var mcBody:MovieClip;
public var mcHead:MovieClip;
public var mcSleep:MovieClip;
}
}//package nutsnbolts_maxgames_fla
Section 30
//mcNutsBody_73 (nutsnbolts_maxgames_fla.mcNutsBody_73)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcNutsBody_73 extends MovieClip {
public function mcNutsBody_73(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 31
//mcNutsHead_74 (nutsnbolts_maxgames_fla.mcNutsHead_74)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcNutsHead_74 extends MovieClip {
public function mcNutsHead_74(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 32
//mcPlatform_49 (nutsnbolts_maxgames_fla.mcPlatform_49)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcPlatform_49 extends MovieClip {
public var mcNut:MovieClip;
public var mcPlatform:MovieClip;
public var btnPlatform:SimpleButton;
}
}//package nutsnbolts_maxgames_fla
Section 33
//mcPlatformBeam_54 (nutsnbolts_maxgames_fla.mcPlatformBeam_54)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcPlatformBeam_54 extends MovieClip {
public var mcBeam_2:MovieClip;
public var btnBeam_3_0:SimpleButton;
public var btnBeam_3_2:SimpleButton;
public var btnBeam_3_3:SimpleButton;
public var btnBeam_3_1:SimpleButton;
public var btnBeam_2_1:SimpleButton;
public var btnBeam_2_2:SimpleButton;
public var btnBeam_2_3:SimpleButton;
public var btnBeam_2_0:SimpleButton;
public var btnBeam_1_2:SimpleButton;
public var btnBeam_1_3:SimpleButton;
public var btnBeam_1_0:SimpleButton;
public var btnBeam_1_1:SimpleButton;
public var mcBeam_0:MovieClip;
public var mcBeam_1:MovieClip;
public var mcBeam_3:MovieClip;
}
}//package nutsnbolts_maxgames_fla
Section 34
//mcPlatformTop_50 (nutsnbolts_maxgames_fla.mcPlatformTop_50)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcPlatformTop_50 extends MovieClip {
public function mcPlatformTop_50(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 35
//mcPointAt_80 (nutsnbolts_maxgames_fla.mcPointAt_80)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcPointAt_80 extends MovieClip {
public function mcPointAt_80(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 36
//mcPreload_2 (nutsnbolts_maxgames_fla.mcPreload_2)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcPreload_2 extends MovieClip {
public var mcBar:MovieClip;
}
}//package nutsnbolts_maxgames_fla
Section 37
//mcPreloadBar_3 (nutsnbolts_maxgames_fla.mcPreloadBar_3)
package nutsnbolts_maxgames_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcPreloadBar_3 extends MovieClip {
public var txtLoad:TextField;
public function mcPreloadBar_3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 38
//mcSound_15 (nutsnbolts_maxgames_fla.mcSound_15)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcSound_15 extends MovieClip {
public function mcSound_15(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 39
//mcSound_88 (nutsnbolts_maxgames_fla.mcSound_88)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcSound_88 extends MovieClip {
public function mcSound_88(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 40
//mcWindowConfirm_89 (nutsnbolts_maxgames_fla.mcWindowConfirm_89)
package nutsnbolts_maxgames_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mcWindowConfirm_89 extends MovieClip {
public var txtScore:TextField;
public var btnDoneNext:SimpleButton;
public var btnDoneQuit:SimpleButton;
public var btnResetNo:SimpleButton;
public var btnConfirmYes:SimpleButton;
public var btnDoneMore:SimpleButton;
public var btnConfirmNo:SimpleButton;
public var btnResetYes:SimpleButton;
public var btnReadyYes:SimpleButton;
public var mcEyeNuts:MovieClip;
public var btnDoneReset:SimpleButton;
public function mcWindowConfirm_89(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package nutsnbolts_maxgames_fla
Section 41
//mcZeppelin_8 (nutsnbolts_maxgames_fla.mcZeppelin_8)
package nutsnbolts_maxgames_fla {
import flash.display.*;
public dynamic class mcZeppelin_8 extends MovieClip {
public var btnZeppelin:SimpleButton;
}
}//package nutsnbolts_maxgames_fla
Section 42
//mcLevel_0 (mcLevel_0)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_0 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var start_1:MovieClip;
public var end_3:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 43
//mcLevel_1 (mcLevel_1)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_1 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var bmh:MovieClip;
public var start_3:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var end_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 44
//mcLevel_10 (mcLevel_10)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_10 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var startbolts:MovieClip;
public var blh:MovieClip;
public var bmh:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var startend_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 45
//mcLevel_11 (mcLevel_11)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_11 extends MovieClip {
public var pl:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var startbolts:MovieClip;
public var blh:MovieClip;
public var bmh:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var startend_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 46
//mcLevel_12 (mcLevel_12)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_12 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var startbolts:MovieClip;
public var blv:MovieClip;
public var start_2:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var end_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 47
//mcLevel_13 (mcLevel_13)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_13 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var startbolts:MovieClip;
public var blv:MovieClip;
public var bmh:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var startend_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 48
//mcLevel_14 (mcLevel_14)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_14 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var startbolts:MovieClip;
public var bmh:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var startend_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 49
//mcLevel_15 (mcLevel_15)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_15 extends MovieClip {
public var pl:MovieClip;
public var txtLvlName:TextField;
public var startbolts:MovieClip;
public var blv:MovieClip;
public var bmh:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var startend_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 50
//mcLevel_16 (mcLevel_16)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_16 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var startbolts:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var startend_0:MovieClip;
public var txtLvlSteps:TextField;
public var txtHelp:TextField;
}
}//package
Section 51
//mcLevel_17 (mcLevel_17)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_17 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var startbolts:MovieClip;
public var blh:MovieClip;
public var bmh:MovieClip;
public var txtLvlNum:TextField;
public var startend_3:MovieClip;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var txtHelp:TextField;
}
}//package
Section 52
//mcLevel_18 (mcLevel_18)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_18 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var startbolts:MovieClip;
public var blv:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var startend_0:MovieClip;
public var txtLvlSteps:TextField;
public var txtHelp:TextField;
}
}//package
Section 53
//mcLevel_19 (mcLevel_19)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_19 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var startbolts:MovieClip;
public var blv:MovieClip;
public var bmh:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var startend_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 54
//mcLevel_2 (mcLevel_2)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_2 extends MovieClip {
public var pl:MovieClip;
public var txtLvlName:TextField;
public var blh:MovieClip;
public var bmv:MovieClip;
public var start_3:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var end_3:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 55
//mcLevel_20 (mcLevel_20)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_20 extends MovieClip {
public var pl:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var blh:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var bolts:MovieClip;
public var end_2:MovieClip;
public var txtHelp:TextField;
public var startall_0:MovieClip;
}
}//package
Section 56
//mcLevel_21 (mcLevel_21)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_21 extends MovieClip {
public var pl:MovieClip;
public var startall_3:MovieClip;
public var txtLvlName:TextField;
public var blv:MovieClip;
public var bmh:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var bolts:MovieClip;
public var end_0:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 57
//mcLevel_22 (mcLevel_22)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_22 extends MovieClip {
public var pl:MovieClip;
public var startall_3:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var bmh:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var bolts:MovieClip;
public var end_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 58
//mcLevel_23 (mcLevel_23)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_23 extends MovieClip {
public var pl:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var blh:MovieClip;
public var bmh:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var bolts:MovieClip;
public var end_3:MovieClip;
public var txtHelp:TextField;
public var startall_1:MovieClip;
}
}//package
Section 59
//mcLevel_24 (mcLevel_24)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_24 extends MovieClip {
public var pl:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var bolts:MovieClip;
public var end_0:MovieClip;
public var txtHelp:TextField;
public var startall_2:MovieClip;
}
}//package
Section 60
//mcLevel_25 (mcLevel_25)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_25 extends MovieClip {
public var pl:MovieClip;
public var startall_3:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var blv:MovieClip;
public var bmh:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var bolts:MovieClip;
public var end_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 61
//mcLevel_26 (mcLevel_26)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_26 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var blv:MovieClip;
public var bmh:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var bolts:MovieClip;
public var end_3:MovieClip;
public var txtHelp:TextField;
public var startall_1:MovieClip;
}
}//package
Section 62
//mcLevel_27 (mcLevel_27)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_27 extends MovieClip {
public var pl:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var bolts:MovieClip;
public var end_2:MovieClip;
public var txtHelp:TextField;
public var startall_0:MovieClip;
}
}//package
Section 63
//mcLevel_28 (mcLevel_28)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_28 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var bmh:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var bolts:MovieClip;
public var end_3:MovieClip;
public var txtHelp:TextField;
public var startall_1:MovieClip;
}
}//package
Section 64
//mcLevel_29 (mcLevel_29)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_29 extends MovieClip {
public var pl:MovieClip;
public var startall_3:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var blv:MovieClip;
public var bmh:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var bolts:MovieClip;
public var end_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 65
//mcLevel_3 (mcLevel_3)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_3 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var bmh:MovieClip;
public var start_0:MovieClip;
public var txtLvlNum:TextField;
public var bmv:MovieClip;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var end_2:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 66
//mcLevel_4 (mcLevel_4)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_4 extends MovieClip {
public var pl:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var blv:MovieClip;
public var bmh:MovieClip;
public var start_0:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var end_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 67
//mcLevel_5 (mcLevel_5)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_5 extends MovieClip {
public var pl:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var bmh:MovieClip;
public var start_2:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var end_0:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 68
//mcLevel_6 (mcLevel_6)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_6 extends MovieClip {
public var pl:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var blv:MovieClip;
public var bmh:MovieClip;
public var bmv:MovieClip;
public var start_3:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var end_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 69
//mcLevel_7 (mcLevel_7)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_7 extends MovieClip {
public var pl:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var blv:MovieClip;
public var start_0:MovieClip;
public var txtLvlNum:TextField;
public var bmv:MovieClip;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var end_2:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 70
//mcLevel_8 (mcLevel_8)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_8 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var bmh:MovieClip;
public var start_3:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var end_1:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 71
//mcLevel_9 (mcLevel_9)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcLevel_9 extends MovieClip {
public var pl:MovieClip;
public var bsh:MovieClip;
public var txtLvlName:TextField;
public var bsv:MovieClip;
public var blv:MovieClip;
public var bmv:MovieClip;
public var txtLvlNum:TextField;
public var nut:MovieClip;
public var txtLvlSteps:TextField;
public var start_1:MovieClip;
public var end_3:MovieClip;
public var txtHelp:TextField;
}
}//package
Section 72
//MedalBadge (MedalBadge)
package {
import flash.geom.*;
import com.medalyourway.DataType.*;
import de.drygoods.Util.*;
import flash.display.*;
import flash.text.*;
public class MedalBadge extends MovieClip {
public var txtCopy:TextField;
private var _bmpIcon:Bitmap;
public var txtHead:TextField;
private var _fnReturn:Function;
private var _strMedal:String;
public function MedalBadge(_arg1:String="", _arg2:Function=null){
if (_arg1 != ""){
this._strMedal = _arg1;
this._fnReturn = _arg2;
this.init();
};
}
private function init():void{
var _local1:mywMedalData;
var _local2:Rectangle;
var _local3:TextField;
_local1 = SubMain.getInstance().mywPlayer.getMedal(this._strMedal);
_local2 = StrUtil.cRect(_local1.strIcon);
this._bmpIcon = new Bitmap((new pngMedalIcons(0, 0) as BitmapData));
this._bmpIcon.x = 9;
this._bmpIcon.y = 9;
this._bmpIcon.alpha = 0;
this._bmpIcon.scrollRect = _local2;
_local3 = (this.getChildByName("txtHead") as TextField);
_local3.text = _local1.strName;
TweenUtil.from(_local3, 0.3, {alpha:0, delay:0.5});
TweenUtil.to(_local3, 0.3, {alpha:0, delay:4, overwrite:false});
_local3 = (this.getChildByName("txtCopy") as TextField);
_local3.text = _local1.strText;
TweenUtil.from(_local3, 0.3, {alpha:0, delay:1});
TweenUtil.to(_local3, 0.3, {alpha:0, delay:4.2, overwrite:false});
this.addChild(this._bmpIcon);
TweenUtil.to(this._bmpIcon, 0.2, {tint:0xFFFFFF, alpha:1, delay:0.2});
TweenUtil.to(this._bmpIcon, 1, {tint:0, delay:0.5, overwrite:false});
TweenUtil.to(this._bmpIcon, 0.3, {tint:1, alpha:0, delay:4, overwrite:false});
this.x = 220;
this.y = 500;
this.alpha = 0;
TweenUtil.to(this, 0.2, {y:380, alpha:1});
TweenUtil.to(this, 0.2, {y:500, alpha:0, delay:4.8, overwrite:false, onComplete:this._fnReturn});
trace("medal: ", _local1.strName);
}
}
}//package
Section 73
//musicMenu (musicMenu)
package {
import flash.media.*;
public dynamic class musicMenu extends Sound {
}
}//package
Section 74
//musicWind (musicWind)
package {
import flash.media.*;
public dynamic class musicWind extends Sound {
}
}//package
Section 75
//pngMedalIcons (pngMedalIcons)
package {
import flash.display.*;
public dynamic class pngMedalIcons extends BitmapData {
public function pngMedalIcons(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 76
//Preloader (Preloader)
package {
import de.drygoods.Util.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.external.*;
import flash.net.*;
public class Preloader extends MovieClip {
private const STATE_PRELOAD:uint = 1;
private const STATE_EXIT:uint = 4;
private const STATE_DONE:uint = 3;
private const STATE_NOP:uint = 0;
public var link:String;
public var btnSiteLink:SimpleButton;
private var _FPSCounter:FPSCounter;
public var mcPreload:MovieClip;
private var _iState:uint;
private var _spMain:Sprite;
public function Preloader(){
addFrameScript(0, frame1);
trace("init preloader");
this._iState = STATE_NOP;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.showDefaultContextMenu = false;
stage.quality = StageQuality.HIGH;
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
this.loaderInfo.addEventListener(Event.INIT, this.initDisplay);
this.loaderInfo.addEventListener(Event.COMPLETE, this.onComplete);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
this.stop();
}
private function onComplete(_arg1:Event):void{
this._iState = STATE_DONE;
}
function frame1(){
link = "http://www.maxgames.com/";
btnSiteLink.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
}
private function onLanguageFileLoaded(_arg1:Boolean):void{
this.onExitPreloader();
}
private function onExitPreloader():void{
SubMain.getInstance().init(this._spMain, stage);
SubMain.getInstance().showScreen("intro");
}
private function showProgress(_arg1:ProgressEvent):void{
var _local2:Number;
var _local3:MovieClip;
_local2 = ((_arg1.bytesLoaded / _arg1.bytesTotal) * 100);
if (this._iState == STATE_PRELOAD){
if (this._iState == STATE_PRELOAD){
_local3 = ((this.getChildByName("mcPreload") as MovieClip).getChildByName("mcBar") as MovieClip);
_local3.gotoAndStop(Math.round(_local2));
(_local3.getChildByName("txtLoad") as TextField).text = (((Math.round((_arg1.bytesLoaded / 0x0400)).toString() + "k / ") + Math.round((_arg1.bytesTotal / 0x0400)).toString()) + "k");
};
};
}
private function initDisplay(_arg1:Event):void{
trace("init display");
this._spMain = new Sprite();
this._spMain.name = "spMain";
this._spMain.x = 0;
this._spMain.y = 0;
this.addChildAt(this._spMain, 0);
}
private function onEnterFrame(_arg1:Event):void{
switch (this._iState){
case STATE_NOP:
if (this.framesLoaded >= 5){
this.gotoAndStop("Preload");
this._iState = STATE_PRELOAD;
};
break;
case STATE_DONE:
this.gotoAndStop("Preload");
this._iState = STATE_EXIT;
break;
case STATE_EXIT:
this.initExitPreloader();
break;
};
}
private function initExitPreloader():void{
var _local1:String;
trace("loading done");
_local1 = this.loaderInfo.url;
this.gotoAndStop("Done");
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
this.loaderInfo.removeEventListener(Event.INIT, this.initDisplay);
this.loaderInfo.removeEventListener(Event.COMPLETE, this.onComplete);
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, showProgress);
this._FPSCounter = new FPSCounter(32, 575, 0);
this._FPSCounter.start();
this._FPSCounter.visible = false;
this.addChild(this._FPSCounter);
this.onExitPreloader();
}
public function onClick(_arg1:MouseEvent):void{
var event = _arg1;
try {
ExternalInterface.call("window.open", link, "_blank", "");
} catch(error:Error) {
navigateToURL(new URLRequest(link), "_blank");
};
}
}
}//package
Section 77
//ScreenAbout (ScreenAbout)
package {
import de.drygoods.Util.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import de.drygoods.Graphics.*;
import flash.net.*;
import flash.filters.*;
public class ScreenAbout extends MovieClip {
public var btnBack:SimpleButton;
public var btnMax:SimpleButton;
public var btnNGFX:SimpleButton;
public var txtBack:TextField;
public var btnGYW:SimpleButton;
public var btnMore:SimpleButton;
public var txtMore:TextField;
public var btnDG:SimpleButton;
public function ScreenAbout(_arg1:int=-1){
this.name = "mcAbout";
if (_arg1 != -1){
trace("about screen");
this.init();
};
}
private function takeBluredScreenshot(_arg1:Number=0):Bitmap{
var _local2:BitmapData;
var _local3:Bitmap;
_local2 = new BitmapData(640, 480, false, 0);
this.filters = [new BlurFilter(10, 10, BitmapFilterQuality.MEDIUM)];
_local2.draw(this);
this.filters = [];
_local3 = new Bitmap(_local2);
ColorUtil.setBrightness2(_local3, _arg1, _arg1, _arg1);
return (_local3);
}
private function init():void{
var _local1:SimpleButton;
var _local2:TextField;
var _local3:TextField;
_local2 = (this.getChildByName("txtBack") as TextField);
_local2.mouseEnabled = false;
_local1 = (this.getChildByName("btnBack") as SimpleButton);
_local1.x = (_local2.x - 5);
_local1.y = (_local2.y - 2);
_local1.width = (VisualUtil.txtGetWidth(_local2) + 10);
_local1.height = (VisualUtil.txtGetHeight(_local2) + 7);
EventUtil.setButtonEvents(_local1, this.handleButtonMenu);
_local3 = (this.getChildByName("txtMore") as TextField);
_local3.mouseEnabled = false;
_local3.x = (VisualUtil.txtGetRight(_local2) + 20);
_local1 = (this.getChildByName("btnMore") as SimpleButton);
_local1.x = (_local3.x - 5);
_local1.y = (_local3.y - 2);
_local1.width = (VisualUtil.txtGetWidth(_local3) + 15);
_local1.height = (VisualUtil.txtGetHeight(_local3) + 7);
EventUtil.setButtonEvents(_local1, this.handleButtonMenu);
EventUtil.setButtonEvents((this.getChildByName("btnDG") as SimpleButton), this.handleButtonMenu);
EventUtil.setButtonEvents((this.getChildByName("btnGYW") as SimpleButton), this.handleButtonMenu);
EventUtil.setButtonEvents((this.getChildByName("btnNGFX") as SimpleButton), this.handleButtonMenu);
EventUtil.setButtonEvents((this.getChildByName("btnMax") as SimpleButton), this.handleButtonMenu);
this.alpha = 0;
TweenUtil.to(this, 0.5, {alpha:1});
}
public function exit(){
EventUtil.setButtonEvents((this.getChildByName("btnBack") as SimpleButton), this.handleButtonMenu, false);
EventUtil.setButtonEvents((this.getChildByName("btnMore") as SimpleButton), this.handleButtonMenu, false);
EventUtil.setButtonEvents((this.getChildByName("btnDG") as SimpleButton), this.handleButtonMenu, false);
EventUtil.setButtonEvents((this.getChildByName("btnGYW") as SimpleButton), this.handleButtonMenu, false);
EventUtil.setButtonEvents((this.getChildByName("btnNGFX") as SimpleButton), this.handleButtonMenu, false);
EventUtil.setButtonEvents((this.getChildByName("btnMax") as SimpleButton), this.handleButtonMenu, false);
}
private function handleButtonMenu(_arg1:MouseEvent):void{
switch (_arg1.type){
case MouseEvent.MOUSE_OVER:
SoundUtil.playSFX("sndOver");
break;
case MouseEvent.MOUSE_UP:
SoundUtil.playSFX("sndClick");
switch (_arg1.target.name){
case "btnBack":
this.exit();
SubMain.getInstance().showScreen("menu_activate");
TweenUtil.to(this, 0.5, {alpha:0, onComplete:SubMain.getInstance().showScreen, onCompleteParams:["about_remove"]});
break;
case "btnMore":
SubMain.getInstance().moreGames();
break;
case "btnGYW":
if (!SubMain.getInstance().mywPlayer.getMedal("m8").bAchieved){
SubMain.getInstance().mywPlayer.getMedal("m8").setAchieved(StrUtil.isoDateTime());
SubMain.getInstance().showMedal("m8");
};
navigateToURL(new URLRequest("http://blog.gamingyourway.com/"), "_blank");
break;
case "btnDG":
navigateToURL(new URLRequest("http://www.drygoods.de/"), "_blank");
break;
case "btnNGFX":
navigateToURL(new URLRequest("http://www.ngfx.de/"), "_blank");
break;
case "btnMax":
SubMain.getInstance().moreGames();
break;
};
break;
};
}
}
}//package
Section 78
//ScreenExtro (ScreenExtro)
package {
import de.drygoods.Util.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import de.drygoods.Graphics.*;
import flash.filters.*;
public class ScreenExtro extends MovieClip {
private var _mcEyeBolts:MovieClip;
private var _mcEyeNuts:MovieClip;
public var txtBack:TextField;
public var mcEyeBolts:MovieClip;
public var btnPlay:SimpleButton;
public var mcEyeNuts:MovieClip;
public function ScreenExtro(_arg1:Boolean=false){
addFrameScript(60, frame61, 89, frame90);
this.name = "mcExtro";
if (_arg1){
trace("story screen");
this.init();
};
}
private function takeBluredScreenshot(_arg1:Number=0):Bitmap{
var _local2:BitmapData;
var _local3:Bitmap;
_local2 = new BitmapData(640, 480, false, 0);
this.filters = [new BlurFilter(10, 10, BitmapFilterQuality.MEDIUM)];
_local2.draw(this);
this.filters = [];
_local3 = new Bitmap(_local2);
ColorUtil.setBrightness2(_local3, _arg1, _arg1, _arg1);
return (_local3);
}
private function init():void{
EventUtil.setButtonEvents((this.getChildByName("btnPlay") as SimpleButton), this.handleButtonMenu);
this.alpha = 0;
this.stop();
this.gotoAndStop(1);
this._mcEyeBolts = (this.getChildByName("mcEyeNuts") as MovieClip);
this._mcEyeBolts.visible = false;
this._mcEyeNuts = (this.getChildByName("mcEyeBolts") as MovieClip);
this._mcEyeNuts.visible = false;
TweenUtil.to(this, 0.5, {alpha:1});
TweenUtil.to(this, 0.1, {delay:1, overwrite:false, onComplete:this.play});
SoundUtil.playSFX("musicMenu");
}
public function exit(){
this._mcEyeBolts.visible = false;
this._mcEyeNuts.visible = false;
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
EventUtil.setButtonEvents((this.getChildByName("btnPlay") as SimpleButton), this.handleButtonMenu, false);
}
function frame90(){
this.gotoMenu();
stop();
}
public function gotoMenu():void{
SubMain.getInstance().showScreen("menu");
TweenUtil.to(this, 0.5, {alpha:0, onComplete:SubMain.getInstance().showScreen, onCompleteParams:["extro_remove"]});
}
private function onEnterFrame(_arg1:Event):void{
this._mcEyeBolts.visible = false;
if (MathUtil.rnd(0, 100) <= 1){
this._mcEyeBolts.visible = true;
};
this._mcEyeNuts.visible = false;
if (MathUtil.rnd(0, 100) <= 1){
this._mcEyeNuts.visible = true;
};
}
private function blinkEyes():void{
trace("!");
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
function frame61(){
this.blinkEyes();
stop();
}
private function handleButtonMenu(_arg1:MouseEvent):void{
switch (_arg1.type){
case MouseEvent.MOUSE_OVER:
SoundUtil.playSFX("sndOver");
break;
case MouseEvent.MOUSE_UP:
SoundUtil.playSFX("sndClick");
switch (_arg1.target.name){
case "btnPlay":
this.exit();
this.play();
break;
};
break;
};
}
}
}//package
Section 79
//ScreenGame (ScreenGame)
package {
import flash.geom.*;
import de.drygoods.Random.*;
import de.drygoods.Util.*;
import flash.events.*;
import flash.display.*;
import com.medalyourway.*;
import flash.text.*;
import com.gamingyourway.Pathfinder.*;
import de.drygoods.Graphics.*;
import com.gamingyourway.Dungeon.*;
import fl.motion.easing.*;
import flash.utils.*;
import flash.filters.*;
public class ScreenGame extends MovieClip {
private const MAPCENTER_X:int = 320;
private const MAPCENTER_Y:int = 260;
private const BEAM_NO:int = 0;
private const PLATFORM_STARTALL:int = 6;
private const PLATFORM_STARTBOLTS:int = 5;
private const PLATFORM_NO:int = -1;
private const PLATFORM_START:int = 2;
private const PLATFORM_BOLTS:int = 1;
private const MEDAL_TIME_PLAY:int = 3600;
private const PLATFORM_NUTS:int = 0;
private const PLATFORM_END:int = 3;
private const PLATFORM_STARTEND:int = 4;
private const BEAM_1:int = 1;
private const BEAM_2:int = 2;
private const BEAM_3:int = 3;
public var mcCloud_00:MovieClip;
public var mcCloud_01:MovieClip;
public var mcCloud_03:MovieClip;
private var _txtTimeMin_0:TextField;
public var txtStepsExt:TextField;
private var _txtTimeMin_1:TextField;
private var _strSeperator:String;// = ","
public var mcCloud_02:MovieClip;
public var mcArrow:MovieClip;
private var _pClick:Point;
private var _mcPointExit:MovieClip;
public var btnSound:SimpleButton;
public var btnRestart:SimpleButton;
private var _txtScoreLabel:TextField;
private var _pCurrent:Point;
public var mcConfirm:MovieClip;
public var txtLevelLabel:TextField;
public var txtTimeSec_0:TextField;
public var txtTimeSec_1:TextField;
private var _mcPointBonus:MovieClip;
private var _bUsingNuts:Boolean;
public var mcZeppelin:MovieClip;
private var _pExit:Point;
private var _iScore:int;
private var _txtStepsLabel:TextField;
public var txtQuit:TextField;
private var _mcPointBolts:MovieClip;
private var _rnd:MersenneTwister;
private var _txtTimeMS_0:TextField;
private var _txtTimeMS_1:TextField;
private var _txtTimeMS_2:TextField;
private var _mcNut:MovieClip;
public var mcSound:MovieClip;
private var _iStartSeed:int;
private var _mcRobot:MovieClip;
private var _iSteps:int;
private var _btnSound:SimpleButton;
private var _txtTimeLabel:TextField;
public var txtRestart:TextField;
private var _mcPointNuts:MovieClip;
private var _btnQuit:SimpleButton;
private var _iNoBeam:int;// = -1
private var _mcCloud_00:MovieClip;
private var _mcCloud_01:MovieClip;
private var _mcCloud_02:MovieClip;
private var _mcCloud_03:MovieClip;
private var _btnRestart:SimpleButton;
private var _iTimeMS:int;
private var _txtLevelBase:TextField;
public var mcPointExit:MovieClip;
private var _txtScoreBase:TextField;
public var mcHelp:MovieClip;
private var _bUseDrag:Boolean;
public var txtStepsBase:TextField;
public var txtScoreLabel:TextField;
private var _pNuts:Point;
private var _mcBattery:MovieClip;
private var _aMap:Array;
public var txtTimeMin_0:TextField;
public var txtTimeMin_1:TextField;
private var _aHelp:Array;
private var _bMouseDown:Boolean;
private var _txtTimeSec_1:TextField;
private var _mcPointer:MovieClip;
private var _Pathfinder:Pathfinder2D;
private var _iHelp:int;// = -1
private var _mcZeppelin:MovieClip;
private var _txtTimeSec_0:TextField;
private var _bMove:Boolean;
private var _mcNuts:MovieClip;
private var _txtLevelLabel:TextField;
private var _txtStepsExt:TextField;
public var mcRobot:MovieClip;
public var txtStepsLabel:TextField;
public var mcPointBonus:MovieClip;
public var txtTimeMS_0:TextField;
public var txtTimeMS_1:TextField;
public var txtTimeMS_2:TextField;
private var _iStepsMax:int;
public var btnQuit:SimpleButton;
private var _mcConfirm:MovieClip;
private var _mcArrow:MovieClip;
private var _mcMap:MovieClip;
private var _iTimeSec:int;
public var mcPointBolts:MovieClip;
private var _pBolts:Point;
private var _bHasBolts:Boolean;
private var _mcHelp:MovieClip;
private var _txtRestart:TextField;
private var _aPath:Array;
private var _iPower:int;
public var mcPointNuts:MovieClip;
private var _iNut:int;// = -1
private var _mcBolts:MovieClip;
private var _bAllowDrag:Boolean;
public var txtTimeLabel:TextField;
private var _rectMap:Rectangle;
public var mcBattery:MovieClip;
private var _txtQuit:TextField;
private var _fnRun:Function;
private var _refPlayer:mywUserHandle;
private var _mcSound:MovieClip;
public var txtLevelBase:TextField;
private var _txtStepsBase:TextField;
public var mcMap:MovieClip;
public var txtScoreBase:TextField;
private var _bWait:Boolean;
public function ScreenGame(_arg1:int=-1){
_iHelp = -1;
_iNut = -1;
_iNoBeam = -1;
_strSeperator = ",";
super();
this.name = "mcGame";
if (_arg1 != -1){
trace("Game screen");
this._iStartSeed = _arg1;
this.init();
};
}
private function moveClouds():void{
this._mcCloud_00.x = (this._mcCloud_00.x + 1);
this._mcCloud_01.x = (this._mcCloud_01.x + (this._bWait) ? 1 : 0);
this._mcCloud_02.x = (this._mcCloud_02.x + (this._bWait) ? 1 : 0);
this._mcCloud_03.x = (this._mcCloud_03.x + 1);
this._mcZeppelin.x--;
this._bWait = !(this._bWait);
if (this._mcCloud_00.x > 650){
this._mcCloud_00.x = -(MathUtil.rnd(350, 500));
this._mcCloud_00.y = MathUtil.rnd(-25, 100);
};
if (this._mcCloud_01.x > 650){
this._mcCloud_01.x = -(MathUtil.rnd(350, 500));
this._mcCloud_01.y = MathUtil.rnd(-25, 100);
};
if (this._mcCloud_02.x > 650){
this._mcCloud_02.x = -(MathUtil.rnd(350, 500));
this._mcCloud_02.y = MathUtil.rnd(-25, 100);
};
if (this._mcCloud_03.x > 650){
this._mcCloud_03.x = -(MathUtil.rnd(350, 500));
this._mcCloud_03.y = MathUtil.rnd(-25, 100);
};
if (this._mcZeppelin.x < -310){
this._mcZeppelin.x = MathUtil.rnd(640, 680);
this._mcZeppelin.y = MathUtil.rnd(0, 75);
};
}
private function paintMap():void{
var mcTmp:MovieClip;
var mcBeam:MovieClip;
var i:int;
var j:int;
var x:int;
var xd:int;
var xx:int;
var y:int;
var yd:int;
var yy:int;
var bVisible:Boolean;
bVisible = false;
this._mcRobot.y = 500;
this._mcNut = null;
this._rectMap = new Rectangle(999, 999, -999, -999);
this._iNut = -1;
x = 0;
while (x < 7) {
y = 0;
while (y < 7) {
bVisible = false;
xd = y;
yd = x;
xx = (((-3 + xd) * 80) + ((-3 + yd) * 80));
yy = ((-((-3 + yd)) * 40) + ((-3 + xd) * 40));
mcTmp = (this.mcMap[((("mcPlatform_" + xd) + "_") + yd)] as MovieClip);
mcTmp.x = xx;
mcTmp.y = yy;
mcTmp.visible = false;
var _local2 = (mcTmp.getChildByName("mcNut") as MovieClip);
with (_local2) {
visible = false;
enabled = false;
mouseEnabled = false;
};
mcBeam = (this.mcMap[((("mcBeam_" + xd) + "_") + yd)] as MovieClip);
mcBeam.x = xx;
mcBeam.y = yy;
mcBeam.visible = false;
if (this._aMap[x][y].p != PLATFORM_NO){
mcTmp.visible = true;
mcBeam.visible = true;
i = 0;
while (i < Dir.NUM_BASEDIR) {
_local2 = (mcBeam[("mcBeam_" + i)] as MovieClip);
with (_local2) {
visible = false;
};
j = 1;
while (j < 4) {
_local2 = (mcBeam.getChildByName(((("btnBeam_" + j) + "_") + i)) as SimpleButton);
with (_local2) {
enabled = false;
mouseEnabled = false;
};
j = (j + 1);
};
i = (i + 1);
};
switch (this._aMap[x][y].p){
case PLATFORM_NUTS:
bVisible = true;
if (this._aMap[x][y].h == 1){
this._mcNut = (mcTmp.getChildByName("mcNut") as MovieClip);
_local2 = (mcTmp.getChildByName("mcNut") as MovieClip);
with (_local2) {
visible = true;
enabled = true;
};
this._iNut = 0;
};
(mcTmp.getChildByName("mcPlatform") as MovieClip).gotoAndStop(1);
break;
case PLATFORM_BOLTS:
bVisible = true;
(mcTmp.getChildByName("mcPlatform") as MovieClip).gotoAndStop(2);
break;
case PLATFORM_START:
bVisible = true;
(mcTmp.getChildByName("mcPlatform") as MovieClip).gotoAndStop((3 + this._aMap[x][y].d));
this.spinBody(this._mcNuts, this._aMap[x][y].d);
this._mcNuts.x = mcTmp.x;
this._mcNuts.y = mcTmp.y;
this._mcNuts.visible = true;
break;
case PLATFORM_STARTALL:
bVisible = true;
(mcTmp.getChildByName("mcPlatform") as MovieClip).gotoAndStop((3 + this._aMap[x][y].d));
this.spinBody(this._mcNuts, this._aMap[x][y].d);
this._mcNuts.x = mcTmp.x;
this._mcNuts.y = mcTmp.y;
this._mcNuts.visible = true;
this._mcBolts.x = mcTmp.x;
this._mcBolts.y = mcTmp.y;
this._mcBolts.visible = true;
this._aPath = [{x:x, y:y, iPow:1, xp:mcTmp.x, yp:mcTmp.y, iDir:this._aMap[x][y].d, iType:0}];
this.moveRobot();
this._mcRobot.y = 415;
break;
case PLATFORM_STARTEND:
bVisible = true;
(mcTmp.getChildByName("mcPlatform") as MovieClip).gotoAndStop((7 + this._aMap[x][y].d));
this.spinBody(this._mcNuts, this._aMap[x][y].d);
this._mcNuts.x = mcTmp.x;
this._mcNuts.y = mcTmp.y;
this._mcNuts.visible = true;
break;
case PLATFORM_STARTBOLTS:
bVisible = true;
(mcTmp.getChildByName("mcPlatform") as MovieClip).gotoAndStop(2);
this._mcBolts.x = mcTmp.x;
this._mcBolts.y = mcTmp.y;
this._mcBolts.visible = true;
this._mcRobot.y = 415;
break;
case PLATFORM_END:
bVisible = true;
(mcTmp.getChildByName("mcPlatform") as MovieClip).gotoAndStop((7 + this._aMap[x][y].d));
break;
};
if (bVisible){
this._rectMap.x = Math.min(xx, this._rectMap.x);
this._rectMap.y = Math.min(yy, this._rectMap.y);
this._rectMap.width = Math.max(xx, this._rectMap.width);
this._rectMap.height = Math.max(yy, this._rectMap.height);
};
this.displayBeams(x, y);
};
y = (y + 1);
};
x = (x + 1);
};
this.setDepth();
}
private function onEOFGame():void{
this.spinHead();
this.updateTime();
}
private function updateLevel(_arg1):void{
this._txtLevelBase.text = _arg1.toString();
VisualUtil.txtAlignRight(this._txtLevelBase, VisualUtil.txtGetRight(this._txtLevelLabel), this._txtLevelBase.y);
}
private function startLevel():void{
this.onEndConfirm(null);
this._iTimeMS = getTimer();
this._bMove = true;
this._bAllowDrag = true;
this._fnRun = this.onEOFGame;
this._mcHelp.visible = false;
this.showHelp();
SoundUtil.playSFX("sndStart");
}
private function nextLevel():void{
trace("nextLevel");
this.initValues(true);
this._refPlayer.data.iCurrentLevel = Math.min((this._refPlayer.data.iCurrentLevel + 1), 29);
}
private function initLevel(_arg1:Boolean=true):void{
this.initValues(_arg1);
this._bMove = false;
this._bAllowDrag = false;
this._pCurrent = new Point(-1, -1);
this._pBolts = new Point(-1, -1);
this._pNuts = new Point(-1, -1);
this._mcPointer.visible = false;
this._iHelp = -1;
this._refPlayer.data.aLevelScore[this._refPlayer.data.iCurrentLevel] = 0;
SubMain.getInstance().getScoreTotal();
this.readMapMC(this.getLevelMC(this._refPlayer.data.iCurrentLevel));
this.paintMap();
this._mcSound.visible = true;
this._txtQuit.visible = true;
this._txtRestart.visible = true;
this.updateLevel((this._refPlayer.data.iCurrentLevel + 1));
this.updateTime();
this.updateStep(0);
this.updateScore(0);
this._mcMap.y = (this._rectMap.height + 600);
this.centerView(this._mcNuts.x, this._mcNuts.y, true);
this.startLevel();
}
private function getBeamMC(_arg1:int, _arg2:int, _arg3:int):MovieClip{
return (((this._mcMap.getChildByName(((("mcBeam_" + _arg2) + "_") + _arg1)) as MovieClip).getChildByName(("mcBeam_" + _arg3)) as MovieClip));
}
private function centerView(_arg1:int=0, _arg2:int=0, _arg3:Boolean=false, _arg4:Number=0.3){
var _local5:int;
var _local6:int;
_local5 = (MAPCENTER_X + -(_arg1));
_local6 = (MAPCENTER_Y + -(_arg2));
this._bUseDrag = true;
if (this._refPlayer.data.iCurrentLevel == 0){
_local5 = (MAPCENTER_X - ((this._rectMap.x + this._rectMap.width) * 0.5));
_local6 = (((MAPCENTER_Y - ((this._rectMap.y + this._rectMap.height) * 0.5)) - _arg2) + 50);
};
if (_arg3){
this._bAllowDrag = false;
TweenUtil.to(this._mcMap, _arg4, {x:_local5, y:_local6, alpha:1, deleay:0.3, onComplete:this.updateMarker});
} else {
if (this._bAllowDrag){
this._mcMap.x = _local5;
this._mcMap.y = _local6;
};
};
}
private function onEndConfirm(_arg1:Function):void{
this._mcConfirm.x = 700;
this._mcConfirm.visible = true;
this._mcConfirm.alpha = 1;
this._bMove = true;
this._bAllowDrag = true;
this._bMouseDown = false;
this._fnRun = _arg1;
}
private function stopLevel():void{
this._bMove = false;
this._bAllowDrag = false;
this._fnRun = null;
}
private function onEnterFrame(_arg1:Event):void{
this.moveClouds();
if (this._fnRun != null){
this._fnRun();
};
}
private function handleMouseMap(_arg1:MouseEvent):void{
var _local2:int;
var _local3:int;
if (this._bAllowDrag){
switch (_arg1.type){
case MouseEvent.MOUSE_MOVE:
if (this._bMouseDown){
_local2 = (this._mcMap.x - (this._pClick.x - this.mouseX));
_local3 = (this._mcMap.y - (this._pClick.y - this.mouseY));
if (_local2 < 110){
_local2 = 110;
};
if (_local2 > 520){
_local2 = 520;
};
if (_local3 < 140){
_local3 = 140;
};
if (_local3 > 390){
_local3 = 390;
};
this._mcMap.x = _local2;
this._mcMap.y = _local3;
this.updateMarker();
this._pClick = new Point(this.mouseX, this.mouseY);
};
break;
case MouseEvent.MOUSE_DOWN:
this._pClick = new Point(this.mouseX, this.mouseY);
this._bMouseDown = true;
break;
case MouseEvent.MOUSE_OUT:
case MouseEvent.MOUSE_UP:
this._bMouseDown = false;
break;
};
};
}
private function spinBody(_arg1:MovieClip, _arg2:int):void{
var _local3:int;
_local3 = 1;
switch (_arg2){
case 0:
_local3 = 19;
break;
case 1:
_local3 = 28;
break;
case 2:
_local3 = 1;
break;
case 3:
_local3 = 10;
break;
};
if (_arg1.currentFrame > 36){
_arg1.gotoAndStop((_arg1.currentFrame - 36));
} else {
if ((_local3 - _arg1.currentFrame) > 17){
_arg1.gotoAndStop((_arg1.currentFrame + 36));
};
};
TweenUtil.to(_arg1, 0.5, {frame:_local3});
}
public function init():void{
var mcTmp:MovieClip;
var mcBeam:MovieClip;
var btnTmp:SimpleButton;
var i:int;
var j:int;
var x:int;
var y:int;
var xd:int;
var yd:int;
this._mcMap = (this.getChildByName("mcMap") as MovieClip);
this._mcNuts = (this._mcMap.getChildByName("mcNuts") as MovieClip);
this._mcBolts = (this._mcMap.getChildByName("mcBolts") as MovieClip);
this._mcBattery = (this.getChildByName("mcBattery") as MovieClip);
this._mcArrow = (this.getChildByName("mcArrow") as MovieClip);
this._mcRobot = (this.getChildByName("mcRobot") as MovieClip);
this._mcCloud_00 = (this.getChildByName("mcCloud_00") as MovieClip);
this._mcCloud_01 = (this.getChildByName("mcCloud_01") as MovieClip);
this._mcCloud_02 = (this.getChildByName("mcCloud_02") as MovieClip);
this._mcCloud_03 = (this.getChildByName("mcCloud_03") as MovieClip);
this._mcZeppelin = (this.getChildByName("mcZeppelin") as MovieClip);
this._mcPointExit = (this.getChildByName("mcPointExit") as MovieClip);
this._mcPointExit.gotoAndStop("Exit_0");
this._mcPointNuts = (this.getChildByName("mcPointNuts") as MovieClip);
this._mcPointNuts.gotoAndStop("Robot_0");
this._mcPointBolts = (this.getChildByName("mcPointBolts") as MovieClip);
this._mcPointBolts.gotoAndStop("Robot_0");
this._mcPointBonus = (this.getChildByName("mcPointBonus") as MovieClip);
this._mcPointBonus.gotoAndStop("Bonus_0");
this._mcPointer = (this._mcMap.getChildByName("mcPointer") as MovieClip);
this._mcPointer.mouseEnabled = false;
this._mcPointer.mouseChildren = false;
this._mcPointer.visible = false;
this._mcHelp = (this.getChildByName("mcHelp") as MovieClip);
this._txtTimeMin_0 = (this.getChildByName("txtTimeMin_0") as TextField);
this._txtTimeMin_1 = (this.getChildByName("txtTimeMin_1") as TextField);
this._txtTimeSec_0 = (this.getChildByName("txtTimeSec_0") as TextField);
this._txtTimeSec_1 = (this.getChildByName("txtTimeSec_1") as TextField);
this._txtTimeMS_0 = (this.getChildByName("txtTimeMS_0") as TextField);
this._txtTimeMS_1 = (this.getChildByName("txtTimeMS_1") as TextField);
this._txtTimeMS_2 = (this.getChildByName("txtTimeMS_2") as TextField);
this._txtTimeLabel = (this.getChildByName("txtTimeLabel") as TextField);
this._txtStepsBase = (this.getChildByName("txtStepsBase") as TextField);
this._txtStepsExt = (this.getChildByName("txtStepsExt") as TextField);
this._txtStepsLabel = (this.getChildByName("txtStepsLabel") as TextField);
this._txtScoreBase = (this.getChildByName("txtScoreBase") as TextField);
this._txtScoreLabel = (this.getChildByName("txtScoreLabel") as TextField);
this._txtLevelBase = (this.getChildByName("txtLevelBase") as TextField);
this._txtLevelLabel = (this.getChildByName("txtLevelLabel") as TextField);
this._txtTimeMin_0.mouseEnabled = false;
this._txtTimeMin_1.mouseEnabled = false;
this._txtTimeSec_0.mouseEnabled = false;
this._txtTimeSec_1.mouseEnabled = false;
this._txtTimeMS_0.mouseEnabled = false;
this._txtTimeMS_1.mouseEnabled = false;
this._txtTimeMS_2.mouseEnabled = false;
this._txtTimeLabel.mouseEnabled = false;
this._txtStepsBase.mouseEnabled = false;
this._txtStepsExt.mouseEnabled = false;
this._txtStepsLabel.mouseEnabled = false;
this._txtScoreBase.mouseEnabled = false;
this._txtScoreLabel.mouseEnabled = false;
this._txtLevelBase.mouseEnabled = false;
this._txtLevelLabel.mouseEnabled = false;
this._btnSound = (this.getChildByName("btnSound") as SimpleButton);
this._btnQuit = (this.getChildByName("btnQuit") as SimpleButton);
this._btnRestart = (this.getChildByName("btnRestart") as SimpleButton);
this._mcSound = (this.getChildByName("mcSound") as MovieClip);
this._txtQuit = (this.getChildByName("txtQuit") as TextField);
this._txtRestart = (this.getChildByName("txtRestart") as TextField);
this._mcConfirm = (this.getChildByName("mcConfirm") as MovieClip);
this._refPlayer = SubMain.getInstance().mywPlayer;
var _local2 = this._mcConfirm;
with (_local2) {
visible = false;
x = 700;
};
this._mcSound.mouseEnabled = false;
this._mcSound.gotoAndStop((SoundUtil.getInstance().bEnabled) ? 1 : 2);
this._txtQuit.mouseEnabled = false;
this._txtRestart.mouseEnabled = false;
this._mcHelp.mouseEnabled = false;
this._mcHelp.visible = false;
this._mcNuts.mouseEnabled = false;
this._mcNuts.visible = false;
(this._mcNuts.getChildByName("mcHead") as MovieClip).mouseEnabled = false;
(this._mcNuts.getChildByName("mcHead") as MovieClip).mouseChildren = false;
(this._mcNuts.getChildByName("mcBody") as MovieClip).mouseEnabled = false;
(this._mcNuts.getChildByName("mcBody") as MovieClip).mouseChildren = false;
(this._mcNuts.getChildByName("mcSleep") as MovieClip).mouseEnabled = false;
(this._mcNuts.getChildByName("mcSleep") as MovieClip).mouseChildren = false;
(this._mcNuts.getChildByName("mcSleep") as MovieClip).visible = false;
this._mcBolts.mouseEnabled = false;
this._mcBolts.visible = false;
(this._mcBolts.getChildByName("mcBody") as MovieClip).mouseEnabled = false;
(this._mcBolts.getChildByName("mcBody") as MovieClip).mouseChildren = false;
(this._mcBolts.getChildByName("mcSleep") as MovieClip).mouseEnabled = false;
(this._mcBolts.getChildByName("mcSleep") as MovieClip).mouseChildren = false;
(this._mcBolts.getChildByName("mcSleep") as MovieClip).visible = false;
this._bWait = false;
this._aHelp = new Array();
this.initValues();
this.updateTime();
this.updateStep(0);
this.updateScore(0);
x = 0;
while (x < 7) {
y = 0;
while (y < 7) {
xd = y;
yd = x;
mcTmp = (this.mcMap[((("mcPlatform_" + xd) + "_") + yd)] as MovieClip);
mcTmp.visible = false;
mcBeam = (this.mcMap[((("mcBeam_" + xd) + "_") + yd)] as MovieClip);
mcBeam.visible = false;
_local2 = (mcTmp.getChildByName("mcPlatform") as MovieClip);
with (_local2) {
mouseEnabled = false;
mouseChildren = false;
};
i = 0;
while (i < Dir.NUM_BASEDIR) {
_local2 = (mcBeam[("mcBeam_" + i)] as MovieClip);
with (_local2) {
visible = false;
mouseEnabled = false;
mouseChildren = false;
};
btnTmp = (mcTmp.getChildByName("btnPlatform") as SimpleButton);
EventUtil.setButtonEvents(btnTmp, this.handleButtonPlatform);
j = 1;
while (j < 4) {
btnTmp = (mcBeam.getChildByName(((("btnBeam_" + j) + "_") + i)) as SimpleButton);
_local2 = btnTmp;
with (_local2) {
enabled = false;
mouseEnabled = false;
};
EventUtil.setButtonEvents(btnTmp, this.handleButtonBeam);
j = (j + 1);
};
i = (i + 1);
};
y = (y + 1);
};
x = (x + 1);
};
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
this.addEventListener(MouseEvent.MOUSE_MOVE, this.handleMouseMap);
this.addEventListener(MouseEvent.MOUSE_UP, this.handleMouseMap);
this.addEventListener(MouseEvent.MOUSE_DOWN, this.handleMouseMap);
EventUtil.setButtonEvents(this._btnSound, this.handleButtonMenu);
EventUtil.setButtonEvents(this._btnQuit, this.handleButtonMenu);
EventUtil.setButtonEvents(this._btnRestart, this.handleButtonMenu);
EventUtil.setButtonEvents((this._mcNuts.getChildByName("btnNuts") as SimpleButton), this.handleButtonRobot);
EventUtil.setButtonEvents((this._mcBolts.getChildByName("btnBolts") as SimpleButton), this.handleButtonRobot);
EventUtil.setButtonEvents((this._mcZeppelin.getChildByName("btnZeppelin") as SimpleButton), this.handleButtonMenu);
SoundUtil.playMusic("musicWind");
this.initGame();
}
private function showConfirm(_arg1:String, _arg2:Array){
this._mcConfirm.gotoAndStop(("en_" + _arg1));
this._mcConfirm.x = Math.round(((640 - this._mcConfirm.getBounds(this).width) * 0.5));
this._mcConfirm.y = Math.round(((480 - this._mcConfirm.getBounds(this).height) * 0.5));
this._mcConfirm.visible = true;
this._mcConfirm.alpha = 0;
this._bMove = false;
this._bAllowDrag = false;
this._bMouseDown = false;
this._fnRun = null;
TweenUtil.to(this._mcConfirm, 0.5, {alpha:1, onComplete:this.setConfirmEvents, onCompleteParams:[_arg2]});
}
public function exit():void{
var _local1:MovieClip;
var _local2:MovieClip;
var _local3:SimpleButton;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
_local6 = 0;
while (_local6 < 7) {
_local7 = 0;
while (_local7 < 7) {
_local8 = _local7;
_local9 = _local6;
_local1 = (this.mcMap[((("mcPlatform_" + _local8) + "_") + _local9)] as MovieClip);
_local2 = (this.mcMap[((("mcBeam_" + _local8) + "_") + _local9)] as MovieClip);
_local4 = 0;
while (_local4 < Dir.NUM_BASEDIR) {
EventUtil.setButtonEvents((_local1.getChildByName("btnPlatform") as SimpleButton), this.handleButtonPlatform);
_local5 = 1;
while (_local5 < 4) {
EventUtil.setButtonEvents((_local2.getChildByName(((("btnBeam_" + _local5) + "_") + _local4)) as SimpleButton), this.handleButtonBeam);
_local5++;
};
_local4++;
};
_local7++;
};
_local6++;
};
this.removeEventListener(MouseEvent.MOUSE_MOVE, this.handleMouseMap);
this.removeEventListener(MouseEvent.MOUSE_UP, this.handleMouseMap);
this.removeEventListener(MouseEvent.MOUSE_DOWN, this.handleMouseMap);
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
EventUtil.setButtonEvents((this._mcNuts.getChildByName("btnNuts") as SimpleButton), this.handleButtonRobot, false);
EventUtil.setButtonEvents((this._mcBolts.getChildByName("btnBolts") as SimpleButton), this.handleButtonRobot, false);
EventUtil.setButtonEvents(this._btnSound, this.handleButtonMenu, false);
EventUtil.setButtonEvents(this._btnQuit, this.handleButtonMenu, false);
EventUtil.setButtonEvents(this._btnRestart, this.handleButtonMenu, false);
EventUtil.setButtonEvents((this._mcZeppelin.getChildByName("btnZeppelin") as SimpleButton), this.handleButtonMenu, false);
SoundUtil.stopMusic("musicWind", 2);
}
private function moveRobot():void{
var _local1:Object;
var _local2:Boolean;
var _local3:Point;
var _local4:Function;
var _local5:Number;
_local1 = this._aPath.shift();
_local2 = false;
_local3 = new Point(_local1.x, _local1.y);
_local4 = Sine.easeInOut;
_local5 = (_local1.iPow * 0.3);
this.setDepth();
SoundUtil.playSFX(("sndMove_" + _local1.iPow.toString()));
if (_local1.iType != 0){
_local5 = (_local1.iPow * 0.3);
switch (_local1.iType){
case 1:
_local4 = Sine.easeIn;
break;
case 2:
_local4 = Linear.easeNone;
break;
case 3:
_local4 = Sine.easeOut;
break;
};
};
this.centerView(_local1.xp, _local1.yp, true, _local5);
if (this._bUsingNuts){
if (!this._refPlayer.getMedal("m1").bAchieved){
this._refPlayer.getMedal("m1").setAchieved(StrUtil.isoDateTime());
SubMain.getInstance().showMedal("m1");
};
if (_local3.equals(this._pBolts)){
TweenUtil.to(this._mcBolts, 0.1, {x:(_local1.xp - 12), y:(_local1.yp + 7), delay:(_local5 - 0.1)});
_local1.xp = (_local1.xp + 12);
_local1.yp = (_local1.yp - 7);
} else {
if (this._pNuts.equals(this._pBolts)){
TweenUtil.to(this._mcBolts, 0.1, {x:(this._mcNuts.x - 12), y:(this._mcNuts.y + 7)});
};
};
TweenUtil.to(this._mcNuts, _local5, {x:_local1.xp, y:_local1.yp, onComplete:this.onEndMoveRobot, ease:_local4});
if (_local1.iDir != -1){
this.spinBody((this._mcNuts.getChildByName("mcBody") as MovieClip), _local1.iDir);
};
} else {
if (!this._refPlayer.getMedal("m2").bAchieved){
this._refPlayer.getMedal("m2").setAchieved(StrUtil.isoDateTime());
SubMain.getInstance().showMedal("m2");
};
if (_local3.equals(this._pNuts)){
TweenUtil.to(this._mcNuts, 0.1, {x:(_local1.xp + 12), y:(_local1.yp - 7), delay:(_local5 - 0.1)});
_local1.xp = (_local1.xp - 12);
_local1.yp = (_local1.yp + 7);
} else {
if (this._pNuts.equals(this._pBolts)){
TweenUtil.to(this._mcNuts, 0.1, {x:(this._mcBolts.x + 12), y:(this._mcBolts.y - 7)});
};
};
TweenUtil.to(this._mcBolts, _local5, {x:_local1.xp, y:_local1.yp, onComplete:this.onEndMoveRobot, ease:_local4});
if (_local1.iDir != -1){
this.spinBody((this._mcBolts.getChildByName("mcBody") as MovieClip), _local1.iDir);
};
};
this._mcArrow.gotoAndStop(1);
this._pCurrent = new Point(_local1.x, _local1.y);
if (this._bUsingNuts){
this._pNuts = new Point(_local1.x, _local1.y);
} else {
this._pBolts = new Point(_local1.x, _local1.y);
};
this._bMove = false;
this._bAllowDrag = false;
this.updateStep();
}
private function initGame():void{
if ((((++this._refPlayer.data.iPlays >= 2)) && (!(this._refPlayer.getMedal("m7").bAchieved)))){
this._refPlayer.getMedal("m7").setAchieved(StrUtil.isoDateTime());
SubMain.getInstance().showMedal("m7");
};
this.initLevel();
}
private function getPlatformMC(_arg1:int, _arg2:int):MovieClip{
return ((this._mcMap.getChildByName(((("mcPlatform_" + _arg2) + "_") + _arg1)) as MovieClip));
}
private function spinHead():void{
var _local1:int;
_local1 = (37 - Math.round(((180 + Math.round(((Math.atan2((this._mcNuts.mouseY + 0), this._mcNuts.mouseX) * 180) / Math.PI))) * 0.1)));
_local1 = (_local1 + 22);
if (_local1 > 37){
_local1 = (_local1 - 37);
};
if (this._bUsingNuts){
this._mcNuts["mcHead"].gotoAndStop(_local1);
};
}
private function checkBeamCrossing(_arg1:Point, _arg2:int, _arg3:int):Boolean{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Array;
var _local10:Boolean;
_local4 = (_arg1.x * 2);
_local5 = (_arg1.y * 2);
_local9 = this.initBoolMap(false);
_local10 = true;
_local6 = 1;
while (_local6 < (_arg3 * 2)) {
if ((_local6 % 2) == 0){
_local7 = (_local4 + (Dir.getDirOffset(_arg2).x * _local6));
_local8 = (_local5 + (Dir.getDirOffset(_arg2).y * _local6));
if (_local9[_local7][_local8]){
_local10 = false;
break;
};
};
_local6++;
};
return (_local10);
}
private function initPathfinder(_arg1:Point, _arg2:Point):void{
this._Pathfinder = new Pathfinder2D(this.initBoolMap(), _arg1, _arg2, 100, Pathfinder2D.LEVEL_HIGH);
this._Pathfinder.findPath();
}
private function onEndMoveBeam():void{
this._bMove = true;
this._bAllowDrag = true;
this._bMouseDown = false;
this.displayBeams(this._pCurrent.x, this._pCurrent.y);
}
private function onEndMoveRobot():void{
this._bMove = true;
this._bAllowDrag = true;
this._bMouseDown = false;
if (this._aMap[this._pNuts.x][this._pNuts.y].h == 1){
this._aMap[this._pNuts.x][this._pNuts.y].h = 0;
if (this._mcNut != null){
this._mcNut.gotoAndPlay("Collect");
SoundUtil.playSFX("sndCollect");
};
this._refPlayer.data.aNut[this._refPlayer.data.iCurrentLevel] = 1;
this.updateScore(0);
SubMain.getInstance().saveData();
};
if ((((SubMain.getInstance().getNutTotal() >= 25)) && (!(this._refPlayer.getMedal("m4").bAchieved)))){
this._refPlayer.getMedal("m4").setAchieved(StrUtil.isoDateTime());
SubMain.getInstance().showMedal("m4");
};
this.checkLevelEnd();
this.setDepth();
if (this._aPath.length > 0){
this.moveRobot();
} else {
if (!this._bUsingNuts){
this.setRobot("btnNuts");
};
};
}
private function handleButtonPlatform(_arg1:MouseEvent):void{
var _local2:SimpleButton;
var _local3:SimpleButton;
var _local4:MovieClip;
var _local5:MovieClip;
var _local6:MovieClip;
var _local7:MovieClip;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:Boolean;
var _local18:Boolean;
var _local19:Boolean;
var _local20:Boolean;
var _local21:Boolean;
_local2 = (_arg1.target as SimpleButton);
_local4 = (_local2.parent as MovieClip);
_local5 = (_local4.getChildByName("mcPlatform") as MovieClip);
_local7 = (_local4.parent.getChildByName(_local4.name.replace("mcPlatform", "mcBeam")) as MovieClip);
_local8 = parseInt(_local4.name.split("_")[2]);
_local9 = parseInt(_local4.name.split("_")[1]);
_local12 = 0;
_local14 = 0;
_local15 = 1;
_local16 = Dir.getDirFromPoint(this._pCurrent, new Point(_local8, _local9));
_local17 = false;
_local18 = false;
_local19 = false;
_local20 = false;
_local21 = false;
if (_local8 == this._pCurrent.x){
_local14 = Math.abs((_local9 - this._pCurrent.y));
_local18 = true;
} else {
if (_local9 == this._pCurrent.y){
_local14 = Math.abs((_local8 - this._pCurrent.x));
_local18 = true;
};
};
if (this._iHelp != -1){
switch (this._iHelp){
case 0:
if (!(((_local8 == 2)) && ((_local9 == 2)))){
return;
};
if (_arg1.type == MouseEvent.MOUSE_UP){
this._mcPointer.visible = false;
};
break;
case 2:
if (!(((_local8 == 3)) && ((_local9 == 2)))){
return;
};
if (_arg1.type == MouseEvent.MOUSE_UP){
this._mcPointer.visible = false;
};
break;
default:
if (_arg1.type == MouseEvent.MOUSE_UP){
return;
};
break;
};
};
if (((this._bMove) && (!((((_local8 == this._pCurrent.x)) && ((_local9 == this._pCurrent.y))))))){
_local17 = (((this._aMap[this._pCurrent.x][this._pCurrent.y].c[_local16].x == _local8)) && ((this._aMap[this._pCurrent.x][this._pCurrent.y].c[_local16].y == _local9)));
switch (_arg1.type){
case MouseEvent.MOUSE_OVER:
ColorUtil.setBrightness2(_local5, 1.2, 1.2, 1.2);
ColorUtil.setBrightness2(this._mcArrow);
ColorUtil.setBrightness2(this._mcBattery);
this._bAllowDrag = false;
this._bMouseDown = false;
if ((((_local14 < 4)) && (_local18))){
this._mcArrow.gotoAndStop((_local14 + 1));
if ((((this._aMap[this._pCurrent.x][this._pCurrent.y].b[_local16] == 0)) && ((_local14 == this._iPower)))){
if (_local14 == 1){
_local19 = true;
} else {
_local19 = checkBeamCrossing(this._pCurrent, _local16, _local14);
};
if (_local19){
_local6 = (_local7.getChildByName(("mcBeam_" + Dir.getOppositeDir(_local16))) as MovieClip);
_local6.visible = true;
_local6.gotoAndStop(("beam_" + _local14));
ColorUtil.setBrightness2(this._mcArrow, 0, 1, 0);
ColorUtil.setBrightness2(this._mcBattery, 0, 1, 0);
};
} else {
ColorUtil.setBrightness2(this._mcArrow, 1, 0, 0);
ColorUtil.setBrightness2(this._mcBattery, 1, 0, 0);
};
} else {
this._mcArrow.gotoAndStop(1);
};
break;
case MouseEvent.MOUSE_DOWN:
ColorUtil.setBrightness2(_local5, 1.1, 1.1, 1.1);
break;
case MouseEvent.MOUSE_OUT:
ColorUtil.setBrightness2(_local5, 1, 1, 1);
ColorUtil.setBrightness2(this._mcArrow);
ColorUtil.setBrightness2(this._mcBattery);
this._bAllowDrag = true;
this._mcArrow.gotoAndStop(1);
_local10 = this._aMap[this._pCurrent.x][this._pCurrent.y].c[_local16].x;
_local11 = this._aMap[this._pCurrent.x][this._pCurrent.y].c[_local16].y;
if (((!((_local10 == -1))) && (!((_local11 == -1))))){
if ((((((this._aMap[this._pCurrent.x][this._pCurrent.y].b[_local16] == 0)) && ((this._aMap[_local10][_local11].b[Dir.getOppositeDir(_local16)] == 0)))) && ((_local14 == this._iPower)))){
(_local7.getChildByName(("mcBeam_" + Dir.getOppositeDir(_local16))) as MovieClip).visible = false;
};
};
this.updateBeams();
break;
case MouseEvent.MOUSE_UP:
ColorUtil.setBrightness2(_local5, 1, 1, 1);
ColorUtil.setBrightness2(this._mcArrow);
ColorUtil.setBrightness2(this._mcBattery);
_local21 = false;
_local20 = false;
if (this._bUsingNuts){
_local20 = true;
} else {
if ((((((this._aMap[_local8][_local9].p == PLATFORM_BOLTS)) || ((this._aMap[_local8][_local9].p == PLATFORM_END)))) || ((this._aMap[_local8][_local9].p == PLATFORM_STARTEND)))){
_local20 = true;
};
};
if (_local20){
if (((!((this._aMap[this._pCurrent.x][this._pCurrent.y].b[_local16] == 0))) && (_local17))){
_local21 = true;
this._aPath = [{x:_local8, y:_local9, iPow:_local14, xp:_local4.x, yp:_local4.y, iDir:_local16, iType:0}];
this.moveRobot();
} else {
this.initPathfinder(new Point((this._pCurrent.x * 2), (this._pCurrent.y * 2)), new Point((_local8 * 2), (_local9 * 2)));
if (((this._Pathfinder.bHasPath) && ((this._aHelp.length == 0)))){
this._aPath = this.createPath().slice();
_local21 = true;
this._aPath[0].iType = 1;
this._aPath[(this._aPath.length - 1)].iType = 3;
this.moveRobot();
};
};
};
if (((!(_local21)) && (this._bUsingNuts))){
if (this._iPower == 0){
if (this._iNoBeam == -1){
this.showHelp("NoBeam");
this._iNoBeam = 0;
};
SoundUtil.playSFX("sndErrorA");
} else {
if (_local14 == this._iPower){
if (_local14 == 1){
_local19 = true;
} else {
_local19 = checkBeamCrossing(this._pCurrent, _local16, _local14);
};
if (_local19){
this._aMap[this._pCurrent.x][this._pCurrent.y].b[_local16] = _local14;
this._aMap[this._pCurrent.x][this._pCurrent.y].a[_local16] = true;
this._aMap[this._pCurrent.x][this._pCurrent.y].c[_local16] = this._pCurrent.add(new Point((Dir.getDirOffset(_local16).x * _local14), (Dir.getDirOffset(_local16).y * _local14)));
_local10 = this._aMap[this._pCurrent.x][this._pCurrent.y].c[_local16].x;
_local11 = this._aMap[this._pCurrent.x][this._pCurrent.y].c[_local16].y;
this._aMap[_local10][_local11].b[Dir.getOppositeDir(_local16)] = _local14;
this._aMap[_local10][_local11].a[Dir.getOppositeDir(_local16)] = false;
this._aMap[_local10][_local11].c[Dir.getOppositeDir(_local16)] = new Point(this._pCurrent.x, this._pCurrent.y);
switch (_local14){
case 1:
_local15 = 10;
break;
case 2:
_local15 = 25;
break;
case 3:
_local15 = 40;
break;
};
(_local7.getChildByName(("mcBeam_" + Dir.getOppositeDir(_local16))) as MovieClip).visible = false;
_local6 = this.getBeamMC(this._pCurrent.x, this._pCurrent.y, _local16);
_local6.visible = true;
_local6.gotoAndStop((_local15 + 9));
SoundUtil.playSFX("sndBeamOut");
TweenUtil.to(_local6, 0.3, {frame:_local15, onComplete:this.onEndMoveBeam, ease:Linear});
TweenUtil.to(this._mcBattery, (0.5 * _local14), {frame:9});
this._iPower = 0;
this._bMove = false;
this._bAllowDrag = false;
this.updateStep();
};
} else {
this.showHelp("WrongBeam");
SoundUtil.playSFX("sndErrorB");
};
};
};
break;
};
};
}
private function handleButtonBeam(_arg1:MouseEvent):void{
var btnBase:SimpleButton;
var iDir:int;
var mcBase:MovieClip;
var mcBeam:MovieClip;
var x:int;
var y:int;
var xd:int;
var yd:int;
var iPow:int;
var iFrame:int;
var bCollect:Boolean;
var e = _arg1;
btnBase = (e.target as SimpleButton);
iDir = parseInt(btnBase.name.split("_")[2]);
mcBase = (btnBase.parent as MovieClip);
mcBeam = (mcBase.getChildByName(("mcBeam_" + iDir)) as MovieClip);
x = parseInt(mcBase.name.split("_")[2]);
y = parseInt(mcBase.name.split("_")[1]);
xd = 0;
yd = 0;
iPow = 0;
iFrame = 1;
bCollect = false;
if (this._iHelp != -1){
switch (this._iHelp){
case 1:
if (!(((x == 1)) && ((y == 2)))){
return;
};
if (e.type == MouseEvent.MOUSE_UP){
this._mcPointer.visible = false;
};
break;
default:
return;
};
};
if (((this._bMove) && (this._bUsingNuts))){
switch (e.type){
case MouseEvent.MOUSE_OVER:
this._bAllowDrag = false;
this._bMouseDown = false;
ColorUtil.setBrightness2(mcBeam, 1.2, 1.2, 1.2);
break;
case MouseEvent.MOUSE_DOWN:
ColorUtil.setBrightness2(mcBeam, 1.1, 1.1, 1.1);
break;
case MouseEvent.MOUSE_OUT:
this._bAllowDrag = true;
ColorUtil.setBrightness2(mcBeam, 1, 1, 1);
break;
case MouseEvent.MOUSE_UP:
ColorUtil.setBrightness2(mcBeam, 1, 1, 1);
bCollect = (((this._pCurrent.x == x)) && ((this._pCurrent.y == y)));
if (!bCollect){
bCollect = (((this._pCurrent.x == this._aMap[x][y].c[iDir].x)) && ((this._pCurrent.y == this._aMap[x][y].c[iDir].y)));
};
if ((((this._iPower == 0)) && (bCollect))){
var _local3 = btnBase;
with (_local3) {
enabled = false;
mouseEnabled = false;
};
iPow = this._aMap[x][y].b[iDir];
if ((((this._pCurrent.x == x)) && ((this._pCurrent.y == y)))){
} else {
mcBeam.visible = false;
mcBase = (this._mcMap.getChildByName(((("mcBeam_" + this._aMap[x][y].c[iDir].y) + "_") + this._aMap[x][y].c[iDir].x)) as MovieClip);
mcBeam = (mcBase.getChildByName(("mcBeam_" + Dir.getOppositeDir(iDir))) as MovieClip);
mcBeam.visible = true;
};
xd = this._aMap[x][y].c[iDir].x;
yd = this._aMap[x][y].c[iDir].y;
this._aMap[x][y].b[iDir] = 0;
this._aMap[x][y].a[iDir] = false;
this._aMap[x][y].c[iDir] = new Point(-1, -1);
this._aMap[xd][yd].b[Dir.getOppositeDir(iDir)] = 0;
this._aMap[xd][yd].a[Dir.getOppositeDir(iDir)] = false;
this._aMap[xd][yd].c[Dir.getOppositeDir(iDir)] = new Point(-1, -1);
switch (iPow){
case 1:
iFrame = 10;
break;
case 2:
iFrame = 25;
break;
case 3:
iFrame = 40;
break;
};
this.spinBody((this._mcNuts.getChildByName("mcBody") as MovieClip), Dir.getDirFromPoint(this._pCurrent, new Point(x, y)));
mcBeam.gotoAndStop(iFrame);
this._mcBattery.gotoAndStop(10);
SoundUtil.playSFX("sndBeamIn");
TweenUtil.to(mcBeam, 0.3, {frame:(iFrame + 9), onComplete:this.onEndMoveBeam, ease:Linear.easeNone});
TweenUtil.to(this._mcBattery, 0.3, {frame:(10 + (iPow * 5))});
this._iPower = iPow;
this._bMove = false;
this._bAllowDrag = false;
this.updateStep();
} else {
this.showHelp("HasBeam");
SoundUtil.playSFX("sndErrorA");
};
break;
};
};
}
private function initValues(_arg1:Boolean=true):void{
this._bMove = true;
this._bAllowDrag = true;
this._bUseDrag = true;
this._bMouseDown = false;
this._pClick = new Point();
this._iPower = 0;
this._iSteps = 0;
this._iStepsMax = 0;
this._iScore = 0;
this._bUsingNuts = true;
this._mcBattery.gotoAndStop(1);
this._mcArrow.gotoAndStop(1);
this._iNoBeam = -1;
(this._mcNuts.getChildByName("mcSleep") as MovieClip).visible = false;
ColorUtil.setBrightness2(this._mcNuts);
(this._mcBolts.getChildByName("mcSleep") as MovieClip).visible = true;
ColorUtil.setBrightness2(this._mcBolts, 0.8, 0.8, 0.8);
if (_arg1){
this._iTimeSec = 0;
this._iTimeMS = 0;
};
}
private function updateMarker():void{
var _local1:Rectangle;
var _local2:MovieClip;
var _local3:Point;
_local1 = new Rectangle(-10, -10, 660, 500);
_local2 = this.getPlatformMC(this._pExit.x, this._pExit.y);
_local3 = this._mcMap.localToGlobal(new Point(_local2.x, _local2.y));
if (!_local1.containsPoint(_local3)){
this._mcPointExit.visible = true;
this._mcPointExit.x = Math.min(Math.max(15, _local3.x), 625);
this._mcPointExit.y = Math.min(Math.max(15, _local3.y), 465);
if (_local3.x < 0){
this._mcPointExit.gotoAndStop("Exit_3");
} else {
if (_local3.x > 640){
this._mcPointExit.gotoAndStop("Exit_1");
} else {
if (_local3.y < 0){
this._mcPointExit.gotoAndStop("Exit_0");
} else {
if (_local3.y > 480){
this._mcPointExit.gotoAndStop("Exit_2");
};
};
};
};
} else {
this._mcPointExit.visible = false;
};
_local3 = this._mcMap.localToGlobal(new Point(this._mcNuts.x, this._mcNuts.y));
if (!_local1.containsPoint(_local3)){
this._mcPointNuts.visible = true;
this._mcPointNuts.x = Math.min(Math.max(15, _local3.x), 625);
this._mcPointNuts.y = Math.min(Math.max(15, _local3.y), 465);
if (_local3.x < 0){
this._mcPointNuts.gotoAndStop("Robot_3");
} else {
if (_local3.x > 640){
this._mcPointNuts.gotoAndStop("Robot_1");
} else {
if (_local3.y < 0){
this._mcPointNuts.gotoAndStop("Robot_0");
} else {
if (_local3.y > 480){
this._mcPointNuts.gotoAndStop("Robot_2");
};
};
};
};
} else {
this._mcPointNuts.visible = false;
};
if (this._bHasBolts){
_local3 = this._mcMap.localToGlobal(new Point(this._mcBolts.x, this._mcBolts.y));
if (!_local1.containsPoint(_local3)){
this._mcPointBolts.visible = true;
this._mcPointBolts.x = Math.min(Math.max(15, _local3.x), 625);
this._mcPointBolts.y = Math.min(Math.max(15, _local3.y), 465);
if (_local3.x < 0){
this._mcPointBolts.gotoAndStop("Robot_3");
} else {
if (_local3.x > 640){
this._mcPointBolts.gotoAndStop("Robot_1");
} else {
if (_local3.y < 0){
this._mcPointBolts.gotoAndStop("Robot_0");
} else {
if (_local3.y > 480){
this._mcPointBolts.gotoAndStop("Robot_2");
};
};
};
};
} else {
this._mcPointBolts.visible = false;
};
} else {
this._mcPointBolts.visible = false;
};
if (this._mcNut != null){
_local3 = this._mcNut.parent.localToGlobal(new Point(this._mcNut.x, _mcNut.y));
if (!_local1.containsPoint(_local3)){
this._mcPointBonus.visible = true;
this._mcPointBonus.x = Math.min(Math.max(15, _local3.x), 625);
this._mcPointBonus.y = Math.min(Math.max(15, _local3.y), 465);
if (_local3.x < 0){
this._mcPointBonus.gotoAndStop("Bonus_3");
} else {
if (_local3.x > 640){
this._mcPointBonus.gotoAndStop("Bonus_1");
} else {
if (_local3.y < 0){
this._mcPointBonus.gotoAndStop("Bonus_0");
} else {
if (_local3.y > 480){
this._mcPointBonus.gotoAndStop("Bonus_2");
};
};
};
};
} else {
this._mcPointBonus.visible = false;
};
} else {
this._mcPointBonus.visible = false;
};
this._bAllowDrag = true;
}
private function showLevelDone(_arg1:int):void{
var _local2:TextField;
var _local3:int;
_local2 = (this._mcConfirm.getChildByName("txtScore") as TextField);
if (this._refPlayer.data.iCurrentLevel == 29){
trace("NO NEXT LEVEL!");
};
switch (_arg1){
case 0:
_local3 = this._iScore;
_local3 = (_local3 + Math.max((((this._iStepsMax * 10) - this._iTimeSec) * 5), 0));
_local3 = (_local3 + (1500 * StrUtil.cInt(this._refPlayer.data.aNut[this._refPlayer.data.iCurrentLevel])));
this._refPlayer.data.aLevelScore[this._refPlayer.data.iCurrentLevel] = _local3;
SubMain.getInstance().getScoreTotal();
this._fnRun = this.onEOFDone;
this._txtQuit.visible = false;
this._txtRestart.visible = false;
this._mcSound.visible = false;
_local2.text = (((("0\n" + "0\n") + "0\n\n") + "0\n\n") + "0");
TweenUtil.to(this, 0.5, {onComplete:this.showLevelDone, onCompleteParams:[1]});
break;
case 1:
SoundUtil.playSFX("sndDing");
_local2.text = (((((StrUtil.seperate(this._iScore.toString(), this._strSeperator) + "\n") + "0\n") + "0\n\n") + "0\n\n") + "0");
TweenUtil.to(this, 0.5, {onComplete:this.showLevelDone, onCompleteParams:[2]});
break;
case 2:
SoundUtil.playSFX("sndDing");
_local2.text = ((((((StrUtil.seperate(this._iScore.toString(), this._strSeperator) + "\n") + StrUtil.seperate(Math.max((((this._iStepsMax * 10) - this._iTimeSec) * 5), 0).toString(), this._strSeperator)) + "\n") + "0\n\n") + "0\n\n") + "0");
TweenUtil.to(this, 0.5, {onComplete:this.showLevelDone, onCompleteParams:[10]});
break;
case 10:
SoundUtil.playSFX("sndDing");
_local2.text = (((((((StrUtil.seperate(this._iScore.toString(), this._strSeperator) + "\n") + StrUtil.seperate(Math.max((((this._iStepsMax * 10) - this._iTimeSec) * 5), 0).toString(), this._strSeperator)) + "\n") + StrUtil.seperate((1500 * StrUtil.cInt(this._refPlayer.data.aNut[this._refPlayer.data.iCurrentLevel])).toString(), this._strSeperator)) + "\n\n") + "0\n\n") + "0");
TweenUtil.to(this, 0.5, {onComplete:this.showLevelDone, onCompleteParams:[3]});
break;
case 3:
SoundUtil.playSFX("sndDing");
_local2.text = ((((((((StrUtil.seperate(this._iScore.toString(), this._strSeperator) + "\n") + StrUtil.seperate(Math.max((((this._iStepsMax * 10) - this._iTimeSec) * 5), 0).toString(), this._strSeperator)) + "\n") + StrUtil.seperate((1500 * StrUtil.cInt(this._refPlayer.data.aNut[this._refPlayer.data.iCurrentLevel])).toString(), this._strSeperator)) + "\n\n") + StrUtil.seperate(this._refPlayer.data.aLevelScore[this._refPlayer.data.iCurrentLevel].toString(), this._strSeperator)) + "\n\n") + "0");
TweenUtil.to(this, 0.5, {onComplete:this.showLevelDone, onCompleteParams:[4]});
break;
case 4:
SoundUtil.playSFX("sndDing");
_local2.text = ((((((((StrUtil.seperate(this._iScore.toString(), this._strSeperator) + "\n") + StrUtil.seperate(Math.max((((this._iStepsMax * 10) - this._iTimeSec) * 5), 0).toString(), this._strSeperator)) + "\n") + StrUtil.seperate((1500 * StrUtil.cInt(this._refPlayer.data.aNut[this._refPlayer.data.iCurrentLevel])).toString(), this._strSeperator)) + "\n\n") + StrUtil.seperate(this._refPlayer.data.aLevelScore[this._refPlayer.data.iCurrentLevel].toString(), this._strSeperator)) + "\n\n") + StrUtil.seperate(this._refPlayer.data.iScore.toString(), this._strSeperator));
break;
case 999:
if (this._iStepsMax == this._iSteps){
if ((((++this._refPlayer.data.onpar >= 10)) && (!(this._refPlayer.getMedal("m12").bAchieved)))){
this._refPlayer.getMedal("m12").setAchieved(StrUtil.isoDateTime());
SubMain.getInstance().showMedal("m12");
};
};
if ((((this._refPlayer.data.iScore >= 25000)) && (!(this._refPlayer.getMedal("m9").bAchieved)))){
this._refPlayer.getMedal("m9").setAchieved(StrUtil.isoDateTime());
SubMain.getInstance().showMedal("m9");
};
_local3 = this._refPlayer.data.iCurrentLevel;
while (_local3 < Math.min(30, (this._refPlayer.data.iCurrentLevel + 3))) {
if (!StrUtil.contains(this._refPlayer.data.strLevel, (("(" + _local3.toString()) + ")"))){
this._refPlayer.data.strLevel = (this._refPlayer.data.strLevel + (("(" + _local3.toString()) + ")"));
};
_local3++;
};
SubMain.getInstance().saveData();
break;
};
}
private function setConfirmEvents(_arg1:Array, _arg2:Boolean=true):void{
var _local3:int;
_local3 = 0;
while (_local3 < _arg1.length) {
EventUtil.setButtonEvents((this._mcConfirm.getChildByName(_arg1[_local3]) as SimpleButton), this.handleButtonMenu, _arg2);
_local3++;
};
}
private function initBoolMap(_arg1:Boolean=false):Array{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Array;
var _local9:String;
_local8 = new Array();
_local4 = 0;
while (_local4 < 14) {
_local8[_local4] = new Array();
_local5 = 0;
while (_local5 < 14) {
_local8[_local4][_local5] = false;
_local5++;
};
_local4++;
};
_local4 = 0;
while (_local4 < 7) {
_local5 = 0;
while (_local5 < 7) {
if (this._aMap[_local4][_local5].p != PLATFORM_NO){
_local8[(_local4 * 2)][(_local5 * 2)] = true;
_local2 = 0;
while (_local2 < Dir.NUM_BASEDIR) {
if (this._aMap[_local4][_local5].b[_local2] != BEAM_NO){
_local3 = 0;
while (_local3 < ((this._aMap[_local4][_local5].b[_local2] * 2) - 1)) {
_local6 = (((_local4 * 2) + (Dir.getDirOffset(_local2).x * _local3)) + Dir.getDirOffset(_local2).x);
_local7 = (((_local5 * 2) + (Dir.getDirOffset(_local2).y * _local3)) + Dir.getDirOffset(_local2).y);
_local8[_local6][_local7] = true;
_local3++;
};
};
_local2++;
};
};
_local5++;
};
_local4++;
};
if (_arg1){
trace("");
_local5 = 0;
while (_local5 < 14) {
_local9 = "";
_local4 = 0;
while (_local4 < 14) {
_local9 = (_local9 + (_local8[_local4][_local5]) ? " " : "#");
_local4++;
};
trace(_local9);
_local5++;
};
};
return (_local8);
}
private function displayBeams(_arg1:int, _arg2:int):void{
var mcBase:MovieClip;
var i:int;
var j:int;
var x = _arg1;
var y = _arg2;
mcBase = (this.mcMap[((("mcBeam_" + y) + "_") + x)] as MovieClip);
mcBase.mouseEnabled = false;
i = 0;
while (i < Dir.NUM_BASEDIR) {
var _local4 = (mcBase[("mcBeam_" + i)] as MovieClip);
with (_local4) {
visible = false;
mouseEnabled = false;
mouseChildren = false;
};
j = 1;
while (j < 4) {
_local4 = (mcBase.getChildByName(((("btnBeam_" + j) + "_") + i)) as SimpleButton);
with (_local4) {
enabled = false;
mouseEnabled = false;
};
j = (j + 1);
};
i = (i + 1);
};
i = 0;
while (i < Dir.NUM_BASEDIR) {
if (((!((this._aMap[x][y].b[i] == 0))) && (this._aMap[x][y].a[i]))){
_local4 = (mcBase[("mcBeam_" + i)] as MovieClip);
with (_local4) {
visible = true;
gotoAndStop((((this._aMap[x][y].b[i] - 1) * 15) + 10));
};
_local4 = (mcBase.getChildByName(((("btnBeam_" + this._aMap[x][y].b[i]) + "_") + i)) as SimpleButton);
with (_local4) {
enabled = true;
mouseEnabled = true;
};
};
i = (i + 1);
};
}
private function handleButtonRobot(_arg1:MouseEvent):void{
this._bMouseDown = false;
if (this._bMove){
if (_arg1.type == MouseEvent.MOUSE_UP){
this.setRobot(_arg1.target.name);
};
};
}
private function setRobot(_arg1:String):void{
switch (_arg1){
case "btnBolts":
trace(">> Bolts");
SoundUtil.playSFX("sndBolts");
this._bUsingNuts = false;
this._mcRobot.gotoAndStop("Bolts");
(this._mcNuts.getChildByName("mcSleep") as MovieClip).visible = true;
(this._mcBolts.getChildByName("mcSleep") as MovieClip).visible = false;
ColorUtil.setBrightness2(this._mcNuts, 0.8, 0.8, 0.8);
ColorUtil.setBrightness2(this._mcBolts);
this._pCurrent = new Point(this._pBolts.x, this._pBolts.y);
break;
case "btnNuts":
trace(">> Nuts");
SoundUtil.playSFX("sndNuts");
this._bUsingNuts = true;
this._mcRobot.gotoAndStop("Nuts");
(this._mcNuts.getChildByName("mcSleep") as MovieClip).visible = false;
(this._mcBolts.getChildByName("mcSleep") as MovieClip).visible = true;
ColorUtil.setBrightness2(this._mcNuts);
ColorUtil.setBrightness2(this._mcBolts, 0.8, 0.8, 0.8);
this._pCurrent = new Point(this._pNuts.x, this._pNuts.y);
break;
};
}
private function updateTime():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:String;
var _local5:String;
var _local6:String;
_local1 = (getTimer() - this._iTimeMS);
_local2 = (this._iTimeSec % 60);
_local3 = Math.floor((this._iTimeSec / 60));
_local4 = StrUtil.format(_local1, 3);
_local5 = StrUtil.format(_local2);
_local6 = StrUtil.format(_local3);
if (_local1 >= 1000){
_local4 = "000";
this._iTimeMS = getTimer();
this._iTimeSec++;
if ((((++this._refPlayer.data.iTime >= MEDAL_TIME_PLAY)) && (!(this._refPlayer.getMedal("m5").bAchieved)))){
this._refPlayer.getMedal("m5").setAchieved(StrUtil.isoDateTime());
SubMain.getInstance().showMedal("m5");
};
};
this._txtTimeMS_0.text = _local4.charAt(0);
this._txtTimeMS_1.text = _local4.charAt(1);
this._txtTimeMS_2.text = _local4.charAt(2);
this._txtTimeSec_0.text = _local5.charAt(0);
this._txtTimeSec_1.text = _local5.charAt(1);
this._txtTimeMin_0.text = _local6.charAt(0);
this._txtTimeMin_1.text = _local6.charAt(1);
}
private function updateStep(_arg1:int=1){
this._iSteps = (this._iSteps + _arg1);
this._txtStepsBase.text = (this._iSteps.toString() + "/");
this._txtStepsExt.text = this._iStepsMax.toString();
if (_arg1 != 0){
this.showHelp();
if (this._iSteps <= this._iStepsMax){
this.updateScore(100);
} else {
this.updateScore(-25);
};
};
VisualUtil.txtAlignRight(this._txtStepsExt, VisualUtil.txtGetRight(this._txtStepsLabel), this._txtStepsExt.y);
VisualUtil.txtAlignRight(this._txtStepsBase, this._txtStepsExt.x, this._txtStepsBase.y);
}
private function createPath(_arg1:int=-1):Array{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:MovieClip;
_local5 = [];
_local2 = 0;
while (_local2 < this._Pathfinder.objPath.iWeight) {
_local3 = this._Pathfinder.objPath.aPathX[_local2];
_local4 = this._Pathfinder.objPath.aPathY[_local2];
if (((((_local3 % 2) == 0)) && (((_local4 % 2) == 0)))){
_local3 = (_local3 * 0.5);
_local4 = (_local4 * 0.5);
if (this._aMap[_local3][_local4].p != PLATFORM_NO){
_local5.push({x:_local3, y:_local4, iPow:-1, xp:-1, yp:-1, iDir:-1, iType:2});
};
};
_local2++;
};
_local2 = 0;
while (_local2 < _local5.length) {
_local6 = this.getPlatformMC(_local5[_local2].x, _local5[_local2].y);
_local5[_local2].xp = _local6.x;
_local5[_local2].yp = _local6.y;
_local5[_local2].iDir = 0;
_local5[_local2].iPow = 1;
if (_local2 > 0){
_local5.iDir = Dir.getDirFromPoint(new Point(_local5[(_local2 - 1)].x, _local5[(_local2 - 1)].y), new Point(_local5[_local2].x, _local5[_local2].y));
if (_local5[_local2].x == _local5[(_local2 - 1)].x){
_local5[_local2].iPow = Math.abs((_local5[_local2].y - _local5[(_local2 - 1)].y));
} else {
if (_local5[_local2].y == _local5[(_local2 - 1)].y){
_local5[_local2].iPow = Math.abs((_local5[_local2].x - _local5[(_local2 - 1)].x));
};
};
};
_local2++;
};
_local5.shift();
if (_arg1 != -1){
};
return (_local5);
}
private function updateScore(_arg1:int=0):void{
var _local2:int;
SubMain.getInstance().getScoreTotal();
_local2 = (this._refPlayer.data.iScore + (1500 * StrUtil.cInt(this._refPlayer.data.aNut[this._refPlayer.data.iCurrentLevel])));
this._iScore = (this._iScore + _arg1);
if (this._iScore < 0){
this._iScore = 0;
};
this._txtScoreBase.text = StrUtil.seperate((_local2 + this._iScore).toString(), this._strSeperator);
VisualUtil.txtAlignRight(this._txtScoreBase, VisualUtil.txtGetRight(this._txtScoreLabel), this._txtScoreBase.y);
}
private function updateBeams():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < 7) {
_local2 = 0;
while (_local2 < 7) {
this.displayBeams(_local1, _local2);
_local2++;
};
_local1++;
};
}
private function setDepth():void{
var _local1:int;
var _local2:int;
_local1 = this._mcNuts.parent.getChildIndex(this._mcNuts);
_local2 = this._mcBolts.parent.getChildIndex(this._mcBolts);
if ((((this._pBolts.y < this._pNuts.y)) && ((_local1 < _local2)))){
this._mcNuts.parent.swapChildrenAt(_local1, _local2);
} else {
if ((((this._pBolts.y > this._pNuts.y)) && ((_local1 > _local2)))){
this._mcNuts.parent.swapChildrenAt(_local1, _local2);
};
};
if ((((this._pBolts.y == this._pNuts.y)) && ((_local1 > _local2)))){
this._mcNuts.parent.swapChildrenAt(_local1, _local2);
};
}
private function onEOFDone():void{
this._mcConfirm["mcEyeNuts"].visible = false;
if (MathUtil.rnd(0, 100) <= 1){
this._mcConfirm["mcEyeNuts"].visible = true;
};
}
private function onEndHelp():void{
this._mcHelp.visible = false;
}
private function showHelp(_arg1:String=""):void{
var _local2:String;
var _local3:MovieClip;
_local2 = "";
this._aHelp.x = Math.round(((640 - this._mcHelp.getBounds(this).width) * 0.5));
if (_arg1 != ""){
this._aHelp.unshift(_arg1);
};
if (this._aHelp.length != 0){
_local2 = this._aHelp.shift();
if ((((_local2 == "10")) && (!((this._iNut == 0))))){
_local2 = "";
};
trace("help:", _local2);
if (_local2 != ""){
if (this._mcHelp.visible){
SoundUtil.playSFX("sndHelp", 0.2);
TweenUtil.to(this._mcHelp, 0.2, {y:-300, onComplete:this._mcHelp.gotoAndStop, onCompleteParams:[("en_" + _local2)]});
TweenUtil.to(this._mcHelp, 0.5, {y:0, delay:0.3, overwrite:false});
} else {
this._mcHelp.visible = true;
this._mcHelp.y = -300;
this._mcHelp.gotoAndStop(("en_" + _local2));
SoundUtil.playSFX("sndHelp");
TweenUtil.to(this._mcHelp, 0.5, {y:0});
};
} else {
TweenUtil.to(this._mcHelp, 0.2, {y:-300, onComplete:this.onEndHelp});
};
} else {
TweenUtil.to(this._mcHelp, 0.2, {y:-300, onComplete:this.onEndHelp});
};
if (this._refPlayer.data.iCurrentLevel == 0){
switch (_local2){
case "00":
_local3 = this.getPlatformMC(2, 2);
this._mcPointer.visible = true;
this._mcPointer.x = _local3.x;
this._mcPointer.y = _local3.y;
this._iHelp = 0;
break;
case "01":
_local3 = this.getPlatformMC(2, 1);
this._mcPointer.visible = true;
this._mcPointer.x = (_local3.x + 35);
this._mcPointer.y = (_local3.y + 55);
this._iHelp = 1;
break;
case "02":
_local3 = this.getPlatformMC(3, 2);
this._mcPointer.visible = true;
this._mcPointer.x = _local3.x;
this._mcPointer.y = _local3.y;
this._iHelp = 2;
break;
case "03":
_local3 = this.getPlatformMC(5, 4);
this._mcPointer.visible = true;
this._mcPointer.x = _local3.x;
this._mcPointer.y = _local3.y;
this._iHelp = -1;
break;
};
};
}
private function checkLevelEnd():void{
var _local1:Boolean;
_local1 = false;
if (!this._bHasBolts){
_local1 = this._pCurrent.equals(this._pExit);
} else {
if (((this._pBolts.equals(this._pExit)) && (this._pNuts.equals(this._pExit)))){
_local1 = true;
};
};
if (_local1){
this.stopLevel();
this._mcNuts.play();
SoundUtil.playSFX("sndExit");
if (this._bHasBolts){
if (!this._refPlayer.getMedal("m3").bAchieved){
this._refPlayer.getMedal("m3").setAchieved(StrUtil.isoDateTime());
SubMain.getInstance().showMedal("m3");
};
};
if ((((this._refPlayer.data.iCurrentLevel == 14)) && (!(this._refPlayer.getMedal("m6").bAchieved)))){
this._refPlayer.getMedal("m6").setAchieved(StrUtil.isoDateTime());
SubMain.getInstance().showMedal("m6");
};
if ((((this._refPlayer.data.iCurrentLevel == 29)) && (!(this._refPlayer.getMedal("m10").bAchieved)))){
this._refPlayer.getMedal("m10").setAchieved(StrUtil.isoDateTime());
SubMain.getInstance().showMedal("m10");
};
if (((!((this._iPower == 0))) && (!(this._refPlayer.getMedal("m11").bAchieved)))){
this._refPlayer.getMedal("m11").setAchieved(StrUtil.isoDateTime());
SubMain.getInstance().showMedal("m11");
};
TweenUtil.to(this._mcMap, 0.5, {alpha:0, onComplete:this.showLevelDone, onCompleteParams:[0]});
TweenUtil.to(this._mcHelp, 0.5, {alpha:0});
this.showConfirm("welldone", ["btnDoneNext", "btnDoneReset", "btnDoneQuit", "btnDoneMore"]);
};
}
private function getLevelMC(_arg1:int):MovieClip{
var _local2:Class;
var _local3:MovieClip;
_local2 = (getDefinitionByName(("mcLevel_" + _arg1.toString())) as Class);
_local3 = (new (_local2) as MovieClip);
return (_local3);
}
private function handleButtonMenu(_arg1:MouseEvent):void{
this._bMouseDown = false;
if (_arg1.type == MouseEvent.MOUSE_UP){
SoundUtil.playSFX("sndClick");
switch (_arg1.target.name){
case "btnSound":
this._mcSound.gotoAndStop((SoundUtil.getInstance().bEnabled) ? 2 : 1);
SoundUtil.getInstance().setEnabled(!(SoundUtil.getInstance().bEnabled), 1);
break;
case "btnQuit":
TweenUtil.to(this._mcMap, 0.5, {alpha:0});
TweenUtil.to(this._mcHelp, 0.5, {alpha:0});
this.showConfirm("00", ["btnConfirmYes", "btnConfirmNo"]);
break;
case "btnRestart":
TweenUtil.to(this._mcMap, 0.5, {alpha:0});
TweenUtil.to(this._mcHelp, 0.5, {alpha:0});
this.showConfirm("reset", ["btnResetYes", "btnResetNo"]);
break;
case "btnZeppelin":
SubMain.getInstance().moreGames();
break;
case "btnConfirmYes":
this.exit();
this.setConfirmEvents(["btnConfirmYes", "btnConfirmNo"], false);
SubMain.getInstance().showTrans("menu", "game_remove");
break;
case "btnConfirmNo":
TweenUtil.to(this._mcMap, 0.5, {alpha:1});
TweenUtil.to(this._mcHelp, 0.5, {alpha:1});
TweenUtil.to(this._mcConfirm, 0.5, {alpha:0, onComplete:this.onEndConfirm, onCompleteParams:[this.onEOFGame]});
this.setConfirmEvents(["btnConfirmYes", "btnConfirmNo"], false);
break;
case "btnReadyYes":
TweenUtil.to(this._mcConfirm, 0.5, {alpha:0, onComplete:this.startLevel});
this.setConfirmEvents(["btnReadyYes"], false);
break;
case "btnResetYes":
TweenUtil.to(this._mcHelp, 0.5, {alpha:1});
TweenUtil.to(this._mcConfirm, 0.5, {alpha:0, onComplete:this.onEndConfirm, onCompleteParams:[this.onEOFGame]});
TweenUtil.to(this, 0.5, {onComplete:this.initLevel, onCompleteParams:[false]});
this.setConfirmEvents(["btnResetYes", "btnResetNo"], false);
break;
case "btnResetNo":
TweenUtil.to(this._mcMap, 0.5, {alpha:1});
TweenUtil.to(this._mcHelp, 0.5, {alpha:1});
TweenUtil.to(this._mcConfirm, 0.5, {alpha:0, onComplete:this.onEndConfirm, onCompleteParams:[this.onEOFGame]});
this.setConfirmEvents(["btnResetYes", "btnResetNo"], false);
break;
case "btnDoneNext":
this.showLevelDone(999);
this.nextLevel();
if (this._refPlayer.data.iCurrentLevel < 29){
TweenUtil.to(this._mcHelp, 0.5, {alpha:1});
TweenUtil.to(this._mcConfirm, 0.5, {alpha:0, onComplete:this.onEndConfirm, onCompleteParams:[this.onEOFGame]});
TweenUtil.to(this, 0.5, {onComplete:this.initLevel, onCompleteParams:[false]});
this.setConfirmEvents(["btnDoneNext", "btnDoneReset", "btnDoneQuit", "btnDoneMore"], false);
} else {
this.exit();
TweenUtil.to(this._mcConfirm, 0.2, {alpha:0});
this.setConfirmEvents(["btnDoneNext", "btnDoneReset", "btnDoneQuit", "btnDoneMore"], false);
SubMain.getInstance().showTrans("extro", "game_remove");
};
break;
case "btnDoneReset":
TweenUtil.to(this._mcHelp, 0.5, {alpha:1});
TweenUtil.to(this._mcConfirm, 0.5, {alpha:0, onComplete:this.onEndConfirm, onCompleteParams:[this.onEOFGame]});
TweenUtil.to(this, 0.5, {onComplete:this.initLevel, onCompleteParams:[false]});
this.setConfirmEvents(["btnDoneNext", "btnDoneReset", "btnDoneQuit", "btnDoneMore"], false);
break;
case "btnDoneQuit":
this.exit();
this.showLevelDone(999);
TweenUtil.to(this._mcConfirm, 0.2, {alpha:0});
this.setConfirmEvents(["btnDoneNext", "btnDoneReset", "btnDoneQuit", "btnDoneMore"], false);
SubMain.getInstance().showTrans("menu", "game_remove");
break;
case "btnDoneMore":
SubMain.getInstance().moreGames();
break;
};
} else {
if (_arg1.type == MouseEvent.MOUSE_OVER){
SoundUtil.playSFX("sndOver");
};
};
}
private function takeBluredScreenshot(_arg1:Number=0):Bitmap{
var _local2:BitmapData;
var _local3:Bitmap;
_local2 = new BitmapData(640, 480, false, 0);
this.filters = [new BlurFilter(10, 10, BitmapFilterQuality.MEDIUM)];
_local2.draw(this);
this.filters = [];
_local3 = new Bitmap(_local2);
ColorUtil.setBrightness2(_local3, _arg1, _arg1, _arg1);
return (_local3);
}
private function readMapMC(_arg1:MovieClip):void{
var _local2:MovieClip;
var _local3:SimpleButton;
var _local4:TextField;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
_local5 = false;
this._iStepsMax = StrUtil.cInt((_arg1.getChildByName("txtLvlSteps") as TextField).text);
this._bHasBolts = false;
_local4 = (_arg1.getChildByName("txtHelp") as TextField);
this._aHelp = new Array();
if (_local4.text != ""){
if (StrUtil.contains(_local4.text, ";")){
this._aHelp = _local4.text.split(";");
} else {
this._aHelp.push(_local4.text);
};
};
this._aMap = new Array();
_local8 = 0;
while (_local8 < 7) {
this._aMap[_local8] = new Array();
_local9 = 0;
while (_local9 < 7) {
this._aMap[_local8][_local9] = {p:PLATFORM_NO, d:0, b:[BEAM_NO, BEAM_NO, BEAM_NO, BEAM_NO], a:[false, false, false, false], c:[new Point(-1, -1), new Point(-1, -1), new Point(-1, -1), new Point(-1, -1)], h:0};
_local9++;
};
_local8++;
};
_local6 = 0;
while (_local6 < _arg1.numChildren) {
if (_arg1.getChildAt(_local6).toString() == "[object MovieClip]"){
_local2 = (_arg1.getChildAt(_local6) as MovieClip);
_local5 = false;
_local8 = Math.floor((_local2.x / 60));
_local9 = Math.floor((_local2.y / 60));
switch (_local2.name){
case "pl":
this._aMap[_local8][_local9].p = PLATFORM_NUTS;
_local5 = true;
break;
case "nut":
this._aMap[_local8][_local9].p = PLATFORM_NUTS;
if (this._refPlayer.data.aNut[this._refPlayer.data.iCurrentLevel] == 0){
this._aMap[_local8][_local9].h = 1;
};
_local5 = true;
break;
case "bolts":
this._aMap[_local8][_local9].p = PLATFORM_BOLTS;
_local5 = true;
break;
case "start":
case "start_0":
case "start_1":
case "start_2":
case "start_3":
this._aMap[_local8][_local9].p = PLATFORM_START;
this._aMap[_local8][_local9].d = 0;
this._pCurrent = new Point(_local8, _local9);
this._pNuts = new Point(_local8, _local9);
if (StrUtil.contains(_local2.name, "_")){
this._aMap[_local8][_local9].d = StrUtil.cInt(StrUtil.part(_local2.name, "_", 1));
};
_local5 = true;
break;
case "startbolts":
this._aMap[_local8][_local9].p = PLATFORM_STARTBOLTS;
this._aMap[_local8][_local9].d = 0;
this._pBolts = new Point(_local8, _local9);
this._bHasBolts = true;
if (StrUtil.contains(_local2.name, "_")){
this._aMap[_local8][_local9].d = StrUtil.cInt(StrUtil.part(_local2.name, "_", 1));
};
_local5 = true;
break;
case "startall":
case "startall_0":
case "startall_1":
case "startall_2":
case "startall_3":
this._aMap[_local8][_local9].p = PLATFORM_STARTALL;
this._aMap[_local8][_local9].d = 0;
this._pCurrent = new Point(_local8, _local9);
this._pNuts = new Point(_local8, _local9);
this._pBolts = new Point(_local8, _local9);
this._bHasBolts = true;
if (StrUtil.contains(_local2.name, "_")){
this._aMap[_local8][_local9].d = StrUtil.cInt(StrUtil.part(_local2.name, "_", 1));
};
_local5 = true;
break;
case "startend":
case "startend_0":
case "startend_1":
case "startend_2":
case "startend_3":
this._aMap[_local8][_local9].p = PLATFORM_STARTEND;
this._aMap[_local8][_local9].d = 0;
this._pCurrent = new Point(_local8, _local9);
this._pNuts = new Point(_local8, _local9);
this._pExit = new Point(_local8, _local9);
if (StrUtil.contains(_local2.name, "_")){
this._aMap[_local8][_local9].d = StrUtil.cInt(StrUtil.part(_local2.name, "_", 1));
};
_local5 = true;
break;
case "end":
case "end_0":
case "end_1":
case "end_2":
case "end_3":
this._aMap[_local8][_local9].p = PLATFORM_END;
this._aMap[_local8][_local9].d = 0;
this._pExit = new Point(_local8, _local9);
if (StrUtil.contains(_local2.name, "_")){
this._aMap[_local8][_local9].d = StrUtil.cInt(StrUtil.part(_local2.name, "_", 1));
};
_local5 = true;
break;
};
if (_local5){
};
};
_local6++;
};
_local6 = 0;
while (_local6 < _arg1.numChildren) {
if (_arg1.getChildAt(_local6).toString() == "[object MovieClip]"){
_local2 = (_arg1.getChildAt(_local6) as MovieClip);
_local8 = Math.floor((_local2.x / 60));
_local9 = Math.floor((_local2.y / 60));
switch (_local2.name){
case "bsh":
trace("bsh:", _local8, _local9);
this._aMap[_local8][_local9].d = 1;
this._aMap[_local8][_local9].b[this._aMap[_local8][_local9].d] = BEAM_1;
this._aMap[_local8][_local9].a[this._aMap[_local8][_local9].d] = true;
this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d] = new Point(_local8, _local9).add(Dir.getDirOffset(this._aMap[_local8][_local9].d));
_local10 = this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d].x;
_local11 = this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d].y;
this._aMap[_local10][_local11].d = 3;
this._aMap[_local10][_local11].b[this._aMap[_local10][_local11].d] = BEAM_1;
this._aMap[_local10][_local11].a[this._aMap[_local10][_local11].d] = false;
this._aMap[_local10][_local11].c[this._aMap[_local10][_local11].d] = new Point(_local8, _local9);
break;
case "bsv":
trace("bsv:", _local8, _local9);
this._aMap[_local8][_local9].d = 2;
this._aMap[_local8][_local9].b[this._aMap[_local8][_local9].d] = BEAM_1;
this._aMap[_local8][_local9].a[this._aMap[_local8][_local9].d] = true;
this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d] = new Point(_local8, _local9).add(Dir.getDirOffset(this._aMap[_local8][_local9].d));
_local10 = this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d].x;
_local11 = this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d].y;
this._aMap[_local10][_local11].d = 0;
this._aMap[_local10][_local11].b[this._aMap[_local10][_local11].d] = BEAM_1;
this._aMap[_local10][_local11].a[this._aMap[_local10][_local11].d] = false;
this._aMap[_local10][_local11].c[this._aMap[_local10][_local11].d] = new Point(_local8, _local9);
break;
case "bmh":
trace("bmh:", _local8, _local9);
this._aMap[_local8][_local9].d = 1;
this._aMap[_local8][_local9].b[this._aMap[_local8][_local9].d] = BEAM_2;
this._aMap[_local8][_local9].a[this._aMap[_local8][_local9].d] = true;
this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d] = new Point(_local8, _local9).add(new Point((Dir.getDirOffset(this._aMap[_local8][_local9].d).x * 2), (Dir.getDirOffset(this._aMap[_local8][_local9].d).y * 2)));
_local10 = this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d].x;
_local11 = this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d].y;
this._aMap[_local10][_local11].d = 3;
this._aMap[_local10][_local11].b[this._aMap[_local10][_local11].d] = BEAM_2;
this._aMap[_local10][_local11].a[this._aMap[_local10][_local11].d] = false;
this._aMap[_local10][_local11].c[this._aMap[_local10][_local11].d] = new Point(_local8, _local9);
break;
case "bmv":
trace("bmv:", _local8, _local9);
this._aMap[_local8][_local9].d = 2;
this._aMap[_local8][_local9].b[this._aMap[_local8][_local9].d] = BEAM_2;
this._aMap[_local8][_local9].a[this._aMap[_local8][_local9].d] = true;
this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d] = new Point(_local8, _local9).add(new Point((Dir.getDirOffset(this._aMap[_local8][_local9].d).x * 2), (Dir.getDirOffset(this._aMap[_local8][_local9].d).y * 2)));
_local10 = this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d].x;
_local11 = this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d].y;
this._aMap[_local10][_local11].d = 0;
this._aMap[_local10][_local11].b[this._aMap[_local10][_local11].d] = BEAM_2;
this._aMap[_local10][_local11].a[this._aMap[_local10][_local11].d] = false;
this._aMap[_local10][_local11].c[this._aMap[_local10][_local11].d] = new Point(_local8, _local9);
break;
case "blh":
trace("blh:", _local8, _local9);
this._aMap[_local8][_local9].d = 1;
this._aMap[_local8][_local9].b[this._aMap[_local8][_local9].d] = BEAM_3;
this._aMap[_local8][_local9].a[this._aMap[_local8][_local9].d] = true;
this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d] = new Point(_local8, _local9).add(new Point((Dir.getDirOffset(this._aMap[_local8][_local9].d).x * 3), (Dir.getDirOffset(this._aMap[_local8][_local9].d).y * 3)));
_local10 = this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d].x;
_local11 = this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d].y;
this._aMap[_local10][_local11].d = 3;
this._aMap[_local10][_local11].b[this._aMap[_local10][_local11].d] = BEAM_3;
this._aMap[_local10][_local11].a[this._aMap[_local10][_local11].d] = false;
this._aMap[_local10][_local11].c[this._aMap[_local10][_local11].d] = new Point(_local8, _local9);
break;
case "blv":
trace("blv:", _local8, _local9);
this._aMap[_local8][_local9].d = 2;
this._aMap[_local8][_local9].b[this._aMap[_local8][_local9].d] = BEAM_3;
this._aMap[_local8][_local9].a[this._aMap[_local8][_local9].d] = true;
this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d] = new Point(_local8, _local9).add(new Point((Dir.getDirOffset(this._aMap[_local8][_local9].d).x * 3), (Dir.getDirOffset(this._aMap[_local8][_local9].d).y * 3)));
_local10 = this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d].x;
_local11 = this._aMap[_local8][_local9].c[this._aMap[_local8][_local9].d].y;
this._aMap[_local10][_local11].d = 0;
this._aMap[_local10][_local11].b[this._aMap[_local10][_local11].d] = BEAM_3;
this._aMap[_local10][_local11].a[this._aMap[_local10][_local11].d] = false;
this._aMap[_local10][_local11].c[this._aMap[_local10][_local11].d] = new Point(_local8, _local9);
break;
};
};
_local6++;
};
}
}
}//package
Section 80
//ScreenIntro (ScreenIntro)
package {
import flash.events.*;
import flash.display.*;
public class ScreenIntro extends MovieClip {
public function ScreenIntro(_arg1:Boolean){
this.name = "mcIntro";
this.stop();
if (_arg1){
this.init();
};
}
private function init():void{
this.play();
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
private function exit():void{
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
SubMain.getInstance().showScreen("story");
SubMain.getInstance().showScreen("remove_intro");
}
private function onEnterFrame(_arg1:Event):void{
if (this.currentFrame == this.totalFrames){
this.stop();
this.exit();
};
}
}
}//package
Section 81
//ScreenLevel (ScreenLevel)
package {
import de.drygoods.Util.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import de.drygoods.Graphics.*;
import flash.filters.*;
public class ScreenLevel extends MovieClip {
public var btnLevel_2:SimpleButton;
public var btnLevel_3:SimpleButton;
public var btnLevel_5:SimpleButton;
public var btnLevel_6:SimpleButton;
public var btnLevel_4:SimpleButton;
public var btnLevel_0:SimpleButton;
public var txtData:TextField;
public var btnLevel_8:SimpleButton;
public var btnLevel_1:SimpleButton;
public var btnLevel_7:SimpleButton;
public var txtLabel:TextField;
public var btnLevel_9:SimpleButton;
public var btnReset:SimpleButton;
public var txtReset:TextField;
private var _txtData:TextField;
public var mcOK_0:MovieClip;
public var mcOK_2:MovieClip;
public var mcOK_6:MovieClip;
public var mcOK_7:MovieClip;
public var mcOK_8:MovieClip;
public var mcOK_9:MovieClip;
public var mcOK_3:MovieClip;
public var mcOK_4:MovieClip;
public var btnLevel_10:SimpleButton;
public var btnLevel_12:SimpleButton;
public var btnLevel_13:SimpleButton;
public var btnLevel_14:SimpleButton;
public var btnLevel_15:SimpleButton;
public var btnLevel_16:SimpleButton;
public var mcLock_10:MovieClip;
public var mcLock_11:MovieClip;
public var mcLock_12:MovieClip;
public var mcLock_15:MovieClip;
public var mcLock_16:MovieClip;
public var mcLock_17:MovieClip;
public var mcLock_18:MovieClip;
public var mcLock_13:MovieClip;
public var mcLock_14:MovieClip;
public var btnLevel_17:SimpleButton;
public var mcLock_19:MovieClip;
public var btnLevel_19:SimpleButton;
public var btnLevel_11:SimpleButton;
public var mcLock_0:MovieClip;
public var mcLock_1:MovieClip;
public var mcLock_2:MovieClip;
public var btnLevel_20:SimpleButton;
public var btnLevel_22:SimpleButton;
public var mcLock_8:MovieClip;
public var mcLock_9:MovieClip;
public var btnLevel_28:SimpleButton;
public var mcLock_23:MovieClip;
public var mcLock_26:MovieClip;
public var mcLock_20:MovieClip;
public var mcLock_21:MovieClip;
public var btnLevel_29:SimpleButton;
public var mcLock_5:MovieClip;
public var mcLock_27:MovieClip;
public var mcLock_22:MovieClip;
public var btnLevel_21:SimpleButton;
public var mcLock_24:MovieClip;
public var btnLevel_23:SimpleButton;
public var mcLock_7:MovieClip;
public var btnLevel_25:SimpleButton;
public var btnLevel_26:SimpleButton;
public var txtBack:TextField;
public var mcLock_4:MovieClip;
public var mcLock_25:MovieClip;
public var mcLock_6:MovieClip;
public var btnLevel_24:SimpleButton;
public var mcLock_29:MovieClip;
public var mcOK_1:MovieClip;
public var btnLevel_27:SimpleButton;
public var mcOK_5:MovieClip;
public var mcOK_12:MovieClip;
public var mcOK_13:MovieClip;
public var mcOK_14:MovieClip;
public var mcOK_15:MovieClip;
public var mcOK_16:MovieClip;
public var mcOK_19:MovieClip;
public var mcOK_17:MovieClip;
public var mcOK_10:MovieClip;
public var mcOK_11:MovieClip;
public var mcLock_28:MovieClip;
public var btnLevel_18:SimpleButton;
public var mcLock_3:MovieClip;
public var mcOK_21:MovieClip;
public var mcOK_22:MovieClip;
public var mcOK_24:MovieClip;
public var mcOK_25:MovieClip;
public var mcOK_26:MovieClip;
public var mcOK_20:MovieClip;
public var mcOK_28:MovieClip;
public var mcOK_29:MovieClip;
public var mcOK_23:MovieClip;
public var mcOK_18:MovieClip;
public var btnBack:SimpleButton;
public var mcOK_27:MovieClip;
private var _txtLabel:TextField;
public var btnMore:SimpleButton;
public var txtMore:TextField;
private var _iWidth:int;
public function ScreenLevel(_arg1:int=-1){
this.name = "mcLevel";
if (_arg1 != -1){
trace("level screen");
this.init();
};
}
private function handleButtonLevel(_arg1:MouseEvent):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = StrUtil.cInt(StrUtil.part(_arg1.target.name, "_", 1));
_local3 = SubMain.getInstance().mywPlayer.data.aLevelScore[_local2];
_local4 = SubMain.getInstance().mywPlayer.data.iScore;
switch (_arg1.type){
case MouseEvent.MOUSE_DOWN:
case MouseEvent.MOUSE_OVER:
SoundUtil.playSFX("sndOver");
_local5 = (_arg1.target.x + 50);
this._txtData.text = ((((_local3)==0) ? "not solved yet" : StrUtil.seperate(_local3.toString(), ",") + "\n") + StrUtil.seperate(_local4.toString(), ","));
if (((_local5 + this._iWidth) + VisualUtil.txtGetWidth(this._txtData)) > SubMain.getInstance().width){
_local5 = (_local5 + (SubMain.getInstance().width - (((_local5 + this._iWidth) + VisualUtil.txtGetWidth(this._txtData)) + 30)));
};
TweenUtil.to(this._txtLabel, 0.3, {x:_local5, y:(_arg1.target.y + 40), alpha:1});
TweenUtil.to(this._txtData, 0.4, {x:(_local5 + this._iWidth), y:(_arg1.target.y + 40), alpha:1});
break;
case MouseEvent.MOUSE_OUT:
TweenUtil.to(this._txtLabel, 0.3, {alpha:0});
TweenUtil.to(this._txtData, 0.4, {alpha:0});
break;
case MouseEvent.MOUSE_UP:
this.exit();
SoundUtil.playSFX("sndClick");
TweenUtil.to(this, 0.5, {alpha:0});
SubMain.getInstance().mywPlayer.data.iCurrentLevel = _local2;
SubMain.getInstance().showTrans("game", "remove_menu_level");
break;
};
}
private function init():void{
var _local1:SimpleButton;
var _local2:TextField;
var _local3:TextField;
var _local4:MovieClip;
var _local5:int;
var _local6:Boolean;
this._txtLabel = (this.getChildByName("txtLabel") as TextField);
this._txtData = (this.getChildByName("txtData") as TextField);
this._txtLabel.alpha = 0;
this._txtLabel.mouseEnabled = false;
this._txtData.alpha = 0;
this._txtData.mouseEnabled = false;
this._iWidth = (VisualUtil.txtGetWidth(this._txtLabel) + 5);
SubMain.getInstance().getScoreTotal();
_local2 = (this.getChildByName("txtBack") as TextField);
_local2.mouseEnabled = false;
_local1 = (this.getChildByName("btnBack") as SimpleButton);
_local1.x = (_local2.x - 5);
_local1.y = (_local2.y - 2);
_local1.width = (VisualUtil.txtGetWidth(_local2) + 10);
_local1.height = (VisualUtil.txtGetHeight(_local2) + 7);
EventUtil.setButtonEvents(_local1, this.handleButtonMenu);
_local3 = (this.getChildByName("txtMore") as TextField);
_local3.mouseEnabled = false;
_local3.x = (VisualUtil.txtGetRight(_local2) + 20);
_local1 = (this.getChildByName("btnMore") as SimpleButton);
_local1.x = (_local3.x - 5);
_local1.y = (_local3.y - 2);
_local1.width = (VisualUtil.txtGetWidth(_local3) + 15);
_local1.height = (VisualUtil.txtGetHeight(_local3) + 7);
EventUtil.setButtonEvents(_local1, this.handleButtonMenu);
_local3 = (this.getChildByName("txtReset") as TextField);
_local3.mouseEnabled = false;
_local1 = (this.getChildByName("btnReset") as SimpleButton);
_local1.x = (_local3.x - 5);
_local1.y = (_local3.y - 2);
_local1.width = (VisualUtil.txtGetWidth(_local3) + 15);
_local1.height = (VisualUtil.txtGetHeight(_local3) + 7);
EventUtil.setButtonEvents(_local1, this.handleButtonMenu);
_local5 = 0;
while (_local5 < 30) {
_local6 = StrUtil.contains(SubMain.getInstance().mywPlayer.data.strLevel, (("(" + _local5.toString()) + ")"));
_local4 = (this.getChildByName(("mcLock_" + _local5.toString())) as MovieClip);
_local4.mouseEnabled = false;
_local4.visible = !(_local6);
_local4 = (this.getChildByName(("mcOK_" + _local5.toString())) as MovieClip);
_local4.mouseEnabled = false;
_local4.mouseChildren = false;
_local4.visible = !((SubMain.getInstance().mywPlayer.data.aLevelScore[_local5] == 0));
_local1 = (this.getChildByName(("btnLevel_" + _local5.toString())) as SimpleButton);
_local1.mouseEnabled = _local6;
_local1.enabled = _local6;
_local1.visible = _local6;
EventUtil.setButtonEvents(_local1, this.handleButtonLevel);
_local5++;
};
SubMain.getInstance().getScoreTotal();
this.alpha = 0;
TweenUtil.to(this, 0.5, {alpha:1});
}
public function exit(){
var _local1:int;
_local1 = 0;
while (_local1 < 30) {
EventUtil.setButtonEvents((this.getChildByName(("btnLevel_" + _local1.toString())) as SimpleButton), this.handleButtonLevel, false);
_local1++;
};
EventUtil.setButtonEvents((this.getChildByName("btnBack") as SimpleButton), this.handleButtonMenu, false);
EventUtil.setButtonEvents((this.getChildByName("btnMore") as SimpleButton), this.handleButtonMenu, false);
}
private function takeBluredScreenshot(_arg1:Number=0):Bitmap{
var _local2:BitmapData;
var _local3:Bitmap;
_local2 = new BitmapData(640, 480, false, 0);
this.filters = [new BlurFilter(10, 10, BitmapFilterQuality.MEDIUM)];
_local2.draw(this);
this.filters = [];
_local3 = new Bitmap(_local2);
ColorUtil.setBrightness2(_local3, _arg1, _arg1, _arg1);
return (_local3);
}
private function handleButtonMenu(_arg1:MouseEvent):void{
switch (_arg1.type){
case MouseEvent.MOUSE_OVER:
SoundUtil.playSFX("sndOver");
break;
case MouseEvent.MOUSE_UP:
SoundUtil.playSFX("sndClick");
switch (_arg1.target.name){
case "btnBack":
this.exit();
SubMain.getInstance().showScreen("menu_activate");
TweenUtil.to(this, 0.5, {alpha:0, onComplete:SubMain.getInstance().showScreen, onCompleteParams:["level_remove"]});
break;
case "btnMore":
SubMain.getInstance().moreGames();
break;
case "btnReset":
this.exit();
SubMain.getInstance().resetScores();
SubMain.getInstance().showScreen("menu_activate");
TweenUtil.to(this, 0.5, {alpha:0, onComplete:SubMain.getInstance().showScreen, onCompleteParams:["level_remove"]});
break;
};
break;
};
}
}
}//package
Section 82
//ScreenMedal (ScreenMedal)
package {
import de.drygoods.Util.*;
import flash.events.*;
import flash.display.*;
import com.medalyourway.*;
import flash.text.*;
public class ScreenMedal extends MovieClip {
public var txtMedal_12:TextField;
public var btnMedal_9:SimpleButton;
public var txtCopy:TextField;
public var btnMedal_7:SimpleButton;
private var _refPlayer:mywUserHandle;
public var btnMedal_10:SimpleButton;
public var txtMore:TextField;
public var txtMedal_11:TextField;
public var btnMedal_2:SimpleButton;
private var _fnExit:Function;
private var _txtCopy:TextField;
public var btnMedal_8:SimpleButton;
public var txtMedal_10:TextField;
private var _txtHead:TextField;
public var btnMedal_11:SimpleButton;
public var txtMedal_3:TextField;
public var txtMedal_5:TextField;
public var txtMedal_7:TextField;
public var txtMedal_4:TextField;
public var txtMedal_2:TextField;
public var btnBack:SimpleButton;
public var txtMedal_6:TextField;
public var txtHead:TextField;
public var txtMedal_1:TextField;
public var txtBack:TextField;
public var txtMedal_9:TextField;
public var txtMedal_8:TextField;
private var _txtClose:TextField;
public var btnMore:SimpleButton;
public var btnMedal_12:SimpleButton;
public var btnMedal_1:SimpleButton;
public var btnMedal_3:SimpleButton;
public var btnMedal_5:SimpleButton;
public var btnMedal_6:SimpleButton;
public var btnMedal_4:SimpleButton;
public function ScreenMedal(_arg1:int=-1, _arg2:Function=null){
if (_arg1 != -1){
trace("medal screen");
this._fnExit = _arg2;
this.name = "mcMedal";
this.x = 0;
this.y = 0;
this.init();
};
}
private function exit():void{
var _local1:int;
_local1 = 1;
while (_local1 < 13) {
EventUtil.setButtonEvents((this.getChildByName(("btnMedal_" + String(_local1))) as SimpleButton), this.handleMedals, false);
_local1++;
};
EventUtil.setButtonEvents((this.getChildByName("btnBack") as SimpleButton), this.handleButtons, false);
EventUtil.setButtonEvents((this.getChildByName("btnMore") as SimpleButton), this.handleButtons, false);
if (this._fnExit != null){
this._fnExit(this);
};
}
private function init():void{
var _local1:int;
var _local2:TextField;
var _local3:SimpleButton;
this._refPlayer = SubMain.getInstance().mywPlayer;
this._txtHead = (this.getChildByName("txtHead") as TextField);
this._txtCopy = (this.getChildByName("txtCopy") as TextField);
this._txtClose = (this.getChildByName("txtClose") as TextField);
_local1 = 1;
while (_local1 < 13) {
_local2 = (this.getChildByName(("txtMedal_" + String(_local1))) as TextField);
_local2.alpha = 0;
if (this._refPlayer.getMedal(("m" + _local1.toString())).bAchieved){
TweenUtil.to(_local2, 0.5, {alpha:1, delay:(_local1 * 0.1)});
};
_local3 = (this.getChildByName(("btnMedal_" + String(_local1))) as SimpleButton);
EventUtil.setButtonEvents(_local3, this.handleMedals);
_local1++;
};
_local2 = (this.getChildByName("txtBack") as TextField);
_local2.mouseEnabled = false;
_local2 = (this.getChildByName("txtMore") as TextField);
_local2.mouseEnabled = false;
EventUtil.setButtonEvents((this.getChildByName("btnBack") as SimpleButton), this.handleButtons);
EventUtil.setButtonEvents((this.getChildByName("btnMore") as SimpleButton), this.handleButtons);
}
private function handleButtons(_arg1:MouseEvent):void{
switch (_arg1.type){
case MouseEvent.MOUSE_OVER:
SoundUtil.playSFX("sndOver");
break;
case MouseEvent.MOUSE_UP:
SoundUtil.playSFX("sndClick");
switch (_arg1.target.name){
case "btnBack":
this.exit();
SubMain.getInstance().showScreen("menu_activate");
TweenUtil.to(this, 0.5, {alpha:0, onComplete:SubMain.getInstance().showScreen, onCompleteParams:["medal_remove"]});
break;
case "btnMore":
SubMain.getInstance().moreGames();
break;
};
break;
};
}
private function handleMedals(_arg1:MouseEvent):void{
var _local2:int;
_local2 = parseInt(_arg1.target.name.split("_")[1]);
switch (_arg1.type){
case MouseEvent.MOUSE_OVER:
SoundUtil.playSFX("sndOver");
this._txtHead.x = (_arg1.target.x + 20);
this._txtHead.y = (_arg1.target.y + 50);
this._txtHead.alpha = 0;
this._txtHead.text = this._refPlayer.getMedal(("m" + _local2.toString())).strName;
this._txtCopy.x = this._txtHead.x;
this._txtCopy.y = (this._txtHead.y + 30);
this._txtCopy.alpha = 0;
this._txtCopy.text = this._refPlayer.getMedal(("m" + _local2.toString())).strText;
TweenUtil.to(this._txtHead, 0.2, {alpha:1});
TweenUtil.to(this._txtCopy, 0.2, {alpha:1, delay:0.1});
break;
case MouseEvent.MOUSE_OUT:
TweenUtil.to(this._txtHead, 0.2, {alpha:0});
TweenUtil.to(this._txtCopy, 0.2, {alpha:0, delay:0.1});
break;
};
}
}
}//package
Section 83
//ScreenMenu (ScreenMenu)
package {
import de.drygoods.Util.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import de.drygoods.Graphics.*;
import flash.filters.*;
public class ScreenMenu extends MovieClip {
public var mcCloud_00:MovieClip;
public var mcCloud_01:MovieClip;
public var txtMedals:TextField;
public var mcCloud_03:MovieClip;
public var mcCloud_02:MovieClip;
public var btnMedals:SimpleButton;
private var _mcEyeBolts:MovieClip;
public var btnSound:SimpleButton;
public var mcSound:MovieClip;
private var _mcZeppelin:MovieClip;
public var mcLogo:MovieClip;
private var _mcEyeNuts:MovieClip;
public var mcEyeBolts:MovieClip;
private var _mcCloud_00:MovieClip;
private var _mcCloud_02:MovieClip;
private var _mcCloud_01:MovieClip;
public var mcZeppelin:MovieClip;
private var _mcCloud_03:MovieClip;
public var btnPlay:SimpleButton;
public var btnGYW:SimpleButton;
public var btnMore:SimpleButton;
public var txtPlay:TextField;
public var mcEyeNuts:MovieClip;
public var txtMore:TextField;
private var _mcSound:MovieClip;
private var _bWait:Boolean;
public function ScreenMenu(_arg1:int=-1){
this.name = "mcMenu";
if (_arg1 != -1){
trace("menu screen");
this.init();
};
}
private function init():void{
var _local1:TextField;
var _local2:SimpleButton;
this._mcEyeBolts = (this.getChildByName("mcEyeNuts") as MovieClip);
this._mcEyeBolts.visible = false;
this._mcEyeNuts = (this.getChildByName("mcEyeBolts") as MovieClip);
this._mcEyeNuts.visible = false;
this._mcCloud_00 = (this.getChildByName("mcCloud_00") as MovieClip);
this._mcCloud_01 = (this.getChildByName("mcCloud_01") as MovieClip);
this._mcCloud_02 = (this.getChildByName("mcCloud_02") as MovieClip);
this._mcCloud_03 = (this.getChildByName("mcCloud_03") as MovieClip);
this._mcZeppelin = (this.getChildByName("mcZeppelin") as MovieClip);
this._mcSound = (this.getChildByName("mcSound") as MovieClip);
this._mcSound.mouseEnabled = false;
this._mcSound.gotoAndStop((SoundUtil.getInstance().bEnabled) ? 1 : 2);
this._bWait = false;
_local1 = (this.getChildByName("txtPlay") as TextField);
_local1.mouseEnabled = false;
_local2 = (this.getChildByName("btnPlay") as SimpleButton);
_local2.x = (_local1.x - 5);
_local2.y = (_local1.y - 2);
_local2.width = (VisualUtil.txtGetWidth(_local1) + 10);
_local2.height = (VisualUtil.txtGetHeight(_local1) + 7);
EventUtil.setButtonEvents(_local2, this.handleButtonMenu);
_local1 = (this.getChildByName("txtMedals") as TextField);
_local1.mouseEnabled = false;
_local1.x = (VisualUtil.txtGetRight((this.getChildByName("txtPlay") as TextField)) + 20);
_local2 = (this.getChildByName("btnMedals") as SimpleButton);
_local2.x = (_local1.x - 5);
_local2.y = (_local1.y - 2);
_local2.width = (VisualUtil.txtGetWidth(_local1) + 10);
_local2.height = (VisualUtil.txtGetHeight(_local1) + 7);
EventUtil.setButtonEvents(_local2, this.handleButtonMenu);
_local1 = (this.getChildByName("txtMore") as TextField);
_local1.mouseEnabled = false;
_local1.x = (VisualUtil.txtGetRight((this.getChildByName("txtMedals") as TextField)) + 20);
_local2 = (this.getChildByName("btnMore") as SimpleButton);
_local2.x = (_local1.x - 5);
_local2.y = (_local1.y - 2);
_local2.width = (VisualUtil.txtGetWidth(_local1) + 15);
_local2.height = (VisualUtil.txtGetHeight(_local1) + 7);
EventUtil.setButtonEvents(_local2, this.handleButtonMenu);
_local2 = (this.getChildByName("btnGYW") as SimpleButton);
EventUtil.setButtonEvents(_local2, this.handleButtonMenu);
_local2 = (this.getChildByName("btnSound") as SimpleButton);
EventUtil.setButtonEvents(_local2, this.handleButtonMenu);
_local2 = (this._mcZeppelin.getChildByName("btnZeppelin") as SimpleButton);
EventUtil.setButtonEvents(_local2, this.handleButtonMenu);
SoundUtil.playMusic("musicMenu", 0.5);
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
public function exit(){
SoundUtil.stopMusic("musicMenu", 2);
EventUtil.setButtonEvents((this.getChildByName("btnPlay") as SimpleButton), this.handleButtonMenu, false);
EventUtil.setButtonEvents((this.getChildByName("btnMedals") as SimpleButton), this.handleButtonMenu, false);
EventUtil.setButtonEvents((this.getChildByName("btnMore") as SimpleButton), this.handleButtonMenu, false);
EventUtil.setButtonEvents((this.getChildByName("btnGYW") as SimpleButton), this.handleButtonMenu, false);
EventUtil.setButtonEvents((this.getChildByName("btnSound") as SimpleButton), this.handleButtonMenu, false);
EventUtil.setButtonEvents((this._mcZeppelin.getChildByName("btnZeppelin") as SimpleButton), this.handleButtonMenu, false);
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
public function activate():void{
this.enabled = true;
this.mouseChildren = true;
this.mouseEnabled = true;
(this.getChildByName("txtPlay") as TextField).mouseEnabled = false;
(this.getChildByName("txtMedals") as TextField).mouseEnabled = false;
(this.getChildByName("txtMore") as TextField).mouseEnabled = false;
(this.getChildByName("mcSound") as MovieClip).mouseEnabled = false;
TweenUtil.to(this.getChildByName("mcLogo"), 0.3, {alpha:1});
TweenUtil.to(this.getChildByName("txtPlay"), 0.3, {alpha:1, delay:0.1});
TweenUtil.to(this.getChildByName("txtMedals"), 0.3, {alpha:1, delay:0.2});
TweenUtil.to(this.getChildByName("txtMore"), 0.3, {alpha:1, delay:0.3});
TweenUtil.to(this.getChildByName("mcSound"), 0.3, {alpha:1, delay:0.4});
}
public function showSubscreen():void{
this.enabled = false;
this.mouseChildren = false;
this.mouseEnabled = false;
TweenUtil.to(this.getChildByName("mcLogo"), 0.3, {alpha:0});
TweenUtil.to(this.getChildByName("txtPlay"), 0.3, {alpha:0, delay:0.1});
TweenUtil.to(this.getChildByName("txtMedals"), 0.3, {alpha:0, delay:0.2});
TweenUtil.to(this.getChildByName("txtMore"), 0.3, {alpha:0, delay:0.3});
TweenUtil.to(this.getChildByName("mcSound"), 0.3, {alpha:0, delay:0.4});
}
private function takeBluredScreenshot(_arg1:Number=0):Bitmap{
var _local2:BitmapData;
var _local3:Bitmap;
_local2 = new BitmapData(640, 480, false, 0);
this.filters = [new BlurFilter(10, 10, BitmapFilterQuality.MEDIUM)];
_local2.draw(this);
this.filters = [];
_local3 = new Bitmap(_local2);
ColorUtil.setBrightness2(_local3, _arg1, _arg1, _arg1);
return (_local3);
}
public function hide():void{
this.exit();
TweenUtil.to(this, 0.5, {alpha:0, onComplete:SubMain.getInstance().showScreen, onCompleteParams:["menu_remove"]});
}
private function onEnterFrame(_arg1:Event):void{
this._mcEyeBolts.visible = false;
if (MathUtil.rnd(0, 100) <= 1){
this._mcEyeBolts.visible = true;
};
this._mcEyeNuts.visible = false;
if (MathUtil.rnd(0, 100) <= 1){
this._mcEyeNuts.visible = true;
};
this._mcCloud_00.x = (this._mcCloud_00.x + 1);
this._mcCloud_01.x = (this._mcCloud_01.x + (this._bWait) ? 1 : 0);
this._mcCloud_02.x = (this._mcCloud_02.x + (this._bWait) ? 1 : 0);
this._mcCloud_03.x = (this._mcCloud_03.x + 1);
this._mcZeppelin.x--;
this._bWait = !(this._bWait);
if (this._mcCloud_00.x > 650){
this._mcCloud_00.x = -(MathUtil.rnd(400, 500));
this._mcCloud_00.y = MathUtil.rnd(-25, 150);
};
if (this._mcCloud_01.x > 650){
this._mcCloud_01.x = -(MathUtil.rnd(400, 500));
this._mcCloud_01.y = MathUtil.rnd(-25, 150);
};
if (this._mcCloud_02.x > 650){
this._mcCloud_02.x = -(MathUtil.rnd(400, 500));
this._mcCloud_02.y = MathUtil.rnd(-25, 150);
};
if (this._mcCloud_03.x > 650){
this._mcCloud_03.x = -(MathUtil.rnd(400, 500));
this._mcCloud_03.y = MathUtil.rnd(-25, 150);
};
if (this._mcZeppelin.x < -310){
this._mcZeppelin.x = MathUtil.rnd(640, 680);
this._mcZeppelin.y = MathUtil.rnd(0, 75);
};
}
private function handleButtonMenu(_arg1:MouseEvent):void{
switch (_arg1.type){
case MouseEvent.MOUSE_OVER:
SoundUtil.playSFX("sndOver");
break;
case MouseEvent.MOUSE_UP:
SoundUtil.playSFX("sndClick");
switch (_arg1.target.name){
case "btnGYW":
this.showSubscreen();
SubMain.getInstance().showScreen("about");
break;
case "btnPlay":
this.showSubscreen();
SubMain.getInstance().showScreen("level");
break;
case "btnMedals":
this.showSubscreen();
SubMain.getInstance().showScreen("medal");
break;
case "btnMore":
case "btnZeppelin":
SubMain.getInstance().moreGames();
break;
case "btnSound":
this._mcSound.gotoAndStop((SoundUtil.getInstance().bEnabled) ? 2 : 1);
SoundUtil.getInstance().setEnabled(!(SoundUtil.getInstance().bEnabled), 1);
break;
};
break;
};
}
}
}//package
Section 84
//ScreenStory (ScreenStory)
package {
import de.drygoods.Util.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import de.drygoods.Graphics.*;
import flash.filters.*;
public class ScreenStory extends MovieClip {
public var txtBack:TextField;
public var btnPlay:SimpleButton;
public function ScreenStory(_arg1:Boolean=false){
this.name = "mcStory";
if (_arg1){
trace("story screen");
this.init();
};
}
private function takeBluredScreenshot(_arg1:Number=0):Bitmap{
var _local2:BitmapData;
var _local3:Bitmap;
_local2 = new BitmapData(640, 480, false, 0);
this.filters = [new BlurFilter(10, 10, BitmapFilterQuality.MEDIUM)];
_local2.draw(this);
this.filters = [];
_local3 = new Bitmap(_local2);
ColorUtil.setBrightness2(_local3, _arg1, _arg1, _arg1);
return (_local3);
}
private function init():void{
EventUtil.setButtonEvents((this.getChildByName("btnPlay") as SimpleButton), this.handleButtonMenu);
this.alpha = 0;
TweenUtil.to(this, 0.5, {alpha:1});
SoundUtil.playSFX("musicWind");
}
public function exit(){
EventUtil.setButtonEvents((this.getChildByName("btnPlay") as SimpleButton), this.handleButtonMenu, false);
}
private function handleButtonMenu(_arg1:MouseEvent):void{
switch (_arg1.type){
case MouseEvent.MOUSE_OVER:
SoundUtil.playSFX("sndOver");
break;
case MouseEvent.MOUSE_UP:
SoundUtil.playSFX("sndClick");
switch (_arg1.target.name){
case "btnPlay":
this.exit();
SubMain.getInstance().showScreen("menu");
TweenUtil.to(this, 0.5, {alpha:0, onComplete:SubMain.getInstance().showScreen, onCompleteParams:["story_remove"]});
break;
};
break;
};
}
}
}//package
Section 85
//ScreenTransition (ScreenTransition)
package {
import flash.events.*;
import flash.display.*;
public class ScreenTransition extends MovieClip {
private var _strRemove:String;
private var _strNext:String;
public function ScreenTransition(_arg1:String="", _arg2:String=""){
this.name = "mcTrans";
this.stop();
if (((!((_arg1 == ""))) && (!((_arg2 == ""))))){
this._strRemove = _arg1;
this._strNext = _arg2;
this.init();
};
}
private function init():void{
this.play();
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
private function exit():void{
this.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
SubMain.getInstance().showScreen("remove_transition");
}
private function onEnterFrame(_arg1:Event):void{
if (this.currentFrame == 20){
trace(">", this._strRemove);
trace(">>", this._strNext);
SubMain.getInstance().showScreen(this._strRemove);
SubMain.getInstance().showScreen(this._strNext);
};
if (this.currentFrame == this.totalFrames){
this.stop();
this.exit();
};
}
}
}//package
Section 86
//sndBeamIn (sndBeamIn)
package {
import flash.media.*;
public dynamic class sndBeamIn extends Sound {
}
}//package
Section 87
//sndBeamOut (sndBeamOut)
package {
import flash.media.*;
public dynamic class sndBeamOut extends Sound {
}
}//package
Section 88
//sndBolts (sndBolts)
package {
import flash.media.*;
public dynamic class sndBolts extends Sound {
}
}//package
Section 89
//sndClick (sndClick)
package {
import flash.media.*;
public dynamic class sndClick extends Sound {
}
}//package
Section 90
//sndCollect (sndCollect)
package {
import flash.media.*;
public dynamic class sndCollect extends Sound {
}
}//package
Section 91
//sndDing (sndDing)
package {
import flash.media.*;
public dynamic class sndDing extends Sound {
}
}//package
Section 92
//sndErrorA (sndErrorA)
package {
import flash.media.*;
public dynamic class sndErrorA extends Sound {
}
}//package
Section 93
//sndErrorB (sndErrorB)
package {
import flash.media.*;
public dynamic class sndErrorB extends Sound {
}
}//package
Section 94
//sndExit (sndExit)
package {
import flash.media.*;
public dynamic class sndExit extends Sound {
}
}//package
Section 95
//sndHelp (sndHelp)
package {
import flash.media.*;
public dynamic class sndHelp extends Sound {
}
}//package
Section 96
//sndMove_1 (sndMove_1)
package {
import flash.media.*;
public dynamic class sndMove_1 extends Sound {
}
}//package
Section 97
//sndMove_2 (sndMove_2)
package {
import flash.media.*;
public dynamic class sndMove_2 extends Sound {
}
}//package
Section 98
//sndMove_3 (sndMove_3)
package {
import flash.media.*;
public dynamic class sndMove_3 extends Sound {
}
}//package
Section 99
//sndNuts (sndNuts)
package {
import flash.media.*;
public dynamic class sndNuts extends Sound {
}
}//package
Section 100
//sndOver (sndOver)
package {
import flash.media.*;
public dynamic class sndOver extends Sound {
}
}//package
Section 101
//sndStart (sndStart)
package {
import flash.media.*;
public dynamic class sndStart extends Sound {
}
}//package
Section 102
//SubMain (SubMain)
package {
import com.medalyourway.DataType.*;
import de.drygoods.Util.*;
import flash.display.*;
import com.medalyourway.*;
import flash.external.*;
import flash.net.*;
public class SubMain {
private var _objData:Object;
private var _mywPlayer:mywUserHandle;
private var _spMain:Sprite;
private var _stage:Stage;
public static const FPS:int = 30;
private static var _allowInstantiation:Boolean;
private static var _instance:SubMain;
public function SubMain():void{
if (!SubMain._allowInstantiation){
throw (new Error("Error: Instantiation failed: Use SubMain.getInstance() instead of new."));
};
}
public function get width():int{
return (640);
}
public function getScoreTotal():void{
var _local1:int;
SubMain.getInstance().mywPlayer.data.iScore = 0;
_local1 = 0;
while (_local1 < this._mywPlayer.data.aLevelScore.length) {
SubMain.getInstance().mywPlayer.data.iScore = (SubMain.getInstance().mywPlayer.data.iScore + this._mywPlayer.data.aLevelScore[_local1]);
_local1++;
};
}
public function showScreen(_arg1:String):void{
var _local2:MovieClip;
trace("show screen:", _arg1);
switch (_arg1){
case "intro":
this._spMain.addChildAt(new ScreenIntro(true), 0);
break;
case "remove_intro":
this._spMain.removeChild(this._spMain.getChildByName("mcIntro"));
break;
case "story":
this._spMain.addChildAt(new ScreenStory(true), 0);
break;
case "story_remove":
this._spMain.removeChild(this._spMain.getChildByName("mcStory"));
break;
case "extro":
this._spMain.addChildAt(new ScreenExtro(true), 0);
break;
case "extro_remove":
this._spMain.removeChild(this._spMain.getChildByName("mcExtro"));
break;
case "game":
this._spMain.addChildAt(new ScreenGame(0), 0);
break;
case "game_remove":
this._spMain.removeChild(this._spMain.getChildByName("mcGame"));
break;
case "menu":
this._spMain.addChildAt(new ScreenMenu(0), 0);
break;
case "menu_activate":
(this._spMain.getChildByName("mcMenu") as ScreenMenu).activate();
break;
case "menu_remove":
this._spMain.removeChild(this._spMain.getChildByName("mcMenu"));
break;
case "about":
this._spMain.addChild(new ScreenAbout(0));
break;
case "about_remove":
this._spMain.removeChild(this._spMain.getChildByName("mcAbout"));
break;
case "level":
this._spMain.addChild(new ScreenLevel(0));
break;
case "level_remove":
this._spMain.removeChild(this._spMain.getChildByName("mcLevel"));
break;
case "medal":
this._spMain.addChild(new ScreenMedal(0));
break;
case "medal_remove":
this._spMain.removeChild(this._spMain.getChildByName("mcMedal"));
break;
case "remove_transition":
this._spMain.removeChild(this._spMain.getChildByName("mcTrans"));
break;
case "remove_menu_level":
(this._spMain.getChildByName("mcMenu") as ScreenMenu).exit();
this._spMain.removeChild(this._spMain.getChildByName("mcLevel"));
this._spMain.removeChild(this._spMain.getChildByName("mcMenu"));
break;
};
}
public function get mywPlayer():mywUserHandle{
return (this._mywPlayer);
}
public function saveData():void{
var _local1:SharedObject;
trace("saving data");
_local1 = SharedObject.getLocal("nutsnbolts");
_local1.data.myw = this._mywPlayer.getSaveData();
_local1.data.lvl = this._mywPlayer.data.strLevel;
_local1.data.sco = this._mywPlayer.data.aLevelScore.toString();
_local1.data.nut = this._mywPlayer.data.aNut.toString();
_local1.flush();
}
public function get objData():Object{
return (this._objData);
}
private function addMedal():void{
var _local1:MovieClip;
var _local2:String;
if (this._mywPlayer.aMedalCache.length > 0){
_local2 = this._mywPlayer.aMedalCache.shift();
SoundUtil.playSFX("sndDing");
_local1 = new MedalBadge(_local2, this.hideMedal);
_local1.name = "medalBadge";
_local1.mouseChildren = false;
_local1.mouseEnabled = false;
this._spMain.parent.addChild(_local1);
};
}
public function init(_arg1:Sprite, _arg2:Stage):void{
this._spMain = _arg1;
this._stage = _arg2;
this._objData = new Object();
this.initSound();
this._mywPlayer = new mywUserHandle();
this._mywPlayer.data.iPlayTime = 0;
this._mywPlayer.data.iCurrentLevel = 0;
this._mywPlayer.data.strLevel = "(0)";
this._mywPlayer.data.aLevelScore = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
this._mywPlayer.data.aNut = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
this._mywPlayer.data.iScore = 0;
this._mywPlayer.data.iTime = 0;
this._mywPlayer.data.iPlays = 0;
this._mywPlayer.data.onpar = 0;
this._mywPlayer.addMedal("m1", "Nuts", "Introducing Nuts", "(0,0,74,74)", mywMedalData.MEDALTYPE_BRONZE);
this._mywPlayer.addMedal("m2", "Bolts", "Introducing Bolts", "(0,74,74,74)", mywMedalData.MEDALTYPE_BRONZE);
this._mywPlayer.addMedal("m3", "Teamwork", "Using Nuts and Bolts", "(0,148,74,74)", mywMedalData.MEDALTYPE_BRONZE);
this._mywPlayer.addMedal("m4", "All mine", "Collected 25 nuts", "(0,222,74,74)", mywMedalData.MEDALTYPE_SILVER);
this._mywPlayer.addMedal("m5", "Lasts longer", "Played for an hour", "(0,296,74,74)", mywMedalData.MEDALTYPE_BRONZE);
this._mywPlayer.addMedal("m6", "Half way through", "Reached level 15", "(0,370,74,74)", mywMedalData.MEDALTYPE_BRONZE);
this._mywPlayer.addMedal("m7", "Sometimes", "they come back ...", "(0,444,74,74)", mywMedalData.MEDALTYPE_BRONZE);
this._mywPlayer.addMedal("m8", "GYW ?", "Visited the GYW site", "(0,518,74,74)", mywMedalData.MEDALTYPE_BRONZE);
this._mywPlayer.addMedal("m9", "Grand Prize", "Scored 25,000", "(0,592,74,74)", mywMedalData.MEDALTYPE_GOLD);
this._mywPlayer.addMedal("m10", "To be continued", "Reached the last level", "(0,666,74,74)", mywMedalData.MEDALTYPE_GOLD);
this._mywPlayer.addMedal("m11", "CO2 neutral", "finished a level with some energy left", "(0,740,74,74)", mywMedalData.MEDALTYPE_BRONZE);
this._mywPlayer.addMedal("m12", "On par", "10 levels finished on par", "(0,814,74,74)", mywMedalData.MEDALTYPE_SILVER);
this.readData();
if (this._mywPlayer.data.strLevel == ""){
this._mywPlayer.data.strLevel = 0;
};
}
private function hideMedal():void{
this._spMain.parent.removeChild(this._spMain.parent.getChildByName("medalBadge"));
this.addMedal();
}
public function get stageMain():Stage{
return (this._stage);
}
private function initSound():void{
var _local1:SoundUtil;
_local1 = SoundUtil.getInstance();
_local1.init(true, 1);
_local1.add("musicMenu", true);
_local1.add("musicWind", true);
_local1.add("sndBeamIn", false);
_local1.add("sndBeamOut", false);
_local1.add("sndMove_1", false);
_local1.add("sndMove_2", false);
_local1.add("sndMove_3", false);
_local1.add("sndClick", false);
_local1.add("sndOver", false);
_local1.add("sndErrorA", false);
_local1.add("sndErrorB", false);
_local1.add("sndDing", false);
_local1.add("sndStart", false);
_local1.add("sndExit", false);
_local1.add("sndHelp", false);
_local1.add("sndCollect", false);
_local1.add("sndNuts", false);
_local1.add("sndBolts", false);
}
public function readData():void{
var _local1:SharedObject;
var _local2:String;
var _local3:Array;
var _local4:int;
trace("reading data");
_local1 = SharedObject.getLocal("nutsnbolts");
this._mywPlayer.readSaveData(_local1.data.myw);
if (_local1.data.lvl != null){
if (_local1.data.lvl != ""){
_local2 = _local1.data.lvl;
trace("lvl:", _local2);
if (_local2.lastIndexOf("(") == -1){
this._mywPlayer.data.strLevel = "(0)";
} else {
this._mywPlayer.data.strLevel = _local2;
};
};
};
if (_local1.data.sco != null){
if (_local1.data.sco != ""){
_local2 = _local1.data.sco;
trace("sco:", _local2);
if (_local2.indexOf(",") == -1){
this._mywPlayer.data.aLevelScore = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
} else {
_local3 = _local2.split(",");
this._mywPlayer.data.aLevelScore = [];
_local4 = 0;
while (_local4 < _local3.length) {
this._mywPlayer.data.aLevelScore[_local4] = StrUtil.cInt(_local3[_local4]);
_local4++;
};
this.getScoreTotal();
};
};
} else {
this._mywPlayer.data.aLevelScore = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
};
if (_local1.data.nut != null){
if (_local1.data.nut != ""){
_local2 = _local1.data.nut;
trace("nut:", _local2);
if (_local2.indexOf(",") == -1){
this._mywPlayer.data.aNut = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
} else {
_local3 = _local2.split(",");
this._mywPlayer.data.aNut = [];
_local4 = 0;
while (_local4 < _local3.length) {
this._mywPlayer.data.aNut[_local4] = StrUtil.cInt(_local3[_local4]);
_local4++;
};
};
};
} else {
this._mywPlayer.data.aNut = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
};
}
public function resetScores():void{
var _local1:int;
_local1 = 0;
while (_local1 < this._mywPlayer.data.aLevelScore.length) {
this._mywPlayer.data.aLevelScore[_local1] = 0;
this._mywPlayer.data.aNut[_local1] = 0;
_local1++;
};
this.getScoreTotal();
this.saveData();
}
public function showTrans(_arg1:String, _arg2:String):void{
this._spMain.addChild(new ScreenTransition(_arg2, _arg1));
}
public function moreGames():void{
var link:String;
trace("more games");
link = "http://www.maxgames.com/";
try {
ExternalInterface.call("window.open", link, "_blank", "");
} catch(error:Error) {
navigateToURL(new URLRequest(link), "_blank");
};
}
public function getNutTotal():int{
var _local1:int;
var _local2:int;
_local2 = 0;
_local1 = 0;
while (_local1 < this._mywPlayer.data.aNut.length) {
_local2 = (_local2 + this._mywPlayer.data.aNut[_local1]);
_local1++;
};
return (_local2);
}
public function get spMain():Sprite{
return (this._spMain);
}
public function showMedal(_arg1:String):void{
var _local2:int;
var _local3:int;
_local3 = -1;
_local2 = 0;
while (_local2 < this._mywPlayer.aMedalCache.length) {
if (this._mywPlayer.aMedalCache[_local2] == _arg1){
_local3 = _local2;
break;
};
_local2++;
};
if (_local3 == -1){
this._mywPlayer.aMedalCache.push(_arg1);
};
this.addMedal();
this.saveData();
}
public static function getInstance():SubMain{
if (SubMain._instance == null){
SubMain._allowInstantiation = true;
SubMain._instance = new (SubMain);
SubMain._allowInstantiation = false;
};
return (SubMain._instance);
}
}
}//package