Section 1
//LineBlink_MC_8 (_3p_fla.LineBlink_MC_8)
package _3p_fla {
import flash.display.*;
public dynamic class LineBlink_MC_8 extends MovieClip {
public function LineBlink_MC_8(){
addFrameScript(23, frame24);
}
function frame24(){
stop();
}
}
}//package _3p_fla
Section 2
//LineMoving_MC_7 (_3p_fla.LineMoving_MC_7)
package _3p_fla {
import flash.display.*;
public dynamic class LineMoving_MC_7 extends MovieClip {
public function LineMoving_MC_7(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
}
}
}//package _3p_fla
Section 3
//mcTimeBonus_23 (_3p_fla.mcTimeBonus_23)
package _3p_fla {
import flash.display.*;
public dynamic class mcTimeBonus_23 extends MovieClip {
public var mc:MovieClip;
public function mcTimeBonus_23(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package _3p_fla
Section 4
//Part1Appearance_MC_4 (_3p_fla.Part1Appearance_MC_4)
package _3p_fla {
import flash.display.*;
public dynamic class Part1Appearance_MC_4 extends MovieClip {
public function Part1Appearance_MC_4(){
addFrameScript(0, frame1, 56, frame57);
}
function frame1(){
stop();
}
function frame57(){
stop();
}
}
}//package _3p_fla
Section 5
//Part2Appearance_MC_15 (_3p_fla.Part2Appearance_MC_15)
package _3p_fla {
import flash.display.*;
public dynamic class Part2Appearance_MC_15 extends MovieClip {
public function Part2Appearance_MC_15(){
addFrameScript(0, frame1, 55, frame56);
}
function frame1(){
stop();
}
function frame56(){
stop();
}
}
}//package _3p_fla
Section 6
//Part3Appearance_MC_17 (_3p_fla.Part3Appearance_MC_17)
package _3p_fla {
import flash.display.*;
public dynamic class Part3Appearance_MC_17 extends MovieClip {
public function Part3Appearance_MC_17(){
addFrameScript(0, frame1, 56, frame57);
}
function frame1(){
stop();
}
function frame57(){
stop();
}
}
}//package _3p_fla
Section 7
//StarBlinking_MC_12 (_3p_fla.StarBlinking_MC_12)
package _3p_fla {
import flash.display.*;
public dynamic class StarBlinking_MC_12 extends MovieClip {
public function StarBlinking_MC_12(){
addFrameScript(23, frame24);
}
function frame24(){
stop();
}
}
}//package _3p_fla
Section 8
//TweenLite (gs.TweenLite)
package gs {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
public class TweenLite {
public var duration:Number;
public var vars:Object;
public var delay:Number;
public var startTime:int;
public var initTime:int;
public var tweens:Array;
public var target:Object;
protected var _active:Boolean;
protected var _subTweens:Array;
protected var _hst:Boolean;
protected var _hasUpdate:Boolean;
protected var _isDisplayObject:Boolean;
protected var _initted:Boolean;
protected var _timeScale:Number;
public static var version:Number = 8.13;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var defaultEase:Function = TweenLite.easeOut;
public static var overwriteManager:Object;
protected static var _all:Dictionary = new Dictionary();
protected static var _curTime:uint;
private static var _classInitted:Boolean;
private static var _sprite:Sprite = new Sprite();
private static var _listening:Boolean;
private static var _timer:Timer = new Timer(2000);
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local5:*;
super();
if (_arg1 == null){
return;
};
if (!_classInitted){
_curTime = getTimer();
_sprite.addEventListener(Event.ENTER_FRAME, executeAll);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_classInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
_timeScale = ((_arg3.timeScale) || (1));
_active = (((_arg2 == 0)) && ((this.delay == 0)));
this.target = _arg1;
_isDisplayObject = (_arg1 is DisplayObject);
if (!(this.vars.ease is Function)){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
this.vars.visible = (this.vars.alpha > 0);
};
this.tweens = [];
_subTweens = [];
_hst = (_initted = false);
this.initTime = _curTime;
this.startTime = (this.initTime + (this.delay * 1000));
var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if ((((_all[_arg1] == undefined)) || (((!((_arg1 == null))) && ((_local4 == 1)))))){
delete _all[_arg1];
_all[_arg1] = new Dictionary(true);
} else {
if ((((_local4 > 1)) && ((this.delay == 0)))){
overwriteManager.manageOverwrites(this, _all[_arg1]);
};
};
_all[_arg1][this] = this;
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (_active))){
initTweenVals();
this.startTime = _curTime;
if (_active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
_local5 = this.vars.visible;
if (this.vars.isTV == true){
_local5 = this.vars.exposedProps.visible;
};
if (((((!((_local5 == null))) && ((this.vars.runBackwards == true)))) && (_isDisplayObject))){
this.target.visible = Boolean(_local5);
};
};
if (((!(_listening)) && (!(_active)))){
_timer.addEventListener("timer", killGarbage);
_timer.start();
_listening = true;
};
}
public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local6:Array;
var _local7:ColorTransform;
var _local8:ColorTransform;
var _local9:Object;
var _local5:Object = this.vars;
if (_local5.isTV == true){
_local5 = _local5.exposedProps;
};
if (((!(_arg1)) && (overwriteManager.enabled))){
overwriteManager.manageOverwrites(this, _all[this.target]);
};
if ((this.target is Array)){
_local6 = ((this.vars.endArray) || ([]));
_local4 = 0;
while (_local4 < _local6.length) {
if (((!((this.target[_local4] == _local6[_local4]))) && (!((this.target[_local4] == undefined))))){
this.tweens[this.tweens.length] = {o:this.target, p:_local4.toString(), s:this.target[_local4], c:(_local6[_local4] - this.target[_local4]), name:_local4.toString()};
};
_local4++;
};
} else {
if (((((!((typeof(_local5.tint) == "undefined"))) || ((this.vars.removeTint == true)))) && (_isDisplayObject))){
_local7 = this.target.transform.colorTransform;
_local8 = new ColorTransform();
if (_local5.alpha != undefined){
_local8.alphaMultiplier = _local5.alpha;
delete _local5.alpha;
} else {
_local8.alphaMultiplier = this.target.alpha;
};
if (((!((this.vars.removeTint == true))) && (((((!((_local5.tint == null))) && (!((_local5.tint == ""))))) || ((_local5.tint == 0)))))){
_local8.color = _local5.tint;
};
addSubTween("tint", tintProxy, {progress:0}, {progress:1}, {target:this.target, color:_local7, endColor:_local8});
};
if (((!((_local5.frame == null))) && (_isDisplayObject))){
addSubTween("frame", frameProxy, {frame:this.target.currentFrame}, {frame:_local5.frame}, {target:this.target});
};
if (((!(isNaN(this.vars.volume))) && (this.target.hasOwnProperty("soundTransform")))){
addSubTween("volume", volumeProxy, this.target.soundTransform, {volume:this.vars.volume}, {target:this.target});
};
for (_local3 in _local5) {
if ((((((((((((((((((((((((((((((((((((((_local3 == "ease")) || ((_local3 == "delay")))) || ((_local3 == "overwrite")))) || ((_local3 == "onComplete")))) || ((_local3 == "onCompleteParams")))) || ((_local3 == "runBackwards")))) || ((_local3 == "visible")))) || ((_local3 == "autoOverwrite")))) || ((_local3 == "persist")))) || ((_local3 == "onUpdate")))) || ((_local3 == "onUpdateParams")))) || ((_local3 == "autoAlpha")))) || ((_local3 == "timeScale")))) || ((_local3 == "onStart")))) || ((_local3 == "onStartParams")))) || ((_local3 == "renderOnStart")))) || ((_local3 == "proxiedEase")))) || ((_local3 == "easeParams")))) || (((_arg1) && (!((_arg2.indexOf(((" " + _local3) + " ")) == -1))))))){
} else {
if (((!(((_isDisplayObject) && ((((((_local3 == "tint")) || ((_local3 == "removeTint")))) || ((_local3 == "frame"))))))) && (!((((_local3 == "volume")) && (this.target.hasOwnProperty("soundTransform"))))))){
if (typeof(_local5[_local3]) == "number"){
this.tweens[this.tweens.length] = {o:this.target, p:_local3, s:this.target[_local3], c:(_local5[_local3] - this.target[_local3]), name:_local3};
} else {
this.tweens[this.tweens.length] = {o:this.target, p:_local3, s:this.target[_local3], c:Number(_local5[_local3]), name:_local3};
};
};
};
};
};
if (this.vars.runBackwards == true){
_local4 = (this.tweens.length - 1);
while (_local4 > -1) {
_local9 = this.tweens[_local4];
this.tweens[_local4].s = (_local9.s + _local9.c);
_local9.c = (_local9.c * -1);
_local4--;
};
};
if ((((_local5.visible == true)) && (_isDisplayObject))){
this.target.visible = true;
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
_initted = true;
}
protected function addSubTween(_arg1:String, _arg2:Function, _arg3:Object, _arg4:Object, _arg5:Object=null):void{
var _local7:String;
var _local6:Object = {name:_arg1, proxy:_arg2, target:_arg3, info:_arg5};
_subTweens[_subTweens.length] = _local6;
for (_local7 in _arg4) {
if (typeof(_arg4[_local7]) == "number"){
this.tweens[this.tweens.length] = {o:_arg3, p:_local7, s:_arg3[_local7], c:(_arg4[_local7] - _arg3[_local7]), sub:_local6, name:_arg1};
} else {
this.tweens[this.tweens.length] = {o:_arg3, p:_local7, s:_arg3[_local7], c:Number(_arg4[_local7]), sub:_local6, name:_arg1};
};
};
_hst = true;
}
public function render(_arg1:uint):void{
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local2:Number = ((_arg1 - this.startTime) / 1000);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = 1;
} else {
_local3 = this.vars.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.o[_local4.p] = (_local4.s + (_local3 * _local4.c));
_local5--;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5]);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function complete(_arg1:Boolean=false):void{
if (!_arg1){
if (!_initted){
initTweenVals();
};
this.startTime = (_curTime - ((this.duration * 1000) / _timeScale));
render(_curTime);
return;
};
if (((!((this.vars.visible == undefined))) && (_isDisplayObject))){
if (((!(isNaN(this.vars.autoAlpha))) && ((this.target.alpha == 0)))){
this.target.visible = false;
} else {
if (this.vars.runBackwards != true){
this.target.visible = this.vars.visible;
};
};
};
if (this.vars.persist != true){
removeTween(this);
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, []);
};
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function get active():Boolean{
if (_active){
return (true);
};
if (((_curTime - this.initTime) / 1000) > this.delay){
_active = true;
if (!_initted){
initTweenVals();
} else {
if (((!((this.vars.visible == undefined))) && (_isDisplayObject))){
this.target.visible = true;
};
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
return (true);
//unresolved jump
};
return (false);
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function executeAll(_arg1:Event=null):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:Object;
var _local2:uint = (_curTime = getTimer());
if (_listening){
_local3 = _all;
for each (_local4 in _local3) {
for (_local5 in _local4) {
if (((!((_local4[_local5] == undefined))) && (_local4[_local5].active))){
_local4[_local5].render(_local2);
};
};
};
};
}
public static function removeTween(_arg1:TweenLite=null):void{
if (((!((_arg1 == null))) && (!((_all[_arg1.target] == undefined))))){
_all[_arg1.target][_arg1] = null;
delete _all[_arg1.target][_arg1];
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Object;
var _local4:*;
if (((!((_arg1 == null))) && (!((_all[_arg1] == undefined))))){
if (_arg2){
_local3 = _all[_arg1];
for (_local4 in _local3) {
_local3[_local4].complete(false);
};
};
delete _all[_arg1];
};
}
public static function killGarbage(_arg1:TimerEvent):void{
var _local3:Boolean;
var _local4:Object;
var _local5:Object;
var _local6:Object;
var _local2:uint;
for (_local4 in _all) {
_local3 = false;
for (_local5 in _all[_local4]) {
_local3 = true;
break;
};
if (!_local3){
delete _all[_local4];
} else {
_local2++;
};
};
if (_local2 == 0){
_timer.removeEventListener("timer", killGarbage);
_timer.stop();
_listening = false;
};
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function tintProxy(_arg1:Object):void{
var _local2:Number = _arg1.target.progress;
var _local3:Number = (1 - _local2);
var _local4:Object = _arg1.info.color;
var _local5:Object = _arg1.info.endColor;
_arg1.info.target.transform.colorTransform = new ColorTransform(((_local4.redMultiplier * _local3) + (_local5.redMultiplier * _local2)), ((_local4.greenMultiplier * _local3) + (_local5.greenMultiplier * _local2)), ((_local4.blueMultiplier * _local3) + (_local5.blueMultiplier * _local2)), ((_local4.alphaMultiplier * _local3) + (_local5.alphaMultiplier * _local2)), ((_local4.redOffset * _local3) + (_local5.redOffset * _local2)), ((_local4.greenOffset * _local3) + (_local5.greenOffset * _local2)), ((_local4.blueOffset * _local3) + (_local5.blueOffset * _local2)), ((_local4.alphaOffset * _local3) + (_local5.alphaOffset * _local2)));
}
public static function frameProxy(_arg1:Object):void{
_arg1.info.target.gotoAndStop(Math.round(_arg1.target.frame));
}
public static function volumeProxy(_arg1:Object):void{
_arg1.info.target.soundTransform = _arg1.target;
}
}
}//package gs
Section 9
//MochiAd (mochi.MochiAd)
package mochi {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.7");
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var mc = _arg1;
var f:Function = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function showPreGameAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var complete:Boolean;
var unloaded:Boolean;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
var fn:Function = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
var bar_color:Number = options.color;
delete options.color;
var bar_background:Number = options.background;
delete options.background;
var bar_outline:Number = options.outline;
delete options.outline;
var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1);
var backing:Object = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2);
var inside:Object = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3);
var outline:Object = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
var f:Function = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
var _local1:Object = this.parent.parent.root;
var _local2:Object = this.parent._mochiad_ctr;
var _local3:Number = (getTimer() - this.started);
var _local4:Boolean;
var _local5:Number = _local1.loaderInfo.bytesTotal;
var _local6:Number = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
var _local7:Number = ((100 * _local6) / _local5);
var _local8:Number = ((100 * _local3) / chk.ad_msec);
var _local9:Object = this._mochiad_bar._inside;
var _local10:Number = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showClickAwayAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
var sendHostProgress:Boolean;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function showInterLevelAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var clip:Object;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
var depth:Number = options.depth;
delete options.depth;
var mc:MovieClip = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
var lv:URLVariables = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function _cleanup(_arg1:Object):void{
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
var idx:Number = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local6:Array;
var _local3:Object = _arg2.getBounds(_arg2.root);
var _local4:Number = 0;
var _local5:Number = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array = _arg2.split(".");
var _local5:Number = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array = _arg2.split(".");
var _local4:Number = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array = _arg2.split(".");
var _local5:Number = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
}
}//package mochi
Section 10
//MochiScores (mochi.MochiScores)
package mochi {
import flash.display.*;
import flash.text.*;
public class MochiScores {
public static var onCloseHandler:Object;
public static var onErrorHandler:Object;
private static var boardID:String;
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});
}
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 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 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);
}
}
}//package mochi
Section 11
//MochiServices (mochi.MochiServices)
package mochi {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class MochiServices {
private static var _id:String;
private static var _container:Object;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _timer:Timer;
private static var _startTime:Number;
private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
private static var _swfVersion:String;
private static var _listenChannel:LocalConnection;
private static var _listenChannelName:String = "__mochiservices";
private static var _sendChannel:LocalConnection;
private static var _sendChannelName:String;
private static var _rcvChannel:LocalConnection;
private static var _rcvChannelName:String;
private static var _connecting:Boolean = false;
private static var _connected:Boolean = false;
public static var onError:Object;
public static function get id():String{
return (_id);
}
public static function get clip():Object{
return (_container);
}
public static function get childClip():Object{
return (_clip);
}
public static function getVersion():String{
return ("1.35");
}
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 isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
_rcvChannelName = _arg1;
initComChannels();
};
};
}
public static function get connected():Boolean{
return (_connected);
}
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 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 createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
var mc:MovieClip = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_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);
};
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
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 loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var id = _arg1;
var clip = _arg2;
var clipname:String = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
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();
var f:Function = 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);
var req:URLRequest = 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 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();
};
}
private static function onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
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 initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_rcvChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = this.client._callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
_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 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 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) {
};
};
};
};
}
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 addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var netup:Boolean;
var s:String;
var x:String;
var req:URLRequest;
var loader:Loader;
var err:Function;
var complete:Function;
var setURL: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);
s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
complete = function (_arg1:Object):void{
netup = true;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
setURL = function ():void{
var _local1:String;
if (netup){
_local1 = (url + s);
} else {
_local1 = burl;
};
var _local2:DisplayObject = clickMovie(_local1, onClick);
btn.addChild(_local2);
_local2.scaleX = (0.01 * btn.width);
_local2.scaleY = (0.01 * btn.height);
};
setTimeout(setURL, 1500);
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().getTime()));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
}
}//package mochi
Section 12
//AllPilesRemoved (AllPilesRemoved)
package {
import flash.media.*;
public dynamic class AllPilesRemoved extends Sound {
}
}//package
Section 13
//BackGround (BackGround)
package {
import flash.display.*;
import flash.text.*;
public class BackGround extends MovieClip {
public var tfScore:TextField;
public var tfCardRun:TextField;
public var tfRoundNumber:TextField;
public var lastScore:int;
public var lastRun:String;
public var mcSound:SoundButton;
public var mcTimer:TimerClass;
public var mcPointsEffect:MovieClip;
public var castle_mc:MovieClip;
public var tfPointsEffect:TextField;
public var btPause:SimpleButton;
public var _sbtTakePoints:SimpleButton;
public function BackGround(){
score = 0;
if (Game.GAME != undefined){
mcTimer.onInitialize(Game.GAME);
mcTimer.setEndFunction(Game.GAME.timeOut);
};
var _local1:DisplayObjectContainer = (mcPointsEffect.getChildAt(0) as DisplayObjectContainer);
tfPointsEffect = (_local1.getChildAt(0) as TextField);
invisibleCastle();
}
public function invisibleCastle():void{
castle_mc.castle_left.visible = false;
castle_mc.castle_center.visible = false;
castle_mc.castle_right.visible = false;
_sbtTakePoints.visible = false;
}
public function set score(_arg1:int):void{
if (tfPointsEffect != null){
tfPointsEffect.text = String((_arg1 - score));
};
lastScore = int(tfScore.text);
tfScore.text = String(_arg1);
if (_arg1 != 0){
mcPointsEffect.gotoAndPlay(1);
};
}
public function get score():int{
return (int(tfScore.text));
}
public function addRunCount(_arg1:int):void{
var _local2:int;
if (_arg1 < 0){
_local2 = 0;
} else {
_local2 = (int(tfCardRun.text) + _arg1);
};
lastRun = tfCardRun.text;
tfCardRun.text = String(_local2);
}
public function returnScore():void{
tfScore.text = String(lastScore);
tfCardRun.text = lastRun;
tfPointsEffect.text = String((lastScore - score));
if (tfPointsEffect.text != "0"){
mcPointsEffect.gotoAndPlay(1);
};
}
}
}//package
Section 14
//btnMenu (btnMenu)
package {
import flash.display.*;
public class btnMenu extends SimpleButton {
public function btnMenu(_arg1:DisplayObject=null, _arg2:DisplayObject=null, _arg3:DisplayObject=null, _arg4:DisplayObject=null){
super(_arg1, _arg2, _arg3, _arg4);
}
}
}//package
Section 15
//BtnSponsorBanner (BtnSponsorBanner)
package {
import flash.display.*;
public dynamic class BtnSponsorBanner extends SimpleButton {
}
}//package
Section 16
//btnUndo (btnUndo)
package {
import flash.display.*;
public class btnUndo extends SimpleButton {
public function btnUndo(_arg1:DisplayObject=null, _arg2:DisplayObject=null, _arg3:DisplayObject=null, _arg4:DisplayObject=null){
super(_arg1, _arg2, _arg3, _arg4);
}
}
}//package
Section 17
//ButtonClick (ButtonClick)
package {
import flash.media.*;
public dynamic class ButtonClick extends Sound {
}
}//package
Section 18
//c1 (c1)
package {
import flash.display.*;
public dynamic class c1 extends MovieClip {
public function c1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 19
//c10 (c10)
package {
import flash.display.*;
public dynamic class c10 extends MovieClip {
public function c10(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 20
//c11 (c11)
package {
import flash.display.*;
public dynamic class c11 extends MovieClip {
}
}//package
Section 21
//c12 (c12)
package {
import flash.display.*;
public dynamic class c12 extends MovieClip {
}
}//package
Section 22
//c13 (c13)
package {
import flash.display.*;
public dynamic class c13 extends MovieClip {
}
}//package
Section 23
//c2 (c2)
package {
import flash.display.*;
public dynamic class c2 extends MovieClip {
public function c2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 24
//c3 (c3)
package {
import flash.display.*;
public dynamic class c3 extends MovieClip {
public function c3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 25
//c4 (c4)
package {
import flash.display.*;
public dynamic class c4 extends MovieClip {
public function c4(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 26
//c5 (c5)
package {
import flash.display.*;
public dynamic class c5 extends MovieClip {
public function c5(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 27
//c6 (c6)
package {
import flash.display.*;
public dynamic class c6 extends MovieClip {
public function c6(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 28
//c7 (c7)
package {
import flash.display.*;
public dynamic class c7 extends MovieClip {
public function c7(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 29
//c8 (c8)
package {
import flash.display.*;
public dynamic class c8 extends MovieClip {
public function c8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 30
//c9 (c9)
package {
import flash.display.*;
public dynamic class c9 extends MovieClip {
public function c9(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 31
//Card (Card)
package {
import flash.display.*;
import flash.events.*;
import gs.*;
import flash.utils.*;
import flash.filters.*;
public class Card extends Sprite {
public var placement:String;
public var placementOld:String;
public var placementIndexOld:int;
public var depth:int;
public var depthOld:int;
public var value:int;// = 0
public var posX:int;
public var posY:int;
public var posOldX:int;
public var posOldY:int;
public var step:int;
public var numRunCnt:Number;
public var topPyramid:Boolean;
public var active:Boolean;
public var back:Boolean;
public var isWildCard:Boolean;// = false
public var colour:String;
public var _c:DisplayObject;
public var _b:CardBack;
public var numFilter:Number;// = 0
public static var cardHolder:CardHolder;
public function Card(_arg1:String){
var _local2:Class = (getDefinitionByName(_arg1) as Class);
_c = addChild(new (_local2));
_b = new CardBack();
this.addChild(_c);
this.addChild(_b);
_c["numFilter"] = 4;
name = _arg1;
buttonMode = true;
_b.mcBugless.addEventListener(MouseEvent.CLICK, releaseCard);
_b.mcBugless.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
_b.mcBugless.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
private function onMouseOver(_arg1:MouseEvent):void{
if (active == false){
return;
};
if (((!(cardHolder.checkValid(this, cardHolder.arrPack[(cardHolder.arrPack.length - 1)]))) && (!((placement == "drawpile"))))){
return;
};
TweenLite.to(_c, 0.15, {numFilter:1, onUpdate:onUpdateTween});
}
private function onMouseOut(_arg1:MouseEvent):void{
if (active == false){
return;
};
if (((!(cardHolder.checkValid(this, cardHolder.arrPack[(cardHolder.arrPack.length - 1)]))) && (!((placement == "drawpile"))))){
return;
};
TweenLite.to(_c, 0.3, {numFilter:0, onUpdate:onUpdateTween});
}
private function onUpdateTween():void{
if (active == false){
return;
};
this.filters = [new GlowFilter((3355647 * int(active)), _c["numFilter"], 6, 6, (int(active) + 1))];
}
public function get _width():Number{
return (_c.width);
}
public function get _height():Number{
return (_c.height);
}
private function releaseCard(_arg1):void{
var _local2:int;
var _local3:int;
if (cardHolder.arrPyramid.length == 0){
return;
};
if (!active){
SoundController.sndUnAccessibleCard.play();
return;
};
if (isWildCard){
cardHolder.packingCard(this);
SoundController.sndWildCard.play();
};
if (((back) && ((placement == "drawpile")))){
turnCard();
Game.GAME._mcBG.addRunCount(-1);
cardHolder.packingCard(this);
cardHolder.arrDraw.splice((cardHolder.arrDraw.length - 1), 1);
if (cardHolder.arrDraw.length > 0){
cardHolder.arrDraw[(cardHolder.arrDraw.length - 1)].active = true;
};
numRunCnt = 0;
SoundController.sndCardClick.play();
} else {
if (((!(back)) && ((placement == "pyramid")))){
if (cardHolder.checkValid(this, cardHolder.arrPack[(cardHolder.arrPack.length - 1)])){
numRunCnt++;
if (topPyramid){
};
SoundController.sndCardClick.play();
cardHolder.packingCard(this);
Game.GAME._mcBG.addRunCount(1);
_local2 = (cardHolder.arrPyramid.length - 1);
while (_local2 >= 0) {
if (this == cardHolder.arrPyramid[_local2]){
cardHolder.arrPyramid.splice(_local2, 1);
this.placementIndexOld = _local2;
break;
};
_local2--;
};
_local3 = (int(Game.GAME._mcBG.tfCardRun.text) * 200);
if (topPyramid){
_local3 = (_local3 + 10000);
if (this.x < 230){
Game.GAME._mcBG.castle_mc.castle_left.visible = true;
Game.GAME._mcBG.castle_mc.castle_left.gotoAndPlay(2);
SoundController.sndAllPilesRemoved.play();
if (cardHolder.arrPyramid.length == 0){
cardHolder.mcToCheckAnimation = Game.GAME._mcBG.castle_mc.castle_left;
};
} else {
if (this.x > 400){
Game.GAME._mcBG.castle_mc.castle_right.visible = true;
Game.GAME._mcBG.castle_mc.castle_right.gotoAndPlay(2);
SoundController.sndAllPilesRemoved.play();
if (cardHolder.arrPyramid.length == 0){
cardHolder.mcToCheckAnimation = Game.GAME._mcBG.castle_mc.castle_right;
};
} else {
Game.GAME._mcBG.castle_mc.castle_center.visible = true;
Game.GAME._mcBG.castle_mc.castle_center.gotoAndPlay(2);
SoundController.sndAllPilesRemoved.play();
if (cardHolder.arrPyramid.length == 0){
cardHolder.mcToCheckAnimation = Game.GAME._mcBG.castle_mc.castle_center;
};
};
};
if (cardHolder.arrPyramid.length == 0){
Game.GAME._mcTimer.stopTimer();
};
};
Game.GAME._mcBG.score = (Game.GAME._mcBG.score + _local3);
cardHolder.checkActiveCards();
};
};
};
}
public function gotoStack():void{
TweenLite.to(this, 0.3, {x:CardHolder.numDrawX, y:CardHolder.numDrawY, onComplete:onReachedPlace});
}
public function goBack():void{
TweenLite.to(this, 0.3, {x:this.posX, y:this.posY, onComplete:onReturned});
}
private function onReachedPlace():void{
cardHolder.checkNextStep();
this.filters = [];
}
private function onReturned():void{
this.depth = this.depthOld;
if (!isWildCard){
cardHolder.mcCardHolder.setChildIndex(this, this.depth);
};
cardHolder.checkActiveCards();
if (this.placement == "drawpile"){
turnCard();
};
}
public function turnCard(_arg1:Boolean=true):void{
if (_arg1 == false){
_b.alpha = 1;
_c.alpha = 0;
back = true;
return;
};
if (back){
if ((((placement == "pyramid")) && ((cardHolder.disable == false)))){
SoundController.sndTurnCard.play();
};
_c.alpha = 1;
_b.alpha = 0;
} else {
_c.alpha = 0;
_b.alpha = 1;
};
back = !(back);
}
public function removeMe():void{
}
}
}//package
Section 32
//CardBack (CardBack)
package {
import flash.display.*;
public class CardBack extends MovieClip {
public var mcBugless:Sprite;
}
}//package
Section 33
//CardClick (CardClick)
package {
import flash.media.*;
public dynamic class CardClick extends Sound {
}
}//package
Section 34
//CardHolder (CardHolder)
package {
import flash.display.*;
import flash.events.*;
import gs.*;
import flash.utils.*;
public class CardHolder {
private var _Game:Game;
public var arrSuit:Array;
public var arrDraw:Array;
public var arrCards:Array;
public var arrPack:Array;
public var arrPyramid:Array;
public var arrMove:Array;
public var mcCardHolder:Sprite;
private var lastCard:Card;
private var lastDroped:Number;// = 0
private var numCardHeight:int;// = 85
private var numCardWidth:int;// = 60
private var numPyramidX:Number;
private var numPyramidY:Number;
private var numPyramidXShift:Number;
private var numPyramidYShift:Number;
private var numDrawCloseShift:Number;// = 12
private var numDrawOpenShift:Number;// = 0
public var wildCard:Card;
public var disable:Boolean;// = true
public var mcToCheckAnimation:MovieClip;
public static var numDrawX:int = 400;
public static var numDrawY:int = 370;
public function CardHolder(_arg1:Sprite, _arg2:Game){
arrSuit = new Array("c", "d", "h", "s");
arrDraw = new Array();
arrCards = new Array();
arrPack = new Array();
arrPyramid = new Array();
arrMove = new Array();
numPyramidX = (5 + (numCardWidth / 2));
numPyramidY = (25 + (numCardHeight / 2));
numPyramidXShift = (numCardWidth - 2);
numPyramidYShift = (numCardHeight / 2);
super();
_Game = _arg2;
mcToCheckAnimation = null;
mcCardHolder = _arg1;
Card.cardHolder = this;
numPyramidX = (11 + (numCardWidth / 2));
numPyramidY = (105 + (numCardHeight / 2));
numPyramidXShift = (numCardWidth + 2);
numPyramidYShift = ((numCardHeight / 2) + 1);
createDeck();
shuffleDeck();
arrangeCards();
spreadCard();
}
private function spreadCard():void{
mcCardHolder.addEventListener(Event.ENTER_FRAME, dropCard);
SoundController.sndNewDeal.play();
disable = true;
trace("set disable");
}
private function dropCard(_arg1):void{
if (lastDroped == Math.floor(lastDroped)){
arrCards[lastDroped].visible = true;
mcCardHolder.setChildIndex(arrCards[lastDroped], lastDroped);
if (lastDroped < 51){
TweenLite.from(arrCards[lastDroped], 0.4, {rotation:(Math.random() * 360), x:-100, y:-100});
} else {
TweenLite.from(arrCards[lastDroped], 0.4, {rotation:(Math.random() * 360), x:-100, y:-100, onComplete:activateAllElements});
};
};
lastDroped = (lastDroped + 1);
if (lastDroped >= 52){
mcCardHolder.removeEventListener(Event.ENTER_FRAME, dropCard);
addWildCard();
};
}
private function activateAllElements():void{
_Game._mcTimer.startNewCountDown(_Game._nRoundTime);
_Game.enableMenu(true);
_Game.showNextCardMC(true);
disable = false;
}
private function createDeck():void{
var _local4:int;
var _local5:Card;
var _local1:int;
var _local2 = "";
lastDroped = 0;
var _local3 = 1;
while (_local3 <= 13) {
_local4 = 0;
while (_local4 < arrSuit.length) {
_local2 = (arrSuit[_local4] + _local3);
if (!Game.isPlayAgain){
_local5 = new Card(_local2);
mcCardHolder.addChild(_local5);
arrCards[_local1] = _local5;
} else {
_local5 = (arrCards[_local1] as Card);
};
_local5.colour = ((((arrSuit[_local4] == "d")) || ((arrSuit[_local4] == "h")))) ? "red" : "black";
if (!Game.isPlayAgain){
_local5.value = _local3;
};
_local5.active = false;
_local5.topPyramid = false;
_local5.depth = 0;
_local5.placement = "pack";
_local5.x = numDrawX;
_local5.y = numDrawY;
_local5.posX = numDrawX;
_local5.posY = numDrawY;
_local5.step = 0;
_local5.back = true;
_local5.visible = false;
_local1++;
_local4++;
};
_local3++;
};
}
private function addWildCard():void{
if (!Game.isPlayAgain){
wildCard = new Card("WildCard");
};
wildCard.isWildCard = true;
mcCardHolder.addChild(wildCard);
wildCard.value = 0;
wildCard.active = true;
wildCard.topPyramid = false;
wildCard.depth = 0;
wildCard.placement = "pack";
wildCard.x = 600;
wildCard.y = numDrawY;
wildCard.step = 0;
wildCard.back = false;
wildCard._b.alpha = 0;
}
private function arrangeCards():void{
var _local6:Card;
var _local7:int;
var _local8:Card;
disable = true;
var _local1:int;
while (_local1 < 23) {
_local6 = arrCards[_local1];
_local6.posX = (((numDrawX - 10) - numCardWidth) - ((23 - _local1) * numDrawCloseShift));
_local6.posY = numDrawY;
_local6.placement = "drawpile";
_local6.x = _local6.posX;
_local6.y = _local6.posY;
arrDraw[_local1] = arrCards[_local1];
_local1++;
};
arrDraw[22].active = true;
arrCards[23].active = true;
arrCards[23].posX = numDrawX;
arrCards[23].posY = numDrawY;
arrCards[23].placement = "pack";
arrCards[23].turnCard();
arrCards[23].x = arrCards[23].posX;
arrCards[23].y = arrCards[23].posY;
arrCards[23].depth = 100;
arrPack[0] = arrCards[23];
var _local2 = 24;
var _local3:int;
var _local4:int;
var _local5:int;
while (_local5 < 4) {
_local3 = (numPyramidX + (((3 - _local5) * numPyramidXShift) / 2));
_local7 = 0;
while (_local7 < ((_local5 * 3) + 3)) {
_local8 = arrCards[_local2];
_local8.posX = ((_local7)==0) ? _local3 : (arrCards[(_local2 - 1)].posX + numPyramidXShift);
if (_local5 == 0){
arrCards[_local2].posX = (arrCards[_local2].posX + ((_local7)>0) ? (2 * numPyramidXShift) : 0);
arrCards[_local2].topPyramid = true;
} else {
if (_local5 == 1){
arrCards[_local2].posX = (arrCards[_local2].posX + ((((_local7 > 0)) && (((_local7 % 2) == 0)))) ? numPyramidXShift : 0);
};
};
arrCards[_local2].posY = ((_local7)==0) ? (numPyramidY + Math.round((_local5 * numPyramidYShift))) : arrCards[(_local2 - 1)].posY;
arrCards[_local2].placement = "pyramid";
if (_local5 == 3){
arrCards[_local2].turnCard();
arrCards[_local2].active = true;
};
arrCards[_local2].x = arrCards[_local2].posX;
arrCards[_local2].y = arrCards[_local2].posY;
arrPyramid[_local4] = arrCards[_local2];
_local4++;
var _temp1 = _local2;
_local2 = (_local2 + 1);
if (_temp1 >= (arrCards.length - 1)){
break;
};
_local7++;
};
_local5++;
};
}
private function shuffleDeck():void{
var _local1:Card;
var _local2:int;
Utils.numRandomSeed = Math.floor((Math.random() * 200));
var _local3:int;
while (_local3 < arrCards.length) {
_local1 = arrCards[_local3];
_local2 = Utils.getRandomValue(arrCards.length);
arrCards[_local3] = arrCards[_local2];
arrCards[_local2] = _local1;
arrCards[_local3].depth = _local3;
mcCardHolder.swapChildren(arrCards[_local3], arrCards[_local2]);
arrCards[_local2].depth = _local2;
_local3++;
};
}
public function checkActiveCards(_arg1:MovieClip=null):void{
var _local2:Boolean;
var _local4:int;
var _local3:int = (arrPyramid.length - 1);
while (_local3 >= 0) {
_local2 = false;
_local4 = (arrPyramid.length - 1);
while (_local4 >= 0) {
if (((!((_local3 == _local4))) && (arrPyramid[_local3]._b.mcBugless.hitTestObject(arrPyramid[_local4]._b.mcBugless)))){
if ((((arrPyramid[_local4].depth > arrPyramid[_local3].depth)) && ((arrPyramid[_local4].depth < 100)))){
_local2 = true;
break;
};
};
_local4--;
};
if (((!(_local2)) && (!(arrPyramid[_local3].active)))){
arrPyramid[_local3].active = true;
arrPyramid[_local3].turnCard();
} else {
if (((_local2) && (arrPyramid[_local3].active))){
arrPyramid[_local3].active = false;
arrPyramid[_local3].turnCard();
};
};
_local3--;
};
}
public function checkNextStep():void{
if (arrDraw.length == 0){
_Game._mcBG._sbtTakePoints.visible = true;
_Game.showNextCardMC(false);
};
if (arrPyramid.length > 0){
return;
};
if (arrPyramid.length == 0){
_Game.enableUndo(false);
_Game.enableMenu(false);
mcToCheckAnimation.addEventListener(Event.ENTER_FRAME, checkCastleAnimation);
return;
};
}
private function checkCastleAnimation(_arg1:Event):void{
if (mcToCheckAnimation.currentFrame == mcToCheckAnimation.totalFrames){
mcToCheckAnimation.removeEventListener(Event.ENTER_FRAME, checkCastleAnimation);
setTimeout(delayShowNextPanel, 1000);
};
}
private function delayShowNextPanel():void{
_Game.showNewRoundPanel();
}
public function checkValid(_arg1:Card, _arg2:Card):Boolean{
if (((_arg1.isWildCard) || (_arg2.isWildCard))){
return (true);
};
if ((((Math.abs((_arg1.value - _arg2.value)) == 1)) || ((Math.abs((_arg1.value - _arg2.value)) == 12)))){
return (true);
};
return (false);
}
public function packingCard(_arg1:Card):void{
if (arrPyramid.length == 0){
_Game.enableUndo(false);
_Game.enableMenu(false);
return;
};
lastCard = _arg1;
lastCard.posOldX = _arg1.x;
lastCard.posOldY = _arg1.y;
lastCard.placementOld = _arg1.placement;
lastCard.depthOld = _arg1.depth;
_arg1.posY = numDrawY;
_arg1.posX = (numDrawX - (arrPack.length * numDrawOpenShift));
arrPack[(arrPack.length - 1)].active = false;
arrPack.push(_arg1);
if (_arg1.placement == "drawpile"){
moveDrawPile(1);
};
_arg1.placement = "pack";
var _local2:int;
while (_local2 < (arrPack.length - 3)) {
arrPack[_local2].y = 1000;
_local2++;
};
arrPack[(arrPack.length - 1)].depth = (arrPack[(arrPack.length - 2)].depth + 1);
mcCardHolder.setChildIndex(arrPack[(arrPack.length - 1)], (mcCardHolder.numChildren - 1));
arrMove.push(_arg1);
_arg1.gotoStack();
_Game.enableUndo(true);
}
public function returningCard():void{
lastCard.posY = lastCard.posOldY;
lastCard.posX = (lastCard.posOldX - (arrPack.length * numDrawOpenShift));
arrPack.pop();
if (lastCard.placementOld == "drawpile"){
moveDrawPile(-1);
if (arrDraw.length > 0){
arrDraw[(arrDraw.length - 1)].active = false;
};
arrDraw.push(lastCard);
arrDraw[(arrDraw.length - 1)].active = true;
if (arrDraw.length == 1){
_Game._mcBG._sbtTakePoints.visible = false;
_Game.showNextCardMC(true);
};
};
if (lastCard.placementOld == "pyramid"){
arrPyramid.splice(lastCard.placementIndexOld, 0, lastCard);
};
lastCard.placement = lastCard.placementOld;
arrMove.push(lastCard);
if (!lastCard.isWildCard){
_Game._mcBG.returnScore();
};
lastCard.goBack();
_Game.enableUndo(false);
}
private function moveDrawPile(_arg1:int):void{
var _local2:int;
while (_local2 < arrDraw.length) {
arrDraw[_local2].x = (arrDraw[_local2].x + (12 * _arg1));
_local2++;
};
}
public function removeCards():void{
trace(arrCards.length);
var _local1:int;
while (_local1 < arrCards.length) {
arrCards[_local1].x = -200;
_local1++;
};
}
public function playAgain():void{
Game.isPlayAgain = true;
mcCardHolder.removeEventListener(Event.ENTER_FRAME, dropCard);
lastCard = null;
_Game.enableUndo(false);
_Game.enableMenu(false);
arrPack.splice(0);
arrPack = new Array();
mcToCheckAnimation = null;
createDeck();
wildCard.x = 1000;
var _local1:int;
while (_local1 < arrCards.length) {
arrCards[_local1].turnCard(false);
arrCards[_local1]._c["numFilter"] = 4;
arrCards[_local1].numFilter = 0;
arrCards[_local1].depth = _local1;
_local1++;
};
shuffleDeck();
arrangeCards();
spreadCard();
}
}
}//package
Section 35
//d1 (d1)
package {
import flash.display.*;
public dynamic class d1 extends MovieClip {
public function d1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 36
//d10 (d10)
package {
import flash.display.*;
public dynamic class d10 extends MovieClip {
public function d10(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 37
//d11 (d11)
package {
import flash.display.*;
public dynamic class d11 extends MovieClip {
}
}//package
Section 38
//d12 (d12)
package {
import flash.display.*;
public dynamic class d12 extends MovieClip {
public function d12(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 39
//d13 (d13)
package {
import flash.display.*;
public dynamic class d13 extends MovieClip {
public function d13(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 40
//d2 (d2)
package {
import flash.display.*;
public dynamic class d2 extends MovieClip {
public function d2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 41
//d3 (d3)
package {
import flash.display.*;
public dynamic class d3 extends MovieClip {
public function d3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 42
//d4 (d4)
package {
import flash.display.*;
public dynamic class d4 extends MovieClip {
public function d4(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 43
//d5 (d5)
package {
import flash.display.*;
public dynamic class d5 extends MovieClip {
public function d5(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 44
//d6 (d6)
package {
import flash.display.*;
public dynamic class d6 extends MovieClip {
public function d6(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 45
//d7 (d7)
package {
import flash.display.*;
public dynamic class d7 extends MovieClip {
public function d7(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 46
//d8 (d8)
package {
import flash.display.*;
public dynamic class d8 extends MovieClip {
public function d8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 47
//d9 (d9)
package {
import flash.display.*;
public dynamic class d9 extends MovieClip {
public function d9(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 48
//Game (Game)
package {
import flash.display.*;
import flash.events.*;
import mochi.*;
public class Game {
private var _root:MovieClip;
private var _mcCardContainer:Sprite;
private var _cardHolder:CardHolder;
public var _mcTimer:TimerClass;
public var _mcBG:BackGround;
private var _mcMenu:Menu;
private var _mcNextPanel:NextRoundPanel;
private var _mcOverPanel:GameOverPanel;
private var _mcInstructions:instructions;
private var _mcNextCard:nextCard_mc;
private var _nTimerPause:Number;// = 0
private var _bGameInPause:Boolean;
public var _btUndo:btnUndo;
public var _btMenu:btnMenu;
public var _nRoundTime:Number;// = 120
public var _nFullTimeBonus:int;// = 20000
public var _nRoundNumber:int;
private var _nRoundScore:Number;
public static var GAME;
public static var isPlayAgain:Boolean = false;
public function Game(_arg1:MovieClip){
GAME = this;
_root = _arg1;
_btUndo = new btnUndo();
_btUndo.x = 452;
_btUndo.y = 355;
_root.addChild(_btUndo);
enableUndo(false);
_btMenu = new btnMenu();
_btMenu.x = 5;
_btMenu.y = 5;
_root.addChild(_btMenu);
enableMenu(false);
_mcCardContainer = new Sprite();
_root.addChild(_mcCardContainer);
_mcBG = new BackGround();
_root.addChildAt(_mcBG, 0);
_mcBG._sbtTakePoints.addEventListener(MouseEvent.CLICK, showGameOverPanel);
_mcTimer = _mcBG.mcTimer;
_mcNextCard = new nextCard_mc();
_mcNextCard.x = 295;
_mcNextCard.y = 330;
_mcNextCard.alpha = 0.5;
_mcNextCard.mouseChildren = false;
_mcNextCard.mouseEnabled = false;
_mcNextCard.visible = false;
_root.addChild(_mcNextCard);
_bGameInPause = false;
if (!_root.showInstr){
startGame();
} else {
showInstructions(1);
};
}
public function showNextCardMC(_arg1:Boolean):void{
_mcNextCard.visible = _arg1;
}
private function showInstructions(_arg1:int):void{
_mcInstructions = new instructions();
if (_arg1 == 1){
_mcInstructions._sbtOk.addEventListener(MouseEvent.CLICK, startFromInstructions);
} else {
_mcInstructions._sbtOk.addEventListener(MouseEvent.CLICK, playAgainFromInstructions);
};
_root.addChild(_mcInstructions);
}
private function startFromInstructions(_arg1:MouseEvent):void{
_root.removeChild(_mcInstructions);
startGame();
}
private function playAgainFromInstructions(_arg1:MouseEvent):void{
_root.removeChild(_mcInstructions);
playAgain();
}
public function allSoundsLoaded(_arg1){
}
public function showStartPanelFromMenu(_arg1:MouseEvent=null):void{
SoundController.sndButtonClick.play();
if (_mcMenu){
_root.removeChild(_mcMenu);
};
showNextCardMC(false);
_root.showStartPanel();
}
public function showStartPanelFromEnd(_arg1:MouseEvent=null):void{
SoundController.sndButtonClick.play();
if (_mcOverPanel){
_root.removeChild(_mcOverPanel);
};
_root.showStartPanel();
}
public function startGame():void{
_cardHolder = new CardHolder(_mcCardContainer, this);
_nRoundNumber = 1;
_mcBG.tfRoundNumber.text = _nRoundNumber.toString();
}
public function showNewRoundPanel():void{
_mcNextPanel = new NextRoundPanel();
_mcNextPanel._sbtNextRound.addEventListener(MouseEvent.CLICK, startNewRound);
var _local1:Number = (_cardHolder.arrDraw.length * 1000);
var _local2:Number = (_nRoundNumber * 1000);
var _local3:Number = (_cardHolder.wildCard.active) ? 5000 : 0;
_nRoundScore = (((_mcTimer._nBonusLeft + _local1) + _local2) + _local3);
_mcBG.score = (_mcBG.score + _nRoundScore);
_mcNextPanel._stxTimeBonus.text = _mcTimer._nBonusLeft.toString();
_mcNextPanel._stxDeckBonus.text = _local1.toString();
_mcNextPanel._stxRoundBonus.text = _local2.toString();
_mcNextPanel._stxWildBonus.text = _local3.toString();
_mcNextPanel._stxScore.text = _mcBG.score.toString();
_mcNextPanel.showBonuses();
_root.addChild(_mcNextPanel);
_mcTimer.stopTimer();
showNextCardMC(false);
}
public function startNewRound(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
_mcNextPanel._sbtNextRound.removeEventListener(MouseEvent.CLICK, startNewRound);
_root.removeChild(_mcNextPanel);
_cardHolder.playAgain();
_nRoundNumber++;
_mcBG.tfRoundNumber.text = _nRoundNumber.toString();
_mcTimer.setTime(0);
_mcBG.invisibleCastle();
}
public function showGameOverPanel(_arg1:MouseEvent=null):void{
if (_cardHolder.arrPyramid.length == 0){
return;
};
_mcOverPanel = new GameOverPanel();
_mcOverPanel.noHigh.visible = false;
_mcOverPanel.tfName.text = HighScorePanel.showLastTypedName();
_mcOverPanel._stxScore.text = _mcBG.score.toString();
trace(_root.getMinScore(), _mcBG.score);
if (_root.getMinScore() > _mcBG.score){
_mcOverPanel.noHigh.visible = true;
_mcOverPanel.noHigh._stxScore.text = _mcBG.score.toString();
_mcOverPanel.noHigh._sbtMainMenu.addEventListener(MouseEvent.CLICK, showStartPanelFromEnd);
} else {
_mcOverPanel._sbtOK.addEventListener(MouseEvent.CLICK, showHighScore);
_mcOverPanel._sbtMainMenu.addEventListener(MouseEvent.CLICK, showStartPanelFromEnd);
};
_root.addChild(_mcOverPanel);
SoundController.sndGameOver.play();
SoundController.sndButtonClick.play();
_mcTimer.stopTimer();
showNextCardMC(false);
}
public function playAgainFromMain():void{
_cardHolder.removeCards();
if (!_root.showInstr){
playAgain();
} else {
showInstructions(2);
};
}
public function playAgain():void{
_mcBG.score = 0;
_mcBG.lastScore = 0;
_mcBG.lastRun = "0";
_mcBG.tfCardRun.text = "0";
_cardHolder.playAgain();
_bGameInPause = false;
_nRoundNumber = 1;
_mcBG.tfRoundNumber.text = _nRoundNumber.toString();
_mcTimer.setTime(0);
_mcBG.invisibleCastle();
}
private function showHighScore(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
sendMochiLeaderBoard();
HighScorePanel.saveNewUser(_mcOverPanel.tfName.text, _mcBG.score);
_mcOverPanel._smcHigh.init("over");
_mcOverPanel._smcHigh.visible = true;
_mcOverPanel._smcHigh._sbtOnlineSend.visible = true;
_mcOverPanel._smcHigh._sbtOnlineSend.addEventListener(MouseEvent.CLICK, sendHighScore);
_mcOverPanel._smcHigh._sbtBack.addEventListener(MouseEvent.CLICK, showStartPanelFromEnd);
_mcOverPanel._sbtOK.removeEventListener(MouseEvent.CLICK, showHighScore);
_mcOverPanel._sbtOK.enabled = false;
}
private function sendHighScore(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
MochiScores.showLeaderboard({boardID:"1eae4923c2771491", score:_mcBG.score, name:_mcOverPanel.tfName.text, onClose:mochiSent});
}
private function sendMochiLeaderBoard():void{
MochiScores.submit(_mcBG.score, _mcOverPanel.tfName.text, this, mochiSent);
}
public function mochiSent(_arg1):void{
_mcOverPanel._smcHigh.txtSent.text = "Online score submitted";
_mcOverPanel._smcHigh._sbtOnlineSend.visible = false;
_mcOverPanel._smcHigh._sbtOnlineSend.removeEventListener(MouseEvent.CLICK, sendHighScore);
}
public function functionsFor4Frame():void{
_root.removeChild(_mcOverPanel);
_root.showStartPanel();
}
public function timeOut():void{
}
private function pauseGame(_arg1:Boolean):void{
if (_arg1){
_bGameInPause = true;
_nTimerPause = _mcTimer.getTime();
_mcTimer.stopTimer();
} else {
_bGameInPause = false;
_mcTimer.startNewCountDown(_nTimerPause);
};
}
private function onUndoClicked(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
_cardHolder.returningCard();
}
public function onMenuClicked(_arg1:MouseEvent=null):void{
pauseGame(!(_bGameInPause));
SoundController.sndButtonClick.play();
if (_bGameInPause){
_mcMenu = new Menu();
_mcMenu.init(this);
_root.addChild(_mcMenu);
} else {
_root.removeChild(_mcMenu);
};
}
public function enableUndo(_arg1:Boolean):void{
if (_arg1){
if (_btUndo.enabled){
return;
};
_btUndo.enabled = true;
_btUndo.addEventListener(MouseEvent.CLICK, onUndoClicked);
_btUndo.alpha = 1;
} else {
_btUndo.enabled = false;
_btUndo.removeEventListener(MouseEvent.CLICK, onUndoClicked);
_btUndo.alpha = 0.7;
};
}
public function enableMenu(_arg1:Boolean):void{
if (_arg1){
if (_btMenu.enabled){
return;
};
_btMenu.addEventListener(MouseEvent.CLICK, onMenuClicked);
_btMenu.enabled = true;
} else {
_btMenu.removeEventListener(MouseEvent.CLICK, onMenuClicked);
_btMenu.enabled = false;
};
}
}
}//package
Section 49
//GameOver (GameOver)
package {
import flash.media.*;
public dynamic class GameOver extends Sound {
}
}//package
Section 50
//GameOverPanel (GameOverPanel)
package {
import flash.display.*;
import flash.text.*;
public class GameOverPanel extends MovieClip {
public var tfName:TextField;
public var _stxScore:TextField;
public var _sbtOK:SimpleButton;
public var _sbtMainMenu:SimpleButton;
public var noHigh:MovieClip;
public var _smcHigh:HighScorePanel;
public function setMinScore(_arg1:Number):void{
}
}
}//package
Section 51
//h1 (h1)
package {
import flash.display.*;
public dynamic class h1 extends MovieClip {
public function h1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 52
//h10 (h10)
package {
import flash.display.*;
public dynamic class h10 extends MovieClip {
public function h10(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 53
//h11 (h11)
package {
import flash.display.*;
public dynamic class h11 extends MovieClip {
}
}//package
Section 54
//h12 (h12)
package {
import flash.display.*;
public dynamic class h12 extends MovieClip {
public function h12(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 55
//h13 (h13)
package {
import flash.display.*;
public dynamic class h13 extends MovieClip {
public function h13(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 56
//h2 (h2)
package {
import flash.display.*;
public dynamic class h2 extends MovieClip {
public function h2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 57
//h3 (h3)
package {
import flash.display.*;
public dynamic class h3 extends MovieClip {
public function h3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 58
//h4 (h4)
package {
import flash.display.*;
public dynamic class h4 extends MovieClip {
public function h4(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 59
//h5 (h5)
package {
import flash.display.*;
public dynamic class h5 extends MovieClip {
public function h5(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 60
//h6 (h6)
package {
import flash.display.*;
public dynamic class h6 extends MovieClip {
public function h6(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 61
//h7 (h7)
package {
import flash.display.*;
public dynamic class h7 extends MovieClip {
public function h7(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 62
//h8 (h8)
package {
import flash.display.*;
public dynamic class h8 extends MovieClip {
public function h8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 63
//h9 (h9)
package {
import flash.display.*;
public dynamic class h9 extends MovieClip {
public function h9(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 64
//HighScorePanel (HighScorePanel)
package {
import flash.display.*;
import flash.events.*;
import mochi.*;
import flash.text.*;
import flash.net.*;
public class HighScorePanel extends Sprite {
public var _sbtOnline:SimpleButton;
public var _sbtOnlineSend:SimpleButton;
public var _sbtBack:SimpleButton;
public var txtSent:TextField;
public var txtP1:TextField;
public var txtP2:TextField;
public var txtP3:TextField;
public var txtP4:TextField;
public var txtP5:TextField;
public var txtP6:TextField;
public var txtP7:TextField;
public var txtP8:TextField;
public var txtP9:TextField;
public var txtP10:TextField;
public var txtS1:TextField;
public var txtS2:TextField;
public var txtS3:TextField;
public var txtS4:TextField;
public var txtS5:TextField;
public var txtS6:TextField;
public var txtS7:TextField;
public var txtS8:TextField;
public var txtS9:TextField;
public var txtS10:TextField;
private static var _soData:SharedObject;
private static var _soLastScoreData:SharedObject;
public function HighScorePanel(){
visible = false;
_sbtOnlineSend.visible = false;
}
public function init(_arg1:String):void{
if (_arg1 == "start"){
_sbtBack.addEventListener(MouseEvent.CLICK, onCloseHigh);
};
_sbtOnline.addEventListener(MouseEvent.CLICK, onShowOnline);
readSO(_arg1);
}
private function onShowOnline(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
MochiScores.showLeaderboard({boardID:"1eae4923c2771491", onClose:onCloseOnline});
}
private function onCloseHigh(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
visible = false;
}
private function onCloseOnline():void{
}
private function setTFcolors():void{
var _local2:TextField;
var _local3:TextField;
var _local1 = 1;
while (_local1 <= 10) {
_local2 = this[("txtP" + _local1)];
_local3 = this[("txtS" + _local1)];
if (((((!((_local1 == 1))) && (!((_local1 == 4))))) && (!((_local1 == 8))))){
_local2.textColor = 14027274;
_local3.textColor = 14027274;
} else {
_local2.textColor = 710154;
_local3.textColor = 710154;
};
_local1++;
};
}
public function readSO(_arg1:String):void{
var _local3:String;
var _local4:int;
var _local8:Object;
var _local9:TextField;
var _local10:TextField;
_soData = SharedObject.getLocal("LocalScoreData");
_soLastScoreData = SharedObject.getLocal("LastScoreData");
var _local2:Array = new Array();
for (_local3 in _soData.data) {
_local8 = {n:_local3, s:_soData.data[_local3]};
if (_local3.indexOf("^") != -1){
_local8.n = _local3.substr(0, _local3.indexOf("^"));
};
_local2.push(_local8);
trace([_local8.n, _local8.s]);
};
_local2.sortOn("s", Array.NUMERIC);
_local2.reverse();
_local4 = ((_local2.length)<10) ? _local2.length : 10;
var _local5:int;
while (_local5 < _local4) {
_local9 = this[("txtP" + int((_local5 + 1)))];
_local10 = this[("txtS" + int((_local5 + 1)))];
_local9.text = _local2[_local5].n;
_local10.text = _local2[_local5].s;
_local5++;
};
var _local6:* = parent;
var _local7:* = ((_local2.length)<10) ? 0 : _local2[9].s;
_local6.setMinScore(Number(_local7));
if (_arg1 != "over"){
return;
};
if (_soLastScoreData.data.nLastUser != undefined){
_local5 = 0;
while (_local5 < _local4) {
_local9 = this[("txtP" + int((_local5 + 1)))];
_local10 = this[("txtS" + int((_local5 + 1)))];
if ((((_local9.text == _soLastScoreData.data["nLastUser"])) && ((_local10.text == _soLastScoreData.data["nLastScore"])))){
_local9 = this[("txtP" + int((_local5 + 1)))];
_local10 = this[("txtS" + int((_local5 + 1)))];
_local9.textColor = 658134;
_local10.textColor = 658134;
};
_local5++;
};
};
}
public static function saveNewUser(_arg1:String, _arg2:Number):void{
if (_arg2 == 0){
return;
};
var _local3:Number = Math.random();
if (_soData.data[((_arg1 + "^") + _local3)] == undefined){
_soData.data[((_arg1 + "^") + _local3)] = _arg2;
};
if (_soData.data[((_arg1 + "^") + _local3)] < _arg2){
_soData.data[((_arg1 + "^") + _local3)] = _arg2;
};
_soLastScoreData.data["nLastUser"] = _arg1;
_soLastScoreData.data["nLastScore"] = _arg2;
_soData.flush();
_soLastScoreData.flush();
}
public static function showLastTypedName():String{
var _local1:String = (_soLastScoreData.data["nLastUser"]) ? _soLastScoreData.data["nLastUser"] : "Player";
return (_local1);
}
}
}//package
Section 65
//instructions (instructions)
package {
import flash.display.*;
public dynamic class instructions extends MovieClip {
public var _sbtOk:SimpleButton;
}
}//package
Section 66
//Main (Main)
package {
import flash.display.*;
import flash.events.*;
import mochi.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
public dynamic class Main extends MovieClip {
private var game:Game;
private var startPanel:StartPanel;
public var percent:TextField;
public var soundController:SoundController;
private var shield:MovieClip;
public var minScoreToGet:Number;
public var showInstr:Boolean;
public var btnSponsorBanner:SimpleButton;
public function Main():void{
stop();
init();
}
private function init(_arg1:Event=null):void{
addEventListener(Event.ENTER_FRAME, onEnterFrame);
soundController = new SoundController();
MochiAd.showPreGameAd({clip:this, id:"e60a83539d6c39a0", res:"640x450", background:16777161, color:0xFF8A00, outline:13994812, no_bg:false});
MochiServices.connect("e60a83539d6c39a0", this);
MochiScores.setBoardID("1eae4923c2771491");
}
private function onEnterFrame(_arg1:Event){
if (framesLoaded == totalFrames){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
addEventListener(Event.ENTER_FRAME, EFlistener);
};
}
private function EFlistener(_arg1:Event):void{
var _local2:Timer;
if (currentFrame == 2){
stop();
if (btnSponsorBanner){
btnSponsorBanner.addEventListener(MouseEvent.CLICK, goToWebsite);
};
_local2 = new Timer(3000, 1);
_local2.addEventListener(TimerEvent.TIMER, timerListener);
_local2.start();
};
if (currentFrame == 3){
stop();
removeEventListener(Event.ENTER_FRAME, EFlistener);
showStartPanel();
};
}
private function timerListener(_arg1:TimerEvent):void{
gotoAndStop(3);
}
public function showStartPanel():void{
var _local1:McMask;
startPanel = new StartPanel(this);
startPanel.randomAppStore();
if (!this.mask){
_local1 = new McMask();
addChild(_local1);
this.mask = _local1;
};
addChild(startPanel);
}
public function initGame(_arg1:Boolean):void{
removeChild(startPanel);
showInstr = _arg1;
if (!game){
game = new Game(this);
} else {
game.playAgainFromMain();
};
}
public function getMinScore():Number{
trace(minScoreToGet);
return (minScoreToGet);
}
public function setMinScore(_arg1:Number):void{
minScoreToGet = _arg1;
trace(("setMinScore " + minScoreToGet));
}
private function goToWebsite(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
var _local2:URLRequest = new URLRequest("http://www.solitaireparadise.com/");
navigateToURL(_local2);
}
}
}//package
Section 67
//McMask (McMask)
package {
import flash.display.*;
public class McMask extends MovieClip {
}
}//package
Section 68
//Menu (Menu)
package {
import flash.display.*;
import flash.events.*;
public class Menu extends MovieClip {
private var _Game:Game;
public var _sbtResume:SimpleButton;
public var _sbtExit:SimpleButton;
public var _sbtInstructions:SimpleButton;
public var _smcBoard:MovieClip;
public var _smcInstructions:MovieClip;
public function Menu(){
_smcInstructions.visible = false;
_smcInstructions._sbtBack.visible = false;
var _local1:SimpleButton = (getChildAt(0) as SimpleButton);
_local1.useHandCursor = false;
}
public function init(_arg1:Game):void{
_Game = _arg1;
_sbtResume.addEventListener(MouseEvent.CLICK, onResume);
_sbtExit.addEventListener(MouseEvent.CLICK, onExit);
_sbtInstructions.addEventListener(MouseEvent.CLICK, onInstructions);
}
private function onResume(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
removeListeners();
_Game.onMenuClicked();
}
private function onExit(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
removeListeners();
_Game.showStartPanelFromMenu();
}
private function onInstructions(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
_smcInstructions.visible = true;
_smcInstructions._sbtResume.addEventListener(MouseEvent.CLICK, onInstructionsExit);
removeMenu(false);
}
private function onInstructionsExit(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
_smcInstructions.visible = false;
_smcInstructions._sbtResume.removeEventListener(MouseEvent.CLICK, onInstructionsExit);
removeMenu(true);
}
private function removeMenu(_arg1:Boolean):void{
_smcBoard.visible = _arg1;
_sbtResume.visible = _arg1;
_sbtExit.visible = _arg1;
_sbtInstructions.visible = _arg1;
}
private function removeListeners():void{
_sbtResume.removeEventListener(MouseEvent.CLICK, onResume);
_sbtExit.removeEventListener(MouseEvent.CLICK, onExit);
_sbtInstructions.removeEventListener(MouseEvent.CLICK, onInstructions);
}
}
}//package
Section 69
//MFNWLogo (MFNWLogo)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class MFNWLogo extends SimpleButton {
public function MFNWLogo(){
this.addEventListener(MouseEvent.CLICK, onMouseClick);
this.mouseEnabled = true;
}
private function onMouseClick(_arg1:MouseEvent){
var _local2:URLRequest = new URLRequest("http://www.makeflashnotwar.com");
navigateToURL(_local2);
}
}
}//package
Section 70
//NewDeal (NewDeal)
package {
import flash.media.*;
public dynamic class NewDeal extends Sound {
}
}//package
Section 71
//nextCard_mc (nextCard_mc)
package {
import flash.display.*;
public dynamic class nextCard_mc extends MovieClip {
}
}//package
Section 72
//NextRoundPanel (NextRoundPanel)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class NextRoundPanel extends MovieClip {
private var _nTimer:Number;
public var _sbtNextRound:SimpleButton;
public var btnMoreGames:SimpleButton;
public var _stxTimeBonus:TextField;
public var _stxWildBonus:TextField;
public var _stxDeckBonus:TextField;
public var _stxRoundBonus:TextField;
public var _stxScore:TextField;
public function NextRoundPanel(){
_sbtNextRound.visible = false;
_stxTimeBonus.visible = false;
_stxWildBonus.visible = false;
_stxDeckBonus.visible = false;
_stxRoundBonus.visible = false;
_stxScore.visible = false;
btnMoreGames.addEventListener(MouseEvent.CLICK, playMoreGames);
}
private function playMoreGames(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
var _local2:URLRequest = new URLRequest("http://www.solitaireparadise.com");
navigateToURL(_local2);
}
public function showBonuses():void{
_nTimer = 90;
this.addEventListener(Event.ENTER_FRAME, enterFrameListener);
}
public function enterFrameListener(_arg1:Event):void{
_nTimer--;
if (_nTimer == 75){
_stxTimeBonus.visible = true;
SoundController.sndScorePing.play();
};
if (_nTimer == 60){
_stxWildBonus.visible = true;
SoundController.sndScorePing.play();
};
if (_nTimer == 45){
_stxDeckBonus.visible = true;
SoundController.sndScorePing.play();
};
if (_nTimer == 30){
_stxRoundBonus.visible = true;
SoundController.sndScorePing.play();
};
if (_nTimer == 15){
_stxScore.visible = true;
SoundController.sndScorePing.play();
};
if (_nTimer == 0){
_sbtNextRound.visible = true;
this.removeEventListener(Event.ENTER_FRAME, enterFrameListener);
};
}
}
}//package
Section 73
//PileRemoved (PileRemoved)
package {
import flash.media.*;
public dynamic class PileRemoved extends Sound {
}
}//package
Section 74
//s1 (s1)
package {
import flash.display.*;
public dynamic class s1 extends MovieClip {
public function s1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 75
//s10 (s10)
package {
import flash.display.*;
public dynamic class s10 extends MovieClip {
public function s10(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 76
//s11 (s11)
package {
import flash.display.*;
public dynamic class s11 extends MovieClip {
}
}//package
Section 77
//s12 (s12)
package {
import flash.display.*;
public dynamic class s12 extends MovieClip {
public function s12(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 78
//s13 (s13)
package {
import flash.display.*;
public dynamic class s13 extends MovieClip {
public function s13(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 79
//s2 (s2)
package {
import flash.display.*;
public dynamic class s2 extends MovieClip {
public function s2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 80
//s3 (s3)
package {
import flash.display.*;
public dynamic class s3 extends MovieClip {
public function s3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 81
//s4 (s4)
package {
import flash.display.*;
public dynamic class s4 extends MovieClip {
public function s4(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 82
//s5 (s5)
package {
import flash.display.*;
public dynamic class s5 extends MovieClip {
public function s5(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 83
//s6 (s6)
package {
import flash.display.*;
public dynamic class s6 extends MovieClip {
public function s6(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 84
//s7 (s7)
package {
import flash.display.*;
public dynamic class s7 extends MovieClip {
public function s7(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 85
//s8 (s8)
package {
import flash.display.*;
public dynamic class s8 extends MovieClip {
public function s8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 86
//s9 (s9)
package {
import flash.display.*;
public dynamic class s9 extends MovieClip {
public function s9(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 87
//ScorePing (ScorePing)
package {
import flash.media.*;
public dynamic class ScorePing extends Sound {
}
}//package
Section 88
//Shield (Shield)
package {
import flash.display.*;
public dynamic class Shield extends MovieClip {
}
}//package
Section 89
//SoundButton (SoundButton)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class SoundButton extends MovieClip {
public var btSoundOff:SimpleButton;
public var btSoundOn:SimpleButton;
private var _enable:Boolean;
private var _soData:SharedObject;
public function SoundButton(){
btSoundOff.addEventListener(MouseEvent.CLICK, setSoundOn);
btSoundOn.addEventListener(MouseEvent.CLICK, setSoundOff);
readSO();
}
private function setSoundOff(_arg1:Event):void{
enable = false;
}
private function setSoundOn(_arg1:Event):void{
enable = true;
SoundController.sndButtonClick.play();
}
private function set enable(_arg1:Boolean){
if (_arg1 == false){
btSoundOff.visible = true;
btSoundOn.visible = !(btSoundOff.visible);
} else {
btSoundOff.visible = false;
btSoundOn.visible = !(btSoundOff.visible);
};
_enable = _arg1;
onSetSound(_arg1);
}
private function get enable():Boolean{
return (_enable);
}
private function readSO():void{
var _local1:*;
var _local2:*;
_soData = SharedObject.getLocal("soundData");
for (_local1 in _soData.data) {
};
_local2 = ((_soData.data.sound)==undefined) ? true : _soData.data.sound;
(enable = _local2);
}
private function onSetSound(_arg1:Boolean):void{
saveSound(_arg1);
(SoundController.enable = _arg1);
}
private function saveSound(_arg1:Boolean):void{
(_soData.data.sound = _arg1);
_soData.flush();
}
}
}//package
Section 90
//SoundController (SoundController)
package {
import flash.media.*;
public class SoundController {
private var indexLoaded:int;// = 0
public static var sndAllPilesRemoved:AllPilesRemoved;
public static var sndCardClick:CardClick;
public static var sndButtonClick:ButtonClick;
public static var sndNewDeal:NewDeal;
public static var sndGameOver:GameOver;
public static var sndUnAccessibleCard:UnAccessibleCard;
public static var sndTurnCard:TurnCard;
public static var sndWildCard:WildCardUsed;
public static var sndPileRemoved:PileRemoved;
public static var sndScorePing:ScorePing;
private static var __enable:Boolean;
public function SoundController(){
sndPileRemoved = new PileRemoved();
sndAllPilesRemoved = new AllPilesRemoved();
sndCardClick = new CardClick();
sndButtonClick = new ButtonClick();
sndNewDeal = new NewDeal();
sndGameOver = new GameOver();
sndUnAccessibleCard = new UnAccessibleCard();
sndTurnCard = new TurnCard();
sndWildCard = new WildCardUsed();
sndScorePing = new ScorePing();
}
public static function get enable():Boolean{
return (Boolean(true));
}
public static function set enable(_arg1:Boolean){
var _local2:SoundTransform = new SoundTransform();
SoundMixer.soundTransform = new SoundTransform(Number(_arg1));
}
}
}//package
Section 91
//StartPanel (StartPanel)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class StartPanel extends MovieClip {
private var _mainClass:Main;
private var _soData:SharedObject;
public var _sbtPlay:SimpleButton;
public var _sbtInstructions:SimpleButton;
public var _sbtCredits:SimpleButton;
public var _smcSound:SoundButton;
public var _sbtHigh:SimpleButton;
public var _smcInstructions:MovieClip;
public var _smcCredits:MovieClip;
public var _smcHighScore:HighScorePanel;
public var btnGoToWebsite:SimpleButton;
public var btnAppStore1:SimpleButton;
public var btnAppStore2:SimpleButton;
public var btnPlayMoreGames:SimpleButton;
public var btnPlayFacebook:SimpleButton;
public var _smcShowInstructions:MovieClip;
public var enableShow:Boolean;
public function StartPanel(_arg1:Main){
_mainClass = _arg1;
init();
}
private function randomNumber(_arg1:Number=0, _arg2:Number=1):Number{
return ((Math.floor((Math.random() * ((1 + _arg2) - _arg1))) + _arg1));
}
private function init():void{
readSO();
_smcHighScore.init("start");
_smcInstructions.visible = false;
_smcInstructions._sbtResume.visible = false;
_smcInstructions._sbtBack.addEventListener(MouseEvent.CLICK, onCloseInst);
btnGoToWebsite.addEventListener(MouseEvent.CLICK, goToWebsite);
btnPlayMoreGames.addEventListener(MouseEvent.CLICK, playMoreGames);
btnPlayFacebook.addEventListener(MouseEvent.CLICK, playFacebook);
btnAppStore1.addEventListener(MouseEvent.CLICK, goToAppStore);
btnAppStore2.addEventListener(MouseEvent.CLICK, goToAppStore);
_smcCredits.visible = false;
_smcCredits._sbtBack.addEventListener(MouseEvent.CLICK, onCloseCredits);
_sbtPlay.addEventListener(MouseEvent.CLICK, onStartGame);
_sbtInstructions.addEventListener(MouseEvent.CLICK, onInstructions);
_sbtCredits.addEventListener(MouseEvent.CLICK, onCredits);
_sbtHigh.addEventListener(MouseEvent.CLICK, onHigh);
_smcShowInstructions.addEventListener(MouseEvent.CLICK, onShow);
}
public function randomAppStore():void{
if (randomNumber() == 1){
btnAppStore1.visible = false;
btnAppStore2.visible = true;
} else {
btnAppStore1.visible = true;
btnAppStore2.visible = false;
};
}
private function goToAppStore(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
var _local2:URLRequest = new URLRequest("http://www.solitaireparadise.com/redirect/magictowersappstore/");
navigateToURL(_local2);
}
private function playFacebook(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
var _local2:URLRequest = new URLRequest("http://www.solitaireparadise.com/redirect/magictowerstofacebook/");
navigateToURL(_local2);
}
private function goToWebsite(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
var _local2:URLRequest = new URLRequest("http://www.glowingeyegames.com/");
navigateToURL(_local2);
}
private function playMoreGames(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
var _local2:URLRequest = new URLRequest("http://www.solitaireparadise.com");
navigateToURL(_local2);
}
private function onStartGame(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
_mainClass.initGame(enableShow);
}
private function onInstructions(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
_smcInstructions.visible = true;
}
private function onCloseInst(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
_smcInstructions.visible = false;
}
private function onCredits(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
_smcCredits.visible = true;
}
private function onCloseCredits(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
_smcCredits.visible = false;
}
public function onHigh(_arg1:MouseEvent):void{
SoundController.sndButtonClick.play();
_smcHighScore.visible = true;
}
public function setMinScore(_arg1:Number):void{
_mainClass.setMinScore(_arg1);
}
private function onShow(_arg1:MouseEvent):void{
if (_smcShowInstructions.currentFrame == 1){
_smcShowInstructions.gotoAndStop(2);
onSetShowInstructions(true);
} else {
_smcShowInstructions.gotoAndStop(1);
onSetShowInstructions(false);
};
}
private function readSO():void{
var _local1:*;
var _local2:*;
_soData = SharedObject.getLocal("showInstructions");
for (_local1 in _soData.data) {
};
_local2 = ((_soData.data.show)==undefined) ? true : _soData.data.show;
(enableShow = _local2);
if (_local2){
_smcShowInstructions.gotoAndStop(2);
} else {
_smcShowInstructions.gotoAndStop(1);
};
}
private function onSetShowInstructions(_arg1:Boolean):void{
showInstructions(_arg1);
(enableShow = _arg1);
}
private function showInstructions(_arg1:Boolean):void{
(_soData.data.show = _arg1);
_soData.flush();
}
}
}//package
Section 92
//TimerClass (TimerClass)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
public class TimerClass extends MovieClip {
public var _Game:Game;
private var _nBonusPerSecond:Number;
public var _nBonusLeft:Number;
public var _nTimer:Number;
private var _nOldTime:Number;
private var _bTimerOn:Boolean;
private var _nStartingTime:Number;
private var _nTotalFrames:Number;
private var _nSeconds:Number;// = 0
private var _bWarned:Boolean;
private var _fTimeRanOut:Function;
private var _fTickFunction:Function;// = null
private var _fBonusTick:Function;
private var _fTimeTargetFunction:Function;
private var _fEnterFrameFunction:Function;
public var timerDisplay:TextField;
public var _smcTimerModifier:MovieClip;
public var _smcTimerTarget:MovieClip;
public var _nTimeTarget:Number;
public var _nTimeWarning:Number;
public var _bPlayerWarned:Boolean;
public var _sTimeModifier:String;
public function TimerClass(){
timerDisplay = (getChildAt(0) as TextField);
}
public function onInitialize(_arg1:Game):void{
_Game = _arg1;
_nTotalFrames = this.totalFrames;
this.stop();
_bTimerOn = false;
_bWarned = false;
_nBonusPerSecond = (_Game._nFullTimeBonus / _Game._nRoundTime);
_nBonusLeft = _Game._nFullTimeBonus;
setTickFunction(decrementBonus);
}
public function setTime(_arg1:Number):void{
_nTimer = _arg1;
}
public function getTime():Number{
return (_nTimer);
}
public function startTimer():void{
_nOldTime = (getTimer() / 1000);
_bTimerOn = true;
}
public function setEndFunction(_arg1:Function):void{
_fTimeRanOut = _arg1;
}
public function setTickFunction(_arg1:Function):void{
_fTickFunction = _arg1;
}
private function decrementBonus():void{
var _local1:int = Math.floor((_nBonusPerSecond * _nTimer));
timerDisplay.text = String(_local1);
}
public function stopTimer():void{
_bTimerOn = false;
}
public function addTime(_arg1:Number):void{
setTime((_nTimer + _arg1));
}
public function setTargetFunction(_arg1:Function):void{
_fTimeTargetFunction = _arg1;
}
public function setTimeTarget(_arg1:Number):void{
_nTimeTarget = _arg1;
_nTimeWarning = (_nTimeTarget - 10);
var _local2:Number = Math.floor((_arg1 / 60));
var _local3:Number = Math.floor((_arg1 % 60));
if (_local2 == 0){
_local2 = 12;
};
if (_local3 > 9){
_smcTimerTarget._sdtTimerTarget.text = ((String(_local2) + ":") + String(_local3));
} else {
_smcTimerTarget._sdtTimerTarget.text = ((String(_local2) + ":") + ("0" + String(_local3)));
};
}
public function getTimeTarget():Number{
return (_nTimeTarget);
}
public function startNewCountDown(_arg1:Number):void{
clearTimer();
_nStartingTime = _arg1;
setTime(_arg1);
_nSeconds = Math.floor((_nTimer % 60));
_nOldTime = (getTimer() / 1000);
_bTimerOn = true;
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, _fEnterFrameFunction);
};
_fEnterFrameFunction = countDown;
this.addEventListener(Event.ENTER_FRAME, _fEnterFrameFunction);
}
public function countDown(_arg1:Event):void{
var _local2:Number = (getTimer() / 1000);
if (_bTimerOn == true){
_nTimer = (_nTimer - (_local2 - _nOldTime));
if (_nTimer <= 0){
_nTimer = 0;
_bTimerOn = false;
_fTimeRanOut();
};
};
_nOldTime = _local2;
var _local3:Number = Math.floor(_nTimer);
if (_local3 != _nSeconds){
_nSeconds = _local3;
if (_fTickFunction != null){
_fTickFunction();
};
};
_nBonusLeft = Math.floor((_nSeconds * _nBonusPerSecond));
timerDisplay.text = String(_nBonusLeft);
}
public function playBonusCountdown(_arg1:Function):void{
_fBonusTick = _arg1;
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, _fEnterFrameFunction);
};
_fEnterFrameFunction = countDown;
this.addEventListener(Event.ENTER_FRAME, _fEnterFrameFunction);
}
public function bonusCountDown(_arg1:Event):void{
var _local2:int = this.currentFrame;
if (_local2 == _nTotalFrames){
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, _fEnterFrameFunction);
};
_fTimeRanOut();
} else {
_local2++;
this.gotoAndStop(_local2);
_fBonusTick();
};
}
public function startNewCountUp(_arg1:Number):void{
clearTimer();
_bPlayerWarned = false;
_nStartingTime = _arg1;
setTime(_arg1);
_nOldTime = (getTimer() / 1000);
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, _fEnterFrameFunction);
};
_fEnterFrameFunction = countUp;
this.addEventListener(Event.ENTER_FRAME, _fEnterFrameFunction);
_bTimerOn = true;
}
public function countUp(_arg1:Event):void{
var _local2:Number = (getTimer() / 1000);
if (_bTimerOn == true){
_nTimer = (_nTimer + (_local2 - _nOldTime));
if ((((_nTimer > _nTimeWarning)) && ((_bPlayerWarned == false)))){
_bPlayerWarned = true;
};
};
_nOldTime = _local2;
var _local3:Number = Math.floor((_nTimer / 60));
var _local4:Number = Math.floor((_nTimer % 60));
if (_local4 != _nSeconds){
_nSeconds = _local4;
if (_fTickFunction != null){
_fTickFunction();
};
_local3 = (_local3 % 24);
if (_local3 > 11){
_local3 = (_local3 % 12);
_smcTimerModifier._sdtTimerModifier.text = "PM";
} else {
_smcTimerModifier._sdtTimerModifier.text = "AM";
};
if (_local3 == 0){
_local3 = 12;
};
if (_local4 > 9){
timerDisplay.text = ((String(_local3) + ":") + String(_local4));
} else {
timerDisplay.text = ((String(_local3) + ":") + ("0" + String(_local4)));
};
};
}
public function playBonusCountUp(_arg1:Function):void{
_bPlayerWarned = true;
_fBonusTick = _arg1;
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, _fEnterFrameFunction);
};
_fEnterFrameFunction = bonusCountUp;
this.addEventListener(Event.ENTER_FRAME, _fEnterFrameFunction);
}
public function bonusCountUp(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
if (_bTimerOn == true){
_nTimer = (_nTimer + 1);
if (_nTimer > _nTimeTarget){
_nTimer = _nTimeTarget;
};
_local2 = Math.floor((_nTimer / 60));
_local3 = Math.floor((_nTimer % 60));
if (_local3 != _nSeconds){
_nSeconds = _local3;
if (_fTickFunction != null){
_fTickFunction();
};
_local2 = (_local2 % 24);
if (_local2 > 11){
_local2 = 0;
_smcTimerModifier._sdtTimerModifier.text = "PM";
} else {
_smcTimerModifier._sdtTimerModifier.text = "AM";
};
if (_local2 == 0){
_local2 = 12;
};
if (_local3 > 9){
timerDisplay.text = ((String(_local2) + ":") + String(_local3));
} else {
timerDisplay.text = ((String(_local2) + ":") + ("0" + String(_local3)));
};
};
_fBonusTick();
if (_nTimer == _nTimeTarget){
_fTimeTargetFunction();
_fTimeTargetFunction = new Function();
clearTimer();
};
};
}
public function clearTimer():void{
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, _fEnterFrameFunction);
};
}
}
}//package
Section 93
//TurnCard (TurnCard)
package {
import flash.media.*;
public dynamic class TurnCard extends Sound {
}
}//package
Section 94
//UnAccessibleCard (UnAccessibleCard)
package {
import flash.media.*;
public dynamic class UnAccessibleCard extends Sound {
}
}//package
Section 95
//Utils (Utils)
package {
public class Utils {
private static const A:int = 3423313;
private static const C:int = 2435;
public static var numRandomSeed:int;
public static function getRandomValue(_arg1:int):int{
numRandomSeed = ((numRandomSeed * A) % 2147352576);
var _local2:int = (Math.floor(((numRandomSeed * _arg1) / C)) % _arg1);
return (_local2);
}
}
}//package
Section 96
//WildCard (WildCard)
package {
import flash.display.*;
public dynamic class WildCard extends Sprite {
public var mcBugless:MovieClip;
}
}//package
Section 97
//WildCardUsed (WildCardUsed)
package {
import flash.media.*;
public dynamic class WildCardUsed extends Sound {
}
}//package