Section 1
//Action_4 (jump_fla.Action_4)
package jump_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Action_4 extends MovieClip {
public function Action_4(){
addFrameScript(0, frame1);
}
public function onComplete(_arg1:Event):void{
MovieClip(parent).gotoAndPlay("loaded");
}
public function progressHandler(_arg1:ProgressEvent):void{
var _local2:int;
_local2 = Math.round(((_arg1.target.bytesLoaded / _arg1.target.bytesTotal) * 100));
MovieClip(parent).gotoAndStop(_local2);
}
function frame1(){
MovieClip(root).stop();
if (root.loaderInfo.bytesLoaded == root.loaderInfo.bytesTotal){
MovieClip(parent).gotoAndPlay("loaded");
};
root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
root.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
}
}
}//package jump_fla
Section 2
//Cannon_Fire_33 (jump_fla.Cannon_Fire_33)
package jump_fla {
import flash.display.*;
public dynamic class Cannon_Fire_33 extends MovieClip {
public function Cannon_Fire_33(){
addFrameScript(3, frame4);
}
function frame4(){
gotoAndPlay(1);
}
}
}//package jump_fla
Section 3
//Dude_29 (jump_fla.Dude_29)
package jump_fla {
import flash.display.*;
public dynamic class Dude_29 extends MovieClip {
public function Dude_29(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package jump_fla
Section 4
//Enemy_MainMenu_26 (jump_fla.Enemy_MainMenu_26)
package jump_fla {
import flash.display.*;
public dynamic class Enemy_MainMenu_26 extends MovieClip {
public var dude:MovieClip;
public var cannon:MovieClip;
}
}//package jump_fla
Section 5
//loadED_5 (jump_fla.loadED_5)
package jump_fla {
import flash.display.*;
public dynamic class loadED_5 extends MovieClip {
public function loadED_5(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package jump_fla
Section 6
//NG_AD_OBJECT_WITH_PRELOADER_1 (jump_fla.NG_AD_OBJECT_WITH_PRELOADER_1)
package jump_fla {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class NG_AD_OBJECT_WITH_PRELOADER_1 extends MovieClip {
public var ng_ad:MovieClip;
public var NG_Button:SimpleButton;
public function NG_AD_OBJECT_WITH_PRELOADER_1(){
addFrameScript(0, frame1);
}
public function loadNGSite(_arg1:Event){
NewgroundsAPI.loadNewgrounds();
}
public function startAd(_arg1){
var _local2:URLLoader;
_local2 = new URLLoader(new URLRequest(_arg1));
_local2.addEventListener(Event.COMPLETE, ad_Loaded);
}
function frame1(){
Security.allowDomain("70.87.128.99");
Security.allowInsecureDomain("70.87.128.99");
Security.allowDomain("ads.shizmoo.com");
Security.allowInsecureDomain("ads.shizmoo.com");
Security.allowDomain("www.cpmstar.com");
Security.allowInsecureDomain("www.cpmstar.com");
Security.allowDomain("server.cpmstar.com");
Security.allowInsecureDomain("server.cpmstar.com");
if (NewgroundsAPI.getAdURL()){
startAd(NewgroundsAPI.getAdURL());
};
NewgroundsAPI.addEventListener(NewgroundsAPI.ADS_APPROVED, startAd);
NG_Button.addEventListener(MouseEvent.CLICK, loadNGSite);
stop();
}
public function ad_Loaded(_arg1:Event){
var _local2:*;
var _local3:Loader;
_local2 = String(_arg1.target.data);
_local3 = new Loader();
_local3.load(new URLRequest(_local2));
ng_ad.addChild(_local3);
}
}
}//package jump_fla
Section 7
//NG_TANK_9 (jump_fla.NG_TANK_9)
package jump_fla {
import flash.display.*;
import flash.events.*;
public dynamic class NG_TANK_9 extends MovieClip {
public var NG_Logo:SimpleButton;
public function NG_TANK_9(){
addFrameScript(0, frame1);
}
public function loadNGSite(_arg1:Event){
NewgroundsAPI.loadNewgrounds();
}
function frame1(){
NG_Logo.addEventListener(MouseEvent.CLICK, loadNGSite);
}
}
}//package jump_fla
Section 8
//TransitionOut_16 (jump_fla.TransitionOut_16)
package jump_fla {
import flash.display.*;
public dynamic class TransitionOut_16 extends MovieClip {
public function TransitionOut_16(){
addFrameScript(0, frame1, 52, frame53);
}
function frame1(){
stop();
}
function frame53(){
stop();
MovieClip(root).play();
}
}
}//package jump_fla
Section 9
//WurmyIntro_11 (jump_fla.WurmyIntro_11)
package jump_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class WurmyIntro_11 extends MovieClip {
public var targetURL:URLRequest;
public var button:SimpleButton;
public var transitionOUT:MovieClip;
public function WurmyIntro_11(){
addFrameScript(0, frame1, 178, frame179);
}
function frame1(){
button.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent):void{
targetURL = new URLRequest("http://www.wurmy.com/");
navigateToURL(targetURL);
});
x = (650 / 2);
y = (450 / 2);
}
function frame179(){
stop();
transitionOUT.gotoAndPlay(2);
}
}
}//package jump_fla
Section 10
//X_LOAD_2 (jump_fla.X_LOAD_2)
package jump_fla {
import flash.display.*;
import flash.events.*;
public dynamic class X_LOAD_2 extends MovieClip {
public var NGButton:SimpleButton;
public function X_LOAD_2(){
addFrameScript(100, frame101, 150, frame151, 164, frame165);
}
function frame151(){
NGButton.addEventListener(MouseEvent.CLICK, PlayMovie);
}
function frame165(){
stop();
}
public function PlayMovie(_arg1:Event){
gotoAndStop("end");
MovieClip(root).play();
}
function frame101(){
play();
}
}
}//package jump_fla
Section 11
//MochiScores (mochi.MochiScores)
package mochi {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var options = _arg1;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (_arg1 != null){
if (_arg1.error != null){
if (_arg1.error == true){
if (onErrorHandler != null){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi
Section 12
//MochiServices (mochi.MochiServices)
package mochi {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _sendChannel:LocalConnection;
private static var _rcvChannelName:String;
private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _startTime:Number;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__mochiservices";
private static var _rcvChannel:LocalConnection;
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (_clip != null){
if (_clip._queue != null){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:MovieClip;
var _local8:LocalConnection;
var _local9:String;
var _local10:ByteArray;
var _local11:ByteArray;
var _local12:uint;
var _local13:uint;
var _local14:Loader;
_local3 = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
_local5 = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
_local6 = [0, 64, 0, 0, 0];
_local7 = new MovieClip();
_local8 = new LocalConnection();
_local9 = ((("_click_" + getTimer()) + "_") + Math.floor(new Date().getTime()));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
_local10 = new ByteArray();
_local11 = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
_local12 = ((_local3.length + _local11.length) + 4);
_local13 = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
public static function get id():String{
return (_id);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:DisplayObjectContainer, _arg3:Function=null):void{
var _local4:Object;
var _local5:String;
var _local6:Number;
var _local7:String;
var _local8:DisplayObject;
_local4 = new Object();
_local4["mav"] = getVersion();
_local4["swfv"] = "9";
_local4["swfurl"] = _arg2.loaderInfo.loaderURL;
_local4["fv"] = Capabilities.version;
_local4["os"] = Capabilities.os;
_local4["lang"] = Capabilities.language;
_local4["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
_local5 = "?";
_local6 = 0;
for (_local7 in _local4) {
if (_local6 != 0){
_local5 = (_local5 + "&");
};
_local6++;
_local5 = (((_local5 + _local7) + "=") + escape(_local4[_local7]));
};
_local8 = clickMovie((_arg1 + _local5), _arg3);
_arg2.addChild(_local8);
_local8.scaleX = (0.01 * _arg2.width);
_local8.scaleY = (0.01 * _arg2.height);
}
public static function getVersion():String{
return ("1.35");
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_listenChannel.close();
_rcvChannel.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
return (_local2);
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_rcvChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = this.client._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
_rcvChannelName = _arg1;
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var clipname:String;
var f:Function;
var req:URLRequest;
var id = _arg1;
var clip = _arg2;
clipname = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
MochiServices.allowDomains(_gatewayURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
_timer = new Timer(1000, 0);
_startTime = getTimer();
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
f = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
req = new URLRequest(_gatewayURL);
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain("*", "localhost");
_rcvChannel.allowInsecureDomain("*", "localhost");
_rcvChannel.client = _clip;
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
public static function bringToTop(_arg1:Event):void{
var e = _arg1;
if (MochiServices.clip != null){
if (MochiServices.childClip != null){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function connectWait(_arg1:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_timer.stop();
};
}
}
}//package mochi
Section 13
//black (black)
package {
import flash.display.*;
public dynamic class black extends MovieClip {
}
}//package
Section 14
//cloud (cloud)
package {
import flash.events.*;
public class cloud extends object {
private var speed:Number;
public function cloud(_arg1:Number, _arg2:Number, _arg3:Object):void{
addFrameScript(0, frame1);
super(_arg1, _arg2, _arg3);
reset();
x = (Math.random() * 650);
}
function frame1(){
stop();
}
private function reset():void{
gotoAndStop(Math.ceil((Math.random() * 3)));
speed = (Math.random() * 1.5);
x = ((700 + width) + (Math.random() * 200));
y = (50 + (Math.random() * 400));
do {
scaleX = (scaleY = Math.random());
} while (scaleX < 0.5);
}
override public function main(_arg1:Event):void{
x = (x - ((5 - currentFrame) - speed));
if (x < -10){
reset();
};
}
}
}//package
Section 15
//document (document)
package {
import flash.display.*;
import flash.events.*;
import mochi.*;
import flash.media.*;
import flash.ui.*;
import flash.text.*;
import flash.net.*;
public dynamic class document extends MovieClip {
public var lowQuality:ContextMenuItem;
private var left:Boolean;// = false
public var MainMenuChannel:SoundChannel;
public var tryagainButton:SimpleButton;
public var api:MovieClip;
private var right:Boolean;// = false
public var wurmyLink:SimpleButton;
public var myMenu:ContextMenu;
public var MainMenuMusic:music_menu;
public var Game:game;
public var btn3:SimpleButton;
public var btn2:SimpleButton;
public var submitButton:SimpleButton;
public var btn1:SimpleButton;
public var medQuality:ContextMenuItem;
public var inputBox:TextField;
public var transitionOUT:MovieClip;
public var instructions:MovieClip;
public var feetTextBox:TextField;
private var feet:Number;
private var up:Boolean;// = false
private var section:String;
public var highQuality:ContextMenuItem;
public function document():void{
var _local1:int;
left = false;
right = false;
up = false;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9);
removeChild(api);
_local1 = 0;
while (_local1 <= 10) {
addChild(new cloud(0, 0, this));
_local1++;
};
addChild(api);
feet = 0;
this.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
this.stage.addEventListener(KeyboardEvent.KEY_UP, keyUpListener);
}
public function toggleIns(_arg1:MouseEvent):void{
instructions.visible = !(instructions.visible);
}
public function highQual(_arg1:ContextMenuEvent):void{
stage.quality = "HIGH";
}
private function keyUpListener(_arg1:KeyboardEvent){
switch (_arg1.keyCode){
case 37:
left = false;
break;
case 38:
up = false;
break;
case 39:
right = false;
break;
};
}
public function deleteGame():void{
this.stage.removeEventListener(Event.ENTER_FRAME, enterFrameFunc, false);
Game.visible = false;
Game.startDelete();
removeChild(Game);
Game = null;
}
public function getRight():Boolean{
return (right);
}
function frame1(){
stop();
myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
lowQuality = new ContextMenuItem("Low Quality", false, true, true);
lowQuality.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, lowQual);
medQuality = new ContextMenuItem("Medium Quality", false, true, true);
medQuality.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, medQual);
highQuality = new ContextMenuItem("High Quality", false, true, true);
highQuality.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, highQual);
myMenu.customItems.push(lowQuality, medQuality, highQuality);
this.contextMenu = myMenu;
MochiServices.connect("59fd721af6abae77", this);
NewgroundsAPI.linkAPI(this);
NewgroundsAPI.connectMovie(2847);
MainMenuChannel = new SoundChannel();
MainMenuMusic = new music_menu();
}
function frame6(){
deleteGame();
stop();
transitionOUT.visible = false;
feetTextBox.text = (Math.round(feet) + "");
submitButton.addEventListener(MouseEvent.CLICK, submitScores, false, 0, true);
tryagainButton.addEventListener(MouseEvent.CLICK, goBack, false, 0, true);
}
public function submitScores(_arg1:MouseEvent):void{
MochiScores.showLeaderboard({boardID:"d92352a81faf350d", score:Math.round(feet), name:inputBox.text});
}
private function keyDownListener(_arg1:KeyboardEvent){
switch (_arg1.keyCode){
case 37:
left = true;
break;
case 38:
up = true;
break;
case 39:
right = true;
break;
};
}
public function getLeft():Boolean{
return (left);
}
public function getUp():Boolean{
return (up);
}
function frame5(){
stop();
MainMenuChannel.stop();
createGame();
}
function frame7(){
MainMenuChannel = MainMenuMusic.play(0, 999);
gotoAndStop(3);
}
public function goToWebsite(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.wurmy.com/");
navigateToURL(_local2);
}
function frame9(){
gotoAndStop(2);
}
function frame3(){
stop();
instructions.visible = false;
transitionOUT.visible = false;
btn1.addEventListener(MouseEvent.CLICK, btf1Func, false, 0, true);
btn3.addEventListener(MouseEvent.CLICK, showHighScores, false, 0, true);
btn2.addEventListener(MouseEvent.CLICK, toggleIns, false, 0, true);
instructions.addEventListener(MouseEvent.CLICK, toggleIns, false, 0, true);
wurmyLink.addEventListener(MouseEvent.MOUSE_UP, goToWebsite, false, 0, true);
}
public function showHighScores(_arg1:MouseEvent):void{
gotoAndStop(8);
}
public function createGame():void{
var _local1:TransitionIn;
feet = 0;
Game = new game(this);
addChild(Game);
_local1 = new TransitionIn();
_local1.x = 324.3;
_local1.y = 218;
addChild(_local1);
this.stage.addEventListener(Event.ENTER_FRAME, enterFrameFunc, false, 0, true);
}
public function btf1Func(_arg1:Event):void{
transitionOUT.visible = true;
transitionOUT.gotoAndPlay(2);
}
public function lowQual(_arg1:ContextMenuEvent):void{
stage.quality = "LOW";
}
function frame8(){
MainMenuChannel.stop();
MochiScores.showLeaderboard({boardID:"d92352a81faf350d"});
}
public function medQual(_arg1:ContextMenuEvent):void{
stage.quality = "MEDIUM";
}
public function enterFrameFunc(_arg1:Event):void{
feet = (feet + ((0.05 * Game.getSpeed()) * Game.getTimeScale()));
feetTextBox.text = (Math.round(feet) + "");
}
function frame2(){
MainMenuChannel = MainMenuMusic.play(0, 999);
if (api != null){
removeChild(api);
api = null;
};
stop();
}
public function goBack(_arg1:MouseEvent):void{
transitionOUT.visible = true;
transitionOUT.play();
}
}
}//package
Section 16
//enemy (enemy)
package {
import flash.display.*;
import flash.events.*;
public class enemy extends object {
private var reachX:Boolean;
private var timer:int;
private var cannTimer:int;
private var iModeChange:int;// = 0
private var reachY:Boolean;
private var distX:Number;
private var distY:Number;
private var SoundBoom:sound_boom;
private var iMode:int;// = 0
public var dude:MovieClip;
private var targetY:Number;// = 225
private var targetX:Number;// = 300
public var cannon:MovieClip;
public function enemy(_arg1:Number, _arg2:Number, _arg3:Object):void{
targetX = 300;
targetY = (450 / 2);
iMode = 0;
iModeChange = 0;
SoundBoom = new sound_boom();
super(_arg1, _arg2, _arg3);
x = 750;
y = (450 / 2);
distX = (targetX - x);
distY = (targetY - y);
reachX = false;
reachY = false;
timer = 0;
cannTimer = 150;
}
private function getDist(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1 - x);
_local4 = (_arg2 - y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
override public function main(_arg1:Event):void{
var _local2:int;
if (timer > 0){
timer = (timer - (1 * Root.getTimeScale()));
};
if (cannTimer > 0){
cannTimer = (cannTimer - (1 * Root.getTimeScale()));
} else {
SoundBoom.play(0, 1);
cannon.gotoAndPlay(5);
_local2 = 0;
if (x < Root.Guy.x){
_local2 = 1;
} else {
_local2 = -1;
};
if ((Math.random() * 10) > 4){
Root.ctForeground.addChild(new spikeball((x - (55.9 * scaleX)), (y - 24.8), Root, _local2));
Root.ctForeground.addChild(new spikeball((x - (55.9 * scaleX)), (y - 24.8), Root, _local2));
Root.ctForeground.addChild(new spikeball((x - (55.9 * scaleX)), (y - 24.8), Root, _local2));
} else {
Root.ctForeground.addChild(new missile((x - (55.9 * scaleX)), (y - 24.8), Root));
};
cannTimer = (100 + (Math.random() * 200));
};
distX = (targetX - x);
distY = (targetY - y);
if ((((distX > 3)) || ((distX < -3)))){
x = (x + ((distX / 24) * Root.getTimeScale()));
reachX = false;
} else {
reachX = true;
};
if ((((distY > 3)) || ((distY < -3)))){
y = (y + ((distY / 24) * Root.getTimeScale()));
reachY = false;
} else {
reachY = true;
};
if ((((getDist(Root.Guy.x, Root.Guy.y) < 50)) && ((timer < 1)))){
reachX = (reachY = true);
};
if (((reachX) && (reachY))){
while (getDist(targetX, targetY) < 200) {
targetX = ((Math.random() * 400) + 100);
targetY = ((Math.random() * 300) + 50);
timer = 30;
};
};
if (x < Root.Guy.x){
scaleX = -1;
} else {
scaleX = 1;
};
}
public function setModeAnim(_arg1:int):void{
iModeChange = _arg1;
}
}
}//package
Section 17
//Explosion (Explosion)
package {
import flash.events.*;
public class Explosion extends object {
private var life:int;// = 30
public function Explosion(_arg1:Number, _arg2:Number, _arg3:Object):void{
life = 30;
super(_arg1, _arg2, _arg3);
}
override public function main(_arg1:Event):void{
life--;
if (life < 1){
remove();
};
}
}
}//package
Section 18
//Explosion_Small (Explosion_Small)
package {
import flash.media.*;
public dynamic class Explosion_Small extends Sound {
}
}//package
Section 19
//game (game)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
public class game extends MovieClip {
private var Root:Object;
private var startTimer:Timer;
private var mainTimer:Timer;
public var Guy:guy;
public var ctParticles:MovieClip;
public var SoundMusic:SoundChannel;
private var Enemy:enemy;
public var ctBackground:MovieClip;
private var nSpeed:Number;
private var MusicGame:music_game;
public var Ground:ground;
private var nTimeScale:Number;
private var powerTimer:Timer;
private var feet:Number;
public var ctForeground:MovieClip;
public var ctMain:MovieClip;
public function game(_arg1:Object):void{
SoundMusic = new SoundChannel();
MusicGame = new music_game();
super();
feet = 0;
SoundMusic = MusicGame.play(0, 999);
Root = _arg1;
startTimer = new Timer(5000, 1);
mainTimer = new Timer(1000, 0);
powerTimer = new Timer(8000, 0);
setSpeed(0);
setTimeScale(1);
Ground = new ground(0, 0, this);
Guy = new guy(Ground, this);
Enemy = new enemy(0, 0, this);
initGame();
startTimer.addEventListener(TimerEvent.TIMER, startGame, false, 0, true);
mainTimer.addEventListener(TimerEvent.TIMER, updateGame, false, 0, true);
powerTimer.addEventListener(TimerEvent.TIMER, givePowerUp, false, 0, true);
startTimer.start();
}
public function getRootFrame():Number{
return (Root.currentFrame);
}
private function initGame():void{
ctBackground = new MovieClip();
ctMain = new MovieClip();
ctForeground = new MovieClip();
ctParticles = new MovieClip();
addChild(ctBackground);
addChild(ctMain);
addChild(ctForeground);
addChild(ctParticles);
ctMain.addChild(Ground);
ctMain.addChild(Guy);
ctMain.addChild(Enemy);
}
public function playStage():void{
SoundMusic.stop();
Root.play();
startTimer.removeEventListener(TimerEvent.TIMER, startGame);
startTimer = null;
mainTimer.removeEventListener(TimerEvent.TIMER, updateGame);
mainTimer = null;
powerTimer.removeEventListener(TimerEvent.TIMER, givePowerUp);
powerTimer = null;
}
public function setSpeed(_arg1:Number):void{
nSpeed = _arg1;
}
private function givePowerUp(_arg1:TimerEvent):void{
ctForeground.addChild(new stopwatch(650, (50 + (Math.random() * 350)), this));
}
public function setTimeScale(_arg1:Number):void{
nTimeScale = _arg1;
}
private function updateGame(_arg1:TimerEvent):void{
setSpeed((nSpeed + 0.08));
}
public function getRoot():Object{
return (Root);
}
private function startGame(_arg1:TimerEvent):void{
setSpeed(2);
mainTimer.start();
powerTimer.start();
}
public function getSpeed():Number{
return (nSpeed);
}
public function startDelete():void{
removeChild(ctBackground);
ctBackground = null;
removeChild(ctMain);
ctMain = null;
removeChild(ctForeground);
ctForeground = null;
removeChild(ctParticles);
ctParticles = null;
}
public function getTimeScale():Number{
return (nTimeScale);
}
}
}//package
Section 20
//gameover (gameover)
package {
import flash.display.*;
import flash.events.*;
public class gameover extends object {
public function gameover(_arg1:Number, _arg2:Number, _arg3:Object):void{
addFrameScript(0, frame1, 109, frame110);
super(_arg1, _arg2, _arg3);
}
function frame1(){
trace("GAME OVER START");
}
function frame110(){
trace("GAME OVER 110 BEFORE");
Root.visible = false;
Root.playStage();
trace("GAME OVER 110 AFTER");
stop();
}
override public function main(_arg1:Event):void{
if (currentFrame > 111){
remove();
};
if (Root.getRootFrame() > 6){
remove();
};
}
}
}//package
Section 21
//ground (ground)
package {
import flash.display.*;
import flash.events.*;
public class ground extends object {
private var iLastFrame:int;// = 999
private var nLastHeight:Number;// = 999
public var cliff:MovieClip;
public function ground(_arg1:Number, _arg2:Number, _arg3:Object):void{
nLastHeight = 999;
iLastFrame = 999;
super(_arg1, _arg2, _arg3);
}
public function setLastFrame(_arg1:int):void{
iLastFrame = _arg1;
}
override public function postConstructor():void{
var _local1:int;
_local1 = 0;
while (_local1 <= 3) {
addChild(new platform(this, _local1, Root));
_local1++;
};
}
public function setLastHeight(_arg1:Number):void{
nLastHeight = _arg1;
}
public function getLastHeight():Number{
return (nLastHeight);
}
override public function main(_arg1:Event):void{
if (cliff.x > -400){
cliff.x = (cliff.x - (Root.getSpeed() * Root.getTimeScale()));
};
}
public function getLastFrame():int{
return (iLastFrame);
}
}
}//package
Section 22
//guy (guy)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.geom.*;
public class guy extends object {
private var nGravity:Number;
private var iLastFrame:int;
private var SoundDie:sound_gameover;
private var iNewFrame:int;
public var anim4:MovieClip;
public var anim2:MovieClip;
private var bCanJump:Boolean;
private var SoundFreeze:sound_glass;
private var iFrozen:int;// = 0
public var anim1:MovieClip;
public var anim3:MovieClip;
private var bLeft:Boolean;
private var bFrozen:Boolean;// = false
private var bJump:Boolean;
private var iHoloTime:int;// = 0
private var mcGround:MovieClip;
private var bInAir:Boolean;
private var SoundJump:sound_jump;
private var moveSide:Number;// = 0
private var iHolo:int;// = 0
private var bRight:Boolean;
private var SoundExplosion:Explosion_Small;
public function guy(_arg1, _arg2:Object):void{
iHolo = 0;
iHoloTime = 0;
bFrozen = false;
iFrozen = 0;
moveSide = 0;
SoundJump = new sound_jump();
SoundDie = new sound_gameover();
SoundExplosion = new Explosion_Small();
SoundFreeze = new sound_glass();
addFrameScript(0, frame1);
super(200, 400, _arg2);
mcGround = _arg1;
}
private function setFrame():void{
gotoAndStop(iNewFrame);
}
override public function postConstructor():void{
nGravity = 0;
iLastFrame = (iNewFrame = 1);
bLeft = false;
bRight = false;
bJump = false;
bInAir = true;
bCanJump = false;
scaleX = (scaleY = 0.7);
}
public function setStrafe(_arg1:Number):void{
Root.ctForeground.addChild(new Explosion(x, y, Root));
moveSide = (_arg1 * 2);
nGravity = -17;
SoundExplosion.play();
}
public function setHolo(_arg1:int):void{
iHoloTime = _arg1;
}
function frame1(){
stop();
}
public function setFreeze(_arg1:Boolean):void{
iNewFrame = 4;
setFrame();
bFrozen = _arg1;
iFrozen = 40;
}
override public function main(_arg1:Event):void{
var _local2:int;
var _local3:int;
if (y < 450){
if ((((moveSide > 0.1)) || ((moveSide < -0.1)))){
moveSide = (moveSide * 0.9);
} else {
moveSide = 0;
};
x = (x + moveSide);
if ((((x < 21)) && (mcGround.hitTestPoint((x + 18), (y - 6), true)))){
Root.ctForeground.addChild(new Explosion(x, y, Root));
y = 999;
};
bLeft = Root.getRoot().getLeft();
bRight = Root.getRoot().getRight();
bJump = Root.getRoot().getUp();
if (iHoloTime > 0){
iHolo++;
if ((((currentFrame > 1)) && (((iHolo % 3) == 0)))){
_local2 = currentFrame;
_local3 = this[("anim" + _local2)].currentFrame;
Root.ctBackground.addChild(new guy_holo(x, y, _local2, _local3, scaleX, Root));
iHoloTime--;
};
} else {
Root.setTimeScale(1);
};
bInAir = true;
nGravity++;
y = (y + nGravity);
while (mcGround.hitTestPoint(x, y, true)) {
nGravity = 0;
y--;
bCanJump = true;
};
if (mcGround.hitTestPoint(x, (y + 3), true)){
bInAir = false;
x = (x - (Root.getSpeed() * Root.getTimeScale()));
};
while (mcGround.hitTestPoint((x + 15), (y - 30), true)) {
x--;
};
while (mcGround.hitTestPoint((x - 15), (y - 30), true)) {
x++;
};
iLastFrame = currentFrame;
if (!bFrozen){
if (bLeft){
x = (x - 5);
scaleX = -0.7;
} else {
if (bRight){
x = (x + 5);
scaleX = 0.7;
};
};
if (((bJump) && (bCanJump))){
bCanJump = false;
nGravity = -15;
SoundJump.play(0, 1);
};
if (bInAir){
iNewFrame = 3;
} else {
if (((bLeft) || (bRight))){
iNewFrame = 2;
} else {
iNewFrame = 1;
};
};
} else {
iFrozen--;
if (iFrozen < 0){
iNewFrame = 1;
setFrame();
SoundFreeze.play(0, 1);
Root.ctForeground.addChild(new Explosion(x, y, Root));
bFrozen = false;
};
};
if (x < 20){
x = 20;
};
if (x > 630){
x = 630;
};
if (iNewFrame != iLastFrame){
setFrame();
};
if (y > 449){
Root.addChild(new gameover(0, 0, Root));
Root.setTimeScale(0);
Root.SoundMusic.stop();
Root.SoundMusic = SoundDie.play(0, 1);
};
};
if (Root.getRootFrame() > 6){
remove();
};
}
public function getHolo():int{
return (iHoloTime);
}
public function setGrav(_arg1:Number):void{
nGravity = _arg1;
}
}
}//package
Section 23
//guy_holo (guy_holo)
package {
import flash.display.*;
import flash.events.*;
public class guy_holo extends object {
public var anim4:MovieClip;
public function guy_holo(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int, _arg5:Number, _arg6:Object):void{
super(_arg1, _arg2, _arg6);
switch (_arg3){
case 1:
gotoAndStop(_arg4);
break;
case 2:
gotoAndStop((_arg4 + 8));
break;
case 3:
gotoAndStop((_arg4 + 16));
break;
case 4:
gotoAndStop((_arg4 + 20));
break;
default:
trace("ERROR: WRONG FRAME FOR HOLOGRAM");
break;
};
scaleX = _arg5;
scaleY = 0.7;
alpha = 0.5;
}
override public function main(_arg1:Event):void{
x = (x - (Root.getSpeed() * Root.getTimeScale()));
if (alpha < 0.1){
remove();
} else {
alpha = (alpha - 0.02);
};
}
}
}//package
Section 24
//missile (missile)
package {
import flash.display.*;
import flash.events.*;
public class missile extends object {
var life:int;
private var SoundFreeze:sound_glass;
var dead:Boolean;// = false
private var SoundBoom:sound_boom;
var radAngle:Number;
public function missile(_arg1:Number, _arg2:Number, _arg3:Object):void{
dead = false;
SoundBoom = new sound_boom();
SoundFreeze = new sound_glass();
addFrameScript(3, frame4, 26, frame27);
super(_arg1, _arg2, _arg3);
life = 100;
}
function frame4(){
gotoAndPlay(1);
}
function frame27(){
remove();
}
override public function main(_arg1:Event):void{
if (!dead){
life = (life - (1 * Root.getTimeScale()));
radAngle = -(Math.atan2((Root.Guy.x - x), ((Root.Guy.y - 8) - y)));
rotation = int((((radAngle * 360) / (2 * Math.PI)) - 90));
x = (x - ((Math.cos(((Math.PI / 180) * rotation)) * 5) * Root.getTimeScale()));
y = (y - ((Math.sin(((Math.PI / 180) * rotation)) * 5) * Root.getTimeScale()));
if (this.hitTestPoint(Root.Guy.x, (Root.Guy.y - 8), true)){
Root.Guy.setFreeze(true);
dead = true;
gotoAndPlay(5);
SoundFreeze.play(0, 1);
};
if (life < 0){
dead = true;
gotoAndPlay(5);
SoundBoom.play(0, 1);
};
};
}
}
}//package
Section 25
//music_game (music_game)
package {
import flash.media.*;
public dynamic class music_game extends Sound {
}
}//package
Section 26
//music_menu (music_menu)
package {
import flash.media.*;
public dynamic class music_menu extends Sound {
}
}//package
Section 27
//NewgroundsAPI (NewgroundsAPI)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class NewgroundsAPI {
public static const ADS_APPROVED:Number = 3;
public static const bridge:Sprite = new Sprite();
private static const STAT_NEW_VERSION:Number = 4;
private static const STAT_AUTHOR_SITE:Number = 2;
private static const GATEWAY_URL:String = "http://www.ngads.com/gateway.php";
private static const NEWGROUNDS_URL:String = "http://www.newgrounds.com";
private static const STAT_CUSTOM_STATS:Number = 50;
private static const STAT_MOVIE_VIEWS:Number = 1;
private static const STAT_NEWGROUNDS:Number = 3;
public static const NEW_VERSION:Number = 2;
public static const DENY_HOST:Number = 1;
private static var tracker_id:Number;
private static var movie_options:Object = new Object();
private static var connected:Boolean;
private static var custom_events:Object = new Object();
private static var host:String;
private static var linked:Boolean;
private static var events:Object = new Object();
private static var debug:Boolean;
private static var version:String;
private static var custom_links:Object = new Object();
public static function getNewVersionURL(){
return (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + STAT_NEW_VERSION));
}
private static function ReadGatewayData(_arg1:Object){
var _local2:*;
var _local3:String;
var _local4:*;
var _local5:URLLoader;
for (_local2 in _arg1) {
_arg1[_local2] = unescape(_arg1[_local2]);
movie_options[_local2] = _arg1[_local2];
};
if (_arg1["settings_loaded"]){
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage((("Movie Identified as '" + movie_options["movie_name"]) + "'"));
if (movie_options["message"]){
SendMessage(movie_options["message"]);
};
if (movie_options["ad_url"]){
SendMessage("Your movie has been approved to run Flash Ads");
if (events[ADS_APPROVED]){
var _local6 = events;
_local6[ADS_APPROVED](movie_options["ad_url"]);
} else {
onAdsApproved(movie_options["ad_url"]);
};
};
if (((movie_options["movie_version"]) && (!((String(movie_options["movie_version"]) == String(version)))))){
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
if (events[NEW_VERSION]){
_local6 = events;
_local6[NEW_VERSION]({version:movie_options["movie_version"], real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onNewVersionAvailable(movie_options["movie_version"], getMovieURL(), getNewVersionURL());
};
};
if (movie_options["deny_host"]){
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
if (events[DENY_HOST]){
_local6 = events;
_local6[DENY_HOST]({host:host, real_url:getMovieURL(), redirect_url:getNewVersionURL()});
} else {
onDenyHost(host, getMovieURL(), getNewVersionURL());
};
};
if (movie_options["request_portal_url"]){
_local3 = bridge.root.loaderInfo.url;
_local4 = ((((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_local3));
_local5 = new URLLoader(new URLRequest(_local4));
};
if (events[69]){
_local6 = events;
_local6[69]();
};
} else {
if (!movie_options["settings_loaded"]){
SendError("Could not establish connection to the API gateway.");
};
};
}
public static function setMovieVersion(_arg1){
if (!_arg1){
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = String(_arg1);
};
}
public static function loadCustomLink(_arg1:String){
if (!_arg1){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else {
if (!custom_links[_arg1]){
SendError(("Attempted to open undefined custom link: " + _arg1));
} else {
SendLink(custom_links[_arg1]);
};
};
}
public static function addCustomLink(_arg1:Number, _arg2:String){
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
if (!_arg2){
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[_arg2] = (STAT_CUSTOM_STATS + _arg1);
SendMessage(((("Created custom link " + _arg1) + ": ") + _arg2));
};
};
}
public static function getMovieURL(){
if (movie_options["movie_url"]){
return (movie_options["movie_url"]);
};
return ("Newgrounds.com");
}
public static function debugMode(){
debug = true;
}
public static function getAdURL(){
return (movie_options["ad_url"]);
}
private static function SendStat(_arg1:Number, _arg2:Boolean, _arg3=null){
var target_url:*;
var XML_Loaded:Function;
var x:*;
var request:URLRequest;
var gateway_loader:URLLoader;
var stat_id = _arg1;
var open_in_browser = _arg2;
var extra = _arg3;
if (!tracker_id){
SendError("You must call NewgroundsAPI.connectMovie() with a valid movie id before using API features!");
} else {
XML_Loaded = function (_arg1:Event){
var _local2:XML;
var _local3:Object;
var _local4:XMLList;
var _local5:XML;
var _local6:*;
var _local7:*;
XML.ignoreWhitespace = true;
_local2 = XML(_arg1.target.data);
_local3 = new Object();
_local4 = _local2.children();
for each (_local5 in _local4) {
_local6 = _local5.localName();
_local7 = _local5.attribute("value");
if (_local7 == Number(_local7)){
_local7 = Number(_local7);
};
_local3[_local6] = _local7;
};
ReadGatewayData(_local3);
};
target_url = (((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id) + addSeed());
if (extra){
for (x in extra) {
target_url = (target_url + ((("&" + escape(x)) + "=") + escape(extra[x])));
};
};
if (debug){
target_url = (target_url + "&debug=1");
};
if (open_in_browser){
request = new URLRequest((target_url + addSeed()));
navigateToURL(request, "_blank");
} else {
gateway_loader = new URLLoader(new URLRequest((target_url + addSeed())));
gateway_loader.addEventListener(Event.COMPLETE, XML_Loaded);
};
};
}
public static function onAdsApproved(_arg1:String){
}
public static function loadMySite(_arg1:Event=null){
SendLink(STAT_AUTHOR_SITE);
}
private static function SendMessage(_arg1:String){
trace(("[NEWGROUNDS API] :: " + _arg1));
}
public static function linkAPI(_arg1){
_arg1.addChild(bridge);
linked = true;
}
public static function loadNewgrounds(_arg1:Event=null, _arg2:String=null){
var _local3:URLRequest;
var _local4:*;
if (!tracker_id){
_local3 = new URLRequest(((NEWGROUNDS_URL + "/") + _arg2));
navigateToURL(_local3, "_blank");
} else {
_local4 = null;
if (_arg2){
_local4 = new Object();
_local4.page = _arg2;
};
SendLink(STAT_NEWGROUNDS, _local4);
};
}
private static function SendLink(_arg1, _arg2=null){
SendStat(_arg1, true, _arg2);
}
public static function logCustomEvent(_arg1:String){
if (!_arg1){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else {
if (!custom_events[_arg1]){
SendError(("Attempted to log undefined custom event: " + _arg1));
} else {
SendEvent(custom_events[_arg1]);
};
};
}
private static function SendError(_arg1:String){
trace(("[NEWGROUNDS API ERROR] :: " + _arg1));
}
public static function addCustomEvent(_arg1:Number, _arg2:String){
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
if (!_arg2){
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[_arg2] = (STAT_CUSTOM_STATS + _arg1);
SendMessage(("Created custom event: " + _arg2));
};
};
}
private static function addSeed(){
return (("&seed=" + Math.random()));
}
public static function addEventListener(_arg1:Number, _arg2:Function){
events[_arg1] = _arg2;
}
private static function SendEvent(_arg1){
SendStat(_arg1, false);
}
public static function onNewVersionAvailable(_arg1:String, _arg2:String, _arg3:String){
var sw:*;
var sh:*;
var tw:*;
var th:*;
var mg:*;
var _root:*;
var overlay:MovieClip;
var overlay_x:*;
var overlay_y:*;
var close_x:*;
var blankarea:TextField;
var header:TextField;
var header_format:TextFormat;
var msgtext:TextField;
var msgtext_format:TextFormat;
var msgtext_link:TextFormat;
var version = _arg1;
var movie_url = _arg2;
var redirect_url = _arg3;
sw = bridge.stage.stageWidth;
sh = bridge.stage.stageHeight;
tw = 350;
th = 160;
mg = 20;
_root = bridge.root;
overlay = new MovieClip();
overlay.graphics.beginFill(0, 0.6);
overlay.graphics.lineStyle(0, 0);
overlay.graphics.drawRect(0, 0, sw, sh);
overlay.graphics.endFill();
overlay_x = Math.round(((sw - tw) / 2));
overlay_y = Math.round(((sh - th) / 2));
overlay.graphics.beginFill(102);
overlay.graphics.lineStyle(10, 0);
overlay.graphics.drawRect((overlay_x - mg), (overlay_y - mg), (tw + mg), (th + mg));
overlay.graphics.endFill();
overlay.close = function (_arg1:Event){
_root.removeChild(overlay);
};
close_x = new MovieClip();
close_x.graphics.beginFill(0, 0.1);
close_x.graphics.lineStyle(3, 22015);
close_x.graphics.drawRect(0, 0, 16, 16);
close_x.graphics.endFill();
close_x.graphics.moveTo(4, 4);
close_x.graphics.lineTo(13, 13);
close_x.graphics.moveTo(13, 4);
close_x.graphics.lineTo(4, 13);
close_x.x = ((overlay_x + tw) - 26);
close_x.y = (overlay_y - 10);
close_x.addEventListener(MouseEvent.CLICK, overlay.close);
blankarea = new TextField();
blankarea.x = (overlay_x - mg);
blankarea.y = (overlay_y - mg);
blankarea.width = (tw + mg);
blankarea.height = (th + mg);
blankarea.selectable = false;
header = new TextField();
header.width = tw;
header.x = overlay_x;
header.y = overlay_y;
header.height = 100;
header.selectable = false;
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.color = 0xFFFFFF;
header_format.size = 20;
header.defaultTextFormat = header_format;
header.text = "New Version Available!";
msgtext = new TextField();
msgtext.x = overlay_x;
msgtext.y = (overlay_y + 70);
msgtext.width = tw;
msgtext.height = 60;
msgtext.selectable = false;
msgtext_format = new TextFormat();
msgtext_format.font = "Arial";
msgtext_format.color = 0xFFFFFF;
msgtext_format.size = 12;
msgtext_format.bold = true;
msgtext_link = new TextFormat();
msgtext_link.font = "Arial";
msgtext_link.color = 0xFFFF00;
msgtext_link.size = 12;
msgtext_link.bold = true;
msgtext_link.url = redirect_url;
msgtext_link.target = "_blank";
if (version){
version = ("Version " + version);
} else {
version = "A new version";
};
msgtext.defaultTextFormat = msgtext_format;
msgtext.appendText((version + " is now available"));
if (movie_url){
msgtext.appendText(" at:\n");
msgtext.defaultTextFormat = msgtext_link;
msgtext.appendText(movie_url);
} else {
msgtext.appendText("!");
};
_root.addChild(overlay);
overlay.addChild(blankarea);
overlay.addChild(header);
overlay.addChild(msgtext);
overlay.addChild(close_x);
}
public static function onDenyHost(_arg1:String, _arg2:String, _arg3:String){
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:MovieClip;
var _local10:TextField;
var _local11:TextField;
var _local12:TextFormat;
var _local13:TextField;
var _local14:TextFormat;
var _local15:TextFormat;
_local4 = bridge.stage.stageWidth;
_local5 = bridge.stage.stageHeight;
_local6 = 350;
_local7 = 160;
_local8 = bridge.root;
_local9 = new MovieClip();
_local9.graphics.beginFill(0x660000);
_local9.graphics.lineStyle(20, 0);
_local9.graphics.drawRect(0, 0, _local4, _local5);
_local9.graphics.endFill();
_local10 = new TextField();
_local10.x = 0;
_local10.y = 0;
_local10.width = _local4;
_local10.height = _local5;
_local10.selectable = false;
_local11 = new TextField();
_local11.x = Math.round(((_local4 - _local6) / 2));
_local11.y = Math.round(((_local5 - _local7) / 2.5));
_local11.width = _local6;
_local11.height = 100;
_local11.selectable = false;
_local12 = new TextFormat();
_local12.font = "Arial Black";
_local12.color = 0xFF0000;
_local12.size = 38;
_local11.defaultTextFormat = _local12;
_local11.text = "ERROR!";
_local13 = new TextField();
_local13.x = Math.round(((_local4 - _local6) / 2));
_local13.y = (Math.round(((_local5 - _local7) / 2.5)) + 80);
_local13.width = _local6;
_local13.height = 80;
_local13.selectable = false;
_local14 = new TextFormat();
_local14.font = "Arial";
_local14.color = 0xFFFFFF;
_local14.size = 12;
_local14.bold = true;
_local15 = new TextFormat();
_local15.font = "Arial";
_local15.color = 0xFFFF00;
_local15.size = 12;
_local15.bold = true;
_local15.url = _arg3;
_local15.target = "_blank";
_local13.defaultTextFormat = _local14;
_local13.appendText((("This movie has not been approved for use on " + _arg1) + "\n"));
_local13.appendText("For an approved copy, please visit:\n");
_local13.defaultTextFormat = _local15;
_local13.appendText(_arg2);
_local8.addChild(_local9);
_local9.addChild(_local10);
_local9.addChild(_local11);
_local9.addChild(_local13);
}
public static function connectMovie(_arg1:Number){
var _local2:String;
var _local3:*;
if (!_arg1){
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else {
if (!linked){
SendError("Attempted to call MewgroundsAPI.connectMovie() without first calling NewgroundsAPI.linkAPI(this)");
} else {
if (!tracker_id){
SendMessage("Connecting to API gateway...");
tracker_id = _arg1;
_local2 = bridge.root.loaderInfo.url;
host = _local2.split("/")[2].toLowerCase();
if (host.length < 1){
host = "localhost";
};
_local3 = new Object();
SendEvent(STAT_MOVIE_VIEWS);
};
};
};
}
public static function isInstalled(){
return (true);
}
}
}//package
Section 28
//object (object)
package {
import flash.display.*;
import flash.events.*;
public class object extends MovieClip {
public var Root:Object;
public function object(_arg1:Number, _arg2:Number, _arg3:Object):void{
Root = _arg3;
preConstructor(_arg1, _arg2);
}
private function preConstructor(_arg1:Number, _arg2:Number):void{
x = _arg1;
y = _arg2;
postConstructor();
addEventListener(Event.ENTER_FRAME, main, false, 0, true);
}
public function remove():void{
if (this.parent != null){
removeEventListener(Event.ENTER_FRAME, main, false);
this.parent.removeChild(this);
};
}
public function postConstructor():void{
}
public function main(_arg1:Event):void{
remove();
}
}
}//package
Section 29
//particle (particle)
package {
import flash.display.*;
import flash.events.*;
public class particle extends MovieClip {
private var iLife:int;// = 0
private var Root:Object;
public function particle(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Object):void{
iLife = 0;
super();
iLife = _arg3;
scaleX = (scaleY = ((Math.random() * 1) + 0.5));
rotation = (Math.random() * 360);
alpha = 0.5;
x = _arg1;
y = _arg2;
addEventListener(Event.ENTER_FRAME, main, false, 0, true);
Root = _arg4;
}
public function remove():void{
if (this.parent != null){
removeEventListener(Event.ENTER_FRAME, main, false);
this.parent.removeChild(this);
};
}
public function main(_arg1:Event):void{
x = (x - (Root.getSpeed() * Root.getTimeScale()));
if (iLife > 0){
if (alpha < 1){
alpha = (alpha + 0.5);
};
rotation = (rotation + (2 * Root.getTimeScale()));
iLife = (iLife - (1 * Root.getTimeScale()));
} else {
if (alpha > 0){
alpha = (alpha - (0.1 * Root.getTimeScale()));
} else {
remove();
};
};
if (Root.getRootFrame() > 6){
remove();
};
}
}
}//package
Section 30
//platform (platform)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class platform extends object {
private var iShake:int;
private var bCollapseAble:Boolean;
private var bCollapse:Boolean;
private var iNum:int;
private var bStartCollapse:Boolean;
private var oParent:Object;
public function platform(_arg1:Object, _arg2:int, _arg3:Object):void{
super(0, 0, _arg3);
oParent = _arg1;
iShake = 2;
iNum = 0;
resetPlatform();
x = (740 + (_arg2 * 200));
}
private function shake():void{
iNum++;
if ((iNum % 2) == 0){
Root.ctParticles.addChild(new smoke((x - ((Math.random() * 150) - 75)), (430 + (Math.random() * 20)), Root));
};
iShake = (iShake * -1);
x = (x + iShake);
}
private function fall(_arg1:Event):void{
bCollapse = true;
}
override public function main(_arg1:Event):void{
var _local2:int;
var _local3:Timer;
x = (x - (Root.getSpeed() * Root.getTimeScale()));
if (bCollapseAble){
if (y < 500){
if (((this.hitTestPoint(Root.Guy.x, (Root.Guy.y + 3), true)) && (!(((bCollapse) || (bStartCollapse)))))){
_local3 = new Timer(300, 1);
_local3.addEventListener(TimerEvent.TIMER, fall, false, 0, true);
_local3.start();
bStartCollapse = true;
};
_local2 = -1;
while (_local2 <= 1) {
if (this.hitTestPoint((Root.Guy.x - (_local2 * 3)), (Root.Guy.y - 10), true)){
Root.Guy.setGrav(10);
};
_local2 = (_local2 + 1);
};
if (((bStartCollapse) && ((Root.getTimeScale() > 0)))){
shake();
};
if (bCollapse){
y = (y + (1 * Root.getTimeScale()));
};
};
};
if (x < -100){
resetPlatform();
};
if (Root.getRootFrame() > 6){
remove();
};
}
public function resetPlatform():void{
gotoAndStop(Math.ceil((Math.random() * 3)));
bCollapseAble = Boolean((Math.ceil((Math.random() * 2)) - 1));
bCollapse = false;
bStartCollapse = false;
if (oParent.getLastFrame() == 999){
gotoAndStop((2 + (Number(bCollapseAble) * 3)));
} else {
do {
gotoAndStop((Math.ceil((Math.random() * 3)) + (Number(bCollapseAble) * 3)));
} while (currentFrame == oParent.getLastFrame());
};
if (oParent.getLastHeight() == 999){
y = 214;
} else {
do {
y = ((oParent.getLastHeight() + (Math.random() * 150)) - 75);
} while ((((y > 440)) || ((y < 100))));
};
x = 740;
oParent.setLastHeight(y);
oParent.setLastFrame(currentFrame);
}
}
}//package
Section 31
//smoke (smoke)
package {
public class smoke extends particle {
public function smoke(_arg1:Number, _arg2:Number, _arg3:Object):void{
super(_arg1, _arg2, 20, _arg3);
}
}
}//package
Section 32
//sound_boom (sound_boom)
package {
import flash.media.*;
public dynamic class sound_boom extends Sound {
}
}//package
Section 33
//sound_gameover (sound_gameover)
package {
import flash.media.*;
public dynamic class sound_gameover extends Sound {
}
}//package
Section 34
//sound_glass (sound_glass)
package {
import flash.media.*;
public dynamic class sound_glass extends Sound {
}
}//package
Section 35
//sound_jump (sound_jump)
package {
import flash.media.*;
public dynamic class sound_jump extends Sound {
}
}//package
Section 36
//spikeball (spikeball)
package {
import flash.display.*;
import flash.events.*;
public class spikeball extends object {
var friction:Number;// = 0.98
var life:int;
var vx:Number;// = 0
var vy:Number;// = 0
var iMod:int;// = 0
public function spikeball(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number):void{
friction = 0.98;
vy = 0;
vx = 0;
iMod = 0;
iMod = _arg4;
vx = (4 + (Math.random() * 10));
vx = (vx * iMod);
vy = (-3 - (Math.random() * 20));
rotation = (Math.random() * 360);
super(_arg1, _arg2, _arg3);
life = 100;
}
override public function main(_arg1:Event):void{
x = (x - (Root.getSpeed() * Root.getTimeScale()));
if (life > 0){
if (this.hitTestObject(Root.Guy)){
if (Root.Guy.x > x){
Root.Guy.setStrafe(-10);
} else {
Root.Guy.setStrafe(10);
};
life = 0;
};
rotation = (rotation + (4 * iMod));
x = (x + (vx * Root.getTimeScale()));
y = (y + (vy * Root.getTimeScale()));
vx = (vx * friction);
vy = (vy + (1 * Root.getTimeScale()));
life--;
if (Root.Ground.hitTestPoint(x, y, true)){
life = 0;
};
} else {
if (alpha > 0){
alpha = (alpha - 0.1);
} else {
remove();
};
};
}
}
}//package
Section 37
//stopwatch (stopwatch)
package {
import flash.display.*;
import flash.events.*;
public class stopwatch extends object {
public function stopwatch(_arg1:Number, _arg2:Number, _arg3:Object):void{
super(_arg1, _arg2, _arg3);
}
override public function main(_arg1:Event):void{
x = (x - (Root.getSpeed() * Root.getTimeScale()));
if (this.hitTestObject(Root.Guy)){
Root.setTimeScale(0.5);
Root.Guy.setHolo(40);
remove();
};
if (x < -10){
remove();
};
}
}
}//package
Section 38
//TransitionIn (TransitionIn)
package {
import flash.display.*;
public dynamic class TransitionIn extends MovieClip {
public function TransitionIn(){
addFrameScript(53, frame54);
}
function frame54(){
stop();
}
}
}//package