Section 1
//mute_button_9 (atomz_fla.mute_button_9)
package atomz_fla {
import flash.display.*;
public dynamic class mute_button_9 extends MovieClip {
public function mute_button_9(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package atomz_fla
Section 2
//Neenja_Preloader_15 (atomz_fla.Neenja_Preloader_15)
package atomz_fla {
import flash.display.*;
public dynamic class Neenja_Preloader_15 extends MovieClip {
public function Neenja_Preloader_15(){
addFrameScript(178, frame179);
}
function frame179(){
stop();
MovieClip(parent).gotoAndStop(3);
}
}
}//package atomz_fla
Section 3
//preloader_1 (atomz_fla.preloader_1)
package atomz_fla {
import flash.display.*;
public dynamic class preloader_1 extends MovieClip {
public var loader_mask:MovieClip;
}
}//package atomz_fla
Section 4
//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_pos1:Point;
public var c_pos2:Point;
private var ypos;
private var off_screen:BitmapData;
public var display:Bitmap;
private var blur_screen:Bitmap;
private var on_screen:BitmapData;
public var blend:String;
private var xpos;
public var ct2:ColorTransform;
private var h:int;
public var ct:ColorTransform;
private var w;
public var fade:ColorTransform;
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;
ct = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
ct2 = new ColorTransform(1, 1, 1, 1, -32, -32, -32, 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(8, 8, 3);
_local6 = new Array();
_local6.push(_local5);
blur_screen = new Bitmap(on_screen);
blur_screen.filters = _local6;
blur_screen.blendMode = "add";
}
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;
var _local8:Matrix;
_local6 = new TextField();
_local7 = new TextFormat();
_local7.font = "Arial Black";
_local7.size = 18;
_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));
_local8 = new Matrix();
_local8.translate(_arg2, _arg3);
off_screen.draw(_local6, _local8, ct, blend);
}
public function drawImageScale(_arg1:Image, _arg2:Number, _arg3:Number, _arg4:int, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number){
var _local9:Rectangle;
var _local10:Matrix;
_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);
_local10 = new Matrix();
_local10.translate(-(_arg5), -(_arg6));
_local10.scale(_arg7, _arg8);
_local10.translate(_arg2, _arg3);
off_screen.draw(_arg1.temp_data, _local10, ct, blend);
}
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 drawPixel(_arg1:Number, _arg2:Number, _arg3:uint){
off_screen.setPixel32(_arg1, _arg2, _arg3);
}
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);
}
public function drawImageRotate(_arg1:Image, _arg2:Number, _arg3:Number, _arg4:int, _arg5:Number, _arg6:Number, _arg7:Number){
var _local8:Rectangle;
var _local9:*;
var _local10:Matrix;
_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));
_local10 = new Matrix();
_local10.translate(-(_arg5), -(_arg6));
_local10.rotate(_local9);
_local10.translate(_arg2, _arg3);
off_screen.draw(_arg1.temp_data, _local10, ct, blend);
}
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:*;
var _local12:Matrix;
_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));
_local12 = new Matrix();
_local12.translate(-(_arg5), -(_arg6));
_local12.rotate(_local11);
_local12.scale(_arg8, _arg9);
_local12.translate(_arg2, _arg3);
off_screen.draw(_arg1.temp_data, _local12, ct, blend);
}
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:*;
var _local12:Matrix;
_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));
_local12 = new Matrix();
_local12.translate(-(_arg5), -(_arg6));
_local12.scale(_arg8, _arg9);
_local12.rotate(_local11);
_local12.translate(_arg2, _arg3);
off_screen.draw(_arg1.temp_data, _local12, ct, blend);
}
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 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 drawImageRect(_arg1:Image, _arg2:Number, _arg3:Number, _arg4:int){
var _local5:Rectangle;
_local5 = new Rectangle(_arg4, 0, 1, 1);
off_screen.copyPixels(_arg1.img_data, _local5, new Point(_arg2, _arg3), null, null, false);
}
public function drawImage(_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), null, null, false);
}
}
}//package cursesfoiled.graphics
Section 5
//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 6
//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 7
//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);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
_rcvChannelName = _arg1;
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var clipname:String;
var f:Function;
var req:URLRequest;
var id = _arg1;
var clip = _arg2;
clipname = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
MochiServices.allowDomains(_gatewayURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
_timer = new Timer(1000, 0);
_startTime = getTimer();
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
f = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
req = new URLRequest(_gatewayURL);
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain("*", "localhost");
_rcvChannel.allowInsecureDomain("*", "localhost");
_rcvChannel.client = _clip;
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
public static function bringToTop(_arg1:Event):void{
var e = _arg1;
if (MochiServices.clip != null){
if (MochiServices.childClip != null){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var _local5:MovieClip;
_local5 = new MovieClip();
if (_arg4){
if (((false) && (_arg3))){
_arg1.addChildAt(_local5, _arg3);
} else {
_arg1.addChild(_local5);
};
};
_arg1[_arg2] = _local5;
_local5["_name"] = _arg2;
return (_local5);
}
public static function connectWait(_arg1:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_timer.stop();
};
}
}
}//package mochi
Section 8
//atom1_sound (atom1_sound)
package {
import flash.media.*;
public dynamic class atom1_sound extends Sound {
}
}//package
Section 9
//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 10
//atom2_sound (atom2_sound)
package {
import flash.media.*;
public dynamic class atom2_sound extends Sound {
}
}//package
Section 11
//atom3_sound (atom3_sound)
package {
import flash.media.*;
public dynamic class atom3_sound extends Sound {
}
}//package
Section 12
//atom4_sound (atom4_sound)
package {
import flash.media.*;
public dynamic class atom4_sound extends Sound {
}
}//package
Section 13
//atom5_sound (atom5_sound)
package {
import flash.media.*;
public dynamic class atom5_sound extends Sound {
}
}//package
Section 14
//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.*;
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 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;
private var seconds:int;// = 0
public var level_list:TextField;
private var fade:Number;// = 0
private var win_snd:win_sound;
public var time_counter:TextField;
private var gamesound:SoundChannel;
private var score:int;// = 0
public var neenja_button:SimpleButton;
public var text1:TextField;
public var text2:TextField;
public var text3:TextField;
public var text4: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;
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
public var stage1:MovieClip;
public var curses2_button:SimpleButton;
private var fade_out:int;// = 0
private var sound:int;// = 1
public var curses_button:SimpleButton;
private var hit_img:Image;
private var player_started:int;// = 0
public var myMenu:ContextMenu;
private var atom2_snd:atom2_sound;
private var sparks:Array;
public var submit_button:SimpleButton;
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 gamevol:SoundTransform;
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
private var fail_message:String;// = ""
public var counter:TextField;
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);
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;
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 clearBalls(){
var _local1:int;
var _local2:Object;
_local1 = (balls.length - 1);
while (_local1 >= 0) {
_local2 = balls[_local1];
removeObject(_local2, balls);
_local1--;
};
}
private function mouseup(_arg1:Event){
mouse_status = 0;
}
private function updateMolocules(){
var _local1:int;
var _local2:Object;
_local1 = (balls.length - 1);
while (_local1 >= 0) {
_local2 = balls[_local1];
_local2.x = (_local2.x + _local2.xv);
_local2.y = (_local2.y + _local2.yv);
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 (getTimer() > (_local2.time + 100)){
_local2.frame = ((_local2.frame + 1) % 18);
_local2.time = getTimer();
};
_local2.angle = (_local2.angle + 1);
screen.drawImage(atom_img, ((_local2.x - 8) + (Math.sin(degToRad(_local2.angle)) * _local2.size)), ((_local2.y - 8) + (Math.cos(degToRad(_local2.angle)) * _local2.size)), 0);
screen.drawImage(atom_img, ((_local2.x - 8) + (Math.sin(degToRad((_local2.angle + 120))) * _local2.size)), ((_local2.y - 8) + (Math.cos(degToRad((_local2.angle + 120))) * _local2.size)), 0);
screen.drawImage(atom_img, ((_local2.x - 8) + (Math.sin(degToRad((_local2.angle + 240))) * _local2.size)), ((_local2.y - 8) + (Math.cos(degToRad((_local2.angle + 240))) * _local2.size)), 0);
_local1--;
};
}
private function toggleSound(_arg1:Event){
if (sound){
sound = 0;
gamevol.volume = 0;
mute_button.gotoAndStop(2);
} else {
sound = 1;
gamevol.volume = 1;
mute_button.gotoAndStop(1);
};
}
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(){
var _local1:Object;
_local1 = new Object();
_local1.x = (Math.random() * 480);
_local1.y = (Math.random() * 320);
_local1.size = 5;
_local1.time = 0;
_local1.angle = (Math.random() * 360);
_local1.xv = ((Math.sin(degToRad(_local1.angle)) * 1) + (Math.random() * 0.3));
_local1.yv = ((Math.cos(degToRad(_local1.angle)) * 1) + (Math.random() * 0.3));
balls.push(_local1);
}
private function updateGame(){
var _local1:*;
_local1 = (getTimer() - timeLastFrame);
while (_local1 < (1000 / 50)) {
_local1 = (getTimer() - timeLastFrame);
};
timeLastFrame = getTimer();
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;
score = (score + 200);
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;
} else {
win_message = "Failed..";
level_complete = 0;
game_mode = 2;
player_started = 0;
clearBalls();
clearAtoms();
trys[current_level] = (trys[current_level] + 1);
};
};
};
};
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 (!player_started){
if (mouse_status){
mouse_status = 0;
player_started = 1;
addAtom(mouseX, mouseY, ang);
addAtom(mouseX, mouseY, (ang + 120));
addAtom(mouseX, mouseY, (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 (current_level > 11){
gotoAndStop(4);
updateTimer.removeEventListener(TimerEvent.TIMER, updateTest);
};
screen.render_fade();
fps_counter++;
}
function frame3(){
stop();
checkURL();
stage.frameRate = 120;
text1.visible = false;
text2.visible = false;
text3.visible = false;
text4.visible = false;
text6.visible = false;
time_counter.visible = false;
neenja_button.visible = true;
curses_button.visible = true;
neenja_button.addEventListener(MouseEvent.MOUSE_DOWN, moregames);
curses_button.addEventListener(MouseEvent.MOUSE_DOWN, cursessite);
}
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);
addLevel(5, 1);
addLevel(7, 2);
addLevel(10, 3);
addLevel(15, 5);
addLevel(20, 7);
addLevel(30, 10);
addLevel(35, 15);
addLevel(40, 22);
addLevel(45, 26);
addLevel(50, 37);
addLevel(55, 43);
addLevel(60, 55);
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:"f043280d10f900c2", score:score});
}
function frame7(){
stop();
}
function frame1(){
this.stop();
MochiServices.connect("7315ca16b7599071", root);
MochiBot.track(this, "ef9068d3");
curses2_button.addEventListener(MouseEvent.MOUSE_DOWN, cursessite2);
myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
this.contextMenu = myMenu;
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, PL_LOADING);
}
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 moregames(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.neenja.com");
navigateToURL(_local2, "_blank");
}
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].amount) {
addBall();
_local2++;
};
}
private function checkCollisions(){
var _local1:int;
var _local2:Object;
var _local3:Point;
var _local4:int;
var _local5:Object;
var _local6:Point;
_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));
if (atom2_img.img_data.hitTest(_local3, 0xFF, hit_img.img_data, _local6, 0xFF)){
addAtom(_local5.x, _local5.y, _local5.angle);
addAtom(_local5.x, _local5.y, (_local5.angle + 120));
addAtom(_local5.x, _local5.y, (_local5.angle + 240));
addSpark(_local5.x, _local5.y, 4, 1);
removeObject(_local2, atoms);
removeObject(_local5, balls);
current_amount = (current_amount + 1);
gamesound = sounds[Math.floor((Math.random() * 5))].play();
gamesound.soundTransform = gamevol;
if (current_amount > needed_amount){
score = (score + 100);
};
};
_local4--;
};
_local1--;
};
}
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);
}
private function mousedown(_arg1:Event){
mouse_status = 1;
}
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);
_local1--;
};
}
private function removeObject(_arg1:Object, _arg2:Array){
var _local3:*;
for (_local3 in _arg2) {
if (_arg2[_local3] == _arg1){
_arg2.splice(_local3, 1);
break;
};
};
}
private function updateTitle(){
text1.visible = false;
text2.visible = false;
text3.visible = false;
text4.visible = false;
text6.visible = false;
counter.visible = false;
if (mouse_status){
if ((((((((mouseX > 202)) && ((mouseX < 280)))) && ((mouseY > 148)))) && ((mouseY < 163)))){
game_mode = 2;
mouse_status = 0;
};
};
screen.drawImage(title_img, 0, 0, 0);
screen.render();
}
private function updateIntro(){
text3.visible = true;
text4.visible = true;
text6.visible = true;
counter.visible = false;
time_counter.visible = false;
neenja_button.visible = false;
curses_button.visible = false;
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){
text1.visible = false;
text2.visible = false;
text3.visible = false;
text4.visible = false;
text6.visible = false;
mouse_status = 0;
game_mode = 3;
initLevel(current_level);
current_amount = 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();
};
}
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:int, _arg2:int){
var _local3:Object;
_local3 = new Object();
_local3.amount = _arg1;
_local3.needed = _arg2;
levels.push(_local3);
}
private function updateTest(_arg1:TimerEvent){
switch (game_mode){
case 0:
updateTitle();
break;
case 1:
updateOptions();
break;
case 2:
updateIntro();
break;
case 3:
updateGame();
break;
};
}
private function updateOptions(){
screen.drawText("OPTIONS", 230, 150, 4294967295, "left");
screen.render();
}
private function addAtom(_arg1:int, _arg2:int, _arg3:Number){
var _local4:Object;
_local4 = new Object();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.xv = (Math.sin(degToRad(_arg3)) * 2.5);
_local4.yv = (Math.cos(degToRad(_arg3)) * 2.5);
_local4.life = 60;
atoms.push(_local4);
}
public function PL_LOADING(_arg1:ProgressEvent):void{
var _local2:Number;
_local2 = ((_arg1.bytesLoaded / _arg1.bytesTotal) * 100);
preloader.loader_mask.scaleX = (_local2 / 100);
if (_local2 == 100){
this.gotoAndStop(16);
};
}
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);
};
_local2.life = (_local2.life - 1);
screen.drawImageScale(atom2_img, (_local2.x - 8), (_local2.y - 8), 0, 0, 0, 1, 1);
if (_local2.life < 1){
addSpark(_local2.x, _local2.y, 2, 0);
removeObject(_local2, atoms);
};
_local1--;
};
}
}
}//package
Section 15
//ball (ball)
package {
import flash.display.*;
public dynamic class ball extends BitmapData {
public function ball(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 16
//block (block)
package {
import flash.display.*;
public dynamic class block extends BitmapData {
public function block(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 17
//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 18
//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 19
//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 20
//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 21
//win_sound (win_sound)
package {
import flash.media.*;
public dynamic class win_sound extends Sound {
}
}//package