Section 1
//fade_black_18 (atomz2_fla.fade_black_18)
package atomz2_fla {
import flash.display.*;
import flash.text.*;
public dynamic class fade_black_18 extends MovieClip {
public var glow_button:SimpleButton;
public var trail_button:SimpleButton;
public var glow_text:TextField;
public var done_button:SimpleButton;
public var start_button:TextField;
public var trail_text:TextField;
}
}//package atomz2_fla
Section 2
//mute_button_15 (atomz2_fla.mute_button_15)
package atomz2_fla {
import flash.display.*;
public dynamic class mute_button_15 extends MovieClip {
public function mute_button_15(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package atomz2_fla
Section 3
//Neenja_Preloader_26 (atomz2_fla.Neenja_Preloader_26)
package atomz2_fla {
import flash.display.*;
public dynamic class Neenja_Preloader_26 extends MovieClip {
public function Neenja_Preloader_26(){
addFrameScript(178, frame179);
}
function frame179(){
stop();
MovieClip(parent).gotoAndStop(3);
}
}
}//package atomz2_fla
Section 4
//preloader_1 (atomz2_fla.preloader_1)
package atomz2_fla {
import flash.display.*;
public dynamic class preloader_1 extends MovieClip {
public var loader_mask:MovieClip;
}
}//package atomz2_fla
Section 5
//Blitter (cursesfoiled.graphics.Blitter)
package cursesfoiled.graphics {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import flash.filters.*;
public class Blitter {
private var shape:Shape;
public var c_pos2:Point;
private var ypos;
private var off_screen:BitmapData;
public var c_pos1:Point;
public var display:Bitmap;
private var blur_screen:Bitmap;
private var on_screen:BitmapData;
public var blend:String;
public var blur_size:int;
private var xpos;
var rotationMatrix:Matrix;
public var ct2:ColorTransform;
private var h:int;
public var ct:ColorTransform;
public var fade:ColorTransform;
private var w;
public function Blitter(_arg1:int, _arg2:int, _arg3:Boolean, _arg4:Object){
var _local5:BlurFilter;
var _local6:Array;
super();
on_screen = new BitmapData(_arg1, _arg2, _arg3, 0);
off_screen = new BitmapData(_arg1, _arg2, _arg3, 0);
display = new Bitmap(on_screen);
_arg4.addChild(display);
blend = null;
blur_size = 16;
ct = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
ct2 = new ColorTransform(1, 1, 1, 1, -16, -16, -16, 0xFF);
fade = new ColorTransform(0, 0, 0, 0.2, 0, 0, 0, 0);
shape = new Shape();
shape.graphics.beginFill(0, 1);
shape.graphics.drawRect(0, 0, _arg1, _arg2);
_local5 = new BlurFilter(blur_size, blur_size, 1);
_local6 = new Array();
_local6.push(_local5);
blur_screen = new Bitmap(on_screen);
blur_screen.filters = _local6;
blur_screen.blendMode = "add";
rotationMatrix = new Matrix();
}
public function render_fade(){
on_screen.copyPixels(off_screen, off_screen.rect, new Point(0, 0), null, null, false);
off_screen.draw(shape, null, fade);
}
public function drawText(_arg1:String, _arg2:Number, _arg3:Number, _arg4:uint, _arg5:String){
var _local6:TextField;
var _local7:TextFormat;
_local6 = new TextField();
_local7 = new TextFormat();
_local7.font = "Terminal";
_local7.size = 8;
_local7.align = _arg5;
_local6.wordWrap = false;
_local6.multiline = false;
_local6.text = _arg1;
_local6.textColor = _arg4;
_local6.setTextFormat(_local7);
_local6.width = (_arg1.length * Number(_local7.size));
rotationMatrix = null;
rotationMatrix = new Matrix();
rotationMatrix.translate(_arg2, _arg3);
off_screen.draw(_local6, rotationMatrix, ct, blend);
rotationMatrix = null;
_local6 = null;
_local7 = null;
}
public function drawImageScale(_arg1:Image, _arg2:Number, _arg3:Number, _arg4:int, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number){
var _local9:Rectangle;
_local9 = new Rectangle((_arg4 * _arg1.w), 0, _arg1.w, _arg1.h);
_arg1.temp_data.copyPixels(_arg1.img_data, _local9, new Point(0, 0), null, null, false);
rotationMatrix = null;
rotationMatrix = new Matrix();
rotationMatrix.translate(-(_arg5), -(_arg6));
rotationMatrix.scale(_arg7, _arg8);
rotationMatrix.translate(_arg2, _arg3);
off_screen.draw(_arg1.temp_data, rotationMatrix, ct, blend);
_local9 = null;
rotationMatrix = null;
}
public function render(){
on_screen.copyPixels(off_screen, off_screen.rect, new Point(0, 0), null, null, false);
off_screen.fillRect(off_screen.rect, 0);
}
public function render_bloom(){
on_screen.copyPixels(off_screen, off_screen.rect, new Point(0, 0), null, null, false);
on_screen.draw(blur_screen, null, ct2, "add");
off_screen.fillRect(off_screen.rect, 0);
}
public function drawImageAlpha(_arg1:Image, _arg2:Number, _arg3:Number, _arg4:int){
var _local5:Rectangle;
_local5 = new Rectangle((_arg4 * _arg1.w), 0, _arg1.w, _arg1.h);
off_screen.copyPixels(_arg1.img_data, _local5, new Point(_arg2, _arg3), _arg1.img_data, null, false);
_local5 = null;
}
public function drawPixel(_arg1:Number, _arg2:Number, _arg3:uint){
off_screen.setPixel32(_arg1, _arg2, _arg3);
}
public function drawImageRotate(_arg1:Image, _arg2:Number, _arg3:Number, _arg4:int, _arg5:Number, _arg6:Number, _arg7:Number){
var _local8:Rectangle;
var _local9:*;
_local8 = new Rectangle((_arg4 * _arg1.w), 0, _arg1.w, _arg1.h);
_arg1.temp_data.copyPixels(_arg1.img_data, _local8, new Point(0, 0), null, null, false);
_local9 = ((Math.PI * 2) * (_arg7 / 360));
rotationMatrix = null;
rotationMatrix = new Matrix();
rotationMatrix.translate(-(_arg5), -(_arg6));
rotationMatrix.rotate(_local9);
rotationMatrix.translate(_arg2, _arg3);
off_screen.draw(_arg1.temp_data, rotationMatrix, ct, blend);
_local8 = null;
rotationMatrix = null;
}
public function drawImageRotateScale(_arg1:Image, _arg2:Number, _arg3:Number, _arg4:int, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number){
var _local10:Rectangle;
var _local11:*;
_local10 = new Rectangle((_arg4 * _arg1.w), 0, _arg1.w, _arg1.h);
_arg1.temp_data.copyPixels(_arg1.img_data, _local10, new Point(0, 0), null, null, false);
_local11 = ((Math.PI * 2) * (_arg7 / 360));
rotationMatrix.translate(-(_arg5), -(_arg6));
rotationMatrix.rotate(_local11);
rotationMatrix.scale(_arg8, _arg9);
rotationMatrix.translate(_arg2, _arg3);
off_screen.draw(_arg1.temp_data, rotationMatrix, ct, blend);
_local10 = null;
rotationMatrix = null;
}
public function Lock(){
off_screen.lock();
}
public function drawImageScaleRotate(_arg1:Image, _arg2:Number, _arg3:Number, _arg4:int, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number){
var _local10:Rectangle;
var _local11:*;
_local10 = new Rectangle((_arg4 * _arg1.w), 0, _arg1.w, _arg1.h);
_arg1.temp_data.copyPixels(_arg1.img_data, _local10, new Point(0, 0), null, null, false);
_local11 = ((Math.PI * 2) * (_arg7 / 360));
rotationMatrix = null;
rotationMatrix = new Matrix();
rotationMatrix.translate(-(_arg5), -(_arg6));
rotationMatrix.scale(_arg8, _arg9);
rotationMatrix.rotate(_local11);
rotationMatrix.translate(_arg2, _arg3);
off_screen.draw(_arg1.temp_data, rotationMatrix, ct, blend);
_local10 = null;
rotationMatrix = null;
}
public function colour(_arg1:int, _arg2:int, _arg3:int, _arg4:int):uint{
return (((((_arg4 << 24) | (_arg1 << 16)) | (_arg2 << 8)) | _arg3));
}
public function scaleScreen(_arg1:int, _arg2:int){
display.width = _arg1;
display.height = _arg2;
}
public function render_fade_bloom(){
on_screen.copyPixels(off_screen, off_screen.rect, new Point(0, 0), null, null, false);
on_screen.draw(blur_screen, null, ct2, "add");
off_screen.draw(shape, null, fade);
}
public function drawFade(){
off_screen.draw(shape, null, ct);
}
public function Unlock(){
off_screen.unlock();
}
public function drawTiledImage(_arg1:Image, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number){
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Rectangle;
var _local13:Rectangle;
var _local14:Rectangle;
var _local15:Rectangle;
_local8 = (_arg6 % _arg1.w);
_local9 = (_arg7 % _arg1.h);
_local10 = (_arg1.w - _local8);
_local11 = (_arg1.h - _local9);
_local12 = new Rectangle(_local8, _local9, _local10, _local11);
_local13 = new Rectangle(0, _local9, (_arg1.w - _local10), _local11);
_local14 = new Rectangle(_local8, 0, _local10, (_arg1.h - _local11));
_local15 = new Rectangle(0, 0, (_arg1.w - _local10), (_arg1.h - _local11));
off_screen.copyPixels(_arg1.img_data, _local12, new Point(0, 0), null, null, false);
off_screen.copyPixels(_arg1.img_data, _local13, new Point(_local10, 0), null, null, false);
off_screen.copyPixels(_arg1.img_data, _local14, new Point(0, _local11), null, null, false);
off_screen.copyPixels(_arg1.img_data, _local15, new Point(_local10, _local11), null, null, false);
}
public function drawImage(_arg1:Image, _arg2:Number, _arg3:Number, _arg4:int){
var _local5:Rectangle;
var _local6:Point;
_local5 = new Rectangle((_arg4 * _arg1.w), 0, _arg1.w, _arg1.h);
_local6 = new Point(_arg2, _arg3);
off_screen.copyPixels(_arg1.img_data, _local5, _local6, null, null, false);
_local5 = null;
_local6 = null;
}
public function drawImageRect(_arg1:Image, _arg2:Number, _arg3:Number, _arg4:int){
var _local5:Rectangle;
var _local6:Point;
_local5 = new Rectangle(_arg4, 0, 1, 1);
_local6 = new Point(_arg2, _arg3);
off_screen.copyPixels(_arg1.img_data, _local5, _local6, null, null, false);
_local5 = null;
_local6 = null;
}
}
}//package cursesfoiled.graphics
Section 6
//Image (cursesfoiled.graphics.Image)
package cursesfoiled.graphics {
import flash.display.*;
public class Image {
public var img_data:BitmapData;
public var h:int;
public var col_data:BitmapData;
public var frames:int;
public var temp_data:BitmapData;
public var w:int;
public function Image(_arg1:Class, _arg2:int, _arg3:int){
w = _arg2;
h = _arg3;
img_data = new _arg1(_arg2, _arg3);
temp_data = new BitmapData(_arg2, _arg3);
col_data = new BitmapData(_arg2, _arg3);
}
public function hitTestComplex(_arg1:Image){
}
}
}//package cursesfoiled.graphics
Section 7
//MochiScores (mochi.MochiScores)
package mochi {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var options = _arg1;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (_arg1 != null){
if (_arg1.error != null){
if (_arg1.error == true){
if (onErrorHandler != null){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi
Section 8
//MochiServices (mochi.MochiServices)
package mochi {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _sendChannel:LocalConnection;
private static var _rcvChannelName:String;
private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _startTime:Number;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__mochiservices";
private static var _rcvChannel:LocalConnection;
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (_clip != null){
if (_clip._queue != null){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
public static function get id():String{
return (_id);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function getVersion():String{
return ("1.2");
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_listenChannel.close();
_rcvChannel.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
return (_local2);
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion()});
_rcvChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = this.client._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace("Unable to invoke callback method.");
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace("Unable to invoke callback method on object.");
};
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
_rcvChannel.connect(_rcvChannelName);
_connecting = false;
_connected = true;
_listenChannel.close();
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
_rcvChannelName = _arg1;
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var clipname:String;
var f:Function;
var req:URLRequest;
var id = _arg1;
var clip = _arg2;
clipname = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
MochiServices.allowDomains(_gatewayURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
_timer = new Timer(1000, 0);
_startTime = getTimer();
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
f = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
req = new URLRequest(_gatewayURL);
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain("*", "localhost");
_rcvChannel.allowInsecureDomain("*", "localhost");
_rcvChannel.client = _clip;
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
public static function bringToTop(_arg1:Event):void{
var e = _arg1;
if (MochiServices.clip != null){
if (MochiServices.childClip != null){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var _local5:MovieClip;
_local5 = new MovieClip();
if (_arg4){
if (((false) && (_arg3))){
_arg1.addChildAt(_local5, _arg3);
} else {
_arg1.addChild(_local5);
};
};
_arg1[_arg2] = _local5;
_local5["_name"] = _arg2;
return (_local5);
}
public static function connectWait(_arg1:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_timer.stop();
};
}
}
}//package mochi
Section 9
//atom1_sound (atom1_sound)
package {
import flash.media.*;
public dynamic class atom1_sound extends Sound {
}
}//package
Section 10
//atom2_gfx (atom2_gfx)
package {
import flash.display.*;
public dynamic class atom2_gfx extends BitmapData {
public function atom2_gfx(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 11
//atom2_sound (atom2_sound)
package {
import flash.media.*;
public dynamic class atom2_sound extends Sound {
}
}//package
Section 12
//atom3_sound (atom3_sound)
package {
import flash.media.*;
public dynamic class atom3_sound extends Sound {
}
}//package
Section 13
//atom4_sound (atom4_sound)
package {
import flash.media.*;
public dynamic class atom4_sound extends Sound {
}
}//package
Section 14
//atom5_sound (atom5_sound)
package {
import flash.media.*;
public dynamic class atom5_sound extends Sound {
}
}//package
Section 15
//atomz (atomz)
package {
import cursesfoiled.graphics.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import mochi.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.ui.*;
import flash.net.*;
import flash.system.*;
public dynamic class atomz extends MovieClip {
private var FPSTimer:Timer;
private var updateTimer:Timer;
public var mute_button:MovieClip;
private var needed_amount:int;// = 0
private var glow_switch:int;// = 1
private var trys:Array;
private var current_minutes:int;// = 0
private var atom4_snd:atom4_sound;
private var timeLastFrame:Number;
private var balls:Array;
public var i:int;
private var screen:Blitter;
public var FPSscreen:TextField;
public var preloader:MovieClip;
public var fade_black:MovieClip;
private var seconds:int;// = 0
public var level_list:TextField;
private var win_snd:win_sound;
public var time_counter:TextField;
private var score:int;// = 0
public var neenja_button:SimpleButton;
private var gamesound:SoundChannel;
public var text1:TextField;
public var text2:TextField;
public var text3:TextField;
public var try_list:TextField;
private var win_message:String;// = ""
private var atom3_snd:atom3_sound;
public var score_box:TextField;
public var text6:TextField;
private var fps_counter:Number;
public var click_to_begin:SimpleButton;
private var level_started:int;// = 0
private var FPS:String;// = ""
private var mouse_status:int;// = 0
public var time_list:TextField;
private var minutes:int;// = 0
private var fade:Number;// = 0
public var stage1:MovieClip;
public var curses2_button:SimpleButton;
public var memory:TextField;
public var level_text:TextField;
private var fade_out:int;// = 0
public var curses_button:SimpleButton;
private var hit_img:Image;
private var line_img:Image;
private var sound:int;// = 1
private var player_started:int;// = 0
public var myMenu:ContextMenu;
public var return_button:SimpleButton;
private var start_wait:int;// = 0
private var first_time:int;// = 0
private var sparks:Array;
public var submit_button:SimpleButton;
private var atom2_snd:atom2_sound;
private var current_level:int;// = 0
private var atoms:Array;
private var times:Array;
private var wait_time:int;// = 0
private var title_img:Image;
private var sounds:Array;
private var levels:Array;
private var spark_img:Image;
public var time_box:TextField;
private var atom2_img:Image;
public var back_button:SimpleButton;
private var level_complete:int;// = 0
private var trail_switch:int;// = 1
private var gamevol:SoundTransform;
public var instructions:TextField;
public var start_button:SimpleButton;
private var atom1_snd:atom1_sound;
private var current_seconds:int;// = 0
private var atom5_snd:atom5_sound;
private var fade_in:int;// = 0
private var game_mode:int;// = 0
private var atom_img:Image;
public var neenja:SimpleButton;
private var ang:Number;// = 200
private var current_amount:int;// = 0
private var win:int;// = 0
public var options_button:SimpleButton;
public var screen_click:SimpleButton;
public var counter:TextField;
private var fail_message:String;// = ""
public function atomz(){
FPSTimer = new Timer(1000);
updateTimer = new Timer(1);
FPS = "";
mouse_status = 0;
sound = 1;
ang = 200;
balls = new Array();
atoms = new Array();
sparks = new Array();
atom_img = new Image(ball, 16, 16);
atom2_img = new Image(atom2_gfx, 16, 16);
spark_img = new Image(spark_gfx, 64, 18);
hit_img = new Image(hit_gfx, 16, 16);
line_img = new Image(line, 1, 64);
game_mode = 0;
score = 0;
current_amount = 0;
needed_amount = 0;
level_complete = 0;
win = 0;
level_started = 0;
player_started = 0;
current_level = 0;
fade = 0;
fade_out = 0;
fade_in = 0;
fail_message = "";
win_message = "";
wait_time = 0;
start_wait = 0;
glow_switch = 1;
trail_switch = 1;
first_time = 0;
minutes = 0;
seconds = 0;
current_minutes = 0;
current_seconds = 0;
gamesound = new SoundChannel();
gamevol = new SoundTransform(1, 0);
sounds = new Array();
levels = new Array();
trys = new Array(11);
times = new Array(11);
super();
addFrameScript(0, frame1, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 15, frame16);
}
private function addAtom(_arg1:int, _arg2:int, _arg3:Number, _arg4:int){
var _local5:Object;
_local5 = new Object();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.frame = _arg4;
_local5.time = 0;
_local5.xv = (Math.sin(degToRad(_arg3)) * 2.5);
_local5.yv = (Math.cos(degToRad(_arg3)) * 2.5);
_local5.life = 60;
atoms.push(_local5);
_local5 = null;
}
private function clearBalls(){
var _local1:int;
var _local2:Object;
_local1 = (balls.length - 1);
while (_local1 >= 0) {
_local2 = balls[_local1];
removeObject(_local2, balls);
_local2 = null;
_local1--;
};
}
private function mouseup(_arg1:Event){
mouse_status = 0;
}
private function toggleSound(_arg1:Event){
switch (sound){
case 1:
sound = 0;
gamevol.volume = 0;
mute_button.gotoAndStop(2);
break;
case 0:
sound = 1;
gamevol.volume = 1;
mute_button.gotoAndStop(1);
break;
};
}
public function click_to_begin_pushed(_arg1:Event){
text1.visible = false;
text2.visible = false;
text3.visible = false;
click_to_begin.visible = false;
text6.visible = false;
mouse_status = 0;
game_mode = 3;
initLevel(current_level);
current_amount = 0;
screen_click.visible = true;
}
private function updateMolocules(){
var _local1:Object;
var _local2:int;
var _local3:*;
_local2 = (balls.length - 1);
while (_local2 >= 0) {
_local1 = balls[_local2];
_local1.x = (_local1.x + _local1.xv);
_local1.y = (_local1.y + _local1.yv);
if (_local1.x < 0){
_local1.xv = (_local1.xv * -1);
};
if (_local1.x > 480){
_local1.xv = (_local1.xv * -1);
};
if (_local1.y < 0){
_local1.yv = (_local1.yv * -1);
};
if (_local1.y > 320){
_local1.yv = (_local1.yv * -1);
};
if (getTimer() > (_local1.time + 100)){
_local1.frame = ((_local1.frame + 1) % 12);
_local1.time = getTimer();
};
_local1.angle = (_local1.angle + 1);
i = 0;
while (i < _local1.balls) {
_local3 = ((360 / _local1.balls) * i);
screen.drawImage(atom_img, ((_local1.x - 8) + (Math.sin(degToRad((_local1.angle + _local3))) * _local1.size)), ((_local1.y - 8) + (Math.cos(degToRad((_local1.angle + _local3))) * _local1.size)), _local1.frame);
i++;
};
_local2--;
};
_local1 = null;
}
public function glow_pushed(_arg1:Event){
if (glow_switch){
glow_switch = 0;
fade_black.glow_text.text = "OFF";
} else {
glow_switch = 1;
fade_black.glow_text.text = "ON";
};
}
public function cursessite2(_arg1:Event){
var _local2:URLRequest;
trace("test");
_local2 = new URLRequest("http://www.cursesfoiled.co.uk");
navigateToURL(_local2, "_blank");
}
function frame16(){
stage.frameRate = 30;
neenja.addEventListener(MouseEvent.MOUSE_DOWN, website);
}
private function addBall(_arg1){
var _local2:Object;
_local2 = new Object();
_local2.x = (Math.random() * 480);
_local2.y = (Math.random() * 320);
_local2.time = 0;
_local2.balls = _arg1;
_local2.size = (1.5 * _local2.balls);
_local2.frame = Math.floor((Math.random() * 12));
_local2.angle = (Math.random() * 360);
_local2.xv = ((Math.sin(degToRad(_local2.angle)) * 1) + (Math.random() * 0.3));
_local2.yv = ((Math.cos(degToRad(_local2.angle)) * 1) + (Math.random() * 0.3));
balls.push(_local2);
_local2 = null;
}
private function updateGame(){
var _local1:*;
_local1 = (getTimer() - timeLastFrame);
while (_local1 < (1000 / 50)) {
_local1 = (getTimer() - timeLastFrame);
};
timeLastFrame = getTimer();
return_button.visible = true;
instructions.visible = false;
level_text.visible = true;
level_text.text = (("Level " + String((current_level + 1))) + " / 12");
memory.text = String((System.totalMemory / 0x0400));
needed_amount = levels[current_level].needed;
if (current_amount >= needed_amount){
if (!win){
win = 1;
gamesound = win_snd.play();
gamesound.soundTransform = gamevol;
};
};
if (player_started){
if (atoms.length == 0){
if (sparks.length == 0){
if (current_amount >= needed_amount){
win_message = "Success!";
level_complete = 1;
if (current_amount < levels[current_level].amount){
score = (score + 200);
} else {
score = (score + 5000);
};
if (current_seconds < 10){
times[current_level] = ((current_minutes + ":0") + current_seconds);
} else {
times[current_level] = ((current_minutes + ":") + current_seconds);
};
current_seconds = 0;
current_minutes = 0;
win = 0;
mouse_status = 0;
start_wait = 0;
} else {
win_message = "Failed..";
level_complete = 0;
game_mode = 2;
player_started = 0;
clearBalls();
clearAtoms();
trys[current_level] = (trys[current_level] + 1);
mouse_status = 0;
start_wait = 0;
};
};
};
};
if (level_complete){
level_complete = 0;
player_started = 0;
current_level = (current_level + 1);
game_mode = 2;
clearBalls();
clearAtoms();
};
updateAtoms();
updateMolocules();
updateSparks();
checkCollisions();
ang = (ang + 2);
if (start_wait < 1){
start_wait = 1;
mouse_status = 0;
};
if (!player_started){
screen.drawImageRotate(line_img, mouseX, mouseY, 0, 0, 0, -(ang));
screen.drawImageRotate(line_img, mouseX, mouseY, 0, 0, 0, (-(ang) + 120));
screen.drawImageRotate(line_img, mouseX, mouseY, 0, 0, 0, (-(ang) + 240));
screen.drawImage(atom2_img, ((mouseX - 8) + (Math.sin(degToRad(ang)) * 5)), ((mouseY - 8) + (Math.cos(degToRad(ang)) * 5)), 0);
screen.drawImage(atom2_img, ((mouseX - 8) + (Math.sin(degToRad((ang + 120))) * 5)), ((mouseY - 8) + (Math.cos(degToRad((ang + 120))) * 5)), 0);
screen.drawImage(atom2_img, ((mouseX - 8) + (Math.sin(degToRad((ang + 240))) * 5)), ((mouseY - 8) + (Math.cos(degToRad((ang + 240))) * 5)), 0);
};
time_counter.visible = true;
if (current_seconds < 10){
time_counter.text = ((current_minutes + ":0") + current_seconds);
} else {
time_counter.text = ((current_minutes + ":") + current_seconds);
};
counter.visible = true;
counter.text = ((current_amount + " / ") + needed_amount);
if (((glow_switch) && (trail_switch))){
screen.render_fade_bloom();
} else {
if (glow_switch){
screen.render_bloom();
} else {
if (trail_switch){
screen.render_fade();
} else {
if (((!(glow_switch)) && (!(trail_switch)))){
screen.render();
};
};
};
};
fps_counter++;
if (current_level > 11){
gotoAndStop(4);
updateTimer.removeEventListener(TimerEvent.TIMER, updateTest);
};
}
function frame3(){
stop();
checkURL();
stage.frameRate = 120;
text1.visible = false;
text2.visible = false;
text3.visible = false;
text6.visible = false;
instructions.visible = false;
time_counter.visible = false;
neenja_button.visible = true;
curses_button.visible = true;
start_button.visible = true;
options_button.visible = true;
return_button.visible = false;
click_to_begin.visible = false;
screen_click.visible = false;
fade_black.visible = false;
if (glow_switch){
fade_black.glow_text.text = "ON";
} else {
fade_black.glow_text.text = "OFF";
};
if (trail_switch){
fade_black.trail_text.text = "ON";
} else {
fade_black.trail_text.text = "OFF";
};
neenja_button.addEventListener(MouseEvent.MOUSE_DOWN, moregames);
curses_button.addEventListener(MouseEvent.MOUSE_DOWN, cursessite);
start_button.addEventListener(MouseEvent.MOUSE_DOWN, start_pushed);
click_to_begin.addEventListener(MouseEvent.MOUSE_DOWN, click_to_begin_pushed);
screen_click.addEventListener(MouseEvent.MOUSE_DOWN, screen_clicked);
options_button.addEventListener(MouseEvent.MOUSE_DOWN, options_pushed);
fade_black.glow_button.addEventListener(MouseEvent.MOUSE_DOWN, glow_pushed);
fade_black.trail_button.addEventListener(MouseEvent.MOUSE_DOWN, trail_pushed);
fade_black.done_button.addEventListener(MouseEvent.MOUSE_DOWN, done_pushed);
return_button.addEventListener(MouseEvent.MOUSE_DOWN, return_pushed);
}
public function start_test(){
var _local1:int;
screen = new Blitter(480, 320, false, stage1);
updateTimer.addEventListener(TimerEvent.TIMER, updateTest);
updateTimer.start();
FPSTimer.addEventListener(TimerEvent.TIMER, fps_update);
FPSTimer.start();
stage.addEventListener(MouseEvent.MOUSE_DOWN, mousedown);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseup);
mute_button.addEventListener(MouseEvent.MOUSE_DOWN, toggleSound);
current_level = 0;
addLevel(new Array(0, 0, 0, 0, 3), 1);
addLevel(new Array(100, 0, 0, 0, 0), 50);
addLevel(new Array(0, 0, 0, 10, 0), 5);
addLevel(new Array(10, 5, 0, 0, 0), 5);
addLevel(new Array(5, 5, 5, 0, 0), 7);
addLevel(new Array(5, 3, 0, 0, 7), 10);
addLevel(new Array(10, 0, 0, 0, 10), 15);
addLevel(new Array(50, 50, 0, 0, 0), 75);
addLevel(new Array(10, 0, 10, 10, 0), 26);
addLevel(new Array(20, 5, 10, 5, 2), 37);
addLevel(new Array(30, 0, 10, 5, 5), 43);
addLevel(new Array(100, 10, 10, 0, 0), 115);
title_img = new Image(title_gfx, 480, 320);
atom1_snd = new atom1_sound();
atom2_snd = new atom2_sound();
atom3_snd = new atom3_sound();
atom4_snd = new atom4_sound();
atom5_snd = new atom5_sound();
win_snd = new win_sound();
sounds.push(atom1_snd);
sounds.push(atom2_snd);
sounds.push(atom3_snd);
sounds.push(atom4_snd);
sounds.push(atom5_snd);
_local1 = 0;
while (_local1 < 12) {
trys[_local1] = 1;
times[_local1] = "00:00";
_local1++;
};
}
function frame5(){
MochiScores.showLeaderboard({boardID:"59f5c2b14754388e", score:score});
}
function frame7(){
stop();
}
function frame4(){
try_list.text = "Attempts\n";
level_list.text = "Level\n";
time_list.text = "Time\n";
time_box.text = ((("Total time:\n" + minutes) + ":") + seconds);
score_box.text = ("Score:\n" + String(score));
submit_button.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent){
gotoAndStop(5);
});
back_button.addEventListener(MouseEvent.MOUSE_UP, function (_arg1:MouseEvent){
resetGame();
gotoAndStop(3);
});
i = 0;
while (i < 12) {
try_list.appendText((String(trys[i]) + "\n"));
level_list.appendText((String((i + 1)) + "\n"));
time_list.appendText((String(times[i]) + "\n"));
i++;
};
}
function frame6(){
stop();
resetGame();
gotoAndStop(3);
}
public function angleFromTo(_arg1, _arg2, _arg3, _arg4:Number){
var _local5:Number;
var _local6:Number;
_local5 = (_arg3 - _arg1);
_local6 = (_arg4 - _arg2);
return ((Math.atan2(_local6, _local5) / (Math.PI / 180)));
}
public function moregames(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.neenja.com");
navigateToURL(_local2, "_blank");
}
function frame1(){
this.stop();
MochiServices.connect("7315ca16b7599071", root);
MochiBot.track(this, "2a80c56b");
curses2_button.addEventListener(MouseEvent.MOUSE_DOWN, cursessite2);
myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
this.contextMenu = myMenu;
this.addEventListener("enterFrame", onEnterFrame);
}
public function done_pushed(_arg1:Event){
fade_black.visible = false;
}
public function website(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.neenja.com");
navigateToURL(_local2, "_blank");
}
private function initLevel(_arg1:int){
var _local2:int;
_local2 = 0;
while (_local2 < levels[_arg1].types[0]) {
addBall(2);
_local2++;
};
_local2 = 0;
while (_local2 < levels[_arg1].types[1]) {
addBall(3);
_local2++;
};
_local2 = 0;
while (_local2 < levels[_arg1].types[2]) {
addBall(4);
_local2++;
};
_local2 = 0;
while (_local2 < levels[_arg1].types[3]) {
addBall(5);
_local2++;
};
_local2 = 0;
while (_local2 < levels[_arg1].types[4]) {
addBall(6);
_local2++;
};
}
public function onEnterFrame(_arg1:Event){
preloader.loader_mask.scaleX = ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 1);
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
gotoAndStop(16);
this.removeEventListener("enterFrame", onEnterFrame);
};
}
private function checkCollisions(){
var _local1:int;
var _local2:Object;
var _local3:Point;
var _local4:int;
var _local5:Object;
var _local6:Point;
var _local7:Number;
var _local8:Number;
var _local9:*;
_local1 = (atoms.length - 1);
while (_local1 >= 0) {
_local2 = atoms[_local1];
_local3 = new Point((_local2.x - 8), (_local2.y - 8));
_local4 = (balls.length - 1);
while (_local4 >= 0) {
_local5 = balls[_local4];
_local6 = new Point((_local5.x - 8), (_local5.y - 8));
_local7 = 0;
_local8 = 0;
_local7 = (_local5.x - _local2.x);
_local8 = (_local5.y - _local2.y);
if (Math.sqrt(((_local7 * _local7) + (_local8 * _local8))) < (_local5.size + 8)){
i = 0;
while (i < _local5.balls) {
_local9 = ((360 / _local5.balls) * i);
addAtom(_local5.x, _local5.y, (_local5.angle + _local9), 7);
i++;
};
if (current_amount > needed_amount){
score = (score + (10 * _local2.life));
};
addSpark(_local5.x, _local5.y, 4, _local5.frame);
removeObject(_local2, atoms);
removeObject(_local5, balls);
current_amount = (current_amount + 1);
gamesound = sounds[Math.floor((Math.random() * 5))].play();
gamesound.soundTransform = gamevol;
_local5 = null;
};
_local4--;
};
_local1--;
};
}
private function mousedown(_arg1:Event){
mouse_status = 1;
}
private function addSpark(_arg1:int, _arg2:int, _arg3:Number, _arg4:int){
var _local5:Object;
_local5 = new Object();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.scale = _arg3;
_local5.type = _arg4;
sparks.push(_local5);
_local5 = null;
}
public function cursessite(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.cursesfoiled.co.uk");
navigateToURL(_local2, "_blank");
}
private function fps_update(_arg1:TimerEvent){
if (game_mode == 3){
seconds = (seconds + 1);
current_seconds = (current_seconds + 1);
if (current_seconds > 59){
current_seconds = 0;
current_minutes = (current_minutes + 1);
};
if (seconds > 59){
seconds = 0;
minutes = (minutes + 1);
};
};
}
private function clearAtoms(){
var _local1:int;
var _local2:Object;
_local1 = (atoms.length - 1);
while (_local1 >= 0) {
_local2 = atoms[_local1];
removeObject(_local2, atoms);
_local2 = null;
_local1--;
};
}
private function removeObject(_arg1:Object, _arg2:Array){
var _local3:*;
for (_local3 in _arg2) {
if (_arg2[_local3] == _arg1){
_arg2.splice(_local3, 1);
_arg1 = null;
break;
};
};
}
private function updateIntro(){
text3.visible = true;
click_to_begin.visible = true;
text6.visible = true;
counter.visible = false;
time_counter.visible = false;
neenja_button.visible = false;
curses_button.visible = false;
start_button.visible = false;
screen_click.visible = false;
options_button.visible = false;
return_button.visible = false;
level_text.visible = false;
if (first_time == 0){
first_time = 1;
instructions.visible = true;
};
if (win_message == "Failed.."){
text2.visible = true;
text2.text = ((("You got " + current_amount) + " out of ") + levels[current_level].needed);
} else {
text2.visible = false;
};
if (win_message != ""){
text1.visible = true;
text1.text = win_message;
} else {
text1.visible = false;
};
text3.text = (((("Split " + levels[current_level].needed) + " out of ") + levels[current_level].amount) + " molecules");
text6.text = ("Score: " + score);
if (mouse_status){
mouse_status = 0;
};
screen.render();
}
public function return_pushed(_arg1:Event){
stop();
resetGame();
game_mode = 0;
gotoAndPlay(2);
}
private function updateTitle(){
text1.visible = false;
text2.visible = false;
text3.visible = false;
click_to_begin.visible = false;
text6.visible = false;
counter.visible = false;
screen.drawImage(title_img, 0, 0, 0);
screen.render();
}
private function degToRad(_arg1:Number){
return ((((Math.PI * 2) * _arg1) / 360));
}
public function checkURL(){
var _local1:String;
_local1 = stage.loaderInfo.url.toLowerCase();
if ((((((_local1.indexOf("cursesfoiled.co.uk") <= 0)) && ((_local1.indexOf("fantasticchoice.com") <= 0)))) && ((_local1.indexOf("flashgamelicense.com") <= 0)))){
start_test();
} else {
start_test();
};
}
public function screen_clicked(_arg1:Event){
if (!player_started){
player_started = 1;
addAtom(mouseX, mouseY, ang, 7);
addAtom(mouseX, mouseY, (ang + 120), 7);
addAtom(mouseX, mouseY, (ang + 240), 7);
};
}
private function updateSparks(){
var _local1:int;
var _local2:Object;
_local1 = (sparks.length - 1);
while (_local1 >= 0) {
_local2 = sparks[_local1];
_local2.scale = (_local2.scale - 0.2);
screen.blend = "add";
screen.drawImageScale(spark_img, _local2.x, _local2.y, _local2.type, 32, 9, _local2.scale, _local2.scale);
screen.blend = null;
if (_local2.scale < 0){
removeObject(_local2, sparks);
};
_local1--;
};
}
private function addLevel(_arg1:Array, _arg2:int){
var _local3:Object;
_local3 = new Object();
_local3.amount = ((((_arg1[0] + _arg1[1]) + _arg1[2]) + _arg1[3]) + _arg1[4]);
_local3.types = _arg1;
_local3.needed = _arg2;
levels.push(_local3);
_local3 = null;
}
private function updateTest(_arg1:TimerEvent){
switch (game_mode){
case 0:
updateTitle();
break;
case 1:
updateOptions();
break;
case 2:
updateIntro();
break;
case 3:
updateGame();
break;
};
}
public function trail_pushed(_arg1:Event){
if (trail_switch){
trail_switch = 0;
fade_black.trail_text.text = "OFF";
} else {
trail_switch = 1;
fade_black.trail_text.text = "ON";
};
}
private function updateOptions(){
screen.drawText("OPTIONS", 230, 150, 4294967295, "left");
screen.render();
}
public function start_pushed(_arg1:Event){
game_mode = 2;
mouse_status = 0;
}
private function resetGame(){
var _local1:int;
clearBalls();
clearAtoms();
game_mode = 0;
current_level = 0;
level_complete = 0;
player_started = 0;
win_message = "";
score = 0;
seconds = 0;
minutes = 0;
current_seconds = 0;
current_minutes = 0;
_local1 = 0;
while (_local1 < 12) {
trys[_local1] = 1;
times[_local1] = "00:00";
_local1++;
};
}
private function updateAtoms(){
var _local1:int;
var _local2:Object;
_local1 = (atoms.length - 1);
while (_local1 >= 0) {
_local2 = atoms[_local1];
_local2.x = (_local2.x + _local2.xv);
_local2.y = (_local2.y + _local2.yv);
_local2.yv = (_local2.yv * 0.98);
_local2.xv = (_local2.xv * 0.98);
if (_local2.x < 0){
_local2.xv = (_local2.xv * -1);
};
if (_local2.x > 480){
_local2.xv = (_local2.xv * -1);
};
if (_local2.y < 0){
_local2.yv = (_local2.yv * -1);
};
if (_local2.y > 320){
_local2.yv = (_local2.yv * -1);
};
if (mouse_status){
_local2.xv = (_local2.xv - (Math.sin(degToRad(((180 - angleFromTo(_local2.x, _local2.y, mouseX, mouseY)) + 90))) * 0.1));
_local2.yv = (_local2.yv - (Math.cos(degToRad(((180 - angleFromTo(_local2.x, _local2.y, mouseX, mouseY)) + 90))) * 0.1));
};
_local2.life = (_local2.life - 1);
if (getTimer() > _local2.time){
_local2.frame = ((_local2.frame + 1) % 12);
_local2.time = getTimer();
};
screen.drawImage(atom_img, (_local2.x - 8), (_local2.y - 8), _local2.frame);
if (_local2.life < 1){
addSpark(_local2.x, _local2.y, 2, _local2.frame);
removeObject(_local2, atoms);
};
_local1--;
};
}
public function options_pushed(_arg1:Event){
fade_black.visible = true;
}
}
}//package
Section 16
//ball (ball)
package {
import flash.display.*;
public dynamic class ball extends BitmapData {
public function ball(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 17
//block (block)
package {
import flash.display.*;
public dynamic class block extends BitmapData {
public function block(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 18
//hit_gfx (hit_gfx)
package {
import flash.display.*;
public dynamic class hit_gfx extends BitmapData {
public function hit_gfx(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 19
//line (line)
package {
import flash.display.*;
public dynamic class line extends BitmapData {
public function line(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 20
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 21
//spark_gfx (spark_gfx)
package {
import flash.display.*;
public dynamic class spark_gfx extends BitmapData {
public function spark_gfx(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 22
//title_gfx (title_gfx)
package {
import flash.display.*;
public dynamic class title_gfx extends BitmapData {
public function title_gfx(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 23
//win_sound (win_sound)
package {
import flash.media.*;
public dynamic class win_sound extends Sound {
}
}//package