Section 1
//HighScoreEvent (com.chris.AS3.events.HighScoreEvent)
package com.chris.AS3.events {
import flash.events.*;
public class HighScoreEvent extends Event {
private var _first:int;
private var _end:int;
public static const CHANGE:String = "change";
public function HighScoreEvent(_arg1:String, _arg2:int, _arg3:int):void{
super(_arg1, false, false);
_first = _arg2;
_end = _arg3;
}
public function get first():int{
return (_first);
}
public function get end():int{
return (_end);
}
}
}//package com.chris.AS3.events
Section 2
//XMLLoader (com.chris.AS3.loaders.XMLLoader)
package com.chris.AS3.loaders {
import flash.events.*;
import flash.net.*;
public class XMLLoader extends URLLoader {
private var _request:URLRequest;
private var _xml:XML;
private var _name:String;
public function XMLLoader():void{
_request = new URLRequest();
_name = "";
initInternalEvents();
}
private function onProgress(_arg1:ProgressEvent):void{
}
public function get name():String{
return (_name);
}
private function onInit(_arg1:Event):void{
}
public function get xml():XML{
return (_xml);
}
private function onError(_arg1:IOErrorEvent):void{
}
public function loadXML(_arg1:String, _arg2:String="loadXML"):void{
_request.url = _arg1;
_name = _arg2;
load(_request);
}
private function initInternalEvents():void{
addEventListener(Event.INIT, onInit);
addEventListener(Event.COMPLETE, onComplete);
addEventListener(IOErrorEvent.IO_ERROR, onError);
addEventListener(ProgressEvent.PROGRESS, onProgress);
}
private function onComplete(_arg1:Event):void{
_xml = new XML(data);
}
}
}//package com.chris.AS3.loaders
Section 3
//FlashVars (com.chris.AS3.net.FlashVars)
package com.chris.AS3.net {
import flash.display.*;
public class FlashVars {
public static var _data:Object;
public static function init(_arg1:DisplayObject):void{
_data = LoaderInfo(_arg1.loaderInfo).parameters;
}
public static function get data():Object{
return (_data);
}
}
}//package com.chris.AS3.net
Section 4
//HighScoreList (com.chris.AS3.net.HighScoreList)
package com.chris.AS3.net {
import flash.events.*;
import com.chris.AS3.events.*;
public class HighScoreList extends EventDispatcher {
public var size:int;
private var first:int;
private var maxElements:int;
public function HighScoreList():void{
size = 0;
first = 0;
maxElements = 0;
}
public function get maxPages():int{
var _local1:int;
var _local2:Number;
_local1 = (size - 1);
_local2 = Math.floor((_local1 / maxElements));
return (_local2);
}
public function next():void{
first = (first + maxElements);
if (first >= size){
if (size <= maxElements){
first = 0;
} else {
first = (first - maxElements);
};
};
buildList();
}
public function init(_arg1:int, _arg2:int):void{
maxElements = _arg1;
size = _arg2;
buildList();
}
public function get page():int{
var _local1:int;
var _local2:Number;
var _local3:Number;
_local1 = (size - 1);
_local2 = (_local1 / maxElements);
_local3 = ((first + 1) / _local1);
return (Math.floor((_local3 * _local2)));
}
public function last():void{
first = (maxPages * maxElements);
buildList();
}
public function start():void{
first = 0;
buildList();
}
public function buildList():void{
var _local1:int;
var _local2:int;
if (size == 0){
trace("size is 0");
} else {
_local1 = (size - first);
_local2 = Math.min((first + maxElements), (first + _local1));
};
dispatchEvent(new HighScoreEvent(HighScoreEvent.CHANGE, first, _local2));
}
public function prev():void{
first = (first - maxElements);
if (first < 0){
first = 0;
};
buildList();
}
}
}//package com.chris.AS3.net
Section 5
//HighScoreLoader (com.chris.AS3.net.HighScoreLoader)
package com.chris.AS3.net {
import flash.events.*;
import com.chris.AS3.loaders.*;
public class HighScoreLoader extends EventDispatcher {
private var loader:XMLLoader;
private var data:XMLList;
public function HighScoreLoader():void{
loader = new XMLLoader();
}
public function getScoreXML(_arg1:int):XML{
return (data[_arg1]);
}
public function get scoreData():XMLList{
return (data);
}
public function loadScores(_arg1:int):void{
var _local2:int;
var _local3:String;
var _local4:String;
_local2 = (Math.random() * 1000000000);
_local3 = "0";
_local4 = ((((("http://stats.soap.com.au/highscore/highscoreXML.php?gameid=" + _arg1) + "&start=0&count=100&today=") + _local3) + "&cacheB=") + _local2);
loader.addEventListener(Event.COMPLETE, parse, false, 0, true);
loader.loadXML(_local4, "loadHighScores");
}
private function parse(_arg1:Event):void{
data = loader.xml.entry;
dispatchEvent(_arg1);
}
public function get scoresNum():int{
return (data.length());
}
}
}//package com.chris.AS3.net
Section 6
//TextUtil (com.chris.AS3.utils.TextUtil)
package com.chris.AS3.utils {
public class TextUtil {
public function TextUtil():void{
}
public static function formatScoreComma(_arg1:Number):String{
var _local2:String;
var _local3:int;
var _local4:String;
var _local5:int;
var _local6:*;
_local2 = _arg1.toString();
_local3 = _local2.length;
_local4 = "";
if (_local3 > 3){
_local5 = (_local3 % 3);
_local6 = 0;
while (_local6 < _local3) {
if (((((((_local6 % 3) == _local5)) && (!((_local6 == (_local3 - 1)))))) && (!((_local6 == 0))))){
_local4 = (_local4 + ",");
};
_local4 = (_local4 + _local2.charAt(_local6));
_local6++;
};
} else {
_local4 = (_local4 + _local2);
};
return (_local4);
}
public static function formatTime(_arg1:Number, _arg2:String, _arg3:String):String{
var _local4:int;
var _local5:int;
var _local6:String;
var _local7:String;
_local4 = (int((_arg1 / 60)) % 60);
_local5 = (int(_arg1) % 60);
_local6 = ((_local4 < 10)) ? (_arg2 + _local4.toString()) : _local4.toString();
_local7 = ((_local5 < 10)) ? (_arg3 + _local5.toString()) : _local5.toString();
return (((_local6 + ":") + _local7));
}
}
}//package com.chris.AS3.utils
Section 7
//FpsBox (com.efnx.fps.FpsBox)
package com.efnx.fps {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class FpsBox extends TextField {
protected var format:TextFormat;
protected var averageArray:Array;
protected var targetFPS:int;// = 0
protected var frames:uint;// = 0
public function FpsBox(... _args){
var _local2:Timer;
frames = 0;
format = new TextFormat();
averageArray = new Array();
targetFPS = 0;
super();
_local2 = new Timer(1000);
format.font = "Verdana";
format.color = 0;
format.size = 10;
this.autoSize = TextFieldAutoSize.LEFT;
this.defaultTextFormat = format;
this.text = "-- FPS ---- AV";
_local2.addEventListener(TimerEvent.TIMER, tick);
if ((_args[0] is Stage)){
_args[0].addEventListener(Event.ENTER_FRAME, everyFrame, false, 0, true);
targetFPS = _args[0].frameRate;
} else {
this.addEventListener(Event.ENTER_FRAME, everyFrame, false, 0, true);
};
_local2.start();
}
public function everyFrame(_arg1:Event):void{
frames++;
}
protected function tick(_arg1:TimerEvent):void{
var _local2:int;
averageArray.push(frames);
if (averageArray.length == 4){
_local2 = 1;
while (_local2 < averageArray.length) {
averageArray[0] = (averageArray[0] + averageArray[_local2]);
_local2++;
};
averageArray.splice(1, (averageArray.length - 1));
averageArray[0] = (averageArray[0] / 4);
};
this.text = (((frames + " FPS ") + Math.round(averageArray[0])) + " AV");
if (targetFPS != 0){
this.appendText((" /" + targetFPS));
};
frames = 0;
}
}
}//package com.efnx.fps
Section 8
//TweenFilterLite (com.gs.TweenFilterLite)
package com.gs {
import flash.display.*;
import flash.filters.*;
public class TweenFilterLite extends TweenLite {
private var _endMatrix:Array;
private var _hf:Boolean;// = false
private var _matrix:Array;
private var _cmf:ColorMatrixFilter;
private var _clrsa:Array;
private var _filters:Array;
public static var defaultEase:Function = TweenLite.defaultEase;
private static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
private static var _lumB:Number = 0.072169;
public static var version:Number = 7.07;
public static var delayedCall:Function = TweenLite.delayedCall;
public static var killTweensOf:Function = TweenLite.killTweensOf;
private static var _lumG:Number = 0.71516;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _lumR:Number = 0.212671;
public function TweenFilterLite(_arg1:Object, _arg2:Number, _arg3:Object){
_hf = false;
_filters = [];
super(_arg1, _arg2, _arg3);
if ((((TweenLite.version < 6.12)) || (isNaN(TweenLite.version)))){
trace("ERROR! Please update your TweenLite class. TweenFilterLite requires a more recent version. Download updates at http://www.TweenLite.com.");
};
if (_arg3.type != undefined){
trace((("TweenFilterLite error: " + _arg1) + " is using deprecated syntax. Please update to the new syntax. See http://www.TweenFilterLite.com for details."));
};
}
override public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:uint;
var _local4:Object;
var _local5:Object;
var _local6:Object;
_clrsa = [];
_filters = [];
_matrix = _idMatrix.slice();
_arg2 = (_arg2 + " blurFilter glowFilter colorMatrixFilter dropShadowFilter bevelFilter ");
if ((this.target is DisplayObject)){
if (this.vars.blurFilter != undefined){
_local4 = this.vars.blurFilter;
addFilter("blur", _local4, BlurFilter, ["blurX", "blurY", "quality"], new BlurFilter(0, 0, ((_local4.quality) || (2))));
};
if (this.vars.glowFilter != undefined){
_local4 = this.vars.glowFilter;
addFilter("glow", _local4, GlowFilter, ["alpha", "blurX", "blurY", "color", "quality", "strength", "inner", "knockout"], new GlowFilter(0xFFFFFF, 0, 0, 0, ((_local4.strength) || (1)), ((_local4.quality) || (2)), _local4.inner, _local4.knockout));
};
if (this.vars.colorMatrixFilter != undefined){
_local4 = this.vars.colorMatrixFilter;
_local5 = addFilter("colorMatrix", _local4, ColorMatrixFilter, [], new ColorMatrixFilter(_matrix));
_cmf = _local5.filter;
_matrix = ColorMatrixFilter(_cmf).matrix;
if (((!((_local4.matrix == undefined))) && ((_local4.matrix is Array)))){
_endMatrix = _local4.matrix;
} else {
if (_local4.relative == true){
_endMatrix = _matrix.slice();
} else {
_endMatrix = _idMatrix.slice();
};
_endMatrix = setBrightness(_endMatrix, _local4.brightness);
_endMatrix = setContrast(_endMatrix, _local4.contrast);
_endMatrix = setHue(_endMatrix, _local4.hue);
_endMatrix = setSaturation(_endMatrix, _local4.saturation);
_endMatrix = setThreshold(_endMatrix, _local4.threshold);
if (!isNaN(_local4.colorize)){
_endMatrix = colorize(_endMatrix, _local4.colorize, _local4.amount);
} else {
if (!isNaN(_local4.color)){
_endMatrix = colorize(_endMatrix, _local4.color, _local4.amount);
};
};
};
_local3 = 0;
while (_local3 < _endMatrix.length) {
if (((!((_matrix[_local3] == _endMatrix[_local3]))) && (!((_matrix[_local3] == undefined))))){
this.tweens[("tfl_mtx" + _local3)] = {o:_matrix, p:_local3.toString(), s:_matrix[_local3], c:(_endMatrix[_local3] - _matrix[_local3])};
};
_local3++;
};
};
if (this.vars.dropShadowFilter != undefined){
_local4 = this.vars.dropShadowFilter;
addFilter("dropShadow", _local4, DropShadowFilter, ["alpha", "angle", "blurX", "blurY", "color", "distance", "quality", "strength", "inner", "knockout", "hideObject"], new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_local4.quality) || (2)), _local4.inner, _local4.knockout, _local4.hideObject));
};
if (this.vars.bevelFilter != undefined){
_local4 = this.vars.bevelFilter;
addFilter("bevel", _local4, BevelFilter, ["angle", "blurX", "blurY", "distance", "highlightAlpha", "highlightColor", "quality", "shadowAlpha", "shadowColor", "strength"], new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_local4.quality) || (2))));
};
if (this.vars.runBackwards == true){
_local3 = 0;
while (_local3 < _clrsa.length) {
_local6 = _clrsa[_local3];
_clrsa[_local3].sr = (_local6.sr + _local6.cr);
_local6.cr = (_local6.cr * -1);
_local6.sg = (_local6.sg + _local6.cg);
_local6.cg = (_local6.cg * -1);
_local6.sb = (_local6.sb + _local6.cb);
_local6.cb = (_local6.cb * -1);
_local6.f[_local6.p] = (((_local6.sr << 16) | (_local6.sg << 8)) | _local6.sb);
_local3++;
};
};
super.initTweenVals(true, _arg2);
} else {
super.initTweenVals(_arg1, _arg2);
};
}
override public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local6:String;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:int;
var _local11:Array;
_local2 = ((_arg1 - this.startTime) / 1000);
if (_local2 > this.duration){
_local2 = this.duration;
};
_local3 = this.vars.ease(_local2, 0, 1, this.duration);
for (_local6 in this.tweens) {
_local4 = this.tweens[_local6];
_local4.o[_local4.p] = (_local4.s + (_local3 * _local4.c));
};
if (_hf){
_local5 = 0;
while (_local5 < _clrsa.length) {
_local4 = _clrsa[_local5];
_local7 = (_local4.sr + (_local3 * _local4.cr));
_local8 = (_local4.sg + (_local3 * _local4.cg));
_local9 = (_local4.sb + (_local3 * _local4.cb));
_local4.f[_local4.p] = (((_local7 << 16) | (_local8 << 8)) | _local9);
_local5++;
};
if (_cmf != null){
ColorMatrixFilter(_cmf).matrix = _matrix;
};
_local11 = this.target.filters;
_local5 = 0;
while (_local5 < _filters.length) {
_local10 = (_local11.length - 1);
while (_local10 > -1) {
if ((_local11[_local10] is _filters[_local5].type)){
_local11.splice(_local10, 1, _filters[_local5].filter);
break;
};
_local10--;
};
_local5++;
};
this.target.filters = _local11;
};
if (_hst){
_local5 = 0;
while (_local5 < _subTweens.length) {
_subTweens[_local5].proxy(_subTweens[_local5]);
_local5++;
};
};
if (this.vars.onUpdate != null){
this.vars.onUpdate.apply(this.vars.onUpdateScope, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
super.complete(true);
};
}
private function addFilter(_arg1:String, _arg2:Object, _arg3:Class, _arg4:Array, _arg5:BitmapFilter):Object{
var _local6:Object;
var _local7:Array;
var _local8:int;
var _local9:String;
var _local10:Number;
var _local11:Object;
var _local12:Object;
_local6 = {type:_arg3};
_local7 = this.target.filters;
_local8 = 0;
while (_local8 < _local7.length) {
if ((_local7[_local8] is _arg3)){
_local6.filter = _local7[_local8];
break;
};
_local8++;
};
if (_local6.filter == undefined){
_local6.filter = _arg5;
_local7.push(_local6.filter);
this.target.filters = _local7;
};
_local8 = 0;
while (_local8 < _arg4.length) {
_local9 = _arg4[_local8];
if (_arg2[_local9] != undefined){
if ((((((_local9 == "color")) || ((_local9 == "highlightColor")))) || ((_local9 == "shadowColor")))){
_local11 = HEXtoRGB(_local6.filter[_local9]);
_local12 = HEXtoRGB(_arg2[_local9]);
_clrsa.push({f:_local6.filter, p:_local9, sr:_local11.rb, cr:(_local12.rb - _local11.rb), sg:_local11.gb, cg:(_local12.gb - _local11.gb), sb:_local11.bb, cb:(_local12.bb - _local11.bb)});
} else {
if ((((((((_local9 == "quality")) || ((_local9 == "inner")))) || ((_local9 == "knockout")))) || ((_local9 == "hideObject")))){
_local6.filter[_local9] = _arg2[_local9];
} else {
if (typeof(_arg2[_local9]) == "number"){
_local10 = (_arg2[_local9] - _local6.filter[_local9]);
} else {
_local10 = Number(_arg2[_local9]);
};
this.tweens[(("tfl_" + _arg1) + _local8)] = {o:_local6.filter, p:_local9, s:_local6.filter[_local9], c:_local10};
};
};
};
_local8++;
};
_filters.push(_local6);
_hf = true;
return (_local6);
}
public function HEXtoRGB(_arg1:Number):Object{
return ({rb:(_arg1 >> 16), gb:((_arg1 >> 8) & 0xFF), bb:(_arg1 & 0xFF)});
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
var _local3:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
_local3 = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=100):Array{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
_local4 = (((_arg2 >> 16) & 0xFF) / 0xFF);
_local5 = (((_arg2 >> 8) & 0xFF) / 0xFF);
_local6 = ((_arg2 & 0xFF) / 0xFF);
_local7 = (1 - _arg3);
_local8 = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_local3 = (1 - _arg2);
_local4 = (_local3 * _lumR);
_local5 = (_local3 * _lumG);
_local6 = (_local3 * _lumB);
_local7 = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
_local3 = [];
_local4 = 0;
_local5 = 0;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
_arg3.runBackwards = true;
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
var _local3:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_local3 = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
_local3 = Math.cos(_arg2);
_local4 = Math.sin(_arg2);
_local5 = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
}
}//package com.gs
Section 9
//TweenLite (com.gs.TweenLite)
package com.gs {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
public class TweenLite {
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;
private static var _timer:Timer = new Timer(2000);
private static var _classInitted:Boolean;
public static var defaultEase:Function = TweenLite.easeOut;
public static var version:Number = 6.12;
private static var _sprite:Sprite = new Sprite();
protected static var _all:Dictionary = new Dictionary();
public static var killDelayedCallsTo:Function = killTweensOf;
protected static var _curTime:uint;
private static var _listening:Boolean;
public function TweenLite(_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 = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
};
this.tweens = {};
_subTweens = [];
_hst = (_initted = false);
_active = (((_arg2 == 0)) && ((this.delay == 0)));
if (!_classInitted){
_curTime = getTimer();
_sprite.addEventListener(Event.ENTER_FRAME, executeAll);
_classInitted = true;
};
this.initTime = _curTime;
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (_active))){
initTweenVals();
this.startTime = _curTime;
if (_active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
};
if (((!(_listening)) && (!(_active)))){
_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:ColorTransform;
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 == "proxiedEase")))) || ((_local4 == "easeParams")))) || (((_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] == ""))))) || ((this.vars[_local4] == 0)))){
_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 (((_curTime - 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){
if (!_initted){
initTweenVals();
};
render((this.startTime + (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 easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function frameProxy(_arg1:Object):void{
_arg1.info.target.gotoAndStop(Math.round(_arg1.target.frame));
}
public static function removeTween(_arg1:TweenLite=null):void{
if (((!((_arg1 == null))) && (!((_all[_arg1.target] == undefined))))){
delete _all[_arg1.target][_arg1];
};
}
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];
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, onCompleteScope:_arg4, overwrite:false}));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_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 = (_curTime = getTimer());
if (_listening){
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;
};
};
};
};
};
}
public static function volumeProxy(_arg1:Object):void{
_arg1.info.target.soundTransform = _arg1.target;
}
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){
_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):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package com.gs
Section 10
//ButtonSet (com.markdavies.control.ButtonSet)
package com.markdavies.control {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class ButtonSet extends EventDispatcher {
private var _buttonSet:Dictionary;
public function ButtonSet(){
_buttonSet = new Dictionary();
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:*;
if (!_buttonSet[_arg1.target]){
return;
};
_local2 = _buttonSet[_arg1.target];
if (_local2.downHandler != null){
_local2.downHandler(_local2.event);
};
}
private function mouseOutHandler(_arg1:MouseEvent):void{
var _local2:*;
if (!_buttonSet[_arg1.target]){
return;
};
_local2 = _buttonSet[_arg1.target];
if (_local2.outHandler != null){
_local2.outHandler(_local2.event);
};
}
public function removeButton(_arg1:MovieClip):void{
_arg1.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
_arg1.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
_arg1.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
_arg1.mouseEnabled = false;
_arg1.buttonMode = false;
delete _buttonSet[_arg1];
}
public function addButton(_arg1:MovieClip, _arg2:Function, _arg3:Function, _arg4:Function, _arg5):void{
_buttonSet[_arg1] = {overHandler:_arg2, downHandler:_arg3, outHandler:_arg4, event:_arg5};
_arg1.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
_arg1.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
_arg1.mouseEnabled = true;
_arg1.buttonMode = true;
_arg1.mouseChildren = false;
}
private function mouseOverHandler(_arg1:MouseEvent):void{
var _local2:*;
if (!_buttonSet[_arg1.target]){
return;
};
_local2 = _buttonSet[_arg1.target];
if (_local2.overHandler != null){
_local2.overHandler(_local2.event);
};
}
}
}//package com.markdavies.control
Section 11
//DebugBox (com.markdavies.debug.DebugBox)
package com.markdavies.debug {
import flash.text.*;
import com.efnx.fps.*;
import flash.system.*;
public class DebugBox extends TextField {
protected var format:TextFormat;
private var variablesArray:Array;
private var fps:FpsBox;
private static var instance:DebugBox;
public function DebugBox(){
variablesArray = new Array();
format = new TextFormat();
super();
if (instance){
throw (new Error("DebugBox can only be accessed through DebugBox.getInstance()"));
};
}
public function setup():void{
format.font = "Verdana";
format.color = 0;
format.size = 10;
this.autoSize = TextFieldAutoSize.LEFT;
this.defaultTextFormat = format;
this.background = true;
this.backgroundColor = 0xFFFFFF;
fps = new FpsBox(instance.stage);
}
public function render():void{
var _local1:String;
var _local2:String;
_local1 = "";
variablesArray["AA FPS"] = (fps.text + " fps");
variablesArray["AA MEMORY"] = (Math.round((System.totalMemory / 0x100000)) + " Mb");
for (_local2 in variablesArray) {
_local1 = ((((_local2 + ": ") + variablesArray[_local2]) + "\n") + _local1);
};
this.text = _local1;
}
public static function debug(_arg1:String, _arg2):void{
instance.variablesArray[_arg1] = _arg2.toString();
instance.render();
}
public static function getInstance():DebugBox{
try {
instance = new (DebugBox);
} catch(e:Error) {
};
instance.setup();
return (instance);
}
public static function setAtTop(){
if (instance.parent){
instance.parent.setChildIndex(instance, (instance.parent.numChildren - 1));
};
}
}
}//package com.markdavies.debug
Section 12
//CustomEvent (com.markdavies.events.CustomEvent)
package com.markdavies.events {
import flash.events.*;
public class CustomEvent extends Event {
public var data;
public function CustomEvent(_arg1:String, _arg2=null){
super(_arg1);
this.data = _arg2;
}
}
}//package com.markdavies.events
Section 13
//Preloader (com.markdavies.net.Preloader)
package com.markdavies.net {
import flash.events.*;
import com.markdavies.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
public class Preloader extends EventDispatcher {
public var timer:Timer;
private var _dperc:Number;// = 0
private var _lperc:Number;// = 0
public var itemRefs:Dictionary;
private var _isLoaded:Boolean;// = false
public var preloadItems:Dictionary;
public static var LOADING:String = "loading";
public static var LOADED:String = "loaded";
public static var TYPE_ROOT:String = "root";
public static var ERROR:String = "error";
public static var EVENT_SITE_LOAD_ERROR:String = "loadError";
public static var TYPE_SOUND:String = "sound";
public static var TYPE_XML:String = "xml";
public static var UNLOADED:String = "unloaded";
public static var TYPE_LOADER:String = "loader";
public function Preloader(){
preloadItems = new Dictionary();
itemRefs = new Dictionary();
_isLoaded = false;
_lperc = 0;
_dperc = 0;
super();
}
public function stopCheckPreload():void{
timer.removeEventListener(TimerEvent.TIMER, doPreload);
timer.stop();
}
public function get percLoaded():Number{
return (_lperc);
}
public function addItem(_arg1, _arg2:String=null, _arg3:Boolean=false):void{
var _local4:URLLoader;
var _local5:Loader;
var _local6:Sound;
var _local7:URLRequest;
var _local8:String;
var _local9:String;
switch (typeof(_arg1)){
case "string":
_local9 = _arg1.substr((_arg1.lastIndexOf(".") + 1), 3);
if (_arg1.lastIndexOf(".") == -1){
return;
};
switch (_local9){
case "xml":
_local8 = Preloader.TYPE_XML;
break;
case "swf":
case "jpg":
case "jpeg":
case "gif":
case "png":
_local8 = Preloader.TYPE_LOADER;
break;
case "mp3":
_local8 = Preloader.TYPE_SOUND;
break;
};
break;
default:
_local8 = Preloader.TYPE_ROOT;
break;
};
switch (_local8){
case Preloader.TYPE_XML:
_local4 = new URLLoader();
_local7 = new URLRequest(_arg1);
_local4.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
_local4.load(_local7);
preloadItems[_arg1] = {loader:_local4, status:Preloader.UNLOADED, type:Preloader.TYPE_XML};
break;
case Preloader.TYPE_LOADER:
_local5 = new Loader();
_local7 = new URLRequest(_arg1);
_local5.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
_local5.load(_local7);
preloadItems[_arg1] = {loader:_local5, status:Preloader.UNLOADED, type:Preloader.TYPE_LOADER};
break;
case Preloader.TYPE_SOUND:
_local6 = new Sound();
_local7 = new URLRequest(_arg1);
preloadItems[_arg1] = {loader:_local6, status:Preloader.UNLOADED, type:Preloader.TYPE_SOUND};
_local6.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
_local6.load(_local7);
break;
case Preloader.TYPE_ROOT:
preloadItems[_arg1] = {loader:_arg1, status:Preloader.UNLOADED, type:Preloader.TYPE_ROOT};
break;
default:
return;
};
preloadItems[_arg1].required = _arg3;
if (_arg2 != null){
itemRefs[_arg2] = preloadItems[_arg1];
};
}
public function get isLoaded():Boolean{
return (_isLoaded);
}
private function doPreload(_arg1:Event):void{
var lb:int;
var lt:int;
var li:LoaderInfo;
var allb:Number;
var allt:Number;
var requiredFilesMissing:Boolean;
var key:Object;
var e = _arg1;
lb = 0;
lt = 0;
allb = 0;
allt = 0;
requiredFilesMissing = false;
for (key in preloadItems) {
switch (preloadItems[key].status){
case Preloader.ERROR:
case Preloader.LOADING:
case Preloader.UNLOADED:
if (preloadItems[key].required == true){
requiredFilesMissing = true;
};
break;
};
if (preloadItems[key].status == Preloader.ERROR){
} else {
try {
preloadItems[key].loader.contentLoaderInfo;
li = preloadItems[key].loader.contentLoaderInfo;
lb = li.bytesLoaded;
lt = li.bytesTotal;
} catch(ce2:Error) {
try {
lb = preloadItems[key].loader.bytesLoaded;
lt = preloadItems[key].loader.bytesTotal;
} catch(ce1:Error) {
lb = preloadItems[key].loader.loaderInfo.bytesLoaded;
lt = preloadItems[key].loader.loaderInfo.bytesTotal;
};
};
if ((((lb >= lt)) && (!((lb == 0))))){
preloadItems[key].status = Preloader.LOADED;
};
allb = (allb + lb);
allt = (allt + lt);
};
};
_lperc = (allb / allt);
if (_lperc > 1){
_lperc = 1;
};
_dperc = Math.floor((_lperc * 100));
if ((((_dperc == 100)) && (!((requiredFilesMissing == true))))){
onLoadHandler();
_isLoaded = true;
};
}
public function startCheckPreload():void{
_isLoaded = false;
try {
timer.running;
} catch(e:TypeError) {
timer = new Timer(100);
};
timer.addEventListener(TimerEvent.TIMER, doPreload);
timer.start();
}
private function onLoadHandler():void{
stopCheckPreload();
dispatchEvent(new Event(Event.COMPLETE));
}
private function ioErrorHandler(_arg1:Event):void{
var _local2:Object;
for (_local2 in preloadItems) {
if (preloadItems[_local2].loader == _arg1.target){
preloadItems[_local2].status = Preloader.ERROR;
if (preloadItems[_local2].required == true){
dispatchEvent(new CustomEvent(Preloader.EVENT_SITE_LOAD_ERROR));
stopCheckPreload();
};
break;
};
};
}
public function get percLoadedDisplay():String{
return ((_dperc.toString() + "%"));
}
}
}//package com.markdavies.net
Section 14
//SoundCollection (com.markdavies.sound.SoundCollection)
package com.markdavies.sound {
import com.gs.*;
import com.markdavies.net.*;
import flash.utils.*;
import flash.media.*;
public class SoundCollection extends Preloader {
public function getItemsFromPreloader(_arg1:Preloader){
preloadItems = _arg1.preloadItems;
itemRefs = _arg1.itemRefs;
}
public function play(_arg1:String, _arg2:Number=1, _arg3:Number=0, _arg4:Number=0):void{
var r:Object;
var s:Sound;
var ClassReference:Class;
var transform:SoundTransform;
var ref = _arg1;
var vol = _arg2;
var startTime = _arg3;
var loops = _arg4;
try {
ClassReference = (getDefinitionByName(ref) as Class);
r = itemRefs[ClassReference];
s = r.s;
} catch(re:ReferenceError) {
r = getSoundByRef(ref);
s = r.loader;
};
if (r != null){
r.channel = SoundChannel(s.play(startTime, loops));
transform = r.channel.soundTransform;
transform.volume = vol;
r.channel.soundTransform = transform;
};
}
public function stop(_arg1:String):void{
var _local2:Object;
_local2 = getSoundByRef(_arg1);
if (_local2 != null){
if (_local2.channel){
_local2.channel.stop();
};
};
}
public function addLinkedItem(_arg1:Class):void{
if (itemRefs[_arg1] != null){
return;
};
itemRefs[_arg1] = new Object();
itemRefs[_arg1].s = new (_arg1);
}
public function fadeSound(_arg1, _arg2:Number, _arg3:Number):void{
var r:Object;
var s:Sound;
var ClassReference:Class;
var ref = _arg1;
var toVolume = _arg2;
var duration = _arg3;
try {
ClassReference = (getDefinitionByName(ref) as Class);
r = itemRefs[ClassReference];
s = r.s;
} catch(re:ReferenceError) {
r = getSoundByRef(ref);
s = r.loader;
};
if (r != null){
TweenLite.to(r.channel, duration, {volume:toVolume});
};
}
public function getSoundByRef(_arg1:String):Object{
if (((((itemRefs[_arg1]) && ((itemRefs[_arg1].type == Preloader.TYPE_SOUND)))) && ((itemRefs[_arg1].status == Preloader.LOADED)))){
return (itemRefs[_arg1]);
};
return (null);
}
public function setVolume(_arg1, _arg2:Number):void{
var r:Object;
var s:Sound;
var ClassReference:Class;
var ref = _arg1;
var toVolume = _arg2;
try {
ClassReference = (getDefinitionByName(ref) as Class);
r = itemRefs[ClassReference];
s = r.s;
} catch(re:ReferenceError) {
r = getSoundByRef(ref);
s = r.loader;
};
if (r != null){
TweenLite.to(r.channel, 0, {volume:toVolume});
};
}
}
}//package com.markdavies.sound
Section 15
//Validator (com.markdavies.utils.Validator)
package com.markdavies.utils {
public class Validator {
public static var TYPE_STRING:String = "string";
public static var TYPE_EMAIL:String = "email";
public static var TYPE_NUMBER:String = "number";
private function validateEmail(_arg1:String){
var _local2:RegExp;
_local2 = /^[a-z][\w.-]+@\w[\w.-]+\.[\w.-]*[a-z][a-z]$/i;
return (!(_local2.test(_arg1)));
}
public function validate(_arg1:String, _arg2){
switch (_arg1){
case Validator.TYPE_EMAIL:
return (validateEmail(_arg2));
case Validator.TYPE_STRING:
return ((((_arg2 == "")) || ((_arg2 == null))));
};
}
}
}//package com.markdavies.utils
Section 16
//MarvelLoginConnector (com.soap.net.MarvelLoginConnector)
package com.soap.net {
import flash.events.*;
import com.markdavies.events.*;
import com.markdavies.debug.*;
import flash.net.*;
public class MarvelLoginConnector extends EventDispatcher {
private var recVariables:URLVariables;
private var sendVariables:URLVariables;
private var loader:URLLoader;
private var request:URLRequest;
public var marvelUser:MarvelLoginUser;
public static var EVENT_LOGIN_FAILED:String = "loginFailed";
public static var LOGIN_URL:String = "/soap/login.php";
public static var EVENT_LOGIN_SUCCESS:String = "loginSuccess";
public function MarvelLoginConnector(){
init();
}
private function securityErrorHandler(_arg1:SecurityErrorEvent):void{
DebugBox.debug("marvellogin", "securityErrorHandler");
dispatchEvent(new CustomEvent(MarvelLoginConnector.EVENT_LOGIN_FAILED));
}
private function init():void{
loader = new URLLoader();
request = new URLRequest(MarvelLoginConnector.LOGIN_URL);
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
DebugBox.debug("marvellogin", "ioErrorHandler");
dispatchEvent(new CustomEvent(MarvelLoginConnector.EVENT_LOGIN_FAILED));
}
public function login(_arg1:String, _arg2:String):void{
var user = _arg1;
var pass = _arg2;
sendVariables = new URLVariables();
sendVariables.action = "login";
sendVariables.user = user;
sendVariables.pass = pass;
request.data = sendVariables;
request.method = "GET";
loader.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler, false, 0, true);
try {
loader.load(request);
} catch(error:Error) {
DebugBox.debug("marvellogin", "can't load that");
dispatchEvent(new CustomEvent(MarvelLoginConnector.EVENT_LOGIN_FAILED));
};
}
private function onComplete(_arg1:Event):void{
var _local2:Array;
var _local3:int;
var _local4:Array;
marvelUser = new MarvelLoginUser();
_local2 = loader.data.split("&");
_local3 = 0;
while (_local3 < _local2.length) {
_local4 = _local2[_local3].split("=");
switch (_local4[0]){
case "user_id":
marvelUser.userID = _local4[1];
break;
case "member_name":
marvelUser.username = _local4[1];
break;
case "country_id":
marvelUser.country = _local4[1];
break;
};
_local3++;
};
if (marvelUser.userID != ""){
dispatchEvent(new CustomEvent(MarvelLoginConnector.EVENT_LOGIN_SUCCESS, {marvelUser:marvelUser}));
} else {
dispatchEvent(new CustomEvent(MarvelLoginConnector.EVENT_LOGIN_FAILED));
};
}
}
}//package com.soap.net
Section 17
//MarvelLoginUser (com.soap.net.MarvelLoginUser)
package com.soap.net {
public class MarvelLoginUser {
public var country:String;// = "10"
public var username:String;// = "test"
public var userID:String;// = "01"
public function MarvelLoginUser(){
userID = "01";
username = "test";
country = "10";
super();
}
}
}//package com.soap.net
Section 18
//Mochi (com.soap.net.Mochi)
package com.soap.net {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class Mochi {
private static var self:Mochi;
public function Mochi():void{
}
public static function track(_arg1:DisplayObject, _arg2:String):Mochi{
var _local3:String;
var _local4:URLVariables;
var _local5:String;
var _local6:URLRequest;
var _local7:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
self = new (Mochi);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local3 = "http://core.mochibot.com/my/core.swf";
_local4 = new URLVariables();
_local4["sb"] = Security.sandboxType;
_local4["v"] = Capabilities.version;
_local4["swfid"] = _arg2;
_local4["mv"] = "8";
_local4["fv"] = "9";
_local5 = _arg1.loaderInfo.loaderURL;
if (_local5.indexOf("http") == 0){
_local4["url"] = _local5;
} else {
_local4["url"] = "local";
};
_local6 = new URLRequest(_local3);
_local6.contentType = "application/x-www-form-urlencoded";
_local6.method = URLRequestMethod.POST;
_local6.data = _local4;
_local7 = new Loader();
_local7.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, error);
_local7.load(_local6);
return (self);
}
private static function error(_arg1:IOErrorEvent):void{
trace(("error " + _arg1.text));
}
}
}//package com.soap.net
Section 19
//Bounce (fl.motion.easing.Bounce)
package fl.motion.easing {
public class Bounce {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package fl.motion.easing
Section 20
//Elastic (fl.motion.easing.Elastic)
package fl.motion.easing {
public class Elastic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
}
}//package fl.motion.easing
Section 21
//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 22
//Elastic (fl.transitions.easing.Elastic)
package fl.transitions.easing {
public class Elastic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
}
}//package fl.transitions.easing
Section 23
//hulk_power_up_215 (hulkjump_fla.hulk_power_up_215)
package hulkjump_fla {
import flash.display.*;
public dynamic class hulk_power_up_215 extends MovieClip {
public function hulk_power_up_215(){
addFrameScript(28, frame29);
}
function frame29(){
gotoAndPlay("loop");
}
}
}//package hulkjump_fla
Section 24
//m_123 (hulkjump_fla.m_123)
package hulkjump_fla {
import flash.display.*;
public dynamic class m_123 extends MovieClip {
public var hits:MovieClip;
}
}//package hulkjump_fla
Section 25
//marcadebtn_98 (hulkjump_fla.marcadebtn_98)
package hulkjump_fla {
import flash.display.*;
public dynamic class marcadebtn_98 extends MovieClip {
public function marcadebtn_98(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package hulkjump_fla
Section 26
//marcadenum_136 (hulkjump_fla.marcadenum_136)
package hulkjump_fla {
import flash.display.*;
import flash.text.*;
public dynamic class marcadenum_136 extends MovieClip {
public var txt:TextField;
}
}//package hulkjump_fla
Section 27
//mbacking1_61 (hulkjump_fla.mbacking1_61)
package hulkjump_fla {
import flash.display.*;
public dynamic class mbacking1_61 extends MovieClip {
public var btnPauseGame:MovieClip;
public var btnMainMenu:MovieClip;
}
}//package hulkjump_fla
Section 28
//mbacking2_65 (hulkjump_fla.mbacking2_65)
package hulkjump_fla {
import flash.display.*;
public dynamic class mbacking2_65 extends MovieClip {
public var btnSendToFriend:MovieClip;
public var btnMoreGames:MovieClip;
public var btnStartGame:MovieClip;
public var btnHowToPlay:MovieClip;
public var btnHighScores:MovieClip;
}
}//package hulkjump_fla
Section 29
//mchallegnenum_137 (hulkjump_fla.mchallegnenum_137)
package hulkjump_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mchallegnenum_137 extends MovieClip {
public var txt:TextField;
}
}//package hulkjump_fla
Section 30
//mchallengebtn_100 (hulkjump_fla.mchallengebtn_100)
package hulkjump_fla {
import flash.display.*;
public dynamic class mchallengebtn_100 extends MovieClip {
public function mchallengebtn_100(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package hulkjump_fla
Section 31
//mcomboText_8 (hulkjump_fla.mcomboText_8)
package hulkjump_fla {
import flash.display.*;
public dynamic class mcomboText_8 extends MovieClip {
public var multiMov:MovieClip;
}
}//package hulkjump_fla
Section 32
//mcrackmaskanim_117 (hulkjump_fla.mcrackmaskanim_117)
package hulkjump_fla {
import flash.display.*;
public dynamic class mcrackmaskanim_117 extends MovieClip {
public function mcrackmaskanim_117(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package hulkjump_fla
Section 33
//mdisplaypowerbar_131 (hulkjump_fla.mdisplaypowerbar_131)
package hulkjump_fla {
import flash.display.*;
public dynamic class mdisplaypowerbar_131 extends MovieClip {
public var bar:MovieClip;
}
}//package hulkjump_fla
Section 34
//mdropdownitems_111 (hulkjump_fla.mdropdownitems_111)
package hulkjump_fla {
import flash.display.*;
public dynamic class mdropdownitems_111 extends MovieClip {
public var item2:CountryDropDownItem;
public var item3:CountryDropDownItem;
public var item4:CountryDropDownItem;
public var item5:CountryDropDownItem;
public var scroller:MovieClip;
public var item1:CountryDropDownItem;
}
}//package hulkjump_fla
Section 35
//menemyinner_51 (hulkjump_fla.menemyinner_51)
package hulkjump_fla {
import flash.display.*;
public dynamic class menemyinner_51 extends MovieClip {
public function menemyinner_51(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hulkjump_fla
Section 36
//mgamepaused_70 (hulkjump_fla.mgamepaused_70)
package hulkjump_fla {
import flash.display.*;
public dynamic class mgamepaused_70 extends MovieClip {
public var btnClickToContinue:MovieClip;
}
}//package hulkjump_fla
Section 37
//mhighscoreentry_95 (hulkjump_fla.mhighscoreentry_95)
package hulkjump_fla {
import flash.display.*;
public dynamic class mhighscoreentry_95 extends MovieClip {
public var txt:MovieClip;
public var flag:MovieClip;
}
}//package hulkjump_fla
Section 38
//mhighscoreentrytext_96 (hulkjump_fla.mhighscoreentrytext_96)
package hulkjump_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mhighscoreentrytext_96 extends MovieClip {
public var rankTxt:TextField;
public var scoreTxt:TextField;
public var nameTxt:TextField;
}
}//package hulkjump_fla
Section 39
//mhighscoresprev_78 (hulkjump_fla.mhighscoresprev_78)
package hulkjump_fla {
import flash.display.*;
public dynamic class mhighscoresprev_78 extends MovieClip {
public var base:MovieClip;
}
}//package hulkjump_fla
Section 40
//mhulkfly_216 (hulkjump_fla.mhulkfly_216)
package hulkjump_fla {
import flash.display.*;
public dynamic class mhulkfly_216 extends MovieClip {
public function mhulkfly_216(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package hulkjump_fla
Section 41
//mhulkland_217 (hulkjump_fla.mhulkland_217)
package hulkjump_fla {
import flash.display.*;
public dynamic class mhulkland_217 extends MovieClip {
public function mhulkland_217(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package hulkjump_fla
Section 42
//mloadingmov_3 (hulkjump_fla.mloadingmov_3)
package hulkjump_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mloadingmov_3 extends MovieClip {
public var percentageTxt:TextField;
public var nukeMask:MovieClip;
}
}//package hulkjump_fla
Section 43
//mminimapmap_56 (hulkjump_fla.mminimapmap_56)
package hulkjump_fla {
import flash.display.*;
public dynamic class mminimapmap_56 extends MovieClip {
public var focusArea:MovieClip;
public var spriteHolder:MovieClip;
}
}//package hulkjump_fla
Section 44
//mminimapmask_55 (hulkjump_fla.mminimapmask_55)
package hulkjump_fla {
import flash.display.*;
public dynamic class mminimapmask_55 extends MovieClip {
public function mminimapmask_55(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hulkjump_fla
Section 45
//mmute_133 (hulkjump_fla.mmute_133)
package hulkjump_fla {
import flash.display.*;
public dynamic class mmute_133 extends MovieClip {
public function mmute_133(){
addFrameScript(29, frame30);
}
function frame30(){
gotoAndPlay("on");
}
}
}//package hulkjump_fla
Section 46
//mnavbutton_62 (hulkjump_fla.mnavbutton_62)
package hulkjump_fla {
import flash.display.*;
public dynamic class mnavbutton_62 extends MovieClip {
public var gradient:MovieClip;
public var txt:MovieClip;
}
}//package hulkjump_fla
Section 47
//mnavbuttonsmall_74 (hulkjump_fla.mnavbuttonsmall_74)
package hulkjump_fla {
import flash.display.*;
public dynamic class mnavbuttonsmall_74 extends MovieClip {
public var txt:MovieClip;
}
}//package hulkjump_fla
Section 48
//mnavbuttonsmalltxt_75 (hulkjump_fla.mnavbuttonsmalltxt_75)
package hulkjump_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mnavbuttonsmalltxt_75 extends MovieClip {
public var txt:TextField;
}
}//package hulkjump_fla
Section 49
//mnavbuttontxt_63 (hulkjump_fla.mnavbuttontxt_63)
package hulkjump_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mnavbuttontxt_63 extends MovieClip {
public var txt:TextField;
}
}//package hulkjump_fla
Section 50
//mnumhits_124 (hulkjump_fla.mnumhits_124)
package hulkjump_fla {
import flash.display.*;
import flash.text.*;
public dynamic class mnumhits_124 extends MovieClip {
public var numHits:TextField;
public function mnumhits_124(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package hulkjump_fla
Section 51
//mplayerdoubleupbar_143 (hulkjump_fla.mplayerdoubleupbar_143)
package hulkjump_fla {
import flash.display.*;
public dynamic class mplayerdoubleupbar_143 extends MovieClip {
public var bar:MovieClip;
}
}//package hulkjump_fla
Section 52
//mplayerinner_144 (hulkjump_fla.mplayerinner_144)
package hulkjump_fla {
import flash.display.*;
public dynamic class mplayerinner_144 extends MovieClip {
public function mplayerinner_144(){
addFrameScript(1, frame2, 28, frame29, 36, frame37, 43, frame44);
}
function frame29(){
gotoAndPlay("poweruploop");
}
function frame2(){
stop();
}
function frame37(){
stop();
}
function frame44(){
stop();
}
}
}//package hulkjump_fla
Section 53
//mplayerpowerbar_141 (hulkjump_fla.mplayerpowerbar_141)
package hulkjump_fla {
import flash.display.*;
public dynamic class mplayerpowerbar_141 extends MovieClip {
public var bar:MovieClip;
}
}//package hulkjump_fla
Section 54
//mrankitems_94 (hulkjump_fla.mrankitems_94)
package hulkjump_fla {
import flash.display.*;
public dynamic class mrankitems_94 extends MovieClip {
public var r2:MovieClip;
public var r3:MovieClip;
public var r6:MovieClip;
public var r8:MovieClip;
public var r9:MovieClip;
public var r5:MovieClip;
public var r4:MovieClip;
public var r10:MovieClip;
public var r7:MovieClip;
public var r1:MovieClip;
}
}//package hulkjump_fla
Section 55
//msendtofriendbutton_102 (hulkjump_fla.msendtofriendbutton_102)
package hulkjump_fla {
import flash.display.*;
public dynamic class msendtofriendbutton_102 extends MovieClip {
public var btn:MovieClip;
public function msendtofriendbutton_102(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hulkjump_fla
Section 56
//msounds_138 (hulkjump_fla.msounds_138)
package hulkjump_fla {
import flash.display.*;
public dynamic class msounds_138 extends MovieClip {
public function msounds_138(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hulkjump_fla
Section 57
//myourbest_135 (hulkjump_fla.myourbest_135)
package hulkjump_fla {
import flash.display.*;
public dynamic class myourbest_135 extends MovieClip {
public var arcade:MovieClip;
public var challenge:MovieClip;
}
}//package hulkjump_fla
Section 58
//GameCamera (marvel.centralsmashdown.game.control.GameCamera)
package marvel.centralsmashdown.game.control {
public class GameCamera {
public var scale:Number;
public var xOffset:Number;// = 0
public var yOffset:Number;// = 0
private var _minScale:Number;
public var x:Number;
public var y:Number;
public static var CAMERA_SCALE_CHANGE_RATE:Number = 0.02;
public static var CAMERA_HEIGHT:int = 350;
public static var CAMERA_X:int = 16;
public static var CAMERA_GROUND_SPACER:Number = 105;
public static var CAMERA_WIDTH:int = 700;
public static var CAMERA_SCALE_TO_SPEED_RATIO:Number = 0.03;
private static var instance:GameCamera = new (GameCamera);
;
public static var CAMERA_Y:int = 93;
public function GameCamera(){
xOffset = 0;
yOffset = 0;
super();
}
public function Camera(){
if (instance){
throw (new Error("GameCamera can only be accessed through GameCamera.getInstance()"));
};
}
public function calculate(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local6 = (GameControl.GROUND_Y - _arg2);
_local7 = Math.sqrt((Math.pow(_arg3, 2) + Math.pow(_arg4, 2)));
if ((((_local6 < 300)) && ((_arg4 > 0)))){
_local5 = 1;
scale = (scale + ((_local5 - scale) * (GameCamera.CAMERA_SCALE_CHANGE_RATE * 2)));
} else {
_local5 = (1 - (GameCamera.CAMERA_SCALE_TO_SPEED_RATIO * _local7));
scale = (scale + ((_local5 - scale) * GameCamera.CAMERA_SCALE_CHANGE_RATE));
};
if (scale < _minScale){
scale = _minScale;
};
this.y = (Math.round(((-(_arg2) + GameCamera.CAMERA_Y) + (GameCamera.CAMERA_HEIGHT / 2))) * scale);
this.x = (Math.round(((-(_arg1) + GameCamera.CAMERA_X) + (GameCamera.CAMERA_WIDTH / 2))) * scale);
_local8 = GameCamera.CAMERA_X;
_local9 = (GameCamera.CAMERA_X - ((GameControl.GAME_WIDTH * scale) - GameCamera.CAMERA_WIDTH));
_local10 = ((GameCamera.CAMERA_Y + GameCamera.CAMERA_HEIGHT) - (GameCamera.CAMERA_GROUND_SPACER * scale));
if (this.x > _local8){
this.x = _local8;
};
if (this.x < _local9){
this.x = _local9;
};
if (this.y < _local10){
this.y = _local10;
};
this.x = (this.x - xOffset);
this.y = (this.y - yOffset);
}
public function reset():void{
scale = 1;
_minScale = (GameCamera.CAMERA_WIDTH / GameControl.GAME_WIDTH);
}
public static function getInstance():GameCamera{
return (instance);
}
}
}//package marvel.centralsmashdown.game.control
Section 59
//GameControl (marvel.centralsmashdown.game.control.GameControl)
package marvel.centralsmashdown.game.control {
import flash.events.*;
import com.markdavies.events.*;
import flash.display.*;
import com.gs.*;
import com.markdavies.debug.*;
import marvel.centralsmashdown.*;
import marvel.centralsmashdown.game.sprites.*;
import flash.utils.*;
import marvel.centralsmashdown.game.views.*;
import fl.motion.easing.*;
import marvel.centralsmashdown.views.*;
import marvel.centralsmashdown.game.*;
import flash.errors.*;
public class GameControl {
private var _player:Player;
private var _highScoreArcade:Number;// = 0
private var _pauseStarted:Date;
private var _contentHolder:MovieClip;
private var _bestChallengeScore:int;
private var _score:int;
private var _gameMode:String;
private var _main:Main;
private var _gameScreen:GameScreen;
private var _bestArcadeScore:int;
private var _currentTime:int;
private var _quitToMain:MovieClip;
private var _timeRemaining:int;
private var _timeStarted:Date;
private var _gameOverTimer:Timer;
private var _comboCount:int;
private var _pausedTime:int;
private var _pauseScreen:MovieClip;
private var _miniMap:MiniMap;
private var _outerFrame:OuterFrame;
private var _gameCamera:GameCamera;
private var _isPaused:Boolean;// = false
private var _highScoreChallenge:Number;// = 0
private var _rumblePack:RumblePack;
private var _lastEnemyType:String;
private var _bottomNav:BottomNav;
private var _comboTime:Date;
private var _stage:Stage;
public static var COMICTEXT_TYPE_CRASH:String = "crash";
public static var RUMBLE_PERC_MAX_DROPHEIGHT:int = 2000;
public static var ENEMY_MAX_Y:int = -200;
public static var COMICTEXT_TYPE_DOUBLEUP:String = "doubleup";
public static var MAX_ENEMIES:int = 10;
public static var BONUS_TYPE_TIMEUP:String = "timeup";
public static var ENEMY_TYPE_SNAKE:String = "snake";
public static var ENEMY_TYPE_MOVER:String = "mover";
public static var GAME_MODE_CHALLENGE:String = "gameModeChallenge";
private static var instance:GameControl = new (GameControl);
;
public static var ENEMY_REMOVE_RANGE:int = 1000;
public static var GAME_WIDTH:int = 900;
public static var GROUND_Y:int = -35;
public static var PLAYER_ENEMY_HIT_SIDEWAYS_RATE:Number = 0.25;
public static var PLAYER_ENEMY_HIT_POWER:Number = 0.75;
public static var RUMBLE_BROWSER_SHAKE_PERC:Number = 0.9;
public static var COMICTEXT_TYPE_SMASH:String = "smash";
public static var RUMBLE_MAX_AMOUNT:int = 40;
public static var SCORE_PER_ENEMY:Number = 150;
public static var ENEMY_CREATION_CHANCE:Number = 0.05;
public static var HIT_DISTANCE:int = 70;
public static var COMBO_HIT_TIME:int = 500;
public static var MIN_COMBO_FOR_BONUS:Number = 2;
public static var BONUS_TYPE_DOUBLEUP:String = "doubleup";
public static var TIMEUP_AMOUNT:Number = 10000;
public static var ENEMY_TYPE_FLOATER:String = "floater";
public static var GAME_MODE_ARCADE:String = "gameModeArcade";
public static var COMICTEXT_TYPE_COMBO:String = "combo";
public static var COMICTEXT_TYPE_BOOM:String = "boom";
public static var RUMBLE_MIN_AMOUNT:int = 10;
public static var ENEMY_CREATION_RANGE:int = 300;
public static var ENEMY_START_PADDING_X:int = 100;
public static var ENEMY_START_PADDING_Y:int = 200;
public static var ENEMY_TYPE_FOLLOWER:String = "follower";
public static var COMICTEXT_TYPE_TIMEUP:String = "timeup";
public static var RUMBLE_OUTERFRAME_SHAKE_PERC:Number = 0.5;
public function GameControl(){
_isPaused = false;
_highScoreArcade = 0;
_highScoreChallenge = 0;
super();
if (instance){
throw (new Error("GameControl can only be accessed through GameControl.getInstance()"));
};
_main = Main.getInstance();
}
private function spriteGroundHitHandler(_arg1:CustomEvent):void{
var _local2:Number;
if ((_arg1.data.target is Player)){
_local2 = (-(_player.dropHeight) / GameControl.RUMBLE_PERC_MAX_DROPHEIGHT);
if (_local2 > 1){
_local2 = 1;
};
rumble(_local2);
_main.sc.play("s_hitground", _local2);
if ((((_gameMode == GameControl.GAME_MODE_CHALLENGE)) && ((_player.enemiesHitThisJump > 0)))){
if (_score > _bestChallengeScore){
_bestChallengeScore = _score;
};
gameOver();
};
_player.setToMaxY();
_player.power = 0;
_player.isDoubleUp = false;
} else {
if ((_arg1.data.target is Enemy)){
Enemy(_arg1.data.target).setToMaxY();
};
};
}
private function enemyDieHandler(_arg1:Event):void{
var _local2:Enemy;
if ((_arg1.target is Enemy)){
_local2 = Enemy(_arg1.target);
_local2.removeEventListener(GameSprite.EVENT_GROUND_HIT, spriteGroundHitHandler);
_local2.removeEventListener(GameSprite.EVENT_OUTSIDE_BORDERS, spriteOutsideBorderHandler);
_local2.removeEventListener(Event.REMOVED, enemyDieHandler);
_miniMap.remove(_local2);
};
}
public function get highScore():int{
var _local1:int;
switch (gameMode){
case GameControl.GAME_MODE_ARCADE:
_local1 = highScoreArcade;
break;
case GameControl.GAME_MODE_CHALLENGE:
_local1 = highScoreChallenge;
break;
};
return (_local1);
}
private function rumble(_arg1:Number):void{
var _local2:Number;
var _local3:Array;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
var _local8:String;
var _local9:Number;
_local2 = (((GameControl.RUMBLE_MAX_AMOUNT - GameControl.RUMBLE_MIN_AMOUNT) * _arg1) + GameControl.RUMBLE_MIN_AMOUNT);
if (_arg1 > GameControl.RUMBLE_OUTERFRAME_SHAKE_PERC){
_local3 = [MovieClip(_main.border), MovieClip(_main.outerFrame), MovieClip(_gameScreen)];
_local9 = (Math.random() * 3);
if (_local9 < 1){
_local8 = GameControl.COMICTEXT_TYPE_BOOM;
} else {
if (_local9 < 2){
_local8 = GameControl.COMICTEXT_TYPE_CRASH;
} else {
_local8 = GameControl.COMICTEXT_TYPE_SMASH;
};
};
makeComicText((_player.x - 20), (_player.y - 120), _local8);
makeCrack();
} else {
_local3 = [MovieClip(_gameScreen)];
};
_local7 = 0;
while (_local7 < _local3.length) {
_rumblePack = new RumblePack();
if (_local3[_local7] == _gameScreen){
_local4 = _gameScreen.y;
_local5 = (GameCamera.CAMERA_HEIGHT + GameCamera.CAMERA_Y);
_local6 = GameControl.GAME_WIDTH;
} else {
_local4 = 0;
_local5 = _local3[_local7].root.stage.stageHeight;
_local6 = _local3[_local7].root.stage.stageWidth;
};
_rumblePack.create(_local3[_local7], _local6, _local5, 0, _local4);
_rumblePack.startRumble(_local2, 1);
if (_local3[_local7] == _gameScreen){
_rumblePack.y = -(_local4);
};
_local3[_local7].addChildAt(_rumblePack, _local3[_local7].numChildren);
_local7++;
};
}
private function pauseToggle():void{
var _local1:Date;
_main.clearContent();
if (_isPaused == false){
_pauseScreen = new PauseScreen();
_pauseScreen.btnPaused.addEventListener(MouseEvent.MOUSE_DOWN, pauseClickHandler);
_pauseScreen.btnPaused.buttonMode = true;
_contentHolder.addChild(_pauseScreen);
_pauseStarted = new Date();
_main.sc.setVolume("s_soundtrack_game", 0);
} else {
_local1 = new Date();
_pausedTime = (_pausedTime + (_local1.getTime() - _pauseStarted.getTime()));
_main.sc.setVolume("s_soundtrack_game", 1);
};
_isPaused = !(_isPaused);
}
public function get score():int{
return (_score);
}
public function get lastScore():int{
return (_score);
}
public function exit():void{
_main.gameOverHandler();
}
private function makeComicText(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Number=0):void{
var _local5:ComicTextDisplay;
_local5 = new ComicTextDisplay();
_local5.type = _arg3;
_local5.x = _arg1;
_local5.y = _arg2;
_local5.multiplier = _arg4;
_local5.show();
_gameScreen.addChild(_local5);
}
private function render():void{
var _local1:Number;
var _local2:GameSprite;
_outerFrame.score = _score;
if (_gameMode == GameControl.GAME_MODE_ARCADE){
_outerFrame.timeRemaining = _timeRemaining;
_outerFrame.timePercentage = (_timeRemaining / (Config.TIMER_MODE_TIMEPERGAME * 1000));
};
_local1 = 0;
while (_local1 < _gameScreen.spriteHolder.numChildren) {
_local2 = GameSprite(_gameScreen.spriteHolder.getChildAt(_local1));
_local2.move();
if (_local2.currentStatus != GameSprite.STATUS_DEAD){
_miniMap.set(_local2);
};
_local1++;
};
_gameScreen.x = _gameCamera.x;
_gameScreen.y = _gameCamera.y;
_gameScreen.scaleX = (_gameScreen.scaleY = _gameCamera.scale);
_gameScreen.render();
}
private function bonusHitHandler(_arg1:CustomEvent):void{
var _local2:BonusSprite;
var _local3:Number;
_local2 = BonusSprite(_arg1.data.bonus);
_local2.currentStatus = GameSprite.STATUS_DEAD;
_local2.gotoAndPlay("die");
_miniMap.remove(_local2);
_local3 = (_player.speedY * 10);
if (_local2.type == GameControl.BONUS_TYPE_DOUBLEUP){
makeComicText((_player.x - 20), (_player.y + _local3), GameControl.COMICTEXT_TYPE_DOUBLEUP);
_player.isDoubleUp = true;
} else {
if (_local2.type == GameControl.BONUS_TYPE_TIMEUP){
_timeStarted.setTime((_timeStarted.getTime() + GameControl.TIMEUP_AMOUNT));
makeComicText((_player.x - 20), (_player.y + _local3), GameControl.COMICTEXT_TYPE_TIMEUP);
};
};
TweenLite.to(_local2, 0.5, {scaleX:2, scaleY:2, alpha:0, ease:Bounce.easeOut, onComplete:_local2.die});
}
private function pauseClickHandler(_arg1:MouseEvent):void{
pauseToggle();
}
public function get gameMode():String{
return (_gameMode);
}
public function get paused():Boolean{
return (_isPaused);
}
public function engine(_arg1:Event):void{
if (_isPaused == true){
return;
};
calculate();
render();
}
private function spriteOutsideBorderHandler(_arg1:CustomEvent):void{
var _local2:Enemy;
if ((_arg1.data.target is Enemy)){
_local2 = Enemy(_arg1.data.target);
switch (_local2.enemyType){
case GameControl.ENEMY_TYPE_FOLLOWER:
_local2.currentStatus = GameSprite.STATUS_DEAD;
_local2.gotoAndPlay("die");
break;
case GameControl.ENEMY_TYPE_FLOATER:
_local2.x = ((_arg1.data.direction)==0) ? (_local2.minXPos + GameControl.ENEMY_START_PADDING_X) : (_local2.maxXpos - GameControl.ENEMY_START_PADDING_X);
_local2.aimSpeedX = (_local2.aimSpeedX - _local2.aimSpeedX);
break;
};
} else {
if ((_arg1.data.target is Player)){
if (_player.x > _player.maxXPos){
_player.x = _player.maxXPos;
};
if (_player.x < _player.minXPos){
_player.x = _player.minXPos;
};
};
};
}
public function get highScoreArcade():int{
return (_highScoreArcade);
}
private function gameOver():void{
var _local1:GameOver;
if (_gameMode == GameControl.GAME_MODE_ARCADE){
_gameOverTimer = new Timer(3000, 1);
_gameOverTimer.addEventListener(TimerEvent.TIMER, out);
_gameOverTimer.start();
};
_local1 = new GameOver();
_local1.mode = _gameMode;
TweenLite.from(_local1, 0.5, {alpha:0, delay:1.25});
_contentHolder.addChild(_local1);
_main.bottomNav.menu = Main.MENU_MODE_SCREEN;
end();
}
public function get highScoreChallenge():int{
return (_highScoreChallenge);
}
private function quitToMainClickHandler(_arg1:CustomEvent):void{
switch (_arg1.data){
case Config.NAV_QUITMAIN_YES:
_bottomNav.dispatchEvent(new CustomEvent(Main.EVENT_NAV_CLICK, Config.NAV_QUITMAIN_YES));
end();
break;
case Config.NAV_QUITMAIN_NO:
_contentHolder.removeChild(_quitToMain);
_isPaused = false;
break;
};
}
private function reset():void{
_score = 0;
_bestArcadeScore = 0;
_player = new Player();
_player.reset();
_player.addEventListener(Event.REMOVED_FROM_STAGE, remHandler);
_gameScreen.spriteHolder.addChild(_player);
}
private function remHandler(_arg1:Event):void{
trace("removed!");
}
private function out(_arg1:TimerEvent):void{
_gameOverTimer.removeEventListener(TimerEvent.TIMER, out);
exit();
}
public function end():void{
_miniMap.clearAll();
_miniMap.showing = false;
while (_gameScreen.crackHolder.numChildren > 0) {
_gameScreen.crackHolder.removeChildAt(0);
};
switch (gameMode){
case GameControl.GAME_MODE_ARCADE:
if (_score > highScoreArcade){
highScoreArcade = _score;
};
break;
case GameControl.GAME_MODE_CHALLENGE:
if (_score > highScoreChallenge){
highScoreChallenge = _score;
};
break;
};
registerListeners(false);
_main.so = {highScoreArcade:_highScoreArcade, highScoreChallenge:_highScoreChallenge};
_stage.quality = StageQuality.HIGH;
}
private function registerListeners(_arg1:Boolean):void{
var _local2:Function;
_local2 = ((_arg1)==true) ? _main.addEventListener : _main.removeEventListener;
_local2(Event.ENTER_FRAME, engine);
_local2 = ((_arg1)==true) ? _gameScreen.stage.addEventListener : _gameScreen.stage.removeEventListener;
_local2(MouseEvent.MOUSE_DOWN, _player.mousePressHandler);
_local2(MouseEvent.MOUSE_UP, _player.mouseReleaseHandler);
_local2 = ((_arg1)==true) ? _player.addEventListener : _player.removeEventListener;
_local2(GameSprite.EVENT_GROUND_HIT, spriteGroundHitHandler);
_local2(GameSprite.EVENT_ENEMY_HIT, enemyHitHandler);
_local2(GameSprite.EVENT_BONUS_HIT, bonusHitHandler);
_local2(GameSprite.EVENT_IS_HITTING_SPRITE, spritesHittingHandler);
_local2(GameSprite.EVENT_OUTSIDE_BORDERS, spriteOutsideBorderHandler);
_local2 = ((_arg1)==true) ? _stage.addEventListener : _stage.removeEventListener;
_local2(KeyboardEvent.KEY_DOWN, keyDownHandler);
_local2 = ((_arg1)==true) ? _bottomNav.addEventListener : _bottomNav.removeEventListener;
_local2(Main.EVENT_NAV_CLICK, navClickHandler);
}
private function quitToMainScreen():void{
_main.clearContent();
_quitToMain = new QuitToMain();
_quitToMain.addEventListener(Main.EVENT_NAV_CLICK, quitToMainClickHandler, false, 0, true);
_contentHolder.addChild(_quitToMain);
_isPaused = true;
}
private function enemyHitHandler(_arg1:CustomEvent):void{
var _local2:Enemy;
var _local3:Object;
var _local4:int;
var _local5:int;
_local2 = Enemy(_arg1.data.enemy);
_local3 = _player.calculateRelativePosition(_local2);
_local2.currentStatus = GameSprite.STATUS_DEAD;
_local2.gotoAndPlay("die");
_miniMap.remove(_local2);
if (_gameMode == GameControl.GAME_MODE_ARCADE){
_local4 = ((_player.isDoubleUp)==true) ? (GameControl.SCORE_PER_ENEMY * 2) : GameControl.SCORE_PER_ENEMY;
} else {
_local4 = ((_player.isDoubleUp)==true) ? 2 : 1;
};
_score = (_score + _local4);
_player.jump(GameControl.PLAYER_ENEMY_HIT_POWER);
_player.accelerationX = (-(_local3.adj) * GameControl.PLAYER_ENEMY_HIT_SIDEWAYS_RATE);
_comboTime = new Date();
_comboCount = (_comboCount + ((_player.isDoubleUp)==true) ? 2 : 1);
_local5 = (Math.round((Math.random() * 3)) + 1);
_main.sc.play(("s_explosion" + _local5.toString()));
if (Math.random() > 0.75){
_local5 = (Math.round((Math.random() * 3)) + 1);
_main.sc.play(("s_damage" + _local5.toString()));
};
DebugBox.debug("combo", _comboCount);
}
private function createSprite(_arg1:Class):void{
var _local2:Enemy;
var _local3:BonusSprite;
switch (_arg1){
case Enemy:
_local2 = new Enemy();
_local2.chooseType();
_local2.init(_player);
_lastEnemyType = _local2.enemyType;
_local2.addEventListener(GameSprite.EVENT_GROUND_HIT, spriteGroundHitHandler);
_local2.addEventListener(GameSprite.EVENT_OUTSIDE_BORDERS, spriteOutsideBorderHandler);
_local2.addEventListener(Event.REMOVED, enemyDieHandler);
_gameScreen.spriteHolder.addChild(_local2);
break;
case BonusSprite:
_local3 = new BonusSprite();
_local3.x = _player.x;
_local3.y = _player.y;
_local3.type = ((((_gameMode == GameControl.GAME_MODE_CHALLENGE)) || ((Math.random() > 0.5)))) ? GameControl.BONUS_TYPE_DOUBLEUP : GameControl.BONUS_TYPE_TIMEUP;
_local3.currentStatus = GameSprite.STATUS_CREATING;
TweenLite.from(_local3, 0.5, {scaleX:0, scaleY:0, delay:0.5, ease:Bounce.easeOut, onComplete:_local3.ready});
_gameScreen.spriteHolder.addChild(_local3);
break;
};
}
public function start():void{
var _local1:int;
if (_gameScreen == null){
throw (new Error("GameControl can only run if there is a registered GameScreen!"));
};
_outerFrame.gameMode = gameMode;
_gameCamera = GameCamera.getInstance();
_gameCamera.reset();
_comboTime = new Date();
_timeStarted = new Date();
_pausedTime = 0;
_comboCount = 0;
_score = 0;
_bestArcadeScore = 0;
_outerFrame.scoreHardChange = 0;
_miniMap.showing = true;
_miniMap.clearAll();
_isPaused = false;
registerListeners(true);
_stage.quality = StageQuality.MEDIUM;
_local1 = (Math.round(Math.random()) + 1);
_main.sc.play(("s_hulksmash" + _local1.toString()));
_main.bottomNav.menu = Main.MENU_MODE_GAME;
DebugBox.setAtTop();
}
public function registerScreens():void{
_gameScreen = _main.gameScreen;
_outerFrame = _main.outerFrame;
_miniMap = _outerFrame.miniMap;
_bottomNav = _outerFrame.bottomNav;
_contentHolder = _main.contentHolder;
_stage = _main.stage;
reset();
}
private function navClickHandler(_arg1:CustomEvent):void{
switch (_arg1.data){
case Config.NAV_PAUSEGAME:
pauseToggle();
break;
case Config.NAV_MAINMENU:
quitToMainScreen();
break;
};
}
public function set highScoreChallenge(_arg1:int):void{
_highScoreChallenge = _arg1;
}
private function comboHandler(_arg1:Number):void{
if (_gameMode == GameControl.GAME_MODE_ARCADE){
_score = (_score + ((_arg1 - 1) * GameControl.SCORE_PER_ENEMY));
} else {
_score = (_score + (_arg1 - 1));
};
makeComicText(_player.x, (_player.y - 50), GameControl.COMICTEXT_TYPE_COMBO, _arg1);
}
private function makeCrack(){
var _local1:Crack;
_local1 = new Crack();
_local1.y = (GameControl.GROUND_Y + 37);
_local1.x = _player.x;
_local1.gotoAndStop((Math.round((Math.random() * 3)) + 1));
_gameScreen.crackHolder.addChild(_local1);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:int;
_local2 = 5;
switch (_arg1.keyCode){
case 80:
pauseToggle();
break;
case 37:
if (_main.debugMode == true){
_gameCamera.xOffset = (_gameCamera.xOffset - _local2);
};
break;
case 39:
if (_main.debugMode == true){
_gameCamera.xOffset = (_gameCamera.xOffset + _local2);
};
break;
case 38:
if (_main.debugMode == true){
_gameCamera.yOffset = (_gameCamera.yOffset - _local2);
};
break;
case 40:
if (_main.debugMode == true){
_gameCamera.yOffset = (_gameCamera.yOffset + _local2);
};
break;
};
}
public function set gameMode(_arg1:String):void{
_gameMode = _arg1;
}
public function set highScoreArcade(_arg1:int):void{
_highScoreArcade = _arg1;
}
private function calculate():void{
var _local1:Date;
var _local2:int;
var _local3:int;
var _local4:Boolean;
var _local5:Number;
var _local6:int;
var _local7:GameSprite;
var _local8:Date;
_player.checkPower();
_player.checkDoubleUp();
_player.checkOtherSprites();
_gameCamera.calculate(_player.x, _player.y, _player.speedX, _player.speedY);
_local1 = new Date();
if ((_local1.getTime() - _comboTime.getTime()) > GameControl.COMBO_HIT_TIME){
if (_comboCount > 1){
comboHandler(_comboCount);
_local6 = ((_player.isDoubleUp)==true) ? (GameControl.MIN_COMBO_FOR_BONUS * 2) : GameControl.MIN_COMBO_FOR_BONUS;
if (_comboCount >= _local6){
createSprite(BonusSprite);
};
};
_comboCount = 0;
};
_local2 = _gameScreen.spriteHolder.numChildren;
_local3 = 0;
_local4 = true;
_local5 = 0;
while (_local5 < _local2) {
_local7 = GameSprite(_gameScreen.spriteHolder.getChildAt(_local5));
if ((_local7 is Player)){
} else {
if ((_local7 is BonusSprite)){
_local3++;
} else {
Enemy(_local7).calculateSpeed(_player);
};
};
_local5++;
};
if (_gameMode == GameControl.GAME_MODE_ARCADE){
_local8 = new Date();
_currentTime = (_local8.getTime() - _timeStarted.getTime());
_timeRemaining = (((Config.TIMER_MODE_TIMEPERGAME * 1000) - _currentTime) + _pausedTime);
if (_timeRemaining <= 0){
gameOver();
};
};
if (((((_local2 - 1) < GameControl.MAX_ENEMIES)) && ((Math.random() < GameControl.ENEMY_CREATION_CHANCE)))){
createSprite(Enemy);
};
}
private function spritesHittingHandler(_arg1:CustomEvent):void{
if ((_arg1.data.target is Player)){
if ((_arg1.data.sprite is Enemy)){
_player.enemiesHitThisJump++;
_player.dispatchEvent(new CustomEvent(GameSprite.EVENT_ENEMY_HIT, {enemy:_arg1.data.sprite}));
} else {
if ((_arg1.data.sprite is BonusSprite)){
_player.dispatchEvent(new CustomEvent(GameSprite.EVENT_BONUS_HIT, {bonus:_arg1.data.sprite}));
};
};
};
}
public static function get lastEnemyType():String{
return (instance._lastEnemyType);
}
public static function getInstance():GameControl{
return (instance);
}
}
}//package marvel.centralsmashdown.game.control
Section 60
//BonusSprite (marvel.centralsmashdown.game.sprites.BonusSprite)
package marvel.centralsmashdown.game.sprites {
import marvel.centralsmashdown.game.control.*;
import flash.display.*;
public class BonusSprite extends GameSprite {
private var _type:String;
public var typesMov:MovieClip;
public function BonusSprite(){
speedX = 0;
speedY = 0;
accelerationX = 0;
accelerationY = 0;
resistanceX = 1;
resistanceY = 1;
maxYPos = GameControl.ENEMY_MAX_Y;
maxXPos = (GameControl.GAME_WIDTH + GameControl.ENEMY_START_PADDING_X);
minXPos = -(GameControl.ENEMY_START_PADDING_X);
}
public function set type(_arg1:String){
_type = _arg1;
typesMov.gotoAndStop(_arg1);
}
public function ready():void{
currentStatus = GameSprite.STATUS_ALIVE;
}
public function get type():String{
return (_type);
}
}
}//package marvel.centralsmashdown.game.sprites
Section 61
//Enemy (marvel.centralsmashdown.game.sprites.Enemy)
package marvel.centralsmashdown.game.sprites {
import marvel.centralsmashdown.game.control.*;
import flash.display.*;
public class Enemy extends GameSprite {
public var distance:Number;
private var _amplitude:Number;
private var _count:int;// = 0
public var enemyType:String;
public var char:MovieClip;
public var aimSpeedY:Number;
public var opp:Number;
public var aimSpeedX:Number;
public var adj:Number;
public var angle:Number;
public static var FOLLOWER_MIN_RADIUS:int = 50;
public static var MAX_SPEED_X:Number = 5;
public static var MAX_SPEED_Y:Number = 2.5;
public static var AIM_CHANGE_CHANCE:Number = 0.02;
public static var SNAKE_AMPLITUDE:Number = 3;
public static var SPEED_AIM_RATE:int = 20;
public function Enemy(){
_count = 0;
super();
maxYPos = GameControl.ENEMY_MAX_Y;
maxXPos = (GameControl.GAME_WIDTH + GameControl.ENEMY_START_PADDING_X);
minXPos = -(GameControl.ENEMY_START_PADDING_X);
}
public function chooseType():void{
var _local1:Number;
while ((((enemyType == null)) || ((GameControl.lastEnemyType == enemyType)))) {
_local1 = Math.random();
if (_local1 < (1 / 8)){
enemyType = GameControl.ENEMY_TYPE_FOLLOWER;
} else {
if (_local1 < (3 / 8)){
enemyType = GameControl.ENEMY_TYPE_FLOATER;
} else {
if (_local1 < (6 / 8)){
enemyType = GameControl.ENEMY_TYPE_MOVER;
} else {
enemyType = GameControl.ENEMY_TYPE_SNAKE;
};
};
};
};
char.gotoAndStop(enemyType);
}
private function getRandomSpeed():void{
aimSpeedX = ((Math.random() * (Enemy.MAX_SPEED_X * 2)) - Enemy.MAX_SPEED_X);
aimSpeedY = ((Math.random() * (Enemy.MAX_SPEED_Y * 2)) - Enemy.MAX_SPEED_Y);
if ((((((aimSpeedX < 0)) && ((x < -(GameControl.ENEMY_START_PADDING_X))))) || ((((aimSpeedX > 0)) && ((x > (GameControl.GAME_WIDTH + GameControl.ENEMY_START_PADDING_X))))))){
aimSpeedX = -(aimSpeedX);
};
}
public function init(_arg1:Player){
var _local2:Number;
speedX = 0;
speedY = 0;
accelerationX = 0;
accelerationY = 0;
resistanceX = 1;
resistanceY = 1;
chooseType();
_local2 = ((Math.random() * GameControl.ENEMY_CREATION_RANGE) + GameControl.ENEMY_START_PADDING_Y);
if ((((_arg1.isGrounded == true)) || ((_arg1.speedY < 0)))){
_local2 = -(_local2);
};
y = (_arg1.y + _local2);
switch (enemyType){
case GameControl.ENEMY_TYPE_FOLLOWER:
case GameControl.ENEMY_TYPE_FLOATER:
x = (Math.random() * GameControl.GAME_WIDTH);
break;
case GameControl.ENEMY_TYPE_MOVER:
case GameControl.ENEMY_TYPE_SNAKE:
x = ((Math.random())>0.5) ? -(GameControl.ENEMY_START_PADDING_X) : (GameControl.GAME_WIDTH + GameControl.ENEMY_START_PADDING_X);
_amplitude = ((enemyType)==GameControl.ENEMY_TYPE_MOVER) ? 0 : Enemy.SNAKE_AMPLITUDE;
scaleX = ((((enemyType == GameControl.ENEMY_TYPE_MOVER)) && ((x == -(GameControl.ENEMY_START_PADDING_X))))) ? -1 : 1;
break;
};
resetAim(_arg1);
}
public function calculateSpeed(_arg1:GameSprite):void{
var _local2:Object;
_local2 = calculateRelativePosition(_arg1);
adj = _local2.adj;
opp = _local2.opp;
angle = _local2.angle;
distance = _local2.distance;
speedX = (speedX + ((aimSpeedX - speedX) / Enemy.SPEED_AIM_RATE));
speedY = (speedY + ((aimSpeedY - speedY) / Enemy.SPEED_AIM_RATE));
if (speedX > Enemy.MAX_SPEED_X){
speedX = Enemy.MAX_SPEED_X;
};
if (speedY > Enemy.MAX_SPEED_Y){
speedY = Enemy.MAX_SPEED_Y;
};
if (speedX < -(Enemy.MAX_SPEED_X)){
speedX = -(Enemy.MAX_SPEED_X);
};
if (speedY < -(Enemy.MAX_SPEED_Y)){
speedY = -(Enemy.MAX_SPEED_Y);
};
switch (enemyType){
case GameControl.ENEMY_TYPE_FOLLOWER:
case GameControl.ENEMY_TYPE_FLOATER:
if (Math.random() < Enemy.AIM_CHANGE_CHANCE){
resetAim(_arg1);
};
break;
case GameControl.ENEMY_TYPE_MOVER:
case GameControl.ENEMY_TYPE_SNAKE:
resetAim(_arg1);
break;
};
}
override public function setToMaxY():void{
switch (enemyType){
case GameControl.ENEMY_TYPE_FLOATER:
if (aimSpeedY > 0){
aimSpeedY = -(aimSpeedY);
};
break;
case GameControl.ENEMY_TYPE_MOVER:
break;
};
super.setToMaxY();
}
public function resetAim(_arg1:GameSprite){
var _local2:*;
var _local3:Number;
var _local4:Number;
switch (enemyType){
case GameControl.ENEMY_TYPE_FOLLOWER:
if (Player(_arg1).isGrounded != true){
_local2 = (Math.random() * (Math.PI * 2));
_local3 = (_arg1.x + (Math.sin(_local2) * Enemy.FOLLOWER_MIN_RADIUS));
_local4 = (_arg1.y + (Math.cos(_local2) * Enemy.FOLLOWER_MIN_RADIUS));
aimSpeedX = ((_local3 - x) / Enemy.SPEED_AIM_RATE);
aimSpeedY = ((_local4 - y) / Enemy.SPEED_AIM_RATE);
} else {
getRandomSpeed();
};
break;
case GameControl.ENEMY_TYPE_FLOATER:
getRandomSpeed();
break;
case GameControl.ENEMY_TYPE_MOVER:
case GameControl.ENEMY_TYPE_SNAKE:
if (isNaN(aimSpeedX)){
aimSpeedX = ((this.x)<0) ? Enemy.MAX_SPEED_X : -(Enemy.MAX_SPEED_X);
};
_count++;
aimSpeedY = (_amplitude * Math.sin(((Math.PI / 180) * _count)));
break;
};
}
}
}//package marvel.centralsmashdown.game.sprites
Section 62
//GameSprite (marvel.centralsmashdown.game.sprites.GameSprite)
package marvel.centralsmashdown.game.sprites {
import marvel.centralsmashdown.game.control.*;
import flash.events.*;
import com.markdavies.events.*;
import flash.display.*;
import flash.errors.*;
public class GameSprite extends MovieClip {
public var accelerationX:Number;
public var minXPos:Number;
public var resistanceX:Number;
public var resistanceY:Number;
public var maxYPos:Number;
public var maxXPos:Number;
public var currentStatus:String;
public var accelerationY:Number;
public var speedX:Number;
public var speedY:Number;
public static var EVENT_GROUND_HIT:String = "groundHit";
public static var EVENT_ENEMY_DIE:String = "enemyDie";
public static var EVENT_PLAYER_JUMP:String = "playerJump";
public static var STATUS_ALIVE:String = "alive";
public static var EVENT_OUTSIDE_BORDERS:String = "outsideBorders";
public static var STATUS_DEAD:String = "dead";
public static var EVENT_IS_HITTING_SPRITE:String = "spritesHitting";
public static var EVENT_ENEMY_HIT:String = "enemyHit";
public static var EVENT_BONUS_HIT:String = "bonusHit";
public static var STATUS_CREATING:String = "creating";
public function GameSprite(){
currentStatus = GameSprite.STATUS_ALIVE;
this.addEventListener(GameSprite.EVENT_ENEMY_DIE, dieHandler);
}
public function checkGroundHit():void{
if (this.y > maxYPos){
dispatchEvent(new CustomEvent(GameSprite.EVENT_GROUND_HIT, {target:this}));
};
}
public function checkOtherSprites():Boolean{
var _local1:Object;
var _local2:Boolean;
var _local3:Number;
var _local4:GameSprite;
_local2 = true;
if (this.parent == null){
return (false);
};
_local3 = 0;
while (_local3 < this.parent.numChildren) {
_local4 = GameSprite(this.parent.getChildAt(_local3));
_local1 = calculateRelativePosition(_local4);
if (((((!((_local4 == this))) && ((_local1.distance < GameControl.HIT_DISTANCE)))) && ((_local4.currentStatus == GameSprite.STATUS_ALIVE)))){
_local2 = true;
dispatchEvent(new CustomEvent(GameSprite.EVENT_IS_HITTING_SPRITE, {target:this, sprite:_local4, pos:_local1}));
} else {
if ((((this is Player)) && ((_local1.distance > GameControl.ENEMY_REMOVE_RANGE)))){
if ((((_local4 is Enemy)) || ((_local4 is BonusSprite)))){
_local4.die();
};
};
};
_local3++;
};
return (_local2);
}
public function checkOutsideBorders():void{
if ((((this.x < minXPos)) || ((this.x > maxXPos)))){
dispatchEvent(new CustomEvent(GameSprite.EVENT_OUTSIDE_BORDERS, {target:this, direction:(this.x > maxXPos)}));
};
}
public function setToMaxY():void{
this.y = maxYPos;
}
public function die():void{
try {
parent.removeChild(this);
} catch(e:TypeError) {
trace(("cant find " + this.name));
};
}
private function dieHandler(_arg1:Event){
die();
}
public function calculateRelativePosition(_arg1:GameSprite):Object{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = (_arg1.x - x);
_local3 = (_arg1.y - y);
_local4 = Math.atan2(_local2, _local3);
_local5 = Math.sqrt((Math.pow(_local2, 2) + Math.pow(_local3, 2)));
return ({adj:_local2, opp:_local3, angle:_local4, distance:_local5});
}
public function move():void{
speedX = (speedX + accelerationX);
speedY = (speedY + accelerationY);
accelerationX = (accelerationX * resistanceX);
accelerationY = (accelerationY * resistanceY);
this.x = (this.x + speedX);
this.y = (this.y + speedY);
checkGroundHit();
checkOutsideBorders();
}
}
}//package marvel.centralsmashdown.game.sprites
Section 63
//MiniMapSprite (marvel.centralsmashdown.game.sprites.MiniMapSprite)
package marvel.centralsmashdown.game.sprites {
import flash.display.*;
public class MiniMapSprite extends MovieClip {
}
}//package marvel.centralsmashdown.game.sprites
Section 64
//Player (marvel.centralsmashdown.game.sprites.Player)
package marvel.centralsmashdown.game.sprites {
import marvel.centralsmashdown.game.control.*;
import flash.events.*;
import com.markdavies.events.*;
import flash.display.*;
import com.gs.*;
import marvel.centralsmashdown.*;
import flash.geom.*;
public class Player extends GameSprite {
private var _power:Number;
private var _status:String;
private var _isDoubleUp:Boolean;
public var doubleUpBar:MovieClip;
private var _gameControl:GameControl;
private var _mouseIsDown:Boolean;
private var _doubleUpStart:Date;
public var inner:MovieClip;
private var _mouseY:Number;
public var enemiesHitThisJump:Number;
public var isGrounded:Boolean;
private var _main:Main;
public var powerBar:MovieClip;
private var _mouseX:Number;
public var dropHeight:Number;
public static var STATUS_IDLE:String = "idle";
public static var MIN_JUMP_SPEED:Number = -10;
public static var DOUBLE_UP_TIME:Number = 10000;
public static var MIN_POWER_FOR_JUMP:Number = 0.15;
public static var RECHARGE_POWER_RATE:Number = 0.0125;
public static var STATUS_FLY:String = "fly";
public static var TIME_POWERBAR_FADEUP:Number = 0.5;
public static var STATUS_LAND:String = "land";
public static var STATUS_JUMP:String = "jump";
public static var STATUS_DROP:String = "drop";
public static var MAX_JUMP_SPEED:Number = -25;
public static var STATUS_POWERUP:String = "powerup";
public static var MOUSE_FOLLOW_RATE:Number = 0.035;
public static var DEFAULT_ACCELERATION_Y:Number = 0.4;
public static var ANIM_DROP_SPEEDY:Number = -15;
public function Player(){
maxYPos = GameControl.GROUND_Y;
maxXPos = (GameControl.GAME_WIDTH - 50);
minXPos = 50;
_gameControl = GameControl.getInstance();
_main = Main.getInstance();
}
public function set isDoubleUp(_arg1:Boolean):void{
_isDoubleUp = _arg1;
if (_arg1 == true){
_doubleUpStart = new Date();
TweenLite.to(doubleUpBar, Player.TIME_POWERBAR_FADEUP, {alpha:1});
} else {
TweenLite.to(doubleUpBar, Player.TIME_POWERBAR_FADEUP, {alpha:0});
};
}
public function set power(_arg1:Number):void{
_power = _arg1;
}
public function jump(_arg1:Number):void{
var _local2:int;
if (isGrounded == true){
_local2 = (Math.round((Math.random() * 4)) + 1);
_main.sc.play(("s_jump" + _local2.toString()));
};
dropHeight = 0;
isGrounded = false;
speedY = (Player.MIN_JUMP_SPEED + ((Player.MAX_JUMP_SPEED - Player.MIN_JUMP_SPEED) * _arg1));
accelerationY = Player.DEFAULT_ACCELERATION_Y;
status = Player.STATUS_JUMP;
dispatchEvent(new CustomEvent(GameSprite.EVENT_PLAYER_JUMP));
}
public function mouseReleaseHandler(_arg1:MouseEvent):void{
if ((((((_mouseIsDown == true)) && ((isGrounded == true)))) && ((_power > Player.MIN_POWER_FOR_JUMP)))){
jump(_power);
} else {
if (((!((_gameControl.paused == true))) && ((speedY == 0)))){
status = Player.STATUS_IDLE;
_power = 0;
};
};
TweenLite.to(powerBar, Player.TIME_POWERBAR_FADEUP, {alpha:0});
_mouseIsDown = false;
}
public function reset():void{
x = (GameControl.GAME_WIDTH / 2);
setToMaxY();
_power = 0;
powerBar.alpha = 0;
doubleUpBar.alpha = 0;
status = Player.STATUS_IDLE;
}
public function checkDoubleUp():void{
var _local1:Date;
var _local2:int;
if (_isDoubleUp == true){
_local1 = new Date();
_local2 = (_local1.getTime() - _doubleUpStart.getTime());
doubleUpBar.bar.scaleX = (1 - (_local2 / Player.DOUBLE_UP_TIME));
if (_local2 > Player.DOUBLE_UP_TIME){
isDoubleUp = false;
};
};
}
override public function setToMaxY():void{
super.setToMaxY();
enemiesHitThisJump = 0;
accelerationX = 0;
accelerationY = 0;
resistanceX = 0.98;
resistanceY = 1;
speedX = 0;
speedY = 0;
status = Player.STATUS_LAND;
isGrounded = true;
if (_mouseIsDown == true){
TweenLite.to(powerBar, Player.TIME_POWERBAR_FADEUP, {alpha:1});
};
}
public function set status(_arg1:String):void{
if (_arg1 != _status){
_status = _arg1;
inner.gotoAndPlay(_arg1);
};
}
public function get power():Number{
return (_power);
}
public function get isDoubleUp():Boolean{
return (_isDoubleUp);
}
public function mousePressHandler(_arg1:MouseEvent):void{
_mouseIsDown = true;
if ((((isGrounded == true)) && ((_gameControl.paused == false)))){
TweenLite.to(powerBar, Player.TIME_POWERBAR_FADEUP, {alpha:1});
status = Player.STATUS_POWERUP;
};
}
override public function move():void{
if (isGrounded == false){
speedX = (this.mouseX * Player.MOUSE_FOLLOW_RATE);
if (speedY > Player.ANIM_DROP_SPEEDY){
status = Player.STATUS_DROP;
};
inner.scaleX = ((speedX)>0) ? 1 : -1;
};
if (y < dropHeight){
dropHeight = y;
};
super.move();
}
public function checkPower():void{
if ((((_mouseIsDown == true)) && ((isGrounded == true)))){
_power = (_power + Player.RECHARGE_POWER_RATE);
powerBar.bar.scaleX = _power;
if (_power >= 1){
_power = 1;
jump(_power);
TweenLite.to(powerBar, Player.TIME_POWERBAR_FADEUP, {alpha:0});
};
};
}
}
}//package marvel.centralsmashdown.game.sprites
Section 65
//BackgroundPiece (marvel.centralsmashdown.game.views.BackgroundPiece)
package marvel.centralsmashdown.game.views {
import flash.display.*;
public class BackgroundPiece extends MovieClip {
public var tileNumber:Number;
}
}//package marvel.centralsmashdown.game.views
Section 66
//ComicTextDisplay (marvel.centralsmashdown.game.views.ComicTextDisplay)
package marvel.centralsmashdown.game.views {
import marvel.centralsmashdown.game.control.*;
import flash.display.*;
import com.gs.*;
public class ComicTextDisplay extends MovieClip {
private var _type:String;
public var txt:MovieClip;
private var _multiplier:int;
private static var PER_LETTER_DELAY:Number = 0.1;
public function ComicTextDisplay(){
_type = GameControl.COMICTEXT_TYPE_BOOM;
super();
}
public function set type(_arg1:String):void{
switch (_arg1){
case GameControl.COMICTEXT_TYPE_COMBO:
case GameControl.COMICTEXT_TYPE_BOOM:
case GameControl.COMICTEXT_TYPE_CRASH:
case GameControl.COMICTEXT_TYPE_SMASH:
case GameControl.COMICTEXT_TYPE_DOUBLEUP:
case GameControl.COMICTEXT_TYPE_TIMEUP:
_type = _arg1;
break;
};
}
private function die():void{
this.parent.removeChild(this);
}
public function set multiplier(_arg1:int):void{
_multiplier = _arg1;
}
public function go():void{
var _local1:Number;
var _local2:DisplayObject;
var _local3:Number;
_local1 = 0;
_local3 = (txt.numChildren - 1);
while (_local3 >= 0) {
_local2 = txt.getChildAt(_local3);
_local2.alpha = 0;
_local2.scaleX = 2;
_local2.scaleY = 2;
TweenLite.to(_local2, 0.25, {alpha:1, scaleX:1, scaleY:1, delay:_local1});
_local1 = (_local1 + ComicTextDisplay.PER_LETTER_DELAY);
_local3--;
};
if (_type == GameControl.COMICTEXT_TYPE_COMBO){
txt.multiMov.gotoAndStop((_multiplier - 1));
};
this.alpha = 1;
TweenLite.to(this, 0.5, {alpha:0, y:(this.y - 50), delay:2, onComplete:die});
}
public function show():void{
this.alpha = 0;
gotoAndStop(_type);
}
}
}//package marvel.centralsmashdown.game.views
Section 67
//GameOver (marvel.centralsmashdown.game.views.GameOver)
package marvel.centralsmashdown.game.views {
import marvel.centralsmashdown.game.control.*;
import flash.events.*;
import flash.display.*;
import com.gs.*;
public class GameOver extends MovieClip {
private var _gameControl:GameControl;
public var btnSubmitScore:MovieClip;
public var txt:MovieClip;
public var btnPlayAgain:MovieClip;
private static var HIGHLIGHT_TWEENTIME:Number = 0.25;
private static var BUTTON_EVENT:String = "buttonEvent";
public function GameOver(){
_gameControl = GameControl.getInstance();
}
public function init():void{
btnPlayAgain.addEventListener(MouseEvent.MOUSE_OVER, overHandler);
btnSubmitScore.addEventListener(MouseEvent.MOUSE_OVER, overHandler);
btnPlayAgain.addEventListener(MouseEvent.MOUSE_OUT, outHandler);
btnSubmitScore.addEventListener(MouseEvent.MOUSE_OUT, outHandler);
btnPlayAgain.addEventListener(MouseEvent.MOUSE_DOWN, downHandler);
btnSubmitScore.addEventListener(MouseEvent.MOUSE_DOWN, downHandler);
btnPlayAgain.buttonMode = true;
btnSubmitScore.buttonMode = true;
txt.hits.numHits.text = (((_gameControl.score.toString() + " HIT") + ((_gameControl.score)>1) ? "S" : "") + "!");
}
public function outHandler(_arg1:MouseEvent):void{
TweenFilterLite.to(_arg1.target, GameOver.HIGHLIGHT_TWEENTIME, {colorMatrixFilter:{brightness:1}, glowFilter:{color:13953073, alpha:0, blurX:6, blurY:6, strength:0, quality:1}});
}
public function downHandler(_arg1:MouseEvent):void{
if (_arg1.target == btnPlayAgain){
_gameControl.start();
this.parent.removeChild(this);
} else {
_gameControl.exit();
};
}
public function set mode(_arg1:String):void{
switch (_arg1){
case GameControl.GAME_MODE_ARCADE:
gotoAndStop(_arg1);
break;
case GameControl.GAME_MODE_CHALLENGE:
gotoAndStop(_arg1);
init();
break;
};
}
public function overHandler(_arg1:MouseEvent):void{
TweenFilterLite.to(_arg1.target, GameOver.HIGHLIGHT_TWEENTIME, {colorMatrixFilter:{brightness:1.25}, glowFilter:{color:13953073, alpha:0.5, blurX:2, blurY:2, strength:1, quality:1}});
}
}
}//package marvel.centralsmashdown.game.views
Section 68
//MiniMap (marvel.centralsmashdown.game.views.MiniMap)
package marvel.centralsmashdown.game.views {
import marvel.centralsmashdown.game.control.*;
import flash.events.*;
import flash.display.*;
import com.gs.*;
import flash.utils.*;
import flash.geom.*;
public class MiniMap extends MovieClip {
private var _gameCamera:GameCamera;
public var map:MovieClip;
private var yScale:Number;
public var _showing:Boolean;
public var masker:MovieClip;
private var _spriteList:Dictionary;
private var xScale:Number;
public var spriteHolder:MovieClip;
private static var GAME_SHOW_WIDTH:Number = 900;
private static var MINI_MAP_HEIGHT:Number = 113;
private static var MINI_MAP_WIDTH:Number = 65;
private static var GAME_SHOW_HEIGHT:Number = 700;
public function MiniMap(){
_spriteList = new Dictionary(true);
_gameCamera = GameCamera.getInstance();
spriteHolder = map.spriteHolder;
xScale = (MiniMap.MINI_MAP_WIDTH / MiniMap.GAME_SHOW_WIDTH);
yScale = (MiniMap.MINI_MAP_HEIGHT / MiniMap.GAME_SHOW_HEIGHT);
}
public function clearAll():void{
var _local1:Object;
for (_local1 in _spriteList) {
spriteDie(_spriteList[_local1]);
};
}
public function set(_arg1:Sprite){
var index:int;
var mov = _arg1;
if (!_spriteList[mov]){
createSprite(mov);
};
try {
index = spriteHolder.getChildIndex(_spriteList[mov]);
} catch(e:ArgumentError) {
createSprite(mov);
};
_spriteList[mov].x = (((mov.x * _gameCamera.scale) + _gameCamera.x) * xScale);
_spriteList[mov].y = (((mov.y * _gameCamera.scale) + _gameCamera.y) * yScale);
}
private function spriteDie(_arg1:MovieClip):void{
var sprite = _arg1;
try {
spriteHolder.removeChild(sprite);
} catch(e:RangeError) {
trace(("cant find " + sprite.name));
} catch(e:ArgumentError) {
trace(("cant find " + sprite.name));
};
}
public function remove(_arg1:Sprite){
var sprite:MovieClip;
var index:int;
var mov = _arg1;
if (_spriteList[mov]){
sprite = _spriteList[mov];
try {
index = spriteHolder.getChildIndex(sprite);
sprite = MovieClip(spriteHolder.getChildAt(index));
TweenLite.to(sprite, 0.5, {alpha:0, scaleX:2, scaleY:2, onComplete:spriteDie, onCompleteParams:[sprite]});
delete _spriteList[mov];
} catch(e:ArgumentError) {
};
};
}
public function set showing(_arg1:Boolean):void{
_showing = _arg1;
this.play();
}
private function createSprite(_arg1:Sprite):void{
var _local2:MovieClip;
var _local3:Number;
var _local4:ColorTransform;
_local2 = new MiniMapSprite();
_local3 = ((((_arg1 is Enemy)) || ((_arg1 is BonusSprite)))) ? 0.25 : 1;
if ((_arg1 is BonusSprite)){
if (BonusSprite(_arg1).types == GameControl.BONUS_TYPE_DOUBLEUP){
_local4 = new ColorTransform(1, 5, 50, 1, 0, 0, 0);
} else {
_local4 = new ColorTransform(1, 50, 5, 1, 0, 0, 0);
};
_local2.transform.colorTransform = _local4;
};
_local2.scaleX = (_local2.scaleY = 2);
_local2.alpha = 0;
TweenLite.to(_local2, 0.5, {alpha:1, scaleX:_local3, scaleY:_local3});
_spriteList[_arg1] = _local2;
spriteHolder.addChild(_local2);
}
}
}//package marvel.centralsmashdown.game.views
Section 69
//QuitToMain (marvel.centralsmashdown.game.views.QuitToMain)
package marvel.centralsmashdown.game.views {
import com.markdavies.events.*;
import flash.display.*;
import com.gs.*;
import marvel.centralsmashdown.*;
import com.markdavies.control.*;
import flash.text.*;
public class QuitToMain extends MovieClip {
public var btnYes:MovieClip;
public var btnNo:MovieClip;
private var _bs:ButtonSet;
private static var HIGHLIGHT_TWEENTIME:Number = 0.25;
private static var BUTTON_EVENT:String = "buttonEvent";
public function QuitToMain(){
init();
}
public function init():void{
var _local1:TextFormat;
_local1 = btnYes.txt.txt.getTextFormat();
_local1.letterSpacing = -0.8;
btnYes.txt.txt.text = "YES";
btnNo.txt.txt.text = "NO";
btnYes.txt.txt.setTextFormat(_local1);
btnNo.txt.txt.setTextFormat(_local1);
_bs = new ButtonSet();
_bs.addButton(btnYes, overHandler, downHandler, outHandler, new CustomEvent(Config.NAV_QUITMAIN_YES, {target:btnYes, click:Config.NAV_QUITMAIN_YES}));
_bs.addButton(btnNo, overHandler, downHandler, outHandler, new CustomEvent(Config.NAV_QUITMAIN_NO, {target:btnNo, click:Config.NAV_QUITMAIN_NO}));
}
public function outHandler(_arg1:CustomEvent):void{
TweenFilterLite.to(_arg1.data.target, QuitToMain.HIGHLIGHT_TWEENTIME, {colorMatrixFilter:{brightness:1}, glowFilter:{color:13953073, alpha:0, blurX:6, blurY:6, strength:0, quality:1}});
}
public function downHandler(_arg1:CustomEvent):void{
dispatchEvent(new CustomEvent(Main.EVENT_NAV_CLICK, _arg1.data.click));
}
public function overHandler(_arg1:CustomEvent):void{
TweenFilterLite.to(_arg1.data.target, QuitToMain.HIGHLIGHT_TWEENTIME, {colorMatrixFilter:{brightness:1.25}, glowFilter:{color:13953073, alpha:0.5, blurX:2, blurY:2, strength:1, quality:1}});
}
}
}//package marvel.centralsmashdown.game.views
Section 70
//RumblePack (marvel.centralsmashdown.game.views.RumblePack)
package marvel.centralsmashdown.game.views {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class RumblePack extends Sprite {
private var _rumbleAmt:Number;
private var _bitmapData:BitmapData;
private var _bitmap:Bitmap;
private var _rumbleTimer:Timer;
private var _srcMov:MovieClip;
private var _alphaDecay:Number;
private var _h:Number;
private var _rumbleDecay:Number;
private var _x:Number;
private var _y:Number;
private var _w:Number;
private static var START_ALPHA:Number = 0.6;
private static var MAX_RUMBLE_DISTANCE:Number = 50;
private static var TIMER_RATE:Number = 50;
public function create(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{
_srcMov = _arg1;
_w = _arg2;
_h = _arg3;
_x = _arg4;
_y = _arg5;
_bitmap = getBitmap();
this.addChild(_bitmap);
this.alpha = RumblePack.START_ALPHA;
this.mouseEnabled = false;
this.mouseChildren = false;
}
private function getBitmap():Bitmap{
var _local1:Matrix;
var _local2:Bitmap;
if (_bitmapData){
_bitmapData.dispose();
};
_bitmapData = new BitmapData(_w, _h, true, 0xFFFFFF);
_local1 = new Matrix(1, 0, 0, 1, _x, _y);
_bitmapData.draw(_srcMov, _local1);
_local2 = new Bitmap(_bitmapData);
return (_local2);
}
private function die():void{
_rumbleTimer.removeEventListener(TimerEvent.TIMER, rumble);
_rumbleTimer.stop();
this.parent.removeChild(this);
}
private function rumble(_arg1:TimerEvent):void{
var e = _arg1;
_rumbleAmt = (_rumbleAmt - _rumbleDecay);
this.alpha = (this.alpha - _alphaDecay);
if (_rumbleAmt <= 0){
die();
};
try {
removeChild(_bitmap);
} catch(e:Error) {
};
_bitmap = getBitmap();
this.addChild(_bitmap);
_bitmap.x = ((Math.random() * _rumbleAmt) - (_rumbleAmt / 2));
_bitmap.y = ((Math.random() * _rumbleAmt) - (_rumbleAmt / 2));
}
public function startRumble(_arg1:Number, _arg2:Number):void{
_rumbleDecay = (_arg1 / ((_arg2 * 1000) / RumblePack.TIMER_RATE));
_alphaDecay = (1 / ((_arg2 * 1000) / RumblePack.TIMER_RATE));
_rumbleAmt = _arg1;
_rumbleTimer = new Timer(RumblePack.TIMER_RATE);
_rumbleTimer.addEventListener(TimerEvent.TIMER, rumble);
_rumbleTimer.start();
}
}
}//package marvel.centralsmashdown.game.views
Section 71
//GameScreen (marvel.centralsmashdown.game.GameScreen)
package marvel.centralsmashdown.game {
import flash.display.*;
import com.markdavies.debug.*;
public class GameScreen extends MovieClip {
public var crackHolder:MovieClip;
public var backgroundHolder:MovieClip;
public var spriteHolder:MovieClip;
public static var PIXELS_PER_TILE:Number = 500;
public static var TILE_START_Y:Number = 108;
public function render(){
var _local1:Number;
var _local2:int;
var _local3:int;
var _local4:BackgroundPiece;
var _local5:Boolean;
var _local6:int;
var _local7:int;
_local1 = Math.round(((this.y - GameScreen.TILE_START_Y) / (GameScreen.PIXELS_PER_TILE * scaleX)));
_local2 = (_local1 - 1);
_local3 = (_local1 + 2);
if (_local2 < 0){
_local2 = 0;
};
_local6 = 0;
while (_local6 < backgroundHolder.numChildren) {
_local4 = BackgroundPiece(backgroundHolder.getChildAt(_local6));
if ((((_local4.tileNumber < _local2)) || ((_local4.tileNumber > _local3)))){
backgroundHolder.removeChild(_local4);
};
_local6++;
};
_local7 = _local2;
while (_local7 <= _local3) {
_local5 = false;
_local6 = 0;
while (_local6 < backgroundHolder.numChildren) {
if (BackgroundPiece(backgroundHolder.getChildAt(_local6)).tileNumber == _local7){
_local5 = true;
break;
};
_local6++;
};
if (_local5 == false){
_local4 = new BackgroundPiece();
_local4.tileNumber = _local7;
_local4.y = (-((_local7 * GameScreen.PIXELS_PER_TILE)) + GameScreen.TILE_START_Y);
_local4.gotoAndStop(_local7);
backgroundHolder.addChild(_local4);
};
_local7++;
};
DebugBox.debug("currentPoint", ((((Math.round((this.y - GameScreen.TILE_START_Y)) + "/") + GameScreen.PIXELS_PER_TILE) + " ") + _local1));
}
}
}//package marvel.centralsmashdown.game
Section 72
//CountryDropDown (marvel.centralsmashdown.ui.CountryDropDown)
package marvel.centralsmashdown.ui {
import flash.events.*;
import flash.display.*;
import com.gs.*;
import marvel.centralsmashdown.*;
import marvel.centralsmashdown.utils.*;
import flash.geom.*;
public class CountryDropDown extends MovieClip {
private var _scrollHeight:Number;
private var _countries:Array;
private var _flagsSrc:Flags;
public var selectedItem:CountryDropDownItem;
private var _scrollIndex:int;
public var scroller:MovieClip;
public var list:MovieClip;
private var _clicked:Boolean;// = false
public static var SCROLL_MIN_Y:Number = 1;
public static var SCROLL_MAX_Y:Number = 87;
public function CountryDropDown(){
var _local1:*;
_clicked = false;
super();
_countries = Config.COUNTRY_IDS;
scroller = list.scroller;
_flagsSrc = new Flags();
_scrollHeight = (CountryDropDown.SCROLL_MAX_Y - CountryDropDown.SCROLL_MIN_Y);
selectedItem.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
this.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
this.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
selectedItem.buttonMode = true;
selectedItem.mouseEnabled = true;
selectedItem.mouseChildren = false;
scroller.buttonMode = true;
_local1 = 1;
while (_local1 < 6) {
list[("item" + _local1)].buttonMode = true;
list[("item" + _local1)].mouseChildren = false;
list[("item" + _local1)].addEventListener(MouseEvent.MOUSE_DOWN, itemClickedHandler);
list[("item" + _local1)].addEventListener(MouseEvent.MOUSE_OVER, itemOverHandler);
list[("item" + _local1)].addEventListener(MouseEvent.MOUSE_OUT, itemOutHandler);
_local1++;
};
scrollIndex = 0;
setFlagItems();
selectedMarvelCode = "1";
}
private function hideList():void{
TweenLite.to(list, 0.5, {y:225, onComplete:function (){
_clicked = false;
}});
scroller.stopDrag();
scroller.removeEventListener(MouseEvent.MOUSE_DOWN, scrollDownHandler);
scroller.removeEventListener(MouseEvent.MOUSE_UP, scrollUpHandler);
scroller.removeEventListener(MouseEvent.MOUSE_MOVE, scrollMoveHandler);
}
public function get selectedCountryCode():String{
return (_countries[_scrollIndex].code);
}
public function get selectedMarvelCode():String{
return (_countries[_scrollIndex].id);
}
public function set selectedCountryCode(_arg1:String):void{
var _local2:Number;
_local2 = 0;
while (_local2 < _countries.length) {
if (_countries[_local2].code == _arg1){
selectedIndex = _local2;
return;
};
_local2++;
};
}
public function set scrollIndex(_arg1:int):void{
var _local2:Number;
if (_arg1 >= _countries.length){
return;
};
_local2 = (_arg1 / (_countries.length - 5));
scroller.y = (CountryDropDown.SCROLL_MIN_Y + (_scrollHeight * _local2));
_scrollIndex = _arg1;
scrollMoveHandler(null);
}
private function itemClickedHandler(_arg1:MouseEvent):void{
scroller.stopDrag();
selectedIndex = _arg1.target.index;
_clicked = true;
hideList();
}
private function scrollMoveHandler(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:Number;
_local2 = (scroller.y - CountryDropDown.SCROLL_MIN_Y);
_local3 = (_local2 / _scrollHeight);
if (_local3 > 1){
_local3 = 1;
};
_scrollIndex = Math.round((_local3 * (_countries.length - 5)));
setFlagItems();
}
public function set selectedMarvelCode(_arg1:String):void{
var _local2:Number;
_local2 = 0;
while (_local2 < _countries.length) {
if (_countries[_local2].id == _arg1){
selectedIndex = _local2;
return;
};
_local2++;
};
}
private function scrollDownHandler(_arg1:MouseEvent):void{
scroller.startDrag(false, new Rectangle(221, CountryDropDown.SCROLL_MIN_Y, 0, CountryDropDown.SCROLL_MAX_Y));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
if (_clicked != true){
showList();
};
}
public function setFlagItems():void{
var _local1:*;
var _local2:int;
var _local3:FlagMaker;
_local1 = 1;
while (_local1 < 6) {
_local2 = (_scrollIndex + (_local1 - 1));
_local3 = new FlagMaker(_flagsSrc, _countries[_local2].code);
list[("item" + _local1)].setCountry(_countries[_local2].name, _local3, _local2);
_local1++;
};
}
private function mouseOutHandler(_arg1:MouseEvent):void{
hideList();
}
private function itemOutHandler(_arg1:MouseEvent):void{
_arg1.target.ro.alpha = 0;
}
private function itemOverHandler(_arg1:MouseEvent):void{
_arg1.target.ro.alpha = 0.5;
}
private function showList():void{
TweenLite.to(list, 0.5, {y:319});
scroller.addEventListener(MouseEvent.MOUSE_DOWN, scrollDownHandler);
scroller.addEventListener(MouseEvent.MOUSE_UP, scrollUpHandler);
scroller.addEventListener(MouseEvent.MOUSE_MOVE, scrollMoveHandler);
scrollMoveHandler(null);
}
private function scrollUpHandler(_arg1:MouseEvent):void{
scroller.stopDrag();
}
public function set selectedIndex(_arg1:int):void{
var _local2:FlagMaker;
if (_arg1 >= _countries.length){
return;
};
_local2 = new FlagMaker(_flagsSrc, _countries[_arg1].code);
selectedItem.setCountry(_countries[_arg1].name, _local2, _arg1);
scrollIndex = _arg1;
}
private function mouseOverHandler(_arg1:MouseEvent):void{
if (_clicked != true){
showList();
};
}
}
}//package marvel.centralsmashdown.ui
Section 73
//CountryDropDownItem (marvel.centralsmashdown.ui.CountryDropDownItem)
package marvel.centralsmashdown.ui {
import flash.display.*;
import marvel.centralsmashdown.utils.*;
import flash.text.*;
public class CountryDropDownItem extends MovieClip {
public var ro:MovieClip;
public var countryName:TextField;
public var flag:MovieClip;
public var index:int;
public function setCountry(_arg1:String, _arg2:FlagMaker, _arg3:int):void{
if (flag.numChildren > 0){
flag.removeChildAt(0);
};
flag.addChild(_arg2);
countryName.text = _arg1.toUpperCase();
this.index = _arg3;
}
}
}//package marvel.centralsmashdown.ui
Section 74
//FlagMaker (marvel.centralsmashdown.utils.FlagMaker)
package marvel.centralsmashdown.utils {
import flash.display.*;
import marvel.centralsmashdown.*;
import flash.geom.*;
public class FlagMaker extends Bitmap {
private var _flagWidth;// = 16
private var _flagHeight;// = 11
private var _flagBitmapLookupRef:Array;
public function FlagMaker(_arg1:MovieClip, _arg2:String){
var _local3:BitmapData;
var _local4:int;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Matrix;
_flagWidth = 16;
_flagHeight = 11;
_flagBitmapLookupRef = Config.FLAG_CODES.split(" ");
_local4 = 0;
if (_arg2 != "undefined"){
_local5 = 0;
while (_local5 < _flagBitmapLookupRef.length) {
if (_flagBitmapLookupRef[_local5].toLowerCase() == _arg2.toLowerCase()){
_local4 = _local5;
break;
};
_local5++;
};
_local6 = ((_local4 % 22) * _flagWidth);
_local7 = (Math.floor((_local4 / 22)) * _flagHeight);
_local3 = new BitmapData(_flagWidth, _flagHeight, true, 0xFFFFFF);
_local8 = new Matrix(1, 0, 0, 1, -(_local6), -(_local7));
_local3.draw(_arg1, _local8);
} else {
_local3 = new BitmapData(_flagWidth, _flagHeight, true, 0xFFFFFF);
_local3.fillRect(new Rectangle(0, 0, _flagWidth, _flagHeight), 0xFFFFFF);
};
super(_local3);
}
}
}//package marvel.centralsmashdown.utils
Section 75
//BottomNav (marvel.centralsmashdown.views.BottomNav)
package marvel.centralsmashdown.views {
import com.markdavies.events.*;
import flash.display.*;
import com.gs.*;
import marvel.centralsmashdown.*;
import com.markdavies.control.*;
import flash.text.*;
public class BottomNav extends MovieClip {
private var _btnPauseGame:MovieClip;
public var screensNav:MovieClip;
private var _screenBS:ButtonSet;
public var _menu:String;
private var _btnStartGame:MovieClip;
private var _btnMoreGames:MovieClip;
private var _btnMainMenu:MovieClip;
private var _main:Main;
private var _btnHowToPlay:MovieClip;
public var gameNav:MovieClip;
private var _btnSendToFriend:MovieClip;
private var _btnHighScores:MovieClip;
private var _gameBS:ButtonSet;
private static var HIGHLIGHT_TWEENTIME:Number = 0.25;
private static var BUTTON_EVENT:String = "buttonEvent";
public function BottomNav(){
_menu = Main.MENU_MODE_SCREEN;
super();
}
public function init():void{
var _local1:TextFormat;
_btnStartGame = screensNav.btnStartGame;
_btnHowToPlay = screensNav.btnHowToPlay;
_btnHighScores = screensNav.btnHighScores;
_btnSendToFriend = screensNav.btnSendToFriend;
_btnMoreGames = screensNav.btnMoreGames;
_btnPauseGame = gameNav.btnPauseGame;
_btnMainMenu = gameNav.btnMainMenu;
_local1 = _btnStartGame.txt.txt.getTextFormat();
_local1.letterSpacing = -0.8;
_btnStartGame.txt.txt.text = "START GAME";
_btnHowToPlay.txt.txt.text = "HOW TO PLAY";
_btnHighScores.txt.txt.text = "HIGH SCORES";
_btnSendToFriend.txt.txt.text = "SEND TO A FRIEND";
_btnMoreGames.txt.txt.text = "MORE GAMES";
_btnPauseGame.txt.txt.text = "PAUSE GAME";
_btnMainMenu.txt.txt.text = "MAIN MENU";
_btnStartGame.txt.txt.setTextFormat(_local1);
_btnHowToPlay.txt.txt.setTextFormat(_local1);
_btnHighScores.txt.txt.setTextFormat(_local1);
_btnSendToFriend.txt.txt.setTextFormat(_local1);
_btnMoreGames.txt.txt.setTextFormat(_local1);
_btnPauseGame.txt.txt.setTextFormat(_local1);
_btnMainMenu.txt.txt.setTextFormat(_local1);
_screenBS = new ButtonSet();
_screenBS.addButton(_btnStartGame, overHandler, downHandler, outHandler, new CustomEvent(BottomNav.BUTTON_EVENT, {target:_btnStartGame, click:Config.NAV_STARTGAME}));
_screenBS.addButton(_btnHowToPlay, overHandler, downHandler, outHandler, new CustomEvent(BottomNav.BUTTON_EVENT, {target:_btnHowToPlay, click:Config.NAV_HOWTOPLAY}));
_screenBS.addButton(_btnHighScores, overHandler, downHandler, outHandler, new CustomEvent(BottomNav.BUTTON_EVENT, {target:_btnHighScores, click:Config.NAV_HIGHSCORES}));
_screenBS.addButton(_btnSendToFriend, overHandler, downHandler, outHandler, new CustomEvent(BottomNav.BUTTON_EVENT, {target:_btnSendToFriend, click:Config.NAV_SENDTOFRIEND}));
_screenBS.addButton(_btnMoreGames, overHandler, downHandler, outHandler, new CustomEvent(BottomNav.BUTTON_EVENT, {target:_btnMoreGames, click:Config.NAV_MOREGAMES}));
_gameBS = new ButtonSet();
_gameBS.addButton(_btnPauseGame, overHandler, downHandler, outHandler, new CustomEvent(BottomNav.BUTTON_EVENT, {target:_btnPauseGame, click:Config.NAV_PAUSEGAME}));
_gameBS.addButton(_btnMainMenu, overHandler, downHandler, outHandler, new CustomEvent(BottomNav.BUTTON_EVENT, {target:_btnMainMenu, click:Config.NAV_MAINMENU}));
_main = Main.getInstance();
}
public function outHandler(_arg1:CustomEvent):void{
TweenFilterLite.to(_arg1.data.target, 0.3, {glowFilter:{color:0x33FF00, alpha:0, blurX:10, blurY:10}});
}
public function downHandler(_arg1:CustomEvent):void{
dispatchEvent(new CustomEvent(Main.EVENT_NAV_CLICK, _arg1.data.click));
_main.sc.play("s_mousedown", 0.25);
}
public function set menu(_arg1:String):void{
_menu = _arg1;
this.play();
}
public function overHandler(_arg1:CustomEvent):void{
TweenFilterLite.to(_arg1.data.target, 0.3, {glowFilter:{color:0x33FF00, alpha:0.7, blurX:10, blurY:10}});
_main.sc.play("s_mouseover", 0.25);
}
}
}//package marvel.centralsmashdown.views
Section 76
//ChooseGameMode (marvel.centralsmashdown.views.ChooseGameMode)
package marvel.centralsmashdown.views {
import marvel.centralsmashdown.game.control.*;
import flash.events.*;
import flash.display.*;
import com.gs.*;
import marvel.centralsmashdown.*;
public class ChooseGameMode extends MovieClip {
private var _main:Main;
public var btnTimeTrial:MovieClip;
public var btnArcade:MovieClip;
private static var HIGHLIGHT_TWEENTIME:Number = 0.25;
public function ChooseGameMode(){
_main = Main.getInstance();
btnArcade.addEventListener(MouseEvent.MOUSE_DOWN, clickHandler, false, 0, true);
btnTimeTrial.addEventListener(MouseEvent.MOUSE_DOWN, clickHandler, false, 0, true);
btnArcade.addEventListener(MouseEvent.MOUSE_OVER, overHandler, false, 0, true);
btnTimeTrial.addEventListener(MouseEvent.MOUSE_OVER, overHandler, false, 0, true);
btnArcade.addEventListener(MouseEvent.MOUSE_OUT, outHandler, false, 0, true);
btnTimeTrial.addEventListener(MouseEvent.MOUSE_OUT, outHandler, false, 0, true);
btnArcade.buttonMode = true;
btnTimeTrial.buttonMode = true;
TweenLite.from(btnArcade, 0.5, {y:(btnArcade.y + 50), alpha:0});
TweenLite.from(btnTimeTrial, 0.5, {y:(btnTimeTrial.y + 50), alpha:0, delay:0.25});
}
private function outHandler(_arg1:MouseEvent):void{
TweenFilterLite.to(_arg1.target, ChooseGameMode.HIGHLIGHT_TWEENTIME, {colorMatrixFilter:{brightness:1}, glowFilter:{color:13953073, alpha:0, blurX:6, blurY:6, strength:0, quality:1}, overwrite:false});
}
private function clickHandler(_arg1:MouseEvent):void{
switch (_arg1.target){
case btnArcade:
_main.gotoGame(GameControl.GAME_MODE_ARCADE);
break;
case btnTimeTrial:
_main.gotoGame(GameControl.GAME_MODE_CHALLENGE);
break;
};
_main.sc.play("s_mousedown", 0.25);
}
private function overHandler(_arg1:MouseEvent):void{
TweenFilterLite.to(_arg1.target, ChooseGameMode.HIGHLIGHT_TWEENTIME, {colorMatrixFilter:{brightness:1.25}, glowFilter:{color:13953073, alpha:0.5, blurX:2, blurY:2, strength:1, quality:1}, overwrite:false});
_main.sc.play("s_mouseover", 0.25);
}
}
}//package marvel.centralsmashdown.views
Section 77
//HighScores (marvel.centralsmashdown.views.HighScores)
package marvel.centralsmashdown.views {
import marvel.centralsmashdown.game.control.*;
import flash.events.*;
import com.markdavies.events.*;
import flash.display.*;
import com.gs.*;
import marvel.centralsmashdown.*;
import marvel.centralsmashdown.utils.*;
import com.chris.AS3.events.*;
import com.chris.AS3.net.*;
import com.chris.AS3.utils.*;
import com.markdavies.control.*;
import flash.geom.*;
public class HighScores extends MovieClip {
public var btnArrowRight:MovieClip;
public var rankItems:MovieClip;
private var _flagsSrc:Flags;
private var _gameControl:GameControl;
private var _hsLoader:HighScoreLoader;
public var btnChallenge:MovieClip;
private var _hsList:HighScoreList;
private var _main:Main;
private var _fieldNum:Number;// = 10
public var btnArcade:MovieClip;
public var btnArrowLeft:MovieClip;
private var _bs:ButtonSet;
private static var NEXT:String = "next";
private static var PREVIOUS:String = "previous";
private static var HIGHLIGHT_TWEENTIME:Number = 0.25;
public function HighScores(){
_fieldNum = 10;
super();
init();
}
private function arrowClick(_arg1:Event):void{
if (_arg1.type == "next"){
if (_hsList.page == _hsList.maxPages){
_hsList.start();
} else {
_hsList.next();
};
} else {
if (_hsList.page == 0){
_hsList.last();
} else {
_hsList.prev();
};
};
_main.sc.play("s_mousedown", 0.25);
}
private function updateList(_arg1:HighScoreEvent):void{
var _local2:String;
var _local3:int;
var _local4:int;
var _local5:MovieClip;
var _local6:XML;
var _local7:FlagMaker;
_local3 = 0;
while (_local3 < _fieldNum) {
_local4 = (_arg1.first + _local3);
_local5 = rankItems[("r" + (_local3 + 1))];
_local5.visible = (_local4 < _arg1.end);
if (_local5.visible){
_local6 = _hsLoader.getScoreXML(_local4);
_local5.txt.rankTxt.text = ((_arg1.first + _local3) + 1).toString();
_local5.txt.nameTxt.text = _local6.@pname.toUpperCase();
_local5.txt.scoreTxt.text = TextUtil.formatScoreComma(_local6.@score);
_local2 = _local6.@miscellaneous1;
_local7 = new FlagMaker(_flagsSrc, _local2);
_local5.flag.addChild(_local7);
};
_local3++;
};
gotoAndStop("show");
}
public function init():void{
var _local1:int;
_main = Main.getInstance();
_gameControl = GameControl.getInstance();
_bs = new ButtonSet();
_bs.addButton(btnArrowLeft, buttonOverHandler, arrowClick, buttonOutHandler, new CustomEvent(HighScores.PREVIOUS, {target:btnArrowLeft}));
_bs.addButton(btnArrowRight, buttonOverHandler, arrowClick, buttonOutHandler, new CustomEvent(HighScores.NEXT, {target:btnArrowRight}));
_local1 = ((_gameControl.gameMode)==GameControl.GAME_MODE_ARCADE) ? Config.HIGH_SCORE_ID_ARCADE : Config.HIGH_SCORE_ID_CHALLENGE;
loadScores(_local1);
rankItems.mouseEnabled = false;
rankItems.mouseChildren = false;
_flagsSrc = new Flags();
_gameControl = GameControl.getInstance();
}
public function buttonOverHandler(_arg1:CustomEvent):void{
var _local2:MovieClip;
_local2 = _arg1.data.target;
TweenFilterLite.to(_local2.base, HighScores.HIGHLIGHT_TWEENTIME, {alpha:1});
_main.sc.play("s_mouseover", 0.25);
}
private function downHandler(_arg1:MouseEvent):void{
_main.sc.play("s_mousedown", 0.25);
switch (_arg1.target){
case btnChallenge:
loadScores(Config.HIGH_SCORE_ID_CHALLENGE);
break;
case btnArcade:
loadScores(Config.HIGH_SCORE_ID_ARCADE);
break;
};
}
private function enableButton(_arg1:MovieClip, _arg2:Boolean):void{
var _local3:Function;
_local3 = ((_arg2)==true) ? _arg1.addEventListener : _arg1.removeEventListener;
_local3(MouseEvent.MOUSE_OVER, overHandler);
_local3(MouseEvent.MOUSE_DOWN, downHandler);
_arg1.mouseChildren = _arg2;
_arg1.mouseEnabled = _arg2;
_arg1.buttonMode = _arg2;
_arg1.gotoAndStop(((_arg2 == true)) ? "off" : "on");
}
private function loadScores(_arg1:int):void{
_hsLoader = new HighScoreLoader();
_hsList = new HighScoreList();
_hsLoader.addEventListener(Event.COMPLETE, scoresLoaded);
_hsLoader.loadScores(_arg1);
switch (_arg1){
case Config.HIGH_SCORE_ID_ARCADE:
enableButton(btnChallenge, true);
enableButton(btnArcade, false);
break;
case Config.HIGH_SCORE_ID_CHALLENGE:
enableButton(btnArcade, true);
enableButton(btnChallenge, false);
break;
};
gotoAndStop("loading");
}
private function scoresLoaded(_arg1:Event):void{
_hsList.addEventListener(HighScoreEvent.CHANGE, updateList);
_hsList.init(_fieldNum, _hsLoader.scoresNum);
}
private function overHandler(_arg1:MouseEvent):void{
_main.sc.play("s_mouseover", 0.25);
}
public function buttonOutHandler(_arg1:CustomEvent):void{
var _local2:MovieClip;
_local2 = _arg1.data.target;
TweenFilterLite.to(_local2.base, HighScores.HIGHLIGHT_TWEENTIME, {alpha:0});
}
}
}//package marvel.centralsmashdown.views
Section 78
//HowToPlay (marvel.centralsmashdown.views.HowToPlay)
package marvel.centralsmashdown.views {
import flash.events.*;
import com.markdavies.events.*;
import flash.display.*;
import com.gs.*;
import marvel.centralsmashdown.*;
import com.markdavies.control.*;
public class HowToPlay extends MovieClip {
public var btnArrowRight:MovieClip;
private var _main:Main;
public var btnArrowLeft:MovieClip;
private var _bs:ButtonSet;
private static var NEXT:String = "next";
private static var PREVIOUS:String = "previous";
private static var HIGHLIGHT_TWEENTIME:Number = 0.25;
public function HowToPlay(){
_main = Main.getInstance();
_bs = new ButtonSet();
_bs.addButton(btnArrowLeft, buttonOverHandler, arrowClick, buttonOutHandler, new CustomEvent(HowToPlay.PREVIOUS, {target:btnArrowLeft}));
_bs.addButton(btnArrowRight, buttonOverHandler, arrowClick, buttonOutHandler, new CustomEvent(HowToPlay.NEXT, {target:btnArrowRight}));
}
private function arrowClick(_arg1:Event):void{
if (_arg1.type == "next"){
if (currentFrame == totalFrames){
gotoAndStop(1);
} else {
nextFrame();
};
} else {
if (currentFrame == 1){
gotoAndStop(totalFrames);
} else {
prevFrame();
};
};
this.alpha = 0;
TweenLite.to(this, 0.5, {alpha:1});
_main.sc.play("s_mousedown", 0.25);
}
public function buttonOverHandler(_arg1:CustomEvent):void{
var _local2:MovieClip;
_local2 = _arg1.data.target;
TweenFilterLite.to(_local2.base, HowToPlay.HIGHLIGHT_TWEENTIME, {alpha:1});
_main.sc.play("s_mouseover", 0.25);
}
public function buttonOutHandler(_arg1:CustomEvent):void{
var _local2:MovieClip;
_local2 = _arg1.data.target;
TweenFilterLite.to(_local2.base, HowToPlay.HIGHLIGHT_TWEENTIME, {alpha:0});
}
}
}//package marvel.centralsmashdown.views
Section 79
//LoginScreen (marvel.centralsmashdown.views.LoginScreen)
package marvel.centralsmashdown.views {
import flash.events.*;
import com.markdavies.events.*;
import flash.display.*;
import com.gs.*;
import com.soap.net.*;
import marvel.centralsmashdown.*;
import flash.utils.*;
import com.markdavies.control.*;
import flash.text.*;
public class LoginScreen extends MovieClip {
public var btnRegister:MovieClip;
public var arrow1:MovieClip;
public var arrow2:MovieClip;
public var btnLogin:MovieClip;
private var _marvelConnector:MarvelLoginConnector;
public var btnSkip:MovieClip;
private var _marvelUser:MarvelLoginUser;
public var userNameTxt:TextField;
private var _main:Main;
private var _timer:Timer;
public var passwordTxt:TextField;
private var _bs:ButtonSet;
private static var HIGHLIGHT_TWEENTIME:Number = 0.25;
private static var BUTTON_EVENT:String = "buttonEvent";
public function LoginScreen(){
_main = Main.getInstance();
}
public function init():void{
_bs = new ButtonSet();
_bs.addButton(btnSkip, overHandler, skipClickHandler, outHandler, new CustomEvent(LoginScreen.BUTTON_EVENT, {target:btnSkip}));
_bs.addButton(btnRegister, overHandler, registerClickHandler, outHandler, new CustomEvent(LoginScreen.BUTTON_EVENT, {target:btnRegister}));
_bs.addButton(btnLogin, overHandler, loginClickHandler, outHandler, new CustomEvent(LoginScreen.BUTTON_EVENT, {target:btnLogin}));
}
public function outHandler(_arg1:CustomEvent):void{
TweenFilterLite.to(_arg1.data.target, LoginScreen.HIGHLIGHT_TWEENTIME, {colorMatrixFilter:{brightness:1}, glowFilter:{color:13953073, alpha:0, blurX:6, blurY:6, strength:0, quality:1}});
}
private function loginFailHandler(_arg1:CustomEvent):void{
gotoAndStop("loginFailed");
_timer = new Timer(3000, 1);
_timer.addEventListener(TimerEvent.TIMER, failOutHandler);
_timer.removeEventListener(TimerEvent.TIMER, successOutHandler);
_timer.start();
}
private function validate():Boolean{
var _local1:Boolean;
_local1 = false;
if (userNameTxt.text == ""){
_local1 = true;
arrow1.alpha = 1;
} else {
arrow1.alpha = 0;
};
if (passwordTxt.text == ""){
_local1 = true;
arrow2.alpha = 1;
} else {
arrow2.alpha = 0;
};
return (!(_local1));
}
private function loginSuccessHandler(_arg1:CustomEvent):void{
gotoAndStop("loggedIn");
dispatchEvent(new CustomEvent(Config.LOGIN_SUCCESS, {marvelUser:_marvelConnector.marvelUser}));
_timer = new Timer(3000, 1);
_timer.removeEventListener(TimerEvent.TIMER, failOutHandler);
_timer.addEventListener(TimerEvent.TIMER, successOutHandler);
_timer.start();
}
private function successOutHandler(_arg1:TimerEvent):void{
dispatchEvent(new CustomEvent(Config.LOGIN_DONE));
}
public function loginClickHandler(_arg1:CustomEvent):void{
if (validate() == false){
return;
};
_marvelConnector = new MarvelLoginConnector();
_marvelConnector.login(userNameTxt.text, passwordTxt.text);
_marvelConnector.addEventListener(MarvelLoginConnector.EVENT_LOGIN_SUCCESS, loginSuccessHandler, false, 0, true);
_marvelConnector.addEventListener(MarvelLoginConnector.EVENT_LOGIN_FAILED, loginFailHandler, false, 0, true);
_main.sc.play("s_mousedown", 0.25);
gotoAndStop("loggingIn");
}
public function skipClickHandler(_arg1:CustomEvent):void{
dispatchEvent(new CustomEvent(Config.LOGIN_CLICK_SKIP));
_main.sc.play("s_mousedown", 0.25);
}
public function overHandler(_arg1:CustomEvent):void{
TweenFilterLite.to(_arg1.data.target, LoginScreen.HIGHLIGHT_TWEENTIME, {colorMatrixFilter:{brightness:1.25}, glowFilter:{color:13953073, alpha:0.5, blurX:2, blurY:2, strength:1, quality:1}});
_main.sc.play("s_mouseover", 0.25);
}
private function failOutHandler(_arg1:TimerEvent):void{
gotoAndStop("login");
}
public function registerClickHandler(_arg1:CustomEvent):void{
dispatchEvent(new CustomEvent(Config.LOGIN_CLICK_REGISTER));
_main.sc.play("s_mousedown", 0.25);
}
}
}//package marvel.centralsmashdown.views
Section 80
//OuterFrame (marvel.centralsmashdown.views.OuterFrame)
package marvel.centralsmashdown.views {
import marvel.centralsmashdown.game.control.*;
import flash.events.*;
import com.markdavies.events.*;
import flash.display.*;
import com.gs.*;
import com.markdavies.debug.*;
import marvel.centralsmashdown.*;
import flash.utils.*;
import com.chris.AS3.utils.*;
import fl.transitions.easing.*;
import flash.text.*;
public class OuterFrame extends MovieClip {
public var timeBar:MovieClip;
private var _gameControl:GameControl;
public var timeTxt:TextField;
private var _currentScore:int;
private var _timer:Timer;
public var miniMap:MiniMap;
private var _aimScore:int;
public var scoreTxt:TextField;
public var muteButton:MovieClip;
public var marvelLogo:MovieClip;
public var yourBestMov:MovieClip;
private static var REFRESH_RATE:int = 10;
private static var HIGHLIGHT_TWEENTIME:Number = 0.25;
private static var SCORE_INC_RATE:Number = 0.05;
public function OuterFrame(){
init();
}
public function set yourBestChallenge(_arg1:int):void{
yourBestMov.challenge.txt.text = TextUtil.formatScoreComma(_arg1);
}
public function init():void{
TweenLite.from(marvelLogo, 1, {scaleX:0.1, scaleY:0.1, ease:Elastic.easeOut});
try {
_timer.running;
} catch(e:TypeError) {
_timer = new Timer(OuterFrame.REFRESH_RATE);
_timer.addEventListener(TimerEvent.TIMER, render);
};
_timer.start();
muteButton.addEventListener(MouseEvent.MOUSE_DOWN, muteButtonClickHandler);
muteButton.buttonMode = true;
marvelLogo.addEventListener(MouseEvent.MOUSE_DOWN, marvelLogoClickHandler);
marvelLogo.addEventListener(MouseEvent.MOUSE_OVER, marvelLogoOverHandler);
marvelLogo.addEventListener(MouseEvent.MOUSE_OUT, marvelLogoOutHandler);
marvelLogo.buttonMode = true;
_gameControl = GameControl.getInstance();
}
public function set score(_arg1:int):void{
_aimScore = _arg1;
DebugBox.debug("_aimScore", _aimScore);
}
public function set yourBestArcade(_arg1:int):void{
yourBestMov.arcade.txt.text = TextUtil.formatScoreComma(_arg1);
}
public function set scoreHardChange(_arg1:int):void{
_aimScore = _arg1;
_currentScore = _arg1;
}
public function set gameMode(_arg1:String):void{
switch (_arg1){
case GameControl.GAME_MODE_ARCADE:
gotoAndStop(_arg1);
break;
case GameControl.GAME_MODE_CHALLENGE:
gotoAndStop(_arg1);
break;
};
}
public function muteChangedHandler(_arg1:CustomEvent):void{
if (_arg1.data == true){
muteButton.gotoAndStop("off");
} else {
muteButton.gotoAndPlay("on");
};
}
private function marvelLogoOutHandler(_arg1:MouseEvent):void{
TweenFilterLite.to(_arg1.target, 0.3, {glowFilter:{color:0x33FF00, alpha:0, blurX:10, blurY:10}});
}
public function set timeRemaining(_arg1:int):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:String;
var _local7:String;
if (_arg1 < 0){
_arg1 = 0;
};
_local2 = Math.floor((_arg1 / 60000));
_local3 = Math.floor(((_arg1 - (_local2 * 60000)) / 1000));
_local4 = Math.round((((_arg1 - (_local2 * 60000)) - (_local3 * 1000)) / 10));
_local5 = _local2.toString();
_local6 = _local3.toString();
_local7 = _local4.toString();
if (_local5.length == 1){
_local5 = ("0" + _local5);
};
if (_local6.length == 1){
_local6 = ("0" + _local6);
};
if (_local7.length == 1){
_local7 = ("0" + _local7);
};
timeTxt.text = ((((_local5 + ":") + _local6) + ":") + _local7);
}
public function set timePercentage(_arg1:Number):void{
if (_arg1 > 1){
_arg1 = 1;
};
timeBar.bar.scaleX = _arg1;
}
private function marvelLogoOverHandler(_arg1:MouseEvent):void{
TweenFilterLite.to(_arg1.target, 0.3, {glowFilter:{color:0x33FF00, alpha:0.7, blurX:10, blurY:10}});
}
private function marvelLogoClickHandler(_arg1:MouseEvent):void{
dispatchEvent(new CustomEvent(Main.EVENT_NAV_CLICK, Config.NAV_MARVELLOGO));
}
private function render(_arg1:TimerEvent):void{
var _local2:int;
if (_currentScore == _aimScore){
return;
};
_local2 = (((_aimScore - _currentScore))>10) ? 10 : 1;
_currentScore = (_currentScore + ((_currentScore)>_aimScore) ? (-1 * _local2) : (1 * _local2));
scoreTxt.text = TextUtil.formatScoreComma(_currentScore);
DebugBox.debug("_currentScore", _currentScore);
}
private function muteButtonClickHandler(_arg1:MouseEvent):void{
dispatchEvent(new CustomEvent(Main.EVENT_NAV_CLICK, Config.NAV_MUTE_TOGGLE));
}
}
}//package marvel.centralsmashdown.views
Section 81
//PreloadScreen (marvel.centralsmashdown.views.PreloadScreen)
package marvel.centralsmashdown.views {
import flash.events.*;
import com.markdavies.events.*;
import flash.display.*;
import marvel.centralsmashdown.*;
import flash.utils.*;
import flash.text.*;
public class PreloadScreen extends MovieClip {
public var preloadItems:Dictionary;
private var _nukeMask:MovieClip;
private var _percTxt:TextField;
private var _main:Main;
public var loadingClip:MovieClip;
public static var EVENT_SITE_LOADED:String = "siteLoaded";
public function PreloadScreen(){
preloadItems = new Dictionary();
super();
_percTxt = loadingClip.percentageTxt;
_nukeMask = loadingClip.nukeMask;
}
public function out():void{
dispatchEvent(new CustomEvent(Config.EVENT_SITE_LOADED));
}
public function goOut():void{
gotoAndPlay("out");
}
public function render(_arg1:TimerEvent):void{
_main = Main.getInstance();
_percTxt.text = _main.pl.percLoadedDisplay;
_nukeMask.rotation = (_nukeMask.rotation + 5);
}
}
}//package marvel.centralsmashdown.views
Section 82
//SendToFriend (marvel.centralsmashdown.views.SendToFriend)
package marvel.centralsmashdown.views {
import marvel.centralsmashdown.game.control.*;
import flash.events.*;
import flash.display.*;
import com.gs.*;
import com.markdavies.debug.*;
import marvel.centralsmashdown.*;
import flash.utils.*;
import com.markdavies.utils.*;
import fl.motion.easing.*;
import flash.net.*;
import flash.text.*;
public class SendToFriend extends MovieClip {
public var recipEmailArrow:MovieClip;
private var loader:URLLoader;
public var recipEmail:TextField;
private var _gameControl:GameControl;
public var recipNameArrow:MovieClip;
public var senderEmail:TextField;
private var _timer:Timer;
public var senderNameArrow:MovieClip;
public var senderName:TextField;
private var _buttonDown:Boolean;
private var _main:Main;
private var request:URLRequest;
private var sendVariables:URLVariables;
public var sendButton:MovieClip;
public var recipName:TextField;
public var senderEmailArrow:MovieClip;
private static var HIGHLIGHT_TWEENTIME:Number = 0.25;
public static var STF_URL:String = "http://stats.soap.com.au/stats08/hulk_game2_challenge.php";
public function SendToFriend(){
_gameControl = GameControl.getInstance();
_buttonDown = false;
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
request = new URLRequest(SendToFriend.STF_URL);
loader.addEventListener(Event.COMPLETE, onComplete, false);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler, false);
registerListeners(true);
senderNameArrow.alpha = 0;
recipNameArrow.alpha = 0;
senderEmailArrow.alpha = 0;
recipEmailArrow.alpha = 0;
showSendButton = true;
_main = Main.getInstance();
}
private function registerListeners(_arg1:Boolean){
var _local2:Function;
_local2 = ((_arg1)==true) ? sendButton.btn.addEventListener : sendButton.btn.removeEventListener;
_local2(MouseEvent.MOUSE_DOWN, sendClickHandler);
_local2(MouseEvent.MOUSE_OVER, sendOverHandler);
_local2(MouseEvent.MOUSE_OUT, sendOutHandler);
sendButton.btn.mouseEnabled = _arg1;
sendButton.btn.buttonMode = _arg1;
TweenFilterLite.to(sendButton.btn, SendToFriend.HIGHLIGHT_TWEENTIME, {glowFilter:{color:15537941, alpha:0, blurX:2, blurY:2, strength:0, quality:1}, alpha:0});
}
private function sendOverHandler(_arg1:MouseEvent):void{
TweenFilterLite.to(_arg1.target, SendToFriend.HIGHLIGHT_TWEENTIME, {glowFilter:{color:15537941, alpha:1, blurX:20, blurY:20, strength:5, quality:1}, alpha:0.25});
_main.sc.play("s_mouseover", 0.25);
}
private function onComplete(_arg1:Event):void{
var _local2:String;
_local2 = String(loader.data);
if (_local2.indexOf("sent=true") != -1){
gotoAndStop("success");
} else {
gotoAndStop("error");
timerBackToForm();
};
}
private function validate():Boolean{
var _local1:Boolean;
var _local2:Boolean;
var _local3:Validator;
_local1 = false;
_local3 = new Validator();
_local2 = _local3.validate(Validator.TYPE_EMAIL, senderEmail.text);
_local1 = ((_local2)==true) ? true : _local1;
senderEmailArrow.alpha = int(_local2);
_local2 = _local3.validate(Validator.TYPE_EMAIL, recipEmail.text);
_local1 = ((_local2)==true) ? true : _local1;
recipEmailArrow.alpha = int(_local2);
_local2 = _local3.validate(Validator.TYPE_STRING, senderName.text);
_local1 = ((_local2)==true) ? true : _local1;
senderNameArrow.alpha = int(_local2);
_local2 = _local3.validate(Validator.TYPE_STRING, recipName.text);
_local1 = ((_local2)==true) ? true : _local1;
recipNameArrow.alpha = int(_local2);
return (!(_local1));
}
private function set showSendButton(_arg1:Boolean):void{
if (_arg1 == true){
TweenLite.to(sendButton, 1, {y:70, ease:Elastic.easeOut});
_buttonDown = true;
} else {
TweenLite.to(sendButton, 0.25, {y:-450, ease:Linear.easeIn});
_buttonDown = false;
};
}
private function sendClickHandler(_arg1:MouseEvent):void{
_main.sc.play("s_mousedown", 0.25);
send();
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
DebugBox.debug("stf", "ioErrorHandler");
gotoAndStop("error");
timerBackToForm();
}
private function securityErrorHandler(_arg1:SecurityErrorEvent):void{
DebugBox.debug("stf", "securityErrorHandler");
gotoAndStop("error");
timerBackToForm();
}
private function send():void{
if (validate() == false){
return;
};
showSendButton = false;
registerListeners(false);
sendVariables = new URLVariables();
sendVariables.strName = senderName.text;
sendVariables.strEmail = senderEmail.text;
sendVariables.F_name_1 = recipName.text;
sendVariables.F_email_1 = recipEmail.text;
sendVariables.intScore = _gameControl.highScore;
request.data = sendVariables;
request.method = "POST";
DebugBox.debug("stf", ((("sending " + senderEmail.text) + " ") + recipEmail.text));
try {
loader.load(request);
gotoAndStop("sending");
} catch(error:Error) {
gotoAndStop("error");
timerBackToForm();
};
}
private function timerBackToForm():void{
_timer = new Timer(3000, 1);
_timer.addEventListener(TimerEvent.TIMER, toForm);
_timer.start();
}
private function toForm(_arg1:TimerEvent):void{
registerListeners(true);
showSendButton = true;
gotoAndStop("form");
}
private function sendOutHandler(_arg1:MouseEvent):void{
TweenFilterLite.to(_arg1.target, SendToFriend.HIGHLIGHT_TWEENTIME, {glowFilter:{color:15537941, alpha:0, blurX:2, blurY:2, strength:0, quality:1}, alpha:0});
}
}
}//package marvel.centralsmashdown.views
Section 83
//SubmitScore (marvel.centralsmashdown.views.SubmitScore)
package marvel.centralsmashdown.views {
import marvel.centralsmashdown.game.control.*;
import flash.events.*;
import com.markdavies.events.*;
import flash.display.*;
import com.gs.*;
import com.markdavies.debug.*;
import marvel.centralsmashdown.*;
import flash.utils.*;
import com.chris.AS3.utils.*;
import fl.motion.easing.*;
import flash.net.*;
import flash.text.*;
public class SubmitScore extends MovieClip {
public var yourInitials:TextField;
private var loader:URLLoader;
private var _gameControl:GameControl;
private var _timer:Timer;
public var btnPlayAgain:MovieClip;
private var _main:Main;
private var request:URLRequest;
public var scoreTxt:TextField;
private var sendVariables:URLVariables;
public var sendButton:MovieClip;
public var countryDropDown:CountryDropDown;
public static var HIGHSCORES_URL:String = "http://stats.soap.com.au/highscore/engine_mofo.php";
private static var HIGHLIGHT_TWEENTIME:Number = 0.25;
public function SubmitScore(){
_gameControl = GameControl.getInstance();
_main = Main.getInstance();
if (_main.marvelUser != null){
countryDropDown.selectedMarvelCode = _main.marvelUser.country;
yourInitials.text = _main.marvelUser.username;
TweenLite.from(sendButton, 1, {y:-270, ease:Elastic.easeOut, delay:0.5});
registerListeners(true);
yourInitials.addEventListener(Event.CHANGE, textChangeHandler);
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
request = new URLRequest(SubmitScore.HIGHSCORES_URL);
loader.addEventListener(Event.COMPLETE, onComplete, false);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler, false);
} else {
sendButton.y = -270;
gotoAndStop("nosubmit");
};
btnPlayAgain.addEventListener(MouseEvent.MOUSE_DOWN, playClickHandler);
btnPlayAgain.addEventListener(MouseEvent.MOUSE_OVER, playOverHandler);
btnPlayAgain.addEventListener(MouseEvent.MOUSE_OUT, playOutHandler);
btnPlayAgain.buttonMode = true;
scoreTxt.text = TextUtil.formatScoreComma(_gameControl.lastScore);
}
private function timerToHighscores():void{
_timer = new Timer(2000, 1);
_timer.addEventListener(TimerEvent.TIMER, toHighScores);
_timer.start();
}
private function registerListeners(_arg1:Boolean){
var _local2:Function;
_local2 = ((_arg1)==true) ? sendButton.btn.addEventListener : sendButton.btn.removeEventListener;
_local2(MouseEvent.MOUSE_DOWN, sendClickHandler);
_local2(MouseEvent.MOUSE_OVER, sendOverHandler);
_local2(MouseEvent.MOUSE_OUT, sendOutHandler);
sendButton.btn.mouseEnabled = _arg1;
sendButton.btn.buttonMode = _arg1;
TweenFilterLite.to(sendButton.btn, SubmitScore.HIGHLIGHT_TWEENTIME, {glowFilter:{color:15537941, alpha:0, blurX:2, blurY:2, strength:0, quality:1}, alpha:0});
}
private function sendOverHandler(_arg1:MouseEvent):void{
TweenFilterLite.to(_arg1.target, SubmitScore.HIGHLIGHT_TWEENTIME, {glowFilter:{color:15537941, alpha:1, blurX:20, blurY:20, strength:5, quality:1}, alpha:0.25});
}
private function playOverHandler(_arg1:MouseEvent):void{
TweenFilterLite.to(_arg1.target, SubmitScore.HIGHLIGHT_TWEENTIME, {glowFilter:{color:13953073, alpha:0.5, blurX:2, blurY:2, strength:1, quality:1}});
_main.sc.play("s_mouseover", 0.25);
}
private function toHighScores(_arg1:TimerEvent):void{
registerListeners(false);
_main.showContent(Config.NAV_HIGHSCORES);
}
private function onComplete(_arg1:Event):void{
var _local2:String;
_local2 = String(loader.data);
if (_local2.indexOf("result=yes") != -1){
gotoAndStop("success");
timerToHighscores();
} else {
gotoAndStop("error");
timerBackToForm();
};
}
private function playOutHandler(_arg1:MouseEvent):void{
TweenFilterLite.to(_arg1.target, SubmitScore.HIGHLIGHT_TWEENTIME, {glowFilter:{color:13953073, alpha:0, blurX:2, blurY:2, strength:1, quality:1}});
}
private function sendClickHandler(_arg1:MouseEvent):void{
send();
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
trace("ioErrorHandler");
DebugBox.debug("submitscore", "ioErrorHandler");
gotoAndStop("error");
timerBackToForm();
}
private function securityErrorHandler(_arg1:SecurityErrorEvent):void{
trace("securityErrorHandler");
DebugBox.debug("submitscore", "securityErrorHandler");
gotoAndStop("error");
timerBackToForm();
}
private function send():void{
registerListeners(false);
sendVariables = new URLVariables();
sendVariables.intGameId = ((_gameControl.gameMode)==GameControl.GAME_MODE_ARCADE) ? Config.HIGH_SCORE_ID_ARCADE : Config.HIGH_SCORE_ID_CHALLENGE;
sendVariables.strName = _main.marvelUser.username;
sendVariables.strEmail = (((Math.round((Math.random() * 1E15)).toString() + "@") + Math.round((Math.random() * 1E15)).toString()) + ".com");
sendVariables.intScore = _gameControl.lastScore;
sendVariables.strMisc1 = countryDropDown.selectedCountryCode;
if (_main.marvelUser != null){
sendVariables.strMisc4 = _main.marvelUser.userID;
};
request.data = sendVariables;
request.method = "POST";
DebugBox.debug("submitscore", ("send to " + SubmitScore.HIGHSCORES_URL));
try {
loader.load(request);
gotoAndStop("sending");
} catch(error:Error) {
gotoAndStop("error");
timerBackToForm();
};
DebugBox.setAtTop();
}
private function textChangeHandler(_arg1:Event):void{
yourInitials.text = yourInitials.text.toUpperCase();
}
private function timerBackToForm():void{
_timer = new Timer(3000, 1);
_timer.addEventListener(TimerEvent.TIMER, toForm);
_timer.start();
}
private function sendOutHandler(_arg1:MouseEvent):void{
TweenFilterLite.to(_arg1.target, SubmitScore.HIGHLIGHT_TWEENTIME, {glowFilter:{color:15537941, alpha:0, blurX:2, blurY:2, strength:0, quality:1}, alpha:0});
}
private function toForm(_arg1:TimerEvent):void{
registerListeners(false);
gotoAndStop("form");
}
private function playClickHandler(_arg1:MouseEvent):void{
_main.sc.play("s_mousedown", 0.25);
dispatchEvent(new CustomEvent(Main.EVENT_NAV_CLICK, Config.NAV_STARTGAME));
}
}
}//package marvel.centralsmashdown.views
Section 84
//Config (marvel.centralsmashdown.Config)
package marvel.centralsmashdown {
public class Config {
public static var EVENT_SITE_LOAD_ERROR:String = "siteLoadError";
public static var NAV_STARTGAME:String = "startGame";
public static var HIGH_SCORE_ID_CHALLENGE:Number = 9;
public static var HIGH_SCORE_ID_ARCADE:Number = 8;
public static var NAV_PAUSEGAME:String = "pauseGame";
public static var EVENT_MUTE_CHANGED:String = "muteChanged";
public static var NAV_QUITMAIN_NO:String = "quitToMainNo";
public static var NAV_SENDTOFRIEND:String = "sendToFriend";
public static var OFFICIAL_SITE_LINK:String = "http://www.marvelkids.com";
public static var NAV_HOWTOPLAY:String = "howToPlay";
public static var NAV_SUBMITSCORE:String = "submitScore";
public static var LOGIN_CLICK_SKIP:String = "loginSkip";
public static var SOAP_LINK:String = "http://www.soap.com.au";
public static var NAV_MOREGAMES:String = "moreGames";
public static var DEBUG:Boolean = false;
public static var LOGIN_DONE:String = "loginDone";
public static var EVENT_SITE_LOADED:String = "siteLoaded";
public static var TIMER_MODE_TIMEPERGAME:int = 60;
public static var LOGIN_CLICK_LOGIN:String = "loginLogin";
public static var NAV_QUITMAIN_YES:String = "quitToMainYes";
public static var MIN_VOLUME:Number = 0;
public static var COUNTRY_IDS:Array = new Array({id:"4", name:"Afghanistan", code:"AF"}, {id:"5", name:"Albania", code:"AL"}, {id:"6", name:"Algeria", code:"DZ"}, {id:"8", name:"Andorra", code:"AD"}, {id:"9", name:"Angola", code:"AO"}, {id:"11", name:"Antigua Barbuda", code:"AG"}, {id:"12", name:"Argentina", code:"AR"}, {id:"13", name:"Armenia", code:"AM"}, {id:"15", name:"Australia", code:"AU"}, {id:"16", name:"Austria", code:"AT"}, {id:"17", name:"Azerbaijan", code:"AZ"}, {id:"19", name:"Bahamas", code:"BS"}, {id:"20", name:"Bahrain", code:"BH"}, {id:"21", name:"Bangladesh", code:"BD"}, {id:"22", name:"Barbados", code:"BB"}, {id:"23", name:"Belarus", code:"BY"}, {id:"24", name:"Belgium", code:"BE"}, {id:"25", name:"Belize", code:"BZ"}, {id:"26", name:"Benin", code:"BJ"}, {id:"27", name:"Bermuda", code:"BT"}, {id:"29", name:"Bolivia", code:"BO"}, {id:"31", name:"Bosnia", code:"BA"}, {id:"32", name:"Botswana", code:"BW"}, {id:"33", name:"Brazil", code:"BR"}, {id:"35", name:"Brunei", code:"BN"}, {id:"36", name:"Bulgaria", code:"BG"}, {id:"37", name:"Burkina Faso", code:"BF"}, {id:"38", name:"Burundi", code:"BI"}, {id:"39", name:"Cambodia", code:"KH"}, {id:"40", name:"Cameroon", code:"CM"}, {id:"3", name:"Canada", code:"CA"}, {id:"42", name:"Cape Verde", code:"CV"}, {id:"44", name:"Central African Republic", code:"CF"}, {id:"45", name:"Chad", code:"TD"}, {id:"47", name:"Chile", code:"CL"}, {id:"48", name:"China", code:"CN"}, {id:"51", name:"Colombia", code:"CO"}, {id:"52", name:"Comoros", code:"KM"}, {id:"53", name:"Congo", code:"CG"}, {id:"55", name:"Costa Rica", code:"CR"}, {id:"56", name:"Cote D'Ivoire", code:"CI"}, {id:"57", name:"Croatia", code:"HR"}, {id:"58", name:"Cuba", code:"CU"}, {id:"60", name:"Cyprus", code:"CY"}, {id:"61", name:"Czech Republic", code:"CZ"}, {id:"62", name:"Denmark", code:"DK"}, {id:"63", name:"Djibouti", code:"DJ"}, {id:"64", name:"Dominica", code:"DM"}, {id:"65", name:"Dominican Republic", code:"DO"}, {id:"68", name:"Egypt", code:"EG"}, {id:"69", name:"El Salvador", code:"SV"}, {id:"70", name:"Equatorial Guinea", code:"GQ"}, {id:"71", name:"Eritrea", code:"ER"}, {id:"72", name:"Estonia", code:"EE"}, {id:"73", name:"Ethiopia", code:"ET"}, {id:"76", name:"Fiji", code:"FJ"}, {id:"77", name:"Finland", code:"FI"}, {id:"78", name:"France", code:"FR"}, {id:"82", name:"Gabon", code:"GA"}, {id:"83", name:"Gambia", code:"GM"}, {id:"84", name:"Georgia", code:"GE"}, {id:"85", name:"Germany", code:"DE"}, {id:"86", name:"Ghana", code:"GH"}, {id:"88", name:"Great Britain", code:"UK"}, {id:"89", name:"Greece", code:"GR"}, {id:"90", name:"Greenland", code:"DK"}, {id:"91", name:"Grenada", code:"GD"}, {id:"94", name:"Guatemala", code:"GT"}, {id:"95", name:"Guinea", code:"GN"}, {id:"96", name:"Guyana", code:"GY"}, {id:"97", name:"Haiti", code:"HT"}, {id:"99", name:"Honduras", code:"HN"}, {id:"100", name:"Hong Kong", code:"HK"}, {id:"101", name:"Hungary", code:"HU"}, {id:"102", name:"Iceland", code:"IS"}, {id:"103", name:"India", code:"IN"}, {id:"104", name:"Indonesia", code:"ID"}, {id:"105", name:"Iran", code:"IR"}, {id:"106", name:"Iraq", code:"IQ"}, {id:"107", name:"Ireland", code:"IE"}, {id:"109", name:"Israel", code:"IL"}, {id:"110", name:"Italy", code:"IT"}, {id:"111", name:"Jamaica", code:"JM"}, {id:"112", name:"Japan", code:"JP"}, {id:"113", name:"Jordan", code:"JO"}, {id:"114", name:"Kazakhstan", code:"KZ"}, {id:"115", name:"Kenya", code:"KE"}, {id:"116", name:"Kiribati", code:"KI"}, {id:"117", name:"North Korea", code:"KP"}, {id:"118", name:"South Korea", code:"KR"}, {id:"119", name:"Kuwait", code:"KW"}, {id:"120", name:"Kyrgyzstan", code:"KG"}, {id:"121", name:"Laos", code:"LA"}, {id:"122", name:"Latvia", code:"LV"}, {id:"123", name:"Lebanon", code:"LB"}, {id:"124", name:"Lesotho", code:"LS"}, {id:"125", name:"Liberia", code:"LR"}, {id:"126", name:"Libya", code:"LY"}, {id:"127", name:"Liechtenstein", code:"LI"}, {id:"128", name:"Lithuania", code:"LT"}, {id:"129", name:"Luxembourg", code:"LU"}, {id:"131", name:"Macedonia", code:"MK"}, {id:"132", name:"Madagascar", code:"MG"}, {id:"134", name:"Malawi", code:"MW"}, {id:"133", name:"Malaysia", code:"MY"}, {id:"135", name:"Maldives", code:"MV"}, {id:"136", name:"Mali", code:"ML"}, {id:"137", name:"Malta", code:"MT"}, {id:"138", name:"Marshall Islands", code:"MH"}, {id:"140", name:"Mauritania", code:"MR"}, {id:"141", name:"Mauritius", code:"MU"}, {id:"143", name:"Mexico", code:"MX"}, {id:"145", name:"Moldova", code:"MD"}, {id:"146", name:"Monaco", code:"MC"}, {id:"147", name:"Mongolia", code:"MN"}, {id:"149", name:"Morocco", code:"MA"}, {id:"150", name:"Mozambique", code:"MZ"}, {id:"151", name:"Myanmar", code:"MM"}, {id:"152", name:"Nambia", code:"NA"}, {id:"153", name:"Nauru", code:"NR"}, {id:"154", name:"Nepal", code:"NP"}, {id:"156", name:"Netherlands", code:"NL"}, {id:"158", name:"New Caledonia", code:"NC"}, {id:"159", name:"New Zealand", code:"NZ"}, {id:"160", name:"Nicaragua", code:"NI"}, {id:"161", name:"Niger", code:"NE"}, {id:"162", name:"Nigeria", code:"NG"}, {id:"165", name:"Norway", code:"NO"}, {id:"166", name:"Oman", code:"OM"}, {id:"167", name:"Pakistan", code:"PK"}, {id:"168", name:"Palau Island", code:"PW"}, {id:"170", name:"Panama", code:"PA"}, {id:"171", name:"Papua New Guinea", code:"PG"}, {id:"172", name:"Paraguay", code:"PY"}, {id:"173", name:"Peru", code:"PE"}, {id:"174", name:"Philippines", code:"PH"}, {id:"176", name:"Poland", code:"PL"}, {id:"177", name:"Portugal", code:"PT"}, {id:"179", name:"Qatar", code:"QA"}, {id:"181", name:"Romania", code:"RO"}, {id:"182", name:"Russia", code:"RU"}, {id:"183", name:"Rwanda", code:"RW"}, {id:"193", name:"Samoa", code:"WS"}, {id:"195", name:"San Marino", code:"SM"}, {id:"196", name:"Sao Tome Principe", code:"ST"}, {id:"197", name:"Saudi Arabia", code:"SA"}, {id:"198", name:"Senegal", code:"SN"}, {id:"200", name:"Serbia", code:"RS"}, {id:"199", name:"Seychelles", code:"SC"}, {id:"201", name:"Sierra Leone", code:"SL"}, {id:"202", name:"Singapore", code:"SG"}, {id:"203", name:"Slovakia", code:"SK"}, {id:"204", name:"Slovenia", code:"SI"}, {id:"205", name:"Solomon Islands", code:"SB"}, {id:"206", name:"Somalia", code:"SO"}, {id:"207", name:"South Africa", code:"ZA"}, {id:"208", name:"Spain", code:"ES"}, {id:"209", name:"Sri Lanka", code:"LK"}, {id:"210", name:"Sudan", code:"SD"}, {id:"211", name:"Suriname", code:"SR"}, {id:"212", name:"Swaziland", code:"SZ"}, {id:"213", name:"Sweden", code:"SE"}, {id:"214", name:"Switzerland", code:"CH"}, {id:"215", name:"Syria", code:"SY"}, {id:"217", name:"Taiwan", code:"TW"}, {id:"218", name:"Tajikistan", code:"TJ"}, {id:"219", name:"Tanzania", code:"TZ"}, {id:"220", name:"Thailand", code:"TH"}, {id:"221", name:"Togo", code:"TG"}, {id:"223", name:"Tonga", code:"TO"}, {id:"224", name:"Trinidad Tobago", code:"TT"}, {id:"225", name:"Tunisia", code:"TN"}, {id:"226", name:"Turkey", code:"TR"}, {id:"227", name:"Turkmenistan", code:"TM"}, {id:"229", name:"Tuvalu", code:"TV"}, {id:"230", name:"Uganda", code:"UG"}, {id:"231", name:"Ukraine", code:"UA"}, {id:"232", name:"United Arab Emirates", code:"AE"}, {id:"2", name:"United Kingdom", code:"GB"}, {id:"1", name:"United States", code:"US"}, {id:"233", name:"Uruguay", code:"UY"}, {id:"234", name:"Uzbekistan", code:"UZ"}, {id:"235", name:"Vanuatu", code:"VU"}, {id:"237", name:"Venezuela", code:"VE"}, {id:"238", name:"Vietnam", code:"VN"}, {id:"243", name:"Yemen", code:"YE"}, {id:"246", name:"Zimbabwe", code:"ZM"});
public static var LOGIN_CLICK_REGISTER:String = "loginRegister";
public static var NAV_MAINMENU:String = "maimMenu";
public static var NAV_MARVELLOGO:String = "marvelLogo";
public static var LOGIN_FAILED:String = "loginFailed";
public static var LOGIN_SUCCESS:String = "loginSuccess";
public static var MAX_VOLUME:Number = 1;
public static var FLAG_CODES:String = ((((((((("ad ae af ag ai al am an ao ar as at au aw ax az ba bb bd be bf bg bh bi bj " + "bm bn bo br bs bt bv bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cs cu ") + "cv cx cy cz de dj dk dm do dz ec ee eg eh er es et fi fj fk fm fo fr ga gb ") + "gd ge gf gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il ") + "in io iq ir is it jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc li lk ") + "lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu mv mw ") + "mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl pm pn ") + "pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sj sk sl sm sn so ") + "sr st sv sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz ua ug um us ") + "uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw");
public static var NAV_MUTE_TOGGLE:String = "Mute";
public static var NAV_HIGHSCORES:String = "highScores";
}
}//package marvel.centralsmashdown
Section 85
//Main (marvel.centralsmashdown.Main)
package marvel.centralsmashdown {
import marvel.centralsmashdown.game.control.*;
import flash.events.*;
import com.markdavies.events.*;
import flash.display.*;
import com.gs.*;
import com.soap.net.*;
import com.markdavies.net.*;
import com.markdavies.debug.*;
import com.chris.AS3.net.*;
import flash.net.*;
import flash.media.*;
import com.markdavies.sound.*;
import marvel.centralsmashdown.views.*;
import marvel.centralsmashdown.game.*;
import flash.system.*;
import flash.ui.*;
public class Main extends MovieClip {
public var gameScreen:GameScreen;
public var pl:Preloader;
public var bottomNav:BottomNav;
public var gameControl:GameControl;
public var border:MovieClip;
public var hulkHolder:MovieClip;
public var loginScreen:MovieClip;
public var sc:SoundCollection;
private var _postLoginParams;
public var isMuted:Boolean;// = false
public var debugBox:DebugBox;
private var _so:SharedObject;
public var contentHolder:MovieClip;
public var outerFrame:OuterFrame;
private var _postLoginMethod:Function;
private var _initedParts:Boolean;// = false
public var debugMode:Boolean;// = false
public var preloadScreen:PreloadScreen;
public var marvelUser:MarvelLoginUser;
private static var instance:Main;
public static var EVENT_NAV_CLICK:String = "navClick";
public static var MENU_MODE_SCREEN:String = "screens";
public static var MENU_MODE_GAME:String = "game";
public function Main(){
debugMode = false;
isMuted = false;
_initedParts = false;
super();
addFrameScript(0, frame1, 23, frame24, 34, frame35);
if (instance){
throw (new Error("Main is the document class and can only be accessed through Main.getInstance()"));
};
instance = this;
}
public function gotoGame(_arg1:String):void{
clearContent();
gameControl.gameMode = _arg1;
gotoAndStop("game");
}
private function goLink(_arg1:String, _arg2:String="_blank"):void{
var _local3:URLRequest;
_local3 = new URLRequest(_arg1);
navigateToURL(_local3, _arg2);
}
function frame1(){
init();
stop();
}
public function init():void{
var _local1:ContextMenu;
var _local2:ContextMenuItem;
var _local3:DebugBox;
_local1 = new ContextMenu();
_local1.hideBuiltInItems();
_local2 = new ContextMenuItem("Visit Marvel Kids");
_local2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextOffSiteHandler);
_local1.customItems.push(_local2);
_local2 = new ContextMenuItem("Game by Soap Creative");
_local2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextSoapCreativeHandler);
_local1.customItems.push(_local2);
this.contextMenu = _local1;
_local3 = DebugBox.getInstance();
if ((((Config.DEBUG == true)) || ((this.loaderInfo.parameters.debug == "true")))){
debugMode = true;
addChild(_local3);
};
FlashVars.init(this.root);
if (((((!((FlashVars.data.userID == null))) && (!((FlashVars.data.username == null))))) && (((!((FlashVars.data.countryID == null))) || (!((FlashVars.data.country == null))))))){
marvelUser = new MarvelLoginUser();
marvelUser.userID = FlashVars.data.userID;
marvelUser.username = FlashVars.data.username;
marvelUser.country = ((FlashVars.data.countryID)!=null) ? FlashVars.data.countryID : FlashVars.data.country;
DebugBox.debug("marveluser", ((((("data found " + marvelUser.userID) + " ") + marvelUser.username) + " ") + marvelUser.country));
} else {
DebugBox.debug("marveluser", "no data found");
};
gameControl = GameControl.getInstance();
getSo();
setMute(false);
initPreload();
}
public function initGame():void{
gameControl.registerScreens();
gameControl.start();
sc.fadeSound("s_soundtrack_game", 0.5, 0.25);
sc.fadeSound("s_soundtrack_menu", 0, 0.25);
bottomNav.menu = Main.MENU_MODE_GAME;
}
public function preloadOutHandler(_arg1:CustomEvent):void{
this.removeChild(preloadScreen);
gotoScreens();
}
public function siteLoadErrorHandler(_arg1:Event):void{
trace("LOAD ERROR");
}
function frame35(){
initGame();
}
public function initScreens():void{
if (_initedParts == false){
initParts();
if (marvelUser == null){
showLogin(showContent, Config.NAV_MAINMENU);
} else {
showContent(Config.NAV_MAINMENU);
bottomNav.gotoAndPlay("in");
};
};
sc.fadeSound("s_soundtrack_menu", 0.5, 0.25);
sc.fadeSound("s_soundtrack_game", 0, 0.25);
outerFrame.gotoAndStop("gameName");
outerFrame.yourBestArcade = gameControl.highScoreArcade;
outerFrame.yourBestChallenge = gameControl.highScoreChallenge;
DebugBox.setAtTop();
}
private function hideLogin():void{
loginScreen.removeEventListener(Config.LOGIN_SUCCESS, loginSuccessHandler);
loginScreen.removeEventListener(Config.LOGIN_FAILED, loginFailedHandler);
loginScreen.removeEventListener(Config.LOGIN_CLICK_SKIP, loginSkipHandler);
loginScreen.removeEventListener(Config.LOGIN_CLICK_REGISTER, loginRegisterHandler);
loginScreen.removeEventListener(Config.LOGIN_DONE, loginDoneHandler);
if (_postLoginParams.length > 0){
_postLoginMethod(_postLoginParams);
} else {
_postLoginMethod();
};
}
function frame24(){
initScreens();
stop();
}
public function clearContent():void{
var _local1:Number;
_local1 = 0;
while (_local1 < contentHolder.numChildren) {
contentHolder.removeChildAt(_local1);
_local1++;
};
if (hulkHolder.numChildren > 0){
hulkHolder.removeChildAt(0);
};
}
public function contextSoapCreativeHandler(_arg1:ContextMenuEvent):void{
trace("contextSoapCreativeHandler");
goLink(Config.SOAP_LINK);
}
public function gameOverHandler():void{
bottomNav.menu = Main.MENU_MODE_SCREEN;
gotoScreens();
if (marvelUser == null){
showLogin(showContent, Config.NAV_SUBMITSCORE);
} else {
showContent(Config.NAV_SUBMITSCORE);
};
}
private function loginSuccessHandler(_arg1:CustomEvent):void{
marvelUser = _arg1.data.marvelUser;
}
public function getSo():void{
_so = SharedObject.getLocal("marvel-bad-altitude");
if (_so.data.highScoreArcade != null){
gameControl.highScoreArcade = int(_so.data.highScoreArcade);
};
if (_so.data.highScoreChallenge != null){
gameControl.highScoreChallenge = int(_so.data.highScoreChallenge);
};
}
private function showLogin(_arg1:Function, ... _args):void{
loginScreen = new LoginScreen();
loginScreen.addEventListener(Config.LOGIN_SUCCESS, loginSuccessHandler);
loginScreen.addEventListener(Config.LOGIN_FAILED, loginFailedHandler);
loginScreen.addEventListener(Config.LOGIN_CLICK_SKIP, loginSkipHandler);
loginScreen.addEventListener(Config.LOGIN_CLICK_REGISTER, loginRegisterHandler);
loginScreen.addEventListener(Config.LOGIN_DONE, loginDoneHandler);
clearContent();
contentHolder.addChild(loginScreen);
TweenLite.from(contentHolder, 0.5, {alpha:0});
_postLoginMethod = _arg1;
_postLoginParams = _args;
}
public function navClick(_arg1:CustomEvent){
switch (_arg1.data){
case Config.NAV_MUTE_TOGGLE:
toggleMute();
break;
case Config.NAV_STARTGAME:
showContent(_arg1.data);
break;
case Config.NAV_QUITMAIN_YES:
case Config.NAV_HOWTOPLAY:
case Config.NAV_HIGHSCORES:
case Config.NAV_SENDTOFRIEND:
gotoScreens();
showContent(_arg1.data);
break;
case Config.NAV_MOREGAMES:
case Config.NAV_MARVELLOGO:
goLink("http://www.marvelkids.com");
break;
};
}
public function initParts():void{
_initedParts = true;
border.mouseChildren = false;
border.mouseEnabled = false;
hulkHolder.mouseChildren = false;
hulkHolder.mouseEnabled = false;
bottomNav = outerFrame.bottomNav;
bottomNav.init();
bottomNav.addEventListener(Main.EVENT_NAV_CLICK, navClick);
outerFrame.addEventListener(Main.EVENT_NAV_CLICK, navClick);
addEventListener(Config.EVENT_MUTE_CHANGED, outerFrame.muteChangedHandler);
sc = new SoundCollection();
sc.addLinkedItem(s_soundtrack_menu);
sc.addLinkedItem(s_soundtrack_game);
sc.addLinkedItem(s_damage1);
sc.addLinkedItem(s_damage2);
sc.addLinkedItem(s_damage3);
sc.addLinkedItem(s_damage4);
sc.addLinkedItem(s_explosion1);
sc.addLinkedItem(s_explosion2);
sc.addLinkedItem(s_explosion3);
sc.addLinkedItem(s_explosion4);
sc.addLinkedItem(s_hulksmash1);
sc.addLinkedItem(s_hulksmash2);
sc.addLinkedItem(s_jump1);
sc.addLinkedItem(s_jump2);
sc.addLinkedItem(s_jump3);
sc.addLinkedItem(s_jump4);
sc.addLinkedItem(s_jump5);
sc.addLinkedItem(s_jump6);
sc.addLinkedItem(s_hitground);
sc.addLinkedItem(s_mouseover);
sc.addLinkedItem(s_mousedown);
sc.play("s_soundtrack_menu", 0, 0, 9999999999);
sc.play("s_soundtrack_game", 0, 0, 9999999999);
sc.setVolume("s_soundtrack_game", 0);
sc.setVolume("s_soundtrack_menu", 0.5);
}
public function gotoScreens():void{
gotoAndStop("screens");
}
public function siteLoadedHandler(_arg1:Event):void{
pl.removeEventListener(Event.COMPLETE, siteLoadedHandler);
pl.removeEventListener(Config.EVENT_SITE_LOAD_ERROR, siteLoadErrorHandler);
preloadScreen.goOut();
Mochi.track(root, "f8b44225");
}
public function contextOffSiteHandler(_arg1:ContextMenuEvent):void{
trace("contextOffSiteHandler");
goLink(Config.OFFICIAL_SITE_LINK);
}
private function setMute(_arg1:Boolean){
isMuted = _arg1;
muteChangeHandler();
}
private function loginSkipHandler(_arg1:CustomEvent):void{
hideLogin();
}
public function set so(_arg1:Object):void{
var flushStatus:String;
var obj = _arg1;
_so.data.highScoreArcade = obj.highScoreArcade;
_so.data.highScoreChallenge = obj.highScoreChallenge;
flushStatus = null;
try {
flushStatus = _so.flush(10000);
} catch(error:Error) {
};
}
private function loginRegisterHandler(_arg1:CustomEvent):void{
var _local2:String;
_local2 = (("javascript:loadSignup('" + FlashVars.data.ref) + "')");
goLink(_local2, "_self");
}
private function toggleMute():void{
isMuted = !(isMuted);
muteChangeHandler();
}
private function loginFailedHandler(_arg1:CustomEvent):void{
}
public function initPreload():void{
pl = new Preloader();
pl.addItem(this);
pl.startCheckPreload();
pl.addEventListener(Event.COMPLETE, siteLoadedHandler);
pl.addEventListener(Preloader.EVENT_SITE_LOAD_ERROR, siteLoadErrorHandler);
pl.timer.addEventListener(TimerEvent.TIMER, preloadScreen.render);
preloadScreen.addEventListener(Config.EVENT_SITE_LOADED, preloadOutHandler);
}
public function showContent(_arg1:String):void{
var _local2:Class;
var _local3:*;
var _local4:MovieClip;
clearContent();
switch (_arg1){
case Config.NAV_MAINMENU:
case Config.NAV_QUITMAIN_YES:
_local2 = MainMenu;
_local3 = new Hulk();
hulkHolder.addChild(_local3);
bottomNav.menu = Main.MENU_MODE_SCREEN;
break;
case Config.NAV_HOWTOPLAY:
_local2 = HowToPlay;
break;
case Config.NAV_HIGHSCORES:
_local2 = HighScores;
break;
case Config.NAV_SENDTOFRIEND:
_local2 = SendToFriend;
break;
case Config.NAV_STARTGAME:
_local2 = ChooseGameMode;
gotoScreens();
break;
case Config.NAV_SUBMITSCORE:
_local2 = SubmitScore;
gotoScreens();
break;
};
if (_local2 != null){
_local4 = new (_local2);
contentHolder.addChild(_local4);
_local4.removeEventListener(Main.EVENT_NAV_CLICK, navClick);
_local4.addEventListener(Main.EVENT_NAV_CLICK, navClick);
TweenLite.from(_local4, 0.5, {alpha:0});
};
}
private function muteChangeHandler():void{
SoundMixer.soundTransform = new SoundTransform(((isMuted)==true) ? 0 : Config.MAX_VOLUME);
dispatchEvent(new CustomEvent(Config.EVENT_MUTE_CHANGED, isMuted));
}
private function loginDoneHandler(_arg1:CustomEvent):void{
hideLogin();
}
public static function getInstance():Main{
return (instance);
}
}
}//package marvel.centralsmashdown
Section 86
//BackgroundPiece (BackgroundPiece)
package {
import marvel.centralsmashdown.game.views.*;
public dynamic class BackgroundPiece extends BackgroundPiece {
public function BackgroundPiece(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 87
//BonusSprite (BonusSprite)
package {
import marvel.centralsmashdown.game.sprites.*;
public dynamic class BonusSprite extends BonusSprite {
}
}//package
Section 88
//BottomNav (BottomNav)
package {
import marvel.centralsmashdown.views.*;
public dynamic class BottomNav extends BottomNav {
public function BottomNav(){
addFrameScript(0, frame1, 23, frame24, 51, frame52, 74, frame75);
}
function frame75(){
gotoAndPlay("screens");
}
function frame1(){
stop();
}
function frame24(){
if (_menu == "screens"){
gotoAndStop("screens");
};
}
function frame52(){
if (_menu == "game"){
gotoAndStop("game");
};
}
}
}//package
Section 89
//ChooseGameMode (ChooseGameMode)
package {
import marvel.centralsmashdown.views.*;
public dynamic class ChooseGameMode extends ChooseGameMode {
}
}//package
Section 90
//ComicTextDisplay (ComicTextDisplay)
package {
import marvel.centralsmashdown.game.views.*;
public dynamic class ComicTextDisplay extends ComicTextDisplay {
public function ComicTextDisplay(){
addFrameScript(2, frame3, 7, frame8, 14, frame15, 21, frame22, 28, frame29, 37, frame38);
}
function frame3(){
go();
}
function frame15(){
go();
}
function frame8(){
go();
}
function frame22(){
go();
}
function frame29(){
go();
}
function frame38(){
go();
}
}
}//package
Section 91
//CountryDropDown (CountryDropDown)
package {
import marvel.centralsmashdown.ui.*;
public dynamic class CountryDropDown extends CountryDropDown {
}
}//package
Section 92
//CountryDropDownItem (CountryDropDownItem)
package {
import marvel.centralsmashdown.ui.*;
public dynamic class CountryDropDownItem extends CountryDropDownItem {
}
}//package
Section 93
//Crack (Crack)
package {
import flash.display.*;
public dynamic class Crack extends MovieClip {
}
}//package
Section 94
//Enemy (Enemy)
package {
import com.markdavies.events.*;
import marvel.centralsmashdown.game.sprites.*;
public dynamic class Enemy extends Enemy {
public function Enemy(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
stop();
}
function frame45(){
dispatchEvent(new CustomEvent(GameSprite.EVENT_ENEMY_DIE));
stop();
}
}
}//package
Section 95
//Flags (Flags)
package {
import flash.display.*;
public dynamic class Flags extends MovieClip {
}
}//package
Section 96
//GameOver (GameOver)
package {
import marvel.centralsmashdown.game.views.*;
public dynamic class GameOver extends GameOver {
public function GameOver(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package
Section 97
//GameScreen (GameScreen)
package {
import marvel.centralsmashdown.game.*;
public dynamic class GameScreen extends GameScreen {
}
}//package
Section 98
//HighScores (HighScores)
package {
import marvel.centralsmashdown.views.*;
public dynamic class HighScores extends HighScores {
public function HighScores(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package
Section 99
//HowToPlay (HowToPlay)
package {
import marvel.centralsmashdown.views.*;
public dynamic class HowToPlay extends HowToPlay {
public function HowToPlay(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 100
//Hulk (Hulk)
package {
import flash.display.*;
public dynamic class Hulk extends MovieClip {
public function Hulk(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package
Section 101
//LoginScreen (LoginScreen)
package {
import marvel.centralsmashdown.views.*;
public dynamic class LoginScreen extends LoginScreen {
public function LoginScreen(){
addFrameScript(0, frame1);
}
function frame1(){
init();
stop();
}
}
}//package
Section 102
//MainMenu (MainMenu)
package {
import flash.display.*;
public dynamic class MainMenu extends MovieClip {
}
}//package
Section 103
//MiniMap (MiniMap)
package {
import marvel.centralsmashdown.game.views.*;
public dynamic class MiniMap extends MiniMap {
public function MiniMap(){
addFrameScript(1, frame2, 12, frame13, 21, frame22, 29, frame30);
}
function frame22(){
if (_showing == true){
gotoAndStop("in");
};
}
function frame13(){
masker.gotoAndStop(2);
}
function frame2(){
if (_showing != true){
gotoAndStop("out");
};
}
function frame30(){
masker.gotoAndStop(1);
}
}
}//package
Section 104
//MiniMapSprite (MiniMapSprite)
package {
import marvel.centralsmashdown.game.sprites.*;
public dynamic class MiniMapSprite extends MiniMapSprite {
}
}//package
Section 105
//OuterFrame (OuterFrame)
package {
import marvel.centralsmashdown.views.*;
public dynamic class OuterFrame extends OuterFrame {
public function OuterFrame(){
addFrameScript(0, frame1, 3, frame4, 4, frame5);
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
}
}//package
Section 106
//PauseScreen (PauseScreen)
package {
import flash.display.*;
public dynamic class PauseScreen extends MovieClip {
public var btnPaused:MovieClip;
public function PauseScreen(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 107
//Player (Player)
package {
import marvel.centralsmashdown.game.sprites.*;
public dynamic class Player extends Player {
}
}//package
Section 108
//PreloadScreen (PreloadScreen)
package {
import marvel.centralsmashdown.views.*;
public dynamic class PreloadScreen extends PreloadScreen {
public function PreloadScreen(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
out();
stop();
}
function frame1(){
stop();
}
}
}//package
Section 109
//QuitToMain (QuitToMain)
package {
import marvel.centralsmashdown.game.views.*;
public dynamic class QuitToMain extends QuitToMain {
}
}//package
Section 110
//s_damage1 (s_damage1)
package {
import flash.media.*;
public dynamic class s_damage1 extends Sound {
}
}//package
Section 111
//s_damage2 (s_damage2)
package {
import flash.media.*;
public dynamic class s_damage2 extends Sound {
}
}//package
Section 112
//s_damage3 (s_damage3)
package {
import flash.media.*;
public dynamic class s_damage3 extends Sound {
}
}//package
Section 113
//s_damage4 (s_damage4)
package {
import flash.media.*;
public dynamic class s_damage4 extends Sound {
}
}//package
Section 114
//s_explosion1 (s_explosion1)
package {
import flash.media.*;
public dynamic class s_explosion1 extends Sound {
}
}//package
Section 115
//s_explosion2 (s_explosion2)
package {
import flash.media.*;
public dynamic class s_explosion2 extends Sound {
}
}//package
Section 116
//s_explosion3 (s_explosion3)
package {
import flash.media.*;
public dynamic class s_explosion3 extends Sound {
}
}//package
Section 117
//s_explosion4 (s_explosion4)
package {
import flash.media.*;
public dynamic class s_explosion4 extends Sound {
}
}//package
Section 118
//s_hitground (s_hitground)
package {
import flash.media.*;
public dynamic class s_hitground extends Sound {
}
}//package
Section 119
//s_hulksmash1 (s_hulksmash1)
package {
import flash.media.*;
public dynamic class s_hulksmash1 extends Sound {
}
}//package
Section 120
//s_hulksmash2 (s_hulksmash2)
package {
import flash.media.*;
public dynamic class s_hulksmash2 extends Sound {
}
}//package
Section 121
//s_jump1 (s_jump1)
package {
import flash.media.*;
public dynamic class s_jump1 extends Sound {
}
}//package
Section 122
//s_jump2 (s_jump2)
package {
import flash.media.*;
public dynamic class s_jump2 extends Sound {
}
}//package
Section 123
//s_jump3 (s_jump3)
package {
import flash.media.*;
public dynamic class s_jump3 extends Sound {
}
}//package
Section 124
//s_jump4 (s_jump4)
package {
import flash.media.*;
public dynamic class s_jump4 extends Sound {
}
}//package
Section 125
//s_jump5 (s_jump5)
package {
import flash.media.*;
public dynamic class s_jump5 extends Sound {
}
}//package
Section 126
//s_jump6 (s_jump6)
package {
import flash.media.*;
public dynamic class s_jump6 extends Sound {
}
}//package
Section 127
//s_mousedown (s_mousedown)
package {
import flash.media.*;
public dynamic class s_mousedown extends Sound {
}
}//package
Section 128
//s_mouseover (s_mouseover)
package {
import flash.media.*;
public dynamic class s_mouseover extends Sound {
}
}//package
Section 129
//s_soundtrack_game (s_soundtrack_game)
package {
import flash.media.*;
public dynamic class s_soundtrack_game extends Sound {
}
}//package
Section 130
//s_soundtrack_menu (s_soundtrack_menu)
package {
import flash.media.*;
public dynamic class s_soundtrack_menu extends Sound {
}
}//package
Section 131
//SendToFriend (SendToFriend)
package {
import marvel.centralsmashdown.views.*;
public dynamic class SendToFriend extends SendToFriend {
public function SendToFriend(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 132
//SubmitScore (SubmitScore)
package {
import marvel.centralsmashdown.views.*;
public dynamic class SubmitScore extends SubmitScore {
public function SubmitScore(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package