Section 1
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _inventory:MochiInventory;
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function requestFunding(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFunding", _arg1);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 2
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 3
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 4
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function trackEvent(_arg1:String, _arg2=null):void{
MochiServices.send("events_trackEvent", {tag:_arg1, value:_arg2}, null, null);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local4:Object;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(_arg1:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(_arg1)}, null, null);
}
}
}//package mochi.as3
Section 5
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _syncID:Number;
private var _consumableProperties:Object;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (((_arg1.privateProperties) && (_arg1.privateProperties.consumable))){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function sync(_arg1:Event=null):void{
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var _local2:Object = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[(_local2 + KEY_SALT)].value);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 6
//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){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
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)){
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
} else {
if (Math.floor(n) != n){
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
//unresolved jump
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
//unresolved jump
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
//unresolved jump
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
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)){
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
} else {
if (Math.floor(_arg1) != _arg1){
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 7
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
public class MochiServices {
public static const CONNECTED:String = "onConnected";
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = _callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
var methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
//unresolved jump
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
};
};
};
delete _callbacks[cb];
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_queue.push({methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_nextCallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
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().time));
_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);
}
private static function detach(_arg1:Event):void{
var _local2:LoaderInfo = LoaderInfo(_arg1.target);
_local2.removeEventListener(Event.COMPLETE, detach);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.removeEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
private static function loadLCBridgeComplete(_arg1:Event):void{
var _local2:Loader = LoaderInfo(_arg1.target).loader;
_mochiLocalConnection = MovieClip(_local2.content);
listen();
}
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 {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
} 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.9.1 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
return;
};
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
//unresolved jump
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
//unresolved jump
};
return;
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
return;
};
_local3++;
};
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
_local2 = _queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _callbacks[_local2.callbackID];
};
delete _callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "services":
MochiServices.triggerEvent(_arg1.event, _arg1.args);
break;
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "social":
MochiSocial.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _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 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://link.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 setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (_arg1 != null){
if ((_arg1 is DisplayObjectContainer)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_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 loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
MochiServices.disconnect();
MochiServices.onError("IOError");
}
public static function get childClip():Object{
return (_clip);
}
private static function initComChannels():void{
if (!_connected){
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
private static function loadLCBridge(_arg1:Object):void{
var _local2:Loader = new Loader();
var _local3:String = (_servURL + _mochiLC);
var _local4:URLRequest = new URLRequest(_local3);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local2.load(_local4);
_arg1.addChild(_local2);
}
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{
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
var _local3:String = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local3 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local3);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var _local4:URLRequest = new URLRequest(_local3);
var _local5:URLVariables = new URLVariables();
_local5.listenLC = _listenChannelName;
_local5.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local5.api_version = getVersion();
if (widget){
_local5.widget = true;
};
_local4.data = _local5;
_loader.load(_local4);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_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 connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
};
if (((!(_connected)) && ((_clip == null)))){
_connecting = true;
init(id, clip);
};
//unresolved jump
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
};
};
};
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
MochiServices.disconnect();
MochiServices.onError("IOError");
} else {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
};
}
}
}//package mochi.as3
Section 8
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const ACTION_CANCELED:String = "onCancel";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static const FRIEND_LIST:String = "FriendsList";
public static const PROFILE_DATA:String = "ProfileData";
public static const GAMEPLAY_DATA:String = "GameplayData";
public static const ACTION_COMPLETE:String = "onComplete";
public static const LOGIN_SHOW:String = "LoginShow";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const USER_INFO:String = "UserInfo";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOWN:String = "LoginShown";
public static var _user_info:Object = null;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function requestFan(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFan", _arg1);
}
public static function postToStream(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_postToStream", _arg1);
}
public static function getFriendsList(_arg1:Object=null):void{
MochiServices.send("social_getFriendsList", _arg1);
}
public static function requestLogin(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestLogin", _arg1);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("social_saveUserProperties", _arg1);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function inviteFriends(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_inviteFriends", _arg1);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_showLoginWidget", {options:_arg1});
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("social_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 9
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var operation:String;// = null
public var error:Event;// = null
public var data;// = null
public var _loader:URLLoader;
public var key:String;// = null
public function MochiUserData(_arg1:String="", _arg2:Function=null){
this.key = _arg1;
this.callback = _arg2;
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
};
}
public function request(_arg1:String, _arg2:ByteArray):void{
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 10
//FrozenState_85 (MyHermesGame_fla.FrozenState_85)
package MyHermesGame_fla {
import flash.display.*;
public dynamic class FrozenState_85 extends MovieClip {
public var ice:MovieClip;
public function FrozenState_85(){
addFrameScript(95, frame96);
}
function frame96(){
gotoAndStop(1);
}
}
}//package MyHermesGame_fla
Section 11
//SoundHolder_141 (MyHermesGame_fla.SoundHolder_141)
package MyHermesGame_fla {
import flash.display.*;
public dynamic class SoundHolder_141 extends MovieClip {
public function SoundHolder_141(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MyHermesGame_fla
Section 12
//AssetsHolder (AssetsHolder)
package {
import flash.display.*;
public dynamic class AssetsHolder extends MovieClip {
public function AssetsHolder(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 13
//BaddieScore (BaddieScore)
package {
import flash.display.*;
public dynamic class BaddieScore extends MovieClip {
public var scoreMc:MovieClip;
}
}//package
Section 14
//BadOne (BadOne)
package {
import flash.display.*;
public dynamic class BadOne extends MovieClip {
public function BadOne(){
addFrameScript(33, frame34);
}
function frame34(){
stop();
}
}
}//package
Section 15
//Bg (Bg)
package {
import flash.display.*;
public dynamic class Bg extends Sprite {
}
}//package
Section 16
//BonusScore (BonusScore)
package {
import flash.display.*;
public dynamic class BonusScore extends MovieClip {
public var scoreMc:MovieClip;
public function BonusScore(){
addFrameScript(44, frame45);
}
function frame45(){
stop();
}
}
}//package
Section 17
//BonusSnd (BonusSnd)
package {
import flash.media.*;
public dynamic class BonusSnd extends Sound {
}
}//package
Section 18
//Bravo1 (Bravo1)
package {
import flash.media.*;
public dynamic class Bravo1 extends Sound {
}
}//package
Section 19
//Bullet (Bullet)
package {
import flash.display.*;
public dynamic class Bullet extends MovieClip {
}
}//package
Section 20
//CreditsBg (CreditsBg)
package {
import flash.display.*;
public dynamic class CreditsBg extends Sprite {
}
}//package
Section 21
//CreditsBtn (CreditsBtn)
package {
import flash.display.*;
public dynamic class CreditsBtn extends SimpleButton {
}
}//package
Section 22
//Door (Door)
package {
import flash.display.*;
public dynamic class Door extends MovieClip {
}
}//package
Section 23
//Game (Game)
package {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.net.*;
import flash.media.*;
import flash.filters.*;
import flash.external.*;
import flash.ui.*;
public class Game extends MovieClip {
public var targetParcel:uint;// = 0
public var menuBg:MenuBg;
public var parcel:Parcel;
public var snowHit:SnowHit;
public var parcelScore:uint;// = 0
public var parcelsDelivered:uint;// = 0
public var badOne:BadOne;
public var gamePause:Boolean;// = false
public var music:Sound;
public var baddieCounter:uint;// = 0
public var musicChannel:SoundChannel;
public var mute:Boolean;// = false
public var fireRate:uint;// = 110
public var bg:Bg;
public var scoresBg:ScoresBg;
public var navBar2:NavBar2;
public var messages:Array;
public var overlay:Overlay;
public var howToPlayBg:HowToPlayBg;
public var freezeCounter:uint;// = 0
public var lastDoor:uint;// = 0
public var timeCounter:uint;// = 0
public var scoreBoard:Score;
public var creditsBg:CreditsBg;
public var snowFlakes:Array;
public var doors:Array;
public var bravoSnd:Sound;
public var parcels:Array;
public var ohNoSnd:Sound;
public var score:int;// = 0
public var currentBg:Array;
public var heroY:uint;// = 240
public var gamePausedMsg:GamePausedMsg;
public var tempDoor:Door;
public var heroX:uint;// = 320
public var frozen:Boolean;// = false
public var snowBallHitSnd:Sound;
public var bullets:Array;
public var door:Door;
public var heroState:String;// = "Run"
public var shadowFilter:DropShadowFilter;
public var navBar2On:Boolean;// = false
public var bonusSnd:Sound;
public var time:uint;// = 40
public var multiplier:uint;// = 1
public var gameBg:GameBg;
public var scoresShowed:Boolean;// = false
public var targetDoor:uint;// = 0
public var waitTime:uint;// = 0
public var gameOver:Boolean;// = false
public var navBarOn:Boolean;// = false
public var navBar:NavBar;
public var hero:Hero;
public var multiplierCounter:uint;// = 0
public var tempParcel:Parcel;
public function Game():void{
doors = [];
parcels = [];
snowFlakes = [];
messages = [];
bullets = [];
currentBg = [];
snowHit = new SnowHit();
gamePausedMsg = new GamePausedMsg();
menuBg = new MenuBg();
howToPlayBg = new HowToPlayBg();
gameBg = new GameBg();
scoresBg = new ScoresBg();
creditsBg = new CreditsBg();
overlay = new Overlay();
navBar = new NavBar();
navBar2 = new NavBar2();
bg = new Bg();
badOne = new BadOne();
music = new JingleBells();
bonusSnd = new BonusSnd();
ohNoSnd = new OhNo();
snowBallHitSnd = new SnowballHit();
bravoSnd = new Bravo1();
shadowFilter = new DropShadowFilter(2, 45, 0, 1, 5, 5, 1);
super();
init();
}
function clickCreditsBtn(_arg1):void{
bg.removeChild(currentBg[0]);
currentBg.unshift(creditsBg);
bg.addChild(currentBg[0]);
navBar.howToPlayBtn.visible = true;
navBar.scoresBtn.visible = true;
if (scoresShowed){
MochiScores.closeLeaderboard();
scoresShowed = false();
};
}
public function init():void{
menuScreen();
}
public function moveObjects(_arg1:Event):void{
if (!gamePause){
if (!gameOver){
counters();
checkMessages();
moveHero();
moveThings();
} else {
waitTime++;
if (waitTime > 50){
gameOverFunction();
};
};
};
}
public function openDoor():void{
var _local2:uint;
var _local1:uint = (Math.random() * 9);
if (lastDoor == _local1){
openDoor();
} else {
doors[_local1].gotoAndStop(2);
_local2 = ((Math.random() * 3) + 2);
parcels[_local1].gotoAndStop(_local2);
lastDoor = _local1;
targetParcel = _local1;
};
}
public function initGame():void{
var i:uint;
var makeItSnow:Function = function (){
var _local2:SnowFlake;
var _local1:uint;
while (_local1 < 90) {
_local2 = new SnowFlake();
addChild(_local2);
_local2.SetInitialProperties();
snowFlakes.push(_local2);
_local1++;
};
};
addEventListener(Event.ENTER_FRAME, moveObjects);
score = 0;
parcels = [];
doors = [];
bullets = [];
messages = [];
snowFlakes = [];
multiplier = 1;
time = 40;
waitTime = 0;
timeCounter = 0;
multiplierCounter = 0;
freezeCounter = 0;
baddieCounter = 0;
parcelsDelivered = 0;
fireRate = 110;
gameOver = false;
gamePause = false;
frozen = false;
var j:uint;
while (j < 3) {
i = 0;
while (i < 3) {
door = new Door();
door.x = (119 + (i * 201));
door.y = (93 + (j * 155));
bg.addChild(door);
door.stop();
doors.push(door);
parcel = new Parcel();
bg.addChild(parcel);
parcels.push(parcel);
parcel.x = (door.x + 7);
parcel.y = (door.y + 3);
parcel.stop();
parcel.filters = [shadowFilter];
i = (i + 1);
};
j = (j + 1);
};
openDoor();
addScoreHUD();
hero = new Hero();
hero.x = heroX;
hero.y = heroY;
targetDoor = 13;
hero.stop();
hero.frozenState.stop();
hero.filters = [shadowFilter];
addChild(hero);
addChild(badOne);
badOne.gotoAndStop("Hidden");
badOne.filters = [shadowFilter];
if (!mute){
musicChannel = music.play(500, 99);
};
makeItSnow();
}
public function fireBullet():void{
if (frozen){
return;
};
var _local1:Bullet = new Bullet();
var _local2:uint = (Math.random() * 2);
var _local3 = 748;
var _local4:int = (90 + (Math.random() * 360));
var _local5 = -5;
badOne.x = (_local3 + 22);
badOne.y = (_local4 + 55);
badOne.scaleX = 1;
if (_local2 > 0){
_local3 = -48;
_local5 = 5;
_local1.scaleX = -1;
badOne.scaleX = -1;
badOne.x = -60;
};
_local1.x = _local3;
_local1.y = _local4;
_local1.speedX = _local5;
bg.addChild(_local1);
bullets.push(_local1);
badOne.play();
}
function clickPauseBtn(_arg1):void{
if (!gamePause){
gamePause = true;
addChild(gamePausedMsg);
scoreBoard.MultiplierHUD.stop();
musicChannel.stop();
hero.frozenState.stop();
} else {
gamePause = false;
removeChild(gamePausedMsg);
if (scoreBoard.MultiplierHUD.currentFrame > 1){
scoreBoard.MultiplierHUD.Play();
};
if (frozen){
hero.frozenState.play();
};
if (!mute){
musicChannel = music.play(500, 99);
};
};
}
function clickUnMuteBtn(_arg1):void{
mute = false;
musicChannel = music.play(500, 99);
scoreBoard.muteBtn.visible = true;
scoreBoard.unMuteBtn.visible = false;
}
public function dropParcel():void{
tempDoor.gotoAndStop(1);
targetDoor = 13;
var _local1:uint = (parcelScore * multiplier);
score = (score + _local1);
multiplier++;
multiplierCounter = 0;
parcelsDelivered++;
scoreBoard.MultiplierHUD.gotoAndPlay(3);
multiplierCounter = 0;
hero.gotoAndStop(1);
var _local2:BonusScore = new BonusScore();
_local2.x = mouseX;
_local2.y = (mouseY - 50);
_local2.scoreMc.scoreText.text = _local1.toString();
_local2.scoreMc.timeText.text = "+1 Second";
addChild(_local2);
messages.push(_local2);
parcelScore = 0;
if (!mute){
bonusSnd.play(0, 1);
};
fireRate = (fireRate - 2);
if (fireRate < 34){
fireRate = 34;
};
time = (time + 1);
updateScore();
openDoor();
}
function removeNavBar2():void{
navBar2.submitBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickSubmitBtn);
navBar2.playAgainBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickPlayAgainBtn);
navBar2.howToPlay2Btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickHowToPlay2Btn);
navBar2.myHermesBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickMyHermesBtn);
removeChild(navBar2);
navBar2On = false;
}
public function updateScore():void{
scoreBoard.scoreText.text = score.toString();
if (parcelScore < 10){
scoreBoard.bonusText.text = "";
} else {
scoreBoard.bonusText.text = parcelScore.toString();
};
scoreBoard.timeText.text = time.toString();
scoreBoard.multiplierText.text = multiplier.toString();
}
function submitScores():void{
var o:Object = {n:[1, 2, 9, 14, 8, 13, 13, 6, 15, 11, 13, 10, 8, 2, 3, 14], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
var boardID:String = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, score:score, res:"730x450", denyFriends:true, hideDoneButton:true, onClose:function (){
scoresRemoved();
}});
}
function addNavBar2():void{
navBar2 = new NavBar2();
addChild(navBar2);
navBar2.cacheAsBitmap = true;
navBar2.x = 175;
navBar2.y = 362;
navBar2.submitBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickSubmitBtn);
navBar2.playAgainBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickPlayAgainBtn);
navBar2.howToPlay2Btn.addEventListener(MouseEvent.MOUSE_DOWN, clickHowToPlay2Btn);
navBar2.myHermesBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickMyHermesBtn);
navBar2On = true;
}
function clickHowToPlay2Btn(_arg1):void{
bg.removeChild(currentBg[0]);
currentBg.unshift(howToPlayBg);
bg.addChild(currentBg[0]);
addNavBar();
removeNavBar2();
removeChild(overlay);
navBar.howToPlayBtn.visible = false;
navBar.scoresBtn.visible = true;
if (scoresShowed){
MochiScores.closeLeaderboard();
scoresShowed = false;
};
}
public function moveHero():void{
if (!frozen){
hero.x = mouseX;
hero.y = mouseY;
if ((((hero.x > 622)) && ((hero.y < 39)))){
hero.visible = false;
Mouse.show();
} else {
hero.visible = true;
Mouse.hide();
};
if (targetDoor < 13){
tempDoor = doors[targetDoor];
if (((((((hero.hitTestPoint((tempDoor.x + 30), (tempDoor.y + 30), true)) || (hero.hitTestPoint((tempDoor.x + 30), (tempDoor.y + 50), true)))) || (hero.hitTestPoint((tempDoor.x + 20), (tempDoor.y + 40), true)))) || (hero.hitTestPoint((tempDoor.x + 40), (tempDoor.y + 40), true)))){
dropParcel();
};
} else {
tempParcel = parcels[targetParcel];
if (((((((hero.hitTestPoint((tempParcel.x + 10), (tempParcel.y + 30), true)) || (hero.hitTestPoint((tempParcel.x + 10), (tempParcel.y + 60), true)))) || (hero.hitTestPoint((tempParcel.x + 50), (tempParcel.y + 30), true)))) || (hero.hitTestPoint((tempParcel.x + 50), (tempParcel.y + 60), true)))){
hero.gotoAndStop(tempParcel.currentFrame);
tempParcel.gotoAndStop(1);
doors[targetParcel].gotoAndStop(1);
openTarget();
parcelScore = 1000;
};
};
};
}
public function moveThings():void{
var j:uint;
var tempBullet:Bullet;
var i:uint;
while (i < 90) {
snowFlakes[i].MoveSnowFlake();
i = (i + 1);
};
j = 0;
while (j < bullets.length) {
var removeBullets:Function = function ():void{
bg.removeChild(tempBullet);
bullets.splice(j, 1);
};
tempBullet = bullets[j];
tempBullet.x = (tempBullet.x + tempBullet.speedX);
if ((((tempBullet.x < -48)) || ((tempBullet.x > 748)))){
removeBullets();
};
if (((((((hero.hitTestPoint((tempBullet.x + 12), (tempBullet.y + 12), true)) || (hero.hitTestPoint((tempBullet.x + 12), (tempBullet.y - 12), true)))) || (hero.hitTestPoint((tempBullet.x + 12), (tempBullet.y - 12), true)))) || (hero.hitTestPoint((tempBullet.x - 12), (tempBullet.y - 12), true)))){
if (!frozen){
snowHit = new SnowHit();
addChild(snowHit);
snowHit.x = tempBullet.x;
snowHit.y = tempBullet.y;
messages.push(snowHit);
removeBullets();
freezeCounter = 0;
frozen = true;
hero.frozenState.play();
if (!mute){
snowBallHitSnd.play(38, 1);
ohNoSnd.play(0, 1);
};
multiplier = 0;
scoreBoard.MultiplierHUD.gotoAndStop(1);
updateScore();
};
};
j = (j + 1);
};
}
function checkMessages():void{
var _local1:uint;
while (_local1 < messages.length) {
if (messages[_local1].currentFrame > 35){
removeChild(messages[_local1]);
messages.splice(_local1, 1);
};
_local1++;
};
}
function clickSubmitBtn(_arg1):void{
bg.removeChild(currentBg[0]);
currentBg.unshift(scoresBg);
bg.addChild(currentBg[0]);
removeChild(overlay);
removeNavBar2();
addNavBar();
navBar.howToPlayBtn.visible = true;
navBar.scoresBtn.visible = false;
submitScores();
scoresShowed = true;
}
function showScores():void{
var o:Object = {n:[1, 2, 9, 14, 8, 13, 13, 6, 15, 11, 13, 10, 8, 2, 3, 14], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
var boardID:String = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, res:"730x450", denyFriends:true, hideDoneButton:true, onClose:function (){
scoresRemoved();
}});
}
public function openTarget():void{
var _local1:uint = (Math.random() * 9);
if (lastDoor == _local1){
openTarget();
} else {
doors[_local1].gotoAndStop(2);
lastDoor = _local1;
targetDoor = _local1;
};
}
function removeNavBar():void{
navBar.howToPlayBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickHowToPlayBtn);
navBar.playBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickPlayBtn);
navBar.scoresBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickScoresBtn);
navBar.myHermesBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickMyHermesBtn);
navBar.creditsBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickCreditsBtn);
removeChild(navBar);
navBarOn = false;
}
public function clean():void{
removeChild(hero);
removeScoreHUD();
var _local1:uint;
while (_local1 < 9) {
bg.removeChild(parcels[_local1]);
bg.removeChild(doors[_local1]);
_local1++;
};
var _local2:uint;
while (_local2 < bullets.length) {
bg.removeChild(bullets[_local2]);
_local2++;
};
var _local3:uint;
while (_local3 < snowFlakes.length) {
removeChild(snowFlakes[_local3]);
_local3++;
};
var _local4:uint;
while (_local4 < messages.length) {
removeChild(messages[_local4]);
messages.splice(_local4, 1);
_local4++;
};
removeEventListener(Event.ENTER_FRAME, moveObjects);
}
function removeScoreHUD():void{
scoreBoard.pauseBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickPauseBtn);
scoreBoard.muteBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickMuteBtn);
scoreBoard.unMuteBtn.removeEventListener(MouseEvent.MOUSE_DOWN, clickUnMuteBtn);
removeChild(scoreBoard);
}
public function menuScreen():void{
addChild(bg);
currentBg.unshift(menuBg);
bg.addChild(currentBg[0]);
bg.cacheAsBitmap = true;
addNavBar();
}
function clickHowToPlayBtn(_arg1):void{
bg.removeChild(currentBg[0]);
currentBg.unshift(howToPlayBg);
bg.addChild(currentBg[0]);
navBar.howToPlayBtn.visible = false;
navBar.scoresBtn.visible = true;
if (scoresShowed){
MochiScores.closeLeaderboard();
scoresShowed = false;
};
}
function addScoreHUD():void{
scoreBoard = new Score();
scoreBoard.scoreText.text = "0";
scoreBoard.bonusText.text = "";
scoreBoard.timeText.text = time.toString();
scoreBoard.multiplierText.text = multiplier.toString();
scoreBoard.MultiplierHUD.gotoAndStop(1);
addChild(scoreBoard);
scoreBoard.pauseBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickPauseBtn);
scoreBoard.muteBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickMuteBtn);
scoreBoard.unMuteBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickUnMuteBtn);
scoreBoard.unMuteBtn.visible = false;
}
function clickScoresBtn(_arg1):void{
bg.removeChild(currentBg[0]);
currentBg.unshift(scoresBg);
bg.addChild(currentBg[0]);
if (navBar2On){
removeChild(overlay);
removeNavBar2();
addNavBar();
};
navBar.howToPlayBtn.visible = true;
navBar.scoresBtn.visible = false;
showScores();
scoresShowed = true;
}
function clickPlayAgainBtn(_arg1):void{
bg.removeChild(currentBg[0]);
currentBg.unshift(gameBg);
bg.addChild(currentBg[0]);
removeChild(overlay);
removeNavBar2();
if (scoresShowed){
MochiScores.closeLeaderboard();
scoresShowed = false;
};
initGame();
}
function openWindow(_arg1:String, _arg2:String="_blank", _arg3:String=""):void{
if (ExternalInterface.available){
ExternalInterface.call("window.open", _arg1, _arg2, _arg3);
} else {
navigateToURL(new URLRequest(_arg1), _arg2);
};
}
function clickMuteBtn(_arg1):void{
mute = true;
musicChannel.stop();
scoreBoard.muteBtn.visible = false;
scoreBoard.unMuteBtn.visible = true;
}
function clickPlayBtn(_arg1):void{
bg.removeChild(currentBg[0]);
currentBg.unshift(gameBg);
bg.addChild(currentBg[0]);
removeNavBar();
initGame();
if (scoresShowed){
MochiScores.closeLeaderboard();
scoresShowed = false;
};
}
function clickMyHermesBtn(_arg1):void{
var _local2 = "http://www.myHermes.co.uk";
openWindow(_local2);
}
public function gameOverFunction():void{
musicChannel.stop();
Mouse.show();
clean();
addChild(overlay);
overlay.scoreText.text = (("You have scored " + score.toString()) + " Points!");
addNavBar2();
if (!mute){
bravoSnd.play(38, 1);
};
}
function addNavBar():void{
navBar = new NavBar();
addChild(navBar);
navBar.cacheAsBitmap = true;
navBar.x = 175;
navBar.y = 362;
navBar.howToPlayBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickHowToPlayBtn);
navBar.playBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickPlayBtn);
navBar.scoresBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickScoresBtn);
navBar.myHermesBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickMyHermesBtn);
navBar.creditsBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickCreditsBtn);
navBarOn = true;
}
public function counters():void{
var _local1:BonusScore;
timeCounter++;
multiplierCounter++;
freezeCounter++;
baddieCounter++;
if (baddieCounter > fireRate){
baddieCounter = 0;
fireBullet();
};
if (freezeCounter > 95){
if (frozen){
frozen = false;
};
};
if (parcelScore > 0){
parcelScore = (parcelScore - 5);
updateScore();
};
if (multiplierCounter > 73){
scoreBoard.MultiplierHUD.gotoAndStop(1);
multiplierCounter = 0;
if (multiplier > 1){
multiplier--;
scoreBoard.MultiplierHUD.gotoAndPlay(1);
};
updateScore();
};
if (timeCounter > 33){
time--;
timeCounter = 0;
updateScore();
if (time < 1){
gameOver = true;
_local1 = new BonusScore();
_local1.x = 320;
_local1.y = 280;
_local1.scoreMc.scoreText.text = "GAME OVER";
_local1.scaleX = 4;
_local1.scaleY = 4;
addChild(_local1);
_local1.filters = [shadowFilter];
messages.push(_local1);
};
};
}
function scoresRemoved():void{
scoresShowed = false;
}
}
}//package
Section 24
//GameBg (GameBg)
package {
import flash.display.*;
public dynamic class GameBg extends Sprite {
}
}//package
Section 25
//GamePausedMsg (GamePausedMsg)
package {
import flash.display.*;
public dynamic class GamePausedMsg extends Sprite {
}
}//package
Section 26
//Hero (Hero)
package {
import flash.display.*;
public dynamic class Hero extends MovieClip {
public var frozenState:MovieClip;
}
}//package
Section 27
//HowToPlayBg (HowToPlayBg)
package {
import flash.display.*;
public dynamic class HowToPlayBg extends Sprite {
}
}//package
Section 28
//HowToPlayBtn (HowToPlayBtn)
package {
import flash.display.*;
public dynamic class HowToPlayBtn extends SimpleButton {
}
}//package
Section 29
//JingleBells (JingleBells)
package {
import flash.media.*;
public dynamic class JingleBells extends Sound {
}
}//package
Section 30
//MenuBg (MenuBg)
package {
import flash.display.*;
public dynamic class MenuBg extends Sprite {
}
}//package
Section 31
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 32
//MyHermesBtn (MyHermesBtn)
package {
import flash.display.*;
public dynamic class MyHermesBtn extends SimpleButton {
}
}//package
Section 33
//MyHermesGame (MyHermesGame)
package {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.text.*;
public class MyHermesGame extends MovieClip {
public var game:Game;
public var bar_mc:MovieClip;
public var loader_txt:TextField;
public function MyHermesGame():void{
addFrameScript(0, frame1, 2, frame3);
init();
}
public function init():void{
MochiServices.connect("3f1b2f6999093e43", stage);
MochiBot.track(this, "4cf8f859");
loaderInfo.addEventListener(Event.COMPLETE, onCompletelyDownloaded);
loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressMade);
}
public function onProgressMade(_arg1:ProgressEvent):void{
bar_mc.scaleX = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
}
function frame1(){
stop();
}
public function onCompletelyDownloaded(_arg1:Event):void{
var frames:uint;
var testFrame:Function;
var event = _arg1;
testFrame = function ():void{
frames++;
if (frames > 2){
removeEventListener(Event.ENTER_FRAME, testFrame);
game = new Game();
stage.addChild(game);
};
};
play();
addEventListener(Event.ENTER_FRAME, testFrame);
frames = 0;
}
function frame3(){
stop();
}
}
}//package
Section 34
//NavBar (NavBar)
package {
import flash.display.*;
public dynamic class NavBar extends MovieClip {
public var myHermesBtn:MyHermesBtn;
public var creditsBtn:CreditsBtn;
public var playBtn:PlayBtn;
public var scoresBtn:ScoresBtn;
public var howToPlayBtn:HowToPlayBtn;
}
}//package
Section 35
//NavBar2 (NavBar2)
package {
import flash.display.*;
public dynamic class NavBar2 extends MovieClip {
public var playAgainBtn:PlayAgainBtn;
public var submitBtn:SubmitBtn;
public var howToPlay2Btn:HowToPlayBtn;
public var myHermesBtn:MyHermesBtn;
}
}//package
Section 36
//OhNo (OhNo)
package {
import flash.media.*;
public dynamic class OhNo extends Sound {
}
}//package
Section 37
//Overlay (Overlay)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Overlay extends MovieClip {
public var scoreText:TextField;
}
}//package
Section 38
//Parcel (Parcel)
package {
import flash.display.*;
public dynamic class Parcel extends MovieClip {
}
}//package
Section 39
//PauseBtn (PauseBtn)
package {
import flash.display.*;
public dynamic class PauseBtn extends SimpleButton {
}
}//package
Section 40
//PlayAgainBtn (PlayAgainBtn)
package {
import flash.display.*;
public dynamic class PlayAgainBtn extends SimpleButton {
}
}//package
Section 41
//PlayBtn (PlayBtn)
package {
import flash.display.*;
public dynamic class PlayBtn extends SimpleButton {
}
}//package
Section 42
//Score (Score)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Score extends MovieClip {
public var muteBtn:SimpleButton;
public var unMuteBtn:SimpleButton;
public var pauseBtn:PauseBtn;
public var multiplierText:TextField;
public var bonusText:TextField;
public var MultiplierHUD:MovieClip;
public var timeText:TextField;
public var scoreText:TextField;
}
}//package
Section 43
//ScoresBg (ScoresBg)
package {
import flash.display.*;
public dynamic class ScoresBg extends Sprite {
}
}//package
Section 44
//ScoresBtn (ScoresBtn)
package {
import flash.display.*;
public dynamic class ScoresBtn extends SimpleButton {
}
}//package
Section 45
//SnowballHit (SnowballHit)
package {
import flash.media.*;
public dynamic class SnowballHit extends Sound {
}
}//package
Section 46
//SnowFlake (SnowFlake)
package {
import flash.display.*;
public class SnowFlake extends Sprite {
private var maxWidth:Number;// = 0
private var xPos:Number;// = 0
private var scale:Number;// = 0
private var maxHeight:Number;// = 0
private var ySpeed:Number;// = 0
private var xSpeed:Number;// = 0
private var radius:Number;// = 0
private var alphaValue:Number;// = 0
private var yPos:Number;// = 0
public function SnowFlake(){
SetInitialProperties();
}
function MoveSnowFlake():void{
xPos = (xPos + xSpeed);
yPos = (yPos + ySpeed);
this.x = (this.x + (0.15 + (radius * Math.cos(xPos))));
this.y = (this.y + ySpeed);
if (((((((this.y - this.height) > maxHeight)) || ((this.x < -10)))) || ((this.x > maxWidth)))){
this.y = (-10 - this.height);
this.x = (Math.random() * maxWidth);
};
}
public function SetInitialProperties(){
xSpeed = (0.1 + (Math.random() * 0.1));
ySpeed = (0.55 + (Math.random() * 3));
radius = (0.5 + (Math.random() * 1));
scale = (0.5 + (Math.random() * 0.75));
alphaValue = (0.25 + Math.random());
maxWidth = 700;
maxHeight = 500;
this.x = (Math.random() * maxWidth);
this.y = (Math.random() * maxHeight);
xPos = this.x;
yPos = this.y;
this.scaleX = (this.scaleY = scale);
this.alpha = alphaValue;
}
}
}//package
Section 47
//SnowHit (SnowHit)
package {
import flash.display.*;
public dynamic class SnowHit extends MovieClip {
public function SnowHit(){
addFrameScript(35, frame36);
}
function frame36(){
stop();
}
}
}//package
Section 48
//SubmitBtn (SubmitBtn)
package {
import flash.display.*;
public dynamic class SubmitBtn extends SimpleButton {
}
}//package