Section 1
//enemyBonus_mc_57 (magmafla2_fla.enemyBonus_mc_57)
package magmafla2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class enemyBonus_mc_57 extends MovieClip {
public var enemy_txt:TextField;
}
}//package magmafla2_fla
Section 2
//level_mc_59 (magmafla2_fla.level_mc_59)
package magmafla2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class level_mc_59 extends MovieClip {
public var level_txt:TextField;
}
}//package magmafla2_fla
Section 3
//lives_mc_60 (magmafla2_fla.lives_mc_60)
package magmafla2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class lives_mc_60 extends MovieClip {
public var lives_txt:TextField;
}
}//package magmafla2_fla
Section 4
//LOGO_YOUGAME_70 (magmafla2_fla.LOGO_YOUGAME_70)
package magmafla2_fla {
import flash.display.*;
public dynamic class LOGO_YOUGAME_70 extends MovieClip {
public function LOGO_YOUGAME_70(){
addFrameScript(197, frame198);
}
function frame198(){
MovieClip(parent).gotoAndStop("splash2");
}
}
}//package magmafla2_fla
Section 5
//score_mc_55 (magmafla2_fla.score_mc_55)
package magmafla2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class score_mc_55 extends MovieClip {
public var score_txt:TextField;
}
}//package magmafla2_fla
Section 6
//time_mc_56 (magmafla2_fla.time_mc_56)
package magmafla2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class time_mc_56 extends MovieClip {
public var time_txt:TextField;
}
}//package magmafla2_fla
Section 7
//MochiBot (mochi.MochiBot)
package mochi {
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);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_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 mochi
Section 8
//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 9
//MochiServices (mochi.MochiServices)
package mochi {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
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.31");
}
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 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 (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 10
//BlastCenter (BlastCenter)
package {
import flash.display.*;
public dynamic class BlastCenter extends MovieClip {
}
}//package
Section 11
//BlastX (BlastX)
package {
import flash.display.*;
import flash.events.*;
public class BlastX {
var y:Number;
var xTile:int;
var data:BitmapData;
var name:String;
var yTile:int;
var offSet:int;// = 0
var ts:int;
var x:Number;
var main:MovieClip;
var frame:int;// = 0
public function BlastX(_arg1:String, _arg2:Number, _arg3:Number, _arg4:MovieClip){
offSet = 0;
frame = 0;
super();
name = _arg1;
main = _arg4;
xTile = _arg2;
yTile = _arg3;
x = (xTile * main.ts);
y = (yTile * main.ts);
ts = main.ts;
main.pieces.push(this);
main.tiles[((("t_" + yTile) + "_") + xTile)].blast = true;
data = main.BXanimation[frame];
main.addEventListener(Event.ENTER_FRAME, update);
}
private function update(_arg1:Event):void{
if (frame < (main.BXanimation.length - 1)){
frame++;
data = main.BXanimation[frame];
} else {
main.tiles[((("t_" + yTile) + "_") + xTile)].blast = false;
main.removeEventListener(Event.ENTER_FRAME, update);
};
}
}
}//package
Section 12
//BlastY (BlastY)
package {
import flash.display.*;
import flash.events.*;
public class BlastY {
var y:Number;
var xTile:int;
var data:BitmapData;
var name:String;
var yTile:int;
var offSet:int;// = 0
var ts:int;
var x:Number;
var main:MovieClip;
var frame:int;// = 0
public function BlastY(_arg1:String, _arg2:Number, _arg3:Number, _arg4:MovieClip){
offSet = 0;
frame = 0;
super();
name = _arg1;
main = _arg4;
xTile = _arg2;
yTile = _arg3;
x = (xTile * main.ts);
y = (yTile * main.ts);
ts = main.ts;
main.pieces.push(this);
main.tiles[((("t_" + yTile) + "_") + xTile)].blast = true;
data = main.BYanimation[frame];
main.addEventListener(Event.ENTER_FRAME, updateY);
}
private function updateY(_arg1:Event):void{
if (frame < (main.BYanimation.length - 1)){
frame++;
data = main.BYanimation[frame];
} else {
main.tiles[((("t_" + yTile) + "_") + xTile)].blast = false;
main.removeEventListener(Event.ENTER_FRAME, updateY);
};
}
}
}//package
Section 13
//blueDoor (blueDoor)
package {
import flash.display.*;
public dynamic class blueDoor extends MovieClip {
}
}//package
Section 14
//blueDoorDone (blueDoorDone)
package {
import flash.display.*;
public dynamic class blueDoorDone extends MovieClip {
}
}//package
Section 15
//blueKey (blueKey)
package {
import flash.display.*;
public dynamic class blueKey extends MovieClip {
}
}//package
Section 16
//Bomb (Bomb)
package {
import flash.display.*;
import flash.events.*;
public class Bomb {
var main:MovieClip;
var animation:Array;
var tiles:Object;
var strength:int;
var name:String;
var count:int;
var boomSound:boom;
var data:BitmapData;
var frame:int;// = 0
var offSet:int;// = 0
var x:Number;
var y:Number;
var hero:Hero;
var ts:Number;
public function Bomb(_arg1:String, _arg2:Number, _arg3:Number, _arg4:int, _arg5:MovieClip){
frame = 0;
offSet = 0;
boomSound = new boom();
super();
name = _arg1;
main = _arg5;
hero = main.hero;
ts = main.ts;
x = _arg2;
y = _arg3;
strength = _arg4;
tiles = main.tiles;
animation = main.loop;
data = animation[frame];
main.addEventListener(Event.ENTER_FRAME, update);
}
public function update(_arg1:Event):void{
var _local2:int;
var _local3:*;
_local2 = 0;
while (_local2 < main.enemies.length) {
_local3 = main.enemies[_local2];
if ((((((Math.abs((hero.x - x)) > 32)) || ((Math.abs((hero.y - y)) > 32)))) && ((((Math.abs((_local3.x - x)) > 32)) || ((Math.abs((_local3.y - y)) > 32)))))){
tiles[((("t_" + Math.round((y / main.ts))) + "_") + Math.round((x / main.ts)))].walkable = false;
};
_local2++;
};
if (frame < (animation.length - 1)){
frame++;
} else {
if (animation == main.xplode){
main.removeEventListener(Event.ENTER_FRAME, update);
tiles[((("t_" + Math.round((y / main.ts))) + "_") + Math.round((x / main.ts)))].blast = false;
tiles[((("t_" + Math.round((y / main.ts))) + "_") + Math.round((x / main.ts)))].walkable = true;
} else {
animation = main.xplode;
explode();
frame = 0;
};
};
data = animation[frame];
}
private function explode():void{
var _local1:int;
var _local2:Number;
var _local3:BlastY;
var _local4:Number;
var _local5:Number;
var _local6:BlastX;
var _local7:Number;
boomSound.play();
_local1 = 0;
while (_local1 < strength) {
_local2 = Math.round(((((y - (main.ts * _local1)) - 1) - (ts * 0.5)) / ts));
if (tiles[((("t_" + _local2) + "_") + (x / ts))] != null){
if (tiles[((("t_" + _local2) + "_") + (x / ts))].walkable){
_local3 = new BlastY("blast", (x / ts), _local2, main);
} else {
if (tiles[((("t_" + _local2) + "_") + (x / ts))].destructable){
_local3 = new BlastY("blast", (x / ts), _local2, main);
if (tiles[((("t_" + _local2) + "_") + (x / ts))].item){
tiles[((("t_" + _local2) + "_") + (x / ts))].data = tiles[((("t_" + _local2) + "_") + (x / ts))].itemBmd;
} else {
tiles[((("t_" + _local2) + "_") + (x / ts))].data = main.emptyBmd;
};
tiles[((("t_" + _local2) + "_") + (x / ts))].walkable = true;
tiles[((("t_" + _local2) + "_") + (x / ts))].destructable = true;
break;
} else {
break;
};
};
};
_local1++;
};
_local1 = 0;
while (_local1 < strength) {
_local4 = Math.round((((((y + (main.ts * _local1)) + 1) + (ts * 0.5)) - 1) / ts));
if (tiles[((("t_" + _local4) + "_") + (x / ts))] != null){
if (tiles[((("t_" + _local4) + "_") + (x / ts))].walkable){
_local3 = new BlastY("blast", (x / ts), _local4, main);
} else {
if (tiles[((("t_" + _local4) + "_") + (x / ts))].destructable){
_local3 = new BlastY("blast", (x / ts), _local4, main);
if (tiles[((("t_" + _local4) + "_") + (x / ts))].item){
tiles[((("t_" + _local4) + "_") + (x / ts))].data = tiles[((("t_" + _local4) + "_") + (x / ts))].itemBmd;
} else {
tiles[((("t_" + _local4) + "_") + (x / ts))].data = main.emptyBmd;
};
tiles[((("t_" + _local4) + "_") + (x / ts))].walkable = true;
tiles[((("t_" + _local4) + "_") + (x / ts))].destructable = true;
break;
} else {
break;
};
};
};
_local1++;
};
_local1 = 0;
while (_local1 < strength) {
_local5 = Math.round((((((x + (main.ts * _local1)) + 1) + (ts * 0.5)) - 1) / ts));
if (tiles[((("t_" + (y / ts)) + "_") + _local5)] != null){
if (tiles[((("t_" + (y / ts)) + "_") + _local5)].walkable){
_local6 = new BlastX("blast", _local5, (y / ts), main);
} else {
if (tiles[((("t_" + (y / ts)) + "_") + _local5)].destructable){
_local6 = new BlastX("blast", _local5, (y / ts), main);
if (tiles[((("t_" + (y / ts)) + "_") + _local5)].item){
tiles[((("t_" + (y / ts)) + "_") + _local5)].data = tiles[((("t_" + (y / ts)) + "_") + _local5)].itemBmd;
} else {
tiles[((("t_" + (y / ts)) + "_") + _local5)].data = main.emptyBmd;
};
tiles[((("t_" + (y / ts)) + "_") + _local5)].walkable = true;
tiles[((("t_" + (y / ts)) + "_") + _local5)].destructable = true;
break;
} else {
break;
};
};
};
_local1++;
};
_local1 = 0;
while (_local1 < strength) {
_local7 = Math.round(((((x - (main.ts * _local1)) - 1) - (ts * 0.5)) / ts));
if (tiles[((("t_" + (y / ts)) + "_") + _local7)] != null){
if (tiles[((("t_" + (y / ts)) + "_") + _local7)].walkable){
_local6 = new BlastX("blast", _local7, (y / ts), main);
} else {
if (tiles[((("t_" + (y / ts)) + "_") + _local7)].destructable){
_local6 = new BlastX("blast", _local7, (y / ts), main);
if (tiles[((("t_" + (y / ts)) + "_") + _local7)].item){
tiles[((("t_" + (y / ts)) + "_") + _local7)].data = tiles[((("t_" + (y / ts)) + "_") + _local7)].itemBmd;
} else {
tiles[((("t_" + (y / ts)) + "_") + _local7)].data = main.emptyBmd;
};
tiles[((("t_" + (y / ts)) + "_") + _local7)].walkable = true;
tiles[((("t_" + (y / ts)) + "_") + _local7)].destructable = true;
break;
} else {
break;
};
};
};
_local1++;
};
tiles[((("t_" + Math.round((y / main.ts))) + "_") + Math.round((x / main.ts)))].blast = true;
main.shake();
frame = 0;
animation = main.xplode;
hero.bombing = false;
}
}
}//package
Section 17
//Bones (Bones)
package {
import flash.display.*;
public dynamic class Bones extends MovieClip {
}
}//package
Section 18
//boom (boom)
package {
import flash.media.*;
public dynamic class boom extends Sound {
}
}//package
Section 19
//Bush (Bush)
package {
import flash.display.*;
public dynamic class Bush extends MovieClip {
}
}//package
Section 20
//BX (BX)
package {
import flash.display.*;
public dynamic class BX extends MovieClip {
}
}//package
Section 21
//BY (BY)
package {
import flash.display.*;
public dynamic class BY extends MovieClip {
}
}//package
Section 22
//Cave (Cave)
package {
import flash.media.*;
public dynamic class Cave extends Sound {
}
}//package
Section 23
//China (China)
package {
import flash.media.*;
public dynamic class China extends Sound {
}
}//package
Section 24
//DaBomb (DaBomb)
package {
import flash.display.*;
public dynamic class DaBomb extends MovieClip {
}
}//package
Section 25
//en_1 (en_1)
package {
import flash.display.*;
public dynamic class en_1 extends MovieClip {
}
}//package
Section 26
//en_2 (en_2)
package {
import flash.display.*;
public dynamic class en_2 extends MovieClip {
}
}//package
Section 27
//en_3 (en_3)
package {
import flash.display.*;
public dynamic class en_3 extends MovieClip {
}
}//package
Section 28
//Enemy (Enemy)
package {
import flash.display.*;
import flash.geom.*;
public class Enemy {
var animation:Array;
var ts:Number;
var hitTimer:Number;// = 0
var name:String;
var up:Array;
var left:Array;
var down:Array;
var right:Array;
var curTile:Point;
var data:BitmapData;
var tile:Point;
var main:MovieClip;
var hitCount:int;
var xTile:int;
var yTile:int;
var empty:Array;
var speed:Number;
public var dead:Boolean;// = false
var dirY:int;
var frame:int;// = 0
var offSet:int;// = -3
var splooge;
public var y:Number;
var dirX:int;
public var x:Number;
public function Enemy(_arg1:String, _arg2:int, _arg3:int, _arg4:Number, _arg5:Number, _arg6:MovieClip, _arg7, _arg8:int){
var _local9:int;
var _local10:BitmapData;
offSet = -3;
up = new Array();
down = new Array();
left = new Array();
right = new Array();
empty = new Array();
frame = 0;
hitTimer = 0;
dead = false;
super();
splooge = new Splooge();
name = _arg1;
xTile = _arg2;
yTile = _arg3;
curTile = new Point(xTile, yTile);
tile = curTile;
speed = _arg4;
ts = _arg5;
main = _arg6;
hitCount = _arg8;
x = (xTile * main.ts);
y = (yTile * main.ts);
dirX = 1;
dirY = 0;
_local9 = 1;
while (_local9 < (_arg7.totalFrames + 1)) {
_local10 = new BitmapData(ts, 43, true, 0);
_arg7.gotoAndStop(_local9);
_local10.draw(_arg7);
if (_local9 < 21){
right.push(_local10);
};
if ((((_local9 > 20)) && ((_local9 < 41)))){
down.push(_local10);
};
if ((((_local9 > 40)) && ((_local9 < 61)))){
left.push(_local10);
};
if (_local9 > 60){
up.push(_local10);
};
_local9++;
};
empty.push(main.emptyBmd);
animation = right;
}
private function getMyCorners(_arg1:Number, _arg2:Number):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
_local3 = Math.round(((_arg2 - (ts * 0.5)) / main.ts));
_local4 = Math.round((((_arg2 + (ts * 0.5)) - 1) / main.ts));
_local5 = Math.round(((_arg1 - (ts * 0.5)) / main.ts));
_local6 = Math.round((((_arg1 + (ts * 0.5)) - 1) / main.ts));
_local7 = main.tiles[((("t_" + _local3) + "_") + _local5)].walkable;
_local8 = main.tiles[((("t_" + _local4) + "_") + _local5)].walkable;
_local9 = main.tiles[((("t_" + _local3) + "_") + _local6)].walkable;
_local10 = main.tiles[((("t_" + _local4) + "_") + _local6)].walkable;
if ((((((((_local7 == true)) && ((_local8 == true)))) && ((_local9 == true)))) && ((_local10 == true)))){
return (true);
};
return (false);
}
public function update():void{
var _local1:Number;
var _local2:Number;
if (!dead){
if (dirX != 0){
if (curTile.x == xTile){
if (getMyCorners((x + (dirX * speed)), (y + (dirY * speed)))){
move();
} else {
dirX = -(dirX);
if (main.tiles[((("t_" + (yTile - 1)) + "_") + xTile)].walkable){
if (Math.round((Math.random() * 2)) == 2){
dirY = -1;
dirX = 0;
};
};
if (((main.tiles[((("t_" + (yTile + 1)) + "_") + xTile)].walkable) && ((dirY == 0)))){
if (Math.round((Math.random() * 2)) == 2){
dirY = 1;
dirX = 0;
};
};
};
} else {
if (main.tiles[((("t_" + (yTile - 1)) + "_") + xTile)].walkable){
if (Math.round((Math.random() * 2)) == 2){
dirY = -1;
dirX = 0;
};
};
if (((main.tiles[((("t_" + (yTile + 1)) + "_") + xTile)].walkable) && ((dirY == 0)))){
if (Math.round((Math.random() * 2)) == 2){
dirY = 1;
dirX = 0;
};
};
curTile.x = xTile;
};
};
if (dirY != 0){
if (curTile.y == yTile){
if (getMyCorners((x + (dirX * speed)), (y + (dirY * speed)))){
move();
} else {
dirY = -(dirY);
if (main.tiles[((("t_" + yTile) + "_") + (xTile + 1))].walkable){
if (Math.round((Math.random() * 2)) == 2){
dirX = 1;
dirY = 0;
};
};
if (((main.tiles[((("t_" + yTile) + "_") + (xTile - 1))].walkable) && ((dirX == 0)))){
if (Math.round((Math.random() * 2)) == 2){
dirX = 1;
dirY = 0;
};
};
};
} else {
if (main.tiles[((("t_" + yTile) + "_") + (xTile + 1))].walkable){
if (Math.round((Math.random() * 2)) == 2){
dirX = 1;
dirY = 0;
};
};
if (((main.tiles[((("t_" + yTile) + "_") + (xTile - 1))].walkable) && ((dirX == 0)))){
if (Math.round((Math.random() * 2)) == 2){
dirX = 1;
dirY = 0;
};
};
curTile.y = yTile;
};
};
if (dirX == 1){
animation = right;
};
if (dirX == -1){
animation = left;
};
if (dirY == 1){
animation = down;
};
if (dirY == -1){
animation = up;
};
if (((!((dirY == 0))) || (!((dirX == 0))))){
animate();
};
if ((((dirX == 0)) && (!((dirY == 0))))){
_local1 = ((xTile * main.ts) - x);
x = (x + (_local1 * 0.5));
if (Math.abs(_local1) > 1){
animate();
};
};
if ((((dirY == 0)) && (!((dirX == 0))))){
_local2 = ((yTile * main.ts) - y);
y = (y + (_local2 * 0.5));
if (Math.abs(_local2) > 1){
animate();
};
};
if ((((xTile == main.hero.xTile)) && ((yTile == main.hero.yTile)))){
main.lives--;
main.hero.strength = 1;
splooge.play();
main.bIcon.visible = false;
main.rIcon.visible = false;
main.gIcon.visible = false;
main.tranz();
};
if (((main.tiles[((("t_" + yTile) + "_") + xTile)].blast) && ((hitTimer < 0)))){
hitTimer = 30;
hitCount--;
splooge.play();
};
hitTimer--;
if ((((hitCount == 0)) && (!(dead)))){
main.score = (main.score + 500);
dead = true;
main.killScore++;
};
};
if (!dead){
data = animation[frame];
} else {
data = main.emptyBmd;
};
}
private function move():void{
x = (x + (dirX * speed));
y = (y + (dirY * speed));
xTile = Math.round((x / main.ts));
yTile = Math.round((y / main.ts));
}
private function animate():void{
if (frame < (animation.length - 1)){
frame++;
} else {
frame = 0;
};
}
}
}//package
Section 29
//Grass (Grass)
package {
import flash.display.*;
public dynamic class Grass extends MovieClip {
}
}//package
Section 30
//Gravel (Gravel)
package {
import flash.display.*;
public dynamic class Gravel extends MovieClip {
}
}//package
Section 31
//greenDoor (greenDoor)
package {
import flash.display.*;
public dynamic class greenDoor extends MovieClip {
}
}//package
Section 32
//greenDoorDone (greenDoorDone)
package {
import flash.display.*;
public dynamic class greenDoorDone extends MovieClip {
}
}//package
Section 33
//greenKey (greenKey)
package {
import flash.display.*;
public dynamic class greenKey extends MovieClip {
}
}//package
Section 34
//Happy (Happy)
package {
import flash.media.*;
public dynamic class Happy extends Sound {
}
}//package
Section 35
//Hero (Hero)
package {
import flash.display.*;
import flash.ui.*;
public class Hero {
var bombing:Boolean;// = false
var green:Boolean;// = false
var animation:Array;
var name:String;
var red:Boolean;// = false
var up:Array;
var right:Array;
var left:Array;
var down:Array;
var pickUp;
var hasGreenKey:Boolean;// = false
var data:BitmapData;
var hasBlueKey:Boolean;// = false
var thunkSound;
var main:MovieClip;
public var strength:int;// = 1
public var xTile:int;
public var yTile:int;
var hasRedKey:Boolean;// = false
var speed:Number;
var player;
var blue:Boolean;// = false
public var dirX:int;
public var dirY:int;
var frame:int;// = 0
var splooge;
public var x:Number;
public var y:Number;
var ts:Number;
public function Hero(_arg1:String, _arg2:Number, _arg3:MovieClip){
var _local4:int;
var _local5:BitmapData;
up = new Array();
down = new Array();
left = new Array();
right = new Array();
frame = 0;
hasRedKey = false;
hasGreenKey = false;
hasBlueKey = false;
red = false;
green = false;
blue = false;
strength = 1;
bombing = false;
super();
player = new Player();
thunkSound = new thunk();
pickUp = new PickUp();
splooge = new Splooge();
name = _arg1;
ts = _arg2;
main = _arg3;
reset();
_local4 = 1;
while (_local4 < (player.totalFrames + 1)) {
_local5 = new BitmapData(32, 45, true, 0);
player.gotoAndStop(_local4);
_local5.draw(player);
if (_local4 < 13){
right.push(_local5);
};
if ((((_local4 > 12)) && ((_local4 < 25)))){
down.push(_local5);
};
if ((((_local4 > 24)) && ((_local4 < 37)))){
left.push(_local5);
};
if (_local4 > 36){
up.push(_local5);
};
_local4++;
};
animation = right;
}
private function getMyCorners(_arg1:Number, _arg2:Number):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
_local3 = Math.round(((_arg2 - (ts * 0.5)) / main.ts));
_local4 = Math.round((((_arg2 + (ts * 0.5)) - 1) / main.ts));
_local5 = Math.round(((_arg1 - (ts * 0.5)) / main.ts));
_local6 = Math.round((((_arg1 + (ts * 0.5)) - 1) / main.ts));
_local7 = main.tiles[((("t_" + _local3) + "_") + _local5)].walkable;
_local8 = main.tiles[((("t_" + _local4) + "_") + _local5)].walkable;
_local9 = main.tiles[((("t_" + _local3) + "_") + _local6)].walkable;
_local10 = main.tiles[((("t_" + _local4) + "_") + _local6)].walkable;
if ((((((((_local7 == true)) && ((_local8 == true)))) && ((_local9 == true)))) && ((_local10 == true)))){
return (true);
};
return (false);
}
private function createBomb():void{
var _local1:Bomb;
bombing = true;
_local1 = new Bomb("bomb", (xTile * main.ts), (yTile * main.ts), strength, main);
main.pieces.push(_local1);
}
public function update():void{
var _local1:Number;
var _local2:Number;
if (Key.isDown(Keyboard.UP)){
dirX = 0;
dirY = -1;
animation = up;
} else {
if (Key.isDown(Keyboard.DOWN)){
dirX = 0;
dirY = 1;
animation = down;
} else {
if (Key.isDown(Keyboard.LEFT)){
dirX = -1;
dirY = 0;
animation = left;
} else {
if (Key.isDown(Keyboard.RIGHT)){
dirX = 1;
dirY = 0;
animation = right;
} else {
dirX = 0;
dirY = 0;
};
};
};
};
if (getMyCorners((x + (dirX * speed)), (y + (dirY * speed)))){
move();
} else {
if (dirX != 0){
x = ((xTile * main.ts) + ((dirX * (main.ts - ts)) * 0.5));
} else {
y = ((yTile * main.ts) + ((dirY * (main.ts - ts)) * 0.5));
};
};
if (((Key.isDown(Keyboard.SPACE)) && (!(bombing)))){
createBomb();
};
data = animation[frame];
if (((!((dirY == 0))) || (!((dirX == 0))))){
animate();
};
if ((((dirX == 0)) && (!((dirY == 0))))){
_local1 = ((xTile * main.ts) - x);
x = (x + (_local1 * 0.5));
if (Math.abs(_local1) > 1){
animate();
};
};
if ((((dirY == 0)) && (!((dirX == 0))))){
_local2 = ((yTile * main.ts) - y);
y = (y + (_local2 * 0.5));
if (Math.abs(_local2) > 1){
animate();
};
};
if (main.tiles[((("t_" + yTile) + "_") + xTile)].item){
if (main.tiles[((("t_" + yTile) + "_") + xTile)].itemName == "powerUp"){
strength++;
pickUp.play();
main.tiles[((("t_" + yTile) + "_") + xTile)].data = main.emptyBmd;
main.tiles[((("t_" + yTile) + "_") + xTile)].item = false;
};
if (main.tiles[((("t_" + yTile) + "_") + xTile)].itemName == "redKey"){
hasRedKey = true;
main.rIcon.alpha = 1;
main.rIcon.visible = true;
pickUp.play();
main.tiles[((("t_" + 6) + "_") + 8)].walkable = true;
main.tiles[((("t_" + yTile) + "_") + xTile)].data = main.emptyBmd;
main.tiles[((("t_" + yTile) + "_") + xTile)].item = false;
};
if (main.tiles[((("t_" + yTile) + "_") + xTile)].itemName == "greenKey"){
hasGreenKey = true;
main.gIcon.alpha = 1;
main.gIcon.visible = true;
pickUp.play();
main.tiles[((("t_" + 6) + "_") + 10)].walkable = true;
main.tiles[((("t_" + yTile) + "_") + xTile)].data = main.emptyBmd;
main.tiles[((("t_" + yTile) + "_") + xTile)].item = false;
};
if (main.tiles[((("t_" + yTile) + "_") + xTile)].itemName == "blueKey"){
hasBlueKey = true;
main.bIcon.alpha = 1;
main.bIcon.visible = true;
pickUp.play();
main.tiles[((("t_" + 6) + "_") + 12)].walkable = true;
main.tiles[((("t_" + yTile) + "_") + xTile)].data = main.emptyBmd;
main.tiles[((("t_" + yTile) + "_") + xTile)].item = false;
};
if ((((main.tiles[((("t_" + yTile) + "_") + xTile)].itemName == "redDoor")) && (hasRedKey))){
main.tiles[((("t_" + yTile) + "_") + xTile)].item = false;
main.tiles[((("t_" + yTile) + "_") + xTile)].data = main.redClosedBmd;
main.tiles[((("t_" + yTile) + "_") + xTile)].offSet = -4;
thunkSound.play();
red = true;
};
if ((((main.tiles[((("t_" + yTile) + "_") + xTile)].itemName == "greenDoor")) && (hasGreenKey))){
main.tiles[((("t_" + yTile) + "_") + xTile)].item = false;
main.tiles[((("t_" + yTile) + "_") + xTile)].data = main.greenClosedBmd;
main.tiles[((("t_" + yTile) + "_") + xTile)].offSet = -4;
thunkSound.play();
green = true;
};
if ((((main.tiles[((("t_" + yTile) + "_") + xTile)].itemName == "blueDoor")) && (hasBlueKey))){
main.tiles[((("t_" + yTile) + "_") + xTile)].item = false;
main.tiles[((("t_" + yTile) + "_") + xTile)].data = main.blueClosedBmd;
main.tiles[((("t_" + yTile) + "_") + xTile)].offSet = -4;
thunkSound.play();
blue = true;
};
};
if (((((blue) && (red))) && (green))){
main.levelUp();
};
if (main.tiles[((("t_" + yTile) + "_") + xTile)].blast){
main.lives--;
main.bIcon.visible = false;
main.rIcon.visible = false;
main.gIcon.visible = false;
splooge.play();
strength = 1;
main.tranz();
};
}
public function reset():void{
xTile = 1;
yTile = 1;
x = (xTile * main.ts);
y = (yTile * main.ts);
speed = 4;
hasRedKey = false;
hasGreenKey = false;
hasBlueKey = false;
red = false;
green = false;
blue = false;
}
private function move():void{
x = (x + (dirX * speed));
y = (y + (dirY * speed));
xTile = Math.round((x / main.ts));
yTile = Math.round((y / main.ts));
}
private function animate():void{
if (frame < (animation.length - 1)){
frame++;
} else {
frame = 0;
};
}
}
}//package
Section 36
//iface (iface)
package {
import flash.display.*;
public dynamic class iface extends MovieClip {
public var howBtn:MovieClip;
public var playBtn:MovieClip;
public function iface(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
stop();
}
function frame20(){
stop();
}
}
}//package
Section 37
//Key (Key)
package {
import flash.display.*;
import flash.events.*;
public class Key {
private static var initialized:Boolean = false;
private static var keysDown:Object = new Object();
public static function initialize(_arg1:Stage){
if (!initialized){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
_arg1.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
private static function clearKeys(_arg1:Event):void{
keysDown = new Object();
}
public static function isDown(_arg1:uint):Boolean{
if (!initialized){
throw (new Error("Key class has yet been initialized."));
};
return (Boolean((_arg1 in keysDown)));
}
private static function keyPressed(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = true;
}
private static function keyReleased(_arg1:KeyboardEvent):void{
if ((_arg1.keyCode in keysDown)){
delete keysDown[_arg1.keyCode];
};
}
}
}//package
Section 38
//Lantern (Lantern)
package {
import flash.display.*;
public dynamic class Lantern extends MovieClip {
}
}//package
Section 39
//Log (Log)
package {
import flash.display.*;
public dynamic class Log extends MovieClip {
}
}//package
Section 40
//Main (Main)
package {
import flash.display.*;
import flash.events.*;
import mochi.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.filters.*;
public dynamic class Main extends MovieClip {
public var bIcon:blueKey;
public var rIcon:redKey;
var myMap:Array;
var lanternBmd:BitmapData;
public var lbar:MovieClip;
var enemies:Array;
var emptyTiles:Array;
public var xplode:Array;
var e3Num:int;// = 0
var tango;
public var b;
public var iFace:iface;
var greenDoorBmd:BitmapData;
var e3;
var bushBmd:BitmapData;
var mapH:int;
var e2;
var sandBmd:BitmapData;
var mapW:int;
var ts:Number;// = 32
var destructables:Array;
var screen:BitmapData;
var shroom2Bmd:BitmapData;
var e1;
var redKeyBmd:BitmapData;
var score:int;// = 0
public var loop:Array;
var shroomBmd:BitmapData;
var showingAds:Boolean;// = false
var greenClosedBmd:BitmapData;
var bonesBmd:BitmapData;
var time:int;// = 250
var powerUpBmd:BitmapData;
var happy;
var redClosedBmd:BitmapData;
var bgMusic:Sound;
var emptyBmd:BitmapData;
var gravelBmd:BitmapData;
var myTimer:Timer;
public var BYanimation:Array;
var lives:int;// = 0
var shakeScreen:Boolean;// = false
var redDoorBmd:BitmapData;
var tName:String;
var bgBmd:BitmapData;
var paversBmd:BitmapData;
var blueDoorBmd:BitmapData;
var blueClosedBmd:BitmapData;
public var blastCounter:int;// = 1
var newBgBmd:BitmapData;
public var score_txt:TextField;
var pieces:Array;
var count:int;
var heroBmd:BitmapData;
var transition;
var china;
public var lpc:TextField;
var enemiesBmd:BitmapData;
var numBricks:int;// = 40
var e1Num:int;// = 3
var greenKeyBmd:BitmapData;
var brickBmd:BitmapData;
public var cache:MovieClip;
var level:int;// = 1
var tiles:Object;
public var gIcon:greenKey;
var logBmd:BitmapData;
var cave;
var blockBmd:BitmapData;
var totalScore:int;
var blueKeyBmd:BitmapData;
var rockBmd:BitmapData;
var e2Num:int;// = 0
var killScore:int;// = 0
var goodJob:Boolean;// = false
var grassBmd:BitmapData;
var tikiBmd:BitmapData;
public var BXanimation:Array;
var pillarBmd:BitmapData;
var hero;
public var time_txt:TextField;
public function Main(){
tiles = new Object();
ts = 32;
numBricks = 40;
pieces = new Array();
emptyTiles = new Array();
destructables = new Array();
shroomBmd = new BitmapData(ts, ts, true, 0);
shroom2Bmd = new BitmapData(ts, ts, true, 0);
logBmd = new BitmapData(ts, ts, true, 0);
pillarBmd = new BitmapData(ts, ts, true, 0);
bushBmd = new BitmapData(ts, ts, true, 0);
bonesBmd = new BitmapData(ts, ts, true, 0);
rockBmd = new BitmapData(ts, ts, true, 0);
tikiBmd = new BitmapData(ts, ts, true, 0);
lanternBmd = new BitmapData(ts, ts, true, 0);
brickBmd = new BitmapData(ts, ts, true, 0);
blockBmd = new BitmapData(ts, ts, true, 0);
redKeyBmd = new BitmapData(ts, ts, true, 0);
greenKeyBmd = new BitmapData(ts, ts, true, 0);
blueKeyBmd = new BitmapData(ts, ts, true, 0);
redDoorBmd = new BitmapData(ts, ts, true, 0);
greenDoorBmd = new BitmapData(ts, ts, true, 0);
blueDoorBmd = new BitmapData(ts, ts, true, 0);
redClosedBmd = new BitmapData(ts, 36, true, 0);
greenClosedBmd = new BitmapData(ts, 36, true, 0);
blueClosedBmd = new BitmapData(ts, 36, true, 0);
powerUpBmd = new BitmapData(ts, ts, true, 0);
emptyBmd = new BitmapData(ts, ts, true, 0);
screen = new BitmapData(672, 448, true, 0);
bgBmd = new BitmapData(672, 448);
newBgBmd = new BitmapData(672, 448);
grassBmd = new BitmapData(672, 448);
paversBmd = new BitmapData(672, 448);
sandBmd = new BitmapData(672, 448);
gravelBmd = new BitmapData(672, 448);
heroBmd = new BitmapData(672, 448, true, 0);
enemies = new Array();
enemiesBmd = new BitmapData(672, 448, true, 0);
e1Num = 3;
e2Num = 0;
e3Num = 0;
showingAds = false;
time = 250;
shakeScreen = false;
myTimer = new Timer(1000, 0);
level = 1;
score = 0;
totalScore = score;
killScore = 0;
lives = 0;
goodJob = false;
loop = new Array();
xplode = new Array();
BYanimation = new Array();
BXanimation = new Array();
blastCounter = 1;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 6, frame7, 13, frame14, 24, frame25);
}
private function buildMap():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Tile;
var _local5:*;
var _local6:int;
var _local7:*;
_local1 = 0;
while (_local1 < mapH) {
_local3 = 0;
while (_local3 < mapW) {
tName = ((("t_" + _local1) + "_") + _local3);
tiles[tName] = new Tile(tName, (_local3 * ts), (_local1 * ts));
_local4 = tiles[tName];
_local4.ts = ts;
_local4.offSet = 0;
_local5 = myMap[_local1][_local3];
if (_local5 == 0){
_local4.walkable = false;
_local4.destructable = false;
if (blockBmd == shroomBmd){
if (Math.random() > 0.5){
_local4.data = shroomBmd;
} else {
_local4.data = shroom2Bmd;
};
} else {
_local4.data = blockBmd;
};
} else {
if (_local5 == 1){
_local4.destructable = false;
_local4.walkable = true;
_local4.data = emptyBmd;
if ((_local3 + _local1) > 3){
emptyTiles.push(_local4);
};
} else {
if (_local5 == 2){
_local4.walkable = false;
_local4.destructable = false;
_local4.data = redDoorBmd;
_local4.item = true;
_local4.itemName = "redDoor";
} else {
if (_local5 == 3){
_local4.walkable = false;
_local4.destructable = false;
_local4.data = greenDoorBmd;
_local4.item = true;
_local4.itemName = "greenDoor";
} else {
if (_local5 == 4){
_local4.walkable = false;
_local4.destructable = false;
_local4.data = blueDoorBmd;
_local4.item = true;
_local4.itemName = "blueDoor";
};
};
};
};
};
pieces.push(_local4);
_local3++;
};
_local1++;
};
_local2 = 0;
while (_local2 < numBricks) {
_local6 = Math.round((Math.random() * (emptyTiles.length - 1)));
_local7 = emptyTiles[_local6];
_local7.destructable = true;
_local7.walkable = false;
_local7.data = brickBmd;
destructables.push(_local7);
emptyTiles.splice(_local6, 1);
_local2++;
};
bgBmd = newBgBmd;
}
function frame14(){
stop();
b = this;
MochiAd.showPreGameAd({id:"60fa3eed898436f3", res:"672x448", clip:this, ad_finished:function (){
gotoAndStop("menu");
}});
}
function frame2(){
gotoAndStop(4);
}
function frame4(){
stop();
init();
}
function frame7(){
stop();
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, loading);
MochiBot.track(this, "25029914");
MochiServices.connect("60fa3eed898436f3", this);
}
function frame3(){
removeChild(cache);
cache = null;
}
public function run():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:*;
goodJob = false;
if (lives >= 0){
reset();
_local1 = 0;
while (_local1 < e1Num) {
_local4 = Math.round((Math.random() * (emptyTiles.length - 1)));
_local5 = new Enemy("e", Math.round((emptyTiles[_local4].x / ts)), Math.round((emptyTiles[_local4].y / ts)), 2, 24, this, e1, 1);
emptyTiles.splice(_local4, 1);
enemies.push(_local5);
_local1++;
};
_local2 = 0;
while (_local2 < e2Num) {
_local4 = Math.round((Math.random() * (emptyTiles.length - 1)));
_local5 = new Enemy("e", Math.round((emptyTiles[_local4].x / ts)), Math.round((emptyTiles[_local4].y / ts)), 4, 24, this, e2, 1);
emptyTiles.splice(_local4, 1);
enemies.push(_local5);
_local2++;
};
_local3 = 0;
while (_local3 < e3Num) {
_local4 = Math.round((Math.random() * (emptyTiles.length - 1)));
_local5 = new Enemy("e", Math.round((emptyTiles[_local4].x / ts)), Math.round((emptyTiles[_local4].y / ts)), 2, 24, this, e3, 2);
emptyTiles.splice(_local4, 1);
enemies.push(_local5);
_local3++;
};
addEventListener(Event.ENTER_FRAME, update);
myTimer.start();
bgMusic.play(0, 999);
score_txt.text = ("Score: " + totalScore);
score_txt.visible = true;
time_txt.text = ("Time: " + time);
time_txt.visible = true;
};
}
public function tranz():void{
SoundMixer.stopAll();
removeEventListener(Event.ENTER_FRAME, update);
myTimer.stop();
score_txt.visible = false;
time_txt.visible = false;
transition.gotoAndPlay("fadeOut");
}
private function update(_arg1:Event):void{
var _local2:int;
var _local3:Enemy;
hero.update();
_local2 = 0;
while (_local2 < enemies.length) {
_local3 = enemies[_local2];
_local3.update();
_local2++;
};
render();
}
public function levelUp1():void{
trace("level up");
tranz();
goodJob = true;
level++;
if (level == 6){
newBgBmd = paversBmd;
brickBmd = bushBmd;
blockBmd = pillarBmd;
bgMusic = tango;
};
if (level == 11){
newBgBmd = sandBmd;
brickBmd = lanternBmd;
blockBmd = tikiBmd;
bgMusic = china;
lives++;
};
if (level == 16){
newBgBmd = gravelBmd;
brickBmd = bonesBmd;
blockBmd = rockBmd;
bgMusic = cave;
};
switch (level){
case 1:
numBricks = 40;
e1Num = 3;
e2Num = 0;
e3Num = 0;
break;
case 2:
numBricks = 50;
e1Num = 4;
e2Num = 0;
e3Num = 0;
break;
case 3:
numBricks = 60;
e1Num = 5;
e2Num = 0;
e3Num = 0;
break;
case 4:
numBricks = 70;
e1Num = 6;
e2Num = 0;
e3Num = 0;
break;
case 5:
numBricks = 80;
e1Num = 7;
e2Num = 0;
e3Num = 0;
break;
case 6:
numBricks = 55;
e1Num = 2;
e2Num = 2;
e3Num = 0;
break;
case 7:
numBricks = 65;
e1Num = 2;
e2Num = 3;
e3Num = 0;
break;
case 8:
numBricks = 75;
e1Num = 3;
e2Num = 3;
e3Num = 0;
break;
case 9:
numBricks = 85;
e1Num = 3;
e2Num = 4;
e3Num = 0;
break;
case 10:
numBricks = 95;
e1Num = 4;
e2Num = 4;
e3Num = 0;
break;
case 11:
numBricks = 70;
e1Num = 2;
e2Num = 2;
e3Num = 1;
break;
case 12:
numBricks = 80;
e1Num = 2;
e2Num = 2;
e3Num = 2;
break;
case 13:
numBricks = 90;
e1Num = 2;
e2Num = 3;
e3Num = 2;
case 14:
numBricks = 100;
e1Num = 2;
e2Num = 3;
e3Num = 3;
break;
case 15:
numBricks = 110;
e1Num = 3;
e2Num = 3;
e3Num = 3;
break;
case 16:
numBricks = 85;
e1Num = 2;
e2Num = 2;
e3Num = 2;
break;
case 17:
numBricks = 95;
e1Num = 2;
e2Num = 3;
e3Num = 2;
break;
case 18:
numBricks = 105;
e1Num = 3;
e2Num = 3;
e3Num = 2;
break;
case 19:
numBricks = 115;
e1Num = 3;
e2Num = 3;
e3Num = 3;
break;
case 20:
numBricks = 125;
e1Num = 3;
e2Num = 3;
e3Num = 4;
break;
};
score = (score + ((250 - time) * 50));
totalScore = (totalScore + score);
}
function frame25(){
trace(".......................menu2....................................................");
gotoAndStop("menu");
}
function init():void{
var bm:Bitmap;
var b:*;
var i:int;
var by:*;
var j:int;
var bx:MovieClip;
var k:int;
var b1c:Function;
var b2c:Function;
var b3c:Function;
var bmd:BitmapData;
b1c = function (_arg1:MouseEvent){
var url:String;
var request:URLRequest;
var me = _arg1;
url = "http://www.yougame.com";
request = new URLRequest(url);
try {
navigateToURL(request, "_top");
} catch(e:Error) {
trace("Error occurred!");
};
};
b2c = function (_arg1:MouseEvent){
var me = _arg1;
MochiScores.showLeaderboard({boardID:"a2e7e4b90e915334", onClose:function (){
}});
};
b3c = function (_arg1:MouseEvent){
var url:String;
var request:URLRequest;
var me = _arg1;
url = "http://www.yougame.com";
request = new URLRequest(url);
try {
navigateToURL(request, "_top");
} catch(e:Error) {
trace("Error occurred!");
};
};
Key.initialize(stage);
myMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 2, 1, 3, 1, 4, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mapW = myMap[0].length;
mapH = myMap.length;
bm = new Bitmap(screen);
bm.cacheAsBitmap = true;
bm.y = 32;
addChild(bm);
e1 = new en_1();
e2 = new en_2();
e3 = new en_3();
hero = new Hero("hero", 24, this);
grassBmd.draw(new Grass());
sandBmd.draw(new Sand());
paversBmd.draw(new Pavers());
gravelBmd.draw(new Gravel());
shroomBmd.draw(new Shroom());
shroom2Bmd.draw(new Shroom2());
logBmd.draw(new Log());
pillarBmd.draw(new Pillar());
bushBmd.draw(new Bush());
bonesBmd.draw(new Bones());
rockBmd.draw(new Rock());
tikiBmd.draw(new Tiki());
lanternBmd.draw(new Lantern());
powerUpBmd.draw(new powerUp());
redKeyBmd.draw(new redKey());
greenKeyBmd.draw(new greenKey());
blueKeyBmd.draw(new blueKey());
redDoorBmd.draw(new redDoor());
greenDoorBmd.draw(new greenDoor());
blueDoorBmd.draw(new blueDoor());
redClosedBmd.draw(new redDoorDone());
greenClosedBmd.draw(new greenDoorDone());
blueClosedBmd.draw(new blueDoorDone());
b = new DaBomb();
i = 1;
while (i < (b.totalFrames + 1)) {
b.gotoAndStop(i);
bmd = new BitmapData(ts, ts, true, 0);
bmd.draw(b);
if (i <= 59){
loop.push(bmd);
};
if (i >= 60){
xplode.push(bmd);
};
i = (i + 1);
};
by = new BY();
j = 1;
while (j < (by.totalFrames + 1)) {
by.gotoAndStop(j);
bmd = new BitmapData(ts, ts, true, 0);
bmd.draw(by);
BYanimation.push(bmd);
j = (j + 1);
};
bx = new BX();
k = 1;
while (k < (bx.totalFrames + 1)) {
bx.gotoAndStop(k);
bmd = new BitmapData(ts, ts, true, 0);
bmd.draw(bx);
BXanimation.push(bmd);
k = (k + 1);
};
china = new China();
happy = new Happy();
tango = new Tango();
cave = new Cave();
newBgBmd = grassBmd;
blockBmd = shroomBmd;
brickBmd = logBmd;
bgMusic = happy;
myTimer.addEventListener("timer", updateTime);
transition = new trans();
addChild(transition);
transition.cacheAsBitmap = true;
transition.stop();
transition.mouseEnabled = false;
transition.mouseChildren = false;
iFace.playBtn.addEventListener(MouseEvent.CLICK, startGame);
iFace.howBtn.addEventListener(MouseEvent.CLICK, help);
iFace.b1.addEventListener(MouseEvent.CLICK, b1c);
iFace.b2.addEventListener(MouseEvent.CLICK, b2c);
iFace.b3.addEventListener(MouseEvent.CLICK, b3c);
}
public function shake():void{
count = 10;
shakeScreen = true;
}
private function updateTime(_arg1:TimerEvent){
time--;
time_txt.text = ("Time: " + time);
if (time <= 0){
lives--;
time = 250;
tranz();
bIcon.visible = false;
rIcon.visible = false;
gIcon.visible = false;
};
}
public function loading(_arg1:Event){
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = stage.loaderInfo.bytesTotal;
_local3 = stage.loaderInfo.bytesLoaded;
_local4 = Math.round(((_local3 * 100) / _local2));
lbar.scaleX = (5 * (_local4 / 100));
lpc.text = (int(_local4) + "%");
if (_local3 >= _local2){
gotoAndPlay("splash1");
removeEventListener(Event.ENTER_FRAME, loading);
};
}
public function levelUp():void{
if (showingAds){
return;
};
showingAds = true;
SoundMixer.stopAll();
removeEventListener(Event.ENTER_FRAME, update);
myTimer.stop();
score_txt.visible = false;
time_txt.visible = false;
MochiAd.showInterLevelAd({id:"60fa3eed898436f3", res:"672x448", clip:this, ad_finished:function (){
showingAds = false;
levelUp1();
}});
}
function help(_arg1:MouseEvent):void{
iFace.gotoAndPlay(1);
}
public function reset():void{
var _local1:int;
var _local2:int;
var _local3:Enemy;
rIcon.visible = false;
gIcon.visible = false;
bIcon.visible = false;
score = 0;
killScore = 0;
time = 250;
shakeScreen = false;
tiles = new Object();
destructables = new Array();
emptyTiles = new Array();
pieces = new Array();
enemies = new Array();
buildMap();
_local1 = Math.round((Math.random() * (destructables.length - 1)));
destructables[_local1].item = true;
destructables[_local1].itemBmd = redKeyBmd;
destructables[_local1].itemName = "redKey";
destructables.splice(_local1, 1);
_local1 = Math.round((Math.random() * (destructables.length - 1)));
destructables[_local1].item = true;
destructables[_local1].itemBmd = greenKeyBmd;
destructables[_local1].itemName = "greenKey";
destructables.splice(_local1, 1);
_local1 = Math.round((Math.random() * (destructables.length - 1)));
destructables[_local1].item = true;
destructables[_local1].itemBmd = blueKeyBmd;
destructables[_local1].itemName = "blueKey";
destructables.splice(_local1, 1);
_local1 = Math.round((Math.random() * (destructables.length - 1)));
destructables[_local1].item = true;
destructables[_local1].itemBmd = powerUpBmd;
destructables[_local1].itemName = "powerUp";
destructables.splice(_local1, 1);
hero.reset();
_local2 = 0;
while (_local2 < enemies.length) {
_local3 = enemies[_local2];
if (_local3 != null){
_local3.dead = false;
};
_local2++;
};
}
function startGame(_arg1:MouseEvent):void{
score = 0;
totalScore = 0;
killScore = 0;
newBgBmd = grassBmd;
blockBmd = shroomBmd;
brickBmd = logBmd;
bgMusic = happy;
numBricks = 40;
e1Num = 3;
e2Num = 0;
e3Num = 0;
hero.strength = 1;
level = 1;
lives = 3;
goodJob = false;
tranz();
}
private function render():void{
var _local1:int;
var _local2:int;
var _local3:*;
screen.copyPixels(bgBmd, bgBmd.rect, new Point(0, 0));
_local1 = 0;
while (_local1 < pieces.length) {
_local3 = pieces[_local1];
screen.copyPixels(_local3.data, _local3.data.rect, new Point((_local3.x + ((ts - _local3.ts) * 0.5)), (_local3.y + _local3.offSet)), null, null, true);
_local1++;
};
enemiesBmd.fillRect(enemiesBmd.rect, 0);
_local2 = 0;
while (_local2 < enemies.length) {
enemiesBmd.copyPixels(enemies[_local2].data, enemies[_local2].data.rect, new Point((enemies[_local2].x + ((ts - enemies[_local2].ts) * 0.5)), (enemies[_local2].y + enemies[_local2].offSet)), null, null, true);
_local2++;
};
screen.copyPixels(enemiesBmd, enemiesBmd.rect, new Point(0, 0), null, null, true);
heroBmd.fillRect(heroBmd.rect, 0);
heroBmd.copyPixels(hero.data, hero.data.rect, new Point((hero.x + ((ts - hero.ts) * 0.5)), (hero.y - 6)), null, null, true);
screen.copyPixels(heroBmd, heroBmd.rect, new Point(0, 0), null, null, true);
if (shakeScreen){
if (count > 0){
screen.scroll(((Math.random() * count) - (count * 0.5)), ((Math.random() * count) - (count * 0.5)));
screen.applyFilter(screen, screen.rect, new Point(0, 0), new BlurFilter((Math.random() * count), (Math.random() * count), 2));
count--;
} else {
shakeScreen = false;
};
};
score_txt.text = ("Score: " + totalScore);
}
}
}//package
Section 41
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.3");
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
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 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 f:Function;
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;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
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 sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
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 _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
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 unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
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");
}};
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.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);
};
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 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
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 _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 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 _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
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.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
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 r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, 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");
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0){
options.ad_started();
options.ad_finished();
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);
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.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;
};
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);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
options.ad_failed();
_local4 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
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 fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
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 42
//Pavers (Pavers)
package {
import flash.display.*;
public dynamic class Pavers extends MovieClip {
}
}//package
Section 43
//PickUp (PickUp)
package {
import flash.media.*;
public dynamic class PickUp extends Sound {
}
}//package
Section 44
//Pillar (Pillar)
package {
import flash.display.*;
public dynamic class Pillar extends MovieClip {
}
}//package
Section 45
//Player (Player)
package {
import flash.display.*;
public dynamic class Player extends MovieClip {
}
}//package
Section 46
//powerUp (powerUp)
package {
import flash.display.*;
public dynamic class powerUp extends MovieClip {
}
}//package
Section 47
//redDoor (redDoor)
package {
import flash.display.*;
public dynamic class redDoor extends MovieClip {
}
}//package
Section 48
//redDoorDone (redDoorDone)
package {
import flash.display.*;
public dynamic class redDoorDone extends MovieClip {
}
}//package
Section 49
//redKey (redKey)
package {
import flash.display.*;
public dynamic class redKey extends MovieClip {
}
}//package
Section 50
//Rock (Rock)
package {
import flash.display.*;
public dynamic class Rock extends MovieClip {
}
}//package
Section 51
//Sand (Sand)
package {
import flash.display.*;
public dynamic class Sand extends MovieClip {
}
}//package
Section 52
//Shroom (Shroom)
package {
import flash.display.*;
public dynamic class Shroom extends MovieClip {
}
}//package
Section 53
//Shroom2 (Shroom2)
package {
import flash.display.*;
public dynamic class Shroom2 extends MovieClip {
}
}//package
Section 54
//Splooge (Splooge)
package {
import flash.media.*;
public dynamic class Splooge extends Sound {
}
}//package
Section 55
//Tango (Tango)
package {
import flash.media.*;
public dynamic class Tango extends Sound {
}
}//package
Section 56
//thunk (thunk)
package {
import flash.media.*;
public dynamic class thunk extends Sound {
}
}//package
Section 57
//Tiki (Tiki)
package {
import flash.display.*;
public dynamic class Tiki extends MovieClip {
}
}//package
Section 58
//Tile (Tile)
package {
import flash.display.*;
public class Tile {
private var _walkable:Boolean;
private var _data:BitmapData;
public var name:String;
private var _destructable:Boolean;
public var blast:Boolean;// = false
public var item:Boolean;// = false
public var itemBmd:BitmapData;
public var offSet:int;
public var x:Number;
public var y:Number;
public var itemName:String;
public var ts:int;
public function Tile(_arg1:String, _arg2:Number, _arg3:Number){
item = false;
blast = false;
super();
name = _arg1;
x = _arg2;
y = _arg3;
}
public function set walkable(_arg1:Boolean):void{
_walkable = _arg1;
}
public function get destructable():Boolean{
return (_destructable);
}
public function set data(_arg1:BitmapData):void{
_data = _arg1;
}
public function set destructable(_arg1:Boolean):void{
_destructable = _arg1;
}
public function get walkable():Boolean{
return (_walkable);
}
public function get data():BitmapData{
return (_data);
}
}
}//package
Section 59
//trans (trans)
package {
import flash.display.*;
import flash.events.*;
import mochi.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
import flash.system.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class trans extends MovieClip {
public var submit:MovieClip;
public var level_mc:MovieClip;
public var time_mc:MovieClip;
public var score_mc:MovieClip;
public var enemyBonus:MovieClip;
public var lives_mc:MovieClip;
public function trans(){
addFrameScript(29, frame30, 116, frame117, 117, frame118, 157, frame158, 187, frame188, 188, frame189, 208, frame209, 228, frame229, 229, frame230, 249, frame250, 268, frame269);
}
function frame158(){
MovieClip(parent).run();
}
function frame209(){
stop();
this.mouseEnabled = true;
this.mouseChildren = true;
submit.addEventListener(MouseEvent.CLICK, submitScore);
}
public function submitScore2(_arg1):void{
}
function frame188(){
stop();
}
function frame229(){
stop();
MovieClip(parent).iFace.gotoAndStop(1);
MovieClip(parent).iFace.visible = true;
this.mouseEnabled = false;
this.mouseChildren = false;
}
public function submitScore(_arg1:MouseEvent){
var e = _arg1;
MovieClip(parent).screen.fillRect(MovieClip(parent).screen.rect, 0);
MochiScores.showLeaderboard({boardID:"a2e7e4b90e915334", score:MovieClip(parent).totalScore, clip:this, res:"672x448", onClose:function (){
newGame();
}});
}
function frame189(){
score_mc.score_txt.text = ("Score: " + MovieClip(parent).totalScore);
}
function frame30(){
MovieClip(parent).iFace.visible = false;
if ((((MovieClip(parent).level == 1)) || (!(MovieClip(parent).goodJob)))){
gotoAndPlay("pre level");
};
if (MovieClip(parent).lives == -1){
gotoAndPlay("game over");
};
time_mc.time_txt.text = (("Time Bonus: " + (250 - MovieClip(parent).time)) + " x 50");
enemyBonus.enemy_txt.text = (("Enemy Bonus: " + MovieClip(parent).killScore) + " x 500");
score_mc.score_txt.text = ("Score: " + MovieClip(parent).totalScore);
}
function frame117(){
}
function frame118(){
lives_mc.lives_txt.text = ("x " + MovieClip(parent).lives);
switch (MovieClip(parent).level){
case 1:
level_mc.level_txt.text = "Level 1 - 1";
break;
case 2:
level_mc.level_txt.text = "Level 1 - 2";
break;
case 3:
level_mc.level_txt.text = "Level 1 - 3";
break;
case 4:
level_mc.level_txt.text = "Level 1 - 4";
break;
case 5:
level_mc.level_txt.text = "Level 1 - 5";
break;
case 6:
level_mc.level_txt.text = "Level 2 - 1";
break;
case 7:
level_mc.level_txt.text = "Level 2 - 2";
break;
case 8:
level_mc.level_txt.text = "Level 2 - 3";
break;
case 9:
level_mc.level_txt.text = "Level 2 - 4";
break;
case 10:
level_mc.level_txt.text = "Level 2 - 5";
break;
case 11:
level_mc.level_txt.text = "Level 3 - 1";
break;
case 12:
level_mc.level_txt.text = "Level 3 - 2";
break;
case 13:
level_mc.level_txt.text = "Level 3 - 3";
break;
case 14:
level_mc.level_txt.text = "Level 3 - 4";
break;
case 15:
level_mc.level_txt.text = "Level 3 - 5";
break;
case 16:
level_mc.level_txt.text = "Level 4 - 1";
break;
case 17:
level_mc.level_txt.text = "Level 4 - 2";
break;
case 18:
level_mc.level_txt.text = "Level 4 - 3";
break;
case 19:
level_mc.level_txt.text = "Level 4 - 4";
break;
case 20:
level_mc.level_txt.text = "Level 4 - 5";
break;
case 21:
gotoAndPlay("win");
break;
};
}
function frame230(){
score_mc.score_txt.text = ("Score: " + MovieClip(parent).totalScore);
}
public function newGame(){
trace("=================================new game===========================================");
this.play();
}
function frame250(){
stop();
submit.addEventListener(MouseEvent.CLICK, submitScore2);
this.mouseEnabled = true;
this.mouseChildren = true;
}
function frame269(){
stop();
MovieClip(parent).iFace.gotoAndStop(1);
MovieClip(parent).iFace.visible = true;
this.mouseEnabled = false;
this.mouseChildren = false;
}
}
}//package