Section 1
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 2
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
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 n:Number;
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;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
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.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
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 _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
var _local2:Object = {};
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{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
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{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 3
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import flash.geom.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__ms_";
private static var _servicesURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
public static var netup:Boolean = true;
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
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);
};
};
};
};
};
}
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++;
};
};
}
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);
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().getTime()));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
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();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.02 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
private static function onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
public static function get id():String{
return (_id);
}
private static function urlOptions(_arg1:Object):Object{
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
var _local3:String = _arg1.loaderInfo.parameters.mochiad_options;
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
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 handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_listenChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = this.client._callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = 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");
};
trace("connected!");
_connecting = false;
_connected = true;
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...");
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var id = _arg1;
var clip = _arg2;
var clipname:String = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(clip).servicesURL != undefined){
_servicesURL = urlOptions(clip).servicesURL;
};
MochiServices.allowDomains(_servicesURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
var f:Function = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor((Math.random() * 99999))));
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
var req:URLRequest = new URLRequest(_servicesURL);
var vars:URLVariables = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
if (widget){
vars.widget = true;
};
req.data = vars;
listen();
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function get clip():Object{
return (_container);
}
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;
warnID(id, false);
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 parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
var mc:MovieClip = 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 (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 4
//btnHelp_43 (war_src_fla.btnHelp_43)
package war_src_fla {
import flash.display.*;
public dynamic class btnHelp_43 extends MovieClip {
public function btnHelp_43(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package war_src_fla
Section 5
//btnMore_42 (war_src_fla.btnMore_42)
package war_src_fla {
import flash.display.*;
public dynamic class btnMore_42 extends MovieClip {
public function btnMore_42(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package war_src_fla
Section 6
//btnPlay_40 (war_src_fla.btnPlay_40)
package war_src_fla {
import flash.display.*;
public dynamic class btnPlay_40 extends MovieClip {
public function btnPlay_40(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package war_src_fla
Section 7
//btnSound_41 (war_src_fla.btnSound_41)
package war_src_fla {
import flash.display.*;
public dynamic class btnSound_41 extends MovieClip {
public function btnSound_41(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package war_src_fla
Section 8
//btnSponsorcopy_44 (war_src_fla.btnSponsorcopy_44)
package war_src_fla {
import flash.display.*;
public dynamic class btnSponsorcopy_44 extends MovieClip {
public function btnSponsorcopy_44(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package war_src_fla
Section 9
//shtabNew_34 (war_src_fla.shtabNew_34)
package war_src_fla {
import flash.display.*;
public dynamic class shtabNew_34 extends MovieClip {
public function shtabNew_34(){
addFrameScript(0, frame1, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 42, frame43, 52, frame53);
}
function frame14(){
this.stop();
}
function frame1(){
this.stop();
}
function frame53(){
this.gotoAndPlay(2);
}
function frame43(){
this.stop();
}
function frame11(){
this.stop();
}
function frame12(){
this.stop();
}
function frame13(){
this.stop();
}
}
}//package war_src_fla
Section 10
//sndClip_46 (war_src_fla.sndClip_46)
package war_src_fla {
import flash.display.*;
public dynamic class sndClip_46 extends MovieClip {
public function sndClip_46(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package war_src_fla
Section 11
//textScore_47 (war_src_fla.textScore_47)
package war_src_fla {
import flash.display.*;
public dynamic class textScore_47 extends MovieClip {
public function textScore_47(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package war_src_fla
Section 12
//Timeline_1 (war_src_fla.Timeline_1)
package war_src_fla {
import flash.display.*;
public dynamic class Timeline_1 extends MovieClip {
public function Timeline_1(){
addFrameScript(0, frame1, 1, frame2, 159, frame160);
}
function frame1(){
this.visible = false;
this.stop();
}
function frame2(){
this.visible = true;
}
function frame160(){
this.visible = false;
this.stop();
}
}
}//package war_src_fla
Section 13
//Timeline_31 (war_src_fla.Timeline_31)
package war_src_fla {
import flash.display.*;
public dynamic class Timeline_31 extends MovieClip {
public function Timeline_31(){
addFrameScript(0, frame1, 79, frame80);
}
function frame1(){
this.stop();
}
function frame80(){
this.stop();
}
}
}//package war_src_fla
Section 14
//Timeline_33 (war_src_fla.Timeline_33)
package war_src_fla {
import flash.display.*;
public dynamic class Timeline_33 extends MovieClip {
public function Timeline_33(){
addFrameScript(0, frame1, 46, frame47, 70, frame71);
}
function frame47(){
this.gotoAndStop(1);
}
function frame1(){
this.stop();
}
function frame71(){
this.stop();
}
}
}//package war_src_fla
Section 15
//Timeline_37 (war_src_fla.Timeline_37)
package war_src_fla {
import flash.display.*;
public dynamic class Timeline_37 extends MovieClip {
public function Timeline_37(){
addFrameScript(0, frame1, 1, frame2, 60, frame61);
}
function frame61(){
this.visible = false;
this.stop();
}
function frame1(){
this.visible = false;
this.stop();
}
function frame2(){
this.visible = true;
}
}
}//package war_src_fla
Section 16
//Timeline_9 (war_src_fla.Timeline_9)
package war_src_fla {
import flash.display.*;
public dynamic class Timeline_9 extends MovieClip {
public function Timeline_9(){
addFrameScript(0, frame1, 15, frame16);
}
function frame16(){
this.gotoAndPlay(1);
}
function frame1(){
this.play();
}
}
}//package war_src_fla
Section 17
//Boom (Boom)
package {
import flash.media.*;
public dynamic class Boom extends Sound {
}
}//package
Section 18
//BtnGameover (BtnGameover)
package {
import flash.display.*;
import flash.text.*;
public dynamic class BtnGameover extends MovieClip {
public var fldScore:TextField;
public function BtnGameover(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package
Section 19
//BtnInit (BtnInit)
package {
import flash.events.*;
import flash.display.*;
public final class BtnInit {
private static function enableHelp(_arg1:MovieClip):void{
btnMode(_arg1);
_arg1.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHelp);
_arg1.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHelp);
}
public static function btnMode(_arg1:MovieClip):void{
_arg1.buttonMode = true;
_arg1.useHandCursor = true;
_arg1.mouseChildren = false;
}
private static function mouseOut(_arg1:MouseEvent):void{
var _local2:MovieClip = MovieClip(_arg1.currentTarget);
_local2.gotoAndStop(1);
}
private static function mouseOutHelp(_arg1:MouseEvent):void{
Interfaces.HINT_HELP.gotoAndPlay("end");
}
public static function btnDisable(_arg1:MovieClip):void{
_arg1.buttonMode = false;
_arg1.useHandCursor = false;
}
private static function onSound(_arg1:MouseEvent):void{
SoundGame.musicLevel();
}
private static function onPlay(_arg1:MouseEvent):void{
Interfaces.game.newGame();
}
private static function onMore(_arg1:MouseEvent):void{
Interfaces.myRoot.mochiRoot.goMore();
}
private static function mouseOver(_arg1:MouseEvent):void{
var _local2:MovieClip = MovieClip(_arg1.currentTarget);
_local2.gotoAndStop(2);
SoundGame.mouseOver();
}
private static function mouseOverHelp(_arg1:MouseEvent):void{
Interfaces.HINT_HELP.gotoAndPlay("start");
SoundGame.mouseOver();
}
private static function btnEvent(_arg1:MovieClip):void{
_arg1.addEventListener(MouseEvent.MOUSE_OVER, mouseOver);
_arg1.addEventListener(MouseEvent.MOUSE_OUT, mouseOut);
}
public static function btnEnable():void{
var _local3:MovieClip;
var _local4:String;
var _local1:GameClip = Interfaces.game.screen;
var _local2:Array = new Array(_local1.btnMore, _local1.btnPlay, _local1.btnSound, _local1.logoBtn);
for (_local4 in _local2) {
_local3 = MovieClip(_local2[_local4]);
btnMode(_local3);
btnEvent(_local3);
};
_local1.btnPlay.addEventListener(MouseEvent.MOUSE_DOWN, onPlay);
_local1.btnSound.addEventListener(MouseEvent.MOUSE_DOWN, onSound);
_local1.btnMore.addEventListener(MouseEvent.MOUSE_DOWN, onMore);
_local1.logoBtn.addEventListener(MouseEvent.MOUSE_DOWN, onMore);
enableHelp(_local1.btnHelp);
}
}
}//package
Section 20
//ChikPushka (ChikPushka)
package {
import flash.media.*;
public dynamic class ChikPushka extends Sound {
}
}//package
Section 21
//Comander (Comander)
package {
import flash.events.*;
public final class Comander {
public static var ready:Boolean = false;
public static var speed:Number = 2;
public static var clip:ComanderClip;
private static var mouse_y:Number;
public static function remove():void{
ready = false;
clip.removeEventListener(Event.ENTER_FRAME, update);
}
private static function update(_arg1:Event):void{
ready = false;
if (clip.currentFrame < 4){
mouse_y = Interfaces.game.screen.mouseY;
if (Math.abs((clip.y - mouse_y)) < 10){
clip.gotoAndStop("stop");
ready = true;
} else {
if (clip.y < mouse_y){
move(speed);
if (clip.currentFrame != 2){
clip.gotoAndStop("down");
};
} else {
move(-(speed));
if (clip.currentFrame != 3){
clip.gotoAndStop("up");
};
};
};
};
}
public static function damage():void{
Interfaces.game.screen.comander.gotoAndPlay("dead");
remove();
}
private static function move(_arg1:Number):void{
if (((((clip.y + _arg1) < 30)) && (((clip.y + _arg1) > -115)))){
clip.y = (clip.y + _arg1);
};
}
public static function init():void{
clip = Interfaces.game.screen.comander;
clip.gotoAndStop("stop");
clip.addEventListener(Event.ENTER_FRAME, update);
clip.visible = true;
}
}
}//package
Section 22
//ComanderClip (ComanderClip)
package {
import flash.display.*;
public dynamic class ComanderClip extends MovieClip {
public var talk2:MovieClip;
public function ComanderClip(){
addFrameScript(0, frame1, 29, frame30, 49, frame50);
}
function frame1(){
this.stop();
}
function frame50(){
this.stop();
}
function frame30(){
this.gotoAndStop(1);
}
}
}//package
Section 23
//DownloaderMochi (DownloaderMochi)
package {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.net.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class DownloaderMochi extends MovieClip {
private var boardID:String;
private var tittle:TittleDownloader;
private var o:Object;
private var mochFlag:Boolean;// = false
private var cheker:Boolean;// = true
public function DownloaderMochi(){
tittle = new TittleDownloader();
o = {n:[4, 2, 3, 10, 6, 6, 10, 2, 12, 12, 4, 12, 13, 9, 3, 9], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "");
super();
initContex();
stop();
MochiServices.connect("65193f469de89c4a", this);
var _local1:String = String(stage.loaderInfo.url);
if (((cheker) || (!((_local1.indexOf("/games.mochiads.com/", 0) == -1))))){
if (mochFlag){
} else {
this.addChild(tittle);
this.tittle.gotoAndStop(1);
this.tittle.btnPlayStart.visible = false;
this.tittle.addFrameScript(350, endTittle);
this.tittle.btnPlayStart.buttonMode = true;
this.tittle.btnPlayStart.useHandCursor = true;
this.tittle.btnPlayStart.mouseChildren = false;
this.tittle.buttonMode = true;
this.tittle.useHandCursor = true;
this.tittle.mouseChildren = false;
this.tittle.addEventListener(MouseEvent.MOUSE_DOWN, gogo);
};
addEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
private function getURL(_arg1:String, _arg2:String):void{
var _local3:URLRequest = new URLRequest(_arg1);
navigateToURL(_local3, _arg2);
}
private function onEnterFrameScore(_arg1:Event):void{
if (this.currentFrame == 2){
removeEventListener(Event.ENTER_FRAME, onEnterFrameScore);
this.removeChild(tittle);
tittle = null;
stop();
init();
};
}
private function endTittle():void{
this.tittle.stop();
this.tittle.buttonMode = false;
this.tittle.useHandCursor = false;
this.tittle.mouseChildren = true;
this.tittle.btnPlayStart.visible = true;
this.tittle.removeEventListener(MouseEvent.MOUSE_DOWN, gogo);
this.tittle.btnPlayStart.addEventListener(MouseEvent.MOUSE_DOWN, init);
}
public function initMochiScores():void{
gotoAndStop(1);
MochiScores.showLeaderboard({boardID:boardID});
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(_arg1:Event):void{
var _local2:Number;
if (mochFlag){
if (this.currentFrame == 2){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
stop();
init();
};
} else {
if (framesLoaded == totalFrames){
this.tittle.gotoAndPlay(2);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
} else {
_local2 = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
tittle.procent_txt.text = (String(int((_local2 * 100))) + "%");
};
};
}
private function initContex(_arg1:Event=null):void{
this.contextMenu = new ContextMenu();
this.contextMenu.builtInItems.forwardAndBack = false;
this.contextMenu.builtInItems.loop = false;
this.contextMenu.builtInItems.play = false;
this.contextMenu.builtInItems.print = false;
this.contextMenu.builtInItems.rewind = false;
this.contextMenu.builtInItems.zoom = false;
}
private function init(_arg1:MouseEvent=null):void{
var _local3:Object;
this.tittle.btnPlayStart.removeEventListener(MouseEvent.MOUSE_DOWN, init);
var _local2:Class = Class(getDefinitionByName("TankInvasion"));
if (_local2){
_local3 = new _local2(this);
addChild((_local3 as DisplayObject));
};
}
public function initMochiScoresInput():void{
gotoAndStop(1);
var _local1:Number = ((Interfaces.tankDead * 100) + (Interfaces.time * 100));
MochiScores.showLeaderboard({boardID:boardID, score:_local1});
addEventListener(Event.ENTER_FRAME, onEnterFrameScore);
}
public function goMore(_arg1:MouseEvent=null):void{
getURL("http://www.i6.com/new-games.php?utm_source=games&utm_medium=cdpmg", "_blank");
}
public function gogo(_arg1:MouseEvent=null):void{
getURL("http://www.i6.com/new-games.php?utm_source=games&utm_medium=cdpl", "_blank");
}
}
}//package
Section 24
//FirePushka (FirePushka)
package {
import flash.events.*;
import flash.display.*;
public final class FirePushka {
public var fire:MovieClip;
public var aLive:Boolean;// = true
public function FirePushka(_arg1:MovieClip){
fire = new FirePushkaClip();
super();
fire.name = "fire";
Interfaces.game.screen.addChild(fire);
fire.y = (_arg1.y - 6);
fire.x = (_arg1.x + 46);
fire.addEventListener(Event.ENTER_FRAME, onEnter);
}
private function fireTankTest():Boolean{
var _local1:String;
for (_local1 in Interfaces.play.fireTankArray) {
if (fire.hitTestObject(Interfaces.play.fireTankArray[_local1].fire)){
Interfaces.play.fireTankArray[_local1].damage();
damage();
return (true);
};
};
return (false);
}
public function remove():void{
if (aLive){
aLive = false;
deleteArray();
fire.removeEventListener(Event.ENTER_FRAME, onEnter);
Interfaces.game.screen.removeChild(fire);
};
}
public function deleteArray():void{
var _local1:String;
for (_local1 in Interfaces.play.firePushkaArray) {
if (this == Interfaces.play.firePushkaArray[_local1]){
Interfaces.play.firePushkaArray.splice(int(_local1), 1);
break;
};
};
}
private function onEnter(_arg1:Event):void{
fire.x = (fire.x + Interfaces.FIRE_SPEED);
if (tankTest()){
return;
};
if (fireTankTest()){
return;
};
if (fire.x > 300){
remove();
};
}
private function tankTest():Boolean{
var _local1:String;
for (_local1 in Interfaces.play.tankArray) {
if (fire.hitTestObject(Interfaces.play.tankArray[_local1].tank)){
Interfaces.play.tankArray[_local1].damage();
remove();
return (true);
};
};
return (false);
}
public function remove2():void{
if (aLive){
aLive = false;
fire.removeEventListener(Event.ENTER_FRAME, onEnter);
Interfaces.game.screen.removeChild(fire);
};
}
public function damage():void{
if (aLive){
aLive = false;
deleteArray();
fire.removeEventListener(Event.ENTER_FRAME, onEnter);
fire.gotoAndPlay(2);
};
}
}
}//package
Section 25
//FirePushkaClip (FirePushkaClip)
package {
import flash.display.*;
public dynamic class FirePushkaClip extends MovieClip {
public function FirePushkaClip(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
}
}//package
Section 26
//FirePushkaSound (FirePushkaSound)
package {
import flash.media.*;
public dynamic class FirePushkaSound extends Sound {
}
}//package
Section 27
//FireTank (FireTank)
package {
import flash.events.*;
import flash.display.*;
public final class FireTank {
public var aLive:Boolean;// = true
public var fire:MovieClip;
public function FireTank(_arg1:MovieClip){
fire = new FireTankClip();
super();
fire.name = "fire";
fire.gotoAndStop(1);
Interfaces.game.screen.addChild(fire);
fire.y = (_arg1.y - 11);
fire.x = (_arg1.x - 55);
fire.addEventListener(Event.ENTER_FRAME, onEnter);
}
private function pushkaTest():Boolean{
var _local1:String;
for (_local1 in Interfaces.play.pushkaArray) {
if (fire.hitTestObject(Interfaces.play.pushkaArray[_local1].pushka)){
Interfaces.play.pushkaArray[_local1].damage();
remove();
return (true);
};
};
return (false);
}
private function fireComanderTest():void{
if (fire.hitTestObject(Interfaces.game.screen.comander)){
Comander.damage();
remove();
};
}
public function remove():void{
if (aLive){
aLive = false;
deleteArray();
fire.removeEventListener(Event.ENTER_FRAME, onEnter);
Interfaces.game.screen.removeChild(fire);
};
}
public function boom():void{
if (aLive){
aLive = false;
deleteArray();
fire.removeEventListener(Event.ENTER_FRAME, onEnter);
fire.gotoAndPlay(10);
};
}
public function deleteArray():void{
var _local1:String;
for (_local1 in Interfaces.play.fireTankArray) {
if (this == Interfaces.play.fireTankArray[_local1]){
Interfaces.play.fireTankArray.splice(int(_local1), 1);
break;
};
};
}
public function damage():void{
if (aLive){
aLive = false;
deleteArray();
SoundGame.miniBoom();
fire.removeEventListener(Event.ENTER_FRAME, onEnter);
fire.gotoAndPlay(2);
};
}
private function shtabTest():void{
if (fire.hitTestObject(Interfaces.play.shtab.shtab)){
Interfaces.play.shtab.damage();
boom();
};
}
public function remove2():void{
if (aLive){
aLive = false;
fire.removeEventListener(Event.ENTER_FRAME, onEnter);
Interfaces.game.screen.removeChild(fire);
};
}
private function firePushkaTest():Boolean{
var _local1:String;
for (_local1 in Interfaces.play.firePushkaArray) {
if (fire.hitTestObject(Interfaces.play.firePushkaArray[_local1].fire)){
Interfaces.play.firePushkaArray[_local1].damage();
damage();
return (true);
};
};
return (false);
}
private function onEnter(_arg1:Event):void{
fire.x = (fire.x - Interfaces.FIRE_SPEED);
if (pushkaTest()){
return;
};
if (firePushkaTest()){
return;
};
if (fireComanderTest()){
return;
};
shtabTest();
}
}
}//package
Section 28
//FireTankClip (FireTankClip)
package {
import flash.display.*;
public dynamic class FireTankClip extends MovieClip {
public function FireTankClip(){
addFrameScript(0, frame1, 8, frame9, 28, frame29);
}
function frame9(){
this.stop();
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
function frame29(){
this.stop();
this.parent.removeChild(this);
}
}
}//package
Section 29
//FireTankSound (FireTankSound)
package {
import flash.media.*;
public dynamic class FireTankSound extends Sound {
}
}//package
Section 30
//Game (Game)
package {
import flash.events.*;
public class Game {
public var screen:GameClip;
public var play:Play;// = null
public var vertoletNetu:Boolean;// = true
public var vertoletTut:Boolean;// = false
public function Game(){
screen = new GameClip();
super();
SoundGame.musicGameOver();
SoundGame.volumeTransform.volume = 1;
Interfaces.game = this;
Interfaces.myRoot.addChild(screen);
Interfaces.myRoot.addChild(Interfaces.HINT_HELP);
Interfaces.HINT_HELP.x = 275;
Interfaces.HINT_HELP.y = 130;
screen.build_mc.visible = false;
screen.x = 275;
screen.y = 200;
screen.shtab.gotoAndStop(1);
screen.talk1.gotoAndStop(1);
BtnInit.btnEnable();
screen.addEventListener(Event.ENTER_FRAME, onEnter);
screen.btnGameover.addEventListener(MouseEvent.MOUSE_DOWN, onSubmit);
Interfaces.traceAchiv();
screen.sndClip.gotoAndStop(1);
screen.samolet.y = -271;
}
public function vertoletRemove():void{
screen.samolet.y = -271;
screen.samolet.gotoAndStop(1);
screen.talk1.gotoAndStop(1);
Comander.clip.talk2.gotoAndStop(1);
screen.samolet.removeEventListener(Event.ENTER_FRAME, onVertolet);
}
private function onSky():void{
screen.sky.x = (screen.sky.x - 0.1);
if (screen.sky.x < (227.6 - 550)){
screen.sky.x = (screen.sky.x + 550);
};
var _local1:Number = (Interfaces.time / 300);
}
public function endGame():void{
SoundGame.musicStop();
Interfaces.myRoot.removeChild(screen);
Interfaces.myRoot.removeChild(Interfaces.HINT_HELP);
screen.removeEventListener(Event.ENTER_FRAME, onEnter);
screen.samolet.removeEventListener(Event.ENTER_FRAME, onVertolet);
SoundGame.helicopSndStop();
}
public function newGame():void{
if (play != null){
if (play.dead){
screen.shtab.gotoAndPlay(44);
} else {
play.gameOver();
screen.shtab.gotoAndPlay(44);
};
play.dead = false;
} else {
play = new Play();
screen.shtab.gotoAndPlay(2);
};
play.start();
play.initPushka();
}
private function onSubmit(_arg1:MouseEvent):void{
endGame();
Interfaces.myRoot.gameScoreInput();
}
private function onEnter(_arg1:Event):void{
var _local2:BtnGameover;
if (play != null){
play.update();
};
onSky();
if (screen.shtab.currentFrame == 43){
screen.btnGameover.visible = true;
BtnInit.btnMode(screen.btnGameover);
_local2 = (screen.btnGameover as BtnGameover);
_local2.fldScore.text = String(((Interfaces.tankDead * 100) + (Interfaces.time * 100)));
} else {
screen.btnGameover.visible = false;
BtnInit.btnDisable(screen.btnGameover);
};
if ((((Interfaces.time == 150)) && (vertoletNetu))){
SoundGame.helicopSndPlay();
vertoletNetu = false;
screen.samolet.addEventListener(Event.ENTER_FRAME, onVertolet);
};
}
private function onVertolet(_arg1:Event):void{
screen.samolet.y++;
if (screen.samolet.y > -201){
screen.samolet.y = (-200 - Interfaces.randomNum(2));
if (!vertoletTut){
screen.samolet.gotoAndPlay(2);
vertoletTut = true;
};
};
if (screen.samolet.currentFrame == 80){
screen.samolet.gotoAndStop(1);
screen.talk1.gotoAndPlay(2);
Comander.clip.talk2.gotoAndPlay(2);
};
if (Comander.clip.talk2.currentFrame == 160){
screen.samolet.y = (screen.samolet.y - 2);
if (screen.samolet.y < -271){
screen.talk1.gotoAndStop(1);
Comander.clip.talk2.gotoAndStop(1);
screen.samolet.removeEventListener(Event.ENTER_FRAME, onVertolet);
SoundGame.helicopSndStop();
};
};
}
public function removeGame():void{
screen.removeEventListener(Event.ENTER_FRAME, onEnter);
Interfaces.myRoot.removeChild(screen);
}
}
}//package
Section 31
//GameClip (GameClip)
package {
import flash.display.*;
import flash.text.*;
public dynamic class GameClip extends Sprite {
public var pushka1:MovieClip;
public var txtScore:MovieClip;
public var pushka3:MovieClip;
public var talk1:MovieClip;
public var build_mc:MovieClip;
public var pushka2:MovieClip;
public var btnMore:MovieClip;
public var sndClip:MovieClip;
public var txtTime:TextField;
public var shtab:MovieClip;
public var sky:MovieClip;
public var comander:ComanderClip;
public var btnGameover:BtnGameover;
public var samolet:MovieClip;
public var btnPlay:MovieClip;
public var logoBtn:MovieClip;
public var btnSound:MovieClip;
public var btnHelp:MovieClip;
public var txtDeadTank:TextField;
}
}//package
Section 32
//Helicop (Helicop)
package {
import flash.media.*;
public dynamic class Helicop extends Sound {
}
}//package
Section 33
//HiintHelp (HiintHelp)
package {
import flash.display.*;
public dynamic class HiintHelp extends MovieClip {
public function HiintHelp(){
addFrameScript(0, frame1, 9, frame10, 16, frame17);
}
function frame17(){
this.stop();
}
function frame10(){
this.stop();
}
function frame1(){
this.stop();
}
}
}//package
Section 34
//Interfaces (Interfaces)
package {
import flash.display.*;
public class Interfaces {
public static const WAY2_Y:Number = -38.25;
public static const WAY3_Y:Number = 23.1;
public static const FIRE_SPEED:Number = 12;
public static const MAX_X:Number = 85;
public static const HINT_HELP:MovieClip = new HiintHelp();
public static const WAY1_Y:Number = -96.75;
public static var time:Number;
public static var maxTime:Number;
public static var myRoot:TankInvasion;
public static var game:Game;
public static var play:Play;
public static var maxTank:Number;
public static var tankDead:Number;
public static function traceAchiv():void{
game.screen.txtScore.gotoAndStop(1);
game.screen.txtDeadTank.text = String(maxTank);
game.screen.txtTime.text = getTime(maxTime);
}
public static function randomNum(_arg1:Number=3):Number{
return ((Math.floor((Math.random() * _arg1)) + 1));
}
public static function traceScore(_arg1:int):void{
game.screen.txtScore.gotoAndStop(2);
time = Math.floor((_arg1 / 30));
game.screen.txtDeadTank.text = String(tankDead);
game.screen.txtTime.text = getTime(time);
if (tankDead > maxTank){
maxTank = tankDead;
saveAchiv();
};
if (time > maxTime){
maxTime = time;
saveAchiv();
};
}
private static function getTime(_arg1:Number):String{
var _local2:String;
var _local3:Number = Math.floor((_arg1 / 60));
var _local4:Number = (_arg1 - (_local3 * 60));
if (_local3 < 10){
_local2 = ("0" + _local3);
} else {
_local2 = String(_local3);
};
if (_local4 < 10){
_local2 = ((_local2 + ":0") + _local4);
} else {
_local2 = ((_local2 + ":") + _local4);
};
return (_local2);
}
public static function saveAchiv():void{
myRoot.shared.data.maxTank = maxTank;
myRoot.shared.data.maxTime = maxTime;
}
}
}//package
Section 35
//MiniBoom (MiniBoom)
package {
import flash.media.*;
public dynamic class MiniBoom extends Sound {
}
}//package
Section 36
//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{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 37
//MouseOver (MouseOver)
package {
import flash.media.*;
public dynamic class MouseOver extends Sound {
}
}//package
Section 38
//MusicGameOver (MusicGameOver)
package {
import flash.media.*;
public dynamic class MusicGameOver extends Sound {
}
}//package
Section 39
//MusicMain (MusicMain)
package {
import flash.media.*;
public dynamic class MusicMain extends Sound {
}
}//package
Section 40
//NewPushka (NewPushka)
package {
import flash.media.*;
public dynamic class NewPushka extends Sound {
}
}//package
Section 41
//Play (Play)
package {
import flash.events.*;
import flash.display.*;
public final class Play {
public var countTime:int;
public var pushkaArray:Array;
public var pushkaWay1:Boolean;// = true
public var tankArray:Array;
public var fireTankArray:Array;
public var shtab:Shtab;
public var countNext:int;
public var dead:Boolean;// = false
public var tankWay1:Boolean;// = true
public var tankWay2:Boolean;// = true
public var tankWay3:Boolean;// = true
private var countFrameBuild:Number;
public var firePushkaArray:Array;
public var pushkaWay3:Boolean;// = true
public var countNextLimit:int;
public var pushkaWay2:Boolean;// = true
public var gameFlag:Boolean;// = true
public function Play(){
pushkaArray = new Array();
tankArray = new Array();
firePushkaArray = new Array();
fireTankArray = new Array();
super();
Interfaces.play = this;
shtab = new Shtab();
}
private function tryPushkaWay(_arg1:Number):Boolean{
var _local2:Boolean;
if ((((_arg1 == 1)) && (pushkaWay1))){
_local2 = (pushkaWay1 = false);
};
if ((((_arg1 == 2)) && (pushkaWay2))){
_local2 = (pushkaWay2 = false);
};
if ((((_arg1 == 3)) && (pushkaWay3))){
_local2 = (pushkaWay3 = false);
};
return (_local2);
}
public function update():void{
if (gameFlag){
countTime++;
countNext--;
Interfaces.traceScore(countTime);
if (countNext < 0){
newTank();
countNext = countNextLimit;
};
if (countTime > 4000){
countNextLimit = 0;
} else {
if (countTime > 3500){
countNextLimit = 10;
} else {
if (countTime > 3000){
countNextLimit = 20;
} else {
if (countTime > 2500){
countNextLimit = 30;
} else {
if (countTime > 2000){
countNextLimit = 50;
} else {
if (countTime > 1500){
countNextLimit = 60;
} else {
if (countTime > 1000){
countNextLimit = 70;
} else {
if (countTime > 500){
countNextLimit = 80;
};
};
};
};
};
};
};
};
};
}
public function gameOver():void{
var _local1:String;
var _local2:String;
var _local3:String;
var _local4:String;
SoundGame.musicGameOver();
SoundGame.helicopSndStop();
Interfaces.game.vertoletRemove();
Interfaces.game.screen.build_mc.visible = false;
Interfaces.game.screen.build_mc.removeEventListener(Event.ENTER_FRAME, update);
gameFlag = false;
for (_local1 in Interfaces.play.pushkaArray) {
Interfaces.play.pushkaArray[_local1].remove2();
};
for (_local2 in Interfaces.play.tankArray) {
Interfaces.play.tankArray[_local2].remove2();
};
for (_local3 in Interfaces.play.firePushkaArray) {
Interfaces.play.firePushkaArray[_local3].remove2();
};
for (_local4 in Interfaces.play.fireTankArray) {
Interfaces.play.fireTankArray[_local4].remove2();
};
if (shtab.aLive){
shtab.remove2();
};
pushkaArray = new Array();
tankArray = new Array();
firePushkaArray = new Array();
fireTankArray = new Array();
tankWay1 = true;
tankWay2 = true;
tankWay3 = true;
pushkaWay1 = true;
pushkaWay2 = true;
pushkaWay3 = true;
Comander.remove();
Interfaces.traceAchiv();
}
private function updateBuid(_arg1:Event):void{
countFrameBuild--;
if (countFrameBuild < 0){
Interfaces.game.screen.build_mc.visible = false;
Interfaces.game.screen.build_mc.removeEventListener(Event.ENTER_FRAME, updateBuid);
};
}
private function yTankRandom():Number{
var _local1:Number;
var _local2:Number = Interfaces.randomNum();
while (tryTankWay(_local2)) {
_local2++;
if (_local2 > 3){
_local2 = 1;
};
};
if (_local2 == 1){
_local1 = Interfaces.WAY1_Y;
};
if (_local2 == 2){
_local1 = Interfaces.WAY2_Y;
};
if (_local2 == 3){
_local1 = Interfaces.WAY3_Y;
};
return (_local1);
}
public function start():void{
Interfaces.game.screen.samolet.y = -271;
Interfaces.game.screen.build_mc.visible = false;
Interfaces.game.vertoletTut = false;
Interfaces.game.vertoletNetu = true;
shtab.init();
countTime = 0;
Interfaces.tankDead = 0;
Interfaces.time = 0;
gameFlag = true;
Comander.init();
countNext = 40;
countNextLimit = 90;
SoundGame.musicMain();
}
public function newTank():void{
if (((((tankWay1) || (tankWay2))) || (tankWay3))){
tankArray.push(new Tank(yTankRandom()));
};
}
public function initPushka():void{
pushkaArray.push(new Pushka(yPushkaRandom()));
pushkaArray.push(new Pushka(yPushkaRandom()));
pushkaArray.push(new Pushka(yPushkaRandom()));
}
private function tryTankWay(_arg1:Number):Boolean{
var _local2:Boolean;
if ((((_arg1 == 1)) && (tankWay1))){
_local2 = (tankWay1 = false);
};
if ((((_arg1 == 2)) && (tankWay2))){
_local2 = (tankWay2 = false);
};
if ((((_arg1 == 3)) && (tankWay3))){
_local2 = (tankWay3 = false);
};
return (_local2);
}
public function newPushka():void{
if (((((pushkaWay1) || (pushkaWay2))) || (pushkaWay3))){
if (!Interfaces.game.screen.build_mc.visible){
pushkaArray.push(new Pushka(yPushkaRandom()));
countFrameBuild = (Interfaces.randomNum(20) + 40);
Interfaces.game.screen.build_mc.visible = true;
Interfaces.game.screen.build_mc.addEventListener(Event.ENTER_FRAME, updateBuid);
};
};
}
private function yPushkaRandom():MovieClip{
var _local1:MovieClip;
var _local2:Number = Interfaces.randomNum();
while (tryPushkaWay(_local2)) {
_local2++;
if (_local2 > 3){
_local2 = 1;
};
};
if (_local2 == 1){
_local1 = Interfaces.game.screen.pushka1;
};
if (_local2 == 2){
_local1 = Interfaces.game.screen.pushka2;
};
if (_local2 == 3){
_local1 = Interfaces.game.screen.pushka3;
};
return (_local1);
}
}
}//package
Section 42
//Pushka (Pushka)
package {
import flash.events.*;
import flash.display.*;
public final class Pushka {
private var maxCountFire:Number;// = 46
private var ready:Boolean;// = true
private var countFire:Number;// = 0
private var attack:Boolean;// = false
public var aLive:Boolean;// = true
public var pushka:MovieClip;
private var countAttack:Number;// = 0
public function Pushka(_arg1:MovieClip){
pushka = _arg1;
if (pushka.currentFrame != 1){
SoundGame.newPushka();
};
pushka.gotoAndStop(1);
BtnInit.btnMode(pushka);
pushka.addEventListener(MouseEvent.MOUSE_DOWN, onFire);
pushka.addEventListener(Event.ENTER_FRAME, onEnter);
}
public function remove():void{
if (aLive){
aLive = false;
deleteArray();
if (pushka.name == "pushka1"){
Interfaces.play.pushkaWay1 = true;
};
if (pushka.name == "pushka2"){
Interfaces.play.pushkaWay2 = true;
};
if (pushka.name == "pushka3"){
Interfaces.play.pushkaWay3 = true;
};
BtnInit.btnDisable(pushka);
pushka.removeEventListener(MouseEvent.MOUSE_DOWN, onFire);
pushka.removeEventListener(Event.ENTER_FRAME, onEnter);
};
}
public function damage():void{
if (aLive){
pushka.gotoAndPlay("damage");
SoundGame.boom();
remove();
};
}
private function onFire(_arg1:MouseEvent):void{
if (((ready) && (Comander.ready))){
Comander.clip.gotoAndPlay(4);
Comander.ready = false;
SoundGame.firePushka();
countAttack = 0;
attack = true;
ready = false;
pushka.gotoAndPlay(2);
countFire = 0;
maxCountFire = (45 + Interfaces.randomNum(5));
} else {
SoundGame.chikPushka();
};
}
private function onEnter(_arg1:Event):void{
if (!ready){
countFire++;
if (countFire > maxCountFire){
ready = true;
};
};
if (attack){
countAttack++;
if (countAttack > 22){
attack = false;
Interfaces.play.firePushkaArray.push(new FirePushka(pushka));
};
};
}
public function deleteArray():void{
var _local1:String;
for (_local1 in Interfaces.play.pushkaArray) {
if (this == Interfaces.play.pushkaArray[_local1]){
Interfaces.play.pushkaArray.splice(int(_local1), 1);
break;
};
};
}
public function remove2():void{
if (aLive){
aLive = false;
if (pushka.name == "pushka1"){
Interfaces.play.pushkaWay1 = true;
};
if (pushka.name == "pushka2"){
Interfaces.play.pushkaWay2 = true;
};
if (pushka.name == "pushka3"){
Interfaces.play.pushkaWay3 = true;
};
BtnInit.btnDisable(pushka);
pushka.removeEventListener(MouseEvent.MOUSE_DOWN, onFire);
pushka.removeEventListener(Event.ENTER_FRAME, onEnter);
};
}
}
}//package
Section 43
//Shtab (Shtab)
package {
import flash.events.*;
import flash.display.*;
public final class Shtab {
public var shtab:MovieClip;
public var aLive:Boolean;// = true
private var life:Number;// = 100
private var countFRame:Number;// = 0
public static const NEWGAME:int = 2;
public static const BOOM:int = 15;
public static const GAMEOVER:int = 34;
public static const LIFE90:int = 12;
public static const LIFE30:int = 14;
public static const LIFE60:int = 13;
public function Shtab(){
shtab = Interfaces.game.screen.shtab;
BtnInit.btnMode(shtab);
shtab.addEventListener(MouseEvent.MOUSE_DOWN, onFire);
}
private function remove():void{
Interfaces.play.dead = true;
aLive = false;
BtnInit.btnDisable(shtab);
shtab.removeEventListener(MouseEvent.MOUSE_DOWN, onFire);
shtab.gotoAndPlay(BOOM);
Interfaces.play.gameOver();
Comander.damage();
}
public function remove2():void{
aLive = false;
BtnInit.btnDisable(shtab);
shtab.removeEventListener(MouseEvent.MOUSE_DOWN, onFire);
shtab.gotoAndPlay(GAMEOVER);
}
public function damage():void{
SoundGame.shtabDamage();
life = (life - 10);
if (life < 100){
shtab.gotoAndStop(LIFE90);
};
if (life < 70){
shtab.gotoAndStop(LIFE60);
};
if (life < 40){
shtab.gotoAndStop(LIFE30);
};
if ((((life < 1)) && (aLive))){
remove();
};
}
public function init():void{
life = 100;
aLive = true;
BtnInit.btnMode(shtab);
shtab.addEventListener(MouseEvent.MOUSE_DOWN, onFire);
}
private function onFire(_arg1:MouseEvent):void{
Interfaces.play.newPushka();
}
}
}//package
Section 44
//ShtabBoom (ShtabBoom)
package {
import flash.media.*;
public dynamic class ShtabBoom extends Sound {
}
}//package
Section 45
//SoundBattle (SoundBattle)
package {
import flash.media.*;
public dynamic class SoundBattle extends Sound {
}
}//package
Section 46
//SoundGame (SoundGame)
package {
import flash.media.*;
public final class SoundGame {
private static var sndBattle:Sound = new SoundBattle();
private static var musicChanel:SoundChannel = null;
public static var volumeTransform:SoundTransform = new SoundTransform();
private static var sndHelip:Sound = new Helicop();
private static var sndFirePushka:Sound = new FirePushkaSound();
private static var sndMusicMain:Sound = new MusicMain();
private static var music:Sound;
private static var sndMouseOver:Sound = new MouseOver();
private static var sndShtabBoom:Sound = new ShtabBoom();
private static var sndNewPushka:Sound = new NewPushka();
private static var sndFireTank:Sound = new FireTankSound();
private static var sndMusicGameOver:Sound = new MusicGameOver();
private static var sndChikPushka:Sound = new ChikPushka();
private static var sndMiniBoom:Sound = new MiniBoom();
private static var sndBoom:Sound = new Boom();
private static var musicChanel3:SoundChannel = null;
private static var musicChanel2:SoundChannel = null;
public static function chikPushka():void{
sndChikPushka.play(0, 0, volumeTransform);
}
public static function mouseOver():void{
sndMouseOver.play(0, 0, volumeTransform);
}
public static function helicopSndStop():void{
if (musicChanel3 != null){
musicChanel3.stop();
};
}
public static function musicGameOver():void{
musicStop();
music = sndMusicGameOver;
musicPlay();
}
public static function shtabDamage():void{
boom();
}
public static function shtabBoom():void{
sndShtabBoom.play(0, 0, volumeTransform);
}
public static function newPushka():void{
sndNewPushka.play(0, 0, volumeTransform);
}
public static function firePushka():void{
sndFirePushka.play(0, 0, volumeTransform);
}
public static function musicStop():void{
if (musicChanel != null){
musicChanel.stop();
};
if (musicChanel2 != null){
musicChanel2.stop();
};
if (musicChanel3 != null){
musicChanel3.stop();
};
}
public static function fireTank():void{
sndFireTank.play(0, 0, volumeTransform);
}
public static function helicopSndPlay():void{
musicChanel3 = sndHelip.play(0, 999);
}
public static function musicLevel():void{
if (volumeTransform.volume == 1){
volumeTransform.volume = 0;
Interfaces.game.screen.sndClip.gotoAndStop(2);
} else {
volumeTransform.volume = 1;
Interfaces.game.screen.sndClip.gotoAndStop(1);
};
musicSet();
}
public static function miniBoom():void{
sndMiniBoom.play(0, 0, volumeTransform);
}
public static function boom():void{
sndBoom.play(0, 0, volumeTransform);
}
private static function musicPlay(_arg1:Boolean=false):void{
musicChanel = music.play(0, 999, volumeTransform);
if (_arg1){
musicChanel2 = sndBattle.play(0, 999, volumeTransform);
};
}
private static function musicSet():void{
if (musicChanel != null){
musicChanel.soundTransform = volumeTransform;
};
if (musicChanel2 != null){
musicChanel2.soundTransform = volumeTransform;
};
if (musicChanel3 != null){
musicChanel3.soundTransform = volumeTransform;
};
Interfaces.game.screen.soundTransform = volumeTransform;
}
public static function musicMain():void{
musicStop();
music = sndMusicMain;
musicPlay(true);
}
}
}//package
Section 47
//Tank (Tank)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
public final class Tank {
private var speed:Number;
private var reload:Number;// = 200
private var sndChannel:SoundChannel;
private var ready:Boolean;// = false
private var countFire:Number;
private var sndMove:Sound;
public var tank:MovieClip;
public var aLive:Boolean;// = true
private var speedRandom:Number;// = 1
private var maxX:Number;
private var fire:Boolean;// = false
private var minCountFire:Number;
public function Tank(_arg1:Number){
var _local2:Number = koefHard();
countFire = (120 + (70 * _local2));
reload = (reload - ((reload / 3) * _local2));
speedRandom = (speedRandom + (3 * _local2));
maxX = (85 + Interfaces.randomNum(20));
randomizeTank();
sndChannel = sndMove.play(0, 999, SoundGame.volumeTransform);
tank.name = "tank";
tank.gotoAndStop(1);
tank.y = _arg1;
tank.x = 330;
speed = ((speedRandom / 2) + (Interfaces.randomNum(((speedRandom / 2) * 10)) / 10));
Interfaces.game.screen.addChild(tank);
minCountFire = reload;
tank.addEventListener(Event.ENTER_FRAME, onEnter);
}
private function randomizeTank():void{
var _local1 = 4;
var _local2:Number = koefHard();
if (Interfaces.play.countTime > 1000){
_local1 = 12;
} else {
if (Interfaces.play.countTime > 2000){
_local1 = 8;
};
};
var _local3:Number = Interfaces.randomNum(_local1);
if (_local3 == 1){
tank = new Tank1Clip();
reload = (reload + (reload / 4));
sndMove = new TankMoveNormalSnd();
} else {
if (_local3 == 2){
tank = new Tank2Clip();
reload = (reload + (reload / 4));
sndMove = new TankMoveNormalSnd();
} else {
if (_local3 == 3){
tank = new Tank3Clip();
reload = (reload + (reload / 4));
sndMove = new TankMoveNormalSnd();
} else {
if (_local3 == 4){
tank = new Tank4Clip();
reload = (reload + (reload / 4));
sndMove = new TankMoveNormalSnd();
} else {
if (_local3 == 5){
tank = new TankSpeed1Clip();
speedRandom = ((speedRandom * 2) + (8 * _local2));
sndMove = new TankMoveSpeedlSnd();
} else {
if (_local3 == 6){
tank = new TankSpeed2Clip();
speedRandom = ((speedRandom * 2) + (8 * _local2));
sndMove = new TankMoveSpeedlSnd();
} else {
if (_local3 == 7){
tank = new TankSpeed3Clip();
speedRandom = ((speedRandom * 2) + (8 * _local2));
sndMove = new TankMoveSpeedlSnd();
} else {
if (_local3 == 8){
tank = new TankSpeed4Clip();
speedRandom = ((speedRandom * 2) + (8 * _local2));
sndMove = new TankMoveSpeedlSnd();
} else {
if (_local3 == 9){
tank = new TankRepid1Clip();
reload = (reload - ((reload / 3) * _local2));
sndMove = new TankMoveRapidSnd();
maxX = (205 + Interfaces.randomNum(20));
} else {
if (_local3 == 10){
tank = new TankRepid2Clip();
reload = (reload - ((reload / 3) * _local2));
sndMove = new TankMoveRapidSnd();
maxX = (205 + Interfaces.randomNum(20));
} else {
if (_local3 == 11){
tank = new TankRepid3Clip();
reload = (reload - ((reload / 3) * _local2));
sndMove = new TankMoveRapidSnd();
maxX = (205 + Interfaces.randomNum(20));
} else {
tank = new TankRepid4Clip();
reload = (reload - ((reload / 3) * _local2));
sndMove = new TankMoveRapidSnd();
maxX = (205 + Interfaces.randomNum(20));
};
};
};
};
};
};
};
};
};
};
};
}
public function remove():void{
if (aLive){
aLive = false;
deleteArray();
if (tank.y == Interfaces.WAY1_Y){
Interfaces.play.tankWay1 = true;
};
if (tank.y == Interfaces.WAY2_Y){
Interfaces.play.tankWay2 = true;
};
if (tank.y == Interfaces.WAY3_Y){
Interfaces.play.tankWay3 = true;
};
tank.removeEventListener(Event.ENTER_FRAME, onEnter);
Interfaces.game.screen.removeChild(tank);
if (sndChannel != null){
sndChannel.stop();
};
sndChannel = null;
};
}
private function koefHard():Number{
var _local1:Number = (Interfaces.play.countTime / 25000);
if (_local1 > 1){
_local1 = 1;
};
return (_local1);
}
public function remove2():void{
if (aLive){
aLive = false;
if (tank.y == Interfaces.WAY1_Y){
Interfaces.play.tankWay1 = true;
};
if (tank.y == Interfaces.WAY2_Y){
Interfaces.play.tankWay2 = true;
};
if (tank.y == Interfaces.WAY3_Y){
Interfaces.play.tankWay3 = true;
};
tank.removeEventListener(Event.ENTER_FRAME, onEnter);
Interfaces.game.screen.removeChild(tank);
if (sndChannel != null){
sndChannel.stop();
};
sndChannel = null;
};
}
public function damage():void{
if (aLive){
aLive = false;
deleteArray();
Interfaces.tankDead++;
if (tank.y == Interfaces.WAY1_Y){
Interfaces.play.tankWay1 = true;
};
if (tank.y == Interfaces.WAY2_Y){
Interfaces.play.tankWay2 = true;
};
if (tank.y == Interfaces.WAY3_Y){
Interfaces.play.tankWay3 = true;
};
tank.gotoAndPlay("damage");
SoundGame.boom();
tank.removeEventListener(Event.ENTER_FRAME, onEnter);
if (sndChannel != null){
sndChannel.stop();
};
sndChannel = null;
};
}
public function deleteArray():void{
var _local1:String;
for (_local1 in Interfaces.play.tankArray) {
if (this == Interfaces.play.tankArray[_local1]){
Interfaces.play.tankArray.splice(int(_local1), 1);
break;
};
};
}
private function onEnter(_arg1:Event):void{
if (fire){
if (((ready) && (fire))){
SoundGame.fireTank();
tank.gotoAndPlay(2);
Interfaces.play.fireTankArray.push(new FireTank(tank));
ready = false;
countFire = Interfaces.randomNum((minCountFire / 4));
} else {
if (!ready){
countFire++;
if (countFire > minCountFire){
ready = true;
};
};
};
} else {
tank.x = (tank.x - speed);
if (tank.x < maxX){
tank.x = maxX;
fire = true;
sndChannel.stop();
sndChannel = null;
};
};
}
}
}//package
Section 48
//Tank1Clip (Tank1Clip)
package {
import flash.display.*;
public dynamic class Tank1Clip extends MovieClip {
public function Tank1Clip(){
addFrameScript(0, frame1, 6, frame7, 30, frame31);
}
function frame7(){
this.gotoAndStop(1);
}
function frame31(){
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
}
}//package
Section 49
//Tank2Clip (Tank2Clip)
package {
import flash.display.*;
public dynamic class Tank2Clip extends MovieClip {
public function Tank2Clip(){
addFrameScript(0, frame1, 6, frame7, 30, frame31);
}
function frame7(){
this.gotoAndStop(1);
}
function frame31(){
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
}
}//package
Section 50
//Tank3Clip (Tank3Clip)
package {
import flash.display.*;
public dynamic class Tank3Clip extends MovieClip {
public function Tank3Clip(){
addFrameScript(0, frame1, 6, frame7, 30, frame31);
}
function frame7(){
this.gotoAndStop(1);
}
function frame31(){
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
}
}//package
Section 51
//Tank4Clip (Tank4Clip)
package {
import flash.display.*;
public dynamic class Tank4Clip extends MovieClip {
public function Tank4Clip(){
addFrameScript(0, frame1, 6, frame7, 30, frame31);
}
function frame7(){
this.gotoAndStop(1);
}
function frame31(){
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
}
}//package
Section 52
//TankInvasion (TankInvasion)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class TankInvasion extends MovieClip {
private var game:Game;
public var mochiRoot:DownloaderMochi;
public var shared:SharedObject;
public function TankInvasion(_arg1:DownloaderMochi){
stop();
mochiRoot = _arg1;
MochiBot.track(mochiRoot, "6ca23ead");
this.addEventListener(Event.ADDED_TO_STAGE, initFirst);
}
private function initFirst(_arg1:Event):void{
Interfaces.myRoot = this;
this.focusRect = false;
shared = SharedObject.getLocal("maxScoreTankInv");
if (shared.data.maxTank == undefined){
shared.data.maxTank = 0;
};
if (shared.data.maxTime == undefined){
shared.data.maxTime = 0;
};
Interfaces.maxTank = shared.data.maxTank;
Interfaces.maxTime = shared.data.maxTime;
gameInit();
}
public function gameScoreInput():void{
mochiRoot.removeChild(this);
mochiRoot.initMochiScoresInput();
}
public function gameInit():void{
game = new Game();
}
}
}//package
Section 53
//TankMoveNormalSnd (TankMoveNormalSnd)
package {
import flash.media.*;
public dynamic class TankMoveNormalSnd extends Sound {
}
}//package
Section 54
//TankMoveRapidSnd (TankMoveRapidSnd)
package {
import flash.media.*;
public dynamic class TankMoveRapidSnd extends Sound {
}
}//package
Section 55
//TankMoveSpeedlSnd (TankMoveSpeedlSnd)
package {
import flash.media.*;
public dynamic class TankMoveSpeedlSnd extends Sound {
}
}//package
Section 56
//TankRepid1Clip (TankRepid1Clip)
package {
import flash.display.*;
public dynamic class TankRepid1Clip extends MovieClip {
public function TankRepid1Clip(){
addFrameScript(0, frame1, 6, frame7, 30, frame31);
}
function frame7(){
this.gotoAndStop(1);
}
function frame31(){
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
}
}//package
Section 57
//TankRepid2Clip (TankRepid2Clip)
package {
import flash.display.*;
public dynamic class TankRepid2Clip extends MovieClip {
public function TankRepid2Clip(){
addFrameScript(0, frame1, 6, frame7, 30, frame31);
}
function frame7(){
this.gotoAndStop(1);
}
function frame31(){
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
}
}//package
Section 58
//TankRepid3Clip (TankRepid3Clip)
package {
import flash.display.*;
public dynamic class TankRepid3Clip extends MovieClip {
public function TankRepid3Clip(){
addFrameScript(0, frame1, 6, frame7, 30, frame31);
}
function frame7(){
this.gotoAndStop(1);
}
function frame31(){
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
}
}//package
Section 59
//TankRepid4Clip (TankRepid4Clip)
package {
import flash.display.*;
public dynamic class TankRepid4Clip extends MovieClip {
public function TankRepid4Clip(){
addFrameScript(0, frame1, 6, frame7, 30, frame31);
}
function frame7(){
this.gotoAndStop(1);
}
function frame31(){
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
}
}//package
Section 60
//TankSpeed1Clip (TankSpeed1Clip)
package {
import flash.display.*;
public dynamic class TankSpeed1Clip extends MovieClip {
public function TankSpeed1Clip(){
addFrameScript(0, frame1, 6, frame7, 30, frame31);
}
function frame7(){
this.gotoAndStop(1);
}
function frame31(){
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
}
}//package
Section 61
//TankSpeed2Clip (TankSpeed2Clip)
package {
import flash.display.*;
public dynamic class TankSpeed2Clip extends MovieClip {
public function TankSpeed2Clip(){
addFrameScript(0, frame1, 6, frame7, 30, frame31);
}
function frame7(){
this.gotoAndStop(1);
}
function frame31(){
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
}
}//package
Section 62
//TankSpeed3Clip (TankSpeed3Clip)
package {
import flash.display.*;
public dynamic class TankSpeed3Clip extends MovieClip {
public function TankSpeed3Clip(){
addFrameScript(0, frame1, 6, frame7, 30, frame31);
}
function frame7(){
this.gotoAndStop(1);
}
function frame31(){
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
}
}//package
Section 63
//TankSpeed4Clip (TankSpeed4Clip)
package {
import flash.display.*;
public dynamic class TankSpeed4Clip extends MovieClip {
public function TankSpeed4Clip(){
addFrameScript(0, frame1, 6, frame7, 30, frame31);
}
function frame7(){
this.gotoAndStop(1);
}
function frame31(){
this.parent.removeChild(this);
}
function frame1(){
this.stop();
}
}
}//package
Section 64
//TittleDownloader (TittleDownloader)
package {
import flash.display.*;
import flash.text.*;
public dynamic class TittleDownloader extends MovieClip {
public var btnPlayStart:MovieClip;
public var procent_txt:TextField;
public var logo_mc:MovieClip;
}
}//package