Section 1
//FlashChecker (classes.gamezhero.FlashChecker)
package classes.gamezhero {
import flash.display.*;
public dynamic class FlashChecker extends MovieClip {
public var b:SimpleButton;
public function FlashChecker(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package classes.gamezhero
Section 2
//MD5 (com.gamezhero.as3.crypto.MD5)
package com.gamezhero.as3.crypto {
import com.gamezhero.as3.utils.*;
public class MD5 {
private function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int;
_local9 = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private function createBlocks(_arg1:String):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = new Array();
_local3 = (_arg1.length * 8);
_local4 = 0xFF;
_local5 = 0;
while (_local5 < _local3) {
_local2[(_local5 >> 5)] = (_local2[(_local5 >> 5)] | ((_arg1.charCodeAt((_local5 / 8)) & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[(_local3 >> 5)] = (_local2[(_local3 >> 5)] | (128 << (_local3 % 32)));
_local2[((((_local3 + 64) >>> 9) << 4) + 14)] = _local3;
return (_local2);
}
public function hash(_arg1:String):String{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:int;
_local2 = 1732584193;
_local3 = -271733879;
_local4 = -1732584194;
_local5 = 271733878;
_local10 = createBlocks(_arg1);
_local11 = _local10.length;
_local12 = 0;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 1)], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 3)], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 5)], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 7)], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 9)], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 11)], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 13)], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 15)], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 6)], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 0)], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 10)], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 4)], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 14)], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 8)], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 2)], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 12)], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 8)], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 14)], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 4)], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 10)], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 0)], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 6)], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 12)], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 2)], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 7)], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 5)], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 3)], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 1)], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 15)], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 13)], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 11)], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 9)], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
}
}//package com.gamezhero.as3.crypto
Section 3
//ClassLoader (com.gamezhero.as3.utils.ClassLoader)
package com.gamezhero.as3.utils {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class ClassLoader extends EventDispatcher {
private var loader:Loader;
private var request:URLRequest;
private var swfLib:String;
private var loadedClass:Class;
public static var CLASS_LOADED:String = "classLoaded";
public static var LOAD_ERROR:String = "loadError";
public function ClassLoader(){
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
}
public function getClass(_arg1:String):Class{
var className = _arg1;
try {
return ((loader.contentLoaderInfo.applicationDomain.getDefinition(className) as Class));
} catch(e:Error) {
trace("ERROR");
};
return (null);
}
private function securityErrorHandler(_arg1:Event):void{
dispatchEvent(new Event(ClassLoader.LOAD_ERROR));
}
private function completeHandler(_arg1:Event):void{
dispatchEvent(new Event(ClassLoader.CLASS_LOADED));
}
private function ioErrorHandler(_arg1:Event):void{
dispatchEvent(new Event(ClassLoader.LOAD_ERROR));
}
public function load(_arg1:String):void{
var _local2:LoaderContext;
swfLib = _arg1;
request = new URLRequest(swfLib);
_local2 = new LoaderContext();
_local2.applicationDomain = new ApplicationDomain();
loader.load(request, _local2);
}
}
}//package com.gamezhero.as3.utils
Section 4
//IntUtil (com.gamezhero.as3.utils.IntUtil)
package com.gamezhero.as3.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local3:String;
var _local4:int;
var _local5:int;
_local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int;
_local3 = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
}
}//package com.gamezhero.as3.utils
Section 5
//GamePreloader (com.gamezhero.as3.GamePreloader)
package com.gamezhero.as3 {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.ui.*;
public class GamePreloader extends MovieClip {
private var obj:Object;
private var urls:Dictionary;
public var bg:MovieClip;
private var rate_old:Number;
public var intro:MovieClip;
private var par:MovieClip;
private var scale_old:String;
private var align_old:String;
public static const finish:String = "PRELOAD_COMPLETE";
public function GamePreloader(_arg1:MovieClip, _arg2:Object){
var _local3:ContextMenu;
var _local4:ContextMenuBuiltInItems;
var _local5:String;
var _local6:ContextMenuItem;
urls = new Dictionary();
super();
obj = _arg2;
par = _arg1;
par.addChild(this);
stage.addEventListener(Event.RESIZE, resizeStage);
this.addEventListener(Event.ENTER_FRAME, iniPreloader);
scale_old = stage.scaleMode;
align_old = stage.align;
rate_old = stage.frameRate;
trace(scale_old, align_old);
resizeStage(null);
_local3 = new ContextMenu();
_local3.hideBuiltInItems();
_local4 = _local3.builtInItems;
for (_local5 in _arg2.gamezhero_menu) {
_local6 = new ContextMenuItem(_local5);
_local6.caption = _local5;
urls[_local6] = _arg2.gamezhero_menu[_local5];
_local6.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, getURLContextMenu);
_local3.customItems.push(_local6);
};
par.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
par.loaderInfo.addEventListener(Event.COMPLETE, comp);
this.parent.contextMenu = _local3;
this.addEventListener(MouseEvent.MOUSE_DOWN, getURLPreloader);
this.useHandCursor = true;
this.buttonMode = true;
}
public function comp(_arg1:Event=null):void{
}
public function action(_arg1:Event=null):void{
var _local2:Event;
stage.scaleMode = scale_old;
stage.align = align_old;
stage.frameRate = rate_old;
this.removeEventListener(Event.ENTER_FRAME, iniPreloader);
stage.removeEventListener(Event.RESIZE, resizeStage);
par.loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
par.loaderInfo.removeEventListener(Event.COMPLETE, comp);
_local2 = new Event(finish);
this.dispatchEvent(_local2);
par.removeChild(this);
}
public function getURLPreloader(_arg1:MouseEvent=null):void{
getURL(obj.gamezhero_url);
}
public function getURL(_arg1:String):void{
var _local2:URLRequest;
_local2 = new URLRequest(_arg1);
navigateToURL(_local2, "_blank");
}
public function ioErrorHandler(_arg1:Event):void{
}
public function resizeStage(_arg1:Event):void{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.frameRate = 20;
this["bg"].width = Math.round(stage.stageWidth);
this["bg"].height = Math.round(stage.stageHeight);
this["intro"].x = Math.round((stage.stageWidth / 2));
this["intro"].y = Math.round((stage.stageHeight / 2));
}
public function getURLContextMenu(_arg1:ContextMenuEvent=null):void{
getURL(urls[_arg1.target]);
}
public function iniPreloader(_arg1:Event):void{
var _local2:Number;
_local2 = (-128 + (132 * (par.loaderInfo.bytesLoaded / par.loaderInfo.bytesTotal)));
this["intro"]["pr"]["begun"].x = (this["intro"]["pr"]["begun"].x - ((this["intro"]["pr"]["begun"].x - _local2) / 5));
if (par.loaderInfo.bytesLoaded != par.loaderInfo.bytesTotal){
if (this["intro"].currentLabel == "stopFrame"){
this["intro"].stop();
};
} else {
if (this["intro"].currentLabel == "stopFrame"){
this["intro"].play();
};
if (this["intro"].currentFrame == this["intro"].totalFrames){
this["intro"].stop();
action();
};
if (obj.debug){
action();
};
};
}
}
}//package com.gamezhero.as3
Section 6
//SubmitArea (com.gamezhero.as3.SubmitArea)
package com.gamezhero.as3 {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import com.gamezhero.as3.crypto.*;
import com.gamezhero.as3.utils.*;
import flash.system.*;
public class SubmitArea extends MovieClip {
private var x_pos:Number;// = 0
private var goal:MovieClip;
private var language:String;
private var infoText:TextField;
private var score_value:Number;// = 0
private var y_pos:Number;// = 0
public var secret:MD5;
private var scoreLibrary:ClassLoader;
private var score;
public var versionGame:String;// = "1.0"
public static const CONTINUE:String = "gamezhero_continue";
public static const SUBMITED:String = "gamezhero_submited";
public function SubmitArea(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:Number, _arg5:Array, _arg6:String="ENG"){
var _local7:String;
var _local8:uint;
versionGame = "1.0";
score_value = 0;
x_pos = 0;
y_pos = 0;
super();
x_pos = _arg2;
y_pos = _arg3;
goal = _arg1;
score_value = _arg4;
language = _arg6;
Security.allowDomain("www.gamezhero.com", "gamezhero.com", "files.gamezhero.com", "*.gamezhero.com");
secret = new MD5();
scoreLibrary = new ClassLoader();
scoreLibrary.addEventListener(ClassLoader.LOAD_ERROR, loadErrorHandler);
scoreLibrary.addEventListener(ClassLoader.CLASS_LOADED, classLoadedHandler);
_local7 = "";
_local8 = 0;
while (_local8 < _arg5.length) {
_local7 = (_local7 + String.fromCharCode(_arg5[_local8]));
_local8++;
};
trace(_local7);
scoreLibrary.load(_local7);
createIniText();
infoText.text = "loading score...";
goal.addChild(this);
}
public function submitAction(_arg1:String=""):void{
diactivateAllEvents();
goal.removeChild(this);
dispatchEvent(new Event(SUBMITED));
}
public function loadErrorHandler(_arg1:Event=null):void{
(infoText as TextField).text = "error loading";
}
public function diactivateAllEvents():void{
scoreLibrary.removeEventListener(ClassLoader.LOAD_ERROR, loadErrorHandler);
scoreLibrary.removeEventListener(ClassLoader.CLASS_LOADED, classLoadedHandler);
}
public function createIniText():void{
var _local1:TextFormat;
infoText = new TextField();
infoText.autoSize = TextFieldAutoSize.LEFT;
_local1 = new TextFormat();
_local1.color = 0;
_local1.size = 11;
_local1.font = "Arial";
infoText.defaultTextFormat = _local1;
this.addChild(infoText);
infoText.x = 10;
infoText.y = 10;
}
public function continueAction():void{
diactivateAllEvents();
goal.removeChild(this);
dispatchEvent(new Event(CONTINUE));
}
public function classLoadedHandler(_arg1:Event=null):void{
var _local2:Class;
this.x = x_pos;
this.y = y_pos;
(infoText as TextField).text = "";
_local2 = scoreLibrary.getClass("Score");
score = new _local2((this as MovieClip), null, score_value, language);
this.addChild(score);
}
}
}//package com.gamezhero.as3
Section 7
//ArtClip_1 (on_fla.ArtClip_1)
package on_fla {
import flash.display.*;
public dynamic class ArtClip_1 extends MovieClip {
public function ArtClip_1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package on_fla
Section 8
//gameZheroPreloader_70 (on_fla.gameZheroPreloader_70)
package on_fla {
import flash.display.*;
public dynamic class gameZheroPreloader_70 extends MovieClip {
public var pr:MovieClip;
public function gameZheroPreloader_70(){
addFrameScript(139, frame140);
}
function frame140(){
stop();
}
}
}//package on_fla
Section 9
//gloweffectinstructions_35 (on_fla.gloweffectinstructions_35)
package on_fla {
import flash.display.*;
public dynamic class gloweffectinstructions_35 extends MovieClip {
public var nextButton:SimpleButton;
public function gloweffectinstructions_35(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package on_fla
Section 10
//gloweffectpaused_37 (on_fla.gloweffectpaused_37)
package on_fla {
import flash.display.*;
import flash.text.*;
public dynamic class gloweffectpaused_37 extends MovieClip {
public var resume:SimpleButton;
public var endGame:SimpleButton;
public var scorePause:TextField;
public var difficulty:TextField;
public function gloweffectpaused_37(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package on_fla
Section 11
//gloweffectsubmit_40 (on_fla.gloweffectsubmit_40)
package on_fla {
import flash.display.*;
import flash.text.*;
public dynamic class gloweffectsubmit_40 extends MovieClip {
public var submitScore:SimpleButton;
public var score:TextField;
public var loseBack:SimpleButton;
public var multiplier:TextField;
public var time:TextField;
public var replay:SimpleButton;
public function gloweffectsubmit_40(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package on_fla
Section 12
//Hero_14 (on_fla.Hero_14)
package on_fla {
import flash.display.*;
import flash.media.*;
public dynamic class Hero_14 extends MovieClip {
public var deathTransform;
public var death;
public function Hero_14(){
addFrameScript(0, frame1, 1, frame2, 19, frame20);
}
function frame1(){
stop();
}
function frame20(){
stop();
Main.loseGame();
}
function frame2(){
death = new DeathSound();
deathTransform = new SoundTransform(Volume.death);
Main.play(death, deathTransform);
}
}
}//package on_fla
Section 13
//MainTimeline (on_fla.MainTimeline)
package on_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.media.*;
import flash.net.*;
import com.gamezhero.as3.*;
import flash.utils.*;
import flash.geom.*;
import flash.system.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var obj:Object;
public var gamePreloader:GamePreloader;
public var main;
public var game_name;
public function MainTimeline(){
addFrameScript(2, frame3, 3, frame4, 28, frame29);
}
public function nextStep(_arg1:Event):void{
play();
}
function frame3(){
stop();
obj = new Object();
game_name = "ontheway";
obj.game_name = game_name;
obj.debug = false;
obj.gamezhero_url = (((("http://www.gamezhero.com/?utm_campaign=" + game_name) + "&utm_source=") + game_name) + "&utm_medium=preloader");
obj.gamezhero_menu = {Free Online Games @ Gamezhero.com:(((("http://www.gamezhero.com/?utm_campaign=" + game_name) + "&utm_source=") + game_name) + "&utm_medium=context_menu"), Send To Friends:(((((("http://www.gamezhero.com/sendtofriends/" + game_name) + "-games.html?utm_campaign=") + game_name) + "&utm_source=") + game_name) + "&utm_medium=send_to_friends_context_menu"), Put This Game To Your Blog or Site:(((((("http://www.gamezhero.com/freewebsitegames/" + game_name) + "-games.html?utm_campaign=") + game_name) + "&utm_source=") + game_name) + "&utm_medium=free_web_site_games_context")};
gamePreloader = new GamePreloader(this, obj);
gamePreloader.addEventListener(GamePreloader.finish, nextStep, false, 0, true);
}
function frame4(){
}
function frame29(){
stop();
main = new Main();
addChild(main);
main.main();
}
}
}//package on_fla
Section 14
//MedalsBackground_43 (on_fla.MedalsBackground_43)
package on_fla {
import flash.display.*;
import flash.text.*;
public dynamic class MedalsBackground_43 extends MovieClip {
public var angel:SimpleButton;
public var description:TextField;
public var silver:SimpleButton;
public var miser:SimpleButton;
public var shave:SimpleButton;
public var gold:SimpleButton;
public var bronze:SimpleButton;
public var difficulty:TextField;
public var back:SimpleButton;
}
}//package on_fla
Section 15
//MuteClip_59 (on_fla.MuteClip_59)
package on_fla {
import flash.display.*;
import flash.events.*;
public dynamic class MuteClip_59 extends MovieClip {
public var mute:SimpleButton;
public function MuteClip_59(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
if (!Main.isMute()){
gotoAndStop(2);
};
mute.addEventListener(MouseEvent.CLICK, clickMute, false, 0, true);
}
function frame2(){
stop();
if (Main.isMute()){
gotoAndStop(1);
};
mute.addEventListener(MouseEvent.CLICK, clickMute2, false, 0, true);
}
public function clickMute2(_arg1:MouseEvent):void{
Main.toggleMute();
gotoAndStop(1);
}
public function clickMute(_arg1:MouseEvent):void{
Main.toggleMute();
gotoAndStop(2);
}
}
}//package on_fla
Section 16
//preloaderLine_71 (on_fla.preloaderLine_71)
package on_fla {
import flash.display.*;
public dynamic class preloaderLine_71 extends MovieClip {
public var begun:MovieClip;
}
}//package on_fla
Section 17
//z_2_26 (on_fla.z_2_26)
package on_fla {
import flash.display.*;
public dynamic class z_2_26 extends MovieClip {
public function z_2_26(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package on_fla
Section 18
//Award (Award)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
import flash.geom.*;
class Award {
var buttons:Array;
var toolTip:TextField;
var awards:Array;
var disk:SharedObject;
public static var miserThreshold = 120000;
public static var SILVER:int = 1;
public static var shaveThreshold = 5;
public static var BRONZE:int = 0;
public static var GOLD:int = 2;
public static var ANGEL:int = 4;
public static var MISER:int = 5;
public static var silverThreshold = 60000;
public static var angelThreshold = 10;
public static var totalCount = (COUNT * Difficulty.count);
public static var COUNT:int = 6;
public static var bronzeThreshold = 30000;
static var tips:Array = new Array("Bronze Medal: Survive for 30 seconds.", "Silver Medal: Survive for 1 minute.", "Gold Medal: Survive for 2 minutes.", "Close Shave: Squeek by the spikes on the top of the screen.", "Guardian Angel: Survive certain doom by landing on a lucky platform.", "Jump Miser: Survive for 2 minutes without jumping.");
public static var goldThreshold = 120000;
public static var SHAVE:int = 3;
public static var NO_AWARD:int = -1;
function Award():void{
disk = SharedObject.getLocal("OnTheWayAwards");
if ((((disk.data.awards == null)) || ((disk.data.awards.size < totalCount)))){
resetAwards();
disk.data.awards = copyArray(awards);
disk.flush();
} else {
awards = copyArray(disk.data.awards);
};
}
function rollOut(_arg1:MouseEvent):void{
toolTip.visible = false;
}
public function checkDifficulty(_arg1:int, _arg2:int):int{
var _local3:*;
_local3 = NO_AWARD;
if (_arg1 >= bronzeThreshold){
_local3 = BRONZE;
};
if (_arg1 >= silverThreshold){
_local3 = SILVER;
};
if (_arg1 >= goldThreshold){
_local3 = GOLD;
};
if (_local3 != NO_AWARD){
_local3 = awardNum(_local3, _arg2);
addAward(_local3);
};
return (_local3);
}
function copyArray(_arg1:Array):Array{
var _local2:Array;
var _local3:int;
_local2 = new Array(_arg1.length);
_local3 = 0;
while (_local3 < _arg1.length) {
_local2[_local3] = _arg1[_local3];
_local3++;
};
return (_local2);
}
function resetAwards():void{
var _local1:int;
awards = new Array(totalCount);
_local1 = 0;
while (_local1 < awards.length) {
awards[_local1] = false;
_local1++;
};
}
function awardNum(_arg1:int, _arg2:int):int{
return ((_arg1 + (_arg2 * COUNT)));
}
public function checkMiser(_arg1:int, _arg2:int):int{
var _local3:*;
_local3 = NO_AWARD;
if (_arg1 >= miserThreshold){
_local3 = awardNum(MISER, _arg2);
addAward(_local3);
};
return (_local3);
}
function rollOver(_arg1:MouseEvent):void{
var _local2:int;
_local2 = buttons.indexOf(_arg1.target);
toolTip.visible = true;
toolTip.text = tips[_local2];
}
public function cleanupAwards():void{
var _local1:int;
_local1 = 0;
while (_local1 < COUNT) {
buttons[_local1].removeEventListener(MouseEvent.ROLL_OVER, rollOver);
buttons[_local1].removeEventListener(MouseEvent.ROLL_OUT, rollOut);
_local1++;
};
buttons = null;
toolTip = null;
}
public function checkShave(_arg1:int, _arg2:int):int{
var _local3:*;
_local3 = NO_AWARD;
if (_arg1 < shaveThreshold){
_local3 = awardNum(SHAVE, _arg2);
addAward(_local3);
};
return (_local3);
}
public function displayAwards(_arg1:MovieClip, _arg2:int):void{
var _local3:int;
var _local4:int;
var _local5:*;
var _local6:*;
var _local7:*;
buttons = new Array(_arg1.bronze, _arg1.silver, _arg1.gold, _arg1.shave, _arg1.angel, _arg1.miser);
toolTip = _arg1.description;
toolTip.visible = false;
_local3 = (_arg2 * COUNT);
_local4 = ((_arg2 + 1) * COUNT);
while (_local3 < _local4) {
_local5 = (_local3 % COUNT);
buttons[_local5].addEventListener(MouseEvent.ROLL_OVER, rollOver);
buttons[_local5].addEventListener(MouseEvent.ROLL_OUT, rollOut);
_local6 = new ColorTransform();
_local7 = new ColorTransform(0, 0, 0, 1, 0, 0, 0, 0);
if (awards[_local3]){
buttons[_local5].transform.colorTransform = _local6;
} else {
buttons[_local5].transform.colorTransform = _local7;
};
_local3++;
};
}
public function checkAngel(_arg1:int, _arg2:int):int{
var _local3:*;
_local3 = NO_AWARD;
if (_arg1 < angelThreshold){
_local3 = awardNum(ANGEL, _arg2);
addAward(_local3);
};
return (_local3);
}
function addAward(_arg1:int):void{
if ((((_arg1 >= 0)) && ((_arg1 < totalCount)))){
awards[_arg1] = true;
disk.data.awards = copyArray(awards);
disk.flush();
};
}
public static function awardFrame(_arg1:int){
return (((_arg1 % COUNT) + 1));
}
}
}//package
Section 19
//AwardDisplay (AwardDisplay)
package {
import flash.display.*;
import flash.media.*;
public class AwardDisplay {
var clips:DList;
var base:Sprite;
var awards:DList;
static var transform:SoundTransform = new SoundTransform(Volume.award);
static var sound:Sound = new AwardSound();
public function AwardDisplay(_arg1:DisplayObjectContainer):void{
base = new Sprite();
_arg1.addChild(base);
clips = new DList();
awards = new DList();
}
public function add(_arg1:int):void{
var _local2:MovieClip;
var _local3:int;
if (!hasAward(_arg1)){
_local2 = new AwardGameClip();
base.addChild(_local2);
_local2.gotoAndStop(Award.awardFrame(_arg1));
_local2.scaleX = 0.5;
_local2.scaleY = 0.5;
_local3 = ((Size.gameAward + 2) * clips.size());
_local2.x = Size.gameAward;
_local2.y = ((Size.screenY - (Size.gameAward * 2)) - _local3);
clips.push_back(_local2);
awards.push_back(_arg1);
Main.play(sound, transform);
};
}
function hasAward(_arg1:int):Boolean{
return (awards.find(_arg1).isValid());
}
public function cleanup():void{
var _local1:*;
_local1 = clips.frontIterator();
while (_local1.isValid()) {
_local1.get().parent.removeChild(_local1.get());
_local1.increment();
};
clips = null;
base.parent.removeChild(base);
base = null;
}
}
}//package
Section 20
//AwardGameClip (AwardGameClip)
package {
import flash.display.*;
public dynamic class AwardGameClip extends MovieClip {
}
}//package
Section 21
//AwardSound (AwardSound)
package {
import flash.media.*;
public dynamic class AwardSound extends Sound {
}
}//package
Section 22
//BackgroundClip (BackgroundClip)
package {
import flash.display.*;
public dynamic class BackgroundClip extends MovieClip {
public var secondBack:MovieClip;
public var firstBack:MovieClip;
public function BackgroundClip(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
Main.game.setBackgroundDisplay(new BackgroundDisplay(this, firstBack, secondBack));
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 23
//BackgroundDisplay (BackgroundDisplay)
package {
import flash.display.*;
import flash.geom.*;
class BackgroundDisplay {
var color:uint;
var posY:int;
var parent:DisplayObjectContainer;
var bottom:MovieClip;
var top:MovieClip;
var topShape:Shape;
var bottomShape:Shape;
static var bottomOffset:int = 400;
static var width = 0x0400;
static var height = (bottomOffset - topOffset);
static var topOffset:int = 0;
static var alpha:Number = 0.3;
function BackgroundDisplay(_arg1:BackgroundClip, _arg2:MovieClip, _arg3:MovieClip):void{
var _local4:Rectangle;
super();
parent = _arg1;
top = _arg2;
topShape = new Shape();
top.addChild(topShape);
_local4 = top.getBounds(top);
topShape.x = _local4.left;
topShape.y = _local4.top;
bottom = _arg3;
bottomShape = new Shape();
bottom.addChild(bottomShape);
_local4 = bottom.getBounds(bottom);
bottomShape.x = _local4.left;
bottomShape.y = _local4.top;
posY = 0;
color = 15;
drawNext(topShape);
drawNext(bottomShape);
step(0);
}
public function cleanup():void{
bottomShape.parent.removeChild(bottomShape);
topShape.parent.removeChild(topShape);
}
public function getBottom():DisplayObjectContainer{
return (bottom);
}
function expandColor(_arg1:uint):uint{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = (_arg1 & 31);
_local3 = ((_arg1 >> 5) + 1);
_local4 = _local2;
if (_local2 > 15){
_local4 = (31 - _local2);
};
_local5 = 0;
if ((_local3 & 1) != 0){
_local5 = (_local5 | (_local4 << 4));
};
if ((_local3 & 2) != 0){
_local5 = (_local5 | (_local4 << 12));
};
if ((_local3 & 4) != 0){
_local5 = (_local5 | (_local4 << 20));
};
return (_local5);
}
public function step(_arg1:int):void{
var _local2:int;
_local2 = ((posY + (_arg1 * Speed.platform)) % Size.screenY);
if (_local2 < posY){
swap();
drawNext(bottomShape);
};
posY = _local2;
top.y = (topOffset - posY);
bottom.y = (bottomOffset - posY);
}
function drawNext(_arg1:Shape):void{
var _local2:*;
_arg1.graphics.clear();
_local2 = new Matrix();
_local2.createGradientBox(width, height, (Math.PI / 2), 0);
_arg1.graphics.beginGradientFill(GradientType.LINEAR, new Array(expandColor(color), expandColor((color + 1))), new Array(alpha, alpha), new Array(0, 0xFF), _local2);
_arg1.graphics.drawRect(0, 0, width, height);
_arg1.graphics.endFill();
color = (color + 1);
}
function swap():void{
var _local1:*;
var _local2:*;
parent.swapChildren(top, bottom);
_local1 = top;
top = bottom;
bottom = _local1;
_local2 = topShape;
topShape = bottomShape;
bottomShape = _local2;
}
}
}//package
Section 24
//BackgroundFoobar (BackgroundFoobar)
package {
import flash.display.*;
public dynamic class BackgroundFoobar extends MovieClip {
}
}//package
Section 25
//Bonus (Bonus)
package {
import flash.display.*;
class Bonus {
protected var clip:MovieClip;
protected var type:int;
public static var NONE = 1;
public static var SNAIL = 2;
public static var WINGS = 3;
function Bonus(_arg1:DisplayObjectContainer, _arg2:int, _arg3:int):void{
var _local4:int;
super();
clip = new BonusClip();
_arg1.addChild(clip);
clip.cacheAsBitmap = true;
type = _arg2;
clip.gotoAndStop(type);
_local4 = (_arg3 - (Size.bonusRadius * 2));
clip.y = (-(Size.bonusRadius) - 3);
clip.x = (Size.bonusRadius + Math.floor((Math.random() * _local4)));
}
public function getType():int{
return (type);
}
public function cleanup():void{
clip.parent.removeChild(clip);
}
public function isHit(_arg1:int, _arg2:int, _arg3:int, _arg4:int):Boolean{
var _local5:int;
_local5 = (Size.heroRadius + Size.bonusRadius);
return ((((Math.abs(((_arg3 + clip.x) - _arg1)) <= _local5)) && ((Math.abs(((_arg4 + clip.y) - _arg2)) <= _local5))));
}
}
}//package
Section 26
//BonusClip (BonusClip)
package {
import flash.display.*;
public dynamic class BonusClip extends MovieClip {
public function BonusClip(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 27
//BonusSound (BonusSound)
package {
import flash.media.*;
public dynamic class BonusSound extends Sound {
}
}//package
Section 28
//BronzeMedal (BronzeMedal)
package {
import flash.display.*;
public dynamic class BronzeMedal extends MovieClip {
}
}//package
Section 29
//BumpSound (BumpSound)
package {
import flash.media.*;
public dynamic class BumpSound extends Sound {
}
}//package
Section 30
//CloseShave (CloseShave)
package {
import flash.display.*;
public dynamic class CloseShave extends MovieClip {
}
}//package
Section 31
//DeathSound (DeathSound)
package {
import flash.media.*;
public dynamic class DeathSound extends Sound {
}
}//package
Section 32
//Difficulty (Difficulty)
package {
class Difficulty {
public static var multiplier = new Array(1, 2, 4, 8);
public static var strings = new Array("Easy", "Medium", "Hard", "Insane");
public static var count = 4;
public static function finalScore(_arg1:int, _arg2:int){
return ((Math.floor((_arg1 / 100)) * multiplier[_arg2]));
}
}
}//package
Section 33
//DIterator (DIterator)
package {
public class DIterator {
protected var current:DNode;
public function DIterator():void{
this.current = null;
}
public function setNode(_arg1:DNode):void{
this.current = _arg1;
}
public function increment():void{
if (this.current != null){
this.current = this.current.next;
};
}
public function isValid():Boolean{
return (!((this.current == null)));
}
public function get(){
if (this.current == null){
return (null);
};
return (this.current.data);
}
public function getNode():DNode{
return (this.current);
}
public function decrement():void{
if (this.current != null){
this.current = this.current.prev;
};
}
public function copyFrom(_arg1:DIterator):void{
this.current = _arg1.current;
}
}
}//package
Section 34
//DList (DList)
package {
public class DList {
protected var tail:DNode;
protected var head:DNode;
protected var currentSize:int;
public function DList():void{
this.head = null;
this.tail = null;
currentSize = 0;
}
public function insert(_arg1:DIterator, _arg2):DIterator{
var _local3:DIterator;
var _local4:DNode;
_local3 = new DIterator();
if (!_arg1.isValid()){
this.push_back(_arg2);
_local3.setNode(this.tail);
} else {
if (_arg1.getNode() == this.head){
this.push_front(_arg2);
_local3.setNode(this.head);
} else {
_local4 = new DNode();
_local4.data = _arg2;
_local4.prev = _arg1.getNode().prev;
_local4.next = _arg1.getNode();
_arg1.getNode().prev.next = _local4;
_arg1.getNode().prev = _local4;
_local3.setNode(_local4);
};
};
currentSize++;
return (_local3);
}
public function size():int{
return (currentSize);
}
public function isEmpty():Boolean{
return ((this.head == null));
}
public function remove(_arg1):void{
var _local2:*;
_local2 = find(_arg1);
if (_local2.isValid()){
erase(_local2);
};
}
public function erase(_arg1:DIterator):DIterator{
var _local2:DIterator;
_local2 = new DIterator();
if (_arg1.isValid()){
if (_arg1.getNode() == this.head){
this.pop_front();
_local2.setNode(this.head);
} else {
if (_arg1.getNode() == this.tail){
this.pop_back();
_local2.setNode(this.tail);
} else {
_arg1.getNode().prev.next = _arg1.getNode().next;
_arg1.getNode().next.prev = _arg1.getNode().prev;
_local2.setNode(_arg1.getNode().next);
};
};
currentSize--;
};
return (_local2);
}
public function front(){
if (this.head != null){
return (this.head.data);
};
return (null);
}
public function push_front(_arg1):void{
var _local2:DNode;
_local2 = new DNode();
_local2.data = _arg1;
if (this.head == null){
this.head = _local2;
this.tail = _local2;
} else {
this.head.prev = _local2;
_local2.next = this.head;
this.head = _local2;
};
currentSize++;
}
public function push_back(_arg1):void{
var _local2:DNode;
_local2 = new DNode();
_local2.data = _arg1;
if (this.tail == null){
this.head = _local2;
this.tail = _local2;
} else {
this.tail.next = _local2;
_local2.prev = this.tail;
this.tail = _local2;
};
currentSize++;
}
public function back(){
if (this.tail != null){
return (this.tail.data);
};
return (null);
}
public function backIterator():DIterator{
var _local1:DIterator;
_local1 = new DIterator();
_local1.setNode(this.tail);
return (_local1);
}
public function frontIterator():DIterator{
var _local1:DIterator;
_local1 = new DIterator();
_local1.setNode(this.head);
return (_local1);
}
public function find(_arg1):DIterator{
var _local2:*;
_local2 = frontIterator();
while (_local2.isValid()) {
if (_local2.get() == _arg1){
break;
};
_local2.increment();
};
return (_local2);
}
public function pop_front():void{
if (((!((this.head == null))) && (!((this.tail == null))))){
if (this.head == this.tail){
this.head = null;
this.tail = null;
} else {
this.head.next.prev = null;
this.head = this.head.next;
};
currentSize--;
};
}
public function pop_back():void{
if (((!((this.head == null))) && (!((this.tail == null))))){
if (this.head == this.tail){
this.head = null;
this.tail = null;
} else {
this.tail.prev.next = null;
this.tail = this.tail.prev;
};
currentSize--;
};
}
}
}//package
Section 35
//DNode (DNode)
package {
public class DNode {
public var prev:DNode;
public var next:DNode;
public var data;
public function DNode():void{
this.next = null;
this.prev = null;
this.data = null;
}
}
}//package
Section 36
//ForegroundClip (ForegroundClip)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class ForegroundClip extends MovieClip {
public var mute:MovieClip;
public var score:TextField;
public function ForegroundClip(){
addFrameScript(0, frame1);
}
public function updateScore(_arg1:Event):void{
if (Main.game != null){
score.text = Speed.scoreToTime(Main.game.getScore());
};
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, updateScore, false, 0, true);
}
}
}//package
Section 37
//FpsCounter (FpsCounter)
package {
import flash.display.*;
import flash.text.*;
public class FpsCounter {
protected var timeCount:int;
protected var lastTime:int;
protected var counter:TextField;
public function FpsCounter(_arg1:DisplayObjectContainer):void{
}
public function cleanup():void{
}
public function enterFrame():void{
}
}
}//package
Section 38
//Game (Game)
package {
import flash.events.*;
import flash.utils.*;
public class Game {
var lastTime:int;
var jumps:JumpDisplay;
var score:int;
var frameNumber:int;
var pressRight:Boolean;
var pit:Pit;
var platformNumber:int;
var firstFrame:Boolean;
var paused:Boolean;
var shouldCheckMiser:Boolean;
var background:BackgroundDisplay;
var difficulty:int;
var speedCounter:int;
public var awards:AwardDisplay;
var foreground:ForegroundClip;
var speed:int;
var fpsCounter:FpsCounter;
var platforms:DList;
var elapsedTime:int;
var pressLeft:Boolean;
var threshold:int;
var hero:Hero;
public function Game(_arg1:int):void{
Main.stage.addEventListener(Event.ENTER_FRAME, enterFrame);
difficulty = _arg1;
jumps = new JumpDisplay(Main.gameBase);
awards = new AwardDisplay(Main.gameBase);
pit = new Pit();
hero = new Hero();
platforms = new DList();
background = null;
foreground = new ForegroundClip();
Main.gameBase.addChild(foreground);
fpsCounter = new FpsCounter(Main.gameBase);
firstFrame = true;
paused = false;
pressLeft = false;
pressRight = false;
frameNumber = 0;
platformNumber = 0;
threshold = Speed.threshold[difficulty];
speed = Speed.start[difficulty];
speedCounter = 0;
score = 0;
shouldCheckMiser = true;
lastTime = 0;
elapsedTime = 0;
}
public function updateMute(_arg1:Boolean):void{
if (_arg1){
foreground.mute.gotoAndStop(1);
} else {
foreground.mute.gotoAndStop(2);
};
}
public function togglePaused():void{
if (!hero.isDying()){
paused = !(paused);
if (paused){
Main.menu.gotoPause(getScore());
} else {
Main.menu.gotoPlay();
};
};
}
public function cleanup():void{
var _local1:DIterator;
fpsCounter.cleanup();
foreground.parent.removeChild(foreground);
foreground = null;
if (background != null){
background.cleanup();
};
background = null;
_local1 = platforms.frontIterator();
while (_local1.isValid()) {
_local1.get().cleanup();
_local1.increment();
};
platforms = null;
pit.cleanup();
pit = null;
hero.cleanup();
hero = null;
awards.cleanup();
awards = null;
jumps.cleanup();
jumps = null;
Main.stage.removeEventListener(Event.ENTER_FRAME, enterFrame);
}
public function getDifficulty():int{
return (difficulty);
}
function commit():void{
var _local1:DIterator;
_local1 = platforms.frontIterator();
while (_local1.isValid()) {
_local1.get().commit();
_local1.increment();
};
hero.commit();
}
function checkForAwards():void{
var _local1:int;
_local1 = Award.NO_AWARD;
_local1 = Main.award.checkDifficulty(getScore(), difficulty);
if (_local1 != Award.NO_AWARD){
awards.add(_local1);
};
if (shouldCheckMiser){
_local1 = Main.award.checkMiser(getScore(), difficulty);
if (_local1 != Award.NO_AWARD){
awards.add(_local1);
shouldCheckMiser = false;
};
};
}
function step(_arg1:int):void{
frameNumber = (frameNumber + _arg1);
if (frameNumber >= Speed.pitDelay[difficulty]){
platformNumber++;
frameNumber = (frameNumber - Speed.pitDelay[difficulty]);
speed = (speed + Speed.deltaBase);
if (speed < threshold){
speed = (speed + Speed.deltaBelow);
};
if ((((threshold < Speed.maxThreshold)) && (((platformNumber % Speed.waitThreshold) == 0)))){
threshold = (threshold + Speed.deltaThreshold);
};
pit.step(background.getBottom(), platforms);
checkForAwards();
};
if (background != null){
background.step(_arg1);
};
if (_arg1 > 0){
stepPhysics(_arg1);
};
}
public function changeRight(_arg1:Boolean):void{
pressRight = _arg1;
}
public function changeLeft(_arg1:Boolean):void{
pressLeft = _arg1;
}
function stepPhysics(_arg1:int):void{
var _local2:int;
var _local3:DIterator;
var _local4:Boolean;
_local2 = 0;
while (_local2 < _arg1) {
if (((pressLeft) && (!(pressRight)))){
hero.left();
};
if (((pressRight) && (!(pressLeft)))){
hero.right();
};
hero.gravity(platforms);
_local3 = platforms.frontIterator();
while (_local3.isValid()) {
_local4 = _local3.get().elevate(hero);
if (_local4){
_local3.get().cleanup();
_local3 = platforms.erase(_local3);
} else {
checkBonus(_local3.get());
};
_local3.increment();
};
hero.rotate();
_local2++;
};
commit();
}
public function getScore():int{
return (Math.floor((score / Speed.scoreDivisor)));
}
public function setBackgroundDisplay(_arg1:BackgroundDisplay):void{
background = _arg1;
}
public function enterFrame(_arg1:Event):void{
var _local2:*;
var _local3:*;
var _local4:int;
if (background != null){
if (firstFrame){
lastTime = getTimer();
pit.firstStep(background.getBottom(), platforms);
firstFrame = false;
};
fpsCounter.enterFrame();
if (!paused){
_local2 = getTimer();
_local3 = (_local2 - lastTime);
lastTime = _local2;
speedCounter = (speedCounter + (speed * _local3));
_local4 = Math.ceil((speedCounter / Speed.decrement));
speedCounter = (speedCounter - (_local4 * Speed.decrement));
step(_local4);
if (!hero.isDying()){
score = (score + _local3);
};
} else {
lastTime = getTimer();
};
};
}
public function beginJump():void{
if (((!(hero.isDying())) && ((jumps.count() > 0)))){
hero.jump();
jumps.remove();
shouldCheckMiser = false;
};
}
function checkBonus(_arg1:Platform):void{
var _local2:*;
_local2 = _arg1.touchBonus(hero.getX(), hero.getY());
if (_local2 == Bonus.SNAIL){
speed = (speed - (Speed.snail * Speed.deltaBelow));
} else {
if (_local2 == Bonus.WINGS){
jumps.add();
};
};
}
public function pauseOnDeath():void{
paused = true;
}
}
}//package
Section 39
//GoldMedal (GoldMedal)
package {
import flash.display.*;
public dynamic class GoldMedal extends MovieClip {
}
}//package
Section 40
//GuardianAngel (GuardianAngel)
package {
import flash.display.*;
public dynamic class GuardianAngel extends MovieClip {
}
}//package
Section 41
//Hero (Hero)
package {
import flash.display.*;
import flash.media.*;
public class Hero {
var posX:int;
var posY:int;
var clip:MovieClip;
var angularVelocity:int;
var isJumping:Boolean;
var dying:Boolean;
var onPlatform:Boolean;
var velocityY:int;
var rotation:int;
static var jumpTransform:SoundTransform = new SoundTransform(Volume.jump);
static var bumpTransform:SoundTransform = new SoundTransform(Volume.bump);
static var jumpSound:Sound = new JumpSound();
static var bumpSound:Sound = new BumpSound();
static var pokeDistance:int = (Size.spikeY + Size.heroRadius);
public function Hero():void{
clip = new HeroClip();
Main.gameBase.addChild(clip);
clip.cacheAsBitmap = true;
clip.visible = true;
clip.gotoAndStop(1);
dying = false;
isJumping = false;
onPlatform = false;
posX = (Size.screenX / 2);
posY = (Size.spikeY + Size.heroRadius);
rotation = 0;
angularVelocity = 0;
velocityY = 0;
commit();
}
public function getX():int{
return (posX);
}
public function getY():int{
return (posY);
}
function findPlatform(_arg1:DList, _arg2:int):Platform{
var _local3:Platform;
var _local4:DIterator;
_local3 = null;
_local4 = _arg1.frontIterator();
while (_local4.isValid()) {
if (_local4.get().hitHero(posX, posY, _arg2)){
_local3 = _local4.get();
break;
};
_local4.increment();
};
return (_local3);
}
public function gravity(_arg1:DList):void{
var _local2:*;
var _local3:int;
var _local4:Platform;
var _local5:*;
var _local6:*;
if (!dying){
_local2 = Speed.fall;
if (isJumping){
_local2 = Speed.float;
};
velocityY = (velocityY + Speed.gravity);
if (velocityY > _local2){
velocityY = _local2;
};
_local3 = velocityY;
_local4 = findPlatform(_arg1, _local3);
if (_local4 == null){
if (((!(isJumping)) && (onPlatform))){
_local5 = Main.award.checkShave((posY - pokeDistance), Main.game.getDifficulty());
if (_local5 != Award.NO_AWARD){
Main.game.awards.add(_local5);
};
};
posY = (posY + _local3);
onPlatform = false;
} else {
touchPlatform(_local4.getY());
if (((!(onPlatform)) && (!(isTouchingSpikes())))){
Main.play(bumpSound, bumpTransform);
_local6 = Main.award.checkAngel(((Size.screenY - pokeDistance) - posY), Main.game.getDifficulty());
if (_local6 != Award.NO_AWARD){
Main.game.awards.add(_local6);
};
};
onPlatform = true;
isJumping = false;
};
if (isTouchingSpikes()){
dying = true;
clip.gotoAndStop(2);
};
};
}
public function touchPlatform(_arg1:int):void{
if (!dying){
posY = ((_arg1 - Size.heroRadius) - 1);
};
}
public function left():void{
if (!dying){
posX = (posX - Speed.movement);
if (posX <= 0){
posX = 0;
};
if (onPlatform){
angularVelocity = -(Speed.rotation);
};
};
}
public function rotate():void{
if (!dying){
rotation = (rotation + angularVelocity);
if (onPlatform){
angularVelocity = 0;
};
};
}
public function right():void{
if (!dying){
posX = (posX + Speed.movement);
if (posX >= Size.screenX){
posX = Size.screenX;
};
if (onPlatform){
angularVelocity = Speed.rotation;
};
};
}
function isTouchingSpikes():Boolean{
return ((((posY <= pokeDistance)) || ((posY >= (Size.screenY - pokeDistance)))));
}
public function isDying():Boolean{
return (dying);
}
public function cleanup():void{
clip.parent.removeChild(clip);
clip = null;
}
public function jump():void{
isJumping = true;
velocityY = Speed.jump;
Main.play(jumpSound, jumpTransform);
}
public function commit():void{
clip.x = posX;
clip.y = posY;
clip.rotation = rotation;
}
}
}//package
Section 42
//HeroClip (HeroClip)
package {
import flash.display.*;
public dynamic class HeroClip extends MovieClip {
public var hero:MovieClip;
public function HeroClip(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
hero.gotoAndStop(1);
}
function frame2(){
hero.gotoAndPlay(1);
}
}
}//package
Section 43
//JumpDisplay (JumpDisplay)
package {
import flash.display.*;
public class JumpDisplay {
var base:Sprite;
var clips:DList;
static var rows:int = 10;
static var startCount:int = 3;
public function JumpDisplay(_arg1:DisplayObjectContainer):void{
var _local2:int;
super();
base = new Sprite();
_arg1.addChild(base);
clips = new DList();
_local2 = 0;
while (_local2 < startCount) {
add();
_local2++;
};
}
public function add():void{
var _local1:MovieClip;
var _local2:int;
var _local3:int;
_local1 = new BonusClip();
base.addChild(_local1);
_local1.gotoAndStop(4);
_local2 = ((Size.jumpIcon + 2) * Math.floor((clips.size() / rows)));
_local3 = ((Size.jumpIcon + 2) * (clips.size() % rows));
_local1.x = ((Size.screenX - Size.jumpIcon) - _local2);
_local1.y = ((Size.screenY - (Size.jumpIcon * 2)) - _local3);
clips.push_back(_local1);
}
public function cleanup():void{
var _local1:*;
_local1 = clips.frontIterator();
while (_local1.isValid()) {
_local1.get().parent.removeChild(_local1.get());
_local1.increment();
};
clips = null;
base.parent.removeChild(base);
base = null;
}
public function count():int{
return (clips.size());
}
public function remove():void{
if (!clips.isEmpty()){
clips.back().parent.removeChild(clips.back());
clips.pop_back();
};
}
}
}//package
Section 44
//JumpMiser (JumpMiser)
package {
import flash.display.*;
public dynamic class JumpMiser extends MovieClip {
}
}//package
Section 45
//JumpSound (JumpSound)
package {
import flash.media.*;
public dynamic class JumpSound extends Sound {
}
}//package
Section 46
//Main (Main)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.ui.*;
public class Main extends MovieClip {
public static var game:Game;
public static var scoreBoardIds = new Array("22cb34467d9a856d", "34f693ef6e5fc538", "bedee7e43bfec339", "8b36caab74b7c399");
static var bestScore:Array;
static var mute:Boolean;
public static var award:Award;
public static var menu:Menu;
public static var scoreBoardClip:MovieClip;
public static var music:Music;
public static var root:MovieClip;
static var pressedJump:Boolean;
public static var background:MovieClip;
public static var gameBase:Sprite;
public static var stage:Stage;
public function Main():void{
Main.root = this;
pressedJump = false;
bestScore = new Array(0, 0, 0, 0);
mute = false;
}
public function keyUp(_arg1:KeyboardEvent):void{
var _local2:*;
_local2 = String.fromCharCode(_arg1.charCode);
if (((!(menu.isLose())) && (!((game == null))))){
if ((((((_local2 == "a")) || ((_local2 == "A")))) || ((_arg1.keyCode == Keyboard.LEFT)))){
game.changeLeft(false);
} else {
if ((((((_local2 == "d")) || ((_local2 == "D")))) || ((_arg1.keyCode == Keyboard.RIGHT)))){
game.changeRight(false);
} else {
if ((((_local2 == "w")) || ((_arg1.keyCode == Keyboard.UP)))){
pressedJump = false;
} else {
if ((((_local2 == " ")) || ((_arg1.keyCode == Keyboard.ESCAPE)))){
game.togglePaused();
} else {
if ((((_local2 == "m")) || ((_local2 == "M")))){
toggleMute();
if (game != null){
game.updateMute(mute);
};
};
};
};
};
};
} else {
if (((((menu.isLose()) && (!(menu.isSubmitting())))) && ((((_local2 == " ")) || ((_arg1.keyCode == Keyboard.ESCAPE)))))){
loseReplay();
};
};
}
public function keyDown(_arg1:KeyboardEvent):void{
var _local2:*;
_local2 = String.fromCharCode(_arg1.charCode);
if (((!(menu.isLose())) && (!((game == null))))){
if ((((((_local2 == "a")) || ((_local2 == "A")))) || ((_arg1.keyCode == Keyboard.LEFT)))){
game.changeLeft(true);
} else {
if ((((((_local2 == "d")) || ((_local2 == "D")))) || ((_arg1.keyCode == Keyboard.RIGHT)))){
game.changeRight(true);
} else {
if (((!(pressedJump)) && ((((_local2 == "w")) || ((_arg1.keyCode == Keyboard.UP)))))){
game.beginJump();
pressedJump = true;
};
};
};
};
}
public function main():void{
this.visible = true;
Main.stage = root.stage;
Main.background = new BackgroundClip();
Main.root.addChild(background);
Main.gameBase = new Sprite();
Main.root.addChild(gameBase);
Main.menu = new Menu();
Main.menu.gotoMain();
Main.award = new Award();
Main.game = null;
Main.music = new Music(gameBase);
scoreBoardClip = new MovieClip();
Main.root.addChild(Main.scoreBoardClip);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUp);
gotoMain();
}
public static function clickEndGame():void{
gotoMain();
cleanupGame();
}
public static function clickHighScores():void{
Main.menu.gotoDifficulty(Menu.HIGH_SCORES);
}
public static function clickInstructions():void{
Main.menu.gotoInstructions();
}
public static function clickBack():void{
gotoMain();
}
public static function toggleMute():void{
mute = !(mute);
if (mute){
SoundMixer.soundTransform = new SoundTransform(0);
} else {
SoundMixer.soundTransform = new SoundTransform(1);
};
}
public static function clickResume():void{
Main.game.togglePaused();
}
public static function clickAwards(_arg1:int):void{
Main.menu.gotoAwards(_arg1);
}
public static function clickDifficulty():void{
Main.menu.gotoDifficulty(Menu.PLAY);
}
public static function clickShowScores(_arg1:int):void{
var _local2:String;
menu.gotoLoadingScores();
_local2 = scoreBoardIds[_arg1];
}
public static function loseGame():void{
var _local1:int;
var _local2:int;
_local1 = Main.game.getScore();
_local2 = Main.game.getDifficulty();
if (_local1 > bestScore[_local2]){
bestScore[_local2] = _local1;
};
Main.menu.gotoLose(_local1, bestScore[_local2], _local2);
music.stop();
game.pauseOnDeath();
}
public static function isMute():Boolean{
return (mute);
}
public static function loseReplay():void{
var _local1:*;
_local1 = game.getDifficulty();
cleanupGame();
clickStart(_local1);
}
public static function loseMain():void{
cleanupGame();
gotoMain();
}
public static function clickSubmitScore(_arg1:int, _arg2:int):void{
menu.gotoLoadingScores();
ScoreSubmit.submit(_arg2, scoreBoardClip);
}
public static function clickSoundCredits():void{
Main.menu.gotoSoundCredits();
}
public static function play(_arg1:Sound, _arg2:SoundTransform):SoundChannel{
return (_arg1.play(0, 0, _arg2));
}
static function cleanupGame():void{
if (Main.game != null){
Main.game.cleanup();
Main.game = null;
Main.music.stop();
};
}
public static function clickAwardsDifficulty():void{
Main.menu.gotoDifficulty(Menu.AWARDS);
}
public static function clickStart(_arg1:int):void{
var _local2:*;
_local2 = Main.root.root.loaderInfo.url;
Main.background.gotoAndStop(1);
Main.background.gotoAndStop(3);
Main.menu.gotoPlay();
Main.game = new Game(_arg1);
Main.music.start();
}
static function gotoMain():void{
Main.background.gotoAndStop(1);
Main.background.gotoAndStop(2);
Main.menu.gotoMain();
}
}
}//package
Section 47
//Menu (Menu)
package {
import flash.events.*;
import flash.text.*;
public class Menu {
var difficultyButtons:Array;
var difficultyType:int;
var clip:MenuClip;
static var difficultyTask:Array = new Array(Main.clickStart, Main.clickAwards, Main.clickShowScores);
static var PLAY = 0;
static var AWARDS = 1;
static var difficultyTitle:Array = new Array("Play", "Awards", "High Scores");
static var HIGH_SCORES = 2;
public function Menu():void{
clip = new MenuClip();
Main.root.addChild(clip);
clip.cacheAsBitmap = true;
clip.gotoAndStop(1);
}
public function returnToLose():void{
clip.gotoAndStop(6);
}
public function gotoSoundCredits():void{
clip.gotoAndStop(11);
}
public function isSubmitting():Boolean{
return ((clip.currentFrame == 8));
}
public function gotoPause(_arg1:int):void{
clip.gotoAndStop(5);
clip.scoreNum = _arg1;
}
public function gotoLose(_arg1:int, _arg2:int, _arg3:int):void{
clip.gotoAndStop(6);
clip.scoreNum = _arg1;
clip.bestScoreNum = _arg2;
clip.difficultyNum = _arg3;
}
public function gotoLoadingScores():void{
clip.gotoAndStop(8);
}
public function isLose():Boolean{
return ((((clip.currentFrame == 6)) || ((clip.currentFrame == 8))));
}
function clickDifficulty(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
_local2 = 0;
while (_local2 < difficultyButtons.length) {
difficultyButtons[_local2].removeEventListener(MouseEvent.CLICK, clickDifficulty);
_local2++;
};
_local3 = difficultyButtons.indexOf(_arg1.target);
if (_local3 < 4){
var _local4 = difficultyTask;
_local4[difficultyType](_local3);
} else {
Main.clickBack();
};
difficultyButtons = null;
}
public function cleanup():void{
clip.parent.removeChild(clip);
clip = null;
}
public function gotoInstructions():void{
clip.gotoAndStop(4);
}
public function loseDifficulty():int{
return (clip.difficultyNum);
}
public function gotoPlay():void{
clip.gotoAndStop(1);
}
public function gotoAwards(_arg1:int):void{
clip.difficultyNum = _arg1;
clip.gotoAndStop(9);
}
public function gotoMain():void{
clip.gotoAndStop(2);
}
public function setDifficulty(_arg1:TextField, _arg2:Array):void{
var _local3:*;
_arg1.text = difficultyTitle[difficultyType];
difficultyButtons = _arg2;
_local3 = 0;
while (_local3 < difficultyButtons.length) {
difficultyButtons[_local3].addEventListener(MouseEvent.CLICK, clickDifficulty);
_local3++;
};
}
public function gotoDifficulty(_arg1:int):void{
difficultyType = _arg1;
clip.gotoAndStop(3);
}
}
}//package
Section 48
//MenuClip (MenuClip)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class MenuClip extends MovieClip {
public var easy:SimpleButton;
public var hard:SimpleButton;
public var lose:MovieClip;
public var paused:MovieClip;
public var insane:SimpleButton;
public var title:TextField;
public var highScores:SimpleButton;
public var start:SimpleButton;
public var medium:SimpleButton;
public var soundBackButton:SimpleButton;
public var moreGames:SimpleButton;
public var awardsButton:SimpleButton;
public var bestScoreNum:int;// = 0
public var soundCredits:SimpleButton;
public var instructions:MovieClip;
public var awards:MovieClip;
public var scoreNum:int;// = 0
public var difficultyNum:int;// = 0
public var sponsorLogo:SimpleButton;
public var back:SimpleButton;
public function MenuClip(){
scoreNum = 0;
bestScoreNum = 0;
difficultyNum = 0;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 8, frame9, 9, frame10, 10, frame11);
}
public function clickHighScores(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.gamezhero.com/topscore/ontheway/?utm_campaign=ontheway&utm_source=ontheway&utm_medium=top_score");
navigateToURL(_local2, "_blank");
}
public function clickBackAward(_arg1:MouseEvent):void{
Main.award.cleanupAwards();
Main.clickBack();
}
public function clickSoundCredits(_arg1:MouseEvent):void{
Main.clickSoundCredits();
}
public function clickLoseBack(_arg1:MouseEvent):void{
Main.loseMain();
}
function frame3(){
Main.menu.setDifficulty(title, new Array(easy, medium, hard, insane, back));
}
function frame7(){
}
public function clickAwards(_arg1:MouseEvent):void{
Main.clickAwardsDifficulty();
}
function frame6(){
stop();
lose.time.text = Speed.scoreToTime(scoreNum);
lose.multiplier.text = Difficulty.multiplier[difficultyNum];
lose.score.text = Difficulty.finalScore(scoreNum, difficultyNum);
lose.replay.addEventListener(MouseEvent.CLICK, clickReplay, false, 0, true);
lose.submitScore.addEventListener(MouseEvent.CLICK, clickSubmitScore, false, 0, true);
lose.loseBack.addEventListener(MouseEvent.CLICK, clickLoseBack, false, 0, true);
}
function frame4(){
instructions.nextButton.addEventListener(MouseEvent.CLICK, clickNext, false, 0, true);
}
function frame2(){
stop();
start.addEventListener(MouseEvent.CLICK, clickStart, false, 0, true);
awardsButton.addEventListener(MouseEvent.CLICK, clickAwards, false, 0, true);
highScores.addEventListener(MouseEvent.CLICK, clickHighScores, false, 0, true);
moreGames.addEventListener(MouseEvent.CLICK, clickSponsor, false, 0, true);
sponsorLogo.addEventListener(MouseEvent.CLICK, clickSponsor, false, 0, true);
soundCredits.addEventListener(MouseEvent.CLICK, clickSoundCredits, false, 0, true);
}
public function clickSponsor(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.gamezhero.com/?utm_campaign=ontheway&utm_source=ontheway&utm_medium=more_free_games");
navigateToURL(_local2, "_blank");
}
function frame1(){
stop();
}
function frame5(){
stop();
paused.difficulty.text = Difficulty.strings[Main.game.getDifficulty()];
paused.scorePause.text = Speed.scoreToTime(scoreNum);
paused.resume.addEventListener(MouseEvent.CLICK, clickResume, false, 0, true);
paused.endGame.addEventListener(MouseEvent.CLICK, clickEndGame, false, 0, true);
}
function frame9(){
Main.award.displayAwards(awards, difficultyNum);
awards.difficulty.text = Difficulty.strings[difficultyNum];
awards.back.addEventListener(MouseEvent.CLICK, clickBackAward, false, 0, true);
}
function frame11(){
soundBackButton.addEventListener(MouseEvent.CLICK, clickSoundBackButton, false, 0, true);
}
public function clickReplay(_arg1:MouseEvent):void{
Main.loseReplay();
}
function frame10(){
}
public function clickNext(_arg1:MouseEvent):void{
Main.clickDifficulty();
}
public function clickSubmitScore(_arg1:MouseEvent):void{
Main.clickSubmitScore(difficultyNum, Difficulty.finalScore(scoreNum, difficultyNum));
}
public function clickStart(_arg1:MouseEvent):void{
Main.clickInstructions();
}
public function clickEndGame(_arg1:MouseEvent):void{
Main.clickEndGame();
}
public function clickSoundBackButton(_arg1:MouseEvent):void{
Main.clickBack();
}
public function clickResume(_arg1:MouseEvent):void{
Main.clickResume();
}
}
}//package
Section 49
//Music (Music)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
class Music {
var channel:SoundChannel;
var silenceLeft:int;
var phase:int;
var sound:Sound;
static var silenceStart:int = 30;
static var SILENCE = 1;
static var fadeTime:Number = 10000;
static var FADE = 2;
static var order:Array = new Array(SILENCE, FADE);
static var maxVolume:Number = Volume.music;
function Music(_arg1:Sprite):void{
sound = new MusicSound();
channel = null;
phase = 0;
silenceLeft = 0;
}
function endPhase():void{
var _local1:int;
_local1 = order[phase];
if (_local1 == SILENCE){
Main.root.removeEventListener(Event.ENTER_FRAME, stepSilence);
} else {
Main.root.removeEventListener(Event.ENTER_FRAME, stepPlay);
channel.removeEventListener(Event.SOUND_COMPLETE, completePlay);
};
phase = ((phase + 1) % order.length);
}
public function start():void{
phase = 0;
silenceLeft = 0;
beginPhase();
}
public function cleanup():void{
}
public function stop():void{
if (order[phase] != SILENCE){
channel.stop();
};
endPhase();
phase = 0;
}
function completePlay(_arg1:Event):void{
endPhase();
beginPhase();
}
function stepPlay(_arg1:Event):void{
var _local2:*;
var _local3:Number;
var _local4:Number;
_local2 = order[phase];
_local3 = 0;
if (_local2 == FADE){
_local3 = channel.position;
if ((sound.length - channel.position) < fadeTime){
_local3 = (sound.length - channel.position);
};
};
_local4 = maxVolume;
if ((((_local2 == FADE)) && ((_local3 <= fadeTime)))){
_local4 = (maxVolume * (_local3 / fadeTime));
};
channel.soundTransform = new SoundTransform(_local4);
}
function beginPhase():void{
var _local1:int;
_local1 = order[phase];
if (_local1 == SILENCE){
silenceLeft = Math.floor(((silenceStart * Speed.fps) * Math.random()));
Main.root.addEventListener(Event.ENTER_FRAME, stepSilence);
} else {
Main.root.addEventListener(Event.ENTER_FRAME, stepPlay);
channel = Main.play(sound, new SoundTransform(0));
channel.addEventListener(Event.SOUND_COMPLETE, completePlay);
};
}
function stepSilence(_arg1:Event):void{
if (silenceLeft > 0){
silenceLeft--;
} else {
endPhase();
beginPhase();
};
}
}
}//package
Section 50
//MusicSound (MusicSound)
package {
import flash.media.*;
public dynamic class MusicSound extends Sound {
}
}//package
Section 51
//Pit (Pit)
package {
import flash.display.*;
public class Pit {
protected var platformCount:int;
public function Pit():void{
platformCount = 0;
}
public function cleanup():void{
}
function addPlatform(_arg1:DisplayObjectContainer, _arg2:DList, _arg3:int, _arg4:int):void{
var _local5:*;
var _local6:*;
platformCount++;
_local5 = Bonus.NONE;
if ((platformCount % Speed.snail) == 0){
_local5 = Bonus.SNAIL;
} else {
if ((platformCount % Speed.snail) == Speed.jumpOffset){
_local5 = Bonus.WINGS;
};
};
_local6 = new Platform(_arg1, _local5, _arg3, _arg4);
_arg2.push_back(_local6);
}
public function step(_arg1:DisplayObjectContainer, _arg2:DList):void{
var _local3:int;
var _local4:*;
var _local5:*;
_local3 = Size.platformRange;
_local4 = (Size.platformMin + Math.floor((Math.random() * _local3)));
_local3 = ((Size.screenX - _local4) - (Size.platformBuffer * 2));
_local5 = (Size.platformBuffer + Math.floor((Math.random() * _local3)));
addPlatform(_arg1, _arg2, _local5, _local4);
}
public function firstStep(_arg1:DisplayObjectContainer, _arg2:DList):void{
var _local3:*;
var _local4:*;
_local3 = (Size.platformMin + Math.floor((Size.platformRange / 2)));
_local4 = Math.floor(((Size.screenX - _local3) / 2));
addPlatform(_arg1, _arg2, _local4, _local3);
}
public function getPlatformCount():int{
return (platformCount);
}
}
}//package
Section 52
//Platform (Platform)
package {
import flash.display.*;
import flash.media.*;
public class Platform {
var posY:int;
var platform:MovieClip;
var base:Sprite;
var width:int;
var posX:int;
var bonus:Bonus;
static var bonusSound = new BonusSound();
static var colorCount = 5;
static var bonusTransform = new SoundTransform(Volume.bonus);
public function Platform(_arg1:DisplayObjectContainer, _arg2:int, _arg3:int, _arg4:int):void{
var _local5:int;
super();
base = new Sprite();
_arg1.addChild(base);
posY = Size.screenY;
platform = new PlatformClip();
base.addChild(platform);
_local5 = (Math.floor((Math.random() * colorCount)) + 2);
platform.gotoAndStop(_local5);
base.cacheAsBitmap = true;
width = _arg4;
posX = _arg3;
platform.width = width;
platform.cacheAsBitmap = true;
bonus = null;
if (_arg2 != Bonus.NONE){
bonus = new Bonus(base, _arg2, width);
};
base.x = posX;
base.y = (Size.screenY - base.parent.y);
}
public function touchBonus(_arg1:int, _arg2:int):int{
var _local3:int;
_local3 = Bonus.NONE;
if (((!((bonus == null))) && (bonus.isHit(_arg1, _arg2, posX, posY)))){
Main.play(bonusSound, bonusTransform);
_local3 = bonus.getType();
bonus.cleanup();
bonus = null;
};
return (_local3);
}
public function getY():int{
return (posY);
}
public function cleanup():void{
if (bonus != null){
bonus.cleanup();
bonus = null;
};
platform.parent.removeChild(platform);
platform = null;
base.parent.removeChild(base);
base = null;
}
public function hitHero(_arg1:int, _arg2:int, _arg3:int):Boolean{
var _local4:Boolean;
var _local5:*;
var _local6:Boolean;
_local4 = ((inRange((_arg1 - Size.heroTip), posX, (posX + width))) || (inRange((_arg1 + Size.heroTip), posX, (posX + width))));
_local5 = (_arg2 + Size.heroRadius);
_local6 = inRange(_local5, (posY - _arg3), posY);
return (((_local4) && (_local6)));
}
public function commit():void{
}
function inRange(_arg1:int, _arg2:int, _arg3:int):Boolean{
return ((((((_arg1 >= _arg2)) && ((_arg1 < _arg3)))) || ((((_arg1 >= _arg3)) && ((_arg1 < _arg2))))));
}
public function elevate(_arg1:Hero):Boolean{
var _local2:Boolean;
var _local3:int;
var _local4:Boolean;
_local2 = false;
_local3 = Speed.platform;
_local4 = hitHero(_arg1.getX(), _arg1.getY(), _local3);
posY = (posY - _local3);
if (_local4){
_arg1.touchPlatform(posY);
};
if (posY <= 0){
_local2 = true;
};
return (_local2);
}
}
}//package
Section 53
//PlatformClip (PlatformClip)
package {
import flash.display.*;
public dynamic class PlatformClip extends MovieClip {
public function PlatformClip(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 54
//ScoreSubmit (ScoreSubmit)
package {
import flash.display.*;
import flash.events.*;
import com.gamezhero.as3.*;
public class ScoreSubmit {
static var game_code = [104, 116, 116, 112, 58, 47, 47, 102, 105, 108, 101, 115, 46, 103, 97, 109, 101, 122, 104, 101, 114, 111, 46, 99, 111, 109, 47, 111, 110, 108, 105, 110, 101, 47, 111, 110, 116, 104, 101, 119, 97, 121, 47, 115, 99, 111, 114, 101, 47, 115, 99, 111, 114, 101, 46, 115, 119, 102, 63, 118, 50];
static var language:String = "ENG";
public static function submit(_arg1:int, _arg2:MovieClip){
var _local3:int;
var _local4:int;
var _local5:SubmitArea;
_local3 = Math.floor(((Size.screenX - 300) / 2));
_local4 = Math.floor(((Size.screenY - 300) / 2));
_local5 = new SubmitArea(_arg2, _local3, _local4, _arg1, game_code, language);
_local5.addEventListener(SubmitArea.SUBMITED, submitAction);
_local5.addEventListener(SubmitArea.CONTINUE, continueAction);
}
static function continueAction(_arg1:Event):void{
Main.menu.returnToLose();
}
static function submitAction(_arg1:Event):void{
Main.menu.returnToLose();
}
}
}//package
Section 55
//SilverMedal (SilverMedal)
package {
import flash.display.*;
public dynamic class SilverMedal extends MovieClip {
}
}//package
Section 56
//Size (Size)
package {
public class Size {
public static var heroTip = 10;
public static var jumpIcon = 30;
public static var platformRange = 150;
public static var gameAward = 30;
public static var heroRadius = 18;
public static var screenY = 400;
public static var bonusRadius = 16;
public static var spikeY = 24;
public static var platformBuffer = 25;
public static var platformMin = 50;
public static var screenX = 550;
}
}//package
Section 57
//Speed (Speed)
package {
public class Speed {
public static var jumpOffset = 10;
public static var snail = 20;
public static var gravity = 1;
public static var decrement = (fps * 100);
public static var float = 2;
public static var deltaBelow = 3;
public static var maxThreshold = 250;
public static var pitDelay = new Array(20, 25, 30, 35);
public static var fps = 30;
public static var scoreDivisor:int = 1;
public static var jump = -14;
public static var movement = 5;
public static var deltaBase = 1;
public static var start = new Array(75, 105, 135, 165);
public static var threshold = new Array(100, 130, 180, 230);
public static var platform = 3;
public static var deltaThreshold = 1;
public static var fall = 6;
public static var waitThreshold = 3;
public static var rotation = 8;
public static function scoreToTime(_arg1:int):String{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:String;
_local2 = (Math.floor((_arg1 / 100)) % 10);
_local3 = (Math.floor((_arg1 / 1000)) % 60);
_local4 = Math.floor((_arg1 / 60000));
_local5 = ((_local3 + ".") + _local2);
if (_local3 < 10){
_local5 = ("0" + _local5);
};
_local5 = ((_local4 + ":") + _local5);
if (_local4 < 10){
_local5 = ("0" + _local5);
};
return (_local5);
}
}
}//package
Section 58
//Volume (Volume)
package {
public class Volume {
public static var music = 0.5;
public static var jump = 1;
public static var death = 0.5;
public static var bump = 0.5;
public static var award = 1;
public static var bonus = 0.5;
}
}//package