Section 1
//mcBackAnimHolder_2 (AncientPersiaMahjong_Mochi_fla.mcBackAnimHolder_2)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcBackAnimHolder_2 extends MovieClip {
public function mcBackAnimHolder_2(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 2
//mcBtnCancel_46 (AncientPersiaMahjong_Mochi_fla.mcBtnCancel_46)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcBtnCancel_46 extends MovieClip {
public var btn:SimpleButton;
public function mcBtnCancel_46(){
addFrameScript(0, frame1, 6, frame7, 12, frame13);
}
function frame1(){
stop();
}
function frame7(){
if (this.rol){
stop();
};
}
function frame13(){
if (this.rol){
gotoAndPlay(2);
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 3
//mcBtnContinue_66 (AncientPersiaMahjong_Mochi_fla.mcBtnContinue_66)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcBtnContinue_66 extends MovieClip {
public var btn:SimpleButton;
public function mcBtnContinue_66(){
addFrameScript(0, frame1, 6, frame7, 12, frame13);
}
function frame1(){
stop();
}
function frame7(){
if (this.rol){
stop();
};
}
function frame13(){
if (this.rol){
gotoAndPlay(2);
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 4
//mcBtnFetFull_48 (AncientPersiaMahjong_Mochi_fla.mcBtnFetFull_48)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcBtnFetFull_48 extends MovieClip {
public var btn:SimpleButton;
public function mcBtnFetFull_48(){
addFrameScript(0, frame1, 6, frame7, 12, frame13);
}
function frame1(){
stop();
}
function frame7(){
if (this.rol){
stop();
};
}
function frame13(){
if (this.rol){
gotoAndPlay(2);
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 5
//mcBtnFetFull_end_68 (AncientPersiaMahjong_Mochi_fla.mcBtnFetFull_end_68)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcBtnFetFull_end_68 extends MovieClip {
public var btn:SimpleButton;
public function mcBtnFetFull_end_68(){
addFrameScript(0, frame1, 6, frame7, 12, frame13);
}
function frame1(){
stop();
}
function frame7(){
if (this.rol){
stop();
};
}
function frame13(){
if (this.rol){
gotoAndPlay(2);
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 6
//mcBtnOk_27 (AncientPersiaMahjong_Mochi_fla.mcBtnOk_27)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcBtnOk_27 extends MovieClip {
public var btn:SimpleButton;
public function mcBtnOk_27(){
addFrameScript(0, frame1, 6, frame7, 12, frame13);
}
function frame1(){
stop();
}
function frame7(){
if (this.rol){
stop();
};
}
function frame13(){
if (this.rol){
gotoAndPlay(2);
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 7
//mcCreditsBtn_15 (AncientPersiaMahjong_Mochi_fla.mcCreditsBtn_15)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcCreditsBtn_15 extends MovieClip {
public var btn:SimpleButton;
public function mcCreditsBtn_15(){
addFrameScript(0, frame1, 9, frame10, 17, frame18);
}
function frame1(){
stop();
}
function frame10(){
if (this.rol){
stop();
};
}
function frame18(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 8
//mcCreditsWin_30 (AncientPersiaMahjong_Mochi_fla.mcCreditsWin_30)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcCreditsWin_30 extends MovieClip {
public var btnOk:MovieClip;
public var btn:SimpleButton;
public function mcCreditsWin_30(){
addFrameScript(0, frame1, 24, frame25, 31, frame32);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame32(){
root.gotoAndStop("Main");
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 9
//mcFinalImage_60 (AncientPersiaMahjong_Mochi_fla.mcFinalImage_60)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcFinalImage_60 extends MovieClip {
public function mcFinalImage_60(){
addFrameScript(0, frame1, 56, frame57);
}
function frame1(){
stop();
}
function frame57(){
root.GameOver();
stop();
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 10
//mcHeaderName_5 (AncientPersiaMahjong_Mochi_fla.mcHeaderName_5)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcHeaderName_5 extends MovieClip {
public function mcHeaderName_5(){
addFrameScript(23, frame24);
}
function frame24(){
stop();
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 11
//mcInstructionsBtn_12 (AncientPersiaMahjong_Mochi_fla.mcInstructionsBtn_12)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcInstructionsBtn_12 extends MovieClip {
public var btn:SimpleButton;
public function mcInstructionsBtn_12(){
addFrameScript(0, frame1, 9, frame10, 17, frame18);
}
function frame1(){
stop();
}
function frame10(){
if (this.rol){
stop();
};
}
function frame18(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 12
//mcInstructionsWin_21 (AncientPersiaMahjong_Mochi_fla.mcInstructionsWin_21)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcInstructionsWin_21 extends MovieClip {
public var BG:MovieClip;
public var btnOk:MovieClip;
public function mcInstructionsWin_21(){
addFrameScript(0, frame1, 24, frame25, 31, frame32);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame32(){
root.gotoAndStop("Main");
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 13
//mcItemBack_89 (AncientPersiaMahjong_Mochi_fla.mcItemBack_89)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcItemBack_89 extends MovieClip {
public var BG:MovieClip;
public function mcItemBack_89(){
addFrameScript(0, frame1);
}
function frame1(){
parent.Set();
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 14
//mcLevelNum_58 (AncientPersiaMahjong_Mochi_fla.mcLevelNum_58)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcLevelNum_58 extends MovieClip {
public var mc:MovieClip;
public function mcLevelNum_58(){
addFrameScript(0, frame1, 36, frame37);
}
function frame1(){
stop();
}
function frame37(){
root.gotoLevel();
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 15
//mcLevelNumText_59 (AncientPersiaMahjong_Mochi_fla.mcLevelNumText_59)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcLevelNumText_59 extends MovieClip {
public var txtLevel:TextField;
public function mcLevelNumText_59(){
addFrameScript(0, frame1);
}
function frame1(){
txtLevel.text = ("Level " + (root.nLevelNum + 1));
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 16
//mcLevelsPreviews_118 (AncientPersiaMahjong_Mochi_fla.mcLevelsPreviews_118)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcLevelsPreviews_118 extends MovieClip {
public function mcLevelsPreviews_118(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 17
//mcLimitedLevelWin_44 (AncientPersiaMahjong_Mochi_fla.mcLimitedLevelWin_44)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcLimitedLevelWin_44 extends MovieClip {
public var btnGetFull:MovieClip;
public var btnCancel:MovieClip;
public function mcLimitedLevelWin_44(){
addFrameScript(0, frame1, 18, frame19);
}
public function fnOver(_arg1:MouseEvent){
_arg1.target.parent.rol = true;
_arg1.target.parent.play();
}
public function fnOut(_arg1:MouseEvent){
_arg1.target.parent.rol = false;
_arg1.target.parent.play();
}
public function fnDown(_arg1:MouseEvent){
root.sndBtnPress.play();
this.gotoAndPlay("Hide");
}
public function fnFullDown(_arg1:MouseEvent){
root.sndBtnPress.play();
navigateToURL(new URLRequest(root.strFullVersionLink), "_blank");
}
function frame1(){
stop();
}
function frame19(){
this.btnCancel.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnDown);
this.btnCancel.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnCancel.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnGetFull.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnFullDown);
this.btnGetFull.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnGetFull.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
stop();
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 18
//mcLock_139 (AncientPersiaMahjong_Mochi_fla.mcLock_139)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcLock_139 extends MovieClip {
public function mcLock_139(){
addFrameScript(7, frame8);
}
function frame8(){
stop();
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 19
//mcMainMenuBtn_35 (AncientPersiaMahjong_Mochi_fla.mcMainMenuBtn_35)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcMainMenuBtn_35 extends MovieClip {
public var btn:SimpleButton;
public function mcMainMenuBtn_35(){
addFrameScript(0, frame1, 9, frame10, 17, frame18);
}
function frame1(){
stop();
}
function frame10(){
if (this.rol){
stop();
};
}
function frame18(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 20
//mcMainMenuBtn_gameOver_78 (AncientPersiaMahjong_Mochi_fla.mcMainMenuBtn_gameOver_78)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcMainMenuBtn_gameOver_78 extends MovieClip {
public var btn:SimpleButton;
public function mcMainMenuBtn_gameOver_78(){
addFrameScript(0, frame1, 9, frame10, 17, frame18);
}
function frame1(){
stop();
}
function frame10(){
if (this.rol){
stop();
};
}
function frame18(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 21
//mcMoreGames2_38 (AncientPersiaMahjong_Mochi_fla.mcMoreGames2_38)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcMoreGames2_38 extends MovieClip {
public var btn:SimpleButton;
public function mcMoreGames2_38(){
addFrameScript(0, frame1, 9, frame10, 17, frame18);
}
function frame1(){
stop();
}
function frame10(){
if (this.rol){
stop();
};
}
function frame18(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 22
//mcMoreGames3_54 (AncientPersiaMahjong_Mochi_fla.mcMoreGames3_54)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcMoreGames3_54 extends MovieClip {
public var btn:SimpleButton;
public function mcMoreGames3_54(){
addFrameScript(0, frame1, 7, frame8, 13, frame14);
}
function frame1(){
stop();
}
function frame8(){
if (this.rol){
stop();
};
}
function frame14(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 23
//mcMoreGames4_81 (AncientPersiaMahjong_Mochi_fla.mcMoreGames4_81)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcMoreGames4_81 extends MovieClip {
public var btn:SimpleButton;
public function mcMoreGames4_81(){
addFrameScript(0, frame1, 9, frame10, 17, frame18);
}
function frame1(){
stop();
}
function frame10(){
if (this.rol){
stop();
};
}
function frame18(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 24
//mcMoreGamesBtn_18 (AncientPersiaMahjong_Mochi_fla.mcMoreGamesBtn_18)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcMoreGamesBtn_18 extends MovieClip {
public var btn:SimpleButton;
public function mcMoreGamesBtn_18(){
addFrameScript(0, frame1, 9, frame10, 17, frame18);
}
function frame1(){
stop();
}
function frame10(){
if (this.rol){
stop();
};
}
function frame18(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 25
//mcNoFreeLevelWin_41 (AncientPersiaMahjong_Mochi_fla.mcNoFreeLevelWin_41)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcNoFreeLevelWin_41 extends MovieClip {
public var btnOk:MovieClip;
public function mcNoFreeLevelWin_41(){
addFrameScript(0, frame1, 18, frame19);
}
public function fnOver(_arg1:MouseEvent){
_arg1.target.parent.rol = true;
_arg1.target.parent.play();
}
public function fnOut(_arg1:MouseEvent){
_arg1.target.parent.rol = false;
_arg1.target.parent.play();
}
public function fnDown(_arg1:MouseEvent){
root.sndBtnPress.play();
this.gotoAndPlay("Hide");
}
function frame1(){
stop();
}
function frame19(){
this.btnOk.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnDown);
this.btnOk.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnOk.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
stop();
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 26
//mcNoSameItemsWin_84 (AncientPersiaMahjong_Mochi_fla.mcNoSameItemsWin_84)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcNoSameItemsWin_84 extends MovieClip {
public function mcNoSameItemsWin_84(){
addFrameScript(0, frame1, 73, frame74);
}
function frame1(){
stop();
}
function frame74(){
root.GameOver();
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 27
//mcPauseBtn_56 (AncientPersiaMahjong_Mochi_fla.mcPauseBtn_56)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcPauseBtn_56 extends MovieClip {
public var btn:SimpleButton;
public function mcPauseBtn_56(){
addFrameScript(0, frame1, 7, frame8, 13, frame14);
}
function frame1(){
stop();
}
function frame8(){
if (this.rol){
stop();
};
}
function frame14(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 28
//mcPauseWin_86 (AncientPersiaMahjong_Mochi_fla.mcPauseWin_86)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcPauseWin_86 extends MovieClip {
public var Area:MovieClip;
public function mcPauseWin_86(){
addFrameScript(0, frame1, 14, frame15);
}
public function fnDown(_arg1:MouseEvent){
root.RemoveGamePause();
this.removeEventListener(MouseEvent.MOUSE_DOWN, fnDown);
}
function frame1(){
stop();
}
function frame15(){
this.addEventListener(MouseEvent.MOUSE_DOWN, fnDown);
stop();
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 29
//mcQuitBtn_53 (AncientPersiaMahjong_Mochi_fla.mcQuitBtn_53)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcQuitBtn_53 extends MovieClip {
public var btn:SimpleButton;
public function mcQuitBtn_53(){
addFrameScript(0, frame1, 7, frame8, 13, frame14);
}
function frame1(){
stop();
}
function frame8(){
if (this.rol){
stop();
};
}
function frame14(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 30
//mcShuffleBtn_55 (AncientPersiaMahjong_Mochi_fla.mcShuffleBtn_55)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcShuffleBtn_55 extends MovieClip {
public var btn:SimpleButton;
public function mcShuffleBtn_55(){
addFrameScript(0, frame1, 7, frame8, 13, frame14);
}
function frame1(){
stop();
}
function frame8(){
if (this.rol){
stop();
};
}
function frame14(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 31
//mcStartBtn_8 (AncientPersiaMahjong_Mochi_fla.mcStartBtn_8)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcStartBtn_8 extends MovieClip {
public var btn:SimpleButton;
public function mcStartBtn_8(){
addFrameScript(0, frame1, 9, frame10, 17, frame18);
}
function frame1(){
stop();
}
function frame10(){
if (this.rol){
stop();
};
}
function frame18(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 32
//mcSubmitBtn_74 (AncientPersiaMahjong_Mochi_fla.mcSubmitBtn_74)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcSubmitBtn_74 extends MovieClip {
public var btn:SimpleButton;
public function mcSubmitBtn_74(){
addFrameScript(0, frame1, 9, frame10, 17, frame18);
}
function frame1(){
stop();
}
function frame10(){
if (this.rol){
stop();
};
}
function frame18(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 33
//mcTrialFinalImage_64 (AncientPersiaMahjong_Mochi_fla.mcTrialFinalImage_64)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class mcTrialFinalImage_64 extends MovieClip {
public var btnContinue:MovieClip;
public var btnGetFull:MovieClip;
public function mcTrialFinalImage_64(){
addFrameScript(0, frame1, 30, frame31);
}
public function fnOver(_arg1:MouseEvent){
_arg1.target.parent.rol = true;
_arg1.target.parent.play();
}
public function fnOut(_arg1:MouseEvent){
_arg1.target.parent.rol = false;
_arg1.target.parent.play();
}
public function fnDown(_arg1:MouseEvent){
root.sndBtnPress.play();
root.GameOver();
}
public function fnFullDown(_arg1:MouseEvent){
root.sndBtnPress.play();
navigateToURL(new URLRequest(root.strFullVersionLink), "_blank");
}
function frame1(){
stop();
}
function frame31(){
this.btnContinue.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnDown);
this.btnContinue.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnContinue.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnGetFull.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnFullDown);
this.btnGetFull.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnGetFull.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
stop();
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 34
//Tween10copy_29 (AncientPersiaMahjong_Mochi_fla.Tween10copy_29)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class Tween10copy_29 extends MovieClip {
public var BG:MovieClip;
public var btnOk:MovieClip;
public function Tween10copy_29(){
addFrameScript(0, frame1);
}
public function fnOver(_arg1:MouseEvent){
_arg1.target.parent.rol = true;
_arg1.target.parent.play();
}
public function fnOut(_arg1:MouseEvent){
_arg1.target.parent.rol = false;
_arg1.target.parent.play();
}
public function fnDown(_arg1:MouseEvent){
root.sndBtnPress.play();
this.parent.gotoAndPlay("Hide");
}
function frame1(){
this.btnOk.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnDown);
this.btnOk.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnOk.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 35
//Tween10copy2_31 (AncientPersiaMahjong_Mochi_fla.Tween10copy2_31)
package AncientPersiaMahjong_Mochi_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.ui.*;
public dynamic class Tween10copy2_31 extends MovieClip {
public var btnOk:MovieClip;
public var btn:SimpleButton;
public function Tween10copy2_31(){
addFrameScript(0, frame1);
}
public function fnOver(_arg1:MouseEvent){
_arg1.target.parent.rol = true;
_arg1.target.parent.play();
}
public function fnOut(_arg1:MouseEvent){
_arg1.target.parent.rol = false;
_arg1.target.parent.play();
}
public function fnDown(_arg1:MouseEvent){
root.sndBtnPress.play();
this.parent.gotoAndPlay("Hide");
}
public function fnUrlDown(_arg1:MouseEvent){
root.sndBtnPress.play();
navigateToURL(new URLRequest("http://www.ffly.com.ua"), "_blank");
}
function frame1(){
this.btnOk.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnDown);
this.btnOk.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnOk.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
btn.addEventListener(MouseEvent.MOUSE_DOWN, fnUrlDown);
}
}
}//package AncientPersiaMahjong_Mochi_fla
Section 36
//Field (Main.Field)
package Main {
import flash.display.*;
import flash.events.*;
public dynamic class Field extends MovieClip {
public var ar_Items:Array;
public var HeightCount:Number;// = 8
public var WidthCount:Number;// = 13
public var ItemWidth:Number;// = 42
public var ItemHeight:Number;// = 52
public var mt_Map:MapTypes;
public var LevelType:Number;// = 0
private var ar_ItemsSelected:Array;
private var KindCount:Number;// = 28
private var nCountOn:Number;
private var nRemoved:Number;// = 0
private var BX:Number;
private var BY:Number;
public function Field(){
this.BX = this.x;
this.BY = this.y;
this.Create();
}
public function ReCreate(){
var _local2:Number;
var _local3:Number;
var _local1:Number = 0;
while (_local1 < this.ar_Items.length) {
_local2 = 0;
while (_local2 < this.ar_Items[_local1].length) {
_local3 = 0;
while (_local3 < this.ar_Items[_local1][_local2].length) {
this.ar_Items[_local1][_local2][_local3].RemoveFromContainer();
_local3++;
};
_local2++;
};
_local1++;
};
this.Create();
}
public function Create(){
var _local5:Number;
var _local6:Number;
if (root.nLevelNum == 2){
this.x = (this.BX + 40);
this.y = (this.BY + 20);
} else {
this.x = this.BX;
this.y = this.BY;
};
this.ar_ItemsSelected = new Array();
this.nRemoved = 0;
this.LevelType = root.nLevelType;
mt_Map = new MapTypes();
var _local1:Number = 0;
this.ar_Items = new Array();
var _local2:Number = 0;
var _local3:Number = 0;
this.nCountOn = 0;
var _local4:Number = (3 - root.nLevelSkill);
while (_local4 < mt_Map.ar_Maps[this.LevelType].length) {
_local2 = (this.ar_Items.push(new Array()) - 1);
_local5 = 0;
while (_local5 < HeightCount) {
this.ar_Items[_local2].push(new Array());
_local6 = 0;
while (_local6 < WidthCount) {
_local1++;
this.ar_Items[_local2][_local5].push(new FieldItem());
this.ar_Items[_local2][_local5][_local6].x = ((_local6 * this.ItemWidth) - (_local4 * 5));
this.ar_Items[_local2][_local5][_local6].y = ((_local5 * this.ItemHeight) - (_local4 * 5));
this.ar_Items[_local2][_local5][_local6].DepthLevel = _local2;
this.ar_Items[_local2][_local5][_local6].LevelNum = _local4;
this.ar_Items[_local2][_local5][_local6].nX = _local6;
this.ar_Items[_local2][_local5][_local6].nY = _local5;
this.ar_Items[_local2][_local5][_local6].Num = _local1;
this.ar_Items[_local2][_local5][_local6].isOn = parseInt(mt_Map.ar_Maps[this.LevelType][_local4][_local5][_local6]);
if (this.ar_Items[_local2][_local5][_local6].isOn){
this.nCountOn++;
};
this.ar_Items[_local2][_local5][_local6].nType = Math.floor((Math.random() * this.KindCount));
this.ar_Items[_local2][_local5][_local6].Update(this);
_local6++;
};
_local5++;
};
_local4++;
};
ShuffleItems();
}
public function SelectItem(_arg1:FieldItem):Boolean{
var _local2:Boolean;
if (this.ar_ItemsSelected.length == 0){
this.ar_ItemsSelected.push(_arg1);
_local2 = true;
} else {
this.ar_ItemsSelected.push(_arg1);
_local2 = false;
this.CheckSelectedItems();
};
return (_local2);
}
public function isHereItem(_arg1, _arg2, _arg3, _arg4, _arg5):Boolean{
var _local6:Boolean;
var _local7:Number = (_arg1.nX + _arg2);
var _local8:Number = (_arg1.nY + _arg3);
var _local9:Number = (_arg1.DepthLevel + _arg4);
if ((((((_local7 < 0)) || ((_local8 < 0)))) || ((_local9 > (this.ar_Items.length - 1))))){
_local6 = false;
} else {
if (_local8 > (this.ar_Items[_local9].length - 1)){
_local6 = false;
} else {
if (_local7 > (this.ar_Items[_local9][_local8].length - 1)){
_local6 = false;
};
};
};
if (_local6){
if (!this.ar_Items[_local9][_local8][_local7].isOn){
_local6 = false;
} else {
if (((_arg5) && (this.ar_Items[_local9][_local8][_local7].wasShuffeled))){
_local6 = false;
} else {
if (this.ar_Items[_local9][_local8][_local7].wasRemoved){
_local6 = false;
};
};
};
};
return (_local6);
}
public function isFreeItem(_arg1:FieldItem, _arg2:Boolean):Boolean{
var _local3:Boolean;
if (((isHereItem(_arg1, -1, 0, 0, _arg2)) && (isHereItem(_arg1, 1, 0, 0, _arg2)))){
_local3 = false;
};
if (((isHereItem(_arg1, 0, -1, 0, _arg2)) && (isHereItem(_arg1, 0, 1, 0, _arg2)))){
_local3 = false;
};
if (isHereItem(_arg1, 0, 0, 1, _arg2)){
_local3 = false;
};
return (_local3);
}
public function CheckSelectedItems(){
if ((((this.ar_ItemsSelected[0].nType == this.ar_ItemsSelected[1].nType)) && (!((this.ar_ItemsSelected[0] == this.ar_ItemsSelected[1]))))){
if (((isFreeItem(this.ar_ItemsSelected[0], false)) && (isFreeItem(this.ar_ItemsSelected[1], false)))){
this.ar_ItemsSelected[0].Remove();
this.ar_ItemsSelected[1].Remove();
root.snd_RemovingItems.play();
this.nRemoved = (this.nRemoved + 2);
if (this.nRemoved == this.nCountOn){
root.ShowNext();
} else {
if (!this.IsSame2Here()){
root.GameOverNoSame();
};
};
root.addScores(10);
};
};
this.RemoveSelectionFromItems();
}
public function RemoveSelectionFromItems(){
var _local1:Number = (this.ar_ItemsSelected.length - 1);
while (_local1 >= 0) {
this.ar_ItemsSelected[_local1].RemoveSelection();
this.ar_ItemsSelected.pop();
_local1--;
};
}
public function getFreeItemsNow():Array{
var _local3:Number;
var _local4:Number;
var _local1:Array = new Array();
var _local2:Number = 0;
while (_local2 < this.ar_Items.length) {
_local3 = 0;
while (_local3 < this.ar_Items[_local2].length) {
_local4 = 0;
while (_local4 < this.ar_Items[_local2][_local3].length) {
if (((this.isFreeItem(this.ar_Items[_local2][_local3][_local4], false)) && (this.ar_Items[_local2][_local3][_local4].isOn))){
_local1.push(this.ar_Items[_local2][_local3][_local4]);
};
_local4++;
};
_local3++;
};
_local2++;
};
return (_local1);
}
public function IsSame2Here():Boolean{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local1:Boolean;
var _local2:Array = new Array();
var _local3:Number = 0;
while (_local3 < this.ar_Items.length) {
_local5 = 0;
while (_local5 < this.ar_Items[_local3].length) {
_local6 = 0;
while (_local6 < this.ar_Items[_local3][_local5].length) {
if (((((this.isFreeItem(this.ar_Items[_local3][_local5][_local6], false)) && (this.ar_Items[_local3][_local5][_local6].isOn))) && (!(this.ar_Items[_local3][_local5][_local6].wasRemoved)))){
_local2.push(this.ar_Items[_local3][_local5][_local6]);
};
_local6++;
};
_local5++;
};
_local3++;
};
var _local4:Number = 0;
while (_local4 < _local2.length) {
_local7 = 0;
while (_local7 < _local2.length) {
if (((!((_local4 == _local7))) && ((_local2[_local4].nType == _local2[_local7].nType)))){
_local1 = true;
};
_local7++;
};
_local4++;
};
return (_local1);
}
public function ShuffleItems(){
var _local3:Number;
var _local4:Number;
var _local5:Array;
var _local6:Number;
var _local7:Number;
var _local8:Boolean;
var _local9:Number;
var _local1:Number = 0;
var _local2:Number = 0;
while (_local2 < this.ar_Items.length) {
_local3 = 0;
while (_local3 < this.ar_Items[_local2].length) {
_local4 = 0;
while (_local4 < this.ar_Items[_local2][_local3].length) {
this.ar_Items[_local2][_local3][_local4].wasShuffeled = false;
_local4++;
};
_local3++;
};
_local2++;
};
while (_local1 < this.nCountOn) {
_local5 = new Array();
_local2 = 0;
while (_local2 < this.ar_Items.length) {
_local3 = 0;
while (_local3 < this.ar_Items[_local2].length) {
_local4 = 0;
while (_local4 < this.ar_Items[_local2][_local3].length) {
if (((((this.isFreeItem(this.ar_Items[_local2][_local3][_local4], true)) && (this.ar_Items[_local2][_local3][_local4].isOn))) && (!(this.ar_Items[_local2][_local3][_local4].wasShuffeled)))){
_local5.push(this.ar_Items[_local2][_local3][_local4]);
};
_local4++;
};
_local3++;
};
_local2++;
};
_local6 = 0;
while (_local6 < _local5.length) {
if (!_local5[_local6].wasShuffeled){
_local5[_local6].wasShuffeled = true;
_local7 = Math.floor((Math.random() * this.KindCount));
_local5[_local6].nType = _local7;
_local8 = false;
_local1++;
while (!(_local8)) {
_local9 = Math.floor((Math.random() * _local5.length));
if (!_local5[_local9].wasShuffeled){
_local8 = true;
_local5[_local9].wasShuffeled = true;
_local5[_local9].nType = _local7;
_local1++;
};
};
};
_local6++;
};
};
}
}
}//package Main
Section 37
//FieldItem (Main.FieldItem)
package Main {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import flash.geom.*;
public dynamic class FieldItem extends MovieClip {
public var btn:SimpleButton;
public var mc:MovieClip;
public var isOn:Number;// = 0
public var nType:Number;// = 0
public var DepthLevel:Number;// = 0
public var nY:Number;// = 0
public var nX:Number;// = 0
public var wasSelected:Boolean;// = false
public var rol:Boolean;// = false
public var Num:Number;
public var LevelNum:Number;
public var wasRemoved:Boolean;// = false
public var wasShuffeled:Boolean;// = false
private var intervalId:Number;
private var FIELD:Field;
public function FieldItem(){
addFrameScript(0, frame1, 14, frame15, 15, frame16, 20, frame21, 25, frame26, 41, frame42);
}
private function fnOver(_arg1:MouseEvent){
if (!this.wasSelected){
this.rol = true;
play();
};
}
private function fnOut(_arg1:MouseEvent){
if (((!(this.wasSelected)) && (this.rol))){
this.rol = false;
play();
};
}
private function fnDown(_arg1:MouseEvent){
if (!this.rol){
this.rol = true;
this.play();
};
if (this.FIELD.SelectItem(this)){
this.wasSelected = true;
};
root.sndObjectPress.play();
}
public function Remove(){
this.btn.removeEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btn.removeEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btn.removeEventListener(MouseEvent.MOUSE_DOWN, fnDown);
this.wasRemoved = true;
this.gotoAndPlay("Remove");
}
private function Showed(){
this.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnDown);
}
public function RemoveSelection(){
this.wasSelected = false;
this.rol = false;
this.play();
}
public function Update(_arg1:MovieClip){
if (this.isOn != 0){
_arg1.addChild(this);
this.intervalId = setInterval(fnShow, (this.Num * 5));
this.FIELD = (_arg1 as Field);
};
}
public function RemoveFromContainer(){
if (this.isOn != 0){
this.FIELD.removeChild(this);
};
}
public function Set(){
this.mc.gotoAndStop((this.nType + 1));
var _local1:Number = ((3 - LevelNum) / 10);
this.mc.BG.transform.colorTransform = new ColorTransform((1.2 - _local1), (1.2 - _local1), (1.2 - _local1), 1, 0, 0, 0, 0);
}
private function fnShow(){
gotoAndPlay("SHOW");
clearInterval(this.intervalId);
}
function frame1(){
stop();
}
function frame15(){
this.Showed();
}
function frame16(){
stop();
}
function frame21(){
if (this.rol){
stop();
};
}
function frame26(){
if (this.rol){
gotoAndPlay("OVER");
} else {
gotoAndStop("S");
};
}
function frame42(){
stop();
}
}
}//package Main
Section 38
//Game (Main.Game)
package Main {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
public dynamic class Game extends MovieClip {
public var mcNoSameWin:MovieClip;
public var mcLevelNum:MovieClip;
public var mcLimitedLevelWin:MovieClip;
public var mcTrialFinalImage:MovieClip;
public var mcControls:GameControls;
public var mcPauseWin:MovieClip;
public var mcGameOverWin:GameOverWin;
public var mcNoFreeLevelWin:MovieClip;
public var mcInstructionsWin:MovieClip;
public var mcFinalImage:MovieClip;
public var mcCreditsWin:MovieClip;
public var mcField:Field;
public var nLevelType:Number;// = 0
public var nLevelSkill:Number;// = 0
public var nLevelNum:Number;// = 0
public var nScores:Number;// = 0
public var CountOpenedLevels:Number;// = 1
public var StoredData:SharedObject;
public var strMoreGamePath:String;// = "http://www.hidden-object-online.com/?from=AncientPersiaMahjongMochi"
public var strScoresPath:String;// = "http://online-free-gaming.com/index.php?t=9&gameid=16"
public var strFullVersionLink:String;// = "https://www.regnow.com/softsell/nph-softsell.cgi?item=8595-22"
public var isPause:Boolean;// = false
public var sndMusic:MenuMusic;
public var snd_RemovingItems:sndRemovingItems;
public var sndBtnPress:BtnPress;
public var sndObjectPress:ObjectPress;
public var sndLevelEnd:LevelEnd;
public var ar_Times:Array;
public var isTrial:Boolean;// = true
public var nLevelsLimit:Number;
public function Game(){
sndMusic = new MenuMusic();
snd_RemovingItems = new sndRemovingItems();
sndBtnPress = new BtnPress();
sndObjectPress = new ObjectPress();
sndLevelEnd = new LevelEnd();
ar_Times = new Array(5, 8, 11, 15);
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 4, frame5);
if (this.isTrial){
this.nLevelsLimit = 7;
} else {
this.nLevelsLimit = 20;
};
sndMusic.play(0, 0xFFFF);
this.StoredData = SharedObject.getLocal("AztecMahjong");
if (this.StoredData.data.CountOpenedLevels == undefined){
this.StoredData.data.CountOpenedLevels = 1;
};
this.CountOpenedLevels = this.StoredData.data.CountOpenedLevels;
}
public function GameOverNoSame(){
root.mcNoSameWin.gotoAndPlay("Show");
this.mcControls.Reset();
}
public function addScores(_arg1:Number){
this.nScores = (this.nScores + _arg1);
this.mcControls.SetScores();
}
public function gotoLevel(){
this.mcField.Create();
this.mcControls.Start();
}
public function ShowNext(){
this.sndLevelEnd.play();
this.nLevelNum++;
if (this.nLevelNum < this.nLevelsLimit){
this.nLevelSkill = Math.floor((this.nLevelNum / 5));
this.nLevelType = (this.nLevelNum - (this.nLevelSkill * 5));
this.mcLevelNum.gotoAndPlay("Show");
this.mcControls.Stop();
if (this.nLevelNum > (this.CountOpenedLevels - 1)){
this.CountOpenedLevels++;
this.StoredData.data.CountOpenedLevels = this.CountOpenedLevels;
};
} else {
if (!this.isTrial){
this.mcFinalImage.gotoAndPlay("Show");
} else {
this.mcTrialFinalImage.gotoAndPlay("Show");
};
};
}
public function GameOver(){
this.mcGameOverWin.Show();
}
public function RemoveGamePause(){
this.isPause = false;
this.mcPauseWin.gotoAndPlay("Hide");
}
public function GamePause(){
this.isPause = true;
this.mcPauseWin.gotoAndPlay("Show");
}
function frame1(){
MochiAd.showPreGameAd({clip:root, id:"ef8094388362e4cc", res:"640x480"});
}
function frame2(){
stop();
}
function frame3(){
stop();
}
function frame5(){
stop();
}
}
}//package Main
Section 39
//GameControls (Main.GameControls)
package Main {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
public dynamic class GameControls extends MovieClip {
public var btnPause:MovieClip;
public var mcMoreGames:MovieClip;
public var txtScores:TextField;
public var mcQuitBtn:MovieClip;
public var txtSecs:TextField;
public var txtMins:TextField;
public var btnShuffle:MovieClip;
var TimerID:Number;
var nTime:Number;
public function GameControls(){
this.nTime = (root.ar_Times[root.nLevelSkill] * 60);
this.TimerID = setInterval(fnTick, 1000);
this.UpdateTimerTexts();
this.mcQuitBtn.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.mcQuitBtn.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.mcQuitBtn.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnQuitDown);
this.mcMoreGames.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.mcMoreGames.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.mcMoreGames.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnMoreGamesDown);
this.btnPause.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnPause.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnPause.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnPauseDown);
this.btnShuffle.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnShuffle.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnShuffle.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnShuffleDown);
}
private function fnPauseDown(_arg1:MouseEvent){
root.sndBtnPress.play();
root.GamePause();
}
private function fnShuffleDown(_arg1:MouseEvent){
root.sndBtnPress.play();
root.mcField.ReCreate();
}
private function fnMoreGamesDown(_arg1:MouseEvent){
root.sndBtnPress.play();
navigateToURL(new URLRequest(root.strMoreGamePath), "_blank");
}
private function fnQuitDown(_arg1:MouseEvent){
root.sndBtnPress.play();
this.Reset();
root.GameOver();
}
private function fnOver(_arg1:MouseEvent){
_arg1.target.parent.rol = true;
_arg1.target.parent.play();
}
private function fnOut(_arg1:MouseEvent){
_arg1.target.parent.rol = false;
_arg1.target.parent.play();
}
private function fnTick(){
if (!root.isPause){
this.nTime--;
this.UpdateTimerTexts();
};
}
private function UpdateTimerTexts(){
var _local1:String;
var _local2:String;
var _local3:Number;
var _local4:Number;
if (this.nTime >= 0){
_local1 = "00";
_local2 = "00";
_local3 = Math.floor((nTime / 60));
_local4 = (nTime - (_local3 * 60));
if (_local3 < 10){
_local1 = ("0" + _local3.toString());
} else {
_local1 = _local3.toString();
};
if (_local4 < 10){
_local2 = ("0" + _local4.toString());
} else {
_local2 = _local4.toString();
};
this.txtSecs.text = _local2;
this.txtMins.text = _local1;
} else {
this.Reset();
root.GameOver();
};
}
public function SetScores(){
this.txtScores.text = root.nScores.toString();
}
public function Reset(){
clearInterval(this.TimerID);
this.mcQuitBtn.btn.removeEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.mcQuitBtn.btn.removeEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.mcQuitBtn.btn.removeEventListener(MouseEvent.MOUSE_DOWN, fnQuitDown);
this.mcMoreGames.btn.removeEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.mcMoreGames.btn.removeEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.mcMoreGames.btn.removeEventListener(MouseEvent.MOUSE_DOWN, fnMoreGamesDown);
}
public function Stop(){
clearInterval(this.TimerID);
root.addScores(Math.floor((nTime / 5)));
}
public function Start(){
this.nTime = (root.ar_Times[root.nLevelSkill] * 60);
this.TimerID = setInterval(fnTick, 1000);
}
}
}//package Main
Section 40
//GameOverWin (Main.GameOverWin)
package Main {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.text.*;
public dynamic class GameOverWin extends MovieClip {
public var btnMoreGames:MovieClip;
public var txtName:TextField;
public var btnSubmit:MovieClip;
public var btnMainMenu:MovieClip;
public var txtScores:TextField;
public function GameOverWin(){
addFrameScript(0, frame1, 29, frame30, 36, frame37);
}
public function Show(){
this.gotoAndPlay("Show");
}
public function Hide(){
this.gotoAndPlay("Hide");
}
public function Init(){
this.btnSubmit.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnMainMenu.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnMoreGames.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnSubmit.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnMainMenu.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnMoreGames.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnMoreGames.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnMoreGamesDown);
this.btnMainMenu.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnMainMenuDown);
this.btnSubmit.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnSubmitDown);
this.txtScores.text = root.nScores.toString();
}
private function fnMoreGamesDown(_arg1:MouseEvent){
root.sndBtnPress.play();
navigateToURL(new URLRequest(root.strMoreGamePath), "_blank");
}
private function fnSubmitDown(_arg1:MouseEvent){
root.sndBtnPress.play();
navigateToURL(new URLRequest(((((((root.strScoresPath + "&scrore=") + this.txtScores.text) + "&name=") + this.txtName.text) + "&key=") + String((((root.nScores * root.nScores) + (5 * root.nScores)) + 34)))), "_blank");
this.Hide();
}
private function fnMainMenuDown(_arg1:MouseEvent){
root.sndBtnPress.play();
this.Hide();
}
private function fnOver(_arg1:MouseEvent){
_arg1.target.parent.rol = true;
_arg1.target.parent.play();
}
private function fnOut(_arg1:MouseEvent){
_arg1.target.parent.rol = false;
_arg1.target.parent.play();
}
function frame1(){
stop();
}
function frame30(){
this.Init();
stop();
}
function frame37(){
root.nScores = 0;
root.gotoAndStop("Main");
}
}
}//package Main
Section 41
//LevelPreviewItem (Main.LevelPreviewItem)
package Main {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import flash.geom.*;
public dynamic class LevelPreviewItem extends MovieClip {
public var mcLock:MovieClip;
public var Icons:MovieClip;
public var bg:MovieClip;
public var btn:SimpleButton;
public var nLevelType:Number;// = 0
public var nLevelSkill:Number;// = 0
public var Num:Number;// = 0
public var isLocked:Boolean;// = false
public var isLimited:Boolean;// = false
public function LevelPreviewItem(){
addFrameScript(0, frame1, 7, frame8, 13, frame14);
}
public function Update(){
this.Icons.gotoAndStop((this.Num + 1));
if (isLocked){
this.bg.transform.colorTransform = new ColorTransform(0.7, 0.7, 0.7, 1, 0, 0, 0, 0);
this.Icons.transform.colorTransform = new ColorTransform(0.7, 0.7, 0.7, 1, 0, 0, 0, 0);
if (!this.isLimited){
this.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnDownLocked);
} else {
this.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnDownLimited);
};
} else {
this.mcLock.visible = false;
this.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnDown);
};
this.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
}
private function fnDownLimited(_arg1:MouseEvent){
root.sndBtnPress.play();
if (root.CountOpenedLevels < root.nLevelsLimit){
root.mcNoFreeLevelWin.gotoAndPlay("Show");
} else {
root.mcLimitedLevelWin.gotoAndPlay("Show");
};
}
private function fnDownLocked(_arg1:MouseEvent){
root.sndBtnPress.play();
root.mcNoFreeLevelWin.gotoAndPlay("Show");
}
private function fnDown(_arg1:MouseEvent){
root.sndBtnPress.play();
root.nLevelType = this.nLevelType;
root.nLevelSkill = this.nLevelSkill;
root.nLevelNum = this.Num;
root.gotoAndStop("Game");
}
private function fnOver(_arg1:MouseEvent){
_arg1.target.parent.rol = true;
_arg1.target.parent.play();
}
private function fnOut(_arg1:MouseEvent){
_arg1.target.parent.rol = false;
_arg1.target.parent.play();
}
function frame1(){
stop();
}
function frame8(){
if (this.rol){
stop();
};
}
function frame14(){
if (this.rol){
gotoAndPlay("Over");
};
}
}
}//package Main
Section 42
//LevelSelector (Main.LevelSelector)
package Main {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public dynamic class LevelSelector extends MovieClip {
public var btnMoreGames:MovieClip;
public var btnMenu:MovieClip;
public var ar_Items:Array;
public function LevelSelector(){
this.CreateItems();
this.InitBtns();
}
private function CreateItems(){
var _local2:Number;
var _local3:Number;
this.ar_Items = new Array();
var _local1:Number = 0;
while (_local1 < 20) {
_local2 = Math.floor((_local1 / 5));
_local3 = (_local1 - (_local2 * 5));
this.ar_Items.push(new LevelPreviewItem());
this.addChild(this.ar_Items[_local1]);
this.ar_Items[_local1].x = (128 * _local3);
this.ar_Items[_local1].y = (109 * _local2);
this.ar_Items[_local1].nLevelType = _local3;
this.ar_Items[_local1].nLevelSkill = _local2;
if (_local1 >= root.CountOpenedLevels){
this.ar_Items[_local1].isLocked = true;
};
if (_local1 >= root.nLevelsLimit){
this.ar_Items[_local1].isLocked = true;
this.ar_Items[_local1].isLimited = true;
};
this.ar_Items[_local1].Num = _local1;
this.ar_Items[_local1].Update();
_local1++;
};
}
private function InitBtns(){
this.btnMoreGames.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnMenu.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnMoreGames.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnMenu.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnMenu.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnMenuDown);
this.btnMoreGames.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnMoreGamesDown);
}
private function fnMenuDown(_arg1:MouseEvent){
root.sndBtnPress.play();
root.gotoAndStop("Main");
}
private function fnMoreGamesDown(_arg1:MouseEvent){
root.sndBtnPress.play();
navigateToURL(new URLRequest(root.strMoreGamePath), "_blank");
}
private function fnOver(_arg1:MouseEvent){
_arg1.target.parent.rol = true;
_arg1.target.parent.play();
}
private function fnOut(_arg1:MouseEvent){
_arg1.target.parent.rol = false;
_arg1.target.parent.play();
}
}
}//package Main
Section 43
//MainMenu (Main.MainMenu)
package Main {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public dynamic class MainMenu extends MovieClip {
public var btnInstructions:MovieClip;
public var btnMoreGames:MovieClip;
public var btnStart:MovieClip;
public var btnCredits:MovieClip;
public function MainMenu(){
addFrameScript(22, frame23);
}
public function Init(){
this.btnStart.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnInstructions.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnCredits.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnMoreGames.btn.addEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnStart.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnInstructions.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnCredits.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnMoreGames.btn.addEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnStart.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnStartDown);
this.btnMoreGames.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnMoreGamesDown);
this.btnCredits.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnCreditsDown);
this.btnInstructions.btn.addEventListener(MouseEvent.MOUSE_DOWN, fnInstrDown);
}
private function Reset(){
this.btnStart.btn.removeEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnInstructions.btn.removeEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnCredits.btn.removeEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnMoreGames.btn.removeEventListener(MouseEvent.MOUSE_OVER, fnOver);
this.btnStart.btn.removeEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnInstructions.btn.removeEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnCredits.btn.removeEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnMoreGames.btn.removeEventListener(MouseEvent.MOUSE_OUT, fnOut);
this.btnStart.btn.removeEventListener(MouseEvent.MOUSE_DOWN, fnStartDown);
this.btnMoreGames.btn.removeEventListener(MouseEvent.MOUSE_DOWN, fnMoreGamesDown);
this.btnInstructions.btn.removeEventListener(MouseEvent.MOUSE_DOWN, fnInstrDown);
this.btnCredits.btn.removeEventListener(MouseEvent.MOUSE_DOWN, fnCreditsDown);
}
private function fnInstrDown(_arg1:MouseEvent){
root.sndBtnPress.play();
root.mcInstructionsWin.gotoAndPlay("Show");
}
private function fnCreditsDown(_arg1:MouseEvent){
root.sndBtnPress.play();
root.mcCreditsWin.gotoAndPlay("Show");
}
private function fnStartDown(_arg1:MouseEvent){
root.sndBtnPress.play();
this.Reset();
root.gotoAndStop("Levels");
}
private function fnMoreGamesDown(_arg1:MouseEvent){
root.sndBtnPress.play();
navigateToURL(new URLRequest(root.strMoreGamePath), "_blank");
}
private function fnOver(_arg1:MouseEvent){
_arg1.target.parent.rol = true;
_arg1.target.parent.play();
}
private function fnOut(_arg1:MouseEvent){
_arg1.target.parent.rol = false;
_arg1.target.parent.play();
}
function frame23(){
this.Init();
stop();
}
}
}//package Main
Section 44
//MapTypes (Main.MapTypes)
package Main {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class MapTypes {
public var xmlType1:XML;
public var xmlType2:XML;
public var xmlType3:XML;
public var xmlType4:XML;
public var xmlType5:XML;
public var ar_Maps:Array;
public function MapTypes(){
var _local2:Number;
var _local3:Number;
xmlType1 = <MAP>
<LEVEL>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 0 1 1 1 1 1 0 0 0 0</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>0 0 0 0 1 1 1 1 1 0 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 0 1 1 1 1 1 0 0 0 0</LINE>
<LINE>0 0 1 1 1 1 0 1 1 1 1 0 0</LINE>
<LINE>0 1 1 1 1 0 0 0 1 1 1 1 0</LINE>
<LINE>0 1 1 1 1 0 0 0 1 1 1 1 0</LINE>
<LINE>0 0 1 1 1 1 0 1 1 1 1 0 0</LINE>
<LINE>0 0 0 0 1 1 1 1 1 0 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 1 1 1 0 1 1 1 0 0 0</LINE>
<LINE>0 0 1 1 1 0 0 0 1 1 1 0 0</LINE>
<LINE>0 0 1 1 1 0 0 0 1 1 1 0 0</LINE>
<LINE>0 0 0 1 1 1 0 1 1 1 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 1 1 1 0 1 1 1 0 0 0</LINE>
<LINE>0 0 0 1 0 0 0 0 0 1 0 0 0</LINE>
<LINE>0 0 0 1 0 0 0 0 0 1 0 0 0</LINE>
<LINE>0 0 0 1 1 1 0 1 1 1 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
</LEVEL>
</MAP>
;
xmlType2 = <MAP>
<LEVEL>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 1 0 0</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 1 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
</LEVEL>
<LEVEL>
<LINE>0 1 1 1 1 1 1 1 1 1 1 1 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 1 0 0</LINE>
<LINE>0 1 1 1 0 0 1 0 0 1 1 1 0</LINE>
<LINE>0 1 1 1 0 0 1 0 0 1 1 1 0</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 1 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 1 1 1 1 1 1 1 1 1 1 1 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 1 1 1 0 0 0 1 1 1 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 1 1 0 0 1 0 0 1 1 0 0</LINE>
<LINE>0 1 1 1 0 0 1 0 0 1 1 1 0</LINE>
<LINE>0 1 1 1 0 0 1 0 0 1 1 1 0</LINE>
<LINE>0 0 1 1 0 0 1 0 0 1 1 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 1 1 1 0 0 0 1 1 1 0 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 0 1 0 0 1 0 0 1 0 0 0</LINE>
<LINE>0 0 1 1 0 0 0 0 0 1 1 0 0</LINE>
<LINE>0 0 1 1 0 0 0 0 0 1 1 0 0</LINE>
<LINE>0 0 0 1 0 0 1 0 0 1 0 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
</LEVEL>
</MAP>
;
xmlType3 = <MAP>
<LEVEL>
<LINE>0 1 1 0 0 1 1 0 0 1 1 0 0</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 0 0 0 0</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 1 1 0 0 1 1 0 0 1 1 0 0</LINE>
<LINE>0 0 0 0 0 1 1 0 0 0 0 0 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 0 0 0 1 1 0 0 0 0 0 0</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 0 0 0 0</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 0 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 0 0 0 0 0 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 0 0 0 1 1 0 0 0 0 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 0 0 0 0</LINE>
<LINE>0 0 0 1 1 0 0 1 1 0 0 0 0</LINE>
<LINE>0 1 1 1 1 0 0 1 1 1 1 1 0</LINE>
<LINE>0 1 1 1 1 0 0 1 1 1 1 1 0</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 0 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
<LINE>0 0 0 0 1 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 1 1 0 0 1 1 0 0 0 0</LINE>
<LINE>0 0 1 1 1 0 0 1 1 1 0 0 0</LINE>
<LINE>0 0 1 1 1 0 0 1 1 1 0 0 0</LINE>
<LINE>0 0 0 0 1 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
</LEVEL>
</MAP>
;
xmlType4 = <MAP>
<LEVEL>
<LINE>0 0 0 0 1 1 1 1 1 0 0 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 1 0 0</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 1 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 0 0 1 1 1 1 1 0 0 0 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 0 0 0 1 0 1 0 0 0 0 0</LINE>
<LINE>0 0 0 1 1 1 0 1 1 1 0 0 0</LINE>
<LINE>0 0 1 1 1 0 0 0 1 1 1 0 0</LINE>
<LINE>0 1 1 1 1 1 1 1 1 1 1 1 0</LINE>
<LINE>0 1 1 1 1 1 1 1 1 1 1 1 0</LINE>
<LINE>0 0 1 1 1 0 0 0 1 1 1 0 0</LINE>
<LINE>0 0 0 1 1 1 0 1 1 1 0 0 0</LINE>
<LINE>0 0 0 0 0 1 0 1 0 0 0 0 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 0 0 0 1 0 1 0 0 0 0 0</LINE>
<LINE>0 0 0 1 1 1 0 1 1 1 0 0 0</LINE>
<LINE>0 0 0 1 0 0 0 0 0 1 0 0 0</LINE>
<LINE>0 0 1 1 1 1 0 1 1 1 1 0 0</LINE>
<LINE>0 0 1 1 1 1 0 1 1 1 1 0 0</LINE>
<LINE>0 0 0 1 0 0 0 0 0 1 0 0 0</LINE>
<LINE>0 0 0 1 1 1 0 1 1 1 0 0 0</LINE>
<LINE>0 0 0 0 0 1 0 1 0 0 0 0 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
<LINE>0 0 0 0 1 1 0 1 1 0 0 0 0</LINE>
<LINE>0 0 0 1 0 0 0 0 0 1 0 0 0</LINE>
<LINE>0 0 0 1 1 0 0 0 1 1 0 0 0</LINE>
<LINE>0 0 0 1 1 0 0 0 1 1 0 0 0</LINE>
<LINE>0 0 0 1 0 0 0 0 0 1 0 0 0</LINE>
<LINE>0 0 0 0 1 1 0 1 1 0 0 0 0</LINE>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
</LEVEL>
</MAP>
;
xmlType5 = <MAP>
<LEVEL>
<LINE>0 0 1 1 1 1 1 1 1 1 1 0 0</LINE>
<LINE>0 0 1 0 0 1 1 1 0 0 1 0 0</LINE>
<LINE>0 0 1 0 0 1 1 1 0 0 1 0 0</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>1 1 1 1 1 1 1 1 1 1 1 1 1</LINE>
<LINE>0 0 1 0 0 1 1 1 0 0 1 0 0</LINE>
<LINE>0 0 1 0 0 1 1 1 0 0 1 0 0</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 1 0 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 1 0 0</LINE>
<LINE>0 0 1 1 1 1 1 1 1 1 1 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
</LEVEL>
<LEVEL>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 0 1 0 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 0 1 1 1 1 1 1 1 0 0 0</LINE>
<LINE>0 0 0 0 0 1 1 1 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 0 1 0 0 0 0 0 0</LINE>
<LINE>0 0 0 0 0 0 0 0 0 0 0 0 0</LINE>
</LEVEL>
</MAP>
;
super();
this.ar_Maps = new Array();
var _local1:Number = 0;
while (_local1 < 5) {
ar_Maps.push(new Array());
_local2 = 0;
while (_local2 < this[("xmlType" + (_local1 + 1))].LEVEL.length()) {
ar_Maps[_local1].push(new Array());
_local3 = 0;
while (_local3 < this[("xmlType" + (_local1 + 1))].LEVEL[_local2].LINE.length()) {
ar_Maps[_local1][_local2].push(this[("xmlType" + (_local1 + 1))].LEVEL[_local2].LINE[_local3].toString().split(" "));
_local3++;
};
_local2++;
};
_local1++;
};
}
}
}//package Main
Section 45
//Preloader (Main.Preloader)
package Main {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
public dynamic class Preloader extends MovieClip {
public var txtP:TextField;
public var n_percent:Number;// = 0
public function Preloader(){
addEventListener(Event.ENTER_FRAME, Update);
}
public function Update(_arg1:Event):void{
var _local2:Number = stage.loaderInfo.bytesLoaded;
var _local3:Number = stage.loaderInfo.bytesTotal;
var _local4 = "";
var _local5:Number = 0;
if (_local3 > 0){
_local5 = Math.floor(((_local2 / _local3) * 100));
} else {
_local5 = 0;
};
if (this.n_percent < _local5){
this.n_percent = (this.n_percent + ((_local5 - this.n_percent) * 0.3));
};
this.txtP.text = (Math.floor((n_percent + 1)).toString() + " %");
if ((((n_percent >= 99)) && ((_local5 == 100)))){
removeEventListener(Event.ENTER_FRAME, Update);
root.play();
};
}
}
}//package Main
Section 46
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return (MochiServices.getVersion());
}
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:5500, 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{
}, progress_override:function (_arg1:Object):Number{
return (NaN);
}, bar_offset:0};
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;
if (options.skip){
ad_timeout = 0;
};
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 + options.bar_offset);
bar.y = (h - 20);
};
var bar_w:Number = ((w - bar.x) - 10);
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(bar_w, 0);
backing.lineTo(bar_w, 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(bar_w, 0);
inside.lineTo(bar_w, 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(bar_w, 0);
outline.lineTo(bar_w, 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 progress:Number = Math.min(1, options.progress_override(clip));
var f:Function = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
if (!isNaN(progress)){
complete = (progress == 1);
} else {
if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){
complete = true;
} else {
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
};
};
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);
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local12: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;
var _local7:Number = Math.min(1, options.progress_override(_local1));
if (_local7 == 1){
complete = true;
};
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
var _local8:Number = ((100 * _local6) / _local5);
if (!isNaN(_local7)){
_local8 = (100 * _local7);
};
var _local9:Number = ((100 * _local3) / chk.ad_msec);
var _local10:Object = this._mochiad_bar._inside;
var _local11:Number = Math.min(100, Math.min(((_local8) || (0)), _local9));
_local11 = Math.max(this.last_pcnt, _local11);
this.last_pcnt = _local11;
_local10.scaleX = (_local11 * 0.01);
options.ad_progress(_local11);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local8});
if (_local8 >= 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local12 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local12 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local8 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (unloaded){
MochiAd.unload(_local1);
} else {
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:5500, 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);
};
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:5500, 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];
if (Security.sandboxType == "application"){
return (_local2);
};
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var clip:Object;
var mc:MovieClip;
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 (!(clip is DisplayObject)){
trace("Warning: Object passed as container clip not a descendant of the DisplayObject type");
return (null);
};
if (MovieClip(clip).stage == null){
trace("Warning: Container clip for ad is not attached to the stage");
return (null);
};
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;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
var lv:URLVariables = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
if (!options.skip){
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.right - _local3.left);
_local5 = (_local3.top - _local3.bottom);
};
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.as3
Section 47
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_SHOW:String = "StoreShow";
public static const STORE_HIDE:String = "StoreHide";
public static const ITEM_OWNED:String = "ItemOwned";
public static const ITEM_NEW:String = "ItemNew";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static var _inventory:MochiInventory;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showStore(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function requestFunding(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFunding", _arg1);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 48
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Fragment:Number;
private var Sibling:MochiDigits;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function get value():Number{
return (Number(this.toString()));
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
}
}//package mochi.as3
Section 49
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
}
}//package mochi.as3
Section 50
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_CENTER:String = "ALIGN_C";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const FORMAT_SHORT:String = "ShortForm";
public static const FORMAT_LONG:String = "LongForm";
private static var gameStart:Number;
private static var levelStart:Number;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local4:Object;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startPlay(_arg1:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(_arg1)}, null, null);
}
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function trackEvent(_arg1:String, _arg2=null):void{
MochiServices.send("events_trackEvent", {tag:_arg1, value:_arg2}, null, null);
}
}
}//package mochi.as3
Section 51
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _consumableProperties:Object;
private var _syncPending:Boolean;
private var _outstandingID:Number;
private var _syncID:Number;
private var _names:Array;
private var _storeSync:Object;
private static const CONSUMER_KEY:String = "MochiConsumables";
private static const KEY_SALT:String = " syncMaint";
public static const READY:String = "InvReady";
public static const WRITTEN:String = "InvWritten";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
public static const VALUE_ERROR:String = "InvValueError";
public static const NOT_READY:String = "InvNotReady";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (((_arg1.privateProperties) && (_arg1.privateProperties.consumable))){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[(_local2 + KEY_SALT)].value);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
private function sync(_arg1:Event=null):void{
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var _local2:Object = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 52
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
public class MochiServices {
public static const CONNECTED:String = "onConnected";
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 _preserved:Object;
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
private static var _services:String = "services.swf";
private static var _mochiLC:String = "MochiLC.swf";
private static var _swfVersion:String;
private static var _listenChannelName:String = "__ms_";
private static var _sendChannel:LocalConnection;
private static var _sendChannelName:String;
private static var _connecting:Boolean = false;
private static var _connected:Boolean = false;
public static var netup:Boolean = true;
public static var netupAttempted:Boolean = false;
public static var onError:Object;
public static var widget:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _queue:Array;
private static var _nextCallbackID:Number;
private static var _callbacks:Object;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
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 ("3.9.1 as3");
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
public static function get connected():Boolean{
return (_connected);
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
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 {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
} catch(error:Error) {
};
};
}
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);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
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 (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (_arg1 != null){
if ((_arg1 is DisplayObjectContainer)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
var _local3:String = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local3 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local3);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var _local4:URLRequest = new URLRequest(_local3);
var _local5:URLVariables = new URLVariables();
_local5.listenLC = _listenChannelName;
_local5.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local5.api_version = getVersion();
if (widget){
_local5.widget = true;
};
_local4.data = _local5;
_loader.load(_local4);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
private static function detach(_arg1:Event):void{
var _local2:LoaderInfo = LoaderInfo(_arg1.target);
_local2.removeEventListener(Event.COMPLETE, detach);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.removeEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
}
private static function loadLCBridge(_arg1:Object):void{
var _local2:Loader = new Loader();
var _local3:String = (_servURL + _mochiLC);
var _local4:URLRequest = new URLRequest(_local3);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local2.load(_local4);
_arg1.addChild(_local2);
}
private static function loadLCBridgeComplete(_arg1:Event):void{
var _local2:Loader = LoaderInfo(_arg1.target).loader;
_mochiLocalConnection = MovieClip(_local2.content);
listen();
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
} else {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
};
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
private static function onReceive(_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = _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 _callbacks[cb];
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "services":
MochiServices.triggerEvent(_arg1.event, _arg1.args);
break;
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "social":
MochiSocial.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
_local2 = _queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _callbacks[_local2.callbackID];
};
delete _callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
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){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_queue.push({methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_nextCallbackID++;
};
};
}
private static function urlOptions(_arg1:Object):Object{
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://link.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 53
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const LOGGED_OUT:String = "LoggedOut";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const FRIEND_LIST:String = "FriendsList";
public static const PROFILE_DATA:String = "ProfileData";
public static const GAMEPLAY_DATA:String = "GameplayData";
public static const ACTION_CANCELED:String = "onCancel";
public static const ACTION_COMPLETE:String = "onComplete";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_showLoginWidget", {options:_arg1});
}
public static function hideLoginWidget():void{
MochiServices.send("social_hideLoginWidget");
}
public static function requestLogin(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestLogin", _arg1);
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("social_saveUserProperties", _arg1);
}
public static function getFriendsList(_arg1:Object=null):void{
MochiServices.send("social_getFriendsList", _arg1);
}
public static function postToStream(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_postToStream", _arg1);
}
public static function inviteFriends(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_inviteFriends", _arg1);
}
public static function requestFan(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFan", _arg1);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 54
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var _loader:URLLoader;
public var key:String;// = null
public var data;// = null
public var error:Event;// = null
public var operation:String;// = null
public var callback:Function;// = null
public function MochiUserData(_arg1:String="", _arg2:Function=null){
this.key = _arg1;
this.callback = _arg2;
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public function request(_arg1:String, _arg2:ByteArray):void{
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public function getEvent():void{
request("get", serialize(null));
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 55
//Blending (Blending)
package {
import flash.media.*;
public dynamic class Blending extends Sound {
}
}//package
Section 56
//BtnPress (BtnPress)
package {
import flash.media.*;
public dynamic class BtnPress extends Sound {
}
}//package
Section 57
//LevelEnd (LevelEnd)
package {
import flash.media.*;
public dynamic class LevelEnd extends Sound {
}
}//package
Section 58
//MenuMusic (MenuMusic)
package {
import flash.media.*;
public dynamic class MenuMusic extends Sound {
}
}//package
Section 59
//ObjectPress (ObjectPress)
package {
import flash.media.*;
public dynamic class ObjectPress extends Sound {
}
}//package
Section 60
//sndRemovingItems (sndRemovingItems)
package {
import flash.media.*;
public dynamic class sndRemovingItems extends Sound {
}
}//package