Section 1
//soundsholder_3 (Lunar_Escape_fla.soundsholder_3)
package Lunar_Escape_fla {
import flash.display.*;
public dynamic class soundsholder_3 extends MovieClip {
public function soundsholder_3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Lunar_Escape_fla
Section 2
//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 3
//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 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 getVersion():String{
return ("1.2");
}
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()});
_rcvChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = this.client._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
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("Unable to invoke callback method.");
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace("Unable to invoke callback method on object.");
};
};
};
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 (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 _local5:MovieClip;
_local5 = new MovieClip();
if (_arg4){
if (((false) && (_arg3))){
_arg1.addChildAt(_local5, _arg3);
} else {
_arg1.addChild(_local5);
};
};
_arg1[_arg2] = _local5;
_local5["_name"] = _arg2;
return (_local5);
}
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 4
//Collision (Collision)
package {
import flash.geom.*;
import flash.display.*;
public class Collision {
public static function getCollisionRect(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:DisplayObjectContainer, _arg4:Boolean=false, _arg5:Number=0):Rectangle{
var _local6:Rectangle;
var _local7:Rectangle;
var _local8:Rectangle;
var _local9:BitmapData;
var _local10:BitmapData;
var _local11:uint;
var _local12:Rectangle;
var _local13:int;
_local6 = _arg1.getBounds(_arg3);
_local7 = _arg2.getBounds(_arg3);
_local8 = _local6.intersection(_local7);
if (_local8.size.length > 0){
if (_arg4){
_local8.width = Math.ceil(_local8.width);
_local8.height = Math.ceil(_local8.height);
_local8 = new Rectangle(0, 0, 400, 500);
_local9 = getAlphaMap(_arg1, _local8, BitmapDataChannel.RED, _arg3);
_local10 = getAlphaMap(_arg2, _local8, BitmapDataChannel.GREEN, _arg3);
_local9.draw(_local10, null, null, BlendMode.LIGHTEN);
if (_arg5 <= 0){
_local11 = 65792;
} else {
if (_arg5 > 1){
_arg5 = 1;
};
_local13 = Math.round((_arg5 * 0xFF));
_local11 = (((_local13 << 16) | (_local13 << 8)) | 0);
};
_local12 = _local9.getColorBoundsRect(_local11, _local11);
_local9.getColorBoundsRect(_local11, _local11).x = (_local12.x + _local8.x);
_local12.y = (_local12.y + _local8.y);
return (_local12);
} else {
return (_local8);
};
//unresolved jump
};
return (null);
}
public static function isColliding(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:DisplayObjectContainer, _arg4:Boolean=false, _arg5:Number=0):Boolean{
var _local6:Rectangle;
_local6 = getCollisionRect(_arg1, _arg2, _arg3, _arg4, _arg5);
if (((!((_local6 == null))) && ((_local6.size.length > 0)))){
return (true);
};
return (false);
}
public static function getCollisionPoint(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:DisplayObjectContainer, _arg4:Boolean=false, _arg5:Number=0):Point{
var _local6:Rectangle;
var _local7:Number;
var _local8:Number;
_local6 = getCollisionRect(_arg1, _arg2, _arg3, _arg4, _arg5);
if (((!((_local6 == null))) && ((_local6.size.length > 0)))){
_local7 = ((_local6.left + _local6.right) / 2);
_local8 = ((_local6.top + _local6.bottom) / 2);
return (new Point(_local7, _local8));
};
return (null);
}
private static function getAlphaMap(_arg1:DisplayObject, _arg2:Rectangle, _arg3:uint, _arg4:DisplayObjectContainer):BitmapData{
var _local5:*;
var _local6:BitmapData;
var _local7:BitmapData;
_local5 = new Matrix();
_local5.translate(-(_arg4.x), -(_arg4.y));
_local6 = new BitmapData(_arg2.width, _arg2.height, true, 0);
_local6.draw(_arg1, _local5);
_local7 = new BitmapData(_arg2.width, _arg2.height, false, 0);
_local7.copyChannel(_local6, _local6.rect, new Point(0, 0), BitmapDataChannel.ALPHA, _arg3);
return (_local7);
}
}
}//package
Section 5
//deathscreen (deathscreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class deathscreen extends MovieClip {
public var usedfuel:TextField;
public var refueld:TextField;
public var score_txt:TextField;
public var Sum_Score:SimpleButton;
public var Play_Button:MovieClip;
public var moregames:MovieClip;
public var why:TextField;
}
}//package
Section 6
//firststarts (firststarts)
package {
import flash.display.*;
import flash.text.*;
public class firststarts extends MovieClip {
public var Progress_bar:MovieClip;
public var loadingtext:TextField;
public var playtext:TextField;
public var Play_Button:MovieClip;
public var Loading_txt:TextField;
}
}//package
Section 7
//fuelitem (fuelitem)
package {
import flash.display.*;
public class fuelitem extends MovieClip {
public var ymov;
public function fuelitem(){
ymov = (((Math.random() * 20) / 20) + 1);
super();
}
}
}//package
Section 8
//hud (hud)
package {
import flash.display.*;
import flash.text.*;
public class hud extends MovieClip {
public var score:TextField;
public var fuelbar:MovieClip;
public var fuelt:TextField;
public var Tscore:TextField;
}
}//package
Section 9
//Lander (Lander)
package {
import flash.display.*;
public class Lander extends Sprite {
public var xMov;// = 0
public var yMov;// = 0
public function Lander(){
xMov = 0;
yMov = 0;
super();
}
}
}//package
Section 10
//lava (lava)
package {
import flash.display.*;
public dynamic class lava extends MovieClip {
}
}//package
Section 11
//magnobutton (magnobutton)
package {
import flash.display.*;
public dynamic class magnobutton extends SimpleButton {
}
}//package
Section 12
//Main (Main)
package {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import mochi.*;
import flash.media.*;
import flash.net.*;
public class Main extends MovieClip {
private var LeftWallx;// = 20
private var LeftWally;// = 550
public var MochiClip;
private var tLeftWallx;// = 20
private var Particals;
private var tLeftWally;// = -50
public var newScreen;
public var collide;
private var topScore;// = 0
private var magbutton:magnobutton;
public var CurrentMusic;
private var thrust;// = 0
private var gravity;// = 0.5
public var deathscreenC;
public var DEAD;// = false
private var yVelocity;// = 0
public var FuelsA;
public var CollectedUsed;// = 0
public var mainMenu;
private var tRightWallx;// = 380
private var tRightWally;// = -50
private var upThrust:Boolean;// = false
public var YSquare;// = 0
public var HUD;
public var fuelsUsed;// = 0
private var damp;// = 0.1
private var Player;
public var Shadows;
public var Roids;
public var R_Clip;
private var leftThrust:Boolean;// = false
public var LavaC;
public var capture;
private var RightWallx;// = 360
private var RightWally;// = 550
public var ScoreSubbed;// = false
public var moveamount;// = 0
private var xVelocity;// = 0
public var newScreen2;
private var rightThrust:Boolean;// = false
public var firststart;
public var HOLDER;
public var fuel;// = 100
private var Walls;
public var scoreTotal;// = 0
private var rot;// = 0
public var S_Clip;
public var ThurstSound;
public var F_Clip;
public var C_Clip;
public var P_Clip;
public function Main():void{
leftThrust = false;
rightThrust = false;
upThrust = false;
gravity = 0.5;
damp = 0.1;
thrust = 0;
rot = 0;
yVelocity = 0;
xVelocity = 0;
Particals = new Array();
Walls = new Array();
LeftWallx = 20;
LeftWally = 550;
tLeftWallx = 20;
tLeftWally = -50;
RightWallx = 360;
RightWally = 550;
tRightWallx = 380;
tRightWally = -50;
newScreen = new Bitmap();
newScreen2 = new Bitmap();
capture = new BitmapData(stage.stageWidth, stage.stageHeight, true, 4294967295);
S_Clip = new MovieClip();
C_Clip = new MovieClip();
P_Clip = new MovieClip();
R_Clip = new MovieClip();
Roids = new Array();
F_Clip = new MovieClip();
FuelsA = new Array();
YSquare = 0;
moveamount = 0;
Shadows = new Array();
collide = new Collision();
HOLDER = new MovieClip();
firststart = new firststarts();
fuel = 100;
DEAD = false;
scoreTotal = 0;
fuelsUsed = 0;
CollectedUsed = 0;
topScore = 0;
MochiClip = new MovieClip();
ScoreSubbed = false;
magbutton = new magnobutton();
super();
addChild(firststart);
addEventListener(Event.ENTER_FRAME, myLoader);
addChild(MochiClip);
addChild(magbutton);
magbutton.addEventListener(MouseEvent.CLICK, openMagnoland);
firststart.Play_Button.visible = false;
firststart.playtext.visible = false;
firststart.playtext.mouseEnabled = false;
MochiServices.connect("dc0bda2b0215bf86", MochiClip);
MochiBot.track(this, "3abe5880");
MochiAd.showPreGameAd({clip:MochiClip, id:"dc0bda2b0215bf86", res:"400x500", background:0xD7D7D7, color:8640260, outline:0x9E9E9E, no_bg:true, ad_finished:showplay, ad_failed:showplay});
}
public function moveRoids(){
var _local1:int;
var _local2:*;
_local1 = 0;
while (_local1 < Roids.length) {
_local2 = Roids[_local1];
_local2.ymov = (_local2.ymov + 0.01);
if (_local2.ymov < -5){
_local2.ymov = -5;
} else {
if (_local2.ymov > 5){
_local2.ymov = 5;
};
};
_local2.y = (_local2.y + _local2.ymov);
_local2.x = (_local2.x + _local2.xmov);
_local2.rotation = (_local2.rotation + _local2.rotspeed);
if (Math.abs((_local2.y - Player.y)) > 700){
Roids.splice(_local1, 1);
R_Clip.removeChild(_local2);
_local2 = null;
};
_local1++;
};
}
public function moveFuels(){
var _local1:int;
var _local2:*;
var _local3:*;
var _local4:*;
_local1 = 0;
while (_local1 < FuelsA.length) {
_local2 = FuelsA[_local1];
_local2.ymov = (_local2.ymov + 0.01);
if (_local2.ymov < -5){
_local2.ymov = -5;
} else {
if (_local2.ymov > 5){
_local2.ymov = 5;
};
};
_local2.y = (_local2.y + _local2.ymov);
if (Math.abs((_local2.y - Player.y)) > 700){
FuelsA.splice(_local1, 1);
F_Clip.removeChild(_local2);
_local2 = null;
} else {
_local3 = Math.sqrt((((Player.x - _local2.x) * (Player.x - _local2.x)) + ((Player.y - _local2.y) * (Player.y - _local2.y))));
_local3 = Math.abs(Math.floor(_local3));
if (_local3 < 20){
fuel = (fuel + 25);
if (fuel > 100){
fuel = 100;
};
FuelsA.splice(_local1, 1);
F_Clip.removeChild(_local2);
_local2 = null;
_local4 = new sCollect().play();
CollectedUsed++;
};
};
_local1++;
};
}
public function CheckHits():void{
if (!CheckPlayerWalls((Player.x - 10), (Player.x + 10), Player.y, Player.y)){
killme("You hit the wall!");
} else {
if (!CheckPlayerWalls(Player.x, Player.x, (Player.y - 10), (Player.y + 10))){
killme("You hit the wall!");
} else {
if (HOLDER.y < -280){
killme("You hit the wall!");
};
};
};
}
public function Death(){
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = (5 * Math.cos((Math.random() * 360)));
_local2 = (5 * Math.sin((Math.random() * 360)));
_local3 = new Partical(_local2, _local1, (Math.random() * 20));
HOLDER.addChild(_local3);
Particals.push(_local3);
_local3.x = Player.x;
_local3.y = Player.y;
_local1 = (5 * Math.cos((Math.random() * 360)));
_local2 = (5 * Math.sin((Math.random() * 360)));
_local3 = new Partical(_local2, _local1, (Math.random() * 20));
HOLDER.addChild(_local3);
Particals.push(_local3);
_local3.x = Player.x;
_local3.y = Player.y;
_local1 = (5 * Math.cos((Math.random() * 360)));
_local2 = (5 * Math.sin((Math.random() * 360)));
_local3 = new Partical(_local2, _local1, (Math.random() * 20));
HOLDER.addChild(_local3);
Particals.push(_local3);
_local3.x = Player.x;
_local3.y = Player.y;
}
public function moveLava(){
removeChild(magbutton);
addChild(magbutton);
LavaC.y = (LavaC.y - 0.5);
if ((Player.y - LavaC.y) < -300){
LavaC.y = (Player.y + 299);
};
if (Player.y > LavaC.y){
killme("You landed in the lava!");
};
}
public function resartGame(_arg1:Event){
var _local2:*;
var _local3:*;
ScoreSubbed = false;
_local2 = new sClick().play();
removeChild(HOLDER);
removeChild(HUD);
removeChild(deathscreenC);
leftThrust = false;
rightThrust = false;
upThrust = false;
Player = null;
gravity = 0.5;
damp = 0.1;
thrust = 0;
rot = 0;
yVelocity = 0;
xVelocity = 0;
Particals = new Array();
Walls = new Array();
LeftWallx = 20;
LeftWally = 550;
tLeftWallx = 20;
tLeftWally = -50;
RightWallx = 360;
RightWally = 550;
tRightWallx = 380;
tRightWally = -50;
newScreen = new Bitmap();
newScreen2 = new Bitmap();
capture = new BitmapData(stage.stageWidth, stage.stageHeight, true, 4294967295);
S_Clip = new MovieClip();
C_Clip = new MovieClip();
P_Clip = new MovieClip();
R_Clip = new MovieClip();
Roids = new Array();
F_Clip = new MovieClip();
FuelsA = new Array();
YSquare = 0;
moveamount = 0;
Shadows = new Array();
HUD = null;
ThurstSound = null;
HOLDER = new MovieClip();
firststart = new firststarts();
mainMenu = null;
fuel = 100;
DEAD = false;
scoreTotal = 0;
fuelsUsed = 0;
CollectedUsed = 0;
LavaC = null;
deathscreenC = null;
startGame();
SoundMixer.stopAll();
if ((Math.random() * 100) > 55){
CurrentMusic = new sMusic_01().play(1, 99);
} else {
CurrentMusic = new sMusic_02().play(1, 99);
};
_local3 = CurrentMusic.soundTransform;
_local3.volume = 0.6;
CurrentMusic.soundTransform = _local3;
ThurstSound = new sThrust().play(0, 999);
_local3 = ThurstSound.soundTransform;
_local3.volume = 0;
ThurstSound.soundTransform = _local3;
}
public function youRoids(){
if (playerVroid()){
killme("You where hit by a rock!");
};
}
public function StartMenu(_arg1:MouseEvent){
var _local2:*;
var _local3:*;
_local2 = new sClick().play();
removeChild(firststart);
firststart = null;
mainMenu = new menu();
addChild(mainMenu);
mainMenu.Play_Button.buttonMode = true;
mainMenu.Play_Button.addEventListener(MouseEvent.CLICK, StartmeaGame);
SoundMixer.stopAll();
if ((Math.random() * 100) > 55){
CurrentMusic = new sMusic_01().play(1, 99);
} else {
CurrentMusic = new sMusic_02().play(1, 99);
};
_local3 = CurrentMusic.soundTransform;
_local3.volume = 0.6;
CurrentMusic.soundTransform = _local3;
ThurstSound = new sThrust().play(0, 999);
_local3 = ThurstSound.soundTransform;
_local3.volume = 0;
ThurstSound.soundTransform = _local3;
}
public function keyPressed(_arg1:KeyboardEvent):void{
var _local2:*;
if (_arg1.keyCode == 37){
leftThrust = true;
_local2 = ThurstSound.soundTransform;
_local2.volume = 1;
ThurstSound.soundTransform = _local2;
} else {
if (_arg1.keyCode == 38){
upThrust = true;
_local2 = ThurstSound.soundTransform;
_local2.volume = 1;
ThurstSound.soundTransform = _local2;
} else {
if (_arg1.keyCode == 39){
rightThrust = true;
_local2 = ThurstSound.soundTransform;
_local2.volume = 1;
ThurstSound.soundTransform = _local2;
};
};
};
}
public function StartmeaGame(_arg1:Event){
var _local2:*;
_local2 = new sClick().play();
removeChild(mainMenu);
startGame();
}
public function myLoader(_arg1:Event):void{
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Number;
_local2 = stage.loaderInfo.url;
_local3 = (_local2.indexOf("://") + 3);
_local4 = _local2.indexOf("/", _local3);
_local5 = _local2.substring(_local3, _local4);
if (framesLoaded == totalFrames){
firststart.Loading_txt.text = "Loading....100%";
firststart.Progress_bar.width = 250;
firststart.Play_Button.addEventListener(MouseEvent.CLICK, StartMenu);
removeEventListener(Event.ENTER_FRAME, myLoader);
gotoAndStop(3);
} else {
_local6 = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
_local6 = Math.round((_local6 * 100));
firststart.Loading_txt.text = (("Loading...." + _local6) + "%");
firststart.Progress_bar.width = Math.round(((250 / 100) * _local6));
};
}
public function makeWall(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
if (LeftWallx < 40){
_local5 = (LeftWallx + (Math.random() * 20));
} else {
if (LeftWallx > 0){
_local5 = (LeftWallx - (Math.random() * 20));
} else {
if ((Math.random() * 10) > 5){
_local5 = (LeftWallx - (Math.random() * 20));
} else {
_local5 = (LeftWallx + (Math.random() * 20));
};
};
};
_local1 = (LeftWally - 50);
_local2 = new Wall(LeftWallx, LeftWally, _local5, _local1, 1);
LeftWallx = _local5;
LeftWally = _local1;
HOLDER.addChild(_local2);
Walls.push(_local2);
if (RightWallx < 380){
_local6 = (RightWallx + (Math.random() * 20));
} else {
if (RightWallx > 340){
_local6 = (RightWallx - (Math.random() * 20));
} else {
if ((Math.random() * 10) > 5){
_local6 = (RightWallx - (Math.random() * 20));
} else {
_local6 = (RightWallx + (Math.random() * 20));
};
};
};
_local3 = (RightWally - 50);
_local2 = new Wall(RightWallx, RightWally, _local6, _local3, 0);
RightWallx = _local6;
RightWally = _local3;
HOLDER.addChild(_local2);
Walls.push(_local2);
_local4 = Walls.shift();
HOLDER.removeChild(_local4);
_local4 = Walls.shift();
HOLDER.removeChild(_local4);
makeRoid(1);
}
public function RunGame(_arg1:Event):void{
var _local2:int;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
if (fuel <= 0){
killme("You ran out of fuel");
};
if (DEAD){
Death();
countup();
} else {
CheckHits();
youRoids();
moveRoids();
moveLava();
moveFuels();
xVelocity = (xVelocity + (thrust * Math.sin((Player.rotation * (Math.PI / 180)))));
if (xVelocity < -45){
xVelocity = -45;
};
if (xVelocity > 45){
xVelocity = 45;
};
if (yVelocity < -45){
yVelocity = -45;
};
if (yVelocity > 45){
yVelocity = 45;
};
yVelocity = (yVelocity + ((thrust * Math.cos((Player.rotation * (Math.PI / 180)))) - gravity));
HOLDER.x = (HOLDER.x - (xVelocity * damp));
Player.x = (Player.x + (xVelocity * damp));
Player.xMov = (xVelocity * damp);
HOLDER.y = (HOLDER.y + (yVelocity * damp));
Player.y = (Player.y - (yVelocity * damp));
Player.yMov = (yVelocity * damp);
thrust = 0;
rot = (rot * 0.9);
Player.rotation = (Player.rotation + rot);
HUD.Tscore.text = String(topScore);
HUD.score.text = String((Number(HUD.score.text) + Math.round((yVelocity * damp))));
moveamount = (moveamount + (yVelocity * damp));
if (moveamount >= 50){
YSquare++;
makeWall();
moveamount = (moveamount - 50);
};
if (YSquare >= 8){
YSquare = 0;
_local3 = new fuelitem();
F_Clip.addChild(_local3);
_local3.x = ((Math.random() * 200) + 100);
_local3.y = (-30 - HOLDER.y);
FuelsA.push(_local3);
};
if (leftThrust){
rot = (rot - 0.7);
_local4 = Player.rotation;
_local4 = (_local4 - 40);
_local4 = (_local4 + ((Math.random() * 1) - (Math.random() * (1 * 2))));
_local4 = ((_local4 * Math.PI) / 180);
_local5 = (5 * Math.cos(_local4));
_local6 = (5 * Math.sin(_local4));
_local3 = new Partical(_local6, _local5, (Math.random() * 20));
HOLDER.addChild(_local3);
Particals.push(_local3);
_local3.x = Player.x;
_local3.y = Player.y;
_local3.rotation = Player.rotation;
};
if (rightThrust){
rot = (rot + 0.7);
_local4 = Player.rotation;
_local4 = (_local4 + 40);
_local4 = (_local4 + ((Math.random() * 1) - (Math.random() * (1 * 2))));
_local4 = ((_local4 * Math.PI) / 180);
_local5 = (5 * Math.cos(_local4));
_local6 = (5 * Math.sin(_local4));
_local3 = new Partical(_local6, _local5, (Math.random() * 20));
HOLDER.addChild(_local3);
Particals.push(_local3);
_local3.x = Player.x;
_local3.y = Player.y;
_local3.rotation = Player.rotation;
};
if (upThrust){
fuel = (fuel - 0.1);
HUD.fuelt.text = (Math.round(fuel) + "%");
HUD.fuelbar.height = (400 - Math.round((fuel * 4)));
fuelsUsed++;
thrust = 1.3;
_local4 = Player.rotation;
_local4 = (_local4 + ((Math.random() * 5) - (Math.random() * (5 * 2))));
_local4 = ((_local4 * Math.PI) / 180);
_local5 = (5 * Math.cos(_local4));
_local6 = (5 * Math.sin(_local4));
_local3 = new Partical(_local6, _local5, ((Math.random() * 10) + 10));
HOLDER.addChild(_local3);
Particals.push(_local3);
_local3.x = Player.x;
_local3.y = Player.y;
_local3.rotation = Player.rotation;
};
};
_local2 = 0;
while (_local2 < Particals.length) {
_local3 = Particals[_local2];
_local3.y = (_local3.y + _local3.yMov);
_local3.x = (_local3.x - _local3.xMov);
_local3.Life--;
if (_local3.Life <= 0){
HOLDER.removeChild(_local3);
Particals.splice(_local2, 1);
};
_local2++;
};
}
private function openMagnoland(_arg1:Event):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.magnoland.com?gameref=LunarLander");
navigateToURL(_local2, "_blank");
}
public function CheckRoidWall(_arg1, _arg2):Boolean{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:int;
var _local10:*;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:*;
var _local18:*;
var _local19:*;
var _local20:*;
var _local21:Number;
var _local22:Number;
var _local23:Number;
_local3 = (_arg1.x - _arg2[0]);
_local4 = (_arg1.x - _arg2[2]);
_local5 = (_arg1.y - _arg2[1]);
_local6 = (_arg1.y - _arg2[3]);
_local7 = true;
_local8 = Walls.length;
_local9 = _local8;
while (_local9 > 0) {
_local10 = Walls[(_local9 - 1)];
_local11 = (_local3 - _local4);
_local12 = (_local5 - _local6);
_local13 = (_local10.x2 - _local10.x1);
_local14 = (_local10.y2 - _local10.y1);
_local15 = (_local10.x1 - _local4);
_local16 = (_local6 - _local10.y1);
_local17 = (_local4 + (_local11 * 0.5));
_local18 = (_local6 + (_local12 * 0.5));
_local19 = (_local10.x1 + (_local13 * 0.5));
_local20 = (_local10.y1 + (_local14 * 0.5));
_local21 = (1 / ((_local11 * _local14) - (_local12 * _local13)));
_local22 = (((_local13 * _local16) + (_local14 * _local15)) * _local21);
_local23 = (((_local11 * _local16) + (_local12 * _local15)) * _local21);
if ((((((((_local23 > 0)) && ((_local23 < 1)))) && ((_local22 > 0)))) && ((_local22 < 1)))){
_local7 = false;
break;
};
_local9--;
};
if (_local7 == true){
return (true);
};
return (false);
}
public function makeRoid(_arg1){
var _local2:*;
_arg1 = (Math.random() * 100);
if (_arg1 > 50){
_local2 = new roid();
} else {
_local2 = new roid2();
};
R_Clip.addChild(_local2);
_local2.x = ((Math.random() * 200) + 100);
_local2.y = (-30 - HOLDER.y);
Roids.push(_local2);
}
public function playerVroid():Boolean{
var _local1:Rectangle;
var _local2:Point;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:ColorTransform;
var _local7:*;
var _local8:*;
var _local9:ColorTransform;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Rectangle;
_local1 = new Rectangle(0, 0, 250, 250);
_local2 = new Point(0, 0);
_local3 = new Matrix();
_local3.translate((Math.round(HOLDER.x) - 80), (Math.round(HOLDER.y) - 120));
_local4 = new BitmapData(_local1.width, _local1.height, true, 0xFFFFFF);
_local4.draw(R_Clip, _local3);
newScreen = new Bitmap(_local4);
_local5 = Bitmap(newScreen).bitmapData;
_local6 = new ColorTransform();
_local6.alphaMultiplier = 1;
_local6.greenOffset = 0xFF;
_local6.redOffset = 0xFF;
_local6.blueOffset = 0xFF;
_local4.colorTransform(_local1, _local6);
_local7 = new BitmapData(_local1.width, _local1.height, true, 0xFFFFFF);
_local7.draw(P_Clip, _local3);
newScreen2 = new Bitmap(_local7);
_local8 = Bitmap(newScreen2).bitmapData;
_local9 = new ColorTransform();
_local9.alphaMultiplier = 1;
_local9.greenOffset = 0xFF;
_local9.redOffset = 0xFF;
_local9.blueOffset = 0xFF;
_local7.colorTransform(_local1, _local9);
_local10 = 128;
_local5.merge(_local8, _local1, _local2, _local10, _local10, _local10, _local10);
_local11 = 0;
_local12 = 0x808080;
_local13 = _local5.getColorBoundsRect(_local12, _local12, false);
if ((((_local13.height > 0)) || ((_local13.width > 0)))){
return (true);
};
return (false);
}
public function killme(_arg1){
var _local2:*;
var _local3:*;
_local2 = new sDead().play();
_local3 = ThurstSound.soundTransform;
_local3.volume = 0;
ThurstSound.soundTransform = _local3;
DEAD = true;
leftThrust = false;
rightThrust = false;
upThrust = false;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyunPressed);
deathscreenC = new deathscreen();
addChild(deathscreenC);
deathscreenC.why.text = _arg1;
deathscreenC.refueld.text = String((("You refueled " + CollectedUsed) + " Times"));
deathscreenC.usedfuel.text = String((("You used " + fuelsUsed) + " gallons of fuel"));
deathscreenC.Play_Button.addEventListener(MouseEvent.CLICK, resartGame);
deathscreenC.Play_Button.buttonMode = true;
deathscreenC.Sum_Score.addEventListener(MouseEvent.CLICK, SumMyScore);
deathscreenC.moregames.addEventListener(MouseEvent.CLICK, openMagnoland);
deathscreenC.moregames.buttonMode = true;
removeChild(MochiClip);
addChild(MochiClip);
if (Number(HUD.score.text) > topScore){
topScore = Number(HUD.score.text);
};
HUD.Tscore.text = String(topScore);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed2);
}
public function startGame(){
var _local1:*;
var _local2:*;
var _local3:Shape;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
CollectedUsed = 0;
fuelsUsed = 0;
_local1 = new sStart().play();
DEAD = false;
HUD = new hud();
Player = new Lander();
addChild(HOLDER);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
stage.addEventListener(KeyboardEvent.KEY_UP, keyunPressed);
stage.addEventListener(Event.ENTER_FRAME, RunGame);
HOLDER.addChild(P_Clip);
P_Clip.addChild(Player);
HOLDER.addChild(S_Clip);
HOLDER.addChild(F_Clip);
Player.x = 200;
Player.y = 250;
_local2 = false;
_local3 = new Shape();
_local3.graphics.lineStyle(1, 0xFFFFFF, 1);
_local3.graphics.beginFill(0x222222);
_local3.graphics.moveTo((LeftWallx - 400), LeftWally);
_local3.graphics.lineTo((RightWallx + 400), RightWally);
_local3.graphics.endFill();
HOLDER.addChild(_local3);
while (!(_local2)) {
if (LeftWallx < 20){
_local7 = (LeftWallx + (Math.random() * 20));
} else {
if (LeftWallx < 0){
_local7 = (LeftWallx - (Math.random() * 20));
} else {
if ((Math.random() * 10) > 5){
_local7 = (LeftWallx - (Math.random() * 20));
} else {
_local7 = (LeftWallx + (Math.random() * 20));
};
};
};
_local4 = (LeftWally - 30);
_local5 = new Wall(LeftWallx, LeftWally, _local7, _local4, 1);
LeftWallx = _local7;
LeftWally = _local4;
HOLDER.addChild(_local5);
Walls.push(_local5);
if (RightWallx < 380){
_local8 = (RightWallx + (Math.random() * 20));
} else {
if (RightWallx < 340){
_local8 = (RightWallx - (Math.random() * 20));
} else {
if ((Math.random() * 10) > 5){
_local8 = (RightWallx - (Math.random() * 20));
} else {
_local8 = (RightWallx + (Math.random() * 20));
};
};
};
_local6 = (RightWally - 30);
_local5 = new Wall(RightWallx, RightWally, _local8, _local6, 0);
RightWallx = _local8;
RightWally = _local6;
HOLDER.addChild(_local5);
Walls.push(_local5);
if (LeftWally < -400){
_local2 = true;
};
};
LavaC = new lava();
HOLDER.addChild(LavaC);
LavaC.y = (LavaC.y + 400);
makeRoid(1);
makeRoid(2);
HOLDER.addChild(C_Clip);
addChild(newScreen);
addChild(newScreen2);
HOLDER.addChild(R_Clip);
addChild(HUD);
}
public function CheckPlayerWalls(_arg1, _arg2, _arg3, _arg4):Boolean{
var _local5:*;
var _local6:*;
var _local7:int;
var _local8:*;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:*;
var _local16:*;
var _local17:*;
var _local18:*;
var _local19:Number;
var _local20:Number;
var _local21:Number;
_local5 = true;
_local6 = Walls.length;
_local7 = _local6;
while (_local7 > 0) {
_local8 = Walls[(_local7 - 1)];
_local9 = (_arg1 - _arg2);
_local10 = (_arg3 - _arg4);
_local11 = (_local8.x2 - _local8.x1);
_local12 = (_local8.y2 - _local8.y1);
_local13 = (_local8.x1 - _arg2);
_local14 = (_arg4 - _local8.y1);
_local15 = (_arg2 + (_local9 * 0.5));
_local16 = (_arg4 + (_local10 * 0.5));
_local17 = (_local8.x1 + (_local11 * 0.5));
_local18 = (_local8.y1 + (_local12 * 0.5));
_local19 = (1 / ((_local9 * _local12) - (_local10 * _local11)));
_local20 = (((_local11 * _local14) + (_local12 * _local13)) * _local19);
_local21 = (((_local9 * _local14) + (_local10 * _local13)) * _local19);
if ((((((((_local21 > 0)) && ((_local21 < 1)))) && ((_local20 > 0)))) && ((_local20 < 1)))){
_local5 = false;
break;
};
_local7--;
};
if (_local5 == true){
return (true);
};
return (false);
}
public function SumMyScore(_arg1:Event){
if (!ScoreSubbed){
deathscreenC.Sum_Score.removeEventListener(MouseEvent.CLICK, SumMyScore);
deathscreenC.Sum_Score.alpha = 0.2;
MochiScores.showLeaderboard({boardID:"060511d3d5ea797b", score:Number(HUD.score.text)});
};
ScoreSubbed = true;
}
private function showplay():void{
firststart.Play_Button.visible = true;
firststart.Play_Button.buttonMode = true;
firststart.playtext.visible = true;
firststart.loadingtext.visible = false;
}
public function keyunPressed(_arg1:KeyboardEvent):void{
var _local2:*;
if (_arg1.keyCode == 37){
leftThrust = false;
} else {
if (_arg1.keyCode == 38){
upThrust = false;
} else {
if (_arg1.keyCode == 39){
rightThrust = false;
};
};
};
if (((((!(leftThrust)) && (!(rightThrust)))) && (!(upThrust)))){
_local2 = ThurstSound.soundTransform;
_local2.volume = 0;
ThurstSound.soundTransform = _local2;
};
}
public function keyPressed2(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 32){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed2);
resartGame(null);
};
}
public function countup(){
if (Number(deathscreenC.score_txt.text) < Number(HUD.score.text)){
deathscreenC.score_txt.text = (Number(deathscreenC.score_txt.text) + Math.round((Number(HUD.score.text) / 10)));
if (Number(deathscreenC.score_txt.text) > Number(HUD.score.text)){
deathscreenC.score_txt.text = Number(HUD.score.text);
};
if (Number(HUD.score.text) > topScore){
topScore = Number(HUD.score.text);
};
HUD.Tscore.text = String(topScore);
};
}
}
}//package
Section 13
//menu (menu)
package {
import flash.display.*;
public class menu extends MovieClip {
public var Play_Button:MovieClip;
}
}//package
Section 14
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.5");
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var sendHostProgress:Boolean;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
setTimeout(options.ad_finished, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 15
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 16
//Partical (Partical)
package {
import flash.display.*;
import flash.filters.*;
public class Partical extends MovieClip {
public var Life;// = 0
public var xMov;// = 0
public var yMov;// = 0
public function Partical(_arg1, _arg2, _arg3){
var _local4:GlowFilter;
xMov = 0;
yMov = 0;
Life = 0;
super();
xMov = _arg1;
yMov = _arg2;
Life = _arg3;
_local4 = new GlowFilter();
_local4.color = 0xFFFF00;
_local4.alpha = 1;
_local4.blurX = 10;
_local4.blurY = 10;
_local4.strength = 2;
_local4.quality = BitmapFilterQuality.LOW;
this.filters = [_local4];
}
}
}//package
Section 17
//roid (roid)
package {
import flash.display.*;
import flash.filters.*;
public class roid extends MovieClip {
public var ymov;
var nodes;
public var xmov;
public var rotspeed;
var lines;
public function roid(){
var _local1:Shape;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:GlowFilter;
nodes = new Array();
lines = new Array();
xmov = ((Math.random() * 5) / 20);
ymov = ((Math.random() * 5) / 20);
rotspeed = ((Math.random() * 5) / 10);
super();
_local1 = new Shape();
_local2 = (-20 - (Math.random() * 10));
_local3 = (20 + (Math.random() * 10));
_local4 = (20 + (Math.random() * 10));
_local5 = (-20 - (Math.random() * 10));
_local6 = (-30 - (Math.random() * 10));
_local7 = (20 + (Math.random() * 10));
_local8 = (10 + (Math.random() * 10));
_local9 = (-10 - (Math.random() * 10));
_local10 = (-20 - (Math.random() * 10));
_local11 = (-10 - (Math.random() * 10));
_local1.graphics.lineStyle(1, 11622657, 100);
_local1.graphics.beginFill(0x222222, 0.2);
_local1.graphics.moveTo(_local2, _local7);
_local1.graphics.lineTo(_local3, _local8);
_local1.graphics.lineTo(_local4, _local9);
_local1.graphics.lineTo(_local5, _local10);
_local1.graphics.lineTo(_local6, _local11);
_local1.graphics.lineTo(_local2, _local7);
_local1.graphics.endFill();
addChild(_local1);
_local12 = new GlowFilter();
_local12.color = 11622657;
_local12.alpha = 1;
_local12.blurX = 10;
_local12.blurY = 10;
_local12.strength = 2;
_local12.quality = BitmapFilterQuality.LOW;
_local1.filters = [_local12];
_local1 = null;
lines.push(new Array(_local2, _local7, _local3, _local8), new Array(_local3, _local8, _local4, _local9), new Array(_local4, _local9, _local5, _local10), new Array(_local5, _local10, _local6, _local11), new Array(_local6, _local11, _local2, _local7));
nodes.push(new Array(_local2, _local7), new Array(_local3, _local8), new Array(_local4, _local9), new Array(_local5, _local10), new Array(_local6, _local11));
}
}
}//package
Section 18
//roid2 (roid2)
package {
import flash.display.*;
import flash.filters.*;
public class roid2 extends MovieClip {
public var ymov;
var nodes;
public var xmov;
public var rotspeed;
var lines;
public function roid2(){
var _local1:Shape;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:GlowFilter;
nodes = new Array();
lines = new Array();
xmov = ((Math.random() * 20) / 20);
ymov = ((Math.random() * 10) / 20);
rotspeed = ((Math.random() * 10) / 10);
super();
_local1 = new Shape();
_local2 = -10;
_local3 = 10;
_local4 = 10;
_local5 = -10;
_local6 = -10;
_local7 = -10;
_local8 = 10;
_local9 = 10;
_local1.graphics.lineStyle(1, 0x663300, 100);
_local1.graphics.beginFill(0x222222, 0.2);
_local1.graphics.moveTo(_local2, _local6);
_local1.graphics.lineTo(_local3, _local7);
_local1.graphics.lineTo(_local4, _local8);
_local1.graphics.lineTo(_local5, _local9);
_local1.graphics.lineTo(_local2, _local6);
_local1.graphics.endFill();
addChild(_local1);
_local10 = new GlowFilter();
_local10.color = 0x663300;
_local10.alpha = 1;
_local10.blurX = 10;
_local10.blurY = 10;
_local10.strength = 2;
_local10.quality = BitmapFilterQuality.LOW;
_local1.filters = [_local10];
_local1 = null;
lines.push(new Array(_local2, _local6, _local3, _local7), new Array(_local3, _local7, _local4, _local8), new Array(_local4, _local8, _local5, _local9), new Array(_local5, _local9, _local2, _local6));
nodes.push(new Array(_local2, _local6), new Array(_local3, _local7), new Array(_local4, _local8), new Array(_local5, _local9));
}
}
}//package
Section 19
//sClick (sClick)
package {
import flash.media.*;
public dynamic class sClick extends Sound {
}
}//package
Section 20
//sCollect (sCollect)
package {
import flash.media.*;
public dynamic class sCollect extends Sound {
}
}//package
Section 21
//sDead (sDead)
package {
import flash.media.*;
public dynamic class sDead extends Sound {
}
}//package
Section 22
//sMusic_01 (sMusic_01)
package {
import flash.media.*;
public dynamic class sMusic_01 extends Sound {
}
}//package
Section 23
//sMusic_02 (sMusic_02)
package {
import flash.media.*;
public dynamic class sMusic_02 extends Sound {
}
}//package
Section 24
//sStart (sStart)
package {
import flash.media.*;
public dynamic class sStart extends Sound {
}
}//package
Section 25
//sThrust (sThrust)
package {
import flash.media.*;
public class sThrust extends Sound {
}
}//package
Section 26
//Wall (Wall)
package {
import flash.display.*;
import flash.filters.*;
public class Wall extends MovieClip {
public var y1;
public var x1;
public var x2;
public var y2;
public function Wall(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5){
var _local6:Shape;
var _local7:GlowFilter;
var _local8:Shape;
super();
x1 = _arg1;
x2 = _arg3;
y1 = _arg2;
y2 = _arg4;
if (_arg5 == 1){
_local8 = new Shape();
_local8.graphics.lineStyle(1, 0xFF0000, 0);
_local8.graphics.beginFill(0x999999, 0.3);
_local8.graphics.moveTo((_arg1 - 800), _arg2);
_local8.graphics.lineTo(_arg1, _arg2);
_local8.graphics.lineTo(_arg3, _arg4);
_local8.graphics.lineTo((_arg1 - 800), _arg4);
_local8.graphics.lineTo((_arg1 - 800), _arg2);
_local8.graphics.endFill();
} else {
_local8 = new Shape();
_local8.graphics.lineStyle(1, 0xFF0000, 0);
_local8.graphics.beginFill(0x999999, 0.3);
_local8.graphics.moveTo((_arg1 + 800), _arg2);
_local8.graphics.lineTo(_arg1, _arg2);
_local8.graphics.lineTo(_arg3, _arg4);
_local8.graphics.lineTo((_arg1 + 800), _arg4);
_local8.graphics.lineTo((_arg1 + 800), _arg2);
_local8.graphics.endFill();
};
addChild(_local8);
_local8 = null;
_local6 = new Shape();
_local6.graphics.lineStyle(1, 0xFFFFFF, 0.5);
_local6.graphics.moveTo(_arg1, _arg2);
_local6.graphics.lineTo(_arg3, _arg4);
addChild(_local6);
_local7 = new GlowFilter();
_local7.color = 0xFFFFFF;
_local7.alpha = 1;
_local7.blurX = 20;
_local7.blurY = 20;
_local7.strength = 2;
_local7.quality = BitmapFilterQuality.LOW;
_local6.filters = [_local7];
_local6 = null;
}
}
}//package