STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 229595 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2595 · P5190 |
A Very Merry Christmas! |
This is the info page for Flash #74789 |
presents... |
ActionScript [AS3]
Section 1//AdLoader (CPMStar.AdLoader) package CPMStar { import flash.events.*; import flash.display.*; import flash.net.*; import flash.system.*; public class AdLoader extends Sprite { private var cpmstarLoader:Loader; private var contentspotid:String; public function AdLoader(_arg1:String){ this.contentspotid = _arg1; addEventListener(Event.ADDED, addedHandler); } private function dispatchHandler(_arg1:Event):void{ dispatchEvent(_arg1); } private function addedHandler(_arg1:Event):void{ removeEventListener(Event.ADDED, addedHandler); Security.allowDomain("server.cpmstar.com"); var _local2 = "http://server.cpmstar.com/adviewas3.swf"; var _local3:DisplayObjectContainer = parent; cpmstarLoader = new Loader(); cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler); cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler); cpmstarLoader.load(new URLRequest(((_local2 + "?contentspotid=") + contentspotid))); addChild(cpmstarLoader); } } }//package CPMStarSection 2//MochiAd (mochi.as3.MochiAd) package mochi.as3 { import flash.events.*; import flash.display.*; import flash.utils.*; import flash.net.*; import flash.system.*; public class MochiAd { public static function getVersion():String{ return ("3.0 as3"); } public static function showClickAwayAd(_arg1:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var options = _arg1; var DEFAULTS:Object = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{ }, ad_finished:function ():void{ }, ad_loaded:function (_arg1:Number, _arg2:Number):void{ }, ad_failed:function ():void{ trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software"); }, ad_skipped:function ():void{ }}; options = MochiAd._parseOptions(options, DEFAULTS); clip = options.clip; var ad_timeout:Number = options.ad_timeout; delete options.ad_timeout; if (!MochiAd.load(options)){ options.ad_failed(); options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ MochiAd._cleanup(mc); options.ad_finished(); }; var wh:Array = MochiAd._getRes(options, clip); var w:Number = wh[0]; var h:Number = wh[1]; mc.x = (w * 0.5); mc.y = (h * 0.5); chk = createEmptyMovieClip(mc, "_mochiad_wait", 3); chk.ad_timeout = ad_timeout; chk.started = getTimer(); chk.showing = false; mc.unloadAd = function ():void{ MochiAd.unload(clip); }; mc.adLoaded = options.ad_loaded; mc.adSkipped = options.ad_skipped; mc.rpc = function (_arg1:Number, _arg2:Object):void{ MochiAd.rpc(clip, _arg1, _arg2); }; var sendHostProgress:Boolean; mc.regContLC = function (_arg1:String):void{ mc._containerLCName = _arg1; }; chk["onEnterFrame"] = function ():void{ var _local4:Number; if (!this.parent){ delete this.onEnterFrame; return; }; var _local1:Object = this.parent._mochiad_ctr; var _local2:Number = (getTimer() - this.started); var _local3:Boolean; if (!chk.showing){ _local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal; if (_local4 > 0){ chk.showing = true; _local3 = true; chk.started = getTimer(); } else { if (_local2 > chk.ad_timeout){ options.ad_failed(); _local3 = true; }; }; }; if (this.root == null){ _local3 = true; }; if (_local3){ delete this.onEnterFrame; }; }; doOnEnterFrame(chk); } public static function _isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function _allowDomains(_arg1:String):String{ var _local2:String = _arg1.split("/")[2].split(":")[0]; if (Security.sandboxType == "application"){ return (_local2); }; Security.allowDomain("*"); Security.allowDomain(_local2); Security.allowInsecureDomain("*"); Security.allowInsecureDomain(_local2); return (_local2); } public static function unload(_arg1:Object):Boolean{ if (((_arg1.clip) && (_arg1.clip._mochiad))){ _arg1 = _arg1.clip; }; if (_arg1.origFrameRate != undefined){ _arg1.stage.frameRate = _arg1.origFrameRate; }; if (!_arg1._mochiad){ return (false); }; if (_arg1._mochiad._containerLCName != undefined){ _arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"}); }; if (_arg1._mochiad.onUnload){ _arg1._mochiad.onUnload(); }; delete _arg1._mochiad_loaded; delete _arg1._mochiad; return (true); } public static function showInterLevelAd(_arg1:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var options = _arg1; var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{ if ((this.clip is MovieClip)){ this.clip.stop(); } else { throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_finished:function ():void{ if ((this.clip is MovieClip)){ this.clip.play(); } else { throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_loaded:function (_arg1:Number, _arg2:Number):void{ }, ad_failed:function ():void{ trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software"); }, ad_skipped:function ():void{ }}; options = MochiAd._parseOptions(options, DEFAULTS); clip = options.clip; var ad_msec:Number = 11000; var ad_timeout:Number = options.ad_timeout; delete options.ad_timeout; var fadeout_time:Number = 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(); }; var wh:Array = MochiAd._getRes(options, clip); var w:Number = wh[0]; var h:Number = 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{ if (!this.parent){ delete this.onEnterFrame; delete this.fadeFunction; return; }; var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time))); if (_local1 > 0){ this.parent.alpha = (_local1 * 0.01); } else { MochiAd.unload(clip); delete this["onEnterFrame"]; }; }; mc.unloadAd = function ():void{ MochiAd.unload(clip); }; mc.adLoaded = options.ad_loaded; mc.adSkipped = options.ad_skipped; mc.adjustProgress = function (_arg1:Number):void{ var _local2:Object = mc._mochiad_wait; _local2.server_control = true; _local2.showing = true; _local2.started = getTimer(); _local2.ad_msec = (_arg1 - 250); }; mc.rpc = function (_arg1:Number, _arg2:Object):void{ MochiAd.rpc(clip, _arg1, _arg2); }; chk["onEnterFrame"] = function ():void{ var _local4:Number; if (!this.parent){ delete this.onEnterFrame; delete this.fadeFunction; return; }; var _local1:Object = this.parent._mochiad_ctr; var _local2:Number = (getTimer() - this.started); var _local3:Boolean; if (!chk.showing){ _local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal; if (_local4 > 0){ chk.showing = true; chk.started = getTimer(); MochiAd.adShowing(clip); } else { if (_local2 > chk.ad_timeout){ options.ad_failed(); _local3 = true; }; }; }; if (_local2 > chk.ad_msec){ _local3 = true; }; if (_local3){ if (this.server_control){ delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = this.fadeFunction; }; }; }; doOnEnterFrame(chk); } public static function _parseOptions(_arg1:Object, _arg2:Object):Object{ var _local4:String; var _local5:Array; var _local6:Number; var _local7:Array; var _local3:Object = {}; for (_local4 in _arg2) { _local3[_local4] = _arg2[_local4]; }; if (_arg1){ for (_local4 in _arg1) { _local3[_local4] = _arg1[_local4]; }; }; if (_local3.clip == undefined){ throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite.")); }; _arg1 = _local3.clip.loaderInfo.parameters.mochiad_options; if (_arg1){ _local5 = _arg1.split("&"); _local6 = 0; while (_local6 < _local5.length) { _local7 = _local5[_local6].split("="); _local3[unescape(_local7[0])] = unescape(_local7[1]); _local6++; }; }; if (_local3.id == "test"){ trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!"); }; return (_local3); } public static function _cleanup(_arg1:Object):void{ var 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); }; var idx:Number = DisplayObjectContainer(mc).numChildren; while (idx > 0) { idx = (idx - 1); DisplayObjectContainer(mc).removeChildAt(idx); }; for (k in mc) { delete mc[k]; }; } public static function load(_arg1:Object):MovieClip{ var clip:Object; var k:String; var server:String; var hostname:String; var lc:LocalConnection; var name:String; var loader:Loader; var g:Function; var req:URLRequest; var v:Object; var options = _arg1; var DEFAULTS:Object = {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.")); }; var depth:Number = options.depth; delete options.depth; var mc:MovieClip = createEmptyMovieClip(clip, "_mochiad", depth); var wh:Array = 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; } else { trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal"); }; var lv:URLVariables = new URLVariables(); for (k in options) { v = options[k]; if (!(v is Function)){ lv[k] = v; }; }; server = lv.server; delete lv.server; hostname = _allowDomains(server); lc = new LocalConnection(); lc.client = mc; name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_"); lc.allowDomain("*", "localhost"); lc.allowInsecureDomain("*", "localhost"); lc.connect(name); mc.lc = lc; mc.lcName = name; lv.lc = name; lv.st = getTimer(); loader = new Loader(); g = function (_arg1:Object):void{ _arg1.target.removeEventListener(_arg1.type, arguments.callee); MochiAd.unload(clip); }; loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g); req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime())); req.contentType = "application/x-www-form-urlencoded"; req.method = URLRequestMethod.POST; req.data = lv; loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{ trace("[MochiAds] Blocked URL"); }); loader.load(req); mc.addChild(loader); mc._mochiad_ctr = loader; return (mc); } public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{ var _local4:Array = _arg2.split("."); var _local5:Number = 0; while (_local5 < (_local4.length - 1)) { if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){ return (undefined); }; _arg1 = _arg1[_local4[_local5]]; _local5++; }; if (typeof(_arg1[_local4[_local5]]) == "function"){ return (_arg1[_local4[_local5]].apply(_arg1, _arg3)); }; return (undefined); } public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{ var _local4:MovieClip = new MovieClip(); if (((false) && (_arg3))){ _arg1.addChildAt(_local4, _arg3); } else { _arg1.addChild(_local4); }; _arg1[_arg2] = _local4; _local4["_name"] = _arg2; return (_local4); } public static function _getRes(_arg1:Object, _arg2:Object):Array{ var _local6:Array; var _local3:Object = _arg2.getBounds(_arg2.root); var _local4:Number = 0; var _local5:Number = 0; if (typeof(_arg1.res) != "undefined"){ _local6 = _arg1.res.split("x"); _local4 = parseFloat(_local6[0]); _local5 = parseFloat(_local6[1]); } else { _local4 = (_local3.xMax - _local3.xMin); _local5 = (_local3.yMax - _local3.yMin); }; if ((((_local4 == 0)) || ((_local5 == 0)))){ _local4 = _arg2.stage.stageWidth; _local5 = _arg2.stage.stageHeight; }; return ([_local4, _local5]); } public static function adShowing(_arg1:Object):void{ _arg1.origFrameRate = _arg1.stage.frameRate; _arg1.stage.frameRate = 30; } public static function getValue(_arg1:Object, _arg2:String):Object{ var _local3:Array = _arg2.split("."); var _local4:Number = 0; while (_local4 < (_local3.length - 1)) { if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){ return (undefined); }; _arg1 = _arg1[_local3[_local4]]; _local4++; }; return (_arg1[_local3[_local4]]); } public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{ var _local4:Object; var _local5:Object; switch (_arg3.id){ case "setValue": MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value); break; case "getValue": _local4 = MochiAd.getValue(_arg1, _arg3.objectName); _arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4); break; case "runMethod": _local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args); _arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5); break; default: trace(("[mochiads rpc] unknown rpc id: " + _arg3.id)); }; } public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{ var _local4:Array = _arg2.split("."); var _local5:Number = 0; while (_local5 < (_local4.length - 1)) { if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){ return; }; _arg1 = _arg1[_local4[_local5]]; _local5++; }; _arg1[_local4[_local5]] = _arg3; } public static function showPreGameAd(_arg1:Object):void{ var clip:Object; var mc:MovieClip; var chk:MovieClip; var complete:Boolean; var unloaded:Boolean; var sendHostProgress:Boolean; var fn:Function; var r:MovieClip; var options = _arg1; var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{ if ((this.clip is MovieClip)){ this.clip.stop(); } else { throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_finished:function ():void{ if ((this.clip is MovieClip)){ this.clip.play(); } else { throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers.")); }; }, ad_loaded:function (_arg1:Number, _arg2:Number):void{ }, ad_failed:function ():void{ trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software"); }, ad_skipped:function ():void{ }, ad_progress:function (_arg1:Number):void{ }}; options = MochiAd._parseOptions(options, DEFAULTS); if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){ options.ad_started(); fn = function ():void{ options.ad_finished(); }; setTimeout(fn, 100); return; }; clip = options.clip; var ad_msec:Number = 11000; var ad_timeout:Number = options.ad_timeout; delete options.ad_timeout; var fadeout_time:Number = 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); var fn:Function = function ():void{ options.ad_finished(); }; setTimeout(fn, 100); }; var wh:Array = MochiAd._getRes(options, clip); var w:Number = wh[0]; var h:Number = 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); var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4); if (options.no_progress_bar){ bar.visible = false; delete options.no_progress_bar; } else { bar.x = 10; bar.y = (h - 20); }; var bar_color:Number = options.color; delete options.color; var bar_background:Number = options.background; delete options.background; var bar_outline:Number = options.outline; delete options.outline; var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1); var backing:Object = 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(); var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2); var inside:Object = 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; var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3); var outline:Object = 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 = (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; var f:Function = function (_arg1:Event):void{ _arg1.target.removeEventListener(_arg1.type, arguments.callee); complete = true; if (unloaded){ MochiAd.unload(clip); }; }; clip.loaderInfo.addEventListener(Event.COMPLETE, f); if ((clip.root is MovieClip)){ r = (clip.root as MovieClip); if (r.framesLoaded >= r.totalFrames){ complete = true; }; }; mc.unloadAd = function ():void{ unloaded = true; if (complete){ MochiAd.unload(clip); }; }; mc.adLoaded = options.ad_loaded; mc.adSkipped = options.ad_skipped; mc.adjustProgress = function (_arg1:Number):void{ var _local2:Object = mc._mochiad_wait; _local2.server_control = true; _local2.showing = true; _local2.started = getTimer(); _local2.ad_msec = _arg1; }; mc.rpc = function (_arg1:Number, _arg2:Object):void{ MochiAd.rpc(clip, _arg1, _arg2); }; mc.rpcTestFn = function (_arg1:String):Object{ trace(("[MOCHIAD rpcTestFn] " + _arg1)); return (_arg1); }; mc.regContLC = function (_arg1:String):void{ mc._containerLCName = _arg1; }; sendHostProgress = false; mc.sendHostLoadProgress = function (_arg1:String):void{ sendHostProgress = true; }; chk["onEnterFrame"] = function ():void{ var _local11:Number; if (((!(this.parent)) || (!(this.parent.parent)))){ delete this["onEnterFrame"]; return; }; var _local1:Object = this.parent.parent.root; var _local2:Object = this.parent._mochiad_ctr; var _local3:Number = (getTimer() - this.started); var _local4:Boolean; var _local5:Number = _local1.loaderInfo.bytesTotal; var _local6:Number = _local1.loaderInfo.bytesLoaded; if (complete){ _local6 = Math.max(1, _local6); _local5 = _local6; }; var _local7:Number = ((100 * _local6) / _local5); var _local8:Number = ((100 * _local3) / chk.ad_msec); var _local9:Object = this._mochiad_bar._inside; var _local10:Number = Math.min(100, Math.min(((_local7) || (0)), _local8)); _local10 = Math.max(this.last_pcnt, _local10); this.last_pcnt = _local10; _local9.scaleX = (_local10 * 0.01); options.ad_progress(_local10); if (sendHostProgress){ clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7}); if (_local7 == 100){ sendHostProgress = false; }; }; if (!chk.showing){ _local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal; if (_local11 > 0){ chk.showing = true; chk.started = getTimer(); MochiAd.adShowing(clip); } else { if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){ options.ad_failed(); _local4 = true; }; }; }; if (_local3 > chk.ad_msec){ _local4 = true; }; if (((complete) && (_local4))){ if (this.server_control){ delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = chk.fadeFunction; }; }; }; doOnEnterFrame(chk); } public static function showPreloaderAd(_arg1:Object):void{ trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0"); MochiAd.showPreGameAd(_arg1); } public static function showTimedAd(_arg1:Object):void{ trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0"); MochiAd.showInterLevelAd(_arg1); } public static function doOnEnterFrame(_arg1:MovieClip):void{ var mc = _arg1; var f:Function = 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 mochi.as3Section 3//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.as3Section 4//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; }; }; 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{ MochiScores.boardID = _arg1; MochiServices.send("scores_setBoardID", {boardID:_arg1}); } } }//package mochi.as3Section 5//MochiServices (mochi.as3.MochiServices) package mochi.as3 { import flash.events.*; import flash.display.*; import flash.geom.*; 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; 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 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.0"); } 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; 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.as3Section 6//BitmapAsset (mx.core.BitmapAsset) package mx.core { import flash.display.*; public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject { mx_internal static const VERSION:String = "3.0.0.0"; public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } public function get measuredWidth():Number{ if (bitmapData){ return (bitmapData.width); }; return (0); } public function get measuredHeight():Number{ if (bitmapData){ return (bitmapData.height); }; return (0); } public function setActualSize(_arg1:Number, _arg2:Number):void{ width = _arg1; height = _arg2; } public function move(_arg1:Number, _arg2:Number):void{ this.x = _arg1; this.y = _arg2; } } }//package mx.coreSection 7//EdgeMetrics (mx.core.EdgeMetrics) package mx.core { public class EdgeMetrics { public var top:Number; public var left:Number; public var bottom:Number; public var right:Number; mx_internal static const VERSION:String = "3.0.0.0"; public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0); ; public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){ this.left = _arg1; this.top = _arg2; this.right = _arg3; this.bottom = _arg4; } public function clone():EdgeMetrics{ return (new EdgeMetrics(left, top, right, bottom)); } } }//package mx.coreSection 8//FlexBitmap (mx.core.FlexBitmap) package mx.core { import flash.display.*; import mx.utils.*; public class FlexBitmap extends Bitmap { mx_internal static const VERSION:String = "3.0.0.0"; public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){ var bitmapData = _arg1; var pixelSnapping = _arg2; var smoothing = _arg3; super(bitmapData, pixelSnapping, smoothing); try { name = NameUtil.createUniqueName(this); } catch(e:Error) { }; } override public function toString():String{ return (NameUtil.displayObjectToString(this)); } } }//package mx.coreSection 9//FlexMovieClip (mx.core.FlexMovieClip) package mx.core { import flash.display.*; import mx.utils.*; public class FlexMovieClip extends MovieClip { mx_internal static const VERSION:String = "3.0.0.0"; public function FlexMovieClip(){ super(); try { name = NameUtil.createUniqueName(this); } catch(e:Error) { }; } override public function toString():String{ return (NameUtil.displayObjectToString(this)); } } }//package mx.coreSection 10//FontAsset (mx.core.FontAsset) package mx.core { import flash.text.*; public class FontAsset extends Font implements IFlexAsset { mx_internal static const VERSION:String = "3.0.0.0"; } }//package mx.coreSection 11//IBorder (mx.core.IBorder) package mx.core { public interface IBorder { function get borderMetrics():EdgeMetrics; } }//package mx.coreSection 12//IFlexAsset (mx.core.IFlexAsset) package mx.core { public interface IFlexAsset { } }//package mx.coreSection 13//IFlexDisplayObject (mx.core.IFlexDisplayObject) package mx.core { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.accessibility.*; public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher { function get visible():Boolean; function get rotation():Number; function localToGlobal(_arg1:Point):Point; function get name():String; function set width(_arg1:Number):void; function get measuredHeight():Number; function get blendMode():String; function get scale9Grid():Rectangle; function set name(_arg1:String):void; function set scaleX(_arg1:Number):void; function set scaleY(_arg1:Number):void; function get measuredWidth():Number; function get accessibilityProperties():AccessibilityProperties; function set scrollRect(_arg1:Rectangle):void; function get cacheAsBitmap():Boolean; function globalToLocal(_arg1:Point):Point; function get height():Number; function set blendMode(_arg1:String):void; function get parent():DisplayObjectContainer; function getBounds(_arg1:DisplayObject):Rectangle; function get opaqueBackground():Object; function set scale9Grid(_arg1:Rectangle):void; function setActualSize(_arg1:Number, _arg2:Number):void; function set alpha(_arg1:Number):void; function set accessibilityProperties(_arg1:AccessibilityProperties):void; function get width():Number; function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean; function set cacheAsBitmap(_arg1:Boolean):void; function get scaleX():Number; function get scaleY():Number; function get scrollRect():Rectangle; function get mouseX():Number; function get mouseY():Number; function set height(_arg1:Number):void; function set mask(_arg1:DisplayObject):void; function getRect(_arg1:DisplayObject):Rectangle; function get alpha():Number; function set transform(_arg1:Transform):void; function move(_arg1:Number, _arg2:Number):void; function get loaderInfo():LoaderInfo; function get root():DisplayObject; function hitTestObject(_arg1:DisplayObject):Boolean; function set opaqueBackground(_arg1:Object):void; function set visible(_arg1:Boolean):void; function get mask():DisplayObject; function set x(_arg1:Number):void; function set y(_arg1:Number):void; function get transform():Transform; function set filters(_arg1:Array):void; function get x():Number; function get y():Number; function get filters():Array; function set rotation(_arg1:Number):void; function get stage():Stage; } }//package mx.coreSection 14//IRepeaterClient (mx.core.IRepeaterClient) package mx.core { public interface IRepeaterClient { function get instanceIndices():Array; function set instanceIndices(_arg1:Array):void; function get isDocument():Boolean; function set repeaters(_arg1:Array):void; function initializeRepeaterArrays(_arg1:IRepeaterClient):void; function get repeaters():Array; function set repeaterIndices(_arg1:Array):void; function get repeaterIndices():Array; } }//package mx.coreSection 15//MovieClipAsset (mx.core.MovieClipAsset) package mx.core { public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder { private var _measuredHeight:Number; private var _measuredWidth:Number; mx_internal static const VERSION:String = "3.0.0.0"; public function MovieClipAsset(){ _measuredWidth = width; _measuredHeight = height; } public function get measuredWidth():Number{ return (_measuredWidth); } public function get measuredHeight():Number{ return (_measuredHeight); } public function setActualSize(_arg1:Number, _arg2:Number):void{ width = _arg1; height = _arg2; } public function move(_arg1:Number, _arg2:Number):void{ this.x = _arg1; this.y = _arg2; } public function get borderMetrics():EdgeMetrics{ if (scale9Grid == null){ return (EdgeMetrics.EMPTY); }; return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom)))); } } }//package mx.coreSection 16//mx_internal (mx.core.mx_internal) package mx.core { public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal"; }//package mx.coreSection 17//SoundAsset (mx.core.SoundAsset) package mx.core { import flash.media.*; public class SoundAsset extends Sound implements IFlexAsset { mx_internal static const VERSION:String = "3.0.0.0"; } }//package mx.coreSection 18//NameUtil (mx.utils.NameUtil) package mx.utils { import flash.display.*; import mx.core.*; import flash.utils.*; public class NameUtil { mx_internal static const VERSION:String = "3.0.0.0"; private static var counter:int = 0; public static function displayObjectToString(_arg1:DisplayObject):String{ var _local2:String; var _local4:String; var _local5:Array; var _local3:DisplayObject = _arg1; while (_local3 != null) { if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){ break; }; _local4 = _local3.name; if ((_local3 is IRepeaterClient)){ _local5 = IRepeaterClient(_local3).instanceIndices; if (_local5){ _local4 = (_local4 + (("[" + _local5.join("][")) + "]")); }; }; _local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2); _local3 = _local3.parent; }; return (_local2); } public static function createUniqueName(_arg1:Object):String{ if (!_arg1){ return (null); }; var _local2:String = getQualifiedClassName(_arg1); var _local3:int = _local2.indexOf("::"); if (_local3 != -1){ _local2 = _local2.substr((_local3 + 2)); }; var _local4:int = _local2.charCodeAt((_local2.length - 1)); if ((((_local4 >= 48)) && ((_local4 <= 57)))){ _local2 = (_local2 + "_"); }; return ((_local2 + counter++)); } } }//package mx.utilsSection 19//Advertisment (Advertisment) package { import flash.display.*; public dynamic class Advertisment extends Sprite { } }//packageSection 20//Beam (Beam) package { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.utils.*; public class Beam extends Sprite { private var count:int;// = 0 private var startWave2:Boolean;// = false private var colorOfs:Number;// = 0 private var startWave1:Boolean;// = false private var Iside:Array; public var app:LaserBox; private var PosX:int; private var PosY:int; public var iXX:Number; public var iXY:Number; private var Iprogrs:Array; public var isLaser:Boolean;// = false public var stageHeight:Number; public var iYX:Number; public var iYY:Number; private var currWave:Number;// = 0 private var IposX:Array; private var IposY:Array; public var prevTimer:int;// = 0 private var image:Bitmap; private var ItoCntr:Array; public var timer:Timer; public var currSizeX:Number; public var currSizeY:Number; public var stageWidth:Number; private var imageWave:Bitmap; private var Side:int; private static var imgBeam2:Bitmap = new Resources.imgBeam2(); private static var imgBeam1:Bitmap = new Resources.imgBeam1(); public static var lastImpulse:Beam = null; public function Beam(){ stageWidth = Preloader.stageWidth; stageHeight = Preloader.stageHeight; app = LaserBox.gameApp; iXX = app.field.iXX; iXY = app.field.iXY; iYX = app.field.iYX; iYY = app.field.iYY; currSizeX = app.field.currSizeX; currSizeY = app.field.currSizeY; Iprogrs = new Array(3); IposX = new Array(3); IposY = new Array(3); Iside = new Array(3); ItoCntr = new Array(3); timer = new Timer(25); super(); var _local1:int = ((38 + (iXX * currSizeX)) + (iYX * currSizeY)); var _local2:int = ((30 - (iXY * currSizeY)) + (iYY * currSizeY)); image = new Bitmap(new BitmapData(_local1, _local2, true, 0xFFFFFF)); addChild(image); imageWave = new Bitmap(new BitmapData(10, 11, true, 0xFFFFFF)); addChild(imageWave); app.layers[3].addChild(this); x = (332 - (app.field.iXX * app.field.currSizeX)); y = 156; app.layers[3].mouseEnabled = false; cacheAsBitmap = true; mouseEnabled = false; prevTimer = getTimer(); timer.addEventListener(TimerEvent.TIMER, onEnterFrame); timer.start(); } public function Deactivate():void{ if (isLaser){ app.sndControl.Stop(2); }; app.field.beams.splice(app.field.beams.indexOf(this), 1); parent.removeChild(this); if (lastImpulse == this){ lastImpulse = null; }; app = null; image = null; imageWave = null; timer.stop(); timer.removeEventListener(TimerEvent.TIMER, onEnterFrame); } private function onEnterFrame(_arg1:Event):void{ var _local4:int; var _local2:int = getTimer(); var _local3:Number = ((_local2 - prevTimer) / 1000); prevTimer = _local2; if (startWave1){ imageWave.bitmapData.copyPixels(Resources.imgBeamWave1[Math.floor(currWave)].bitmapData, new Rectangle(0, 0, 8, 11), new Point(0, 0)); currWave = (currWave + (_local3 * 8)); if (currWave >= 3){ currWave = 0; }; } else { if (startWave2){ imageWave.bitmapData.copyPixels(Resources.imgBeamWave2[Math.floor(currWave)].bitmapData, new Rectangle(0, 0, 10, 10), new Point(0, 0)); currWave = (currWave + (_local3 * 8)); if (currWave >= 3){ currWave = 0; }; }; }; if (!isLaser){ BuildImpulseBeam(_local3); } else { colorOfs = (colorOfs + (_local3 * 15)); _local4 = ((Utils.GetSin(((colorOfs / 4) * 57.295779)) * 30) + 225); image.bitmapData.colorTransform(new Rectangle(0, 0, image.width, image.height), new ColorTransform(1, 0, 1, 1, 0, _local4)); }; } private function BuildImpulseBeam(_arg1:Number):void{ var _local2:Rectangle; var _local3:Point; var _local4:int; var _local6:int; var _local7:int; image.bitmapData.fillRect(new Rectangle(0, 0, image.width, image.height), 0xFFFFFF); var _local5:int; while (_local5 < 3) { _local6 = -1; _local7 = -1; if ((((((((((((((_local5 == 2)) || ((count > 0)))) && ((((count - (2 - _local5)) / 2) <= (currSizeX + 1))))) && ((IposX[_local5] >= -1)))) && ((IposX[_local5] <= currSizeX)))) && ((IposY[_local5] >= -1)))) && ((IposY[_local5] <= currSizeY)))){ if ((((((((((IposX[_local5] == -1)) || ((IposX[_local5] == currSizeX)))) || ((IposY[_local5] == -1)))) || ((IposY[_local5] == currSizeY)))) || (!((app.field.boxes[IposX[_local5]][IposY[_local5]].currEvent == BoxButton.eNone))))){ _local6 = Iside[_local5]; }; }; switch (_local6){ case 0: _local2 = new Rectangle(0, 0, imgBeam2.width, 8); _local3 = new Point(((25 + (iXX * IposX[_local5])) + (iYX * IposY[_local5])), ((17 - (((currSizeX - IposX[_local5]) - 1) * iXY)) + (iYY * IposY[_local5]))); _local4 = Math.floor((8 - (8 * Iprogrs[_local5]))); if ((((IposY[_local5] == currSizeY)) && ((count <= 2)))){ _local2.width = (_local2.width - 7); }; if ((((((_local5 == 0)) && (ItoCntr[_local5]))) || ((((_local5 == 2)) && (!(ItoCntr[_local5])))))){ _local3.y = (_local3.y + _local4); _local2.y = (_local2.y + _local4); _local2.height = (_local2.height - _local4); } else { _local2.height = (_local2.height - _local4); }; image.bitmapData.copyPixels(imgBeam2.bitmapData, _local2, _local3, null, null, true); break; case 1: _local2 = new Rectangle(8, 0, 12, imgBeam1.height); _local3 = new Point(((33 + (iXX * IposX[_local5])) + (iYX * IposY[_local5])), ((22 - (iXY * ((currSizeX - IposX[_local5]) - 1))) + (iYY * IposY[_local5]))); _local4 = Math.floor((12 - (12 * Iprogrs[_local5]))); if ((((IposX[_local5] == -1)) && ((count <= 2)))){ _local3.x = (_local3.x + 2); _local2.x = (_local2.x + 2); _local2.width = (_local2.width - 2); }; if ((((((_local5 == 0)) && (ItoCntr[_local5]))) || ((((_local5 == 2)) && (!(ItoCntr[_local5])))))){ _local2.width = (_local2.width - _local4); } else { _local3.x = (_local3.x + _local4); _local2.x = (_local2.x + _local4); _local2.width = (_local2.width - _local4); }; image.bitmapData.copyPixels(imgBeam1.bitmapData, _local2, _local3, null, null, true); break; case 2: _local2 = new Rectangle(0, 8, imgBeam2.width, 5); _local3 = new Point(((25 + (iXX * IposX[_local5])) + (iYX * IposY[_local5])), ((25 - (((currSizeX - IposX[_local5]) - 1) * iXY)) + (iYY * IposY[_local5]))); _local4 = Math.floor((5 - (5 * Iprogrs[_local5]))); if ((((IposY[_local5] < (currSizeY - 1))) && ((app.field.boxes[IposX[_local5]][(IposY[_local5] + 1)].currEvent == BoxButton.eNone)))){ _local2.height = (_local2.height - 2); }; if ((((IposY[_local5] == -1)) && ((count <= 2)))){ _local3.y = (_local3.y + 1); _local2.y = (_local2.y + 1); _local2.height = (_local2.height - 1); }; if ((((((_local5 == 0)) && (ItoCntr[_local5]))) || ((((_local5 == 2)) && (!(ItoCntr[_local5])))))){ _local2.height = (_local2.height - _local4); } else { _local3.y = (_local3.y + _local4); _local2.y = (_local2.y + _local4); _local2.height = (_local2.height - _local4); }; image.bitmapData.copyPixels(imgBeam2.bitmapData, _local2, _local3, null, null, true); break; case 3: _local2 = new Rectangle(0, 0, 8, imgBeam1.height); _local3 = new Point(((25 + (iXX * IposX[_local5])) + (iYX * IposY[_local5])), ((22 - (iXY * ((currSizeX - IposX[_local5]) - 1))) + (iYY * IposY[_local5]))); _local4 = Math.floor((8 - (8 * Iprogrs[_local5]))); if ((((IposX[_local5] == currSizeX)) && ((count <= 2)))){ _local2.width = (_local2.width - 5); }; if ((((((_local5 == 0)) && (ItoCntr[_local5]))) || ((((_local5 == 2)) && (!(ItoCntr[_local5])))))){ _local3.x = (_local3.x + _local4); _local2.x = (_local2.x + _local4); _local2.width = (_local2.width - _local4); } else { _local2.width = (_local2.width - _local4); }; image.bitmapData.copyPixels(imgBeam1.bitmapData, _local2, _local3, null, null, true); break; }; _local5++; }; Iprogrs[0] = (Iprogrs[0] - (_arg1 * 6)); Iprogrs[2] = (Iprogrs[2] + (_arg1 * 6)); if ((((Iprogrs[2] >= 1)) || ((Iprogrs[0] <= 0)))){ count++; if (((((((((((((count / 2) <= (currSizeX + 1))) && ((lastImpulse == this)))) && ((IposX[2] > -1)))) && ((IposX[2] < currSizeX)))) && ((IposY[2] > -1)))) && ((IposY[2] < currSizeY)))){ app.field.ciferblat[0].SetNumbers((count / 2)); }; if ((((((((((((count - 2) / 2) > (currSizeX + 1))) || ((IposX[1] < -1)))) || ((IposX[1] > currSizeX)))) || ((IposY[1] < -1)))) || ((IposY[1] > currSizeY)))){ Deactivate(); return; }; Iprogrs[0] = 1; IposX[0] = IposX[1]; IposY[0] = IposY[1]; Iside[0] = Iside[1]; ItoCntr[0] = ItoCntr[1]; Iprogrs[1] = 1; IposX[1] = IposX[2]; IposY[1] = IposY[2]; Iside[1] = Iside[2]; ItoCntr[1] = ItoCntr[2]; Iprogrs[2] = 0; if (ItoCntr[2]){ if ((((((((IposX[2] >= 0)) && ((IposX[2] < currSizeX)))) && ((IposY[2] >= 0)))) && ((IposY[2] < currSizeX)))){ switch (Iside[2]){ case 0: if (app.field.boxes[IposX[2]][IposY[2]].GetMirrorState() == 0){ Iside[2] = 2; } else { if (app.field.boxes[IposX[2]][IposY[2]].GetMirrorState() == 1){ Iside[2] = 3; } else { if (app.field.boxes[IposX[2]][IposY[2]].GetMirrorState() == 2){ Iside[2] = 1; }; }; }; break; case 1: if (app.field.boxes[IposX[2]][IposY[2]].GetMirrorState() == 0){ Iside[2] = 3; } else { if (app.field.boxes[IposX[2]][IposY[2]].GetMirrorState() == 1){ Iside[2] = 2; } else { if (app.field.boxes[IposX[2]][IposY[2]].GetMirrorState() == 2){ Iside[2] = 0; }; }; }; break; case 2: if (app.field.boxes[IposX[2]][IposY[2]].GetMirrorState() == 0){ Iside[2] = 0; } else { if (app.field.boxes[IposX[2]][IposY[2]].GetMirrorState() == 1){ Iside[2] = 1; } else { if (app.field.boxes[IposX[2]][IposY[2]].GetMirrorState() == 2){ Iside[2] = 3; }; }; }; break; case 3: if (app.field.boxes[IposX[2]][IposY[2]].GetMirrorState() == 0){ Iside[2] = 1; } else { if (app.field.boxes[IposX[2]][IposY[2]].GetMirrorState() == 1){ Iside[2] = 0; } else { if (app.field.boxes[IposX[2]][IposY[2]].GetMirrorState() == 2){ Iside[2] = 2; }; }; }; break; }; } else { switch (Iside[2]){ case 0: Iside[2] = 2; break; case 1: Iside[2] = 3; break; case 2: Iside[2] = 0; break; case 3: Iside[2] = 1; break; }; }; ItoCntr[2] = false; } else { switch (Iside[2]){ case 0: Iside[2] = 2; var _local8 = IposY; var _local9 = 2; var _local10 = (_local8[_local9] - 1); _local8[_local9] = _local10; break; case 1: Iside[2] = 3; _local8 = IposX; _local9 = 2; _local10 = (_local8[_local9] + 1); _local8[_local9] = _local10; break; case 2: Iside[2] = 0; _local8 = IposY; _local9 = 2; _local10 = (_local8[_local9] + 1); _local8[_local9] = _local10; break; case 3: Iside[2] = 1; _local8 = IposX; _local9 = 2; _local10 = (_local8[_local9] - 1); _local8[_local9] = _local10; break; }; ItoCntr[2] = true; }; if (((((!(startWave1)) && (!(startWave2)))) && (((((((((((count / 2) > (currSizeX + 1))) || ((IposX[2] < -1)))) || ((IposX[2] > currSizeX)))) || ((IposY[2] < -1)))) || ((IposY[2] > currSizeY)))))){ app.sndControl.Play(3, 1); if ((((((((((IposX[1] == -1)) || ((IposX[1] == currSizeX)))) || ((IposY[1] == -1)))) || ((IposY[1] == currSizeY)))) || (!((app.field.boxes[IposX[1]][IposY[1]].currEvent == BoxButton.eNone))))){ switch (Iside[2]){ case 0: imageWave.x = ((32 + (iXX * IposX[1])) + (iYX * IposY[1])); imageWave.y = ((24 - (((currSizeX - IposX[1]) - 1) * iXY)) + (iYY * IposY[1])); startWave2 = true; break; case 1: imageWave.x = ((21 + (iXX * IposX[1])) + (iYX * IposY[1])); imageWave.y = ((22 - (((currSizeX - IposX[1]) - 1) * iXY)) + (iYY * IposY[1])); startWave1 = true; break; case 2: imageWave.x = ((20 + (iXX * IposX[1])) + (iYX * IposY[1])); imageWave.y = ((13 - (((currSizeX - IposX[1]) - 1) * iXY)) + (iYY * IposY[1])); startWave2 = true; break; case 3: imageWave.x = ((41 + (iXX * IposX[1])) + (iYX * IposY[1])); imageWave.y = ((17 - (((currSizeX - IposX[1]) - 1) * iXY)) + (iYY * IposY[1])); startWave1 = true; break; }; } else { startWave1 = true; imageWave.x = -1000; imageWave.y = 0; }; }; }; } public function Fire(_arg1:Boolean, _arg2:int, _arg3:int, _arg4:int):void{ isLaser = _arg1; Side = _arg2; PosX = _arg3; PosY = _arg4; if (isLaser){ app.sndControl.Play(2, 999); BuildLaserBeam(Side, Side, PosX, PosY); } else { app.sndControl.Play(4, 1); switch (Side){ case 0: Iside[2] = 2; break; case 1: Iside[2] = 3; break; case 2: Iside[2] = 0; break; case 3: Iside[2] = 1; break; }; IposX[2] = PosX; IposY[2] = PosY; Iprogrs[2] = 0; ItoCntr[2] = false; Iprogrs[1] = 1; IposX[1] = IposX[2]; IposY[1] = IposY[2]; Iside[1] = Iside[2]; ItoCntr[1] = ItoCntr[2]; Iprogrs[0] = 1; IposX[0] = IposX[2]; IposY[0] = IposY[2]; Iside[0] = Iside[2]; ItoCntr[0] = ItoCntr[2]; lastImpulse = this; }; } public function ReBuild():void{ image.bitmapData.fillRect(new Rectangle(0, 0, image.width, image.height), 0xFFFFFF); if (isLaser){ BuildLaserBeam(Side, Side, PosX, PosY); }; } private function BuildLaserBeam(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{ var _local5:Rectangle; var _local6:Point; var _local7 = -1; var _local8 = -1; if ((((((((((_arg3 == -1)) || ((_arg3 == currSizeX)))) || ((_arg4 == -1)))) || ((_arg4 == currSizeX)))) || (!((app.field.boxes[_arg3][_arg4].currEvent == BoxButton.eNone))))){ _local7 = _arg2; if (!(((((((((_arg1 == 0)) && ((_arg4 == -1)))) || ((((_arg1 == 2)) && ((_arg4 == currSizeY)))))) || ((((_arg1 == 3)) && ((_arg3 == -1)))))) || ((((_arg1 == 1)) && ((_arg3 == currSizeY)))))){ _local8 = _arg1; }; }; switch (_local7){ case 0: _local5 = new Rectangle(0, 8, imgBeam2.width, 5); _local6 = new Point(((25 + (iXX * _arg3)) + (iYX * _arg4)), ((25 - (((currSizeX - _arg3) - 1) * iXY)) + (iYY * _arg4))); if ((((_arg4 < (currSizeY - 1))) && ((app.field.boxes[_arg3][(_arg4 + 1)].currEvent == BoxButton.eNone)))){ _local5.height = (_local5.height - 2); }; if (_arg4 == -1){ _local6.y = (_local6.y + 1); _local5.y = (_local5.y + 1); _local5.height = (_local5.height - 1); }; image.bitmapData.copyPixels(imgBeam2.bitmapData, _local5, _local6, null, null, true); break; case 1: _local5 = new Rectangle(0, 0, 8, imgBeam1.height); _local6 = new Point(((25 + (iXX * _arg3)) + (iYX * _arg4)), ((22 - (iXY * ((currSizeX - _arg3) - 1))) + (iYY * _arg4))); if (_arg3 == currSizeX){ _local5.width = (_local5.width - 5); }; image.bitmapData.copyPixels(imgBeam1.bitmapData, _local5, _local6, null, null, true); break; case 2: _local5 = new Rectangle(0, 0, imgBeam2.width, 8); _local6 = new Point(((25 + (iXX * _arg3)) + (iYX * _arg4)), ((17 - (((currSizeX - _arg3) - 1) * iXY)) + (iYY * _arg4))); if (_arg4 == currSizeY){ _local5.width = (_local5.width - 7); }; image.bitmapData.copyPixels(imgBeam2.bitmapData, _local5, _local6, null, null, true); break; case 3: _local5 = new Rectangle(8, 0, 12, imgBeam1.height); _local6 = new Point(((33 + (iXX * _arg3)) + (iYX * _arg4)), ((22 - (iXY * ((currSizeX - _arg3) - 1))) + (iYY * _arg4))); if (_arg3 == -1){ _local6.x = (_local6.x + 2); _local5.x = (_local5.x + 2); _local5.width = (_local5.width - 2); }; image.bitmapData.copyPixels(imgBeam1.bitmapData, _local5, _local6, null, null, true); break; }; switch (_local8){ case 0: _local5 = new Rectangle(0, 0, imgBeam2.width, 8); _local6 = new Point(((25 + (iXX * _arg3)) + (iYX * _arg4)), ((17 - (((currSizeX - _arg3) - 1) * iXY)) + (iYY * _arg4))); image.bitmapData.copyPixels(imgBeam2.bitmapData, _local5, _local6, null, null, true); break; case 1: _local5 = new Rectangle(8, 0, 12, imgBeam1.height); _local6 = new Point(((33 + (iXX * _arg3)) + (iYX * _arg4)), ((22 - (iXY * ((currSizeX - _arg3) - 1))) + (iYY * _arg4))); image.bitmapData.copyPixels(imgBeam1.bitmapData, _local5, _local6, null, null, true); break; case 2: _local5 = new Rectangle(0, 8, imgBeam2.width, 5); _local6 = new Point(((25 + (iXX * _arg3)) + (iYX * _arg4)), ((25 - (((currSizeX - _arg3) - 1) * iXY)) + (iYY * _arg4))); if ((((_arg4 < (currSizeY - 1))) && ((app.field.boxes[_arg3][(_arg4 + 1)].currEvent == BoxButton.eNone)))){ _local5.height = (_local5.height - 2); }; image.bitmapData.copyPixels(imgBeam2.bitmapData, _local5, _local6, null, null, true); break; case 3: _local5 = new Rectangle(0, 0, 8, imgBeam1.height); _local6 = new Point(((25 + (iXX * _arg3)) + (iYX * _arg4)), ((22 - (iXY * ((currSizeX - _arg3) - 1))) + (iYY * _arg4))); image.bitmapData.copyPixels(imgBeam1.bitmapData, _local5, _local6, null, null, true); break; }; if ((((((((((_arg2 == 0)) && ((_arg4 == currSizeY)))) || ((((_arg2 == 2)) && ((_arg4 == -1)))))) || ((((_arg2 == 3)) && ((_arg3 == currSizeX)))))) || ((((_arg2 == 1)) && ((_arg3 == -1)))))){ switch (_arg2){ case 0: imageWave.x = ((32 + (iXX * _arg3)) + (iYX * _arg4)); imageWave.y = ((24 - (((currSizeX - _arg3) - 1) * iXY)) + (iYY * _arg4)); startWave2 = true; break; case 1: imageWave.x = ((21 + (iXX * _arg3)) + (iYX * _arg4)); imageWave.y = ((22 - (((currSizeX - _arg3) - 1) * iXY)) + (iYY * _arg4)); startWave1 = true; break; case 2: imageWave.x = ((20 + (iXX * _arg3)) + (iYX * _arg4)); imageWave.y = ((13 - (((currSizeX - _arg3) - 1) * iXY)) + (iYY * _arg4)); startWave2 = true; break; case 3: imageWave.x = ((41 + (iXX * _arg3)) + (iYX * _arg4)); imageWave.y = ((17 - (((currSizeX - _arg3) - 1) * iXY)) + (iYY * _arg4)); startWave1 = true; break; }; return; }; switch (_arg2){ case 0: if ((((_arg4 == (currSizeY - 1))) || ((app.field.boxes[_arg3][(_arg4 + 1)].GetMirrorState() == 0)))){ BuildLaserBeam(0, 0, _arg3, (_arg4 + 1)); } else { if (app.field.boxes[_arg3][(_arg4 + 1)].GetMirrorState() == 1){ BuildLaserBeam(0, 1, _arg3, (_arg4 + 1)); } else { if (app.field.boxes[_arg3][(_arg4 + 1)].GetMirrorState() == 2){ BuildLaserBeam(0, 3, _arg3, (_arg4 + 1)); }; }; }; break; case 1: if ((((_arg3 == 0)) || ((app.field.boxes[(_arg3 - 1)][_arg4].GetMirrorState() == 0)))){ BuildLaserBeam(1, 1, (_arg3 - 1), _arg4); } else { if (app.field.boxes[(_arg3 - 1)][_arg4].GetMirrorState() == 1){ BuildLaserBeam(1, 0, (_arg3 - 1), _arg4); } else { if (app.field.boxes[(_arg3 - 1)][_arg4].GetMirrorState() == 2){ BuildLaserBeam(1, 2, (_arg3 - 1), _arg4); }; }; }; break; case 2: if ((((_arg4 == 0)) || ((app.field.boxes[_arg3][(_arg4 - 1)].GetMirrorState() == 0)))){ BuildLaserBeam(2, 2, _arg3, (_arg4 - 1)); } else { if (app.field.boxes[_arg3][(_arg4 - 1)].GetMirrorState() == 1){ BuildLaserBeam(2, 3, _arg3, (_arg4 - 1)); } else { if (app.field.boxes[_arg3][(_arg4 - 1)].GetMirrorState() == 2){ BuildLaserBeam(2, 1, _arg3, (_arg4 - 1)); }; }; }; break; case 3: if ((((_arg3 == (currSizeX - 1))) || ((app.field.boxes[(_arg3 + 1)][_arg4].GetMirrorState() == 0)))){ BuildLaserBeam(3, 3, (_arg3 + 1), _arg4); } else { if (app.field.boxes[(_arg3 + 1)][_arg4].GetMirrorState() == 1){ BuildLaserBeam(3, 2, (_arg3 + 1), _arg4); } else { if (app.field.boxes[(_arg3 + 1)][_arg4].GetMirrorState() == 2){ BuildLaserBeam(3, 0, (_arg3 + 1), _arg4); }; }; }; break; }; } } }//packageSection 21//BoxButton (BoxButton) package { import flash.events.*; import flash.display.*; import flash.geom.*; public class BoxButton extends Sprite { public var posX:int;// = 0 public var stageHeight:Number; public var lockSelect:Boolean;// = false public var currEvent:int; public var timer:int;// = 0 public var state:int; public var posY:int;// = 0 public var globalX:int;// = 0 public var globalY:int;// = 0 private var boxBitmap:Bitmap; public var app:LaserBox; public var stageWidth:Number; private var mirrorBmp1:Bitmap; private var mirrorBmp2:Bitmap; public var select:Bitmap; public static var eHide:int = 2; private static var stMirrorW1:Bitmap = new Resources.imgMirrorWrong1(); private static var stMirrorG1:Bitmap = new Resources.imgMirrorGood1(); private static var stMirrorG2:Bitmap = new Resources.imgMirrorGood2(); private static var stMirrorU2:Bitmap = new Resources.imgMirrorUnknw2(); public static var fStD1U2:int = 6; public static var fStD2U2:int = 8; private static var stMirrorW2:Bitmap = new Resources.imgMirrorWrong2(); public static var fStD1:int = 1; public static var lastBox:BoxButton = null; public static var fStD1U1:int = 5; public static var fStD2U1:int = 7; public static var eHalfHide:int = 4; public static var fStD2:int = 2; public static var fStU1:int = 3; public static var fStU2:int = 4; public static var eBoxDown:int = 1; public static var eLock:int = 3; private static var stMirrorB1:Bitmap = new Resources.imgMirrorBad1(); private static var stMirrorB2:Bitmap = new Resources.imgMirrorBad2(); public static var firstBox:BoxButton = null; private static var stMirrorU1:Bitmap = new Resources.imgMirrorUnknw1(); public static var eNone:int = 0; public static var fStNone:int = 0; public function BoxButton(_arg1:int, _arg2:int){ stageWidth = Preloader.stageWidth; stageHeight = Preloader.stageHeight; app = LaserBox.gameApp; currEvent = eNone; state = fStNone; mirrorBmp1 = new Bitmap(new BitmapData(7, 30, true, 0xFFFFFF)); mirrorBmp2 = new Bitmap(new BitmapData(25, 24, true, 0xFFFFFF)); super(); posX = _arg1; posY = _arg2; globalX = (((328 - (app.field.iXX * posX)) + (app.field.iYX * posY)) + 4); globalY = (((185 - (app.field.iXY * posX)) + (app.field.iYY * posY)) - 16); posX = ((app.field.currSizeX - posX) - 1); var _local3:int = (Math.random() * 4); boxBitmap = new (Resources.imgBoxes[_local3]); addChild(boxBitmap); mirrorBmp1.x = 9; mirrorBmp2.y = 3; addChild(mirrorBmp1); addChild(mirrorBmp2); if (select == null){ select = new Resources.imgBoxSelect(); select.x = -4; select.y = -1; }; var _local4:Sprite = new Sprite(); _local4.graphics.beginFill(0, 0); _local4.graphics.moveTo(0, 3); _local4.graphics.lineTo(16, 0); _local4.graphics.lineTo(25, 10); _local4.graphics.lineTo(25, 27); _local4.graphics.lineTo(9, 30); _local4.graphics.lineTo(0, 20); _local4.graphics.lineTo(0, 3); _local4.graphics.endFill(); hitArea = _local4; addChild(_local4); buttonMode = true; addEventListener(MouseEvent.MOUSE_OVER, onOver); addEventListener(MouseEvent.MOUSE_OUT, onOut); addEventListener(MouseEvent.MOUSE_DOWN, onDown); addEventListener(MouseEvent.MOUSE_UP, onUp); addEventListener(MouseEvent.MOUSE_MOVE, onMove); addEventListener(Event.ENTER_FRAME, onEnterFrame); } public function UnlockSelect():void{ lockSelect = false; if (select.parent != null){ select.parent.removeChild(select); }; } public function CheckTheEnd():void{ var _local3:int; var _local1:Boolean; var _local2:int; while (_local2 < app.field.currSizeX) { _local3 = 0; while (_local3 < app.field.currSizeY) { if (!app.field.boxes[_local2][_local3].CheckTrueMirrorPosition()){ _local1 = false; }; _local3++; }; _local2++; }; if (_local1){ app.field.MirrorsIsFounded(); }; } private function ChangeState(_arg1:int):void{ switch (state){ case fStNone: case fStU1: case fStU2: switch (_arg1){ case fStNone: state = fStNone; break; case fStU1: state = fStU1; break; case fStU2: state = fStU2; break; }; break; case fStD1: case fStD1U1: case fStD1U2: switch (_arg1){ case fStNone: state = fStD1; break; case fStU1: state = fStD1U1; break; case fStU2: state = fStD1U2; break; }; break; case fStD2: case fStD2U1: case fStD2U2: switch (_arg1){ case fStNone: state = fStD2; break; case fStU1: state = fStD2U1; break; case fStU2: state = fStD2U2; break; }; break; }; } public function GetMirrorState():int{ switch (state){ case fStNone: return (0); case fStU1: return (0); case fStU2: return (0); case fStD1: return (1); case fStD1U1: return (1); case fStD1U2: return (1); case fStD2: return (2); case fStD2U1: return (2); case fStD2U2: return (2); }; return (0); } private function onOver(_arg1:MouseEvent):void{ if (((((!(app.paused)) && (!(lockSelect)))) && ((currEvent == eNone)))){ if (select.parent != null){ select.parent.removeChild(select); }; addChild(select); }; } private function onMove(_arg1:MouseEvent):void{ var _local2:int; var _local3:int; var _local4:int; var _local5:int; var _local6:int; var _local7:int; if (((!((firstBox == null))) && (!((lastBox == null))))){ if (firstBox.posX <= lastBox.posX){ _local4 = firstBox.posX; _local5 = lastBox.posX; } else { _local4 = lastBox.posX; _local5 = firstBox.posX; }; if (firstBox.posY <= lastBox.posY){ _local6 = firstBox.posY; _local7 = lastBox.posY; } else { _local6 = lastBox.posY; _local7 = firstBox.posY; }; _local2 = _local4; while (_local2 <= _local5) { _local3 = _local6; while (_local3 <= _local7) { app.field.boxes[_local2][_local3].UnlockSelect(); _local3++; }; _local2++; }; lastBox = this; if (firstBox.posX <= lastBox.posX){ _local4 = firstBox.posX; _local5 = lastBox.posX; } else { _local4 = lastBox.posX; _local5 = firstBox.posX; }; if (firstBox.posY <= lastBox.posY){ _local6 = firstBox.posY; _local7 = lastBox.posY; } else { _local6 = lastBox.posY; _local7 = firstBox.posY; }; _local2 = _local4; while (_local2 <= _local5) { _local3 = _local6; while (_local3 <= _local7) { app.field.boxes[_local2][_local3].LockSelect(); _local3++; }; _local2++; }; }; } public function Destroy():void{ removeEventListener(MouseEvent.MOUSE_OVER, onOver); removeEventListener(MouseEvent.MOUSE_OUT, onOut); removeEventListener(MouseEvent.MOUSE_DOWN, onDown); removeEventListener(MouseEvent.MOUSE_UP, onUp); removeEventListener(MouseEvent.MOUSE_MOVE, onMove); removeEventListener(Event.ENTER_FRAME, onEnterFrame); app = null; boxBitmap = null; mirrorBmp1 = null; mirrorBmp2 = null; } public function LockSelect():void{ lockSelect = true; if (select.parent == null){ addChild(select); }; } private function onOut(_arg1:MouseEvent):void{ if (((!(lockSelect)) && (!((select.parent == null))))){ select.parent.removeChild(select); }; } private function onDown(_arg1:MouseEvent):void{ if (((!(app.paused)) && ((currEvent == eNone)))){ firstBox = this; lastBox = this; lockSelect = true; }; } private function onUp(_arg1:MouseEvent):void{ var _local2:int; var _local3:int; var _local4:int; var _local5:int; var _local6:int; var _local7:int; var _local8:Array; if (((!((lastBox == null))) && (!((firstBox == null))))){ if (firstBox.posX <= lastBox.posX){ _local4 = firstBox.posX; _local5 = lastBox.posX; } else { _local4 = lastBox.posX; _local5 = firstBox.posX; }; if (firstBox.posY <= lastBox.posY){ _local6 = firstBox.posY; _local7 = lastBox.posY; } else { _local6 = lastBox.posY; _local7 = firstBox.posY; }; if (lastBox.currEvent == eNone){ _local8 = new Array(); _local2 = _local4; while (_local2 <= _local5) { _local3 = _local6; while (_local3 <= _local7) { _local8.push(app.field.boxes[_local2][_local3]); _local3++; }; _local2++; }; app.sndControl.Play(1, 1); app.field.selectPanel[0].Show((x + 9), (y - 9)); app.field.selectPanel[0].boxButton = _local8; } else { _local2 = _local4; while (_local2 <= _local5) { _local3 = _local6; while (_local3 <= _local7) { app.field.boxes[_local2][_local3].UnlockSelect(); _local3++; }; _local2++; }; }; }; lastBox = null; firstBox = null; } public function SetMirror(_arg1:int):void{ mirrorBmp1.bitmapData.fillRect(new Rectangle(0, 0, mirrorBmp1.width, mirrorBmp1.height), 0xFFFFFF); mirrorBmp2.bitmapData.fillRect(new Rectangle(0, 0, mirrorBmp2.width, mirrorBmp2.height), 0xFFFFFF); if (_arg1 == -1){ if ((((((((((((state == fStD1)) || ((state == fStD1U1)))) || ((state == fStD1U2)))) || ((state == fStD2)))) || ((state == fStD2U1)))) || ((state == fStD2U2)))){ currEvent = eNone; app.field.MirrorIsBroken(); } else { if ((((state == fStU1)) || ((state == fStU2)))){ app.field.ciferblat[2].Incr(); state = fStNone; }; if (mirrorBmp1.parent != null){ removeChild(mirrorBmp1); }; if (mirrorBmp2.parent != null){ removeChild(mirrorBmp2); }; currEvent = eBoxDown; }; } else { if (_arg1 == 0){ if ((((((((((((state == fStU1)) || ((state == fStD1U1)))) || ((state == fStD1U2)))) || ((state == fStU2)))) || ((state == fStD2U1)))) || ((state == fStD2U2)))){ app.field.ciferblat[2].Incr(); }; ChangeState(fStNone); } else { if (_arg1 == 1){ if ((((((state == fStNone)) || ((state == fStD1)))) || ((state == fStD2)))){ app.field.ciferblat[2].Decr(); }; ChangeState(fStU1); mirrorBmp1.bitmapData.copyPixels(stMirrorU1.bitmapData, new Rectangle(0, 0, stMirrorU1.width, stMirrorU1.height), new Point(0, 0)); } else { if (_arg1 == 2){ if ((((((state == fStNone)) || ((state == fStD1)))) || ((state == fStD2)))){ app.field.ciferblat[2].Decr(); }; ChangeState(fStU2); mirrorBmp2.bitmapData.copyPixels(stMirrorU2.bitmapData, new Rectangle(0, 0, stMirrorU2.width, stMirrorU2.height), new Point(0, 0)); } else { if (_arg1 == 3){ mirrorBmp1.bitmapData.copyPixels(stMirrorG1.bitmapData, new Rectangle(0, 0, stMirrorG1.width, stMirrorG1.height), new Point(0, 0)); currEvent = eHalfHide; } else { if (_arg1 == 4){ mirrorBmp2.bitmapData.copyPixels(stMirrorG2.bitmapData, new Rectangle(0, 0, stMirrorG2.width, stMirrorG2.height), new Point(0, 0)); currEvent = eHalfHide; } else { if (_arg1 == 5){ mirrorBmp1.bitmapData.copyPixels(stMirrorB1.bitmapData, new Rectangle(0, 0, stMirrorB1.width, stMirrorB1.height), new Point(0, 0)); currEvent = eHalfHide; } else { if (_arg1 == 6){ mirrorBmp2.bitmapData.copyPixels(stMirrorB2.bitmapData, new Rectangle(0, 0, stMirrorB2.width, stMirrorB2.height), new Point(0, 0)); currEvent = eHalfHide; } else { if (_arg1 == 7){ mirrorBmp1.bitmapData.copyPixels(stMirrorW1.bitmapData, new Rectangle(0, 0, stMirrorW1.width, stMirrorW1.height), new Point(0, 0)); currEvent = eHalfHide; } else { if (_arg1 == 8){ mirrorBmp2.bitmapData.copyPixels(stMirrorW2.bitmapData, new Rectangle(0, 0, stMirrorW2.width, stMirrorW2.height), new Point(0, 0)); currEvent = eHalfHide; }; }; }; }; }; }; }; }; }; }; CheckTheEnd(); } private function onEnterFrame(_arg1:Event):void{ var _local2:int; if (currEvent == eBoxDown){ boxBitmap.bitmapData.copyPixels(boxBitmap.bitmapData, new Rectangle(0, timer, 5, 9), new Point(0, (timer + 1))); boxBitmap.bitmapData.copyPixels(boxBitmap.bitmapData, new Rectangle(5, timer, 20, 13), new Point(5, (timer + 1))); boxBitmap.bitmapData.fillRect(new Rectangle(12, timer, 4, 1), 0xFFFFFF); if (timer == 5){ _local2 = 0; while (_local2 < app.field.beams.length) { app.field.beams[_local2].ReBuild(); _local2++; }; }; timer++; if (timer == 12){ currEvent = eHide; }; } else { if (currEvent == eHide){ alpha = (alpha - Math.min(alpha, 0.08)); if (alpha <= 0){ parent.removeChild(this); currEvent = eLock; }; } else { if (currEvent == eHalfHide){ boxBitmap.alpha = (boxBitmap.alpha - Math.min((boxBitmap.alpha - 0.5), 0.08)); if (boxBitmap.alpha <= 0.5){ currEvent = eLock; }; }; }; }; } public function CheckTrueMirrorPosition():Boolean{ switch (state){ case fStNone: return (true); case fStU1: return (false); case fStU2: return (false); case fStD1: return (false); case fStD1U1: return (true); case fStD1U2: return (false); case fStD2: return (false); case fStD2U1: return (false); case fStD2U2: return (true); }; return (false); } } }//packageSection 22//Ciferblat (Ciferblat) package { import flash.display.*; import flash.geom.*; public class Ciferblat extends Sprite { public var app:LaserBox; public var stageHeight:Number; public var stageWidth:Number; private var mirrNumber:int;// = 0 public var maxChar:int;// = 0 public var chars:Array; public var numBmp:Bitmap; public function Ciferblat(_arg1:int){ var _local2:Bitmap; stageWidth = Preloader.stageWidth; stageHeight = Preloader.stageHeight; app = LaserBox.gameApp; numBmp = new Resources.imgNumbers(); super(); if (_arg1 == 0){ _local2 = new Resources.imgCiferblat1(); maxChar = 2; } else { if (_arg1 == 1){ _local2 = new Resources.imgCiferblat2(); maxChar = 3; } else { if (_arg1 == 2){ _local2 = new Resources.imgCiferblat1(); maxChar = 2; }; }; }; _local2.x = -1; _local2.y = -1; addChild(_local2); chars = new Array(maxChar); var _local3:int; while (_local3 < maxChar) { chars[_local3] = new Bitmap(new BitmapData(7, 21, true, 0xFFFFFF)); chars[_local3].x = (5 + (7 * _local3)); chars[_local3].y = (13 + (7 * _local3)); addChild(chars[_local3]); _local3++; }; SetNumbers(0); } public function SetNumbers(_arg1:Number):void{ var _local2:int; mirrNumber = _arg1; if (_arg1 < 0){ _arg1 = 0; }; _arg1 = Math.floor(_arg1); var _local3:Array = new Array(maxChar); _local2 = 0; while (_local2 < maxChar) { _local3[_local2] = -1; _local2++; }; if (_arg1 >= Math.pow(10, maxChar)){ _arg1 = (Math.pow(10, maxChar) - 1); }; if (maxChar == 3){ _local3[0] = Math.floor((_arg1 / 100)); _local3[1] = Math.floor(((_arg1 - (_local3[0] * 100)) / 10)); _local3[2] = ((_arg1 - (_local3[0] * 100)) - (_local3[1] * 10)); } else { _local3[0] = Math.floor((_arg1 / 10)); _local3[1] = (_arg1 - (_local3[0] * 10)); }; _local2 = 0; while (_local2 < maxChar) { chars[_local2].bitmapData.copyPixels(numBmp.bitmapData, new Rectangle((_local3[_local2] * 7), 0, 7, 21), new Point(0, 0)); _local2++; }; } public function Decr():void{ mirrNumber--; SetNumbers(mirrNumber); } public function Incr():void{ mirrNumber++; SetNumbers(mirrNumber); } } }//packageSection 23//Field (Field) package { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.utils.*; import flash.net.*; public class Field extends Sprite { public var secondIsHidden:Boolean;// = false public var globalY:int;// = 0 public var eGrow:int;// = 1 public var app:LaserBox; public var butSndOff:SimpleButton; public var iXX:int;// = 20 public var iXY:int;// = -5 public var butSndOn:SimpleButton; public var beginGame:Boolean;// = false public var logoGame:Bitmap; public var showBgTimer:int;// = 0 public var eNone:int;// = 0 private var timer:Timer; public var iYY:int;// = 12 public var firstIsHidden:Boolean;// = false public var iYX:int;// = 12 public var shadows:Array; public var butRestart:SimpleButton; public var menu:MenuButton; public var currSizeX:int;// = 8 public var currSizeY:int;// = 8 public var hideInProcess:Boolean;// = false public var playGameCount:int;// = 0 public var stageWidth:Number; public var addShadows:Bitmap; public var selectPanel:Array; public var infos:Array; public var currEvent:int; public var addSite:SimpleButton; public var logoSite:Bitmap; public var fieldSizeX:int;// = 8 public var fieldSizeY:int;// = 8 private var prevTimer2:int;// = 0 public var beams:Array; private var tick:int;// = 0 public var eHideBoxes:int;// = 3 public var boxes:Array; private var allBoxHidden:Boolean;// = true public var stageHeight:Number; public var winTime:Number;// = 0 public var wall:Array; private var prevTimer:int;// = 0 private var substrTimer:int;// = 0 public var eShowBoxes:int;// = 2 public var walls:Bitmap; public var ciferblat:Array; public var fieldBoxes:Bitmap; public var showAdCount:int;// = 0 public var fieldLaser:Array; public static var stWalls:Bitmap = new Resources.imgWall2(); public static var stFieldBoxes:Bitmap = new Resources.imgBoxPlate(); public function Field(){ var _local1:int; var _local2:Bitmap; stageWidth = Preloader.stageWidth; stageHeight = Preloader.stageHeight; app = LaserBox.gameApp; currEvent = eNone; fieldBoxes = new Bitmap(new BitmapData(511, 278, true, 0xFFFFFF)); fieldLaser = new Array(1); shadows = new Array(7); addShadows = new Resources.imgShCiferblat1(); boxes = new Array(0); wall = new Array(2); walls = new Bitmap(new BitmapData(300, 136, true, 0xFFFFFF)); logoSite = new Resources.imgDustunited(); logoGame = new Resources.imgLogo(); ciferblat = new Array(3); butSndOff = new SimpleButton(); butSndOn = new SimpleButton(); butRestart = new SimpleButton(); beams = new Array(0); infos = new Array(); timer = new Timer(1, 0); super(); shadows[0] = new Resources.imgShBottom1(); shadows[1] = new Resources.imgShBottom3(); shadows[2] = new Resources.imgShBottom5(); shadows[3] = new Resources.imgShCiferblat1(); shadows[4] = new Resources.imgShCiferblat2(); shadows[5] = new Resources.imgShWall1(); shadows[6] = new Resources.imgShWall3(); app.layers[0].addChild(addShadows); _local1 = 0; while (_local1 < 7) { app.layers[0].addChild(shadows[_local1]); _local1++; }; wall[0] = new Resources.imgWall1(); wall[1] = new Resources.imgWall3(); wall[1].x = 322; wall[1].y = 108; walls.x = 22; walls.y = 109; _local1 = 0; while (_local1 < 2) { app.layers[1].addChild(wall[_local1]); _local1++; }; app.layers[1].addChild(walls); ciferblat[0] = new Ciferblat(0); ciferblat[1] = new Ciferblat(1); ciferblat[2] = new Ciferblat(2); app.layers[1].addChild(ciferblat[2]); _local1 = 0; while (_local1 < 2) { app.layers[1].addChild(ciferblat[_local1]); _local1++; }; app.layers[1].addChild(logoSite); app.layers[1].addChild(logoGame); app.layers[1].addChild(fieldBoxes); fieldBoxes.x = 29; fieldBoxes.y = 185; _local1 = 0; while (_local1 < 11) { infos.push(new InfoWindow(_local1)); _local1++; }; _local2 = new Resources.imgSmButtonBaseOff(); _local2.bitmapData.copyPixels(new Resources.imgSmButtonRestart().bitmapData, new Rectangle(0, 0, 16, 15), new Point(7, 9), null, null, true); butRestart.upState = _local2; _local2 = new Resources.imgSmButtonBaseOff(); _local2.bitmapData.copyPixels(new Resources.imgSmButtonRestart().bitmapData, new Rectangle(0, 0, 16, 15), new Point(7, 9), null, null, true); _local2.bitmapData.copyPixels(new Resources.imgSmButtonBaseSel().bitmapData, new Rectangle(0, 0, 20, 25), new Point(4, 4), null, null, true); butRestart.overState = _local2; _local2 = new Resources.imgSmButtonBaseOn(); _local2.bitmapData.copyPixels(new Resources.imgSmButtonRestart().bitmapData, new Rectangle(0, 0, 16, 15), new Point(5, 7), null, null, true); butRestart.downState = _local2; var _local3:Shape = new Shape(); _local3.graphics.beginFill(0); _local3.graphics.moveTo(4, 8); _local3.graphics.lineTo(23, 4); _local3.graphics.lineTo(23, 24); _local3.graphics.lineTo(4, 28); _local3.graphics.lineTo(4, 8); _local3.graphics.endFill(); butRestart.hitTestState = _local3; butRestart.x = 311; butRestart.y = 113; app.layers[5].addChild(butRestart); butRestart.addEventListener(MouseEvent.CLICK, onRestartClick); _local2 = new Resources.imgSmButtonBaseOff(); _local2.bitmapData.copyPixels(new Resources.imgSmButtonSndOff().bitmapData, new Rectangle(0, 0, 15, 14), new Point(8, 9), null, null, true); butSndOff.upState = _local2; _local2 = new Resources.imgSmButtonBaseOff(); _local2.bitmapData.copyPixels(new Resources.imgSmButtonSndOff().bitmapData, new Rectangle(0, 0, 15, 14), new Point(8, 9), null, null, true); _local2.bitmapData.copyPixels(new Resources.imgSmButtonBaseSel().bitmapData, new Rectangle(0, 0, 20, 25), new Point(4, 4), null, null, true); butSndOff.overState = _local2; _local2 = new Resources.imgSmButtonBaseOn(); _local2.bitmapData.copyPixels(new Resources.imgSmButtonSndOff().bitmapData, new Rectangle(0, 0, 15, 14), new Point(6, 7), null, null, true); butSndOff.downState = _local2; butSndOff.hitTestState = _local3; butSndOff.x = 287; butSndOff.y = 119; app.layers[5].addChild(butSndOff); butSndOff.addEventListener(MouseEvent.CLICK, onSoundClick); _local2 = new Resources.imgSmButtonBaseOff(); _local2.bitmapData.copyPixels(new Resources.imgSmButtonSndOn().bitmapData, new Rectangle(0, 0, 15, 14), new Point(8, 9), null, null, true); butSndOn.upState = _local2; _local2 = new Resources.imgSmButtonBaseOff(); _local2.bitmapData.copyPixels(new Resources.imgSmButtonSndOn().bitmapData, new Rectangle(0, 0, 15, 14), new Point(8, 9), null, null, true); _local2.bitmapData.copyPixels(new Resources.imgSmButtonBaseSel().bitmapData, new Rectangle(0, 0, 20, 25), new Point(4, 4), null, null, true); butSndOn.overState = _local2; _local2 = new Resources.imgSmButtonBaseOn(); _local2.bitmapData.copyPixels(new Resources.imgSmButtonSndOn().bitmapData, new Rectangle(0, 0, 15, 14), new Point(6, 7), null, null, true); butSndOn.downState = _local2; butSndOn.hitTestState = _local3; butSndOn.x = 287; butSndOn.y = 119; butSndOn.addEventListener(MouseEvent.CLICK, onSoundClick); _local3 = new Shape(); _local3.graphics.beginFill(0); _local3.graphics.moveTo(9, 22); _local3.graphics.lineTo(62, 9); _local3.graphics.lineTo(62, 46); _local3.graphics.lineTo(9, 59); _local3.graphics.lineTo(9, 22); _local3.graphics.endFill(); addSite = new SimpleButton(); addSite.upState = new Resources.imgAddSite(); addSite.overState = addSite.upState; addSite.downState = addSite.upState; addSite.hitTestState = _local3; addSite.x = 12; addSite.y = 15; app.layers[1].addChild(addSite); addSite.addEventListener(MouseEvent.CLICK, onAddSiteClick); menu = new MenuButton(); app.layers[4].addChild(menu); selectPanel = new Array(); selectPanel.push(new SelectPanel(0)); selectPanel.push(new SelectPanel(1)); selectPanel.push(new SelectPanel(2)); addEventListener(Event.ENTER_FRAME, onEnterFrame); timer.addEventListener(TimerEvent.TIMER, onTimer); } public function MirrorsIsFounded():void{ var _local3:int; if (!timer.running){ return; }; timer.stop(); var _local1:int; while (_local1 < currSizeX) { _local3 = 0; while (_local3 < currSizeY) { if (boxes[_local1][_local3].currEvent == BoxButton.eNone){ switch (boxes[_local1][_local3].state){ case BoxButton.fStNone: boxes[_local1][_local3].SetMirror(-1); break; }; }; _local3++; }; _local1++; }; winTime = (getTimer() - prevTimer); var _local2:int = (winTime / 1000); infos[1].textF.text = ("YOU HAVE FOUND ALL MIRRORS\nYOUR TIME: " + _local2); infos[1].Show(); } private function onRestartClick(_arg1:MouseEvent):void{ var _local2:int; if (!app.paused){ _local2 = 0; while (_local2 < app.field.selectPanel.length) { app.field.selectPanel[_local2].Hide(); _local2++; }; CreateGameField(fieldSizeX, fieldSizeY); app.sndControl.Play(0, 1); }; } public function CreateGameField(_arg1:int, _arg2:int):void{ var _local3:int; var _local4:int; app.paused = true; fieldSizeX = _arg1; fieldSizeY = _arg2; if (secondIsHidden){ secondIsHidden = false; firstIsHidden = false; app.sndControl.Stop(7); showBgTimer = getTimer(); hideInProcess = true; }; if (firstIsHidden){ firstIsHidden = false; app.sndControl.Stop(6); showBgTimer = getTimer(); hideInProcess = true; }; if (beams.length > 0){ while (beams.length > 0) { beams[0].Deactivate(); }; }; if (!allBoxHidden){ currEvent = eHideBoxes; timer.stop(); ciferblat[0].SetNumbers(0); ciferblat[1].SetNumbers(0); ciferblat[2].SetNumbers(0); playGameCount++; return; }; if (currSizeX > fieldSizeX){ currSizeX--; } else { if (currSizeX < fieldSizeX){ currSizeX++; }; }; if (currSizeY > fieldSizeY){ currSizeY--; } else { if (currSizeY < fieldSizeY){ currSizeY++; }; }; fieldBoxes.bitmapData.fillRect(new Rectangle(0, 0, fieldBoxes.width, fieldBoxes.height), 0xFFFFFF); walls.bitmapData.fillRect(new Rectangle(0, 0, walls.width, walls.height), 0xFFFFFF); if (boxes.length > 0){ _local3 = 0; while (_local3 < boxes.length) { _local4 = 0; while (_local4 < boxes[_local3].length) { if (boxes[_local3][_local4].parent != null){ boxes[_local3][_local4].parent.removeChild(boxes[_local3][_local4]); }; boxes[_local3][_local4].Destroy(); delete boxes[_local3][_local4]; _local4++; }; delete boxes[_local3]; _local3++; }; boxes.length = 0; }; if (fieldLaser.length > 1){ _local3 = 0; while (_local3 < fieldLaser.length) { fieldLaser[_local3].parent.removeChild(fieldLaser[_local3]); fieldLaser[_local3].Destroy(); delete fieldLaser[_local3]; _local3++; }; }; if (shadows.length > 7){ _local3 = 7; while (_local3 < shadows.length) { shadows[_local3].parent.removeChild(shadows[_local3]); delete shadows[_local3]; _local3++; }; shadows.length = 7; }; fieldLaser = new Array(((currSizeX + currSizeY) * 2)); _local3 = 0; while (_local3 < currSizeX) { fieldLaser[((currSizeX - _local3) - 1)] = new LaserButton(((currSizeX - _local3) - 1), 0); fieldLaser[((currSizeX - _local3) - 1)].x = (312 - (iXX * _local3)); fieldLaser[((currSizeX - _local3) - 1)].y = (169 - (iXY * _local3)); app.layers[1].addChild(fieldLaser[((currSizeX - _local3) - 1)]); _local3++; }; _local3 = 0; while (_local3 < currSizeY) { fieldLaser[(currSizeX + _local3)] = new LaserButton((currSizeX + _local3), 1); fieldLaser[(currSizeX + _local3)].x = (348 + (iYX * _local3)); fieldLaser[(currSizeX + _local3)].y = (179 + (iYY * _local3)); app.layers[1].addChild(fieldLaser[(currSizeX + _local3)]); _local3++; }; fieldBoxes.parent.removeChild(fieldBoxes); app.layers[1].addChild(fieldBoxes); _local3 = 0; while (_local3 < currSizeX) { if ((((currSizeX == fieldSizeX)) && ((currSizeY == fieldSizeY)))){ boxes[((currSizeX - _local3) - 1)] = new Array(currSizeY); }; _local4 = 0; while (_local4 < currSizeY) { fieldBoxes.bitmapData.copyPixels(stFieldBoxes.bitmapData, new Rectangle(0, 0, 32, 22), new Point(((299 - (iXX * _local3)) + (iYX * _local4)), ((0 - (iXY * _local3)) + (iYY * _local4))), null, null, true); if ((((currSizeX == fieldSizeX)) && ((currSizeY == fieldSizeY)))){ boxes[((currSizeX - _local3) - 1)][_local4] = new BoxButton(_local3, _local4); boxes[((currSizeX - _local3) - 1)][_local4].x = (((328 - (iXX * _local3)) + (iYX * _local4)) + 4); boxes[((currSizeX - _local3) - 1)][_local4].y = (((185 - (iXY * _local3)) + (iYY * _local4)) - 16); boxes[((currSizeX - _local3) - 1)][_local4].alpha = 0; app.layers[1].addChild(boxes[((currSizeX - _local3) - 1)][_local4]); }; _local4++; }; _local3++; }; _local3 = 0; while (_local3 < currSizeX) { fieldLaser[((currSizeX + currSizeY) + _local3)] = new LaserButton(((currSizeX + currSizeY) + _local3), 2); fieldLaser[((currSizeX + currSizeY) + _local3)].x = ((328 + (iYX * currSizeY)) - (iXX * _local3)); fieldLaser[((currSizeX + currSizeY) + _local3)].y = ((185 + (iYY * currSizeY)) - (iXY * _local3)); app.layers[1].addChild(fieldLaser[((currSizeX + currSizeY) + _local3)]); _local3++; }; _local3 = 0; while (_local3 < currSizeY) { fieldLaser[((((currSizeX * 2) + (currSizeY * 2)) - _local3) - 1)] = new LaserButton(((((currSizeX * 2) + (currSizeY * 2)) - _local3) - 1), 3); fieldLaser[((((currSizeX * 2) + (currSizeY * 2)) - _local3) - 1)].x = (((328 - (iXX * (currSizeX - 1))) - 24) + (iYX * _local3)); fieldLaser[((((currSizeX * 2) + (currSizeY * 2)) - _local3) - 1)].y = (((185 - (iXY * (currSizeX - 1))) + 5) + (iYY * _local3)); app.layers[1].addChild(fieldLaser[((((currSizeX * 2) + (currSizeY * 2)) - _local3) - 1)]); _local3++; }; shadows[0].x = ((328 - (iXX * currSizeX)) - 11); shadows[0].y = ((185 - (iXY * currSizeX)) - 10); shadows[1].x = (((328 - (iXX * currSizeX)) + (iYX * currSizeY)) - 16); shadows[1].y = (((185 - (iXY * currSizeX)) + (iYY * currSizeY)) + 6); shadows[2].x = ((328 + (iYX * currSizeY)) + 20); shadows[2].y = (185 + (iYY * currSizeY)); shadows[3].x = (328 + 49); shadows[3].y = (185 - 45); shadows[4].x = ((328 + (iYX * currSizeY)) + 18); shadows[4].y = ((185 + (iYY * currSizeY)) - 76); addShadows.x = ((328 + (iYX * currSizeY)) - 6); addShadows.y = ((185 + (iYY * currSizeY)) - 100); shadows[5].x = ((328 - (iXX * currSizeX)) - 15); shadows[5].y = ((185 - (iXY * currSizeX)) - 91); shadows[6].x = (328 - 11); shadows[6].y = (185 - 91); _local3 = 0; while (_local3 < (currSizeY - 1)) { shadows[(7 + _local3)] = new Resources.imgShBottom2(); shadows[(7 + _local3)].x = (((328 - (iXX * currSizeX)) + (iYX * _local3)) - 11); shadows[(7 + _local3)].y = (((185 - (iXY * currSizeX)) + (iYY * _local3)) + 29); app.layers[0].addChild(shadows[(7 + _local3)]); _local3++; }; _local3 = 0; while (_local3 < (currSizeX - 1)) { shadows[(((7 + currSizeY) - 1) + _local3)] = new Resources.imgShBottom4(); shadows[(((7 + currSizeY) - 1) + _local3)].x = ((328 - (iXX * _local3)) + (iYX * currSizeY)); shadows[(((7 + currSizeY) - 1) + _local3)].y = (((185 - (iXY * _local3)) + (iYY * currSizeY)) + 26); app.layers[0].addChild(shadows[(((7 + currSizeY) - 1) + _local3)]); _local3++; }; _local3 = 0; while (_local3 < (currSizeX - 1)) { shadows[(((((7 + currSizeY) - 1) + currSizeX) - 1) + _local3)] = new Resources.imgShWall2(); shadows[(((((7 + currSizeY) - 1) + currSizeX) - 1) + _local3)].x = ((328 - (iXX * _local3)) - 31); shadows[(((((7 + currSizeY) - 1) + currSizeX) - 1) + _local3)].y = ((185 - (iXY * _local3)) - 91); app.layers[0].addChild(shadows[(((((7 + currSizeY) - 1) + currSizeX) - 1) + _local3)]); _local3++; }; wall[0].x = (327 - (iXX * currSizeX)); wall[0].y = ((184 - (iXY * currSizeX)) - 80); _local3 = 0; while (_local3 < (currSizeX - 1)) { walls.bitmapData.copyPixels(stWalls.bitmapData, new Rectangle(0, 0, 20, 67), new Point((280 - (iXX * _local3)), (0 - (iXY * _local3)))); _local3++; }; logoSite.x = ((328 - ((iXX * currSizeX) / 2)) - 76); logoSite.y = Math.round(((185 - ((iXY * currSizeX) / 2)) - 105)); logoGame.x = ((363 - ((iXX * currSizeX) / 2)) - 76); logoGame.y = Math.round(((246 - ((iXY * currSizeX) / 2)) - 105)); ciferblat[0].x = (328 + 44); ciferblat[0].y = (185 - 37); ciferblat[1].x = ((328 + (iYX * currSizeY)) + 13); ciferblat[1].y = ((185 + (iYY * currSizeY)) - 68); ciferblat[2].x = ((328 + (iYX * currSizeY)) - 11); ciferblat[2].y = ((185 + (iYY * currSizeY)) - 92); menu.x = ((328 - (iXX * currSizeX)) + 4); menu.y = ((185 - (iXY * currSizeX)) - 95); if (((!((currSizeX == fieldSizeX))) || (!((currSizeY == fieldSizeY))))){ tick = 3; currEvent = eGrow; } else { FillTheField(); currEvent = eShowBoxes; prevTimer = getTimer(); substrTimer = 0; hideInProcess = false; timer.start(); }; var _local5:int = (((185 - (iXY * fieldSizeX)) + (iYY * fieldSizeY)) + 36); if ((((_local5 > stageHeight)) && (!((app.y == -((_local5 - stageHeight))))))){ globalY = -((_local5 - stageHeight)); } else { if ((((_local5 <= stageHeight)) && ((app.y < 0)))){ globalY = 0; }; }; } private function onAddSiteClick(_arg1:MouseEvent):void{ app.sndControl.Play(1, 1); navigateToURL(new URLRequest("http://cdn.mochiads.com/c/g/laserbox.zip")); } public function MirrorIsBroken():void{ var _local2:int; var _local1:int; while (_local1 < currSizeX) { _local2 = 0; while (_local2 < currSizeY) { if (boxes[_local1][_local2].currEvent == BoxButton.eNone){ switch (boxes[_local1][_local2].state){ case BoxButton.fStNone: boxes[_local1][_local2].SetMirror(-1); break; case BoxButton.fStU1: boxes[_local1][_local2].SetMirror(5); break; case BoxButton.fStU2: boxes[_local1][_local2].SetMirror(6); break; case BoxButton.fStD1: boxes[_local1][_local2].SetMirror(3); break; case BoxButton.fStD2: boxes[_local1][_local2].SetMirror(4); break; case BoxButton.fStD1U1: boxes[_local1][_local2].SetMirror(3); break; case BoxButton.fStD1U2: boxes[_local1][_local2].SetMirror(7); break; case BoxButton.fStD2U1: boxes[_local1][_local2].SetMirror(8); break; case BoxButton.fStD2U2: boxes[_local1][_local2].SetMirror(4); break; }; }; _local2++; }; _local1++; }; if (!timer.running){ return; }; timer.stop(); infos[0].Show(); } private function onTimer(_arg1:TimerEvent):void{ var _local2:int = getTimer(); if (((!(app.paused)) && (beginGame))){ substrTimer = (_local2 - prevTimer); ciferblat[1].SetNumbers((substrTimer / 1000)); } else { prevTimer = (_local2 - substrTimer); }; } private function onEnterFrame(_arg1:Event):void{ var _local2:int; var _local3:int; var _local4:int = getTimer(); var _local5:Number = ((_local4 - prevTimer2) / 1000); prevTimer2 = _local4; if (tick > 0){ tick--; }; if ((((tick == 0)) && ((currEvent == eGrow)))){ currEvent = eNone; CreateGameField(fieldSizeX, fieldSizeY); } else { if (currEvent == eShowBoxes){ allBoxHidden = false; _local2 = 0; while (_local2 < boxes.length) { _local3 = 0; while (_local3 < boxes[_local2].length) { boxes[_local2][_local3].alpha = (boxes[_local2][_local3].alpha + Math.min((1 - boxes[_local2][_local3].alpha), _local5)); _local3++; }; _local2++; }; if (boxes[0][0].alpha >= 1){ currEvent = eNone; app.paused = false; }; } else { if (currEvent == eHideBoxes){ allBoxHidden = true; _local2 = 0; while (_local2 < boxes.length) { _local3 = 0; while (_local3 < boxes[_local2].length) { boxes[_local2][_local3].alpha = (boxes[_local2][_local3].alpha - Math.min(boxes[_local2][_local3].alpha, _local5)); if (boxes[_local2][_local3].alpha > 0){ allBoxHidden = false; }; _local3++; }; _local2++; }; if (allBoxHidden){ (currEvent == eNone); CreateGameField(fieldSizeX, fieldSizeY); }; }; }; }; if (app.y > globalY){ app.y = (app.y + (((globalY - app.y) - 2) / 12)); app.starsImg.y = -(app.y); } else { if (app.y < globalY){ app.y = (app.y + (((globalY - app.y) + 2) / 12)); app.starsImg.y = -(app.y); }; }; if ((((((substrTimer > 15000)) && (!(firstIsHidden)))) && (!(hideInProcess)))){ firstIsHidden = true; app.sndControl.Play(6, 999, true); showBgTimer = getTimer(); } else { if ((((((substrTimer > 40000)) && (!(secondIsHidden)))) && (!(hideInProcess)))){ secondIsHidden = true; app.sndControl.Stop(6); app.sndControl.Play(7, 999, true); showBgTimer = getTimer(); }; }; if (((firstIsHidden) && ((app.background[0].alpha > 0)))){ app.background[0].alpha = (1 - ((_local4 - showBgTimer) / 2000)); addSite.alpha = app.background[0].alpha; } else { if (((!(firstIsHidden)) && ((app.background[0].alpha < 1)))){ app.background[0].alpha = ((_local4 - showBgTimer) / 2000); addSite.alpha = app.background[0].alpha; }; }; if (((secondIsHidden) && ((app.background[1].alpha > 0)))){ app.background[1].alpha = (1 - ((_local4 - showBgTimer) / 2000)); } else { if (((!(secondIsHidden)) && ((app.background[1].alpha < 1)))){ app.background[1].alpha = ((_local4 - showBgTimer) / 2000); }; }; } private function FillTheField():void{ var _local3:int; var _local4:int; var _local1 = -1; if (currSizeX == 8){ _local1 = 10; } else { if (currSizeX == 12){ _local1 = 25; } else { if (currSizeX == 16){ _local1 = 50; }; }; }; ciferblat[2].SetNumbers(_local1); var _local2:int; while (_local2 < _local1) { _local3 = Math.floor((Math.random() * currSizeX)); _local4 = Math.floor((Math.random() * currSizeY)); if (boxes[_local3][_local4].state == BoxButton.fStNone){ boxes[_local3][_local4].state = ((Math.random())>0.5) ? BoxButton.fStD1 : BoxButton.fStD2; } else { _local2--; }; _local2++; }; } private function onSoundClick(_arg1:MouseEvent):void{ app.sndControl.Play(0, 1); if (butSndOff.parent != null){ butSndOff.parent.removeChild(butSndOff); app.layers[5].addChild(butSndOn); app.sndControl.TouchSound(); } else { butSndOn.parent.removeChild(butSndOn); app.layers[5].addChild(butSndOff); app.sndControl.TouchSound(); }; } } }//packageSection 24//InfoWindow (InfoWindow) package { import flash.events.*; import flash.display.*; import flash.geom.*; import CPMStar.*; import mochi.as3.*; import flash.text.*; public class InfoWindow extends Sprite { public var stageHeight:Number; public var skipButton:SimpleButton;// = null public var ID:int; public var rulImage1:Bitmap;// = null public var rulImage2:Bitmap;// = null public var app:LaserBox; public var image:Bitmap; public var stageWidth:Number; public var okButton:SimpleButton; public var adBox:MovieClip;// = null public var ads:Advertisment;// = null public var sizeY:int;// = 1 public var textF:TextField; public var loading:TextField; public var sizeX:int;// = 1 public static var stWall:Bitmap = new Resources.imgInfoWall(); public static var stBorder:Bitmap = new Resources.imgInfoBorder(); public function InfoWindow(_arg1:int){ var _local2:int; var _local3:int; stageWidth = Preloader.stageWidth; stageHeight = Preloader.stageHeight; app = LaserBox.gameApp; okButton = new SimpleButton(); image = new Bitmap(); textF = new TextField(); loading = new TextField(); super(); ID = _arg1; var _local4:TextFormat = new TextFormat(); _local4.align = TextFormatAlign.CENTER; _local4.font = "Courier New"; _local4.bold = true; _local4.size = 18; textF.x = 5; textF.y = 5; _local4.size = 25; loading.defaultTextFormat = _local4; loading.textColor = 0xFFFFFF; loading.text = "LOADING"; loading.autoSize = TextFieldAutoSize.LEFT; loading.x = 95; loading.y = 105; _local4.size = 18; if (ID == 0){ textF.defaultTextFormat = _local4; textF.text = "YOU BROKE THE MIRROR"; textF.textColor = 0xFF0000; textF.autoSize = TextFieldAutoSize.LEFT; sizeX = (textF.textWidth + 7); sizeY = 60; } else { if (ID == 1){ textF.defaultTextFormat = _local4; textF.text = "YOU HAVE FOUND ALL MIRRORS\nYOUR TIME: 999"; textF.textColor = 0x9900; textF.autoSize = TextFieldAutoSize.LEFT; sizeX = (textF.textWidth + 7); sizeY = 75; } else { if (ID == 2){ textF.defaultTextFormat = _local4; textF.text = "TEMPORARY UNAVAILABLE"; textF.textColor = 0xFF0000; textF.autoSize = TextFieldAutoSize.LEFT; sizeX = (textF.textWidth + 7); sizeY = 60; } else { if (ID == 3){ _local4.size = 15; _local4.align = TextFormatAlign.LEFT; textF.defaultTextFormat = _local4; textF.text = "The objective of LaserBox is to detect and avoid uncovering the hidden mirrors within a grid of boxes.\n\n\n\n\n\n\nTo discover mirrors, you must fire a laser into the boxes and note which way the laser is bouncing from within the covered boxes. \n\n\n\n\n\nIf you uncover a mirror by accident, the game is over."; textF.wordWrap = true; textF.width = 450; textF.autoSize = TextFieldAutoSize.LEFT; sizeX = 450; sizeY = 365; rulImage1 = new Resources.imgRules1(); rulImage1.x = 140; rulImage1.y = 42; rulImage2 = new Resources.imgRules2(); rulImage2.x = 105; rulImage2.y = 213; skipButton = new SimpleButton(); skipButton.upState = new Resources.imgInfoSkip(); skipButton.downState = skipButton.upState; skipButton.overState = skipButton.upState; skipButton.hitTestState = skipButton.upState; skipButton.x = 409; skipButton.y = 350; skipButton.addEventListener(MouseEvent.CLICK, onSkip); } else { if (ID == 4){ _local4.size = 15; _local4.align = TextFormatAlign.LEFT; textF.defaultTextFormat = _local4; textF.text = "To place a laser, click a spot from around the grid of boxes, this will open a menu where you can choose between 'Laser' and 'Impulse'. \n'Laser' is a continuous beam that goes from the source, through the grid."; textF.wordWrap = true; textF.width = 450; textF.autoSize = TextFieldAutoSize.LEFT; sizeX = 450; sizeY = 365; rulImage1 = new Resources.imgRules3(); rulImage1.x = 140; rulImage1.y = 120; } else { if (ID == 10){ _local4.size = 15; _local4.align = TextFormatAlign.LEFT; textF.defaultTextFormat = _local4; textF.text = "'Impulse' is a short beam that moves slowly throughout the grid. It has a limited flight length. The flight length is determined by the size of a field. The more the size of a field, the can longer fly an 'impulse'. \nThe first dial shows how far 'impulse' has traveled."; textF.wordWrap = true; textF.width = 450; textF.autoSize = TextFieldAutoSize.LEFT; sizeX = 450; sizeY = 365; rulImage2 = new Resources.imgRules4(); rulImage2.x = 140; rulImage2.y = 120; } else { if (ID == 5){ _local4.size = 15; _local4.align = TextFormatAlign.LEFT; textF.defaultTextFormat = _local4; textF.text = "Click on the box to mark it as a mirror or to brake it. There are two types of mirrors. One goes from left top to bottom right, the other goes from right top to bottom left. \n\n\n\n\n\n\n\nIn addition to selecting a single mirror, you may select multiple mirrors to clear by dragging your mouse."; textF.wordWrap = true; textF.width = 450; textF.autoSize = TextFieldAutoSize.LEFT; sizeX = 450; sizeY = 365; rulImage1 = new Resources.imgRules5(); rulImage1.x = 140; rulImage1.y = 80; rulImage2 = new Resources.imgRules6(); rulImage2.x = 140; rulImage2.y = 229; } else { if (ID == 6){ _local4.size = 15; _local4.align = TextFormatAlign.LEFT; textF.defaultTextFormat = _local4; textF.text = "On the right side of field there is three dials. The first dial shows how far 'impulse' has traveled. The second shows how many unmarked mirrors are in the grid. The third shows how long you have been playing for."; textF.wordWrap = true; textF.width = 450; textF.autoSize = TextFieldAutoSize.LEFT; sizeX = 450; sizeY = 365; rulImage1 = new Resources.imgRules7(); rulImage1.x = 160; rulImage1.y = 110; } else { if (ID == 9){ _local4.align = TextFormatAlign.CENTER; textF.defaultTextFormat = _local4; textF.text = "ADVERTISMENT\n\n\n\n\n\n\n\n\n\n\n\n\nENJOY THE GAME!"; textF.x = 5; textF.width = 330; textF.autoSize = TextFieldAutoSize.CENTER; sizeX = 330; sizeY = 324; adBox = new MovieClip(); adBox.graphics.beginFill(0); adBox.graphics.drawRect(0, 0, 300, 250); adBox.graphics.endFill(); adBox.x = 18; adBox.y = 30; } else { if (ID == 7){ _local4.align = TextFormatAlign.CENTER; textF.defaultTextFormat = _local4; textF.text = "ADVERTISMENT\n\n\n\n\n\n\n\n\n\n\n\n\nENJOY THE GAME!"; textF.x = 5; textF.width = 330; textF.autoSize = TextFieldAutoSize.CENTER; sizeX = 330; sizeY = 324; ads = new Advertisment(); ads.x = 18; ads.y = 30; adBox = new MovieClip(); adBox.graphics.beginFill(0); adBox.graphics.drawRect(0, 0, 300, 250); adBox.graphics.endFill(); adBox.addChild(loading); adBox.x = 18; adBox.y = 30; } else { if (ID == 8){ _local4.align = TextFormatAlign.LEFT; textF.defaultTextFormat = _local4; textF.text = "Developer: \t\t\tLeksikov Artem \nGraphic designer: \tLeksikov Artem \nIdea maker: \t\t\tLeksikov Artem \n\t\t\t\t\t\tAvatar@DustUnited.com\n\nSound maker: \t\t\tValeriy Bohan\n\t\t\t\t\t\tSupport@DustUnited.com\n\nText checker: \t\tColeman Trapp"; textF.textColor = 0; textF.autoSize = TextFieldAutoSize.LEFT; sizeX = (textF.textWidth + 17); sizeY = 250; }; }; }; }; }; }; }; }; }; }; }; image.bitmapData = new BitmapData((sizeX + 6), (sizeY + 6)); image.bitmapData.copyPixels(stBorder.bitmapData, new Rectangle(0, 0, 3, 3), new Point(0, 0)); image.bitmapData.copyPixels(stBorder.bitmapData, new Rectangle(4, 0, 3, 3), new Point((sizeX + 3), 0)); image.bitmapData.copyPixels(stBorder.bitmapData, new Rectangle(0, 4, 3, 3), new Point(0, (sizeY + 3))); image.bitmapData.copyPixels(stBorder.bitmapData, new Rectangle(4, 4, 3, 3), new Point((sizeX + 3), (sizeY + 3))); _local2 = 0; while (_local2 < sizeY) { _local3 = 0; while (_local3 < sizeX) { image.bitmapData.copyPixels(stWall.bitmapData, new Rectangle(0, 0, Math.min(20, (sizeX - _local3)), Math.min(56, (sizeY - _local2))), new Point((3 + _local3), (3 + _local2))); _local3 = (_local3 + 20); }; _local2 = (_local2 + 56); }; _local3 = 0; while (_local3 < sizeX) { image.bitmapData.copyPixels(stBorder.bitmapData, new Rectangle(3, 0, 1, 3), new Point((3 + _local3), 0)); image.bitmapData.copyPixels(stBorder.bitmapData, new Rectangle(3, 4, 1, 3), new Point((3 + _local3), (sizeY + 3))); _local3++; }; _local3 = 0; while (_local3 < sizeY) { image.bitmapData.copyPixels(stBorder.bitmapData, new Rectangle(0, 3, 3, 1), new Point(0, (3 + _local3))); image.bitmapData.copyPixels(stBorder.bitmapData, new Rectangle(4, 3, 3, 1), new Point((sizeX + 3), (3 + _local3))); _local3++; }; addChild(image); okButton.upState = new Resources.imgInfoOk(); okButton.overState = okButton.upState; okButton.downState = okButton.upState; okButton.hitTestState = okButton.upState; okButton.x = Math.round((((sizeX + 6) / 2) - 21)); okButton.y = (sizeY - 22); addChild(okButton); okButton.addEventListener(MouseEvent.CLICK, onOkClick); textF.selectable = false; addChild(textF); if (rulImage1 != null){ addChild(rulImage1); }; if (rulImage2 != null){ addChild(rulImage2); }; if (adBox != null){ addChild(adBox); }; if (ads != null){ addChild(ads); }; if (skipButton != null){ addChild(skipButton); }; } private function onSkip(_arg1:MouseEvent):void{ Hide(); app.field.infos[7].Show(); } public function Show():void{ if ((((ID == 7)) && (!(app.CanShowMochi())))){ return; }; app.layers[6].addChild(this); x = ((stageWidth / 2) - ((sizeX + 6) / 2)); y = (((stageHeight / 2) - ((sizeY + 6) / 2)) - app.y); app.paused = true; if (ID == 7){ MochiAd.showClickAwayAd({clip:ads, id:"17414dc404dcde8a"}); }; } private function onOkClick(_arg1:MouseEvent):void{ var o:Object; var boardID:String; var CPMStarContentSpotID:String; var ad:DisplayObject; var event = _arg1; Hide(); if (ID == 3){ app.field.infos[4].Show(); } else { if (ID == 4){ app.field.infos[10].Show(); } else { if (ID == 10){ app.field.infos[5].Show(); } else { if (ID == 5){ app.field.infos[6].Show(); } else { if (ID == 6){ app.field.infos[7].Show(); } else { if (ID == 1){ if (app.field.currSizeX == 8){ o = {n:[2, 12, 6, 9, 5, 9, 14, 0, 2, 11, 9, 15, 11, 5, 15, 2], f:function (_arg1:Number, _arg2:String):String{ if (_arg2.length == 16){ return (_arg2); }; return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16)))); }}; } else { if (app.field.currSizeX == 12){ o = {n:[14, 15, 2, 9, 9, 11, 6, 0, 7, 3, 15, 10, 12, 6, 13, 7], f:function (_arg1:Number, _arg2:String):String{ if (_arg2.length == 16){ return (_arg2); }; return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16)))); }}; } else { if (app.field.currSizeX == 16){ o = {n:[5, 0, 14, 3, 1, 2, 5, 3, 2, 14, 13, 7, 13, 12, 5, 0], f:function (_arg1:Number, _arg2:String):String{ if (_arg2.length == 16){ return (_arg2); }; return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16)))); }}; }; }; }; app.leaderboard.y = -(app.y); boardID = o.f(0, ""); MochiScores.showLeaderboard({boardID:boardID, score:app.field.winTime}); } else { if ((((ID == 0)) && ((app.field.playGameCount >= 5)))){ app.field.playGameCount = -5; if (app.CanShowJacket()){ app.field.infos[9].Show(); }; } else { if (ID == 9){ CPMStarContentSpotID = "568Q2E7570DF"; ad = new AdLoader(CPMStarContentSpotID); app.field.infos[9].adBox.removeChildAt((app.field.infos[9].adBox.numChildren - 1)); app.field.infos[9].adBox.addChild(ad); }; }; }; }; }; }; }; }; app.sndControl.Play(0, 1); } public function Hide():void{ if (ID == 3){ app.field.beginGame = true; }; parent.removeChild(this); if (!app.field.menu.opened){ app.paused = false; }; } } }//packageSection 25//LaserBox (LaserBox) package { import flash.events.*; import flash.display.*; import flash.geom.*; import CPMStar.*; import mochi.as3.*; import flash.net.*; public dynamic class LaserBox extends MovieClip { public var layers:Array; public var stageHeight:Number; public var iYX:int;// = 12 public var iYY:int;// = 12 private var blackScreen:Sprite; public var currEvent:String;// = "none" public var stars:Array; public var starsImg:Bitmap; public var splash:MovieClip; public var stageWidth:Number; public var iXX:int;// = 20 public var iXY:int;// = -5 public var paused:Boolean;// = false public var starImage:Bitmap; public var sndControl:SoundControl; public var background:Array; public var field:Field; public var leaderboard:Advertisment; public static var gameApp:LaserBox; public function LaserBox(){ stageWidth = Preloader.stageWidth; stageHeight = Preloader.stageHeight; sndControl = new SoundControl(); layers = new Array(9); leaderboard = new Advertisment(); background = new Array(2); stars = new Array(100); starsImg = new Bitmap(new BitmapData(570, 400, false, 0)); starImage = new Resources.imgStar(); super(); gameApp = this; if (stage){ Init(); SplashScr(); } else { addEventListener(Event.ADDED_TO_STAGE, Init); addEventListener(Event.ADDED_TO_STAGE, SplashScr); }; } private function onEnterFrameRemoveBlack(_arg1:Event):void{ if (blackScreen.alpha > 0){ blackScreen.alpha = (blackScreen.alpha - Math.min(0.1, blackScreen.alpha)); if (blackScreen.alpha <= 0){ layers[8].removeChild(blackScreen); addEventListener(MouseEvent.MOUSE_UP, onGlobalUp); removeEventListener(Event.ENTER_FRAME, onEnterFrameRemoveBlack); }; }; } private function drawStars(_arg1:Event):void{ var _local2:Number; starsImg.bitmapData.fillRect(new Rectangle(0, 0, 570, 400), 4278190080); var _local3:int; while (_local3 < stars.length) { _local2 = (0.1 + ((1 - 0.1) * ((200 - stars[_local3].z) / (200 - 100)))); starsImg.bitmapData.draw(starImage.bitmapData, new Matrix(_local2, 0, 0, _local2, stars[_local3].x, stars[_local3].y), null, null, null, true); stars[_local3].y = (stars[_local3].y - _local2); if (stars[_local3].y < -27){ stars[_local3].y = 400; stars[_local3].x = (Math.random() * 570); }; _local3++; }; } public function CreateEnviroment():void{ var _local2:String; var _local3:DisplayObject; var _local1:int; while (_local1 < stars.length) { stars[_local1] = new Object(); stars[_local1].y = (Math.random() * 460); stars[_local1].z = ((Math.random() * 100) + 100); stars[_local1].x = (Math.random() * 570); _local1++; }; addEventListener(Event.ENTER_FRAME, drawStars); background[0] = new Resources.imgBackground1(); background[1] = new Resources.imgBackground2(); background[1].y = 150; layers[0].addChild(starsImg); layers[0].addChild(background[0]); layers[0].addChild(background[1]); field = new Field(); field.CreateGameField(8, 8); if (CanShowMochi()){ field.infos[7].Show(); field.infos[7].Hide(); }; field.infos[3].Show(); if (CanShowJacket()){ _local2 = "568Q2E7570DF"; _local3 = new AdLoader(_local2); field.infos[9].adBox.addChild(_local3); field.infos[9].Show(); field.infos[9].Hide(); }; } private function onSplashClick(_arg1:MouseEvent):void{ navigateToURL(new URLRequest("http://www.dustunited.com")); } public function SplashScr(_arg1:Event=null):void{ splash = new Resources.swfSplash(); splash.x = ((stageWidth / 2) - (splash.width / 2)); splash.y = ((stageHeight / 2) - (splash.height / 2)); splash.addEventListener(Event.ENTER_FRAME, onSplashFrame); splash.addEventListener(MouseEvent.CLICK, onSplashClick); splash.buttonMode = true; addChild(splash); } private function onGlobalUp(_arg1:Event):void{ var _local2:int; var _local3:int; var _local4:int; var _local5:int; var _local6:int; var _local7:int; if ((((((field.boxes.length > 0)) && (!((BoxButton.lastBox == null))))) && (!((_arg1.target.parent.toString() == "[object BoxButton]"))))){ if (BoxButton.firstBox.posX <= BoxButton.lastBox.posX){ _local4 = BoxButton.firstBox.posX; _local5 = BoxButton.lastBox.posX; } else { _local4 = BoxButton.lastBox.posX; _local5 = BoxButton.firstBox.posX; }; if (BoxButton.firstBox.posY <= BoxButton.lastBox.posY){ _local6 = BoxButton.firstBox.posY; _local7 = BoxButton.lastBox.posY; } else { _local6 = BoxButton.lastBox.posY; _local7 = BoxButton.firstBox.posY; }; _local2 = _local4; while (_local2 <= _local5) { _local3 = _local6; while (_local3 <= _local7) { field.boxes[_local2][_local3].UnlockSelect(); _local3++; }; _local2++; }; BoxButton.firstBox = null; BoxButton.lastBox = null; }; } public function CanShowJacket():Boolean{ if (loaderInfo.url.toLocaleLowerCase().indexOf("kongregate", 0) != -1){ return (false); }; if (loaderInfo.url.toLocaleLowerCase().indexOf("armorgames", 0) != -1){ return (false); }; if (loaderInfo.url.toLocaleLowerCase().indexOf("mochi", 0) != -1){ return (false); }; if (loaderInfo.url.toLocaleLowerCase().indexOf("flashgamelicense", 0) != -1){ return (false); }; return (true); } public function IsLocal():Boolean{ return (false); } public function OnTrueSite():Boolean{ return (true); } private function onSplashFrame(_arg1:Event):void{ if (splash.currentFrame == splash.totalFrames){ splash.removeEventListener(Event.ENTER_FRAME, onSplashFrame); splash.removeEventListener(MouseEvent.CLICK, onSplashClick); splash.parent.removeChild(splash); splash.stop(); addEventListener(Event.ENTER_FRAME, onEnterFrameRemoveBlack); }; } public function Init(_arg1:Event=null):void{ stage.showDefaultContextMenu = false; stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; MochiBot.track(this, "d7f5b518"); var _local2:int; while (_local2 < layers.length) { layers[_local2] = new Sprite(); addChild(layers[_local2]); _local2++; }; blackScreen = new Sprite(); blackScreen.graphics.beginFill(0); blackScreen.graphics.drawRect(0, 0, stageWidth, 493); blackScreen.graphics.endFill(); layers[8].addChild(blackScreen); layers[7].addChild(leaderboard); MochiServices.connect("17414dc404dcde8a", leaderboard); CreateEnviroment(); } public function CanShowMochi():Boolean{ if (loaderInfo.url.toLocaleLowerCase().indexOf("kongregate", 0) != -1){ return (false); }; if (loaderInfo.url.toLocaleLowerCase().indexOf("armorgames", 0) != -1){ return (false); }; if (loaderInfo.url.toLocaleLowerCase().indexOf("flashgamelicense", 0) != -1){ return (false); }; return (true); } } }//packageSection 26//LaserButton (LaserButton) package { import flash.events.*; import flash.display.*; public class LaserButton extends Sprite { public var app:LaserBox; public var stageHeight:Number; public var lockSelect:Boolean;// = false public var stageWidth:Number; public var selectH:Bitmap; public var pos:int;// = 0 public var side:int;// = 0 public var selectV:Bitmap; private static var lasers:Array = new Array(); public function LaserButton(_arg1:int, _arg2:int){ var _local3:Bitmap; stageWidth = Preloader.stageWidth; stageHeight = Preloader.stageHeight; app = LaserBox.gameApp; super(); pos = _arg1; side = _arg2; if ((((side == 0)) || ((side == 2)))){ _local3 = new Resources.imgLaserPlateV(); } else { _local3 = new Resources.imgLaserPlateH(); }; addChild(_local3); selectH = new Resources.imgLaserSelectH(); selectH.x = 0; selectH.y = -17; selectV = new Resources.imgLaserSelectV(); selectV.x = 0; selectV.y = -17; if (lasers.length == 0){ lasers.push(new Resources.imgLaser1()); lasers.push(new Resources.imgLaser2()); lasers.push(new Resources.imgLaser3()); lasers.push(new Resources.imgLaser4()); lasers[0].x = 6; lasers[0].y = -12; lasers[1].x = 11; lasers[1].y = -9; lasers[2].x = 14; lasers[2].y = -7; lasers[3].x = 3; lasers[3].y = -6; }; var _local4:Sprite = new Sprite(); _local4.graphics.beginFill(0, 0); if ((((side == 0)) || ((side == 2)))){ _local4.graphics.moveTo(0, (4 - 17)); _local4.graphics.lineTo(20, (0 - 17)); _local4.graphics.lineTo(35, (15 - 17)); _local4.graphics.lineTo(35, 15); _local4.graphics.lineTo(16, 20); _local4.graphics.lineTo(0, 4); _local4.graphics.lineTo(0, (4 - 17)); } else { _local4.graphics.moveTo(0, (5 - 17)); _local4.graphics.lineTo(25, (0 - 17)); _local4.graphics.lineTo(36, (11 - 17)); _local4.graphics.lineTo(36, 11); _local4.graphics.lineTo(12, 17); _local4.graphics.lineTo(0, 5); _local4.graphics.lineTo(0, (5 - 17)); }; _local4.graphics.endFill(); hitArea = _local4; addChild(_local4); buttonMode = true; addEventListener(MouseEvent.MOUSE_OVER, onOver); addEventListener(MouseEvent.MOUSE_OUT, onOut); addEventListener(MouseEvent.CLICK, onClick); } public function UnlockSelect():void{ lockSelect = false; if (selectH.parent != null){ selectH.parent.removeChild(selectH); }; if (selectV.parent != null){ selectV.parent.removeChild(selectV); }; } private function onClick(_arg1:MouseEvent):void{ if (!app.paused){ app.sndControl.Play(1, 1); lockSelect = true; if ((((side == 0)) || ((side == 2)))){ app.field.selectPanel[1].Show((x + 15), (y + 7)); } else { app.field.selectPanel[1].Show((x + 15), (y + 5)); }; app.field.selectPanel[1].laserButton = this; }; } private function onOver(_arg1:MouseEvent):void{ if (((!(lockSelect)) && (!(app.paused)))){ if (selectH.parent != null){ selectH.parent.removeChild(selectH); }; if (selectV.parent != null){ selectV.parent.removeChild(selectV); }; if ((((side == 0)) || ((side == 2)))){ addChild(selectV); } else { addChild(selectH); }; }; } public function Destroy():void{ removeEventListener(MouseEvent.MOUSE_OVER, onOver); removeEventListener(MouseEvent.MOUSE_OUT, onOut); removeEventListener(MouseEvent.CLICK, onClick); app = null; selectH = null; selectV = null; } private function onOut(_arg1:MouseEvent):void{ if (((!(lockSelect)) && (!((selectH.parent == null))))){ selectH.parent.removeChild(selectH); }; if (((!(lockSelect)) && (!((selectV.parent == null))))){ selectV.parent.removeChild(selectV); }; } public function Fire(_arg1:Boolean):void{ var _local2:int; _local2 = 0; while (_local2 < 4) { if (lasers[_local2].parent != null){ lasers[_local2].parent.removeChild(lasers[_local2]); }; _local2++; }; addChild(lasers[side]); _local2 = 0; while (_local2 < app.field.beams.length) { if (app.field.beams[_local2].isLaser){ app.field.beams[_local2].Deactivate(); _local2--; }; _local2++; }; app.field.beams.push(new Beam()); var _local3:int = app.field.currSizeX; switch (side){ case 0: app.field.beams[(app.field.beams.length - 1)].Fire(_arg1, side, pos, -1); break; case 1: app.field.beams[(app.field.beams.length - 1)].Fire(_arg1, side, _local3, (pos - _local3)); break; case 2: app.field.beams[(app.field.beams.length - 1)].Fire(_arg1, side, (((_local3 - 1) - pos) + (side * _local3)), _local3); break; case 3: app.field.beams[(app.field.beams.length - 1)].Fire(_arg1, side, -1, (((_local3 - 1) - pos) + (side * _local3))); break; }; } } }//packageSection 27//MenuButton (MenuButton) package { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.utils.*; public class MenuButton extends Sprite { private var maxSize:int; private var menuLeft:Bitmap; private var oneSize:int; public var currEvent:int; private var menuFront:Bitmap; public var eGrow:int;// = 2 private var maxUp:int;// = 14 public var app:LaserBox; private var prevCurrSize:int;// = 0 public var eNone:int;// = 0 private var textButton:Array; public var stageHeight:Number; private var darkness:Bitmap; public var eShrink:int;// = 1 private var timer:Timer; private var hitShape:Sprite; private var prevTimer:int;// = 0 private var currSize:Number;// = 0 private var menuBack:Bitmap; public var stageWidth:Number; public var opened:Boolean;// = false private var currUp:Number;// = 0 public var eTextUp:int;// = 3 private var menuTop:Bitmap; public var eTextDown:int;// = 4 private var select:Bitmap; private var menuRight:Bitmap; public function MenuButton(){ var _local1:int; stageWidth = Preloader.stageWidth; stageHeight = Preloader.stageHeight; app = LaserBox.gameApp; currEvent = eNone; textButton = new Array(); timer = new Timer(25); super(); textButton.push(new MenuTextButton("Field...")); textButton.push(new MenuTextButton("Reset")); textButton.push(new MenuTextButton("Leaderboard")); textButton.push(new MenuTextButton("Rules")); textButton.push(new MenuTextButton("More Games")); textButton.push(new MenuTextButton("About")); oneSize = 14; maxSize = (textButton.length * oneSize); menuBack = new Resources.imgMenuBack(); addChild(menuBack); menuBack.x = -1; menuBack.y = -1; menuRight = new Bitmap(new BitmapData((75 + maxSize), (37 + maxSize), true, 0xFFFFFF)); menuRight.x = (18 - maxSize); menuRight.y = (0 - maxSize); addChild(menuRight); darkness = new Resources.imgMenuDark(); darkness.x = 6; darkness.y = 2; darkness.alpha = 0; addChild(darkness); _local1 = 0; while (_local1 < textButton.length) { textButton[_local1].x = ((((oneSize / 2) + (_local1 * oneSize)) + 2) - maxSize); textButton[_local1].y = (((((oneSize / 2) + (_local1 * oneSize)) - textButton[_local1].height) + 43) - maxSize); _local1++; }; menuLeft = new Bitmap(new BitmapData((6 + maxSize), (24 + maxSize), true, 0xFFFFFF)); menuLeft.x = (1 - maxSize); menuLeft.y = (22 - maxSize); addChild(menuLeft); menuFront = new Resources.imgMenuFront(); menuFront.x = 1; menuFront.y = 1; addChild(menuFront); select = new Resources.imgMenuSelect(); select.x = 4; select.y = 5; menuTop = new Resources.imgMenuTop(); menuTop.y = -3; addChild(menuTop); hitShape = new Sprite(); hitShape.graphics.beginFill(0, 0); hitShape.graphics.moveTo(4, 27); hitShape.graphics.lineTo(95, 5); hitShape.graphics.lineTo(95, 25); hitShape.graphics.lineTo(4, 47); hitShape.graphics.lineTo(4, 27); hitShape.graphics.endFill(); hitShape.buttonMode = true; addChild(hitShape); hitShape.addEventListener(MouseEvent.MOUSE_OVER, onOver); hitShape.addEventListener(MouseEvent.MOUSE_OUT, onOut); hitShape.addEventListener(MouseEvent.CLICK, onClick); timer.addEventListener(TimerEvent.TIMER, onEnterFrame); } private function onOut(_arg1:MouseEvent):void{ if (select.parent != null){ removeChild(select); }; } private function onEnterFrame(_arg1:TimerEvent):void{ var _local3:int; var _local4:Number; var _local2:int; if (currEvent == eGrow){ _local3 = getTimer(); _local4 = ((_local3 - prevTimer) / 20); prevTimer = _local3; if ((currSize + _local4) > maxSize){ _local4 = (maxSize - currSize); }; currSize = (currSize + _local4); hitShape.x = Math.round(currSize); hitShape.y = Math.round(currSize); select.x = (4 + Math.round(currSize)); select.y = (5 + Math.round(currSize)); menuLeft.x = ((1 - maxSize) + Math.round(currSize)); menuLeft.y = ((22 - maxSize) + Math.round(currSize)); menuFront.x = (1 + Math.round(currSize)); menuFront.y = (1 + Math.round(currSize)); menuRight.x = ((18 - maxSize) + Math.round(currSize)); menuRight.y = ((0 - maxSize) + Math.round(currSize)); _local2 = 0; while (_local2 < textButton.length) { textButton[_local2].x = (((((oneSize / 2) + (_local2 * oneSize)) + 2) - maxSize) + Math.round(currSize)); textButton[_local2].y = ((((((oneSize / 2) + (_local2 * oneSize)) - textButton[_local2].height) + 43) - maxSize) + Math.round(currSize)); if ((((textButton[_local2].x >= -2)) && ((textButton[_local2].parent == null)))){ addChildAt(textButton[_local2], 3); }; if ((((textButton[_local2].x >= -2)) && ((textButton[_local2].x <= 3)))){ textButton[_local2].blackText.alpha = ((3 - textButton[_local2].x) / 5); }; if ((((textButton[_local2].x > 3)) && ((textButton[_local2].blackText.alpha > 0)))){ textButton[_local2].blackText.alpha = 0; }; _local2++; }; menuLeft.bitmapData.fillRect(new Rectangle(0, 0, menuLeft.width, menuLeft.height), 0xFFFFFF); menuRight.bitmapData.fillRect(new Rectangle(0, 0, menuRight.width, menuRight.height), 0xFFFFFF); _local2 = (maxSize - Math.round(currSize)); while (_local2 < maxSize) { menuLeft.bitmapData.copyPixels(new Resources.imgMenuLeft().bitmapData, new Rectangle(0, 0, 6, 24), new Point(_local2, _local2), null, null, true); menuRight.bitmapData.copyPixels(new Resources.imgMenuRight().bitmapData, new Rectangle(0, 0, 75, 37), new Point(_local2, _local2), null, null, true); _local2++; }; if (currSize >= (maxSize - 20)){ darkness.alpha = ((maxSize - currSize) / 20); }; if (currSize >= maxSize){ currEvent = eTextUp; removeChild(menuTop); }; } else { if (currEvent == eShrink){ _local3 = getTimer(); _local4 = ((_local3 - prevTimer) / 20); prevTimer = _local3; if ((currSize - _local4) < 0){ _local4 = currSize; }; currSize = (currSize - _local4); hitShape.x = Math.round(currSize); hitShape.y = Math.round(currSize); select.x = (4 + Math.round(currSize)); select.y = (5 + Math.round(currSize)); menuLeft.x = ((1 - maxSize) + Math.round(currSize)); menuLeft.y = ((22 - maxSize) + Math.round(currSize)); menuFront.x = (1 + Math.round(currSize)); menuFront.y = (1 + Math.round(currSize)); menuRight.x = ((18 - maxSize) + Math.round(currSize)); menuRight.y = ((0 - maxSize) + Math.round(currSize)); _local2 = 0; while (_local2 < textButton.length) { if ((((textButton[_local2].x <= -1)) && (!((textButton[_local2].parent == null))))){ removeChild(textButton[_local2]); }; if ((((textButton[_local2].x >= -2)) && ((textButton[_local2].x <= 3)))){ textButton[_local2].blackText.alpha = ((3 - textButton[_local2].x) / 5); }; textButton[_local2].x = (((((oneSize / 2) + (_local2 * oneSize)) + 2) - maxSize) + Math.round(currSize)); textButton[_local2].y = ((((((oneSize / 2) + (_local2 * oneSize)) - textButton[_local2].height) + 43) - maxSize) + Math.round(currSize)); _local2++; }; menuLeft.bitmapData.fillRect(new Rectangle(0, 0, menuLeft.width, menuLeft.height), 0xFFFFFF); menuRight.bitmapData.fillRect(new Rectangle(0, 0, menuRight.width, menuRight.height), 0xFFFFFF); _local2 = (maxSize - Math.round(currSize)); while (_local2 < maxSize) { menuLeft.bitmapData.copyPixels(new Resources.imgMenuLeft().bitmapData, new Rectangle(0, 0, 6, 24), new Point(_local2, _local2), null, null, true); menuRight.bitmapData.copyPixels(new Resources.imgMenuRight().bitmapData, new Rectangle(0, 0, 75, 37), new Point(_local2, _local2), null, null, true); _local2++; }; if (currSize >= (maxSize - 20)){ darkness.alpha = ((maxSize - currSize) / 20); }; if (currSize <= 0){ currEvent = eNone; opened = false; app.paused = false; darkness.alpha = 0; timer.stop(); }; } else { if (currEvent == eTextUp){ _local3 = getTimer(); _local4 = ((_local3 - prevTimer) / 20); prevTimer = _local3; if ((currUp + _local4) > maxUp){ _local4 = (maxUp - currUp); }; currUp = (currUp + _local4); _local2 = 0; while (_local2 < textButton.length) { textButton[_local2].y = (((((((oneSize / 2) + (_local2 * oneSize)) - textButton[_local2].height) + 43) - maxSize) + Math.round(currSize)) - Math.round(currUp)); _local2++; }; if (currUp >= maxUp){ currEvent = eNone; prevTimer = getTimer(); opened = true; }; } else { if (currEvent == eTextDown){ _local3 = getTimer(); _local4 = ((_local3 - prevTimer) / 20); prevTimer = _local3; if ((currUp - _local4) < 0){ _local4 = currUp; }; currUp = (currUp - _local4); _local2 = 0; while (_local2 < textButton.length) { textButton[_local2].y = (((((((oneSize / 2) + (_local2 * oneSize)) - textButton[_local2].height) + 43) - maxSize) + Math.round(currSize)) - Math.round(currUp)); _local2++; }; if (currUp <= 0){ app.sndControl.Play(5, 1); currEvent = eShrink; prevTimer = getTimer(); addChildAt(menuTop, numChildren); }; }; }; }; }; } private function onOver(_arg1:MouseEvent):void{ if (select.parent == null){ addChild(select); }; } private function onClick(_arg1:MouseEvent):void{ var _local2:int; if ((((currEvent == eNone)) && (opened))){ app.sndControl.Play(0, 1); currEvent = eTextDown; prevTimer = getTimer(); _local2 = 0; while (_local2 < app.field.selectPanel.length) { app.field.selectPanel[_local2].Hide(); _local2++; }; } else { if ((((currEvent == eNone)) && (!(opened)))){ app.sndControl.Play(0, 1); app.sndControl.Play(5, 1); darkness.alpha = 1; currEvent = eGrow; app.paused = true; timer.start(); prevTimer = getTimer(); _local2 = 0; while (_local2 < app.field.selectPanel.length) { app.field.selectPanel[_local2].Hide(); _local2++; }; }; }; } } }//packageSection 28//MenuTextButton (MenuTextButton) package { import flash.events.*; import flash.display.*; import flash.geom.*; import mochi.as3.*; import flash.text.*; import flash.net.*; public class MenuTextButton extends Sprite { public var app:LaserBox; public var stageHeight:Number; public var stageWidth:Number; public var hide:Boolean;// = false public var blackText:Bitmap; public var id:int; public static var globalId:int = 0; public static var buttonArray:Array = new Array(); public function MenuTextButton(_arg1:String){ stageWidth = Preloader.stageWidth; stageHeight = Preloader.stageHeight; app = LaserBox.gameApp; super(); globalId++; id = globalId; var _local2:TextFormat = new TextFormat(); var _local3:Font = new Resources.swfFont1(); _local2.font = _local3.fontName; _local2.size = 16; var _local4:TextField = new TextField(); _local4.text = _arg1; _local4.setTextFormat(_local2); _local4.embedFonts = true; _local4.autoSize = TextFieldAutoSize.LEFT; _local4.textColor = 8258050; var _local5:Bitmap = new Bitmap(new BitmapData(_local4.width, (_local4.height + (_local4.width / 4)), true, 0xFFFFFF)); _local5.smoothing = true; _local5.bitmapData.draw(_local4, new Matrix(1, -0.24, 0, 1, 0, ((_local4.width / 4) + 1))); var _local6:Bitmap = new Bitmap(new BitmapData((_local5.width + 2), (_local5.height + 2), true, 0xFFFFFF)); _local6.bitmapData.copyPixels(_local5.bitmapData, new Rectangle(0, 0, _local5.width, _local5.height), new Point(0, 0), null, null, true); _local6.bitmapData.copyPixels(_local5.bitmapData, new Rectangle(0, 0, _local5.width, _local5.height), new Point(1, 1), null, null, true); _local6.bitmapData.colorTransform(new Rectangle(0, 0, _local6.width, _local6.height), new ColorTransform(0, 0, 0, 1, 252, 237, 237)); _local6.bitmapData.copyPixels(_local5.bitmapData, new Rectangle(0, 0, _local5.width, _local5.height), new Point(2, 2), null, null, true); addChild(_local6); blackText = new Bitmap(new BitmapData(_local6.width, _local6.height, true, 0xFFFFFF)); blackText.bitmapData.copyPixels(_local6.bitmapData, new Rectangle(0, 0, _local6.width, _local6.height), new Point(0, 0), null, null, true); blackText.bitmapData.colorTransform(new Rectangle(0, 0, _local6.width, _local6.height), new ColorTransform(0, 0, 0, 1)); addChild(blackText); var _local7:Sprite = new Sprite(); _local7.graphics.beginFill(0, 0); _local7.graphics.moveTo(0, ((_local4.width / 4) + 6)); _local7.graphics.lineTo(_local4.width, (0 + 6)); _local7.graphics.lineTo(_local4.width, (_local4.height - 2)); _local7.graphics.lineTo(0, (((_local4.width / 4) + _local4.height) - 2)); _local7.graphics.lineTo(0, ((_local4.width / 4) + 6)); _local7.graphics.endFill(); hitArea = _local7; addChild(_local7); buttonMode = true; buttonArray.push(this); addEventListener(MouseEvent.MOUSE_OVER, onOver); addEventListener(MouseEvent.MOUSE_OUT, onOut); addEventListener(MouseEvent.CLICK, onClick); addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onClick(_arg1:MouseEvent):void{ var o:Object; var boardID:String; var event = _arg1; if (app.field.menu.currEvent != app.field.menu.eNone){ return; }; app.sndControl.Play(1, 1); switch (id){ case 1: app.field.selectPanel[2].Show((app.field.menu.x - 3), (app.field.menu.y + 18)); break; case 2: app.field.CreateGameField(app.field.fieldSizeX, app.field.fieldSizeY); app.field.menu.currEvent = app.field.menu.eTextDown; onOut(null); break; case 3: if (app.field.currSizeX == 8){ o = {n:[2, 12, 6, 9, 5, 9, 14, 0, 2, 11, 9, 15, 11, 5, 15, 2], f:function (_arg1:Number, _arg2:String):String{ if (_arg2.length == 16){ return (_arg2); }; return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16)))); }}; } else { if (app.field.currSizeX == 12){ o = {n:[14, 15, 2, 9, 9, 11, 6, 0, 7, 3, 15, 10, 12, 6, 13, 7], f:function (_arg1:Number, _arg2:String):String{ if (_arg2.length == 16){ return (_arg2); }; return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16)))); }}; } else { if (app.field.currSizeX == 16){ o = {n:[5, 0, 14, 3, 1, 2, 5, 3, 2, 14, 13, 7, 13, 12, 5, 0], f:function (_arg1:Number, _arg2:String):String{ if (_arg2.length == 16){ return (_arg2); }; return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16)))); }}; }; }; }; app.leaderboard.y = -(app.y); boardID = o.f(0, ""); if (MochiServices.connected == false){ MochiServices.connect("17414dc404dcde8a", app.leaderboard); }; MochiScores.showLeaderboard({boardID:boardID}); break; case 4: app.field.infos[3].Show(); break; case 5: navigateToURL(new URLRequest("http://www.dustunited.com")); break; case 6: app.field.infos[8].Show(); break; }; } private function onOut(_arg1:MouseEvent):void{ var _local2:int; while (_local2 < buttonArray.length) { buttonArray[_local2].hide = false; _local2++; }; } private function onEnterFrame(_arg1:Event):void{ if (((hide) && ((alpha > 0.3)))){ alpha = (alpha - 0.1); } else { if (((!(hide)) && ((alpha < 1)))){ alpha = (alpha + 0.1); }; }; } private function onOver(_arg1:MouseEvent):void{ if (app.field.menu.currEvent != app.field.menu.eNone){ return; }; var _local2:int; while (_local2 < buttonArray.length) { buttonArray[_local2].hide = true; _local2++; }; hide = false; } } }//packageSection 29//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); } } }//packageSection 30//Preloader (Preloader) package { import flash.events.*; import flash.display.*; import flash.text.*; import flash.utils.*; public dynamic class Preloader extends MovieClip { private var ofX:Number; private var ofY:Number; private var progressBar:Sprite; private var textLoading:TextField; private var blackScreen:Sprite; private var progress:Number;// = 0 private var iX:Number;// = 250 private var iY:Number;// = 30 private var iZ:Number; private var firstDraw:Boolean;// = false public static var stageWidth:Number = 570; public static var stageHeight:Number = 400; public function Preloader(){ textLoading = new TextField(); progressBar = new Sprite(); iZ = (23 / Math.sqrt(2)); ofX = ((stageWidth / 2) - ((iX + iZ) / 2)); ofY = ((stageHeight / 2) - ((iY + iZ) / 2)); super(); stage.showDefaultContextMenu = false; stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; var _local1:TextFormat = new TextFormat(); _local1.font = "Arial Black"; _local1.color = 0xFFFFFF; _local1.size = 25; _local1.align = TextFormatAlign.CENTER; textLoading.defaultTextFormat = _local1; textLoading.text = "LOADING"; textLoading.width = iX; textLoading.height = iY; textLoading.x = (ofX + iZ); textLoading.y = (ofY - 6); textLoading.autoSize = TextFieldAutoSize.CENTER; addChild(textLoading); graphics.beginFill(0x424242); graphics.lineTo((ofX + 0), (ofY + iZ)); graphics.lineTo((ofX + iZ), (ofY + 0)); graphics.lineTo((ofX + iZ), (ofY + iY)); graphics.lineTo((ofX + 0), ((ofY + iY) + iZ)); graphics.lineTo((ofX + 0), (ofY + iZ)); graphics.endFill(); graphics.beginFill(0x8A8A8A); graphics.drawRect((ofX + iZ), ofY, iX, iY); graphics.endFill(); graphics.beginFill(0x646464); graphics.lineTo((ofX + iZ), (ofY + iY)); graphics.lineTo(((ofX + iZ) + iX), (ofY + iY)); graphics.lineTo((ofX + iX), ((ofY + iY) + iZ)); graphics.lineTo((ofX + 0), ((ofY + iY) + iZ)); graphics.lineTo((ofX + iZ), (ofY + iY)); graphics.endFill(); progressBar.x = (ofX + 2); progressBar.y = ofY; addChild(progressBar); var _local2:Sprite = new Sprite(); _local2.graphics.beginFill(0); _local2.graphics.lineTo(iX, iZ); _local2.graphics.lineTo(((iX + iZ) + 2), -2); _local2.graphics.lineTo(((iX + iZ) + 2), iY); _local2.graphics.lineTo(iX, (iY + iZ)); _local2.graphics.lineTo(iX, iZ); _local2.graphics.endFill(); _local2.graphics.lineStyle(1, 0xC5C5C5); _local2.graphics.lineTo((iX + iZ), 0); _local2.graphics.lineTo(iX, iZ); _local2.graphics.lineTo(iX, (iY + iZ)); _local2.graphics.lineStyle(2, 0xC5C5C5); _local2.graphics.moveTo((iZ + iX), 0); _local2.graphics.lineTo(iZ, 0); _local2.graphics.lineTo(0, iZ); _local2.graphics.lineTo(0, (iY + iZ)); _local2.graphics.lineTo(iX, (iY + iZ)); _local2.x = ofX; _local2.y = ofY; addChild(_local2); blackScreen = new Sprite(); blackScreen.graphics.beginFill(0); blackScreen.graphics.drawRect(0, 0, stageWidth, stageHeight); blackScreen.graphics.endFill(); blackScreen.alpha = 0; addChild(blackScreen); stop(); addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function Init():void{ var _local1:Class = Class(getDefinitionByName("LaserBox")); var _local2:Object = new (_local1); stage.addChild((_local2 as DisplayObject)); parent.removeChild(this); } public function onEnterFrame(_arg1:Event):void{ var _local2:Number = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal); if ((((framesLoaded == totalFrames)) && (firstDraw))){ blackScreen.alpha = (blackScreen.alpha + 0.1); if (blackScreen.alpha >= 1){ nextFrame(); Init(); removeEventListener(Event.ENTER_FRAME, onEnterFrame); }; } else { firstDraw = true; progressBar.graphics.clear(); progressBar.graphics.beginFill(1264923, 0.7); progressBar.graphics.lineTo(0, iZ); progressBar.graphics.lineTo(iZ, 0); progressBar.graphics.lineTo(iZ, 0); progressBar.graphics.lineTo((iZ + (iX * _local2)), 0); progressBar.graphics.lineTo((iZ + (iX * _local2)), iY); progressBar.graphics.lineTo((iX * _local2), (iY + iZ)); progressBar.graphics.lineTo(0, (iY + iZ)); progressBar.graphics.lineTo(0, iZ); progressBar.graphics.endFill(); progressBar.graphics.lineStyle(1, 2921274, 0.3); progressBar.graphics.moveTo(0, iZ); progressBar.graphics.lineTo((iX * _local2), iZ); progressBar.graphics.moveTo((iZ + (iX * _local2)), 0); progressBar.graphics.lineTo((iX * _local2), iZ); progressBar.graphics.lineTo((iX * _local2), (iZ + iY)); }; } } }//packageSection 31//Resources (Resources) package { public class Resources { public static var imgBackground1:Class = Resources_imgBackground1; public static var imgBackground2:Class = Resources_imgBackground2; public static var imgLogo:Class = Resources_imgLogo; public static var imgShWall1:Class = Resources_imgShWall1; public static var imgShWall2:Class = Resources_imgShWall2; public static var imgShWall3:Class = Resources_imgShWall3; public static var imgShCiferblat1:Class = Resources_imgShCiferblat1; public static var sndAmbient2:Class = Resources_sndAmbient2; public static var imgBoxSelect:Class = Resources_imgBoxSelect; public static var imgMirrorWrong1:Class = Resources_imgMirrorWrong1; public static var imgShCiferblat2:Class = Resources_imgShCiferblat2; private static var imgBox2:Class = Resources_imgBox2; private static var imgBox3:Class = Resources_imgBox3; private static var imgBox4:Class = Resources_imgBox4; public static var imgSmButtonRestart:Class = Resources_imgSmButtonRestart; public static var imgMirrorWrong2:Class = Resources_imgMirrorWrong2; public static var imgInfoSkip:Class = Resources_imgInfoSkip; public static var sndAmbient1:Class = Resources_sndAmbient1; public static var imgMenuTop:Class = Resources_imgMenuTop; public static var imgNumbers:Class = Resources_imgNumbers; public static var imgSmButtonSndOff:Class = Resources_imgSmButtonSndOff; private static var imgBox1:Class = Resources_imgBox1; public static var imgAddSite:Class = Resources_imgAddSite; public static var imgMirrorBad1:Class = Resources_imgMirrorBad1; public static var imgSelPanButtonOn:Class = Resources_imgSelPanButtonOn; public static var imgSmButtonSndOn:Class = Resources_imgSmButtonSndOn; public static var imgMenuSelect:Class = Resources_imgMenuSelect; public static var imgBeam1:Class = Resources_imgBeam1; public static var swfFont2:Class = Resources_swfFont2; public static var imgBeamWave1:Array = [new imgBeamWave11(), new imgBeamWave12(), new imgBeamWave13()]; public static var imgBeam2:Class = Resources_imgBeam2; public static var imgMirrorUnknw2:Class = Resources_imgMirrorUnknw2; public static var imgLaser1:Class = Resources_imgLaser1; public static var imgLaser3:Class = Resources_imgLaser3; public static var imgLaser4:Class = Resources_imgLaser4; public static var imgBeamWave2:Array = [new imgBeamWave21(), new imgBeamWave22(), new imgBeamWave23()]; public static var swfFont1:Class = Resources_swfFont1; public static var imgMenuDark:Class = Resources_imgMenuDark; public static var imgLaser2:Class = Resources_imgLaser2; public static var sndClick1:Class = Resources_sndClick1; public static var imgDustunited:Class = Resources_imgDustunited; public static var imgInfoWall:Class = Resources_imgInfoWall; public static var imgSmButtonBaseOn:Class = Resources_imgSmButtonBaseOn; public static var imgMenuRight:Class = Resources_imgMenuRight; public static var imgMenuFront:Class = Resources_imgMenuFront; public static var imgMirrorBad2:Class = Resources_imgMirrorBad2; public static var swfSplash:Class = Resources_swfSplash; private static var imgBeamWave11:Class = Resources_imgBeamWave11; private static var imgBeamWave12:Class = Resources_imgBeamWave12; private static var imgBeamWave13:Class = Resources_imgBeamWave13; public static var imgSelPanPipeL:Class = Resources_imgSelPanPipeL; public static var imgMirrorUnknw1:Class = Resources_imgMirrorUnknw1; public static var sndClick2:Class = Resources_sndClick2; public static var imgSelPanPipeR:Class = Resources_imgSelPanPipeR; public static var sndLaserEnd:Class = Resources_sndLaserEnd; public static var imgInfoBorder:Class = Resources_imgInfoBorder; public static var imgWall2:Class = Resources_imgWall2; public static var imgWall3:Class = Resources_imgWall3; public static var sndLaserStart:Class = Resources_sndLaserStart; private static var imgBeamWave21:Class = Resources_imgBeamWave21; private static var imgBeamWave22:Class = Resources_imgBeamWave22; private static var imgBeamWave23:Class = Resources_imgBeamWave23; public static var imgCiferblat1:Class = Resources_imgCiferblat1; public static var imgCiferblat2:Class = Resources_imgCiferblat2; public static var imgWall1:Class = Resources_imgWall1; public static var imgStar:Class = Resources_imgStar; public static var imgBoxes:Array = new Array(4); public static var imgSmButtonBaseSel:Class = Resources_imgSmButtonBaseSel; public static var imgRules1:Class = Resources_imgRules1; public static var imgRules3:Class = Resources_imgRules3; public static var imgRules4:Class = Resources_imgRules4; public static var imgRules5:Class = Resources_imgRules5; public static var imgRules6:Class = Resources_imgRules6; public static var imgRules7:Class = Resources_imgRules7; public static var imgRules2:Class = Resources_imgRules2; public static var imgMenuBack:Class = Resources_imgMenuBack; public static var imgInfoOk:Class = Resources_imgInfoOk; public static var imgShBottom1:Class = Resources_imgShBottom1; public static var imgShBottom2:Class = Resources_imgShBottom2; public static var imgShBottom4:Class = Resources_imgShBottom4; public static var imgMirrorGood2:Class = Resources_imgMirrorGood2; public static var imgShBottom3:Class = Resources_imgShBottom3; public static var imgShBottom5:Class = Resources_imgShBottom5; public static var imgLaserPlateH:Class = Resources_imgLaserPlateH; public static var imgSmButtonBaseOff:Class = Resources_imgSmButtonBaseOff; public static var sndSlidingStone:Class = Resources_sndSlidingStone; public static var imgLaserSelectH:Class = Resources_imgLaserSelectH; public static var imgLaserPlateV:Class = Resources_imgLaserPlateV; public static var imgMenuLeft:Class = Resources_imgMenuLeft; public static var imgMirrorGood1:Class = Resources_imgMirrorGood1; public static var imgBoxPlate:Class = Resources_imgBoxPlate; public static var sndLaserContinues:Class = Resources_sndLaserContinues; public static var imgLaserSelectV:Class = Resources_imgLaserSelectV; public static var imgSelPanButtonOff:Class = Resources_imgSelPanButtonOff; imgBoxes[0] = imgBox1; imgBoxes[1] = imgBox2; imgBoxes[2] = imgBox3; imgBoxes[3] = imgBox4; } }//packageSection 32//Resources_imgAddSite (Resources_imgAddSite) package { import mx.core.*; public class Resources_imgAddSite extends BitmapAsset { } }//packageSection 33//Resources_imgBackground1 (Resources_imgBackground1) package { import mx.core.*; public class Resources_imgBackground1 extends BitmapAsset { } }//packageSection 34//Resources_imgBackground2 (Resources_imgBackground2) package { import mx.core.*; public class Resources_imgBackground2 extends BitmapAsset { } }//packageSection 35//Resources_imgBeam1 (Resources_imgBeam1) package { import mx.core.*; public class Resources_imgBeam1 extends BitmapAsset { } }//packageSection 36//Resources_imgBeam2 (Resources_imgBeam2) package { import mx.core.*; public class Resources_imgBeam2 extends BitmapAsset { } }//packageSection 37//Resources_imgBeamWave11 (Resources_imgBeamWave11) package { import mx.core.*; public class Resources_imgBeamWave11 extends BitmapAsset { } }//packageSection 38//Resources_imgBeamWave12 (Resources_imgBeamWave12) package { import mx.core.*; public class Resources_imgBeamWave12 extends BitmapAsset { } }//packageSection 39//Resources_imgBeamWave13 (Resources_imgBeamWave13) package { import mx.core.*; public class Resources_imgBeamWave13 extends BitmapAsset { } }//packageSection 40//Resources_imgBeamWave21 (Resources_imgBeamWave21) package { import mx.core.*; public class Resources_imgBeamWave21 extends BitmapAsset { } }//packageSection 41//Resources_imgBeamWave22 (Resources_imgBeamWave22) package { import mx.core.*; public class Resources_imgBeamWave22 extends BitmapAsset { } }//packageSection 42//Resources_imgBeamWave23 (Resources_imgBeamWave23) package { import mx.core.*; public class Resources_imgBeamWave23 extends BitmapAsset { } }//packageSection 43//Resources_imgBox1 (Resources_imgBox1) package { import mx.core.*; public class Resources_imgBox1 extends BitmapAsset { } }//packageSection 44//Resources_imgBox2 (Resources_imgBox2) package { import mx.core.*; public class Resources_imgBox2 extends BitmapAsset { } }//packageSection 45//Resources_imgBox3 (Resources_imgBox3) package { import mx.core.*; public class Resources_imgBox3 extends BitmapAsset { } }//packageSection 46//Resources_imgBox4 (Resources_imgBox4) package { import mx.core.*; public class Resources_imgBox4 extends BitmapAsset { } }//packageSection 47//Resources_imgBoxPlate (Resources_imgBoxPlate) package { import mx.core.*; public class Resources_imgBoxPlate extends BitmapAsset { } }//packageSection 48//Resources_imgBoxSelect (Resources_imgBoxSelect) package { import mx.core.*; public class Resources_imgBoxSelect extends BitmapAsset { } }//packageSection 49//Resources_imgCiferblat1 (Resources_imgCiferblat1) package { import mx.core.*; public class Resources_imgCiferblat1 extends BitmapAsset { } }//packageSection 50//Resources_imgCiferblat2 (Resources_imgCiferblat2) package { import mx.core.*; public class Resources_imgCiferblat2 extends BitmapAsset { } }//packageSection 51//Resources_imgDustunited (Resources_imgDustunited) package { import mx.core.*; public class Resources_imgDustunited extends BitmapAsset { } }//packageSection 52//Resources_imgInfoBorder (Resources_imgInfoBorder) package { import mx.core.*; public class Resources_imgInfoBorder extends BitmapAsset { } }//packageSection 53//Resources_imgInfoOk (Resources_imgInfoOk) package { import mx.core.*; public class Resources_imgInfoOk extends BitmapAsset { } }//packageSection 54//Resources_imgInfoSkip (Resources_imgInfoSkip) package { import mx.core.*; public class Resources_imgInfoSkip extends BitmapAsset { } }//packageSection 55//Resources_imgInfoWall (Resources_imgInfoWall) package { import mx.core.*; public class Resources_imgInfoWall extends BitmapAsset { } }//packageSection 56//Resources_imgLaser1 (Resources_imgLaser1) package { import mx.core.*; public class Resources_imgLaser1 extends BitmapAsset { } }//packageSection 57//Resources_imgLaser2 (Resources_imgLaser2) package { import mx.core.*; public class Resources_imgLaser2 extends BitmapAsset { } }//packageSection 58//Resources_imgLaser3 (Resources_imgLaser3) package { import mx.core.*; public class Resources_imgLaser3 extends BitmapAsset { } }//packageSection 59//Resources_imgLaser4 (Resources_imgLaser4) package { import mx.core.*; public class Resources_imgLaser4 extends BitmapAsset { } }//packageSection 60//Resources_imgLaserPlateH (Resources_imgLaserPlateH) package { import mx.core.*; public class Resources_imgLaserPlateH extends BitmapAsset { } }//packageSection 61//Resources_imgLaserPlateV (Resources_imgLaserPlateV) package { import mx.core.*; public class Resources_imgLaserPlateV extends BitmapAsset { } }//packageSection 62//Resources_imgLaserSelectH (Resources_imgLaserSelectH) package { import mx.core.*; public class Resources_imgLaserSelectH extends BitmapAsset { } }//packageSection 63//Resources_imgLaserSelectV (Resources_imgLaserSelectV) package { import mx.core.*; public class Resources_imgLaserSelectV extends BitmapAsset { } }//packageSection 64//Resources_imgLogo (Resources_imgLogo) package { import mx.core.*; public class Resources_imgLogo extends BitmapAsset { } }//packageSection 65//Resources_imgMenuBack (Resources_imgMenuBack) package { import mx.core.*; public class Resources_imgMenuBack extends BitmapAsset { } }//packageSection 66//Resources_imgMenuDark (Resources_imgMenuDark) package { import mx.core.*; public class Resources_imgMenuDark extends BitmapAsset { } }//packageSection 67//Resources_imgMenuFront (Resources_imgMenuFront) package { import mx.core.*; public class Resources_imgMenuFront extends BitmapAsset { } }//packageSection 68//Resources_imgMenuLeft (Resources_imgMenuLeft) package { import mx.core.*; public class Resources_imgMenuLeft extends BitmapAsset { } }//packageSection 69//Resources_imgMenuRight (Resources_imgMenuRight) package { import mx.core.*; public class Resources_imgMenuRight extends BitmapAsset { } }//packageSection 70//Resources_imgMenuSelect (Resources_imgMenuSelect) package { import mx.core.*; public class Resources_imgMenuSelect extends BitmapAsset { } }//packageSection 71//Resources_imgMenuTop (Resources_imgMenuTop) package { import mx.core.*; public class Resources_imgMenuTop extends BitmapAsset { } }//packageSection 72//Resources_imgMirrorBad1 (Resources_imgMirrorBad1) package { import mx.core.*; public class Resources_imgMirrorBad1 extends BitmapAsset { } }//packageSection 73//Resources_imgMirrorBad2 (Resources_imgMirrorBad2) package { import mx.core.*; public class Resources_imgMirrorBad2 extends BitmapAsset { } }//packageSection 74//Resources_imgMirrorGood1 (Resources_imgMirrorGood1) package { import mx.core.*; public class Resources_imgMirrorGood1 extends BitmapAsset { } }//packageSection 75//Resources_imgMirrorGood2 (Resources_imgMirrorGood2) package { import mx.core.*; public class Resources_imgMirrorGood2 extends BitmapAsset { } }//packageSection 76//Resources_imgMirrorUnknw1 (Resources_imgMirrorUnknw1) package { import mx.core.*; public class Resources_imgMirrorUnknw1 extends BitmapAsset { } }//packageSection 77//Resources_imgMirrorUnknw2 (Resources_imgMirrorUnknw2) package { import mx.core.*; public class Resources_imgMirrorUnknw2 extends BitmapAsset { } }//packageSection 78//Resources_imgMirrorWrong1 (Resources_imgMirrorWrong1) package { import mx.core.*; public class Resources_imgMirrorWrong1 extends BitmapAsset { } }//packageSection 79//Resources_imgMirrorWrong2 (Resources_imgMirrorWrong2) package { import mx.core.*; public class Resources_imgMirrorWrong2 extends BitmapAsset { } }//packageSection 80//Resources_imgNumbers (Resources_imgNumbers) package { import mx.core.*; public class Resources_imgNumbers extends BitmapAsset { } }//packageSection 81//Resources_imgRules1 (Resources_imgRules1) package { import mx.core.*; public class Resources_imgRules1 extends BitmapAsset { } }//packageSection 82//Resources_imgRules2 (Resources_imgRules2) package { import mx.core.*; public class Resources_imgRules2 extends BitmapAsset { } }//packageSection 83//Resources_imgRules3 (Resources_imgRules3) package { import mx.core.*; public class Resources_imgRules3 extends BitmapAsset { } }//packageSection 84//Resources_imgRules4 (Resources_imgRules4) package { import mx.core.*; public class Resources_imgRules4 extends BitmapAsset { } }//packageSection 85//Resources_imgRules5 (Resources_imgRules5) package { import mx.core.*; public class Resources_imgRules5 extends BitmapAsset { } }//packageSection 86//Resources_imgRules6 (Resources_imgRules6) package { import mx.core.*; public class Resources_imgRules6 extends BitmapAsset { } }//packageSection 87//Resources_imgRules7 (Resources_imgRules7) package { import mx.core.*; public class Resources_imgRules7 extends BitmapAsset { } }//packageSection 88//Resources_imgSelPanButtonOff (Resources_imgSelPanButtonOff) package { import mx.core.*; public class Resources_imgSelPanButtonOff extends BitmapAsset { } }//packageSection 89//Resources_imgSelPanButtonOn (Resources_imgSelPanButtonOn) package { import mx.core.*; public class Resources_imgSelPanButtonOn extends BitmapAsset { } }//packageSection 90//Resources_imgSelPanPipeL (Resources_imgSelPanPipeL) package { import mx.core.*; public class Resources_imgSelPanPipeL extends BitmapAsset { } }//packageSection 91//Resources_imgSelPanPipeR (Resources_imgSelPanPipeR) package { import mx.core.*; public class Resources_imgSelPanPipeR extends BitmapAsset { } }//packageSection 92//Resources_imgShBottom1 (Resources_imgShBottom1) package { import mx.core.*; public class Resources_imgShBottom1 extends BitmapAsset { } }//packageSection 93//Resources_imgShBottom2 (Resources_imgShBottom2) package { import mx.core.*; public class Resources_imgShBottom2 extends BitmapAsset { } }//packageSection 94//Resources_imgShBottom3 (Resources_imgShBottom3) package { import mx.core.*; public class Resources_imgShBottom3 extends BitmapAsset { } }//packageSection 95//Resources_imgShBottom4 (Resources_imgShBottom4) package { import mx.core.*; public class Resources_imgShBottom4 extends BitmapAsset { } }//packageSection 96//Resources_imgShBottom5 (Resources_imgShBottom5) package { import mx.core.*; public class Resources_imgShBottom5 extends BitmapAsset { } }//packageSection 97//Resources_imgShCiferblat1 (Resources_imgShCiferblat1) package { import mx.core.*; public class Resources_imgShCiferblat1 extends BitmapAsset { } }//packageSection 98//Resources_imgShCiferblat2 (Resources_imgShCiferblat2) package { import mx.core.*; public class Resources_imgShCiferblat2 extends BitmapAsset { } }//packageSection 99//Resources_imgShWall1 (Resources_imgShWall1) package { import mx.core.*; public class Resources_imgShWall1 extends BitmapAsset { } }//packageSection 100//Resources_imgShWall2 (Resources_imgShWall2) package { import mx.core.*; public class Resources_imgShWall2 extends BitmapAsset { } }//packageSection 101//Resources_imgShWall3 (Resources_imgShWall3) package { import mx.core.*; public class Resources_imgShWall3 extends BitmapAsset { } }//packageSection 102//Resources_imgSmButtonBaseOff (Resources_imgSmButtonBaseOff) package { import mx.core.*; public class Resources_imgSmButtonBaseOff extends BitmapAsset { } }//packageSection 103//Resources_imgSmButtonBaseOn (Resources_imgSmButtonBaseOn) package { import mx.core.*; public class Resources_imgSmButtonBaseOn extends BitmapAsset { } }//packageSection 104//Resources_imgSmButtonBaseSel (Resources_imgSmButtonBaseSel) package { import mx.core.*; public class Resources_imgSmButtonBaseSel extends BitmapAsset { } }//packageSection 105//Resources_imgSmButtonRestart (Resources_imgSmButtonRestart) package { import mx.core.*; public class Resources_imgSmButtonRestart extends BitmapAsset { } }//packageSection 106//Resources_imgSmButtonSndOff (Resources_imgSmButtonSndOff) package { import mx.core.*; public class Resources_imgSmButtonSndOff extends BitmapAsset { } }//packageSection 107//Resources_imgSmButtonSndOn (Resources_imgSmButtonSndOn) package { import mx.core.*; public class Resources_imgSmButtonSndOn extends BitmapAsset { } }//packageSection 108//Resources_imgStar (Resources_imgStar) package { import mx.core.*; public class Resources_imgStar extends BitmapAsset { } }//packageSection 109//Resources_imgWall1 (Resources_imgWall1) package { import mx.core.*; public class Resources_imgWall1 extends BitmapAsset { } }//packageSection 110//Resources_imgWall2 (Resources_imgWall2) package { import mx.core.*; public class Resources_imgWall2 extends BitmapAsset { } }//packageSection 111//Resources_imgWall3 (Resources_imgWall3) package { import mx.core.*; public class Resources_imgWall3 extends BitmapAsset { } }//packageSection 112//Resources_sndAmbient1 (Resources_sndAmbient1) package { import mx.core.*; public class Resources_sndAmbient1 extends SoundAsset { } }//packageSection 113//Resources_sndAmbient2 (Resources_sndAmbient2) package { import mx.core.*; public class Resources_sndAmbient2 extends SoundAsset { } }//packageSection 114//Resources_sndClick1 (Resources_sndClick1) package { import mx.core.*; public class Resources_sndClick1 extends SoundAsset { } }//packageSection 115//Resources_sndClick2 (Resources_sndClick2) package { import mx.core.*; public class Resources_sndClick2 extends SoundAsset { } }//packageSection 116//Resources_sndLaserContinues (Resources_sndLaserContinues) package { import mx.core.*; public class Resources_sndLaserContinues extends SoundAsset { } }//packageSection 117//Resources_sndLaserEnd (Resources_sndLaserEnd) package { import mx.core.*; public class Resources_sndLaserEnd extends SoundAsset { } }//packageSection 118//Resources_sndLaserStart (Resources_sndLaserStart) package { import mx.core.*; public class Resources_sndLaserStart extends SoundAsset { } }//packageSection 119//Resources_sndSlidingStone (Resources_sndSlidingStone) package { import mx.core.*; public class Resources_sndSlidingStone extends SoundAsset { } }//packageSection 120//Resources_swfFont1 (Resources_swfFont1) package { import mx.core.*; public class Resources_swfFont1 extends FontAsset { } }//packageSection 121//Resources_swfFont2 (Resources_swfFont2) package { import mx.core.*; public class Resources_swfFont2 extends FontAsset { } }//packageSection 122//Resources_swfSplash (Resources_swfSplash) package { import mx.core.*; public class Resources_swfSplash extends MovieClipAsset { } }//packageSection 123//SelectPanel (SelectPanel) package { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.text.*; public class SelectPanel extends Sprite { public var buttons:Array; public var stageHeight:Number; public var ID:int; public var laserButton:LaserButton;// = null public var pipeL:Bitmap; public var app:LaserBox; public var pipeR:Bitmap; public var stageWidth:Number; public var boxButton:Array; public function SelectPanel(_arg1:int){ stageWidth = Preloader.stageWidth; stageHeight = Preloader.stageHeight; app = LaserBox.gameApp; buttons = new Array(); boxButton = new Array(0); super(); ID = _arg1; switch (_arg1){ case 0: buttons.push(CreateText("Diagonal /")); buttons[(buttons.length - 1)].addEventListener(MouseEvent.CLICK, onDiag1); buttons.push(CreateText("Diagonal \\")); buttons[(buttons.length - 1)].addEventListener(MouseEvent.CLICK, onDiag2); buttons.push(CreateText("Clear")); buttons[(buttons.length - 1)].addEventListener(MouseEvent.CLICK, onClear); buttons.push(CreateText("Break it!")); buttons[(buttons.length - 1)].addEventListener(MouseEvent.CLICK, onBrake); break; case 1: buttons.push(CreateText("Laser")); buttons[(buttons.length - 1)].addEventListener(MouseEvent.CLICK, onLaser); buttons.push(CreateText("Impulse")); buttons[(buttons.length - 1)].addEventListener(MouseEvent.CLICK, onImpulse); break; case 2: buttons.push(CreateText("8 x 8")); buttons[(buttons.length - 1)].addEventListener(MouseEvent.CLICK, on8x8); buttons.push(CreateText("12 x 12")); buttons[(buttons.length - 1)].addEventListener(MouseEvent.CLICK, on12x12); buttons.push(CreateText("16 x 16")); buttons[(buttons.length - 1)].addEventListener(MouseEvent.CLICK, on16x16); break; }; buttons.push(CreateText("Cancel")); buttons[(buttons.length - 1)].addEventListener(MouseEvent.CLICK, onCancel); var _local2:int = (buttons.length - 1); while (_local2 >= 0) { buttons[_local2].x = -1; buttons[_local2].y = (15 * _local2); addChild(buttons[_local2]); _local2--; }; pipeL = new Resources.imgSelPanPipeL(); pipeR = new Resources.imgSelPanPipeR(); pipeL.x = -14; pipeL.y = ((buttons.length * 15) + 17); pipeR.x = 108; pipeR.y = ((buttons.length * 15) - 14); } private function onCancel(_arg1:MouseEvent):void{ Hide(); app.sndControl.Play(0, 1); } private function onDiag1(_arg1:MouseEvent):void{ var _local2:int; while (_local2 < boxButton.length) { boxButton[_local2].SetMirror(1); _local2++; }; app.sndControl.Play(0, 1); Hide(); } private function onBrake(_arg1:MouseEvent):void{ var _local2:int; while (_local2 < boxButton.length) { boxButton[_local2].SetMirror(-1); _local2++; }; Hide(); app.sndControl.Play(0, 1); } private function onDiag2(_arg1:MouseEvent):void{ var _local2:int; while (_local2 < boxButton.length) { boxButton[_local2].SetMirror(2); _local2++; }; app.sndControl.Play(0, 1); Hide(); } private function onImpulse(_arg1:MouseEvent):void{ laserButton.Fire(false); Hide(); app.sndControl.Play(0, 1); } private function on12x12(_arg1:MouseEvent):void{ app.field.CreateGameField(12, 12); app.field.menu.currEvent = app.field.menu.eTextDown; Hide(); app.sndControl.Play(0, 1); } private function on16x16(_arg1:MouseEvent):void{ app.field.CreateGameField(16, 16); app.field.menu.currEvent = app.field.menu.eTextDown; Hide(); app.sndControl.Play(0, 1); } public function Hide():void{ var _local1:int; if (boxButton.length > 0){ _local1 = 0; while (_local1 < boxButton.length) { boxButton[_local1].UnlockSelect(); _local1++; }; boxButton.length = 0; }; if (laserButton != null){ laserButton.UnlockSelect(); laserButton = null; }; if (parent != null){ parent.removeChild(this); }; } private function CreateText(_arg1:String):SimpleButton{ var _local2:TextFormat = new TextFormat(); var _local3:Font = new Resources.swfFont2(); _local2.font = _local3.fontName; _local2.size = 18; _local2.letterSpacing = 1; var _local4:TextField = new TextField(); _local4.text = _arg1; _local4.setTextFormat(_local2); _local4.embedFonts = true; _local4.autoSize = TextFieldAutoSize.LEFT; _local4.textColor = 0; var _local5:Bitmap = new Bitmap(new BitmapData(_local4.width, (_local4.height + (_local4.width / 4)), true, 0xFFFFFF)); _local5.smoothing = true; _local5.bitmapData.draw(_local4, new Matrix(1, -0.24, 0, 1, 0, (_local4.width / 4))); var _local6:Bitmap = new Bitmap(new BitmapData((_local5.width + 1), (_local5.height + 1), true, 0xFFFFFF)); _local6.bitmapData.copyPixels(_local5.bitmapData, new Rectangle(0, 0, _local5.width, _local5.height), new Point(0, 0), null, null, true); _local6.bitmapData.colorTransform(new Rectangle(0, 0, _local6.width, _local6.height), new ColorTransform(0, 0, 0, 1, 0xFF, 0xFF, 0xFF)); _local6.bitmapData.copyPixels(_local5.bitmapData, new Rectangle(0, 0, _local5.width, _local5.height), new Point(1, 1), null, null, true); var _local7:Bitmap = new Resources.imgSelPanButtonOff(); _local7.bitmapData.copyPixels(_local6.bitmapData, new Rectangle(0, 0, _local6.width, _local6.height), new Point(18, ((_local7.height - _local6.height) - 2)), null, null, true); var _local8:Bitmap = new Resources.imgSelPanButtonOn(); _local8.bitmapData.copyPixels(_local6.bitmapData, new Rectangle(0, 0, _local6.width, _local6.height), new Point(18, ((_local8.height - _local6.height) - 2)), null, null, true); var _local9:Sprite = new Sprite(); _local9.graphics.beginFill(0, 1); _local9.graphics.moveTo(2, 29); _local9.graphics.lineTo(107, 2); _local9.graphics.lineTo(107, 15); _local9.graphics.lineTo(2, 42); _local9.graphics.lineTo(2, 29); _local9.graphics.endFill(); return (new SimpleButton(_local7, _local8, _local8, _local9)); } public function Show(_arg1:int, _arg2:int):void{ var _local3:int; while (_local3 < app.field.selectPanel.length) { app.field.selectPanel[_local3].Hide(); _local3++; }; if (pipeL.parent != null){ removeChild(pipeL); }; if (pipeR.parent != null){ removeChild(pipeR); }; if (_arg1 < 130){ addChild(pipeL); x = (_arg1 + 14); y = (_arg2 - 93); } else { addChild(pipeR); x = (_arg1 - 117); y = (_arg2 - 60); }; if (boxButton.length > 0){ _local3 = 0; while (_local3 < boxButton.length) { boxButton[_local3].UnlockSelect(); _local3++; }; boxButton.length = 0; }; if (laserButton != null){ laserButton.UnlockSelect(); laserButton = null; }; app.layers[5].addChild(this); } private function onClear(_arg1:MouseEvent):void{ var _local2:int; while (_local2 < boxButton.length) { boxButton[_local2].SetMirror(0); _local2++; }; Hide(); app.sndControl.Play(0, 1); } private function on8x8(_arg1:MouseEvent):void{ app.field.CreateGameField(8, 8); app.field.menu.currEvent = app.field.menu.eTextDown; Hide(); app.sndControl.Play(0, 1); } private function onLaser(_arg1:MouseEvent):void{ laserButton.Fire(true); Hide(); app.sndControl.Play(0, 1); } } }//packageSection 124//SoundControl (SoundControl) package { import flash.events.*; import flash.display.*; import flash.media.*; public class SoundControl extends Sprite { private var sndTransform:Array; private var sndNum:int;// = 0 private var channel:Array; private var sound:Array; private var globalSwitch:Boolean;// = true private var loopPlay:Array; private var sndSwitch:Array; public function SoundControl(){ sound = new Array(sndNum); channel = new Array(sndNum); sndTransform = new Array(sndNum); sndSwitch = new Array(sndNum); loopPlay = new Array(sndNum); super(); sound.push(new Resources.sndClick1()); sound.push(new Resources.sndClick2()); sound.push(new Resources.sndLaserContinues()); sound.push(new Resources.sndLaserEnd()); sound.push(new Resources.sndLaserStart()); sound.push(new Resources.sndSlidingStone()); sound.push(new Resources.sndAmbient1()); sound.push(new Resources.sndAmbient2()); sndNum = sound.length; var _local1:int; while (_local1 < sndNum) { channel[_local1] = new SoundChannel(); sndTransform[_local1] = new SoundTransform(); sndSwitch[_local1] = true; loopPlay[_local1] = false; _local1++; }; channel[1].soundTransform = new SoundTransform(); addEventListener(Event.ENTER_FRAME, onEnterFrame); } public function Stop(_arg1:int):void{ sndSwitch[_arg1] = false; if (!loopPlay[_arg1]){ sndTransform[_arg1].volume = 0; channel[_arg1].soundTransform = sndTransform[_arg1]; channel[_arg1].stop(); }; } public function Play(_arg1:int, _arg2:int, _arg3:Boolean=false):void{ sndSwitch[_arg1] = true; if (!loopPlay[_arg1]){ loopPlay[_arg1] = _arg3; if (((!(globalSwitch)) || (_arg3))){ sndTransform[_arg1].volume = 0; } else { sndTransform[_arg1].volume = 1; }; channel[_arg1] = sound[_arg1].play(0, _arg2, sndTransform[_arg1]); }; } private function onEnterFrame(_arg1:Event):void{ var _local2:int; while (_local2 < sndNum) { if (((((!(globalSwitch)) || (!(sndSwitch[_local2])))) && ((sndTransform[_local2].volume > 0)))){ sndTransform[_local2].volume = (sndTransform[_local2].volume - 0.05); channel[_local2].soundTransform = sndTransform[_local2]; if (sndTransform[_local2].volume <= 0.07){ sndTransform[_local2].volume = 0; channel[_local2].soundTransform = sndTransform[_local2]; if (((loopPlay[_local2]) && (!(sndSwitch[_local2])))){ loopPlay[_local2] = false; channel[_local2].stop(); }; }; } else { if (((((globalSwitch) && (sndSwitch[_local2]))) && ((sndTransform[_local2].volume < 1)))){ if ((((((_local2 == 6)) || ((_local2 == 7)))) && ((sndTransform[_local2].volume >= 0.4)))){ } else { sndTransform[_local2].volume = (sndTransform[_local2].volume + 0.05); if (_local2 == 6){ sndTransform[_local2].volume = (sndTransform[_local2].volume - 0.04); }; channel[_local2].soundTransform = sndTransform[_local2]; if (sndTransform[_local2].volume >= 0.93){ sndTransform[_local2].volume = 1; channel[_local2].soundTransform = sndTransform[_local2]; }; }; }; }; _local2++; }; } public function TouchSound():void{ globalSwitch = !(globalSwitch); if (globalSwitch){ sndTransform[0].volume = 1; channel[0].soundTransform = sndTransform[0]; }; } } }//packageSection 125//Utils (Utils) package { import flash.display.*; public class Utils { private static var acosinus:Array = new Array(360); private static var cosinus:Array = new Array(360); public static var invPI:Number = 57.2957795130823; private static var asinus:Array = new Array(360); private static var sinus:Array = new Array(360); public static var PI:Number = 3.14159265358979; public static function CreateSinCosTable():void{ var _local1:int; while (_local1 < 360) { sinus[_local1] = Math.sin((_local1 / invPI)); cosinus[_local1] = Math.cos((_local1 / invPI)); asinus[_local1] = Math.asin(((_local1 / 180) - 1)); acosinus[_local1] = Math.acos(((_local1 / 180) - 1)); _local1++; }; } public static function UintToArgb(_arg1:uint):Array{ var _local2:Array = new Array(); _local2.push(((_arg1 >> 24) & 0xFF)); _local2.push(((_arg1 >> 16) & 0xFF)); _local2.push(((_arg1 >> 8) & 0xFF)); _local2.push((_arg1 & 0xFF)); return (_local2); } public static function BitmapToPixelBitmap(_arg1:Bitmap, _arg2:int):void{ var _local4:Number; var _local5:uint; var _local6:Array; var _local3:Number = 0; while (_local3 < _arg1.bitmapData.width) { _local4 = 0; while (_local4 < _arg1.bitmapData.height) { _local5 = _arg1.bitmapData.getPixel32(_local3, _local4); _local6 = UintToArgb(_local5); if ((((_local6[0] > 0)) && ((_local6[0] < 0xFF)))){ _local6[0] = ((_local6[0])<_arg2) ? 0 : 0xFF; _local5 = ArgbToUint(_local6); _arg1.bitmapData.setPixel32(_local3, _local4, _local5); }; _local4++; }; _local3++; }; } public static function GetASin(_arg1:Number):Number{ var _local2:int = Math.floor(((_arg1 + 1) * 180)); if (isNaN(asinus[_local2])){ CreateSinCosTable(); }; return (asinus[_local2]); } public static function ArgbToUint(_arg1:Array):uint{ var _local2:uint; _local2 = (_local2 + (_arg1[0] << 24)); _local2 = (_local2 + (_arg1[1] << 16)); _local2 = (_local2 + (_arg1[2] << 8)); _local2 = (_local2 + _arg1[3]); return (_local2); } public static function GetCos(_arg1:int):Number{ if (_arg1 < 0){ _arg1 = (360 - (-(_arg1) % 360)); } else { _arg1 = (_arg1 % 360); }; if (isNaN(cosinus[_arg1])){ CreateSinCosTable(); }; return (cosinus[_arg1]); } public static function GetSin(_arg1:int):Number{ if (_arg1 < 0){ _arg1 = (360 - (-(_arg1) % 360)); } else { _arg1 = (_arg1 % 360); }; if (isNaN(sinus[_arg1])){ CreateSinCosTable(); }; return (sinus[_arg1]); } public static function GetACos(_arg1:Number):Number{ var _local2:int = Math.floor(((_arg1 + 1) * 180)); if (isNaN(acosinus[_local2])){ CreateSinCosTable(); }; return (acosinus[_local2]); } } }//package
Library Items
Symbol 1 Bitmap {Resources_imgRules5} [Rules5] | ||
Symbol 2 Bitmap {Resources_imgRules7} [Rules7] | ||
Symbol 3 Sound {Resources_sndLaserContinues} [LaserContinues] | ||
Symbol 4 Bitmap {Resources_imgRules6} [Rules6] | ||
Symbol 5 Bitmap {Resources_imgRules3} [Rules3] | ||
Symbol 6 Sound {Resources_sndLaserEnd} [LaserEnd] | ||
Symbol 7 Sound {Resources_sndAmbient2} [Ambient2] | ||
Symbol 8 Bitmap | Used by:9 | |
Symbol 9 Graphic | Uses:8 | Used by:13 |
Symbol 10 Font | Used by:11 | |
Symbol 11 Text | Uses:10 | Used by:13 |
Symbol 12 Sound | Used by:13 | |
Symbol 13 MovieClip {Resources_swfSplash} [Splash] | Uses:9 11 12 | |
Symbol 14 Font {Resources_swfFont1} [MyImpact] | ||
Symbol 15 Bitmap {Resources_imgRules1} [Rules1] | ||
Symbol 16 Bitmap {Resources_imgRules2} [Rules2] | ||
Symbol 17 Font {Resources_swfFont2} [MyKartika] | ||
Symbol 18 Bitmap {Resources_imgBackground2} [Background2] | ||
Symbol 19 Sound {Resources_sndClick1} [Click1] | ||
Symbol 20 Bitmap {Resources_imgBackground1} [Background1] | ||
Symbol 21 Sound {Resources_sndLaserStart} [LaserStart] | ||
Symbol 22 Sound {Resources_sndSlidingStone} [SlidingStone] | ||
Symbol 23 Sound {Resources_sndAmbient1} [Ambient1] | ||
Symbol 24 Sound {Resources_sndClick2} [Click2] | ||
Symbol 25 Bitmap {Resources_imgRules4} [Rules4] | ||
Symbol 26 Bitmap {Resources_imgShBottom5} | ||
Symbol 27 Bitmap {Resources_imgMenuDark} | ||
Symbol 28 Bitmap {Resources_imgShWall3} | ||
Symbol 29 Bitmap {Resources_imgBeamWave13} | ||
Symbol 30 Bitmap {Resources_imgLaserSelectV} | ||
Symbol 31 Bitmap {Resources_imgShBottom2} | ||
Symbol 32 Bitmap {Resources_imgLaser4} | ||
Symbol 33 Bitmap {Resources_imgShBottom3} | ||
Symbol 34 Bitmap {Resources_imgMirrorBad2} | ||
Symbol 35 Bitmap {Resources_imgCiferblat1} | ||
Symbol 36 Bitmap {Resources_imgSelPanButtonOn} | ||
Symbol 37 Bitmap {Resources_imgMirrorUnknw1} | ||
Symbol 38 Bitmap {Resources_imgShBottom4} | ||
Symbol 39 Bitmap {Resources_imgShCiferblat2} | ||
Symbol 40 Bitmap {Resources_imgSelPanPipeL} | ||
Symbol 41 Bitmap {Resources_imgShWall2} | ||
Symbol 42 Bitmap {Resources_imgLaser3} | ||
Symbol 43 Bitmap {Resources_imgSmButtonBaseOff} | ||
Symbol 44 Bitmap {Resources_imgShBottom1} | ||
Symbol 45 Bitmap {Resources_imgMenuTop} | ||
Symbol 46 Bitmap {Resources_imgInfoWall} | ||
Symbol 47 Bitmap {Resources_imgMirrorBad1} | ||
Symbol 48 Bitmap {Resources_imgSmButtonBaseSel} | ||
Symbol 49 Bitmap {Resources_imgBoxSelect} | ||
Symbol 50 Bitmap {Resources_imgLogo} | ||
Symbol 51 Bitmap {Resources_imgMirrorGood1} | ||
Symbol 52 Bitmap {Resources_imgStar} | ||
Symbol 53 Bitmap {Resources_imgMenuBack} | ||
Symbol 54 Bitmap {Resources_imgShWall1} | ||
Symbol 55 Bitmap {Resources_imgCiferblat2} | ||
Symbol 56 Bitmap {Resources_imgWall3} | ||
Symbol 57 Bitmap {Resources_imgInfoOk} | ||
Symbol 58 Bitmap {Resources_imgBeamWave23} | ||
Symbol 59 Bitmap {Resources_imgBox1} | ||
Symbol 60 Bitmap {Resources_imgDustunited} | ||
Symbol 61 Bitmap {Resources_imgBeamWave12} | ||
Symbol 62 Bitmap {Resources_imgMirrorUnknw2} | ||
Symbol 63 Bitmap {Resources_imgSmButtonSndOff} | ||
Symbol 64 Bitmap {Resources_imgLaserPlateH} | ||
Symbol 65 Bitmap {Resources_imgBeam2} | ||
Symbol 66 Bitmap {Resources_imgBox3} | ||
Symbol 67 Bitmap {Resources_imgLaserPlateV} | ||
Symbol 68 Bitmap {Resources_imgWall1} | ||
Symbol 69 Bitmap {Resources_imgMenuSelect} | ||
Symbol 70 Bitmap {Resources_imgBox4} | ||
Symbol 71 Bitmap {Resources_imgMirrorWrong1} | ||
Symbol 72 Bitmap {Resources_imgMenuRight} | ||
Symbol 73 Bitmap {Resources_imgSelPanButtonOff} | ||
Symbol 74 Bitmap {Resources_imgShCiferblat1} | ||
Symbol 75 Bitmap {Resources_imgWall2} | ||
Symbol 76 Bitmap {Resources_imgBeamWave11} | ||
Symbol 77 Bitmap {Resources_imgBeamWave22} | ||
Symbol 78 Bitmap {Resources_imgMenuFront} | ||
Symbol 79 Bitmap {Resources_imgLaserSelectH} | ||
Symbol 80 Bitmap {Resources_imgAddSite} | ||
Symbol 81 Bitmap {Resources_imgLaser1} | ||
Symbol 82 Bitmap {Resources_imgInfoBorder} | ||
Symbol 83 Bitmap {Resources_imgMirrorWrong2} | ||
Symbol 84 Bitmap {Resources_imgBeamWave21} | ||
Symbol 85 Bitmap {Resources_imgMenuLeft} | ||
Symbol 86 Bitmap {Resources_imgInfoSkip} | ||
Symbol 87 Bitmap {Resources_imgSelPanPipeR} | ||
Symbol 88 Bitmap {Resources_imgSmButtonBaseOn} | ||
Symbol 89 Bitmap {Resources_imgBoxPlate} | ||
Symbol 90 Bitmap {Resources_imgBeam1} | ||
Symbol 91 Bitmap {Resources_imgSmButtonRestart} | ||
Symbol 92 Bitmap {Resources_imgBox2} | ||
Symbol 93 Bitmap {Resources_imgMirrorGood2} | ||
Symbol 94 Bitmap {Resources_imgNumbers} | ||
Symbol 95 Bitmap {Resources_imgSmButtonSndOn} | ||
Symbol 96 Bitmap {Resources_imgLaser2} |
Special Tags
FileAttributes (69) | Timeline Frame 1 | Access network only, Metadata present, AS3. |
SWFMetaData (77) | Timeline Frame 1 | 457 bytes "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'><rdf:Description rdf:about='' xmlns ..." |
ScriptLimits (65) | Timeline Frame 1 | MaxRecursionDepth: 1000, ScriptTimeout: 60 seconds |
ExportAssets (56) | Timeline Frame 2 | Symbol 1 as "Rules5" |
ExportAssets (56) | Timeline Frame 2 | Symbol 2 as "Rules7" |
ExportAssets (56) | Timeline Frame 2 | Symbol 3 as "LaserContinues" |
ExportAssets (56) | Timeline Frame 2 | Symbol 4 as "Rules6" |
ExportAssets (56) | Timeline Frame 2 | Symbol 5 as "Rules3" |
ExportAssets (56) | Timeline Frame 2 | Symbol 6 as "LaserEnd" |
ExportAssets (56) | Timeline Frame 2 | Symbol 7 as "Ambient2" |
ExportAssets (56) | Timeline Frame 2 | Symbol 13 as "Splash" |
ExportAssets (56) | Timeline Frame 2 | Symbol 14 as "MyImpact" |
ExportAssets (56) | Timeline Frame 2 | Symbol 15 as "Rules1" |
ExportAssets (56) | Timeline Frame 2 | Symbol 16 as "Rules2" |
ExportAssets (56) | Timeline Frame 2 | Symbol 17 as "MyKartika" |
ExportAssets (56) | Timeline Frame 2 | Symbol 18 as "Background2" |
ExportAssets (56) | Timeline Frame 2 | Symbol 19 as "Click1" |
ExportAssets (56) | Timeline Frame 2 | Symbol 20 as "Background1" |
ExportAssets (56) | Timeline Frame 2 | Symbol 21 as "LaserStart" |
ExportAssets (56) | Timeline Frame 2 | Symbol 22 as "SlidingStone" |
ExportAssets (56) | Timeline Frame 2 | Symbol 23 as "Ambient1" |
ExportAssets (56) | Timeline Frame 2 | Symbol 24 as "Click2" |
ExportAssets (56) | Timeline Frame 2 | Symbol 25 as "Rules4" |
SerialNumber (41) | Timeline Frame 1 |
Labels
"Preloader" | Frame 1 |
"LaserBox" | Frame 2 |
|