Frame 1
function round2(num) {
return(Math.round(num * 100) / 100);
}
stop();
_focusrect = false;
Stage.showMenu = false;
Stage.width = 480;
Stage.height = 360;
Stage.scaleMode = "noScale";
if (downloadURL == undefined) {
preload_logo_mc.onPress = function () {
getURL ("http://www.enkord.com", "_blank");
};
}
percent_mc._xscale = 0;
var to = _root.getBytesTotal();
var prevLo = 0;
total_txt.text = round2(to / 1024).toString() + " KB";
ii = setInterval(function () {
var _local2 = _root.getBytesLoaded();
var _local4 = round2((_local2 - prevLo) / 64);
speed_txt.text = _local4.toString() + " Kb/s";
loaded_txt.text = Math.round(_local2 / 1024).toString() + " KB";
var _local3 = Math.round((_local2 / to) * 100);
percent_txt.text = _local3 + " %";
percent_mc._xscale = _local3;
prevLo = _local2;
if (_local2 == to) {
clearInterval(ii);
gotoAndStop ("load");
}
}, 500);
Frame 2
function getEncodedValue(v, key) {
var _local1 = (v ^ key).toString();
var _local4 = new Array();
_local4.push(key);
var _local2 = new Array();
i = 0;
while (i < _local1.length) {
_local2.push(_local1.charCodeAt(i) ^ key);
i++;
}
_local4.push(_local2.length ^ key);
_local4 = _local4.concat(_local2);
return(_local4.join(","));
}
function getScoreEncoded() {
var _local5 = random(16777215);
var _local4 = random(16777215);
while (_local4 == _local5) {
_local4 = random(16777215);
}
var _local3 = random(16777215);
while ((_local3 == _local5) || (_local3 == _local4)) {
_local3 = random(16777215);
}
var _local2 = random(16777215);
while (((_local2 == _local5) || (_local2 == _local4)) || (_local2 == _local3)) {
_local2 = random(16777215);
}
var _local6 = parseInt(_global.gamelevel) + (15 * (_global.roundgame - 1));
return(new Array(getEncodedValue(_global.totalscore, _local5), getEncodedValue(_local6, _local4), getEncodedValue(_global.totalscore, _local3), getEncodedValue(_local6, _local2)));
}
var rootURL = "http://www.enkord.com/";
var downloadPromotedURL = "http://www.enkord.com/pages.php?s0=contacts";
if (moreGamesURL == undefined) {
moreGamesURL = rootURL;
}
if (downloadURL == undefined) {
downloadURL = rootURL + "games/aerialmahjong/download/?from=webversion";
} else {
greatgames._visible = false;
greatgames_btn.enabled = false;
game_logo_mc._x = 140;
not_our_site = true;
}
if (orderURL == undefined) {
orderURL = rootURL + "games/aerialmahjong/order/?from=webversion";
}
if (hiscoreURL == undefined) {
hiscoreURL = rootURL + (not_our_site ? "games/aerialmahjong/online/hiscore-nolinks.php" : "games/aerialmahjong/online/hiscore.php");
}
var sm = com.enkord.sound.SoundManager.getInstance();
sm.__set___music(((music_trig != undefined) ? false : true));
sm.__set___sound(((sound_trig != undefined) ? false : true));
sm.playSound("menumusic", true, [0, 100], 2000);
signsound.gotoAndPlay((soundEnabled ? "on" : "off"));
signmusic.gotoAndPlay((musicEnabled ? "on" : "off"));
var hintsEnabled = true;
play_txt.embedFonts = (download_txt.embedFonts = (music_txt.embedFonts = (hints_txt.embedFonts = (sound_txt.embedFonts = (desc1_txt.embedFonts = (desc2_txt.embedFonts = true))))));
with (download_btn) {
_xscale = _xscale * -1;
_x = _x + _width;
}
specialCursor = false;
cursor = this.attachMovie("Cursor_mc", "cursor", this.getNextHighestDepth());
var changeCursor = function () {
var _local4 = _root._xmouse;
var _local3 = _root._ymouse;
if ((((_local4 > 480) || (_local4 < 0)) || (_local3 > 360)) || (_local3 < 0)) {
this.cursor._visible = false;
Mouse.show();
} else {
Mouse.hide();
if (!specialCursor) {
this.cursor._visible = true;
}
this.cursor._x = _root._xmouse;
this.cursor._y = _root._ymouse;
}
};
sound_trigger_btn.hitArea = sound_hit_mc;
hints_trigger_btn.hitArea = hints_hit_mc;
music_trigger_btn.hitArea = music_hit_mc;
var rollout = function () {
this._parent.cursor.gotoAndStop(1);
};
var rollover = function () {
this._parent.cursor.gotoAndStop(2);
};
var onrelease = function () {
var _local3 = this._name.substr(0, 5);
var _local2 = com.enkord.sound.SoundManager.getInstance();
if (_local3 == "music") {
_local2.__set___music(!_local2.__get___music());
}
if (_local3 == "sound") {
_local2.__set___sound(!_local2.__get___sound());
}
this.gotoAndStop(((this._currentframe == 1) ? 2 : 1));
};
great_games_btn.onRollOver = function () {
cursor.gotoAndPlay(1);
greatgames.gotoAndPlay("zoom");
_root.playSound("select");
};
great_games_btn.onRelease = function () {
sm.playSound("mouse_click", false, [100]);
_root.getURL(_root.moreGamesURL, "_blank");
};
download_btn.onRelease = function () {
sm.playSound("mouse_click", false, [100]);
getURL (downloadURL, ((_root.downloadTarget != undefined) ? (_root.downloadTarget) : "_blank"));
};
gamestarted = false;
play_btn.onRelease = function () {
sm.playSound("mouse_click", false, [100]);
_root.attachMovie("AutoDeathDarkBlueMovie", "darkblue_mc", _root.getNextHighestDepth());
_global.gamelevel = "1";
_global.totalscore = 0;
_global.roundgame = 1;
ii = setInterval(function () {
clearInterval(ii);
cursor.gotoAndStop(1);
gotoAndStop (3);
}, 666);
};
sound_trigger_btn.onRollOver = (music_trigger_btn.onRollOver = (hints_trigger_btn.onRollOver = rollover));
great_games_btn.onRollOut = (sound_trigger_btn.onRollOut = (music_trigger_btn.onRollOut = (hints_trigger_btn.onRollOut = rollout)));
sound_trigger_btn.onRelease = (music_trigger_btn.onRelease = (hints_trigger_btn.onRelease = onrelease));
Frame 3
MAP = MahjongMap(this.attachMovie("MahjongMap", "mahjongmap_mc", cursor.getDepth() - 1));
Symbol 6 MovieClip [AutoDeathDarkBlueMovie] Frame 40
stop();
removeMovieClip(this);
Symbol 24 MovieClip Frame 1
stop();
Symbol 24 MovieClip Frame 2
play();
Symbol 33 MovieClip Frame 1
function findCursor() {
var _local3 = _parent.cursor;
if (_local3._x != undefined) {
return(_local3);
}
_local3 = _parent.cursorManager;
if (_local3._x != undefined) {
return(_local3);
}
_local3 = _parent._parent.cursor;
if (_local3._x != undefined) {
return(_local3);
}
_local3 = _parent._parent.cursorManager;
if (_local3._x != undefined) {
return(_local3);
}
_local3 = _root.cursor;
if (_local3._x != undefined) {
return(_local3);
}
}
stop();
var my_cursor;
this.hitArea = this.area_mc;
this.area_mc._visible = false;
var tmp = this._name.split("_");
tmp.pop();
var names = (tmp.join("_") + "_txt");
var txt = _parent[names];
this.onRollOver = function () {
txt.textColor = 13158;
if (my_cursor._x == undefined) {
my_cursor = findCursor();
}
my_cursor.gotoAndStop(2);
gotoAndStop (2);
};
this.onRollOut = function () {
txt.textColor = 0;
if (my_cursor._x == undefined) {
my_cursor = findCursor();
}
my_cursor.gotoAndStop(1);
gotoAndStop (1);
};
Symbol 40 MovieClip Frame 1
stop();
Symbol 40 MovieClip Frame 2
stop();
Symbol 44 MovieClip Frame 1
stop();
Symbol 44 MovieClip Frame 2
stop();
Symbol 47 Button
on (rollOver) {
cursor.gotoAndPlay("hand");
}
on (rollOut) {
cursor.gotoAndPlay("arrow");
}
on (release) {
if ((_root.hintsEnabled = !_root.hintsEnabled)) {
hintsMC.gotoAndPlay("on");
} else {
hintsMC.gotoAndPlay("off");
}
}
Symbol 52 MovieClip Frame 1
stop();
Symbol 57 MovieClip Frame 1
_visible = false;
Symbol 78 MovieClip [DestroyTimerEffect] Frame 43
removeMovieClip(this);
Symbol 87 MovieClip [Molnija] Frame 1
stop();
ii = setInterval(function () {
nextFrame();
}, 70);
Symbol 87 MovieClip [Molnija] Frame 4
clearInterval(ii);
removeMovieClip(this);
Symbol 106 MovieClip [Ramka] Frame 40
removeMovieClip(this);
Symbol 107 MovieClip [TileHintMovie] Frame 1
function clearAllIntervals() {
clearInterval(inter);
clearInterval(inter2);
}
count = 0;
inter = setInterval(function () {
if (count == 400) {
clearInterval(inter);
}
attachMovie("TileHintStar", "star" + count, getNextHighestDepth(), {_x:random(25), _y:random(35)});
count++;
}, 20);
var count2 = 0;
var def1 = {xx:-3, yy:0};
var def2 = {xx:31, yy:39};
var dx = 1;
var dy = 0;
var ro1 = 0;
var ro2 = 180;
inter2 = setInterval(function () {
if (count2 == 8000) {
clearInterval(inter2);
removeMovieClip(this);
}
if ((def1.xx == 31) && (def1.yy == 0)) {
dy = 1;
dx = 0;
ro1 = 90;
ro2 = -ro1;
} else if ((def1.xx == 31) && (def1.yy == 39)) {
dy = 0;
dx = -1;
ro1 = 180;
ro2 = 0;
} else if ((def1.xx == -3) && (def1.yy == 39)) {
dy = -1;
dx = 0;
ro1 = -90;
ro2 = -ro;
} else if ((def1.xx == -3) && (def1.yy == 0)) {
dy = 0;
dx = 1;
ro1 = 0;
ro2 = 180;
}
def1.xx = def1.xx + dx;
def1.yy = def1.yy + dy;
def2.xx = def2.xx - dx;
def2.yy = def2.yy - dy;
attachMovie("TileHintWhiteStar", "white" + count2, getNextHighestDepth(), {_x:def1.xx, _y:def1.yy, _rotation:ro1});
attachMovie("TileHintWhiteStar", "white" + count(3), getNextHighestDepth(), {_x:def1.xx, _y:def1.yy, _rotation:ro1});
attachMovie("TileHintWhiteStar", "white" + (count2 + 2), getNextHighestDepth(), {_x:def2.xx, _y:def2.yy, _rotation:ro2});
attachMovie("TileHintWhiteStar", "white" + (count2 + 3), getNextHighestDepth(), {_x:def2.xx, _y:def2.yy, _rotation:ro2});
count2 = count2 + 4;
}, 10);
Symbol 110 MovieClip [TileHintStar] Frame 1
onEnterFrame = function () {
if (random(3) == 1) {
this._x = this._x + ((random(2) == 1) ? 1 : -1);
this._y = this._y + ((random(2) == 1) ? -1 : 1);
}
};
Symbol 110 MovieClip [TileHintStar] Frame 11
removeMovieClip(this);
Symbol 113 MovieClip [TileHintWhiteStar] Frame 1
onEnterFrame = function () {
if (random(2) == 1) {
this._y = this._y + ((random(2) == 1) ? -2 : 2);
}
};
Symbol 113 MovieClip [TileHintWhiteStar] Frame 12
onEnterFrame = function () {
if (random(2) == 1) {
this._y = this._y + ((random(2) == 1) ? -2 : 2);
}
};
removeMovieClip(this);
Symbol 121 MovieClip Frame 1
stop();
Symbol 121 MovieClip Frame 9
stop();
Symbol 132 MovieClip Frame 1
stop();
Symbol 147 MovieClip Frame 1
stop();
this.onRollOver = function () {
gotoAndStop (2);
undo_txt.textColor = 16776960 /* 0xFFFF00 */;
this._parent.cursor.gotoAndStop(2);
};
this.onRollOut = function () {
gotoAndStop (1);
undo_txt.textColor = 16777215 /* 0xFFFFFF */;
this._parent.cursor.gotoAndStop(1);
};
undo_txt.embedFonts = true;
Symbol 150 MovieClip [gamezonemahjong] Frame 1
#initclip 55
Object.registerClass("gamezonemahjong", MahjongTileSet);
#endinitclip
timeout_mc._visible = false;
exit_btn.onPress = function () {
killMe(true);
};
exit_btn.enabled = false;
exit_txt.embedFonts = (score_txt.embedFonts = (matches_txt.embedFonts = true));
preload_txt.embedFonts = true;
preload_txt._alpha = 40;
skip_intro_txt.embedFonts = true;
skip_intro_btn._visible = (skip_intro_txt._visible = false);
Symbol 155 MovieClip Frame 1
stop();
Symbol 155 MovieClip Frame 2
stop();
Symbol 159 MovieClip [DestroyTimerHint] Frame 1
info_txt.embedFonts = true;
Symbol 160 MovieClip [DigitCounter] Frame 1
#initclip 40
Object.registerClass("DigitCounter", DigitCounter);
#endinitclip
Symbol 162 MovieClip [RechangeSphereHint] Frame 1
info_txt.embedFonts = true;
Symbol 171 MovieClip [Hint] Frame 1
#initclip 41
Object.registerClass("Hint", Hint);
#endinitclip
Symbol 197 MovieClip [Sphere] Frame 1
#initclip 42
Object.registerClass("Sphere", Sphera);
#endinitclip
Symbol 198 MovieClip [SphereTab_mc] Frame 1
#initclip 43
Object.registerClass("SphereTab_mc", SpheresTab);
#endinitclip
Symbol 288 MovieClip [MahjongTile_mc] Frame 1
#initclip 44
Object.registerClass("MahjongTile_mc", MahjongTile);
#endinitclip
Symbol 309 MovieClip [MahjongTileLightning] Frame 1
stop();
Symbol 322 MovieClip [UndoGhost] Frame 25
removeMovieClip(this);
Symbol 350 MovieClip [GameZoneTimer] Frame 1
#initclip 45
Object.registerClass("GameZoneTimer", GameZoneTimer);
#endinitclip
Symbol 357 MovieClip Frame 1
stop();
Symbol 358 MovieClip [Bonuses] Frame 1
#initclip 46
Object.registerClass("Bonuses", Bonuses);
#endinitclip
Symbol 394 MovieClip [LevelCompleteFrame] Frame 1
#initclip 47
Object.registerClass("LevelCompleteFrame", LevelCompleteFrame);
#endinitclip
var resultsArr = [];
_sManager = com.enkord.sound.SoundManager.getInstance();
_sManager.playSound("menumusic", true, [0, 100], 4000);
_sManager.fadeOutStop("gamemusic", 800);
Symbol 394 MovieClip [LevelCompleteFrame] Frame 91
function score() {
var _local5 = obj[i];
var _local2 = TextField(this[_local5]);
_local2.embedFonts = true;
var _local3 = __gameResults[i].toString();
_local2.text = _local3;
var _local4 = _local3.length * 4;
this.attachMovie("ScoreEffect", "score" + i, 50 + i, {_x:_local2._x + _local4, _y:_local2._y + (_local2._height / 2)});
i++;
if (i == 9) {
clearInterval(ii);
exit_btn.enabled = true;
}
}
obj = ["bmatched_txt", "sused_txt", "tspent_txt", "sbonus_txt", "strbonus_txt", "pbonus_txt", "score_txt", "tbonus_txt", "total_score_txt"];
i = 0;
var ramka = ResizablePopUp(ramka_mc.attachMovie("ResizablePopUp", "bg", 1));
com.enkord.sound.SoundManager.getInstance().playSound("show_level_result", false, [100]);
ramka.setAttributes(0, 0, 448, 275);
exit_txt.embedFonts = true;
exit_btn.enabled = false;
ii = setInterval(this, "score", 350);
Symbol 394 MovieClip [LevelCompleteFrame] Frame 149
stop();
pressed = false;
exit_btn.onPress = mx.utils.Delegate.create(this, function () {
if (pressed) {
return(undefined);
}
pressed = true;
gotoAndPlay(_currentframe + 1);
_global.gamelevel = (parseInt(_global.gamelevel) + 1).toString();
__gameZoneRef.killMe();
com.enkord.sound.SoundManager.getInstance().playSound("mouse_click", false, [100]);
});
Symbol 394 MovieClip [LevelCompleteFrame] Frame 184
_global.gamelevel = _global.gamelevel + 1;
_parent.killMe();
Symbol 397 MovieClip Frame 1
stop();
onRollOver = function () {
_root.cursor.gotoAndStop(2);
gotoAndStop (2);
};
onRollOut = function () {
_root.cursor.gotoAndStop(1);
gotoAndStop (1);
};
Symbol 403 MovieClip [MahjongMap] Frame 1
#initclip 48
Object.registerClass("MahjongMap", MahjongMap);
#endinitclip
score_txt.embedFonts = (play_txt.embedFonts = true);
Symbol 412 MovieClip Frame 1
stop();
Symbol 415 MovieClip Frame 1
_visible = false;
Symbol 416 MovieClip Frame 1
this.onRelease = function () {
getURL (_root.downloadURL, "_blanc");
};
Symbol 417 MovieClip [MahjongMapPoint] Frame 1
#initclip 49
Object.registerClass("MahjongMapPoint", MahjongMapPoint);
#endinitclip
stop();
Symbol 417 MovieClip [MahjongMapPoint] Frame 4
this.useHandCursor = false;
adverts_mc._visible = false;
ref = null;
me = this;
par = _parent._parent;
spec.onRollOver = function () {
var _local1 = MovieClip(par.adverts);
if (_local1._x != undefined) {
clearInterval(_local1.ii);
_local1.removeMovieClip();
}
if (!par.__playpressed) {
ref = par.attachMovie("MapAdvertsHint", "adverts", par.getNextHighestDepth(), {_x:me._x - 140, _y:me._y + 10});
}
};
Symbol 423 MovieClip [MapCloud] Frame 1
#initclip 50
Object.registerClass("MapCloud", MapCloud);
#endinitclip
stop();
Symbol 425 MovieClip [LevelLabel] Frame 1
#initclip 51
Object.registerClass("LevelLabel", AnimatedLabel);
#endinitclip
Symbol 445 MovieClip [Advertising] Frame 1
par = _parent;
me = this;
continue_txt.embedFonts = (download_txt.embedFonts = true);
with (continue_btn) {
_xscale = _xscale * -1;
_x = _x + _width;
}
download_btn.onRelease = function () {
getURL (_root.downloadURL, ((_root.downloadTarget != undefined) ? (_root.downloadTarget) : "_blank"));
};
continue_btn.onPress = function () {
par.attachMovie("AutoDeathDarkBlueMovie", "darkblue_mc", par.getNextHighestDepth());
workInter = setInterval(function () {
clearInterval(workInter);
par.newInit();
me.removeMovieClip();
}, 680);
};
var adsDepth = 1;
var g = 0;
while (g < 8) {
var b = 0;
while (b < 6) {
bg_container.attachMovie("adsBg", "bg" + adsDepth.toString(), adsDepth, {_x:g * 64, _y:b * 64});
adsDepth++;
b++;
}
g++;
}
stop();
Symbol 462 MovieClip [GameComplete] Frame 1
function validate() {
var _local1 = your_name_txt.text;
var _local2 = false;
if (_local1.charAt(0) == " ") {
_local1 = _local1.substring(1);
_local2 = true;
}
var _local3 = _local1.length;
if (_local1.charAt(_local3 - 1) == " ") {
_local1 = _local1.substr(0, _local3 - 1);
_local2 = true;
}
your_name_txt.text = _local1;
if (_local2) {
validate();
}
}
function checkMouse() {
var _local5 = your_name_txt._x;
var _local3 = your_name_txt._x + your_name_txt._width;
var _local2 = your_name_txt._y;
var _local4 = your_name_txt._y + your_name_txt._height;
if ((((_xmouse > _local5) && (_xmouse < _local3)) && (_ymouse > _local2)) && (_ymouse < _local4)) {
_root.specialCursor = true;
_root.cursor._visible = false;
} else {
_root.specialCursor = false;
}
}
par = _parent;
me = this;
again_txt.embedFonts = (download_txt.embedFonts = true);
with (again_btn) {
_xscale = _xscale * -1;
_x = _x + _width;
}
var adsDepth = 1;
var g = 0;
while (g < 12) {
var b = 0;
while (b < 9) {
bg_container.attachMovie("adsBg", "bg" + adsDepth.toString(), adsDepth, {_x:g * 40, _y:b * 40});
adsDepth++;
b++;
}
g++;
}
download_btn.onPress = function () {
getURL (_root.downloadURL, ((_root.downloadTarget != undefined) ? (_root.downloadTarget) : "_blank"));
};
pressed = false;
again_btn.onPress = function () {
if (pressed) {
return(undefined);
}
pressed = true;
par.attachMovie("AutoDeathDarkBlueMovie", "darkblue_mc", par.getNextHighestDepth());
workInter = setInterval(function () {
clearInterval(workInter);
_global.gamelevel = "1";
_global.roundgame = _global.roundgame + 1;
par.newInit();
me.removeMovieClip();
}, 680);
};
total_score_txt.text = _global.totalscore;
your_name_txt.onSetFocus = function () {
if (this.text == "your name here") {
this.text = "";
}
};
onMouseMove = checkMouse;
your_name_txt.backgroundColor = 13158;
your_name_txt.borderColor = 26316;
submit_btn.onRelease = function () {
if (your_name_txt.text == "your name here") {
mess_txt.text = "You have to enter your name before clicking 'submit'";
return(undefined);
}
validate();
if (your_name_txt.text.length < 2) {
mess_txt.text = "You have to enter your name before clicking 'submit'";
return(undefined);
}
_global.gamelevel = _global.gamelevel - 1;
var _local4 = _root.getScoreEncoded();
var _local3 = new LoadVars();
_local3.name = your_name_txt.text;
(_local3.d1 = _local4[0].toString());
(_local3.d2 = _local4[1].toString());
(_local3.d3 = _local4[2].toString());
(_local3.d4 = _local4[3].toString());
_local3.send(_root.hiscoreURL, "_blank", "POST");
};
stop();
Symbol 468 MovieClip Frame 1
stop();
this.hitArea = this.area_mc;
this.area_mc._visible = false;
Symbol 469 MovieClip [MapAdvertsHint] Frame 1
var res = ResizablePopUp(ramka_mc.attachMovie("ResizablePopUp", "pop", 1));
res.setAttributes(0, 0, 210, 120);
download_btn.onRollOver = function () {
this.gotoAndStop(2);
_root.cursor.gotoAndStop(2);
};
download_btn.onRollOut = function () {
this.gotoAndStop(1);
_root.cursor.gotoAndStop(1);
};
download_btn.onRelease = function () {
_root.getURL(_root.downloadURL, "_blank");
};
clearInterval(ii);
checkForMouse = function () {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
return(true);
}
return(false);
};
ii = setInterval(function () {
clearInterval(ii);
onEnterFrame = function () {
if (!checkForMouse()) {
delete onEnterFrame;
this.removeMovieClip();
}
};
}, 1000);
Symbol 474 MovieClip [ScoreEffect] Frame 40
this.removeMovieClip();
Symbol 481 MovieClip [LevelHint] Frame 1
#initclip 52
Object.registerClass("LevelHint", LevelHint);
#endinitclip
Symbol 494 MovieClip [ResizablePopUp] Frame 1
#initclip 53
Object.registerClass("ResizablePopUp", ResizablePopUp);
#endinitclip
Symbol 552 MovieClip [GameZoneTimeOut] Frame 1
#initclip 54
Object.registerClass("GameZoneTimeOut", TimeOutPopUp);
#endinitclip
function checkMouse() {
var _local5 = your_name_txt._x;
var _local3 = your_name_txt._x + your_name_txt._width;
var _local2 = your_name_txt._y;
var _local4 = your_name_txt._y + your_name_txt._height;
if ((((_xmouse > _local5) && (_xmouse < _local3)) && (_ymouse > _local2)) && (_ymouse < _local4)) {
_root.specialCursor = true;
_root.cursor._visible = false;
} else {
_root.specialCursor = false;
}
}
function validate() {
var _local1 = your_name_txt.text;
var _local2 = false;
if (_local1.charAt(0) == " ") {
_local1 = _local1.substring(1);
_local2 = true;
}
var _local3 = _local1.length;
if (_local1.charAt(_local3 - 1) == " ") {
_local1 = _local1.substr(0, _local3 - 1);
_local2 = true;
}
your_name_txt.text = _local1;
if (_local2) {
validate();
}
}
par = _parent;
me = this;
again_txt.embedFonts = (download_txt.embedFonts = true);
with (again_btn) {
_xscale = _xscale * -1;
_x = _x + _width;
}
var adsDepth = 1;
var g = 0;
while (g < 12) {
var b = 0;
while (b < 9) {
bg_container.attachMovie("adsBg", "bg" + adsDepth.toString(), adsDepth, {_x:g * 40, _y:b * 40});
adsDepth++;
b++;
}
g++;
}
download_btn.onPress = function () {
getURL (_root.downloadURL, ((_root.downloadTarget != undefined) ? (_root.downloadTarget) : "_blank"));
};
pressed = false;
again_btn.onPress = function () {
if (pressed) {
return(undefined);
}
pressed = true;
par.killMe();
clearInterval(workInter);
_global.gamelevel = "1";
_global.roundgame = 1;
_global.totalscore = 0;
};
total_score_txt.text = _global.totalscore;
your_name_txt.onSetFocus = function () {
if (this.text == "your name here") {
this.text = "";
}
};
onMouseMove = checkMouse;
your_name_txt.backgroundColor = 13158;
your_name_txt.borderColor = 39372;
submit_btn.onRelease = function () {
if (your_name_txt.text == "your name here") {
mess_txt.text = "You have to enter your name before clicking 'submit'";
return(undefined);
}
validate();
if (your_name_txt.text.length < 2) {
mess_txt.text = "You have to enter your name before clicking 'submit'";
return(undefined);
}
var _local3 = _root.getScoreEncoded();
var _local2 = new LoadVars();
_local2.name = your_name_txt.text;
(_local2.d1 = _local3[0].toString());
(_local2.d2 = _local3[1].toString());
(_local2.d3 = _local3[2].toString());
(_local2.d4 = _local3[3].toString());
_local2.send(_root.hiscoreURL, "_blank", "POST");
};
stop();
Symbol 576 MovieClip Frame 1
stop();
Symbol 577 MovieClip [__Packages.com.enkord.sound.SoundManager] Frame 0
class com.enkord.sound.SoundManager extends MovieClip
{
static var instance;
var __sound_counter, __soundsCollection, __sound, __music;
function SoundManager () {
super();
__sound_counter = 0;
__soundsCollection = [];
}
static function getInstance() {
if (instance == null) {
instance = create(_root, "GlobalSoundManager", -16500);
}
return(instance);
}
static function create(this_mc, name, depth, init_obj) {
return(com.enkord.sound.SoundManager(com.enkord.utils.McFactory.create(this_mc, name, depth, init_obj, com.enkord.sound.SoundManager)));
}
function set _sound(value) {
__sound = value;
//return(_sound);
}
function set _music(value) {
__music = value;
if (value) {
startAllMusics();
} else {
stopAllMusics();
}
//return(_music);
}
function get _music() {
return(__music);
}
function get _sound() {
return(__sound);
}
function getById(id) {
var _local3 = -1;
var _local4 = __soundsCollection.length;
while (_local3++ , _local3 < _local4) {
var _local2 = __soundsCollection[_local3];
if (_local2.id == id) {
return(_local2);
}
}
return(null);
}
function removeById(id, super_id) {
var _local3 = -1;
var _local5 = __soundsCollection.length;
while (_local3++ , _local3 < _local5) {
var _local2 = com.enkord.sound.GameSound(__soundsCollection[_local3]);
if ((_local2.id == id) && ((super_id == undefined) || (super_id == _local2.__get___superid()))) {
_local2.stop();
_local2.removeMovieClip();
delete __soundsCollection[_local3];
__soundsCollection.splice(_local3, 1);
break;
}
}
}
function playSound(id, repeat, volume, fade, completeHandler, completeFadeHandler) {
if ((!__sound) && (!repeat)) {
return(false);
}
if ((!__music) && (repeat)) {
return(false);
}
var _local2 = com.enkord.sound.GameSound.create(this, ("new_sound" + id) + random(100000000), instance.getNextHighestDepth());
_local2.id = id;
_local2.__set___superid(__sound_counter);
_local2.repeat = repeat;
_local2.fadeArray = volume;
_local2.fadeTime = fade;
_local2.completeHandler = completeHandler;
_local2.fadeCompleteHandler = completeFadeHandler;
__soundsCollection.push(_local2);
__sound_counter++;
var _local3 = _local2.start();
return(_local3);
}
function stopAll() {
for (var _local3 in __soundsCollection) {
var _local2 = com.enkord.sound.GameSound(__soundsCollection[_local3]);
_local2.stop();
removeById(_local2.id, _local2.__get___superid());
}
}
function startAllMusics() {
for (var _local3 in __soundsCollection) {
var _local2 = __soundsCollection[_local3];
if (_local2.repeat) {
_local2.start();
}
removeById(_local2.id, _local2.__get___superid());
}
}
function stopAllSounds() {
for (var _local3 in __soundsCollection) {
var _local2 = __soundsCollection[_local3];
if (!_local2.repeat) {
_local2.stop();
removeById(_local2.id, _local2.__get___superid());
}
}
}
function stopAllMusics() {
for (var _local3 in __soundsCollection) {
var _local2 = __soundsCollection[_local3];
if (_local2.repeat) {
_local2.stop();
}
}
}
function pauseAll() {
for (var _local2 in __soundsCollection) {
com.enkord.sound.GameSound(__soundsCollection[_local2]).pause();
}
}
function pauseAllMusics() {
for (var _local3 in __soundsCollection) {
var _local2 = __soundsCollection[_local3];
if (_local2.repeat) {
_local2.pause();
}
}
}
function resumeAll() {
for (var _local2 in __soundsCollection) {
com.enkord.sound.GameSound(__soundsCollection[_local2]).resume();
}
}
function resumeAllMusics() {
for (var _local3 in __soundsCollection) {
var _local2 = __soundsCollection[_local3];
if (_local2.repeat) {
_local2.resume();
}
}
}
function resumeAllWithFade(time) {
var _local2 = -1;
var _local3 = __soundsCollection.length;
while (_local2++ , _local2 < _local3) {
resumeWithFadeSound(com.enkord.sound.GameSound(__soundsCollection[_local2]).id, time);
}
}
function pauseAllWithFade(time) {
var _local2 = -1;
var _local3 = __soundsCollection.length;
while (_local2++ , _local2 < _local3) {
pauseWithFadeSound(com.enkord.sound.GameSound(__soundsCollection[_local2]).id, time);
}
}
function pauseSound(id) {
getById(id).pause(false);
}
function pauseWithFadeSound(id, time) {
getById(id).pauseWithFade(time);
}
function resumeWithFadeSound(id, time) {
getById(id).resumeWithFade(time);
}
function resumeSound(id) {
getById(id).resume();
}
function stopSound(id) {
for (var _local4 in __soundsCollection) {
var _local2 = com.enkord.sound.GameSound(__soundsCollection[_local4]);
if (_local2.id == id) {
removeById(id, _local2.__get___superid());
}
}
}
function fadeAllSoundsVolumeTo(volume, time) {
for (var _local3 in __soundsCollection) {
com.enkord.sound.GameSound(__soundsCollection[_local3]).fadeVolumeTo(volume, time);
}
}
function fadeVolumeTo(id, volume, time, handler) {
getById(id).fadeVolumeTo(volume, time, handler);
}
function fadeOutStop(id, time) {
fadeVolumeTo(id, 0, time, mx.utils.Delegate.create(this, removeById));
}
}
Symbol 578 MovieClip [__Packages.com.enkord.utils.McFactory] Frame 0
class com.enkord.utils.McFactory
{
function McFactory () {
}
static function create(this_mc, name, depth, init_obj, current_constructor) {
var _local2 = this_mc.createEmptyMovieClip(name, depth);
_local2.__proto__ = current_constructor.prototype;
for (var _local3 in init_obj) {
_local2[_local3] = init_obj[_local3];
}
current_constructor.call(_local2);
return(_local2);
}
}
Symbol 579 MovieClip [__Packages.com.enkord.sound.GameSound] Frame 0
class com.enkord.sound.GameSound extends MovieClip
{
var __playing, _paused, __superid, repeat, id, _conv, completeHandler, _sound, fadeArray, fadeTime, _curPosition, _curVolume;
function GameSound () {
super();
__playing = (_paused = false);
}
static function create(this_mc, name, depth, init_obj) {
return(com.enkord.sound.GameSound(com.enkord.utils.McFactory.create(this_mc, name, depth, init_obj, com.enkord.sound.GameSound)));
}
function get _playing() {
return(__playing);
}
function get _superid() {
return(__superid);
}
function set _superid(value) {
__superid = value;
//return(_superid);
}
function onComplete() {
if (!repeat) {
com.enkord.sound.SoundManager.getInstance().removeById(id, __superid);
_conv.stop();
completeHandler();
}
}
function start() {
_sound = new Sound(this);
_sound.attachSound(id);
if (!isNaN(_sound.duration)) {
_sound.start(0, (repeat ? 100000000 : 1));
_sound.setVolume(fadeArray[0]);
_sound.onSoundComplete = mx.utils.Delegate.create(this, onComplete);
if (id == "blocks_makepair") {
}
if (fadeArray.length > 1) {
fadeVolumeTo(fadeArray[1], fadeTime);
}
__playing = true;
return(true);
}
return(false);
}
function stop() {
if (id == "blocks_makepair") {
}
_conv.stop();
_sound.stop();
}
function pause(not_save_volume) {
if (_paused) {
return(undefined);
}
_curPosition = (repeat ? 0 : (_sound.position));
if (not_save_volume == undefined) {
_curVolume = _sound.getVolume();
}
_sound.setVolume(0);
_sound.stop();
_paused = true;
}
function resume(from_volume) {
if (!_paused) {
return(undefined);
}
_sound.start(Math.round(_curPosition / 1000), (repeat ? 100000000 : 0));
_sound.setVolume(((from_volume == undefined) ? (_curVolume) : (from_volume)));
_paused = false;
}
function fadeVolumeTo(volume, time, completeHandler) {
_conv.stop();
_conv = new com.enkord.utils.Conveyor();
if (time > _sound.duration) {
time = _sound.duration;
}
var _local6 = _sound.getVolume();
var _local3 = volume - _local6;
var _local4 = ((time > 1) ? (Math.floor(time / 100)) : 1);
var _local5 = -1;
_local3 = _local3 / _local4;
while (_local5++ , _local5 < _local4) {
_conv.addToQueue(this, function (delta) {
this._sound.setVolume(this._sound.getVolume() + delta);
}, [Math.round(_local3)], ((time > 1) ? 100 : 0));
}
_conv.addToQueue(this, function (id, superid, handler) {
handler(id, superid);
}, [id, __superid, completeHandler], 0);
_conv.start();
}
function pauseWithFade(time) {
if (_paused) {
return(undefined);
}
if (time > _sound.duration) {
time = _sound.duration;
}
_curPosition = _sound.position;
_curVolume = _sound.getVolume();
fadeVolumeTo(0, time);
_conv.addToQueue(this, pause, [true], 0);
}
function resumeWithFade(time) {
if (!_paused) {
return(undefined);
}
if (time > _sound.duration) {
time = _sound.duration;
}
resume(0);
_paused = false;
fadeVolumeTo(_curVolume, time);
}
function toString() {
return((((((((("GameSound object\rid: " + id) + "\rvolume: ") + _sound.getVolume()) + "\rposition: ") + _sound.position) + "\rpaused: ") + _paused) + "\rplaying: ") + __playing);
}
}
Symbol 580 MovieClip [__Packages.com.enkord.utils.Conveyor] Frame 0
class com.enkord.utils.Conveyor
{
var __queue, __completeQuies, __queueLength, __stackDump, __debugMode, __started, __suspended, __delay;
function Conveyor () {
__queue = [];
__completeQuies = (__queueLength = 0);
__stackDump = [];
__debugMode = false;
__started = (__suspended = false);
}
function startFirstQueue() {
if (!__started) {
return(undefined);
}
var _local2 = __queue[0];
__delay = setInterval(this, "startQueue", _local2.callDelay);
}
function startQueue() {
clearInterval(__delay);
if (!__started) {
return(undefined);
}
var _local2 = __queue[0];
if (_local2.suspended && (__suspended)) {
return(undefined);
}
_local2.callFunction.apply(_local2.scopeObject, _local2.funcArguments);
__completeQuies++;
if (__debugMode) {
__stackDump[__completeQuies][0] = getTimer();
}
delete __queue[0];
__queue.shift();
__queueLength--;
if (__queueLength == 0) {
onQueueComplete();
return(undefined);
}
var _local3 = __queue[0];
if (_local3.callDelay == 0) {
startQueue();
} else {
__delay = setInterval(this, "startQueue", _local3.callDelay);
}
}
function addToQueue(scopeObject, func, args, delay, id) {
if ((id == undefined) && (__debugMode)) {
}
var _local2 = new com.enkord.utils.ConveyorQueueObject(scopeObject, func, args, delay, __suspended, id);
__queue.push(_local2);
if (__debugMode) {
__stackDump.push([0, _local2]);
}
if (__queueLength == 0) {
startFirstQueue();
}
__queueLength++;
}
function start() {
if (__started) {
return(undefined);
}
__started = true;
startFirstQueue();
}
function stop() {
__started = false;
for (var _local2 in __queue) {
delete __queue[_local2];
}
__queue = [];
}
function suspend() {
__suspended = true;
}
function resume() {
__suspended = false;
startFirstQueue();
}
function dump() {
if (__debugMode == false) {
return(undefined);
}
var _local7 = -1;
var _local11 = __stackDump.length;
if (_local11 == 0) {
} else {
while (_local7++ , _local7 < _local11) {
var _local2 = __stackDump[_local7][1];
var _local5 = __stackDump[_local7][0];
var _local6 = _local5 == 0;
var _local10 = (_local6 ? " wait " : "complete ");
var _local4 = _local5.toString();
var _local3 = (_local2.suspended ? " (susp.)" : "");
var _local9 = (_local6 ? ("0" + com.enkord.utils.StringUtils.countedDuplicate(" ", 8)) : (_local4 + com.enkord.utils.StringUtils.countedDuplicate(" ", 9 - _local4.length)));
var _local8 = (_local2.id + _local3) + com.enkord.utils.StringUtils.countedDuplicate(" ", 40 - (_local2.id.length + _local3.length));
}
}
}
function clearDump() {
__stackDump = [];
}
function get _length() {
return(__queueLength);
}
function set _debug(value) {
__debugMode = value;
//return(_debug);
}
function get _debug() {
return(__debugMode);
}
function get _started() {
return(__started);
}
function get _queue() {
return(__queue);
}
function onQueueComplete() {
}
}
Symbol 581 MovieClip [__Packages.com.enkord.utils.ConveyorQueueObject] Frame 0
class com.enkord.utils.ConveyorQueueObject
{
var scopeObject, callFunction, funcArguments, argsLength, callDelay, suspended, id;
function ConveyorQueueObject (scope, func, args, delay, suspend, operationId) {
scopeObject = scope;
callFunction = func;
funcArguments = args;
argsLength = args.length;
callDelay = ((delay == undefined) ? 0 : (delay));
suspended = suspend;
id = operationId;
}
}
Symbol 582 MovieClip [__Packages.com.enkord.utils.StringUtils] Frame 0
class com.enkord.utils.StringUtils extends String
{
function StringUtils () {
super();
}
static function countedDuplicate(pattern, count) {
var _local1 = "";
var _local2 = -1;
while (_local2++ , _local2 < count) {
_local1 = _local1 + pattern;
}
return(_local1);
}
static function capitalizeFirstLetter(phrase, delimiter) {
if (delimiter == undefined) {
delimiter = " ";
}
var _local4 = phrase.split(delimiter);
var _local3 = [];
var _local2 = -1;
var _local5 = _local4.length;
while (_local2++ , _local2 < _local5) {
var _local1 = _local4[_local2];
_local3.push(_local1.substr(0, 1).toUpperCase() + _local1.substring(1));
}
return(_local3.join(delimiter));
}
}
Symbol 583 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 584 MovieClip [__Packages.ResizablePopUp] Frame 0
class ResizablePopUp extends MovieClip
{
var __width, line2, corner3, corner2, __height, line3, corner4, line1, line4, _x, __x, _y, __y, point;
function ResizablePopUp () {
super();
}
function onLoad() {
corner2._x = (corner3._x = (line2._x = __width - 28));
corner3._y = (corner4._y = (line3._y = __height - 28));
var _local2 = (__width - 84) * 100;
var _local3 = (__height - 84) * 100;
line1._xscale = (line3._xscale = _local2);
line2._yscale = (line4._yscale = _local3);
_x = __x;
_y = __y;
point._xscale = _local2 + 200;
point._yscale = _local3 + 100;
}
function setAttributes(xx, yy, wi, he) {
__x = xx;
__y = yy;
__width = ((wi > 85) ? (wi) : 85);
__height = ((he > 85) ? (he) : 85);
}
}
Symbol 585 MovieClip [__Packages.DigitCounter] Frame 0
class DigitCounter extends MovieClip
{
var __added, attachMovie, getNextHighestDepth, _x, _y, animInter, _alpha;
function DigitCounter () {
super();
}
function onLoad() {
__added = true;
__me = this;
var _local2 = 1;
while (_local2 < 6) {
this["dig" + _local2] = attachMovie("SimpleDigit", "SD" + _local2, getNextHighestDepth(), {_x:_local2 * DIGIT_SPACING, _y:0, _visible:false});
_local2++;
}
if (((__x != 0) && (__y != 0)) && (__count != "")) {
start();
}
}
function attributes(xx, yy, count) {
__y = yy;
__x = xx;
__count = "+" + count.toString();
if (__added) {
start();
}
}
function start() {
var _local3 = __count.length;
var _local2 = 0;
while (_local2++ , _local2 < 6) {
this["dig" + _local2]._visible = ((_local2 <= _local3) ? true : false);
this["dig" + _local2].md._x = ((_local2 > 1) ? (-(parseInt(__count.charAt(_local2 - 1)) * DIGIT_WIDTH)) : -180);
}
_x = __x - ((__count.length * DIGIT_SPACING) / 2);
_y = __y;
clearInterval(animInter);
_alpha = 100;
animInter = setInterval(function (obj) {
if (obj._alpha > 0) {
obj._alpha = obj._alpha - 4;
obj._y = obj._y - 3;
} else {
clearInterval(obj.animInter);
}
}, 40, this);
}
var __x = 0;
var __y = 0;
var __count = "";
static var DIGIT_SPACING = 10;
static var DIGIT_WIDTH = 18;
}
Symbol 586 MovieClip [__Packages.Hint] Frame 0
class Hint extends MovieClip
{
var __text, createTextField, __txt, my_txt, __tf, gotoAndStop, __get___text, _width, _height;
function Hint () {
super();
}
function set _text(value) {
__text = value;
createTextField("my_txt", 1, 8, 8, 60, 0);
__txt = my_txt;
__tf = new TextFormat("Tahoma", 9, 16777113);
__tf.align = "center";
__txt.selectable = false;
__txt.autoSize = "center";
__txt.wordWrap = true;
__txt.width = 60;
__txt._x = 8;
__txt._y = 10;
__txt.text = value;
__txt.setTextFormat(__tf);
(gotoAndStop(((__txt._height > 25) ? "full" : "short")));// not popped
alignTextField();
//return(__get___text());
}
function alignTextField() {
__txt._x = (_width / 2) - (__txt._width / 2);
__txt._y = (_height / 2) - (__txt._height / 2);
}
function onLoad() {
}
}
Symbol 587 MovieClip [__Packages.Sphera] Frame 0
class Sphera extends MovieClip
{
var __type, __gameZoneRef, __get___gamezone, __count, _visible, count_txt, __clickable, __get___clickable, gotoAndStop, useHandCursor, __hint, attachMovie, getNextHighestDepth, prevFrame, nextFrame;
function Sphera () {
super();
}
function set _type(value) {
__type = value;
//return(_type);
}
function get _type() {
return(__type);
}
function set _gamezone(value) {
__gameZoneRef = value;
//return(__get___gamezone());
}
function set _count(value) {
__count = value;
_visible = ((__count <= 0) ? false : true);
var _local2 = TextField(count_txt);
_local2.text = __count.toString();
_local2.embedFonts = true;
//return(_count);
}
function get _count() {
return(__count);
}
function set _clickable(value) {
__clickable = value;
//return(__get___clickable());
}
function onLoad() {
(gotoAndStop(__type * 2));// not popped
__clickable = true;
__gameZoneRef.events.addEventListener(MahjongTileSet.GLOBAL_LOCK, mx.utils.Delegate.create(this, onLock));
__gameZoneRef.events.addEventListener(MahjongTileSet.GLOBAL_UNLOCK, mx.utils.Delegate.create(this, onUnlock));
}
function onLock() {
__clickable = (useHandCursor = false);
}
function onUnlock() {
__clickable = (useHandCursor = true);
}
function onPress() {
if (!__clickable) {
return(undefined);
}
_count = (__count);
__gameZoneRef.events.dispatchEvent({type:MahjongTileSet.SPHERE_EVENT, target:this});
}
function onRollOver() {
if (!__clickable) {
return(undefined);
}
__hint = Hint(attachMovie("Hint", "hint", getNextHighestDepth(), {_x:40, _y:-15}));
__hint.__set___text(HINTS[__type - 1]);
__gameZoneRef.cursorManager.gotoAndStop(2);
(prevFrame());// not popped
__rolloved = true;
}
function onRollOut() {
if ((!__clickable) || (!__rolloved)) {
return(undefined);
}
Mouse.removeListener(list);
__hint.removeMovieClip();
__gameZoneRef.cursorManager.gotoAndStop(1);
(nextFrame());// not popped
__rolloved = false;
}
var __rolloved = false;
static var HINTS = new Array("Hint", "Reshuffle tiles", "Transform one type of tile into another", "Start destruction timer", "Interchange two tiles", "Call the power of lightning");
}
Symbol 588 MovieClip [__Packages.MahjongTileSet] Frame 0
class MahjongTileSet extends MovieClip
{
var conveyor, _sManager, mapRef, __get___map, __score, events, pause_bg, __timer, __pause, __containerCoo, __get___containerCoo, __gamelevel, __get___gamelevel, score_txt, undo_btn, __gameMessage, createEmptyMovieClip, getNextHighestDepth, attachMovie, __stats, spheresTab, cursorManager, onMouseMove, container, curLevelArray, clickableTileArray, __transformtypefirst, __transformtypefirstref, workInter, __interchangefirstref, undoInter, __interchange, __initializing, __inanType, __destroytimer, __transformtype, curClickedTileRef, __lastClickType, __specialBonus, __lastClickTime, drawInter, __bonuses, history, undo1, undo2, skip_intro_btn, skip_intro_txt, hintInter, bg_mc, level_label_mc, level_hint, __complete, undotile1, undotile2, un1, un2, topPoverx, __gamemode, percent_txt, matches_txt, __levelsArrays, gamemode_mc, __sorter, __goldTiles, createTextField, tilesCreated, curTileToCreate, preload_txt, youlose_mc, DestroyTimerHint, RechangeSphereHint;
function MahjongTileSet () {
super();
conveyor = new com.enkord.utils.Conveyor();
conveyor.start();
_sManager = com.enkord.sound.SoundManager.getInstance();
}
function set _map(map) {
mapRef = map;
//return(__get___map());
}
function get _score() {
return(__score);
}
function set _pause(value) {
events.dispatchEvent({type:(value ? (GLOBAL_LOCK) : (GLOBAL_UNLOCK))});
if (value) {
gameMessage("pause");
_sManager.pauseAllWithFade(1000);
} else {
_sManager.resumeAllWithFade(1000);
MovieClip(pause_bg).removeMovieClip();
}
__timer.__set___pause(value);
__pause = value;
//return(_pause);
}
function get _pause() {
return(__pause);
}
function set _score(value) {
__score = value;
//return(_score);
}
function set _containerCoo(coo) {
__containerCoo = coo;
//return(__get___containerCoo());
}
function set _gamelevel(value) {
__gamelevel = value;
//return(__get___gamelevel());
}
function onLoad() {
score_txt.text = __score.toString();
undo_btn._visible = ((__gamelevel == 1) ? false : true);
initTimer();
conveyor.addToQueue(this, function () {
this.__levelsArrays = new MahjongLevels(this);
this.__gamemode = MahjongLevels.getMode(this.__gamelevel);
this.newInit(false);
this.initUndoButton();
this.initSpheresTab();
this.initCursors();
}, [], 1000);
conveyor.addToQueue(this, function () {
this.makeNewLevel();
}, [], 700);
conveyor.start();
}
function hurryUp() {
var _local2 = mx.utils.Delegate.create(this, function () {
this.__gameMessage.removeMovieClip();
});
gameMessage("HURRY UP!", _local2, 2000, 16777215, true);
}
function gameMessage(mess, handler, time, color, without_black) {
__gameMessage.removeMovieClip();
if (without_black == undefined) {
var _local2 = createEmptyMovieClip("pause_bg", getNextHighestDepth());
_local2.lineStyle(0, 0, 0);
_local2.beginFill(3355443, 50);
com.enkord.design.Drawing.drawRectangle(_local2, 0, 0, 480, 360);
}
__gameMessage = GameMessage.create(((without_black == undefined) ? (_local2) : this), "game_message", getNextHighestDepth(), {_handler:handler, _time:time, _message:mess, _color:((color == undefined) ? 16777215 : (color))});
__gameMessage._x = (480 - __gameMessage._width) / 2;
__gameMessage._y = (250 - __gameMessage._height) / 2;
}
function initTimer() {
__timer = GameZoneTimer(attachMovie("GameZoneTimer", "timer_mc", getNextHighestDepth(), {_x:13, _y:328}));
__timer.__set___gamezone(this);
__stats = new GameStat(this);
}
function initSpheresTab() {
spheresTab = SpheresTab(attachMovie("SphereTab_mc", "spheretab", getNextHighestDepth(), {_y:-25}));
spheresTab.__set___gamezone(this);
}
function initCursors() {
cursorManager = _root.cursor;
_root.cursor._visible = false;
onMouseMove = mx.utils.Delegate.create(this, function () {
this.cursorManager._x = _root._xmouse;
this.cursorManager._y = _root._ymouse;
});
cursorManager.gotoAndStop(1);
}
function initUndoButton() {
undo_btn.onPress = mx.utils.Delegate.create(this, function () {
this.makeUndo();
});
}
function onMouseDown() {
var _local3 = 1;
while (_local3 < 16) {
if (container["poverx" + __hex[_local3]].hitTest(_root._xmouse, _root._ymouse, true)) {
return(undefined);
}
_local3++;
}
events.dispatchEvent({type:"outOfTiles"});
clearTilesSlectData();
}
function removeFromLevelArray(element) {
var _local2 = -1;
var _local3 = curLevelArray.length;
while (_local2++ , _local2 < _local3) {
if (curLevelArray[_local2].pos == element) {
curLevelArray.splice(_local2, 1);
return(_local2);
}
}
}
function addToLevelArray(ind, element, types) {
var _local2 = -1;
var _local6 = curLevelArray.length;
var _local3 = new Array();
var _local7 = false;
if (ind >= _local6) {
curLevelArray.push({pos:element, type:types});
return(undefined);
}
while (_local2++ , _local2 < _local6) {
if (_local2 == ind) {
_local3.push({pos:element, type:types});
_local7 = true;
}
_local3.push(curLevelArray[_local2]);
}
curLevelArray = _local3;
}
function sphereDestroy(evt) {
if (parseInt(evt.target._specialtype) > 6) {
evt.target.deselectMe();
return(undefined);
}
var _local3;
var _local8 = clickableTileArray.length - 1;
var _local5 = 0;
var _local7;
var _local4 = evt.target;
while (_local5 < _local8) {
_local3 = inClickableArray(_local4.__get___type(), evt.index);
if (_local3.length > 0) {
var _local2 = findMovieByPosition(_local3[0]);
if (_local2.checkedForDestroyTimer == false) {
_local4.destroyByTimer(_local2);
_local2.destroyByTimer();
_local7 = true;
break;
}
}
_local5++;
}
if (!_local7) {
_local4.deselectMe();
}
}
function sphereTransform(evt) {
var _local5 = evt.target._type.toString();
if (parseInt(evt.target._specialtype) > 6) {
evt.target.deselectMe();
return(undefined);
}
if (__transformtypefirst == "") {
__transformtypefirst = _local5;
__transformtypefirstref = evt.target;
} else if (_local5 != __transformtypefirst) {
var _local2 = -1;
var _local6 = curLevelArray.length;
var _local3;
var _local4;
while (_local2++ , _local2 < _local6) {
_local3 = curLevelArray[_local2].pos;
_local4 = curLevelArray[_local2].type;
if (_local4 == _local5) {
findMovieByPosition(_local3).makeTransformToType(parseInt(__transformtypefirst));
curLevelArray[_local2].pos = _local3;
curLevelArray[_local2].type = __transformtypefirst;
}
}
events.dispatchEvent({type:SpheresTab.TRANSFORM_TYPE_END});
events.dispatchEvent({type:SPHERE_EVENT_END});
clearInterval(workInter);
__transformtypefirstref.deselectMe();
evt.target.deselectMe();
workInter = setInterval(mx.utils.Delegate.create(this, function () {
clearInterval(this.workInter);
this.recalculateGameZone();
}), 1500);
} else {
evt.target.deselectMe();
}
}
function sphereInterchange(evt) {
var _local5 = evt.target;
if (__interchangefirstref == undefined) {
__interchangefirstref = evt.target;
} else if (_local5.__get___type() != __interchangefirstref.__get___type()) {
events.dispatchEvent({type:SpheresTab.INTERCHANGE_END});
events.dispatchEvent({type:SPHERE_EVENT_END});
var _local8 = addStaticTile("interch1", _local5.__get___type(), _local5._globalCoo.x, _local5._globalCoo.y);
var _local7 = addStaticTile("interch2", __interchangefirstref.__get___type(), __interchangefirstref._globalCoo.x, __interchangefirstref._globalCoo.y);
var _local11 = _local5._globalCoo.x - __interchangefirstref._globalCoo.x;
var _local9 = __interchangefirstref._globalCoo.x - _local5._globalCoo.x;
var _local10 = _local5._globalCoo.y - __interchangefirstref._globalCoo.y;
var _local13 = __interchangefirstref._globalCoo.y - _local5._globalCoo.y;
_local8.snakeMoving(_local11, _local10, 20);
_local7.snakeMoving(_local9, _local13, 20);
__interchangefirstref.deselectMe();
_local5.deselectMe();
var _local12 = function (obj, pos1, pos2, type1, type2) {
var _local1 = 0;
var _local7 = obj.curLevelArray.length;
var _local4 = 0;
while (_local1++ , _local1 < _local7) {
var _local3 = obj.curLevelArray[_local1].pos;
if (_local3 == pos1) {
obj.curLevelArray[_local1].pos = pos1;
obj.curLevelArray[_local1].type = type1;
_local4++;
continue;
}
if (_local3 == pos2) {
obj.curLevelArray[_local1].pos = pos2;
obj.curLevelArray[_local1].type = type2;
_local4++;
continue;
}
if (_local4 == 2) {
return(undefined);
}
}
};
_local12(this, __interchangefirstref.__get___position(), _local5.__get___position(), _local5.__get___type(), __interchangefirstref.__get___type());
workInter = setInterval(mx.utils.Delegate.create(this, function (o1, o2, t1, t2) {
o1.vspywka();
o2.vspywka();
o1.__set___type(t1);
o2.__set___type(t2);
clearInterval(this.workInter);
}), 560, __interchangefirstref, _local5, _local5.__get___type(), __interchangefirstref.__get___type());
undoInter = setInterval(mx.utils.Delegate.create(this, function () {
clearInterval(this.undoInter);
this.__interchangefirstref = undefined;
this.events.dispatchEvent({type:MahjongTileSet.SPHERE_EVENT_END});
this.recalculateGameZone();
}), 900);
} else {
__interchange = false;
_local5.deselectMe();
__interchange = true;
}
}
function onTileClick(evt) {
if (__initializing) {
return(undefined);
}
var _local2 = evt.target;
var _local3 = parseInt(_local2.__get___specialtype());
if ((_local3 == 7) && (_local2.__get___clickable())) {
_sManager.playSound("block_selectgold", false, [100]);
collectGoldTile(_local2);
return(undefined);
}
if (((_local3 == 8) || (_local3 == 9)) && (_local2.__get___clickable())) {
if (__inanType == undefined) {
__inanType = _local3;
} else if (_local3 != __inanType) {
events.dispatchEvent({type:GLOBAL_LOCK});
_sManager.playSound("yingyang", false, [100]);
conveyor.addToQueue(this, function () {
this.events.dispatchEvent({type:MahjongTileSet.LEVEL_COMPLETE});
}, [], 4000);
return(undefined);
}
} else {
__inanType = undefined;
}
if (__destroytimer) {
sphereDestroy(evt);
return(undefined);
}
if (__transformtype) {
var _local5 = MahjongTile(evt.target);
if ((parseInt(_local5.__get___specialtype()) > 6) && (!_local5.__get___clickable())) {
return(undefined);
}
sphereTransform(evt);
return(undefined);
}
if (__interchange) {
sphereInterchange(evt);
return(undefined);
}
if (curClickedTileRef == null) {
_sManager.playSound("block_select", false, [100]);
}
if (curClickedTileRef._name === _local2._name) {
_local2.deselectMe();
curClickedTileRef = null;
} else {
if (!_local2.__get___clickable()) {
_sManager.playSound("block_wrong", false, [100]);
return(undefined);
}
curClickedTileRef.deselectMe();
_local2.selectMe();
}
if (ifThisTilesCanBeMathced(curClickedTileRef.__get___type(), _local2.__get___type())) {
match2Tiles(curClickedTileRef, evt.target, false, true);
curClickedTileRef = null;
_sManager.playSound("blocks_makepair", false, [100]);
return(undefined);
}
_sManager.playSound("block_wrong", false, [100]);
curClickedTileRef = _local2;
return(undefined);
}
function addStaticTile(name, type, xx, yy, special) {
var _local2 = MahjongTile(attachMovie("MahjongTile_mc", name, getNextHighestDepth()));
_local2.__set___gamezone(this);
_local2.__set___type(type);
_local2._x = xx;
_local2._y = yy;
_local2.__set___specialtype(((special == undefined) ? "0" : (special)));
_local2.__set___static(true);
return(_local2);
}
function addOneSphere(type) {
spheresTab.addOneSphere(type);
}
function checkSpeciality(t1, t2) {
var _local7 = false;
var _local8 = spheresTab.__get___hide();
for (var _local9 in arguments) {
var _local3 = arguments[_local9];
if (_local3.__get___specialtype() > 0) {
var _local4 = _local3.__get___globalCoo();
var _local5 = _local3.__get___specialtype();
var _local6 = (this["specTiles" + _local3._name] = addStaticTile(_local3._name + "S", _local3.__get___type(), _local4.x, _local4.y));
_local6.__set___specialtype(_local5);
_local6.snakeMoving(_local4.x - (_local8 ? -95 : 15), _local4.y - ((parseInt(_local5) * SpheresTab.SPHERES_VERTICAL_SPACING) - 25), 10);
_local7 = true;
}
}
return(_local7);
}
function checkSpecialBonus(type, xx, yy) {
if ((type == (__lastClickType + 1)) && (type < 28)) {
__specialBonus = Bonuses(attachMovie("Bonuses", "bonuses_mc", getNextHighestDepth()));
__specialBonus.__set___gamezone(this);
var _local3 = 5;
var _local2 = 1;
while (_local2++ , _local2 <= __streetBonusCount) {
_local3 = _local3 + (20 * _local2);
}
__specialBonus.viewBonus(1, _local3, xx, yy);
__score = __score + _local3;
__stats.plusStreetBonus();
__streetBonusCount++;
__pairBonusCount = 1;
com.enkord.sound.SoundManager.getInstance().playSound("bonus_score", false, [100]);
return(true);
}
if (type == __lastClickType) {
__specialBonus = Bonuses(attachMovie("Bonuses", "bonuses_mc", getNextHighestDepth()));
__specialBonus.__set___gamezone(this);
var _local3 = 5;
var _local2 = 1;
while (_local2++ , _local2 <= __pairBonusCount) {
_local3 = _local3 + (15 * _local2);
}
__specialBonus.viewBonus(3, _local3, xx, yy);
__score = __score + _local3;
__stats.plusPairBonus();
__pairBonusCount++;
__streetBonusCount = 1;
com.enkord.sound.SoundManager.getInstance().playSound("bonus_score", false, [100]);
return(true);
}
if (((getTimer() - __lastClickTime) < 4000) && (__lastClickTime != undefined)) {
__specialBonus = Bonuses(attachMovie("Bonuses", "bonuses_mc", getNextHighestDepth()));
__specialBonus.__set___gamezone(this);
__specialBonus.viewBonus(2, 5, xx, yy);
__score = __score + 20;
__stats.plusSpeedBonus();
com.enkord.sound.SoundManager.getInstance().playSound("bonus_score", false, [100]);
return(true);
}
return(false);
}
function collectGoldTile(tile) {
events.dispatchEvent({type:GLOBAL_LOCK});
removeFromLevelArray(tile.__get___position());
tile._visible = false;
quickRecalculate(tile.__get___position());
var _local5 = ((__goldTilesCollected == 0) ? 0 : (__goldTilesCollected % 4));
var _local7 = Math.floor(__goldTilesCollected / 4);
var _local4 = 423;
var _local3 = 115;
_local3 = _local3 + (_local7 * 32);
_local3 = _local3 - (_local5 * 4);
_local4 = _local4 + (_local5 * 4);
var _local6 = (this["gold" + tile._name] = addStaticTile("goldie" + tile._name, -1, tile._globalCoo.x, tile._globalCoo.y, "7"));
_local6.snakeMoving(tile._globalCoo.x - _local4, tile._globalCoo.y - _local3, 20);
_local6.swapDepths(cursorManager);
__goldTilesCollected++;
recalculateGameZone(true);
}
function match2Tiles(tile1, tile2, destroy, recalc) {
__firstMatched = true;
__matched++;
clearInterval(drawInter);
var _local5 = tile1.__get___position();
var _local4 = tile2.__get___position();
var _local11 = removeFromLevelArray(_local5);
var _local10 = removeFromLevelArray(_local4);
var _local14 = parseInt(score_txt.text);
if (!destroy) {
events.dispatchEvent({type:GLOBAL_LOCK});
}
if (!checkSpecialBonus(tile1.__get___type(), tile2._globalCoo.x, tile2._globalCoo.y)) {
__pairBonusCount = (__streetBonusCount = 2);
}
__lastClickTime = getTimer();
__lastClickType = tile1._type;
__stats.plusMatch();
tile1.paired();
tile2.paired();
var _local12 = checkSpeciality(tile1, tile2);
var _local7 = countMyBonus();
__bonuses.attributes(tile2._x, tile2._y, _local7);
__score = __score + _local7;
score_txt.text = __score.toString();
if (history.length == 0) {
var _local9 = (undo1 = addStaticTile("un1", tile1.__get___type(), 258, 306));
_local9.swapDepths(cursorManager);
var _local8 = (undo2 = addStaticTile("un2", tile2.__get___type(), 303, 306));
_local8.swapDepths(cursorManager);
_local9.__set___widthProp(27);
_local8.__set___widthProp(27);
} else {
undo1._type = tile1._type;
undo2._type = tile2._type;
}
var _local13 = score_txt.text - _local14;
history.push((((((((((((_local5 + "^") + _local4) + "^") + _local11) + "^") + _local10) + "^") + tile1.__get___type().toString()) + "^") + tile2.__get___type().toString()) + "^") + _local13.toString());
clearTilesSlectData();
var _local15 = ((__destroytimer || (_local12)) ? 1500 : 800);
if (recalc) {
quickRecalculate(_local5, _local4);
recalculateGameZone(true);
}
var _local6 = matchForHint["l" + __gamelevel]["m" + __matched];
if (_local6 != undefined) {
viewGameHint(_local6);
}
}
function setClassicSkin() {
events.dispatchEvent(CLASSIC_SKIN);
}
function setEasySkin() {
events.dispatchEvent(EASY_SKIN);
}
function countStars() {
var _local2 = "";
if (mapRef.__get___round() == 1) {
return(_local2);
}
if (mapRef.__get___round() == 2) {
return("*");
}
return("*" + (mapRef.__get___round() - 1).toString());
}
function onDrawingLevelComplete() {
_root._highquality = 1;
events.dispatchEvent({type:GLOBAL_LOCK});
killAllIntervals();
if (__gamelevel.length < 3) {
conveyor.addToQueue(this, function () {
if (this.__gamelevel.length < 3) {
this._sManager.playSound("new_level", false, [100]);
}
var _local3 = this.createEmptyMovieClip("bg_mc", this.getNextHighestDepth());
_local3._y = 122;
_local3.lineStyle(1, 13421772, 30);
_local3.beginFill(2236962, 65);
com.enkord.design.Drawing.drawRectangle(_local3, 0, 0, 220, 50);
_local3._x = 240 - (_local3._width / 2);
var _local2 = AnimatedLabel(this.attachMovie("LevelLabel", "level_label_mc", this.getNextHighestDepth()));
_local2.__set___label((("Level " + this.__gamelevel) + " ") + this.countStars());
_local2.__set___autoalign({x:true, y:false});
_local2._y = 120;
_local2.onComplete = mx.utils.Delegate.create(this, this.animatedLabelComplete);
_local2.__set___textformat(new TextFormat("Forte MT", 38, 16777215));
_local2.settings(30, 20, 4100, 70, [0, 100], 30, 800);
}, [], 1500);
} else {
addDrawingCompleteRecalculate();
}
}
function addDrawingCompleteRecalculate() {
var _local3 = 1 - ((mapRef.__get___round() - 1) * 0.25);
__timer.start(com.enkord.utils.MathUtils.multiplicate(parseInt(curLevelArray[0]), 0.5, _global.roundgame - 1));
recalculateGameZone();
mapRef.initCheats();
viewGameHint(1);
__initializing = false;
if (parseInt(__gamelevel) == 1) {
skip_intro_btn.enabled = true;
skip_intro_btn._visible = (skip_intro_txt._visible = true);
skip_intro_btn.onPress = mx.utils.Delegate.create(this, function () {
this.__gamelevel = "1_4";
this.skip_intro_btn.enabled = false;
this.onWin();
});
}
hintInter = setInterval(mx.utils.Delegate.create(this, function () {
clearInterval(this.hintInter);
if ((!this.__firstMatched) && (!this.__complete)) {
this.makeAutoMatch(1, false);
}
}), 11000);
}
function animatedLabelComplete() {
MovieClip(bg_mc).removeMovieClip();
MovieClip(level_label_mc).removeMovieClip();
addDrawingCompleteRecalculate();
cursorManager.gotoAndStop(1);
}
function killLevelHint() {
MovieClip(level_hint).removeMovieClip();
delete level_hint;
}
function getHint() {
killLevelHint();
return(LevelHint(attachMovie("LevelHint", "level_hint", getNextHighestDepth())));
}
function viewGameHint(hint) {
var _local2;
if ((mapRef.__get___round() > 1) || (__complete)) {
return(undefined);
}
if (__gamelevel == "1") {
switch (hint) {
case 1 :
_local2 = getHint();
_local2.__set___text("To play this game you must match pairs of identical tiles. Find and click matching pairs, one by one");
_local2.setCoo({x:275, y:160});
_local2.setArrowsCoo({x:-55, y:-40, r:2}, {x:10, y:-25, r:4});
break;
case 2 :
_local2 = getHint();
_local2.__set___text("Great! Try Again");
_local2.setCoo({x:275, y:160});
}
} else if (__gamelevel == "1_1") {
_local2 = getHint();
_local2.__set___text("You can only select tiles not covered by other tiles. They must also have a free left or right side");
_local2.setCoo({x:275, y:160});
} else if (__gamelevel == "1_2") {
switch (hint) {
case 1 :
_local2 = getHint();
_local2.__set___text("Some tiles can be matched when they have different pictures. Tiles with the seasons, for example. Try them!");
_local2.setCoo({x:275, y:160});
break;
case 2 :
_local2 = getHint();
_local2.__set___text("The same applies with flower tiles");
_local2.setCoo({x:275, y:160});
break;
case 3 :
_local2 = getHint();
_local2.__set___text("Wind tiles, too");
_local2.setCoo({x:275, y:160});
}
} else if (__gamelevel == "1_3") {
_local2 = getHint();
_local2.__set___text("To finish this level you must gather all the tiles");
_local2.setCoo({x:275, y:180});
} else if (__gamelevel == "3") {
_local2 = getHint();
_local2.__set___text("In these levels you must gather all the gold bricks to win. Click on them");
_local2.setCoo({x:20, y:20});
_local2.setArrowsCoo({x:215, y:100, r:2}, {x:253, y:115, r:4});
} else if (__gamelevel == "7") {
_local2 = getHint();
_local2.__set___text("Match black and white tiles to free the rainbow spray");
_local2.setCoo({x:15, y:200});
_local2.setArrowsCoo({x:153, y:-83, r:3}, {x:292, y:-35, r:1});
} else {
return(undefined);
}
_sManager.playSound("hint_sound", false, [100]);
}
function transTilePosition(obj) {
var _local2 = {x:0, y:0};
_local2.x = (container._x + obj.pX) + obj.x;
_local2.y = (container._y + obj.pY) + obj.y;
return(_local2);
}
function makeUndo() {
if (history.length == 0) {
return(false);
}
_sManager.playSound("undo", false, [100]);
events.dispatchEvent({type:GLOBAL_LOCK});
var _local9 = history[history.length - 1].split("^");
var _local4 = [{pos:_local9[0], ind:_local9[2], type:_local9[4]}, {pos:_local9[1], ind:_local9[3], type:_local9[5]}];
var _local8;
var _local12;
var _local6;
var _local5;
_local4.sortOn("ind");
var _local2 = 0;
while (_local2 < 2) {
var _local3 = container["poverx" + _local4[_local2].pos.charAt(0)];
for (var _local7 in _local3) {
if (_local3[_local7]._position == _local4[_local2].pos) {
addToLevelArray(_local4[_local2].ind, _local4[_local2].pos, _local4[_local2].type);
if (_local2 == 0) {
_local6 = _local3[_local7];
} else {
_local5 = _local3[_local7];
}
}
}
_local2++;
}
_local8 = transTilePosition({x:_local6._x, y:_local6._y, pX:_local6._parent._x, pY:_local6._parent._y});
_local12 = transTilePosition({x:_local5._x, y:_local5._y, pX:_local5._parent._x, pY:_local5._parent._y});
var _local11 = (undotile1 = addStaticTile("undo_anim1", _local4[0].type, 234, 307));
var _local10 = (undotile2 = addStaticTile("undo_anim2", _local4[1].type, 279, 307));
_local11.__set___widthProp(26);
_local10.__set___widthProp(26);
clearInterval(undoInter);
quickRecalculate(_local6.__get___position(), _local5.__get___position(), true);
_local11.snakeMoving(235 - _local8.x, 308 - _local8.y, 15, _local6, true, true);
_local10.snakeMoving(280 - _local12.x, 308 - _local12.y, 15, _local5, true, false);
history.pop();
__score = __score - parseInt(_local9[6]);
score_txt.text = __score.toString();
if (history.length == 0) {
un1.removeMovieClip();
un2.removeMovieClip();
delete undo1;
delete undo2;
} else {
_local9 = history[history.length - 1].split("^");
undo1._type = _local9[4];
undo2._type = _local9[5];
}
return(true);
}
function recalculateGameZone(quick) {
topPoverx = parseInt(com.enkord.utils.ArrayUtils.lastElementInArray(curLevelArray).pos.charAt(0), 16);
if (!quick) {
clickableTileArray = [];
var _local2 = 0;
var _local5 = curLevelArray.length;
while (_local2++ , _local2 < _local5) {
var _local3 = curLevelArray[_local2].pos;
var _local10 = curLevelArray[_local2].type;
var _local4 = curLevelArray[_local2].spt;
if (ifClickable(_local3)) {
clickableTileArray.push([_local3, _local10, _local4]);
}
}
}
if (clickableTileArray.length == 0) {
events.dispatchEvent({type:SPHERE_EVENT_END});
}
events.dispatchEvent({type:GAMEZONE_CHANGED});
if (__gamemode == 0) {
percent_txt.text = getMatchesPercent().toString() + "%";
} else if (__gamemode == 1) {
var _local7 = getGoldsLeft();
percent_txt.text = _local7.toString() + " left";
if (_local7 == 0) {
events.dispatchEvent({type:LEVEL_COMPLETE});
return(undefined);
}
}
if ((curLevelArray.length == 1) && (__gamemode == 0)) {
events.dispatchEvent({type:LEVEL_COMPLETE});
return(undefined);
}
var _local8 = countMatches();
matches_txt.text = _local8.toString();
if (_local8 == 0) {
var _local6 = mx.utils.Delegate.create(this, function () {
this.__gameMessage.removeMovieClip();
});
if (coundClickableGold() > 0) {
gameMessage("No moves available. Gather the golden tiles to go further", _local6, 5000, 16777215, true);
} else if (seeForBlackWhite()) {
gameMessage("To complete the level gather black and white tiles", _local6, 5000, 16777215, true);
} else if (spheresTab.haveLastChanceSpheres()) {
gameMessage("Use the spheres - they could really help you!", _local6, 5000, 16777215, true);
} else if (curLevelArray.length > 1) {
onLose({why:"matches"});
return(undefined);
}
}
events.dispatchEvent({type:GLOBAL_UNLOCK});
}
function coundClickableGold() {
var _local2 = -1;
var _local4 = clickableTileArray.length;
var _local3 = 0;
while (_local2++ , _local2 < _local4) {
if (clickableTileArray[_local2][2] == "7") {
_local3++;
}
}
return(_local3);
}
function seeForBlackWhite() {
var _local3 = [];
for (var _local4 in clickableTileArray) {
var _local2 = clickableTileArray[_local4];
if (_local2[2] > 7) {
_local3.push(_local2.spt);
}
}
return(_local3.length == 2);
}
function quickRecalculate(pos, pos2, undo) {
var _local2 = -1;
var _local8 = clickableTileArray.length;
var _local6 = 0;
do {
_local2++;
if (_local2 >= _local8) {
break;
}
if ((clickableTileArray[_local2][0] == pos) || (clickableTileArray[_local2][0] == pos2)) {
clickableTileArray.splice(_local2, 1);
_local2--;
_local6++;
}
} while (_local6 != 2);
var _local17 = function (pos, ref) {
if (pos == undefined) {
return([]);
}
var _local3 = [];
var _local5 = [];
var _local1 = ref.shiftNums(pos, [0], [-1]);
var _local6;
if (_local1.charAt(0) == "0") {
_local6 = true;
}
if ((_local1.charAt(2) == "0") && (_local1.charAt(4) == "0")) {
if (!_local6) {
_local3 = ref.simplePos(_local1);
}
_local5 = ref.quickShiftPos(pos, 1);
} else if ((_local1.charAt(2) == "1") && (_local1.charAt(4) == "1")) {
if (!_local6) {
_local3 = ref.crossPos(_local1);
}
_local5 = ref.quickShiftPos(pos, 4);
} else if (_local1.charAt(2) == "1") {
if (!_local6) {
_local3 = ref.xshiftPos(_local1);
}
_local5 = ref.quickShiftPos(pos, 2);
} else if (_local1.charAt(4) == "1") {
if (!_local6) {
_local3 = ref.yshiftPos(_local1);
}
_local5 = ref.quickShiftPos(pos, 3);
}
var _local7 = com.enkord.utils.ArrayUtils.concat2Arrays(_local3, _local5);
if (pos.charAt(0) != "1") {
_local7.push(_local1);
}
return(_local7);
};
var _local18 = _local17(pos, this);
var _local15 = _local17(pos2, this);
var _local7 = com.enkord.utils.ArrayUtils.concat2Arrays(_local18, _local15);
for (var _local14 in _local7) {
var _local3 = findMovieByPosition(_local7[_local14]);
_local3.smallRecalculate(undo);
}
var _local16 = [_local18];
if (_local15.length > 0) {
_local16.push(_local15);
}
return(_local16);
}
function quickShiftPos(pos, flag) {
var _local2 = new Array();
if ((flag == 1) || (flag == 2)) {
_local2.push(shiftNums(pos, [1, 3, 4], [-1, -1, 1]));
_local2.push(shiftNums(pos, [1, 3, 4], [1, -1, 1]));
_local2.push(shiftNums(pos, [1], [1]));
_local2.push(shiftNums(pos, [1, 4], [1, 1]));
_local2.push(shiftNums(pos, [1, 4], [-1, 1]));
_local2.push(shiftNums(pos, [1], [-1]));
} else {
_local2.push(shiftNums(pos, [1, 4], [-1, -1]));
_local2.push(shiftNums(pos, [1, 4], [1, -1]));
_local2.push(shiftNums(pos, [1], [1]));
_local2.push(shiftNums(pos, [1, 3, 4], [1, 1, -1]));
_local2.push(shiftNums(pos, [1, 3, 4], [-1, 1, -1]));
_local2.push(shiftNums(pos, [1], [-1]));
}
return(_local2);
}
function cleanGameZone() {
var _local4 = 1;
while (_local4 < 8) {
var _local3 = container["poverx" + _local4];
for (var _local5 in _local3) {
var _local2 = _local3[_local5];
_local2.fullRemoveMe();
_local2.removeMovieClip();
}
_local4++;
}
}
function makeNewLevel() {
events.dispatchEvent({type:GLOBAL_LOCK});
curLevelArray = __levelsArrays.getLevelArray(__gamelevel);
__matched = 0;
topPoverx = parseInt(curLevelArray[curLevelArray.length - 1].pov, 16);
gamemode_mc.gotoAndStop("m" + __gamemode);
__sorter = new Sorter(this);
curLevelArray = __sorter.normLevel(curLevelArray);
__goldTiles = __sorter._goldtiles;
var _local6;
var _local4 = new TextFormat("Forte MT", 18, 16777215);
_local4.align = "center";
createTextField("percent_txt", getNextHighestDepth(), 409, 59, 69, 25);
var _local3 = TextField(percent_txt);
_local3.autoSize = "center";
_local3.multiline = true;
_local3.wordWrap = true;
_local3.selectable = false;
_local3.embedFonts = true;
if (__gamemode == 1) {
_local6 = __goldTiles + " left";
} else if (__gamemode == 2) {
_local6 = "Match black and white blocks";
_local4.font = "Tahoma";
_local4.size = 12;
} else {
_local6 = "0%";
}
_local3.setNewTextFormat(_local4);
_local3.text = _local6;
history = new Array();
var _local9 = container;
_local9._x = __containerCoo.x;
_local9._y = __containerCoo.y;
cleanGameZone();
tilesCreated = 0;
curTileToCreate = 1;
curTilePoverx = 1;
_root._highquality = 0;
TextField(preload_txt)._visible = false;
com.enkord.sound.SoundManager.getInstance().playSound("blocks_makepair", true, [100]);
drawInter = setInterval(mx.utils.Delegate.create(this, function () {
if (this.curTileToCreate == this.curLevelArray.length) {
clearInterval(this.drawInter);
com.enkord.sound.SoundManager.getInstance().stopSound("blocks_makepair");
this.events.dispatchEvent({type:MahjongTileSet.DRAWING_LEVEL_COMPLETE});
return(undefined);
}
var _local2 = this.curLevelArray[this.curTileToCreate];
var _local4 = _local2.pos;
var _local6 = _local2.type;
var _local3 = _local4.charAt(0);
var _local5 = _local2.spt;
if (parseInt(_local3) != this.curTilePoverx) {
this.curTilePoverx = parseInt(_local3);
}
this.addTileOnPosition(this.container["poverx" + _local3], _local4, _local6, this.curTileToCreate, _local5);
}), 30);
}
function findMovieByPosition(pos) {
var _local2 = container["poverx" + pos.charAt(0)];
for (var _local4 in _local2) {
if (_local2[_local4]._position == pos) {
return(_local2[_local4]);
}
}
return(null);
}
function makeAutoMatch(flag, recalc) {
if (flag == undefined) {
flag = 0;
}
if (recalc == undefined) {
recalc = true;
}
if (flag == 1) {
com.enkord.sound.SoundManager.getInstance().playSound("hint_sound", false, [100]);
}
var _local8 = -1;
var _local18 = clickableTileArray.length;
var _local11;
var _local10;
var _local4;
var _local5;
while (_local8++ , _local8 < _local18) {
_local4 = clickableTileArray[_local8];
if (_local4[2] > 6) {
continue;
}
_local5 = inClickableArray(_local4[1], _local8);
if ((_local5.length != 0) && (_local5[2] < 7)) {
_local11 = _local4[0];
_local10 = _local5[0];
var _local3 = findMovieByPosition(_local11);
var _local2 = findMovieByPosition(_local10);
if (flag == 1) {
_local3.hintMe();
_local2.hintMe();
} else if (flag == 2) {
var _local7 = transTilePosition({x:_local3._x, y:_local3._y, pX:_local3._parent._x, pY:_local3._parent._y});
var _local6 = transTilePosition({x:_local2._x, y:_local2._y, pX:_local2._parent._x, pY:_local2._parent._y});
attachMovie("Molnija", "molnija" + _local3._name, getNextHighestDepth(), {_x:_local7.x, _y:_local7.y - 308});
attachMovie("Molnija", "molnija" + _local2._name, getNextHighestDepth(), {_x:_local6.x, _y:_local6.y - 308});
match2Tiles(_local3, _local2, false, true);
} else {
match2Tiles(_local3, _local2, false, recalc);
}
return(true);
}
}
return(false);
}
function countMatches() {
var _local4 = clickableTileArray.length;
var _local2 = 0;
var _local3 = 0;
var _local5 = 0;
if (clickableTileArray.length < 2) {
return(0);
}
do {
while (_local2++ , _local2 < _local4) {
if (clickableTileArray[_local2][2] > 7) {
continue;
}
if (ifThisTilesCanBeMathced(clickableTileArray[_local3][1], clickableTileArray[_local2][1]) && (clickableTileArray[_local3][2] < 7)) {
_local5++;
}
}
_local3++;
_local2 = _local3;
} while (_local2 != (_local4 - 1));
return(_local5);
}
function newInit(rebuild) {
__complete = false;
__initializing = true;
events = new mx.events.EventDispatcher();
clickableTileArray = [];
curLevelArray = [];
with (this) {
matches_txt.text = "";
percent_txt.text = "0%";
}
cursorManager.gotoAndStop("cursor");
clearTilesSlectData();
configEvents();
undo1.removeMovieClip();
undo2.removeMovieClip();
youlose_mc.removeMovieClip();
__bonuses = DigitCounter(container.attachMovie("DigitCounter", "DC", getNextHighestDepth()));
if (!rebuild) {
return(undefined);
}
makeNewLevel(__gamelevel);
}
function onSphereEnd() {
events.dispatchEvent({type:GLOBAL_UNLOCK});
DestroyTimerHint.removeMovieClip();
RechangeSphereHint.removeMovieClip();
}
function configEvents() {
events.addEventListener(TILE_CLICK, mx.utils.Delegate.create(this, onTileClick));
events.addEventListener(DRAWING_LEVEL_COMPLETE, mx.utils.Delegate.create(this, onDrawingLevelComplete));
events.addEventListener(CLEAR_TILE, mx.utils.Delegate.create(this, clearTile));
events.addEventListener(RESHUFFLE, mx.utils.Delegate.create(this, reshuffle));
events.addEventListener(GLOBAL_LOCK, mx.utils.Delegate.create(this, onGlobalLock));
events.addEventListener(GLOBAL_UNLOCK, mx.utils.Delegate.create(this, onGlobalUnlock));
events.addEventListener(SpheresTab.DESTROY_TIMER, mx.utils.Delegate.create(this, onDestroyTimer));
events.addEventListener(SpheresTab.DESTROY_TIMER_END, mx.utils.Delegate.create(this, onDesroyTimerEnd));
events.addEventListener(SpheresTab.TRANSFORM_TYPE, mx.utils.Delegate.create(this, onTransformSphere));
events.addEventListener(SpheresTab.TRANSFORM_TYPE_END, mx.utils.Delegate.create(this, onTransformSphereEnd));
events.addEventListener(SpheresTab.INTERCHANGE, mx.utils.Delegate.create(this, onInterchange));
events.addEventListener(SpheresTab.INTERCHANGE_END, mx.utils.Delegate.create(this, onInterchangeEnd));
events.addEventListener(SPHERE_EVENT_END, mx.utils.Delegate.create(this, onSphereEnd));
events.addEventListener(GameZoneTimer.TIMER_END, mx.utils.Delegate.create(this, onLose));
events.addEventListener(LEVEL_COMPLETE, mx.utils.Delegate.create(this, onWin));
}
function onLose(evt) {
if (__complete) {
return(undefined);
}
if (youlose_mc._x != undefined) {
return(undefined);
}
mapRef.removeCheats();
killAllIntervals();
killLevelHint();
__timer.onLevelComplete();
events.dispatchEvent({type:GLOBAL_LOCK});
_global.totalscore = __score;
var _local4 = mx.utils.Delegate.create(this, function () {
this.mapRef.attachMovie("AutoDeathDarkBlueMovie", "darkblue_mc", this.mapRef.getNextHighestDepth());
this.conveyor.addToQueue(this, function () {
var _local2 = (this.youlose_mc = TimeOutPopUp(this.attachMovie("GameZoneTimeOut", "GameZoneTimeOut_mc", this.getNextHighestDepth())));
_local2.__set___score(this.__score);
_local2._visible = true;
_local2.swapDepths(this.cursorManager);
}, [], 700);
});
gameMessage(((evt.why == "matches") ? "No more moves. Game over!" : "Your time is out. Game over!"), _local4, 3000);
}
function onWin() {
events.dispatchEvent({type:GLOBAL_LOCK});
__complete = true;
__timer.onLevelComplete();
var _local7 = __gamelevel;
var _local4 = [];
if (__gamelevel.length == 3) {
_local4.push(__gamelevel.substr(0, 2) + (parseInt(__gamelevel.charAt(2)) + 1).toString());
} else {
_local4.push(__gamelevel + "_1");
}
killAllIntervals();
killLevelHint();
var _local3 = -1;
var _local5 = _local4.length;
while (_local3++ , _local3 < _local5) {
if (__levelsArrays._levelPresent(_local4[_local3])) {
clearInterval(workInter);
conveyor.addToQueue(this, function (nextSub) {
this.__gamelevel = nextSub;
this.newInit(true);
}, [_local4[_local3]], 1500);
return(undefined);
}
}
conveyor.addToQueue(this, function () {
_global.totalscore = this.__score;
var _local3 = (this.complete = LevelCompleteFrame(this.attachMovie("LevelCompleteFrame", "complete_mc", this.getNextHighestDepth())));
this.mapRef.removeCheats();
this._sManager.playSound("level_complete", false, [100]);
this.complete.swapDepths(this.cursorManager);
_local3.__set___gamezone(this);
_local3.__set___gameResults(this.__stats._statistics);
this.percent_txt.removeTextField();
}, [], 200);
}
function killMe(panicexit) {
events.dispatchEvent({type:LEVEL_EXIT});
mapRef.attachMovie("AutoDeathDarkBlueMovie", "darkblue_mc", mapRef.getNextHighestDepth());
__timer.onLevelComplete();
conveyor.addToQueue(this, function () {
clearInterval(this.workInter);
this.mapRef.newInit(panicexit);
this.removeMovieClip();
}, [], 680);
}
function onGlobalLock() {
with (this) {
undo_btn.enabled = (exit_btn.enabled = false);
}
}
function onGlobalUnlock() {
with (this) {
undo_btn.enabled = (exit_btn.enabled = true);
}
}
function reshuffle(evt) {
__sorter = new Sorter(this);
_root._highquality = 0;
curLevelArray = __sorter.normLevel(curLevelArray);
events.dispatchEvent({type:RESHUFFLE_FOR_TILE});
workInter = setInterval(mx.utils.Delegate.create(this, function () {
clearInterval(this.workInter);
_root._highquality = 1;
this.recalculateGameZone();
}), 2000);
}
function clearTile(evt) {
container[evt.parent][evt.name]._visible = false;
}
function onDestroyTimer() {
__destroytimer = true;
}
function onDesroyTimerEnd() {
__destroytimer = false;
events.dispatchEvent({type:OUT_OF_TILES});
}
function onTransformSphere() {
__transformtype = true;
events.dispatchEvent({type:GAMEZONE_CHANGED});
__transformtypefirst = "";
}
function onTransformSphereEnd() {
__transformtype = false;
}
function onInterchange() {
__interchange = true;
events.dispatchEvent({type:GAMEZONE_CHANGED});
}
function onInterchangeEnd() {
__interchange = false;
}
function getGoldsLeft() {
var _local2 = __goldTiles - __goldTilesCollected;
return(_local2);
}
function getMatchesPercent() {
return(Math.round(((tilesCreated - (curLevelArray.length - 1)) / tilesCreated) * 100));
}
function ifClickable(pos, arr, simple) {
if ((arr.length == 0) || (pos == "")) {
return(true);
}
var _local7 = new Array();
if (arr == undefined) {
arr = curLevelArray;
}
if (inTileArray(shiftNums(pos, [0], [1]), arr)) {
return(false);
}
if (inTileArray(shiftNums(pos, [1], [1]), arr) && (inTileArray(shiftNums(pos, [1], [-1]), arr))) {
return(false);
}
var _local9 = new Array();
var _local8 = new Array();
var _local6 = 0;
var _local3 = -1;
var _local11 = pos.charAt(4) == "1";
_local9.push((_local11 ? (shiftNums(pos, [1, 3, 4], [-1, 1, -1])) : (shiftNums(pos, [1, 3, 4], [-1, -1, 1]))));
_local9.push((_local11 ? (shiftNums(pos, [1, 4], [-1, -1])) : (shiftNums(pos, [1, 4], [-1, 1]))));
_local9.push(shiftNums(pos, [1], [-1]));
_local8.push((_local11 ? (shiftNums(pos, [1, 3, 4], [1, 1, -1])) : (shiftNums(pos, [1, 3, 4], [1, -1, 1]))));
_local8.push((_local11 ? (shiftNums(pos, [1, 4], [1, -1])) : (shiftNums(pos, [1, 4], [1, 1]))));
_local8.push(shiftNums(pos, [1], [1]));
while (_local3++ , _local3 < 3) {
if (inTileArray(_local9[_local3], arr)) {
_local6++;
break;
}
}
_local3 = -1;
while (_local3++ , _local3 < 3) {
if (inTileArray(_local8[_local3], arr)) {
_local6++;
break;
}
}
if (_local6 == 2) {
return(false);
}
if (simple) {
return(true);
}
var _local10 = shiftNums(pos, [0], [1]);
if ((pos.charAt(2) == "0") && (pos.charAt(4) == "0")) {
_local7 = simplePos(_local10);
} else if ((pos.charAt(2) == "1") && (pos.charAt(4) == "1")) {
_local7 = crossPos(_local10);
} else if (pos.charAt(2) == "1") {
_local7 = xshiftPos(_local10);
} else {
_local7 = yshiftPos(_local10);
}
var _local2 = 0;
while (_local2 < 8) {
if (inTileArray(_local7[_local2], arr)) {
return(false);
}
_local2++;
}
return(true);
}
function simplePos(pos) {
var _local2 = new Array();
_local2[0] = shiftNums(pos, [1, 2, 3, 4], [-1, 1, -1, 1]);
_local2[1] = shiftNums(pos, [3, 4], [-1, 1]);
_local2[2] = shiftNums(pos, [2, 3, 4], [1, -1, 1]);
_local2[3] = shiftNums(pos, [2], [1]);
_local2[4] = shiftNums(pos, [2, 4], [1, 1]);
_local2[5] = shiftNums(pos, [4], [1]);
_local2[6] = shiftNums(pos, [1, 2, 4], [-1, 1, 1]);
_local2[7] = shiftNums(pos, [1, 2], [-1, 1]);
return(_local2);
}
function xshiftPos(pos) {
var _local2 = new Array();
_local2[0] = shiftNums(pos, [2], [-1]);
_local2[1] = shiftNums(pos, [2, 3, 4], [-1, -1, 1]);
_local2[2] = shiftNums(pos, [3, 4], [-1, 1]);
_local2[3] = shiftNums(pos, [1, 2, 3, 4], [1, -1, -1, 1]);
_local2[4] = shiftNums(pos, [1, 2], [1, -1]);
_local2[5] = shiftNums(pos, [1, 2, 4], [1, -1, 1]);
_local2[6] = shiftNums(pos, [4], [1]);
_local2[7] = shiftNums(pos, [2, 4], [-1, 1]);
return(_local2);
}
function yshiftPos(pos) {
var _local2 = new Array();
_local2[0] = shiftNums(pos, [1, 2, 4], [-1, 1, -1]);
_local2[1] = shiftNums(pos, [4], [-1]);
_local2[2] = shiftNums(pos, [2, 4], [1, -1]);
_local2[3] = shiftNums(pos, [2], [1]);
_local2[4] = shiftNums(pos, [2, 3, 4], [1, 1, -1]);
_local2[5] = shiftNums(pos, [3, 4], [1, -1]);
_local2[6] = shiftNums(pos, [1, 2, 3, 4], [-1, 1, 1, -1]);
_local2[7] = shiftNums(pos, [1, 2], [-1, 1]);
return(_local2);
}
function crossPos(pos) {
var _local2 = new Array();
_local2[0] = shiftNums(pos, [2, 4], [-1, -1]);
_local2[1] = shiftNums(pos, [4], [-1]);
_local2[2] = shiftNums(pos, [1, 2, 4], [1, -1, -1]);
_local2[3] = shiftNums(pos, [1, 2], [1, -1]);
_local2[4] = shiftNums(pos, [1, 2, 3, 4], [1, -1, 1, -1]);
_local2[5] = shiftNums(pos, [3, 4], [1, -1]);
_local2[6] = shiftNums(pos, [2, 3, 4], [-1, 1, -1]);
_local2[7] = shiftNums(pos, [2], [-1]);
return(_local2);
}
function shiftNums(str, pos, vec) {
var _local6 = {v0:["-1", "1"], v1:["0", "2"], v2:["1", "3"], v3:["2", "4"], v4:["3", "5"], v5:["4", "6"], v6:["5", "7"], v7:["6", "8"], v8:["7", "9"], v9:["8", "A"], vA:["9", "B"], vB:["A", "C"], vC:["B", "D"], vD:["C", "E"], vE:["D", "F"], vF:["E", "G"]};
var _local2 = str;
var _local1 = 0;
while (_local1 < pos.length) {
var _local4 = _local6["v" + _local2.charAt(pos[_local1])];
var _local5 = ((vec[_local1] == 1) ? (_local4[1]) : (_local4[0]));
_local2 = (_local2.substr(0, pos[_local1]) + _local5) + (((pos[_local1] + 1) < _local2.length) ? (_local2.substring(pos[_local1] + 1)) : "");
_local1++;
}
return(_local2);
}
function inTileArray(pos, arr) {
var _local1 = -1;
var _local2 = arr.length;
while (_local1++ , _local1 < _local2) {
if (pos == arr[_local1].pos) {
return(true);
}
}
return(false);
}
function ifThisTilesCanBeMathced(typ1, typ2) {
if ((typ1 == 0) || (typ2 == 0)) {
return(false);
}
if (typ1 == typ2) {
return(true);
}
if ((((typ1 > 27) && (typ1 < 32)) && (typ2 > 27)) && (typ2 < 32)) {
return(true);
}
if ((((typ1 > 31) && (typ1 < 36)) && (typ2 > 31)) && (typ2 < 36)) {
return(true);
}
if ((((typ1 > 35) && (typ1 < 40)) && (typ2 > 35)) && (typ2 < 40)) {
return(true);
}
return(false);
}
function inClickableArray(type, index) {
var _local2 = -1;
var _local4 = clickableTileArray.length;
var _local3;
while (_local2++ , _local2 < _local4) {
if (_local2 != index) {
_local3 = clickableTileArray[_local2][1];
if (ifThisTilesCanBeMathced(_local3, type)) {
return(clickableTileArray[_local2].concat([_local2]));
}
}
}
return(new Array());
}
function killAllIntervals() {
clearInterval(workInter);
clearInterval(undoInter);
}
function random2(a, b) {
return(Math.floor((Math.random() * (b - a)) + 1));
}
function clearTilesSlectData() {
curClickedTileRef.deselectMe();
curClickedTileRef = null;
}
function countMyBonus() {
return(parseInt(__gamelevel) * 30);
}
function addTileOnPosition(obj, pos, type, index, spec) {
var _local2 = (this["tile" + index] = MahjongTile(obj.attachMovie("MahjongTile_mc", "MT" + curTileToCreate, obj.getNextHighestDepth(), {_x:parseInt(pos.charAt(1), 16) * MahjongTile.PICTURE_WIDTH_STEP, _y:parseInt(pos.charAt(3)) * MahjongTile.PICTURE_HEIGHT_STEP})));
_local2.__set___type(type);
_local2.__set___gamezone(this);
_local2.__set___position(pos);
if (spec != -1) {
_local2.__set___specialtype(spec);
}
if (pos.charAt(2) == "1") {
_local2._x = _local2._x + (MahjongTile.PICTURE_WIDTH_STEP / 2);
}
if (pos.charAt(4) == "1") {
_local2._y = _local2._y + (MahjongTile.PICTURE_HEIGHT_STEP / 2);
}
curTileToCreate++;
tilesCreated++;
}
static var CLASSIC_SKIN = "classicSkin";
static var EASY_SKIN = "easySkin";
static var OUT_OF_TILES = "outOfTiles";
static var TILE_CLICK = "onTileClick";
static var RESHUFFLE = "onReshuffle";
static var RESHUFFLE_FOR_TILE = "onReshuffForTile";
static var CLEAR_TILE = "onClearTile";
static var DRAWING_LEVEL_COMPLETE = "onDrawingLevelComplete";
static var GAMEZONE_CHANGED = "onGameZoneChanges";
static var RESHUFFLE_RIGHT_X = 320;
static var RESHUFFLE_LEFT_X = -40;
static var SPHERE_EVENT = "onSphereClick";
static var SPHERE_EVENT_END = "onSphereEnd";
static var GLOBAL_LOCK = "onGlobalLock";
static var GLOBAL_UNLOCK = "onGlobalUnlock";
static var LEVEL_COMPLETE = "onLevelComplete";
static var LEVEL_EXIT = "onLevelExit";
static var TILES_COUNT = 42;
var curTilePoverx = 1;
var __pairBonusCount = 2;
var __streetBonusCount = 2;
var __goldTilesCollected = 0;
static var __hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
var __firstMatched = false;
var __matched = 0;
var matchForHint = {l1:{m1:2}, l1_2:{m4:2, m8:3}};
}
Symbol 589 MovieClip [__Packages.MahjongTile] Frame 0
class MahjongTile extends MovieClip
{
var useHandCursor, __selected, __clickable, __added, __me, gray, __currentTileBg, attachMovie, __width, basic_mc, _xscale, _yscale, _parent, _y, _x, __x, __y, hitArea, hitarea_mc, __static, __type, __gameZoneRef, __position, __currentGrayAlpha, __matched, __saveClickable, skin_c, reshufInter, reshufBack, myReshufX, reshufXDelta, onEnterFrame, __get___gamezone, __get___static, __height, __get___heightProp, __get___widthProp, outOfTileDelegate, __hinted, snakeMoveCount, __snakeInter, getNextHighestDepth, __pairInter, __transInter, my_hint, lightning, lightnin, _name, _visible, __animCount, gameZoneChaDelegate, reshuffleDelegate, globalLockDelegate, globalUnlockDelegate, sphereDestroyTimerDelegate, sphereDestroyTimerEndDelegate, levelCompleteDelegate, killafter;
function MahjongTile () {
super();
}
function onLoad() {
useHandCursor = false;
__selected = (__clickable = false);
__added = true;
__me = this;
var tileDepth = (gray.getDepth() - 1);
__currentTileBg = ((__specialtype == "0") ? (attachMovie("basic", "basic_mc", tileDepth)) : (attachMovie("sp" + __specialtype, "special_mc", tileDepth)));
var attachedTile = ((__specialtype == "0") ? "basic_mc" : "special_mc");
var attachedTile = "basic_mc";
__currentTileBg._width = 31;
__currentTileBg._height = 39;
if (__width != undefined) {
var koef = ((__width / basic_mc._width) * 100);
_xscale = (_yscale = koef);
}
with (this) {
hitarea_mc._visible = false;
__width = this[attachedTile]._width;
__height = this[attachedTile]._height;
}
__myGlobalCoo = {x:(_x + _parent._x) + _parent._parent._x, y:(_y + _parent._y) + _parent._parent._y};
_x = __x;
_y = __y;
calcGrayAlpha();
colorTransition("basic");
hitArea = hitarea_mc;
setClassicSkin();
_type = (((((parseInt(_specialtype) > 6) && (parseInt(_global.gamelevel) != 7)) && (!__static)) ? (random(41) + 1) : (__type)));
configEvents();
if (!__static) {
__static = false;
vspywka();
}
}
function overOutMove(vec) {
for (var _local3 in __objs) {
(this[__objs[_local3]]._x = this[__objs[_local3]]._x + (1 * vec));
(this[__objs[_local3]]._y = this[__objs[_local3]]._y - (1 * vec));
}
}
function onRollOver() {
if ((__selected || (!__clickable)) || (__static)) {
return(undefined);
}
colorTransition("white");
__rolloved = true;
overOutMove(1);
com.enkord.sound.SoundManager.getInstance().playSound("block_enter", false, [100]);
}
function onRollOut() {
if (((__selected || (!__clickable)) || (__static)) || (!__rolloved)) {
return(undefined);
}
overOutMove(-1);
gray._x = (gray._x = 0);
if (!__destroytimer) {
colorTransition("basic");
} else {
colorTransition("black");
}
__rolloved = false;
}
function onPress() {
if (__destroytimer && (checkedForDestroyTimer)) {
return(undefined);
}
__gameZoneRef.events.dispatchEvent({type:MahjongTileSet.TILE_CLICK, target:this, tiletype:__type, index:findMyIndexInClickableArray()});
}
function findMyIndexInClickableArray() {
var _local2 = -1;
var _local3 = __gameZoneRef.clickableTileArray;
var _local4 = _local3.length;
while (_local2++ , _local2 < _local4) {
if (_local3[_local2][0] == __position) {
return(_local2);
}
}
return(-1);
}
function ifHaveAPair() {
var _local3 = findMyIndexInClickableArray();
if (_local3 == -1) {
return(false);
}
var _local2 = -1;
var _local4 = __gameZoneRef.clickableTileArray;
var _local5 = _local4.length;
while (_local2++ , _local2 < _local5) {
if ((_local4[_local2][1] == __type) && (_local2 != _local3)) {
return(true);
}
}
return(false);
}
function calcGrayAlpha() {
__currentGrayAlpha = ((!__static) ? (Math.round((1 - (parseInt(__position.charAt(0), 16) / __gameZoneRef.topPoverx)) * 50)) : 0);
}
function onGameZoneChanged(quick) {
if (__matched) {
return(undefined);
}
if (__gameZoneRef.__interchange || (__gameZoneRef.__transformtype && (parseInt(_specialtype) < 7))) {
var _local3 = __clickable;
_clickable = (true);
__saveClickable = _local3;
return(undefined);
}
if (!__destroytimer) {
calcGrayAlpha();
colorTransition("basic");
}
_clickable = (((findMyIndexInClickableArray() != -1) ? true : false));
if (((parseInt(_specialtype) > 6) && (__clickable)) && (parseInt(_global.gamelevel) != 7)) {
__currentTileBg.removeMovieClip();
__currentTileBg = attachMovie("sp" + __specialtype, "special_mc", tileDepth);
MovieClip(skin_c).removeMovieClip();
__type = -1;
}
}
function smallRecalculate(undo) {
if (__matched && (!undo)) {
return(undefined);
}
var _local2 = __gameZoneRef.ifClickable(__position);
_clickable = (_local2);
var _local3 = findMyIndexInClickableArray();
if (_local3 == -1) {
if (_local2) {
__gameZoneRef.clickableTileArray.push([__position, __type, __specialtype]);
}
} else if (!_local2) {
__gameZoneRef.clickableTileArray.splice(_local3, 1);
}
}
function onReshuffle() {
clearInterval(reshufInter);
reshufBack = false;
__x = _x;
var _local5 = parseInt(__position.charAt(1));
myReshufX = ((_local5 < 5) ? (MahjongTileSet.RESHUFFLE_LEFT_X) : (MahjongTileSet.RESHUFFLE_RIGHT_X));
reshufXDelta = ((_local5 < 5) ? -20 : 20);
onEnterFrame = mx.utils.Delegate.create(this, function () {
if ((this._x == this.__x) && (this.reshufBack)) {
delete this.onEnterFrame;
var _local3 = this.__gameZoneRef.curLevelArray;
for (var _local4 in _local3) {
var _local2 = _local3[_local4];
if (_local2.pos == this.__position) {
this._type = parseInt(_local2.type);
}
}
return(undefined);
}
if (this.reshufBack) {
this._x = this._x - this.reshufXDelta;
return(undefined);
}
if (((this.myReshufX < 0) && (this._x > this.myReshufX)) || ((this.myReshufX >= 0) && (this._x < this.myReshufX))) {
this._x = this._x + this.reshufXDelta;
} else {
this.reshufBack = true;
}
});
}
function set _type(value) {
__type = value;
if (!__added) {
return;
}
var _local2 = __me.classic_mc;
_local2.gotoAndStop(value);
//return(_type);
}
function get _type() {
return(__type);
}
function set _gamezone(gamezone) {
__gameZoneRef = gamezone;
//return(__get___gamezone());
}
function set _position(value) {
__position = value;
//return(_position);
}
function get _position() {
return(__position);
}
function set _static(value) {
__static = value;
//return(__get___static());
}
function set _heightProp(value) {
__height = value;
//return(__get___heightProp());
}
function set _widthProp(value) {
__width = value;
//return(__get___widthProp());
}
function set _specialtype(value) {
__specialtype = value;
//return(_specialtype);
}
function get _specialtype() {
return(__specialtype);
}
function set _clickable(value) {
__clickable = (__saveClickable = value);
if (__destroytimer) {
colorTransition((ifHaveAPair() ? "white" : "black"));
}
//return(_clickable);
}
function get _clickable() {
return(__clickable);
}
function get _globalCoo() {
return(__myGlobalCoo);
}
function get _selected() {
return(__selected);
}
function set _selected(value) {
__selected = value;
//return(_selected);
}
function deselectMe(evt) {
if ((__gameZoneRef.__transformtype || (__gameZoneRef.__interchange)) || (!__selected)) {
return(undefined);
}
if (__rolloved || (evt.type == undefined)) {
overOutMove(-1);
colorTransition("basic");
__selected = (__rolloved = false);
__gameZoneRef.events.removeEventListener(MahjongTileSet.OUT_OF_TILES, outOfTileDelegate);
}
}
function selectMe() {
__selected = true;
if (__hinted) {
__gameZoneRef.events.dispatchEvent({type:MahjongTileSet.SPHERE_EVENT_END});
__hinted = false;
}
if (__specialtype != 7) {
colorTransition("black");
}
}
function snakeMoving(deltax, deltay, finalPos, obj, recalc, firstSnake) {
snakeMoveCount = 0;
var _local4 = ((__specialtype != "0") ? 8 : 10);
var _local7 = function (deltax, deltay, finalPos, obj, recalc, autodeath) {
if (this.snakeMoveCount < finalPos) {
this.attachMovie("UndoGhost", "undoghost2" + this.snakeMoveCount, this.getNextHighestDepth(), {_x:(this.snakeMoveCount + 1) * deltax, _y:(this.snakeMoveCount + 1) * deltay});
this._x = this._x - deltax;
this._y = this._y - deltay;
} else if (this.snakeMoveCount == finalPos) {
obj.renew();
if ((this.__specialtype > 0) && (this.__specialtype < 7)) {
this.__gameZoneRef.addOneSphere(parseInt(this.__specialtype));
this.vspywka(true);
} else if (this.__specialtype != 7) {
this._visible = false;
}
} else if (this.snakeMoveCount == (finalPos + autodeath)) {
if (recalc) {
obj.smallRecalculate(undo);
if (!firstSnake) {
this.__gameZoneRef.recalculateGameZone(true);
}
}
clearInterval(this.__snakeInter);
if (this.__specialtype == "0") {
this.removeMovieClip();
}
}
this.snakeMoveCount++;
};
__snakeInter = setInterval(mx.utils.Delegate.create(this, _local7), finalPos, deltax / finalPos, deltay / finalPos, finalPos, obj, recalc, _local4);
}
function setClassicSkin() {
if (parseInt(__specialtype) > 6) {
return(undefined);
}
skin_c = attachMovie("ClassicSkin", "classic_mc", getNextHighestDepth(), {_x:6, _y:2});
}
function paired() {
__matched = true;
__clickable = (__selected = false);
MovieClip(skin_c)._visible = (__currentTileBg._visible = false);
clearInterval(__pairInter);
clearInterval(__transInter);
my_hint.clearAllIntervals();
my_hint.removeMovieClip();
removeEvents();
var _local6 = (lightning = attachMovie("MahjongTileLightning", "lightnin", getNextHighestDepth(), {_x:-23, _y:-18.5}));
__pairInter = setInterval(mx.utils.Delegate.create(this, function () {
if (this.easy_mc._alpha > 0) {
for (var _local2 in this.__objs) {
this.__objs[_local2]._alpha = this.__objs[_local2]._alpha - 5;
}
}
var _local3 = this.lightnin;
_local3.nextFrame();
if (_local3._currentframe == _local3._totalframes) {
this.fullRemoveMe();
this.killMe();
}
}), 40);
}
function fullRemoveMe() {
clearInterval(__pairInter);
lightnin.removeMovieClip();
__currentTileBg.removeMovieClip();
skin_c.removeMovieClip();
delete lightning;
}
function killMe() {
__gameZoneRef.events.dispatchEvent({type:MahjongTileSet.CLEAR_TILE, name:_name, parent:_parent._name});
}
function renew() {
__matched = false;
configEvents();
setClassicSkin();
var _local2 = gray;
__currentTileBg = attachMovie("basic", "basic_mc", _local2.getDepth() - 1);
__currentTileBg._x = _local2._x;
__currentTileBg._y = _local2._y;
_type = (__type);
vspywka();
__specialtype = "0";
colorTransition("basic");
_visible = true;
checkedForDestroyTimer = false;
}
function animToPoint(xx, yy, count, endtarget) {
__animCount = 0;
var _local4 = (_x - xx) / count;
var _local3 = (_y - yy) / count;
var _local7 = setInterval(mx.utils.Delegate.create(this, function (dx, dy, inte, target, howmuch) {
this._parent.attachMovie("UndoGhost", "undoghost1" + this.__animCount, this._parent.getNextHighestDepth(), {_x:this._x, _y:this._y});
this._x = this._x - dx;
this._y = this._y - dy;
if (this.__animCount == howmuch) {
clearInterval(inte);
target.renew();
this.removeMoveiClip();
}
this.__animCount++;
}), 20, _local4, _local3, inter, endtarget, count);
}
function hintMe() {
my_hint = attachMovie("TileHintMovie", "hintMe", getNextHighestDepth());
__hinted = true;
}
function onGlobalLock() {
__saveClickable = __clickable;
__clickable = false;
}
function onGlobalUnlock() {
if (__saveClickable == undefined) {
return(undefined);
}
_clickable = (__saveClickable);
}
function destroyByTimer(obj) {
if (checkedForDestroyTimer) {
return(undefined);
}
checkedForDestroyTimer = true;
__gameZoneRef.attachMovie("DestroyTimerEffect", "destroy" + _name, __gameZoneRef.getNextHighestDepth(), {_x:__myGlobalCoo.x, _y:__myGlobalCoo.y});
if (obj != undefined) {
__pairInter = setInterval(mx.utils.Delegate.create(this, function (obj) {
clearInterval(this.__pairInter);
this.__gameZoneRef.match2Tiles(this, obj, true, true);
}), 300, obj);
}
}
function onSphereDestroyTimer() {
__destroytimer = true;
onGameZoneChanged(true);
}
function onSphereDestroyTimerEnd() {
__destroytimer = false;
onGameZoneChanged(true);
}
function configEvents() {
if (!__static) {
outOfTileDelegate = mx.utils.Delegate.create(this, deselectMe);
gameZoneChaDelegate = mx.utils.Delegate.create(this, onGameZoneChanged);
reshuffleDelegate = mx.utils.Delegate.create(this, onReshuffle);
globalLockDelegate = mx.utils.Delegate.create(this, onGlobalLock);
globalUnlockDelegate = mx.utils.Delegate.create(this, onGlobalUnlock);
sphereDestroyTimerDelegate = mx.utils.Delegate.create(this, onSphereDestroyTimer);
sphereDestroyTimerEndDelegate = mx.utils.Delegate.create(this, onSphereDestroyTimerEnd);
levelCompleteDelegate = mx.utils.Delegate.create(this, onLevelComplete);
__gameZoneRef.events.addEventListener(MahjongTileSet.GAMEZONE_CHANGED, gameZoneChaDelegate);
__gameZoneRef.events.addEventListener(MahjongTileSet.RESHUFFLE_FOR_TILE, reshuffleDelegate);
__gameZoneRef.events.addEventListener(MahjongTileSet.GLOBAL_LOCK, globalLockDelegate);
__gameZoneRef.events.addEventListener(MahjongTileSet.GLOBAL_UNLOCK, globalUnlockDelegate);
__gameZoneRef.events.addEventListener(SpheresTab.DESTROY_TIMER, sphereDestroyTimerDelegate);
__gameZoneRef.events.addEventListener(SpheresTab.DESTROY_TIMER_END, sphereDestroyTimerEndDelegate);
__gameZoneRef.events.addEventListener(MahjongTileSet.LEVEL_COMPLETE, levelCompleteDelegate);
__gameZoneRef.events.addEventListener(MahjongTileSet.LEVEL_EXIT, mx.utils.Delegate.create(this, onLose));
}
}
function removeEvents() {
__gameZoneRef.events.removeEventListener(MahjongTileSet.OUT_OF_TILES, outOfTileDelegate);
__gameZoneRef.events.removeEventListener(MahjongTileSet.GAMEZONE_CHANGED, gameZoneChaDelegate);
__gameZoneRef.events.removeEventListener(MahjongTileSet.RESHUFFLE_FOR_TILE, reshuffleDelegate);
__gameZoneRef.events.removeEventListener(MahjongTileSet.GLOBAL_LOCK, globalLockDelegate);
__gameZoneRef.events.removeEventListener(MahjongTileSet.GLOBAL_UNLOCK, globalUnlockDelegate);
__gameZoneRef.events.removeEventListener(SpheresTab.DESTROY_TIMER, sphereDestroyTimerDelegate);
__gameZoneRef.events.removeEventListener(SpheresTab.DESTROY_TIMER_END, sphereDestroyTimerEndDelegate);
__gameZoneRef.events.removeEventListener(MahjongTileSet.LEVEL_COMPLETE, levelCompleteDelegate);
}
function onLose() {
var _local2 = MovieClip(my_hint);
_local2.clearAllIntervals();
_local2.removeMovieClip();
}
function onLevelComplete() {
if (__matched) {
return(undefined);
}
var _local2 = MovieClip(my_hint);
_local2.clearAllIntervals();
_local2.removeMovieClip();
__animCount = 0;
var _local3 = (parseInt(_position.substr(1, 2), 16) * 3) + (parseInt(_position.substring(2)) * 3);
__snakeInter = setInterval(mx.utils.Delegate.create(this, function () {
this.__transInter = setInterval(mx.utils.Delegate.create(this, function (final, delta_x, delta_y) {
if (this.__animCount < 40) {
this._y = this._y - (delta_y / final);
this._x = this._x - (delta_x / final);
}
if (this.__animCount == final) {
clearInterval(this.__transInter);
this.removeMovieClip();
}
this.__animCount++;
}), 10, 10, this._globalCoo.x - 240, this._globalCoo.y - 600);
clearInterval(this.__snakeInter);
}), _local3);
}
function makeTransformToType(type) {
__gameZoneRef.attachMovie("Ramka", "Ramka" + _name, __gameZoneRef.getNextHighestDepth(), {_x:__myGlobalCoo.x, _y:__myGlobalCoo.y});
__pairInter = setInterval(mx.utils.Delegate.create(this, function (value) {
clearInterval(this.__pairInter);
this.vspywka();
this._type = value;
}), 800, type);
}
function colorTransition(colorik) {
var _local2 = gray;
var _local3 = new Color(_local2);
switch (colorik) {
case "basic" :
_local3.setRGB(0);
_local2._alpha = __currentGrayAlpha;
break;
case "black" :
_local3.setRGB(0);
_local2._alpha = 55;
break;
case "white" :
_local3.setRGB(16777215);
_local2._alpha = 40;
}
}
function vspywka(killafter) {
lightning = attachMovie("MahjongTileLightning", "lightnin", getNextHighestDepth(), {_x:-23, _y:-18.5});
this.killafter = killafter;
onEnterFrame = mx.utils.Delegate.create(this, function (killafter) {
var _local2 = this.lightning;
if (_local2._currentframe == _local2._totalframes) {
delete this.onEnterFrame;
_local2.removeMovieClip();
if (this.killafter) {
this.removeMovieClip();
}
return(undefined);
}
_local2.nextFrame();
});
}
static var PICTURE_WIDTH_STEP = 26;
static var PICTURE_HEIGHT_STEP = 35;
static var LEFT_PICTURE_SPACING = 25;
var checkedForDestroyTimer = false;
var __skin = "classic";
var __objs = new Array("basic_mc", "special_mc", "black_mc", "white_mc", "gray", "easy_mc", "classic_mc");
var __rolloved = false;
var __destroytimer = false;
var __myGlobalCoo = {x:0, y:0};
var __specialtype = "0";
}
Symbol 590 MovieClip [__Packages.SpheresTab] Frame 0
class SpheresTab extends MovieClip
{
var mydef_x, _x, conv, __gameZoneRef, __get___gamezone, __hide, attachMovie, sphera2, sphera3, sphera5, _y, sphera6, sphera4, sphera1, workCount, workInter;
function SpheresTab () {
super();
mydef_x = _x;
conv = new com.enkord.utils.Conveyor();
}
function set _gamezone(value) {
__gameZoneRef = value;
__gameZoneRef.events.addEventListener(MahjongTileSet.SPHERE_EVENT, mx.utils.Delegate.create(this, sphere));
__gameZoneRef.events.addEventListener(MahjongTileSet.SPHERE_EVENT_END, mx.utils.Delegate.create(this, sphereEnd));
__gameZoneRef.events.addEventListener(MahjongTileSet.GLOBAL_UNLOCK, mx.utils.Delegate.create(this, onUnlock));
//return(__get___gamezone());
}
function get _hide() {
return(__hide);
}
function addOneSphere(type) {
this["sphera" + type]._count = this["sphera" + type]._count + 1;
}
function onLoad() {
var _local2 = 1;
while (_local2 < 7) {
var _local3 = (this["sphera" + _local2] = Sphera(attachMovie("Sphere", "sphere" + _local2, _local2, {_x:10, _y:SPHERES_VERTICAL_SPACING * _local2})));
_local3.__set___gamezone(__gameZoneRef);
_local3.__set___type(_local2);
_local3.__set___count(0);
__hide = false;
_local2++;
}
mydef_x = _x;
}
function haveLastChanceSpheres() {
if (((Sphera(sphera2).__get___count() > 0) || (Sphera(sphera3).__get___count() > 0)) || (Sphera(sphera5).__get___count() > 0)) {
return(true);
}
return(false);
}
function tabMoving(vec) {
if (conv.__get___started()) {
conv.stop();
}
conv = new com.enkord.utils.Conveyor();
var _local2 = ((vec > 0) ? (my_hide_x) : (mydef_x));
com.enkord.animation.Motion.directMotion(this, _local2, _y, 10, 300, conv);
conv.start();
}
function sphereEnd() {
if (__hide) {
__gameZoneRef.fadeBlack.gotoAndPlay("fadeout");
tabMoving(-1);
__hide = false;
var _local2 = 1;
while (_local2 < 7) {
var _local3 = this["sphera" + _local2];
_local3.gotoAndStop(_local2 * 2);
_local2++;
}
}
}
function testedSphera(evt) {
tabMoving(1);
var _local2 = 1;
while (_local2 < 7) {
var _local3 = this["sphera" + _local2];
_local3.hint.removeMovieClip();
_local2++;
}
__gameZoneRef.fadeBlack.gotoAndPlay("fadein");
__hide = true;
evt.target._count = evt.target._count - 1;
__gameZoneRef.cursorManager.gotoAndStop(1);
}
function haveLevel2Types() {
var _local2 = 0;
var _local4 = __gameZoneRef.curLevelArray;
var _local5 = _local4.length;
var _local3 = "";
while (_local2++ , _local2 < _local5) {
if (_local3 == "") {
_local3 = _local4[_local2].type;
} else if (_local4[_local2].type == _local3) {
return(true);
}
}
return(false);
}
function checkClickNeedableSpheres() {
var _local2 = true;
if (parseInt(__gameZoneRef.matches_txt.text) == 0) {
_local2 = false;
}
sphera1.enabled = (sphera4.enabled = (sphera6.enabled = _local2));
}
function onUnlock() {
checkClickNeedableSpheres();
}
function sphere(evt) {
switch (evt.target._type) {
case 1 :
com.enkord.sound.SoundManager.getInstance().playSound("hint_sound", false, [100]);
testedSphera(evt);
__gameZoneRef.makeAutoMatch(1);
break;
case 2 :
testedSphera(evt);
workCount = 0;
clearInterval(workInter);
com.enkord.sound.SoundManager.getInstance().playSound("sphere_use", false, [100]);
workInter = setInterval(mx.utils.Delegate.create(this, function () {
if (this.workCount == 10) {
this.__gameZoneRef.events.dispatchEvent({type:MahjongTileSet.RESHUFFLE});
} else if (this.workCount == 40) {
this.__gameZoneRef.events.dispatchEvent({type:MahjongTileSet.SPHERE_EVENT_END});
clearInterval(this.workInter);
}
this.workCount++;
}), 100);
break;
case 3 :
if (haveLevel2Types()) {
testedSphera(evt);
com.enkord.sound.SoundManager.getInstance().playSound("sphere_changetype", false, [100]);
__gameZoneRef.events.dispatchEvent({type:TRANSFORM_TYPE});
__gameZoneRef.attachMovie("RechangeSphereHint", "RechangeSphereHint", __gameZoneRef.getNextHighestDepth(), {_x:75});
}
break;
case 4 :
clearInterval(workInter);
testedSphera(evt);
__gameZoneRef.events.dispatchEvent({type:DESTROY_TIMER});
com.enkord.sound.SoundManager.getInstance().playSound("sphere4_activate", false, [100]);
workInter = setInterval(mx.utils.Delegate.create(this, function () {
clearInterval(this.workInter);
this.__gameZoneRef.__destroytimer = false;
this.__gameZoneRef.events.dispatchEvent({type:SpheresTab.DESTROY_TIMER_END});
this.__gameZoneRef.events.dispatchEvent({type:MahjongTileSet.SPHERE_EVENT_END});
com.enkord.sound.SoundManager.getInstance().playSound("sphere4_deactivate", false, [100]);
this.__gameZoneRef.DestroyTimerHint.removeMovieClip();
}), 10000);
__gameZoneRef.attachMovie("DestroyTimerHint", "DestroyTimerHint", __gameZoneRef.getNextHighestDepth(), {_x:75});
break;
case 5 :
if (haveLevel2Types()) {
com.enkord.sound.SoundManager.getInstance().playSound("sphere_use", false, [100]);
testedSphera(evt);
__gameZoneRef.events.dispatchEvent({type:INTERCHANGE});
__gameZoneRef.attachMovie("RechangeSphereHint", "RechangeSphereHint", __gameZoneRef.getNextHighestDepth(), {_x:75});
}
break;
case 6 :
testedSphera(evt);
workCount = 0;
workInter = setInterval(mx.utils.Delegate.create(this, function () {
if (this.workCount <= 20) {
com.enkord.sound.SoundManager.getInstance().playSound("lightning", false, [100]);
if (this.__gameZoneRef.makeAutoMatch(2, (can2 ? false : true))) {
this.workCount++;
}
if (this.__gameZoneRef.makeAutoMatch(2)) {
this.workCount++;
return(undefined);
}
}
this.__gameZoneRef.recalculateGameZone(true);
clearInterval(this.workInter);
this.__gameZoneRef.events.dispatchEvent({type:MahjongTileSet.SPHERE_EVENT_END});
}), 550);
}
}
static var DESTROY_TIMER = "onSphereDestroyTimer";
static var TRANSFORM_TYPE = "onTransformType";
static var TRANSFORM_TYPE_END = "onTransformTypeEnd";
static var INTERCHANGE = "onInterchangeSphere";
static var INTERCHANGE_END = "onInterchangeEnd";
static var DESTROY_TIMER_END = "onSphereDestroyTimerEnd";
static var SPHERES_VERTICAL_SPACING = 40;
var my_hide_x = -100;
}
Symbol 591 MovieClip [__Packages.com.enkord.animation.Motion] Frame 0
class com.enkord.animation.Motion
{
function Motion () {
}
static function directMotion(obj, endX, endY, iterations, time, conv, completeHandler, handlerOwner) {
var _local5 = obj._x;
var _local3 = obj._y;
var _local7 = (endX - _local5) / iterations;
var _local6 = (endY - _local3) / iterations;
var _local4 = time / iterations;
motionQueuer(obj, _local4, iterations + 1, _local7, _local6, conv);
if (completeHandler != undefined) {
conv.addToQueue(handlerOwner, completeHandler, [obj], 0, "directMotionHandler");
}
}
static function directParallelMotions(objects, endCoos, iterations, time, conv, completeHandler, handlerOwner) {
if ((objects.length != endCoos.length) && (endCoos.length > 1)) {
return(undefined);
}
var _local2 = -1;
var _local11 = objects.length;
var _local3 = [];
var _local14 = time / iterations;
var _local13 = endCoos.length == 1;
conv.suspend();
while (_local2++ , _local2 < _local11) {
var _local8 = objects[_local2];
var _local5 = ((_local13 ? (endCoos[0][0]) : (endCoos[_local2][0])) - _local8._x) / iterations;
var _local4 = ((_local13 ? (endCoos[0][1]) : (endCoos[_local2][1])) - _local8._y) / iterations;
_local3.push([_local5, _local4]);
}
var _local9 = 0;
while (_local9 < iterations) {
_local2 = -1;
while (_local2++ , _local2 < _local11) {
conv.addToQueue(objects[_local2], function (deltaX, deltaY) {
this._x = this._x + deltaX;
this._y = this._y + deltaY;
updateAfterEvent();
}, [_local3[_local2][0], _local3[_local2][1]], 0, "parallelMotionIteration");
}
conv.addToQueue(conv, function () {
}, [], _local14, "paralellMotionDelayPlacebo");
_local9++;
}
conv.addToQueue(handlerOwner, completeHandler, [], 0, "parallelMotionCompleteHadler");
conv.resume();
}
static function fewDirectMotions(obj, coo, iterationsPerMotion, timePerMotion, completeHandler, movingHandler, handlersOwner, conveyor) {
coo.unshift([obj._y, obj._x]);
var _local1 = 0;
var _local5 = coo.length;
conveyor.suspend();
while (_local1++ , _local1 < _local5) {
directMotion_few(obj, coo[_local1 - 1][1], coo[_local1 - 1][0], coo[_local1][1], coo[_local1][0], iterationsPerMotion, timePerMotion, conveyor, movingHandler, handlersOwner);
}
conveyor.addToQueue(handlersOwner, completeHandler, [obj], 0, "fewDirectCompleteHandler");
conveyor.resume();
}
static function motionQueuer(obj, delay, queis, deltaX, deltaY, conv) {
var _local2 = 0;
while (_local2++ , _local2 < queis) {
conv.addToQueue(obj, function (delta_X, delta_Y) {
this._x = this._x + delta_X;
this._y = this._y + delta_Y;
updateAfterEvent();
}, [deltaX, deltaY], delay, "directMotionIteration");
}
}
static function directMotion_few(obj, curX, curY, endX, endY, iterations, time, conv, completeHandler, handlerOwner) {
var _local4 = (endX - curX) / iterations;
var _local3 = (endY - curY) / iterations;
var _local2 = time / iterations;
motionQueuer(obj, _local2, iterations + 1, _local4, _local3, conv);
if (completeHandler == undefined) {
return(undefined);
}
conv.addToQueue(handlerOwner, completeHandler, [obj], 0, "fewDirectMotionsIterationHandler");
}
}
Symbol 592 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent == undefined) {
_local1[eventObj.type](eventObj);
} else {
_local1.handleEvent(eventObj);
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
}
Symbol 593 MovieClip [__Packages.Bonuses] Frame 0
class Bonuses extends MovieClip
{
var __gameZoneRef, __bonuses, attachMovie, getNextHighestDepth, __get___gamezone, _width, labels, _x, _y, animInter, animCount;
function Bonuses () {
super();
}
function set _gamezone(value) {
__gameZoneRef = value;
__bonuses = DigitCounter(attachMovie("DigitCounter", "DC", getNextHighestDepth()));
//return(__get___gamezone());
}
function viewBonus(flag, score, xx, yy) {
var _local2 = _width / 2;
labels.gotoAndStop(flag);
__bonuses.attributes(_local2 / 2, -10, score);
labels._y = 0;
_x = xx - _local2;
_y = yy;
animateLabels();
}
function animateLabels() {
clearInterval(animInter);
animCount = 0;
animInter = setInterval(mx.utils.Delegate.create(this, function () {
this.labels._y = this.labels._y - 1;
this.labels._alpha = this.labels._alpha - 4;
this.animCount++;
if (this.animCount == 25) {
clearInterval(this.animInter);
this.removeMovieClip();
}
}), 50);
}
}
Symbol 594 MovieClip [__Packages.GameStat] Frame 0
class GameStat
{
var __gamezoneRef;
function GameStat (ref) {
__gamezoneRef = ref;
}
function plusMatch() {
__blocksMatched = __blocksMatched + 2;
}
function plusSphera() {
__spheresUsed++;
}
function plusSpeedBonus() {
__speedBonuses++;
}
function plusStreetBonus() {
__streetBonuses++;
}
function plusPairBonus() {
__pairBonuses++;
}
function get _statistics() {
var _local3 = __gamezoneRef.__timer;
var _local4 = Math.round((_local3.__get___timeout() - _local3.__get___currentTime()) * 50);
_global.totalscore = _global.totalscore + _local4;
var _local5 = [__blocksMatched, __spheresUsed, normalizeTime(_local3.__get___currentTime()), __speedBonuses, __streetBonuses, __pairBonuses, __gamezoneRef.__get___score(), _local4, _global.totalscore.toString()];
return(_local5);
}
function clearAll() {
__pairBonuses = (__streetBonuses = (__speedBonuses = (__spheresUsed = (__blocksMatched = 0))));
}
function normalizeTime(time) {
var _local1 = Math.round(time % 60).toString();
_local1 = ((_local1.length < 2) ? ("0" + _local1) : (_local1));
var _local2 = Math.floor(time / 60).toString();
_local2 = ((_local2.length < 2) ? ("0" + _local2) : (_local2));
return((_local2 + ":") + _local1);
}
var __blocksMatched = 0;
var __spheresUsed = 0;
var __speedBonuses = 0;
var __streetBonuses = 0;
var __pairBonuses = 0;
}
Symbol 595 MovieClip [__Packages.GameZoneTimer] Frame 0
class GameZoneTimer extends MovieClip
{
var __gameZoneRef, __get___gamezone, __timeOut, __percent, __currentTime, __pause, __get___pause, __in, blue_mc, __startTime, __endTime;
function GameZoneTimer () {
super();
__gameZoneRef = ref;
}
function set _gamezone(value) {
__gameZoneRef = value;
//return(__get___gamezone());
}
function set _timeout(value) {
__timeOut = value;
//return(_timeout);
}
function get _timeout() {
return(__timeOut);
}
function get _percent() {
return(__percent);
}
function get _currentTime() {
return(__currentTime);
}
function set _pause(value) {
__pause = value;
//return(__get___pause());
}
function checkForEnd() {
if (__currentTime >= __timeOut) {
__gameZoneRef.events.dispatchEvent({type:TIMER_END});
clearInterval(__in);
}
}
function onLevelComplete() {
clearInterval(__in);
}
function start(timeout) {
clearInterval(__in);
blue_mc._xscale = 100;
__startTime = getTimer();
__currentTime = 0;
__timeOut = timeout;
__endTime = (timeout * 1000) + getTimer();
__in = setInterval(mx.utils.Delegate.create(this, function () {
this.__currentTime = this.__currentTime + (this.__pause ? 0 : 1);
this.__percent = (this.__currentTime / this.__timeOut) * 100;
if ((this.__timeOut - this.__currentTime) == 30) {
this.__gameZoneRef.hurryUp();
}
this.checkForEnd();
this.blue_mc._xscale = 100 - this.__percent;
}), 1000);
}
static var TIMER_END = "onTimerEnd";
}
Symbol 596 MovieClip [__Packages.MahjongLevels] Frame 0
class MahjongLevels extends Object
{
var __gameZoneRef, curSpecialArray;
function MahjongLevels (ref) {
super();
__gameZoneRef = ref;
}
function getLevelArray(level) {
curSpecialArray = new Array(null);
var _local9 = this["L" + level];
var _local16 = _local9[0];
var _local7 = new Array();
var _local8 = 0;
var _local15 = _local9.length;
if (_local9.length == undefined) {
_local9 = L4;
_local16 = _local9[0];
_local15 = _local9.length;
}
clearAllArrays();
_local7.push(_local16);
while (_local8++ , _local8 < _local15) {
var _local2 = _local9[_local8];
var _local5 = _local2.charAt(0);
var _local6 = {pov:_local5, pos:_local2.substr(1, 4), spt:((_local2.length > 5) ? (_local2.charAt(5)) : -1), fix:((_local2.substring(6) != "") ? (parseInt(_local2.substring(6))) : 0), dis:0};
this["p" + _local5].push(_local6);
}
var _local4 = 1;
while (_local4 < 16) {
var _local3 = this["p" + hex[_local4]];
if (_local3.length > 0) {
_local3 = drawSort(_local3);
_local7 = _local7.concat(_local3);
}
_local4++;
}
return(_local7);
}
static function getMode(level) {
return(LEVEL_MODES["L" + level]);
}
function _levelPresent(value) {
return(this["L" + value].length > 0);
}
function clearAllArrays() {
var _local2 = 0;
while (_local2++ , _local2 < 16) {
this["p" + hex[_local2]] = new Array();
}
}
function drawSort(arr) {
var _local3 = -1;
var _local7 = arr.length;
var _local6 = arr;
while (_local3++ , _local3 < _local7) {
var _local2 = _local6[_local3].pos;
var _local4 = parseInt(_local2.substr(2, 2), 16);
var _local5 = parseInt(_local2.substr(0, 2), 16);
var _local1 = 176 - _local5;
_local6[_local3].dis = Math.sqrt((_local1 * _local1) * 2) + ((_local4 - _local1) / Math.SQRT2);
}
_local6.sortOn("dis", Array.NUMERIC);
return(_local6);
}
static var LEVEL_MODES = {L1:0, L1_1:0, L1_2:0, L1_3:0, L2:0, L3:1, L4:1, L5:0, L6:0, L7:2, L8:2, L9:0, L10:0, L11:2, L12:1, L13:0, L14:0, L15:1};
var L1 = new Array(500, "1503001", "1603001", "2512108", "2513108", "35030013", "36030013", "45121016", "45131016", "55030022", "56030022");
var L1_1 = new Array(500, "1502101", "1602101", "1503101", "1603101", "24130010", "25121010", "26130010", "25131010", "35021016", "36021016", "35031016", "36031016", "44130023", "45121023", "46130023", "45131023");
var L1_2 = new Array(500, "15021031", "16021030", "15031029", "16031028", "24130028", "25121030", "26130029", "25131031", "35021033", "36021034", "35031035", "36031032", "44130032", "45121034", "46130035", "45131033", "55021036", "56021037", "55031038", "56031039", "64130039", "65121037", "66130038", "65131036");
var L1_3 = new Array(500, "1313004", "1511107", "1713004", "1514107", "2403006", "2512001", "2703001", "2514006", "3413009", "3512102", "3613009", "3513102", "4503003", "4603003");
var L2 = new Array(300, "11000", "11010", "11040", "11120", "12040", "12050", "12121", "13051", "13121", "14000", "14010", "14050", "14120", "14130", "14140", "15000", "15010", "15050", "15121", "15160", "16121", "16160", "17110", "17120", "17130", "17140", "18110", "18120", "18130", "18140", "19110", "19120", "19130", "19140", "21000", "21010", "21040", "21120", "22040", "22050", "22121", "23051", "23121", "24000", "24010", "24050", "24120", "24130", "24140", "25000", "25010", "25050", "25121", "25160", "26121", "26160", "27110", "27120", "27130", "27140", "28110", "28120", "28130", "28140", "29110", "29120", "29130", "29140", "38021", "39021");
var L3 = new Array(225, "12121", "12131", "13011", "13041", "14010", "14050", "15001", "15051", "16001", "16051", "17010", "17050", "18011", "18041", "18121", "18131", "151307", "23030", "23120", "23140", "24030", "24111", "24141", "25030", "25110", "25120", "25140", "25150", "26030", "26111", "26141", "27030", "27120", "27140", "28030", "341207", "341307", "341407", "351207", "351307", "351407", "361207", "361307", "361407", "450217", "450317", "460217", "460317", "551307");
var L4 = new Array(250, "16001", "16051", "17001", "17051", "18001", "18011", "18041", "18051", "18130", "19010", "19020", "19040", "19050", "19130", "1A011", "1A041", "1A121", "1A131", "10111", "11101", "111117", "11121", "12111", "12141", "13131", "131417", "14141", "13151", "26001", "26051", "27001", "27051", "28001", "28011", "28041", "28051", "28130", "29010", "290207", "290407", "29050", "291307", "2A011", "2A041", "2A121", "2A131", "21011", "22011", "23041", "24041", "360017", "360517", "37001", "37051", "38001", "38011", "38041", "38051", "38130", "39010", "39020", "39040", "39050", "39130", "3A011", "3A041", "3A121", "3A131", "47101", "47151", "48110", "48150", "49020", "49040", "491307", "4A020", "4A040", "59121", "59131", "69130");
var L5 = new Array(450, "11110", "11120", "12101", "12111", "12121", "13100", "13120", "13130", "14040", "14100", "14120", "14130", "14150", "15060", "15040", "15120", "15130", "15150", "16040", "16060", "16100", "16120", "16130", "16150", "17040", "17100", "17120", "17130", "18101", "18111", "18121", "19110", "19120", "21110", "21120", "22101", "22111", "23030", "23100", "23120", "23140", "24030", "24050", "24160", "24100", "25020", "25030", "25050", "25140", "25160", "26020", "26030", "26050", "26100", "26160", "27030", "27050", "27100", "27120", "27140", "28030", "28101", "28111", "29110", "29120", "32101", "32111", "33030", "33100", "33140", "34020", "34030", "34050", "34100", "34160", "35020", "35030", "35040", "35050", "35160", "36020", "36030", "36040", "36050", "36100", "36160", "37020", "37030", "37050", "37100", "37140", "38030", "38101", "38111");
var L6 = new Array(240, "12130", "12140", "12150", "13020", "13110", "13151", "14101", "14160", "15100", "15160", "16101", "16160", "17110", "17151", "18020", "18130", "18140", "18150", "23031", "23041", "23121", "24011", "24050", "25010", "25051", "26010", "26051", "27011", "27050", "27121", "28031", "28041", "33140", "34030", "34120", "34141", "35111", "35141", "36120", "36141", "37030", "37140", "44131", "45021", "45041", "45131", "46021", "46041", "46131", "55031", "55121", "55141", "56031", "65131");
var L7 = new Array(90, "10120", "10130", "10140", "11130", "121308", "13130", "14121", "14131", "15011", "15041", "15101", "15151", "16011", "16041", "16121", "16131", "17130", "181309", "19130", "1A120", "1A130", "1A140", "21021", "21031", "24130", "26130", "2A021", "2A031");
var L8 = new Array(700, "10100", "10110", "10120", "10130", "10140", "10150", "10160", "11110", "11120", "111308", "11140", "11150", "12111", "12121", "12131", "12141", "13120", "13130", "13140", "14121", "14131", "15130", "16121", "16131", "17120", "17130", "17140", "18111", "18121", "18131", "18141", "19110", "19120", "191309", "19140", "19150", "1A100", "1A110", "1A120", "1A130", "1A140", "1A150", "1A160", "20101", "20111", "20121", "20131", "20141", "20151", "21111", "21121", "21131", "21141", "22120", "22130", "22140", "23121", "23131", "24130", "25130", "26130", "27121", "27131", "28120", "28130", "28140", "29111", "29121", "29131", "29141", "2A101", "2A111", "2A121", "2A131", "2A141", "2A151", "30110", "30120", "30130", "30140", "30150", "31120", "311302", "31140", "32121", "32131", "33130", "34130", "36130", "37130", "38121", "38131", "39120", "391302", "39140", "3A110", "3A120", "3A130", "3A140", "3A150", "40111", "40121", "40131", "40141", "41121", "41131", "42130", "44030", "47030", "48130", "49121", "49131", "4A111", "4A121", "4A131", "4A141", "501201", "501301", "50140", "51130", "52130", "53130", "57130", "58130", "59130", "5A1201", "5A1301", "5A140", "60121", "60131", "61130", "63030", "68030", "69130", "6A120", "6A130", "6A140", "70130", "71130", "72130", "78130", "79130", "7A130", "80130", "81130", "89130", "8A130", "90130", "9A130", "AA130");
var L9 = new Array(700, "10020", "10030", "10040", "10110", "10150", "11101", "11151", "12100", "12160", "13101", "13151", "14110", "14150", "15020", "15030", "15040", "16020", "16030", "16040", "16110", "16150", "17101", "17151", "18100", "18160", "19101", "19151", "1A110", "1A150", "1B020", "1B030", "1B040", "20120", "20130", "20140", "21010", "21050", "22001", "22051", "23001", "23051", "24010", "24050", "24120", "241303", "24141", "26120", "261303", "26140", "27010", "27050", "28001", "28051", "29001", "29051", "2A010", "2A050", "2A120", "2A130", "2A141", "31020", "310302", "31040", "31110", "31150", "32101", "32151", "33110", "33150", "34020", "34030", "34040", "37020", "37030", "37040", "37110", "37150", "38101", "38151", "39110", "39150", "3A020", "3A0302", "3A040", "41120", "41130", "41140", "42010", "42050", "43010", "43050", "43120", "43130", "43140", "47120", "47130", "47140", "48010", "48050", "49010", "49050", "49120", "49130", "49140", "520211", "52031", "52111", "52141", "53021", "53031", "58021", "58031", "58111", "58141", "59021", "590311", "62120", "62130", "62140", "68120", "68130", "68140", "72121", "72131", "78121", "78131", "82130", "88130");
var L10 = new Array(600, "10111", "10140", "11111", "11131", "11160", "12120", "12140", "12160", "13121", "13140", "13151", "14130", "14140", "14150", "15121", "15131", "15141", "15151", "16130", "16140", "16150", "17121", "17140", "17151", "18120", "18140", "18160", "19111", "19131", "19160", "1A111", "1A140", "14000", "14010", "15000", "15011", "16000", "16011", "17000", "17010", "20111", "20140", "21111", "21131", "21160", "22120", "22140", "22160", "23121", "23140", "23151", "24130", "24140", "24150", "25130", "25140", "25150", "26130", "26140", "26150", "27121", "27140", "27151", "28120", "28140", "28160", "29111", "29131", "29160", "2A111", "2A140", "241014", "25100", "25110", "261014", "30111", "30140", "31111", "311312", "31160", "32120", "32140", "32160", "33121", "33140", "33151", "34130", "34140", "34150", "35130", "35140", "35150", "36130", "36140", "36150", "37121", "37140", "37151", "38120", "38140", "38160", "39111", "391312", "39160", "3A111", "3A140", "35001", "36001", "44130", "44140", "44150", "45000", "45010", "45130", "451403", "451503", "46000", "46010", "46130", "46140", "46150", "551011");
var L11 = new Array(450, "101014", "101514", "11110", "11150", "12111", "12141", "13120", "13140", "14121", "14131", "151218", "151319", "16121", "16131", "17120", "17140", "18111", "18141", "19110", "19150", "1A1014", "1A1514", "21010", "21050", "22011", "22041", "23020", "23040", "24021", "24031", "25021", "25031", "26021", "26031", "27021", "27031", "28020", "28040", "29011", "29041", "2A010", "2A050", "31111", "31141", "321202", "321405", "33121", "33131", "35121", "35131", "37121", "37131", "381205", "381402", "39111", "39141", "42020", "42040", "43021", "43031", "45030", "46030", "48021", "48031", "49020", "49040", "52121", "521311", "550303", "560303", "581211", "58131", "62021", "62031", "65030", "66030", "69021", "69031", "72030", "75030", "76030", "79030");
var L12 = new Array(900, "10120", "11120", "12111", "12121", "13111", "13121", "14110", "14120", "14130", "15040", "15110", "151207", "15130", "15150", "16040", "16110", "16120", "16130", "17111", "17121", "18111", "18121", "19120", "1A120", "20120", "21120", "22111", "22121", "23111", "23121", "24110", "24120", "24130", "25110", "25120", "25130", "25141", "26110", "26120", "26130", "27111", "27121", "28111", "28121", "29120", "2A120", "301207", "31120", "32111", "321217", "33111", "33121", "34110", "34120", "34130", "351102", "351207", "351305", "35140", "36110", "36120", "36130", "37111", "37121", "38111", "381217", "39120", "3A120", "41020", "42020", "43011", "43021", "44011", "44021", "45010", "45020", "45030", "46010", "46020", "46030", "47011", "47021", "48011", "48021", "49020", "4A020", "51020", "52020", "53011", "53021", "54011", "54021", "55010", "55020", "55030", "56010", "56020", "56030", "57011", "57021", "58011", "58021", "59020", "5A020", "61120", "62120", "63111", "63121", "64111", "64121", "65110", "65120", "65130", "66111", "66121", "67111", "67121", "68120", "69120", "711207", "72120", "73111", "73121", "74111", "74121", "75110", "75120", "751307", "76111", "76121", "77111", "77121", "78120", "791207", "82020", "830202", "84011", "84021", "85011", "85021", "86011", "86021", "87011", "87021", "880202", "89020", "92120", "93120", "94111", "94121", "95111", "95121", "96111", "96121", "97120", "98120", "A3020", "A40204", "A5011", "A5021", "A6011", "A6021", "A70203", "A8020", "B31207", "B4120", "B5111", "B5121", "B6120", "B71207", "C4020", "C50201", "C60201", "C7020", "D4120", "D5120", "D6120", "E5020", "E6020", "F50207", "F6020");
var L13 = new Array(110, "12030", "15100", "15160", "19030", "22130", "25101", "25151", "28130", "33030", "35110", "35150", "38030", "43130", "45111", "45141", "47130", "54030", "55120", "55140", "57030", "64130", "65121", "65131", "66130", "75030", "76030", "85121", "85131", "95030", "96030", "A4130", "A6130", "B4030", "B7030", "C3130", "C7130", "D3030", "D8030", "E3030", "E8030", "F3030", "F80304");
var L14 = new Array(400, "10000", "10010", "10050", "10060", "10120", "10130", "10140", "11000", "11010", "11050", "11060", "12001", "12051", "14001", "14020", "14030", "14040", "14051", "15020", "150305", "15040", "16001", "16020", "16030", "16040", "16051", "18001", "18051", "19000", "19010", "19050", "19060", "19120", "19130", "19140", "1A000", "1A010", "1A050", "1A060", "20000", "20010", "20050", "20060", "20121", "20131", "21000", "21010", "21050", "21060", "22101", "22151", "23101", "23151", "241016", "241513", "251013", "251516", "26101", "26151", "27101", "27151", "29000", "29010", "29050", "29060", "2A000", "2A010", "2A050", "2A060", "24121", "24131", "25121", "25131", "29121", "29131", "30101", "301302", "30151", "33001", "33051", "34121", "34131", "350014", "350514", "35121", "35131", "37001", "37051", "39101", "391302", "39151", "40101", "40130", "40151", "44020", "44030", "44040", "45020", "450301", "45040", "46020", "46030", "46040", "49101", "49130", "49151", "53120", "53140", "56120", "56140", "55030", "65030");
var L15 = new Array(600, "100007", "100105", "10020", "10030", "10040", "100503", "11000", "11010", "11020", "11030", "11040", "11050", "12000", "12020", "120307", "12040", "12050", "13000", "13010", "13020", "130307", "13040", "13050", "14000", "14010", "14020", "140307", "14040", "14050", "15000", "15010", "15020", "15030", "15040", "15050", "16000", "16010", "16020", "160307", "16040", "16050", "17000", "170106", "17020", "17030", "17040", "170504", "18000", "18010", "18020", "18030", "18040", "18050", "21100", "22100", "23100", "24100", "25100", "26100", "27100", "20010", "21010", "22010", "23010", "24010", "25010", "26010", "27010", "20020", "20030", "20040", "20050", "21050", "22050", "23050", "24050", "25050", "26050", "27050", "28050", "28020", "28030", "28040", "31000", "32000", "33000", "34000", "35000", "36000", "37000", "38000", "30010", "31010", "32010", "33010", "34010", "35010", "36010", "30020", "30030", "30040", "30050", "31050", "32050", "33050", "34050", "35050", "36050", "37050", "38050", "38030", "38040", "41100", "42100", "43100", "44100", "451003", "46100", "47100", "40010", "41010", "42010", "43010", "44010", "45010", "40020", "400304", "40040", "40050", "48040", "47050", "48050", "52000", "53000", "54000", "55000", "56000", "57000", "58000", "50010", "51010", "52010", "53010", "54010", "50020", "50030", "50040", "50050", "580507", "62100", "63100", "64100", "65100", "66100", "67100", "60010", "60020", "60030", "60040", "730007", "74000", "75000", "76000", "770005", "78000", "70010", "71010", "72010", "700202", "70030", "83100", "84100", "85100", "86100", "87100", "80010", "80020", "81010", "94000", "95000", "96000", "97000", "98000", "900107", "A41001", "A5100", "A6100", "A71001", "B5000", "B6000", "B7000", "B8000", "C5100", "C61006", "C7100", "D6000", "D7000", "D8000", "E6100", "E7100");
static var hex = [null, "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
}
Symbol 597 MovieClip [__Packages.Sorter] Frame 0
class Sorter
{
var ref, lastAddedPoss, checkClickability, coveredPosition, workArray, clickableArray, tilesInLevel, incomingArray, goldTilesInLevel, fixedTilesInLevel, readyArray, worked, possibleTypes, possibleTypesClone, paired, startNorm, timeOut;
function Sorter (refer) {
ref = refer;
lastAddedPoss = [];
checkClickability = mx.utils.Delegate.create(ref, ref.ifClickable);
coveredPosition = mx.utils.Delegate.create(ref, ref.quickRecalculate);
}
function makeClickableArray() {
var _local3 = [];
var _local2;
for (var _local4 in workArray) {
_local2 = workArray[_local4];
if (checkClickability(_local2.pos, workArray)) {
_local3.push(_local2);
}
}
return(_local3);
}
function quickClickableChange(tile) {
if (checkClickability(tile.pos, workArray) && (tile.pos != undefined)) {
clickableArray.push(tile);
}
if (clickableArray.length == 0) {
clickableArray = makeClickableArray();
}
}
function getAllCoveredTilesPosition(pos) {
var _local5 = [];
var _local4 = [];
var _local8 = coveredPosition(pos)[0];
var _local6 = -1;
var _local9 = _local8.length;
var _local7 = workArray.length;
while (_local6++ , _local6 < _local9) {
var _local3 = _local8[_local6];
var _local2 = 0;
while (_local2 < _local7) {
if (_local3 == workArray[_local2].pos) {
_local5.push(_local3);
_local4.push(_local2);
break;
}
_local2++;
}
}
return([_local5, _local4]);
}
function initWorkArray() {
tilesInLevel = incomingArray.length;
goldTilesInLevel = (fixedTilesInLevel = 0);
readyArray = [];
workArray = [];
var _local3 = -1;
var _local2 = {};
while (_local3++ , _local3 < tilesInLevel) {
_local2 = incomingArray[_local3];
_local2.index = _local3;
if (_local2.pos.length == 4) {
_local2.pos = _local2.pov + _local2.pos;
}
_local2.type = -1;
if (_local2.spt == 7) {
goldTilesInLevel++;
}
if (_local2.fix != 0) {
fixedTilesInLevel++;
}
_local2.piramid = [];
workArray.push(_local2);
}
if (((tilesInLevel - goldTilesInLevel) % 2) == 1) {
return(false);
}
clickableArray = makeClickableArray();
return(true);
}
function pushReadyTile(pos, types) {
var _local4 = -1;
var _local6 = workArray.length;
while (_local4++ , _local4 < _local6) {
var _local2 = workArray[_local4];
if (_local2.pos == pos) {
_local2.type = types;
if (types != -1) {
if (types == undefined) {
}
_local2.piramid.concat(types);
}
workArray.splice(_local4, 1);
readyArray.push(_local2);
worked.push(pos);
return(undefined);
}
}
}
function findOneClickablkeTile(til) {
do {
while (if (workArray.length <= 0) {
break;
}
, var _local4 = clickableArray.length , var _local3 = random(_local4) , var _local2 = clickableArray[_local3] , clickableArray.splice(_local3, 1) , _local2.spt > 6) {
pushReadyTile(_local2.pos, -1);
smallRecalc(_local2);
}
} while (!((_local2.pos != til.pos) && (!com.enkord.utils.ArrayUtils.containsValue(worked, _local2.pos))));
return(_local2);
}
function getTilePair() {
var _local2 = findOneClickablkeTile();
return([_local2, findOneClickablkeTile(_local2)]);
}
function initTypesArray() {
possibleTypes = [];
var _local5 = -1;
var _local3 = MahjongTileSet.TILES_COUNT;
var _local4 = Math.round(_local3 * 0.95);
while (possibleTypes.length <= _local4) {
var _local2 = random(_local3) + 1;
if (!com.enkord.utils.ArrayUtils.containsValue(possibleTypes, _local2)) {
possibleTypes.push(_local2);
}
}
possibleTypesClone = com.enkord.utils.ArrayUtils.clone(possibleTypes);
}
function runtimeSort() {
var _local5;
var _local4 = getTilePair();
var _local3 = _local4[0];
var _local2 = _local4[1];
if (possibleTypes.length > 4) {
var _local6 = random(possibleTypes.length);
_local5 = possibleTypes[_local6];
possibleTypes.splice(_local6, 1);
} else {
_local5 = findNotUsedType(_local3.piramid, _local2.piramid);
}
if ((_local3.fix != 0) && (_local2.fix != 0)) {
pushReadyTile(_local3.pos, _local3.fix);
pushReadyTile(_local2.pos, _local2.fix);
} else {
if (_local3.fix != 0) {
_local5 = _local3.fix;
}
if (_local2.fix != 0) {
_local5 = _local2.fix;
}
pushReadyTile(_local3.pos, _local5);
pushReadyTile(_local2.pos, _local5);
}
if (workArray.length > 2) {
smallRecalc(_local3);
smallRecalc(_local2);
if (clickableArray.length < 2) {
clickableArray = makeClickableArray();
}
paired++;
if (clickableArray.length > 1) {
runtimeSort();
}
} else if (workArray.length == 2) {
if ((workArray[0].fix == 0) && (workArray[1].fix == 0)) {
_local5 = findNotUsedType(workArray[0].piramid, workArray[1].piramid);
pushReadyTile(workArray[0].pos, _local5);
pushReadyTile(workArray[0].pos, _local5);
} else {
pushReadyTile(workArray[0].pos, workArray[0].fix);
pushReadyTile(workArray[0].pos, workArray[0].fix);
}
} else {
pushReadyTile(workArray[0].pos, -1);
}
}
function smallRecalc(tile) {
var _local11 = getAllCoveredTilesPosition(tile.pos);
var _local12 = _local11[0];
var _local9 = _local11[1];
var _local7 = -1;
var _local8 = _local12.length;
if (_local8 == 0) {
return(undefined);
}
while (_local7++ , _local7 < _local8) {
var _local6 = workArray[_local9[_local7]];
var _local4 = _local6.piramid;
var _local3 = tile.piramid;
var _local5 = _local3.length;
if (workArray.length < 10) {
}
var _local2 = 0;
while (_local2 < _local5) {
if (!com.enkord.utils.ArrayUtils.containsValue(_local4, _local3[_local2])) {
_local4.push(_local3[_local2]);
}
_local2++;
}
quickClickableChange(_local6);
}
}
function findNotUsedType(pira1, pira2) {
var _local6 = pira1.concat(pira2);
var _local2 = com.enkord.utils.ArrayUtils.getUniqueValues(_local6);
if (_local2.length > 0) {
var _local5 = _local2[random(_local2.length)];
return(_local5);
}
if (possibleTypes.length > 0) {
var _local3 = random(possibleTypes.length);
var _local4 = possibleTypes[_local3];
possibleTypes.splice(_local3, 1);
return(_local4);
}
return(possibleTypesClone[random(possibleTypesClone.length)]);
}
function get _goldtiles() {
return(goldTilesInLevel);
}
function normLevel(gamelevel) {
startNorm = getTimer();
timeOut = gamelevel[0];
gamelevel.splice(0, 1);
incomingArray = gamelevel;
initTypesArray();
worked = [];
if (initWorkArray()) {
paired = 0;
runtimeSort();
readyArray.sortOn("index", Array.NUMERIC);
readyArray.unshift(timeOut);
return(readyArray);
}
return([]);
}
}
Symbol 598 MovieClip [__Packages.com.enkord.utils.ArrayUtils] Frame 0
class com.enkord.utils.ArrayUtils extends Object
{
function ArrayUtils () {
super();
}
static function containsValue(array, object) {
return(indexOf(array, object) != -1);
}
static function indexOf(array, object) {
var _local1 = array.length;
while (_local1-- , _local1 > -1) {
if (object instanceof Array) {
if (isSame(object, array[_local1])) {
return(_local1);
}
} else if (object === array[_local1]) {
return(_local1);
}
}
return(-1);
}
static function clone(array) {
var _local3 = function (arr) {
var _local2 = [];
for (var _local3 in arr) {
_local2.unshift(((arr[_local3] instanceof Array) ? (com.enkord.utils.ArrayUtils.clone(arr[_local3])) : (arr[_local3])));
}
return(_local2);
};
return(_local3(array));
}
static function arrayValuesSum(array) {
var _local3 = 0;
var _local2 = -1;
var _local4 = array.length;
while (_local2++ , _local2 < _local4) {
var _local1 = parseInt(array[_local2]);
if (isNaN(_local1)) {
} else {
_local3 = _local3 + _local1;
}
}
return(_local3);
}
static function concat2Arrays(array1, array2) {
var _local1 = new Array();
return(_local1.concat(array1, array2));
}
static function lastElementInArray(array) {
return(array[array.length - 1]);
}
static function removeDuplicates(array) {
var _local2 = [];
var _local4 = 0;
var _local1 = -1;
var _local5 = array.length;
while (_local1++ , _local1 < _local5) {
if (!containsValue(_local2, array[_local1])) {
_local2.push(array[_local1]);
} else {
_local4++;
}
}
return(_local2);
}
static function getUniqueValues(array) {
var _local4 = [];
var _local1 = -1;
var _local6 = array.length;
var _local5 = [];
while (_local1++ , _local1 < _local6) {
if (!containsValue(_local5, array[_local1])) {
var _local3 = indexOf(_local4, array[_local1]);
if (_local3 == -1) {
_local4.push(array[_local1]);
} else {
_local5.push(array[_local1]);
_local4.splice(_local3, 1);
}
}
}
return(_local4);
}
static function isSame(array1, array2) {
var _local1 = array1.length;
if (_local1 != array2.length) {
return(false);
}
while (_local1-- , _local1 > -1) {
if ((array1[_local1] instanceof Array) && (array2[_local1] instanceof Array)) {
return(isSame(array1[_local1], array2[_local1]));
}
if (!(array1[_local1] === array2[_local1])) {
return(false);
}
}
return(true);
}
static function nextInArray(array, value) {
var _local2 = array.length;
value++;
return(((value > (_local2 - 1)) ? (array[value % _local2]) : (array[value])));
}
}
Symbol 599 MovieClip [__Packages.MahjongMap] Frame 0
class MahjongMap extends MovieClip
{
var __lastAdvFrame, __level, __get___level, __score, __get___score, cloudContainer, groundContainer, _parent, __playpressed, attachMovie, darkblue_mc, __viewAdver, score_txt, play_btn, createEmptyMovieClip, getNextHighestDepth, inter;
function MahjongMap () {
super();
}
function onLoad() {
__lastAdvFrame = 0;
newInit();
}
function set _level(value) {
__level = value;
//return(__get___level());
}
function set _round(value) {
__roundPlay = value;
//return(_round);
}
function get _round() {
return(__roundPlay);
}
function set _score(value) {
__score = value;
//return(__get___score());
}
function clearMap() {
for (var _local3 in __cloudCollection) {
var _local2 = __cloudCollection[_local3];
_local2.kill();
}
for (var _local3 in __waysCollection) {
var _local2 = __waysCollection[_local3];
_local2.removeMovieClip();
}
for (var _local3 in __pointsCollection) {
var _local2 = __pointsCollection[_local3];
_local2.removeMovieClip();
}
cloudContainer.removeMovieClip();
groundContainer.removeMovieClip();
__pointsCollection = (__waysCollection = (__cloudCollection = []));
}
function newInit(panicexit) {
__level = parseInt(_global.gamelevel);
__score = _global.totalscore;
__roundPlay = _global.roundgame;
_parent.cursor._visible = true;
__playpressed = false;
__roundPlay = _global.roundgame;
_parent.cursor.gotoAndStop(1);
if (_global.gamelevel == (LEVELS + 1)) {
var _local4 = com.enkord.sound.SoundManager.getInstance();
_local4.stopSound("menumusic");
_local4.playSound("victory", false, [100]);
_local4.playSound("menumusic", true, [0, 100], 10000);
var _local12 = attachMovie("GameComplete", "game_complete_mc", darkblue_mc.getDepth() - 1);
return(undefined);
}
if (((levels["lev" + (_global.gamelevel - 1).toString()].adv == 1) && (__viewAdver == false)) && (panicexit == undefined)) {
__lastAdvFrame++;
__viewAdver = true;
if (__lastAdvFrame > 4) {
__lastAdvFrame = 1;
}
var _local3 = attachMovie("Advertising", "adverts_mc", darkblue_mc.getDepth() - 1);
_local3.gotoAndStop(__lastAdvFrame);
switch (__lastAdvFrame) {
case 1 :
var _local5 = com.enkord.animation.ImagesAlphaBlend.create(_local3, "blend", 160000, {imagesId:["c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8"], staticView:1050, blendTime:400, blendIterations:8, repeat:true, randomize:true, _x:37, _y:97});
_local5.swapDepths(_local3.ramka);
break;
case 2 :
_local5 = _local3.treasure;
break;
case 3 :
_local5 = com.enkord.effects.images.UnderMaskMoving.create(_local3, "mov", 160001, {time:20000, iterations:400, id:"AdvertisingMap", width:313, _x:15, _y:57});
_local5.swapDepths(_local3.ramka);
break;
case 4 :
_local5 = com.enkord.effects.images.EffectsFactory.create(_local3, "factory", 1, {effectsInterval:2000, effectsDuration:500, max_area:20, imagesId:["advEff1", "advEff2", "advEff3", "advEff4", "advEff5"], _x:13, _y:57});
_local5.swapDepths(_local3.ramka);
}
_local5.setMask(_local3.ad_maska);
} else {
__viewAdver = false;
_score = (_global.totalscore);
_level = (_global.gamelevel);
score_txt.text = __score.toString();
play_btn.enabled = false;
groundContainer = createEmptyMovieClip("ground_container", getNextHighestDepth());
cloudContainer = createEmptyMovieClip("cloud_container", getNextHighestDepth());
if (__level > 1) {
drawWays(panicexit);
} else {
drawLastpoint();
}
initClouds();
initPlayButton();
}
}
function initCheats() {
Key.removeListener(list);
list = {};
list.onKeyDown = mx.utils.Delegate.create(this, function () {
if (!(Key.getCode() === 32)) {
} else {
this.__gameZone._pause = !this.__gameZone._pause;
}
});
Key.addListener(list);
}
function removeCheats() {
Key.removeListener(list);
}
function initClouds() {
var _local3 = 0;
while (_local3++ , _local3 <= 20) {
var _local2 = MapCloud(cloudContainer.attachMovie("MapCloud", "cloud_mc" + _local3, cloudContainer.getNextHighestDepth(), {_x:random(440), _y:random(320), _alpha:90}));
__cloudCollection.push(_local2);
}
}
function initPlayButton() {
play_btn.onPress = mx.utils.Delegate.create(this, function () {
if (this.__playpressed) {
return(undefined);
}
this.dark_mc = this.attachMovie("AutoDeathDarkBlueMovie", "darkblue_mc", this.getNextHighestDepth());
MovieClip(this.adverts).removeMovieClip();
this.__playpressed = true;
var _local3 = com.enkord.sound.SoundManager.getInstance();
_local3.playSound("mouse_click", false, [100]);
_local3.playSound("gamemusic", true, [0, 40], 2000);
_local3.fadeOutStop("menumusic", 1000);
this.inter = setInterval(mx.utils.Delegate.create(this, function () {
this.clearMap();
clearInterval(this.inter);
delete this.__gameZone;
this._parent.cursor._visible = false;
this.play_btn.enabled = false;
this.__gameZone = MahjongTileSet(this.attachMovie("gamezonemahjong", "gamezonemahjong", this.dark_mc.getDepth() - 1));
this.__gameZone._gamelevel = this.__level;
this.__gameZone._map = this;
this.__gameZone._score = _global.totalscore;
var _local3 = this.levels["lev" + this.__level];
this.__gameZone._containerCoo = {x:_local3.cx, y:_local3.cy};
}), 666);
});
}
function getWayPointsCoo(forlevel) {
var _local4 = levels["lev" + forlevel];
var _local10 = levels["lev" + (forlevel + 1)];
var _local12 = 22;
var _local7 = _local10.x - _local4.x;
var _local8 = _local10.y - _local4.y;
var _local11 = Math.sqrt((_local7 * _local7) + (_local8 * _local8));
var _local3 = Math.floor(_local11 / _local12);
var _local9 = [];
var _local2 = 1;
while (_local2 < _local3) {
_local9.push({x:((_local2 * (_local7 / _local3)) + _local4.x) + 25, y:((_local2 * (_local8 / _local3)) + _local4.y) + 25});
_local2++;
}
return(_local9);
}
function drawWayPoints(points) {
var _local9 = points.length;
var _local2 = 0;
while (_local2 < _local9) {
var _local5 = k.toString() + _local2.toString();
var _local3 = points[_local2];
var _local4 = groundContainer.attachMovie("MapWay", "waypoint" + _local5, groundContainer.getNextHighestDepth(), {_x:_local3.x, _y:_local3.y, _alpha:80});
__waysCollection.push(_local4);
_local2++;
}
}
function drawWays(panicexit) {
var _local2 = 0;
var _local3 = (panicexit ? (__level) : (__level - 1));
while (_local2++ , _local2 < _local3) {
drawWayPoints(getWayPointsCoo(_local2));
}
if (__level >= 5) {
drawWayPoints(getWayPointsCoo(19));
var _local5 = drawMapPoint(20);
_local5.__set___type(4);
_local5.__set___new(true);
}
if (__level >= 11) {
drawWayPoints(getWayPointsCoo(21));
var _local5 = drawMapPoint(22);
_local5.__set___type(4);
_local5.__set___new(true);
}
animIndex = 0;
drawPoints(panicexit);
if (_local3 == __level) {
drawLastpoint();
return(undefined);
}
var _local7 = getWayPointsCoo(__level - 1);
inter = setInterval(mx.utils.Delegate.create(this, function (points) {
var _local2 = points[this.animIndex];
var _local4 = this.__level.toString() + this.animIndex.toString();
var _local3 = this.groundContainer.attachMovie("MapWay", "waypoint" + _local4, -1 - this.animIndex, {_x:_local2.x, _y:_local2.y, _alpha:80});
this.__waysCollection.push(_local3);
if (this.animIndex == (points.length - 1)) {
clearInterval(this.inter);
this.drawLastpoint();
}
this.animIndex++;
}), 500, _local7);
}
function drawLastpoint() {
lO = levels["lev" + __level];
var _local2 = MahjongMapPoint(groundContainer.attachMovie("MahjongMapPoint", "mappoint_mc" + __level, groundContainer.getNextHighestDepth(), {_x:lO.x, _y:lO.y, _alpha:0}));
__pointsCollection.push(_local2);
_local2.__set___new(true);
_local2.__set___type(MahjongLevels.getMode(__level.toString()) + 1);
com.enkord.sound.SoundManager.getInstance().playSound("new_level", false, [100]);
inter = setInterval(mx.utils.Delegate.create(this, function (obj) {
obj._alpha = obj._alpha + 5;
if (obj._alpha >= 100) {
clearInterval(this.inter);
this.play_btn.enabled = true;
}
}), 40, _local2);
}
function drawMapPoint(k) {
var _local3 = levels["lev" + k];
var _local2 = MahjongMapPoint(groundContainer.attachMovie("MahjongMapPoint", "mappoint_mc" + k, groundContainer.getNextHighestDepth(), {_x:_local3.x, _y:_local3.y}));
_local2.__set___new(false);
_local2.__set___type(MahjongLevels.getMode(k.toString()) + 1);
__pointsCollection.push(_local2);
return(_local2);
}
function drawPoints() {
var _local2 = 0;
while (_local2++ , _local2 < __level) {
drawMapPoint(_local2);
}
}
static var LEVELS = 15;
var levels = {lev1:{x:11, y:274, adv:0, cx:77, cy:-3}, lev2:{x:101, y:274, adv:0, cx:81, cy:-5}, lev3:{x:168, y:223, adv:1, cx:77, cy:-5}, lev4:{x:244, y:273, adv:0, cx:75, cy:-2}, lev5:{x:393, y:231, adv:0, cx:77, cy:-3}, lev6:{x:382, y:142, adv:1, cx:79, cy:-7}, lev7:{x:396, y:53, adv:0, cx:79, cy:-7}, lev8:{x:324, y:4, adv:1, cx:67, cy:-9}, lev9:{x:290, y:74, adv:0, cx:82, cy:-7}, lev10:{x:226, y:119, adv:1, cx:76, cy:-5}, lev11:{x:189, y:35, adv:1, cx:80, cy:-10}, lev12:{x:109, y:14, adv:1, cx:79, cy:13}, lev13:{x:83, y:85, adv:1, cx:61, cy:-5}, lev14:{x:3, y:48, adv:1, cx:93, cy:-8}, lev15:{x:2, y:144, adv:0, cx:120, cy:37}, lev19:{x:244, y:273}, lev20:{x:300, y:203}, lev21:{x:226, y:119}, lev22:{x:150, y:145}};
var list = null;
var __roundPlay = 0;
var __cloudCollection = [];
var __waysCollection = [];
var __pointsCollection = [];
var animIndex = 0;
}
Symbol 600 MovieClip [__Packages.MapCloud] Frame 0
class MapCloud extends MovieClip
{
var inter, removeMovieClip, gotoAndStop, _xscale, _yscale, __xshift, __yshift;
function MapCloud () {
super();
}
function onLoad() {
startMoving();
}
function kill() {
clearInterval(inter);
removeMovieClip();
}
function startMoving() {
if (random(2) == 1) {
(gotoAndStop(2));// not popped
_xscale = (_yscale = random(20) + 80);
}
__xshift = (Math.random() * ((random(2) == 1) ? -1 : 1)) / 2;
__yshift = (Math.random() * ((random(2) == 1) ? -1 : 1)) / 2;
inter = setInterval(mx.utils.Delegate.create(this, function () {
this._x = this._x + this.__xshift;
this._y = this._y + this.__yshift;
if (this._x < -100) {
this._x = 480;
} else if (this._x > 480) {
this._x = -100;
}
if (this._y < -100) {
this._y = 360;
} else if (this._y > 360) {
this._y = -100;
}
}), 50);
}
}
Symbol 601 MovieClip [__Packages.MahjongMapPoint] Frame 0
class MahjongMapPoint extends MovieClip
{
var __new, __complete, __get___new, __type, __get___type, splash, complete, gotoAndStop;
function MahjongMapPoint () {
super();
}
function set _new(value) {
__new = value;
__complete = !value;
//return(__get___new());
}
function set _type(value) {
__type = value;
//return(__get___type());
}
function onLoad() {
splash._visible = __new;
complete._visible = __complete;
gotoAndStop(__type);
}
}
Symbol 602 MovieClip [__Packages.com.enkord.animation.ImagesAlphaBlend] Frame 0
class com.enkord.animation.ImagesAlphaBlend extends MovieClip
{
var conveyor, attachMovie, imagesId, blendIterations, blendTime, randomize, repeat, staticView;
function ImagesAlphaBlend () {
super();
conveyor = new com.enkord.utils.Conveyor();
initConveyorQueue(START_DEPTH);
conveyor.start();
}
static function create(this_mc, name, depth, init_obj) {
return(com.enkord.animation.ImagesAlphaBlend(com.enkord.utils.McFactory.create(this_mc, name, depth, init_obj, com.enkord.animation.ImagesAlphaBlend)));
}
function attach(id, depth) {
var _local3 = attachMovie(id, id, depth);
}
function initConveyorQueue(start_depth, prev_nextId) {
var _local3 = -1;
var _local6 = imagesId.length;
var _local7 = blendTime / blendIterations;
var _local10 = 100 / blendIterations;
var _local9 = [];
while (_local3++ , _local3 < _local6) {
var _local2;
var _local8 = start_depth - _local3;
if (randomize) {
_local2 = (((prev_nextId != undefined) && (_local3 == 0)) ? (prev_nextId) : (nextId));
} else {
_local2 = imagesId[_local3];
}
var nextId = _local2;
if (randomize) {
while ((_local2 == nextId) || (com.enkord.utils.ArrayUtils.containsValue(_local9, nextId))) {
nextId = imagesId[random(_local6)];
}
_local9.push(nextId);
} else {
nextId = ((repeat && (_local3 == (_local6 - 1))) ? (imagesId[0]) : (imagesId[_local3 + 1]));
}
if (start_depth == START_DEPTH) {
attachMovie(_local2, _local2, _local8);
}
conveyor.addToQueue(this, attach, [nextId, _local8 - 1], staticView, "secondAttach");
if ((!isNaN(_local7)) && (_local7 > 0)) {
var _local4 = 0;
while (_local4 < blendIterations) {
conveyor.addToQueue(this, function (delta, id) {
MovieClip(this[id])._alpha = MovieClip(this[id])._alpha - delta;
}, [_local10, (((prev_nextId != undefined) && (_local3 == 0)) ? (prev_nextId) : (_local2))], _local7, "alphaIteration");
_local4++;
}
}
conveyor.addToQueue(this, function (id) {
MovieClip(this[id]).removeMovieClip();
}, [_local2], 0, "removeInvisibleObject");
}
if (lapEndHandler != null) {
conveyor.addToQueue(this, lapEndHandler, [], 0, "dispatchLapEndEvent");
}
if (repeat) {
conveyor.addToQueue(this, initConveyorQueue, [start_depth - _local6, (randomize ? (nextId) : undefined)], 0, "repeatAddQueue");
}
}
static var START_DEPTH = 16000;
var lapEndHandler = null;
}
Symbol 603 MovieClip [__Packages.com.enkord.effects.images.UnderMaskMoving] Frame 0
class com.enkord.effects.images.UnderMaskMoving extends MovieClip
{
var __object, attachMovie, id, createEmptyMovieClip, width, direction, iterations, time;
function UnderMaskMoving () {
super();
__object = attachMovie(id, id, 1);
var _local3 = createEmptyMovieClip("mask", 2);
__object.setMask(_local3);
_local3.lineStyle(0, 0, 0);
_local3.beginFill(0, 100);
com.enkord.design.Drawing.drawRectangle(_local3, 0, 0, width, __object._height);
direction = true;
setInterval(this, "moving", time / iterations, (-__object._width) + width, __object._width / iterations);
}
static function create(this_mc, name, depth, init_obj) {
return(com.enkord.effects.images.UnderMaskMoving(com.enkord.utils.McFactory.create(this_mc, name, depth, init_obj, com.enkord.effects.images.UnderMaskMoving)));
}
function moving(minX, deltaX) {
__object._x = __object._x - (direction ? (deltaX) : (-deltaX));
if (__object._x <= minX) {
direction = false;
}
if (__object._x > 0) {
direction = true;
}
updateAfterEvent();
}
}
Symbol 604 MovieClip [__Packages.com.enkord.design.Drawing] Frame 0
class com.enkord.design.Drawing
{
function Drawing () {
}
static function drawRectangle(object, startX, startY, width, height) {
with (object) {
moveTo(startX, startY);
lineTo(startX + width, startY);
lineTo(startX + width, startY + height);
lineTo(startX, startY + height);
lineTo(startX, startY);
endFill();
}
}
static function drawRoundedRectangle(object, startX, startY, width, height, radius) {
var right = (startX + width);
var bottom = (startY + height);
with (object) {
moveTo(startX + radius, startY);
lineTo(right - radius, startY);
curveTo(right, startY, right, startY + radius);
lineTo(right, (startY + height) - radius);
curveTo(right, bottom, right - radius, bottom);
lineTo(startX + radius, bottom);
curveTo(startX, bottom, startX, bottom - radius);
lineTo(startX, startY + radius);
curveTo(startX, startY, startX + radius, startY);
endFill();
}
}
}
Symbol 605 MovieClip [__Packages.com.enkord.effects.images.EffectsFactory] Frame 0
class com.enkord.effects.images.EffectsFactory extends MovieClip
{
var __randomes, __effectCounter, __imagesRands, __conveyor, imagesId, attachMovie, effectsInterval, effectsDuration, max_area, getInstanceAtDepth;
function EffectsFactory () {
super();
__randomes = [];
__effectCounter = DEFAULT_DEPTH;
__imagesRands = [];
__conveyor = new com.enkord.utils.Conveyor();
makeNewEffect();
__conveyor.start();
}
static function create(this_mc, name, depth, init_obj) {
return(com.enkord.effects.images.EffectsFactory(com.enkord.utils.McFactory.create(this_mc, name, depth, init_obj, com.enkord.effects.images.EffectsFactory)));
}
function getRandomEffectId() {
var _local2 = __allIds[random(__allIds.length)];
if (__randomes.length < __allIds.length) {
if (!com.enkord.utils.ArrayUtils.containsValue(__randomes, _local2)) {
__randomes.push(_local2);
return(_local2);
}
return(getRandomEffectId());
}
__randomes = [];
__randomes.push(_local2);
return(_local2);
}
function getRandomImageId() {
var _local2 = imagesId[random(imagesId.length)];
if (__imagesRands.length < imagesId.length) {
if (!com.enkord.utils.ArrayUtils.containsValue(__imagesRands, _local2)) {
__imagesRands.push(_local2);
return(_local2);
}
return(getRandomImageId());
}
__imagesRands = [];
__imagesRands.push(_local2);
return(_local2);
}
function makeNewEffect() {
var _local6 = getRandomEffectId();
var _local3 = getRandomImageId();
var _local2 = attachMovie(_local3, _local3 + __effectCounter.toString(), __effectCounter, {_visible:false});
__conveyor.addToQueue(this, function (image) {
image._visible = true;
}, [_local2], ((__effectCounter == DEFAULT_DEPTH) ? 0 : (effectsInterval)), "placebo");
switch (_local6) {
case "squares" :
var _local8 = function (imageRef, time, max_area, depth, hand) {
var _local1 = new com.enkord.effects.images.SquaresMask(imageRef, max_area * 2, time, depth, false);
_local1.onComplete = hand;
};
break;
case "horizontal" :
var ori = ((random(2) == 0) ? (com.enkord.effects.images.HorizontalStripeMask.UP_TO_DOWN) : (com.enkord.effects.images.HorizontalStripeMask.DOWN_TO_UP));
_local8 = function (imageRef, time, max_area, depth, hand) {
var _local1 = new com.enkord.effects.images.HorizontalStripeMask(imageRef, max_area, time, 10, ori, depth, false);
_local1.onComplete = hand;
};
break;
case "vertical" :
var ori = ((random(2) == 0) ? (com.enkord.effects.images.VerticalStripeMask.LEFT_TO_RIGHT) : (com.enkord.effects.images.VerticalStripeMask.RIGHT_TO_LEFT));
_local8 = function (imageRef, time, max_area, depth, hand) {
var _local1 = new com.enkord.effects.images.VerticalStripeMask(imageRef, max_area, time, 10, ori, depth, false);
_local1.onComplete = hand;
};
break;
case "vertical_against" :
var ori = ((random(2) == 0) ? (com.enkord.effects.images.VerticalAgainstStripesMask.ORIENTATION_UP) : (com.enkord.effects.images.VerticalAgainstStripesMask.ORIENTATION_DOWN));
var easy = ((random(5) / 10) + 0.25);
_local8 = function (imageRef, time, max_area, depth, hand) {
var _local1 = new com.enkord.effects.images.VerticalAgainstStripesMask(imageRef, max_area, time, 10, easy, ori, depth, false);
_local1.onComplete = hand;
};
}
__conveyor.addToQueue(this, _local8, [_local2, effectsDuration, max_area, __effectCounter - 1, mx.utils.Delegate.create(this, effComplete)], 0, "effectFunction");
__effectCounter = __effectCounter + 2;
}
function effComplete() {
getInstanceAtDepth(__effectCounter - 4).removeMovieClip();
getInstanceAtDepth(__effectCounter - 5).removeMovieClip();
__conveyor.addToQueue(this, makeNewEffect, [], 0, "makeNewEffect");
}
static var __allIds = ["squares", "horizontal", "vertical", "vertical_against"];
static var DEFAULT_DEPTH = 1;
}
Symbol 606 MovieClip [__Packages.com.enkord.effects.images.SquaresMask] Frame 0
class com.enkord.effects.images.SquaresMask
{
var __inversation, __conveyor, __object, __mask, onComplete;
function SquaresMask (object, squareSize, time, mask_depth, invers) {
var _local12 = Math.round((object._height / squareSize) + 1);
var _local13 = Math.round((object._width / squareSize) + 1);
var _local16 = object._parent;
var _local9 = _local12 * _local13;
var _local11 = time / _local9;
var _local3 = [];
while (_local3.length < _local9) {
var _local8 = random(_local12);
var _local7 = random(_local13);
var _local6 = [_local8, _local7];
if (!com.enkord.utils.ArrayUtils.containsValue(_local3, _local6)) {
_local3.push(_local6);
}
}
__inversation = invers;
__conveyor = new com.enkord.utils.Conveyor();
__object = object;
__mask = _local16.createEmptyMovieClip("mask_sm", ((mask_depth != undefined) ? (mask_depth) : (_local16.getNextHighestDepth())));
__mask._x = object._x;
__mask._y = object._y;
var _local2 = 0;
while (_local2 < _local9) {
var _local4 = _local3[_local2][0];
var _local5 = _local3[_local2][1];
if (!invers) {
__conveyor.addToQueue(this, createSquare, [_local4, _local5, squareSize, _local2], ((_local2 == 0) ? 0 : (_local11)));
} else {
createSquare(_local4, _local5, squareSize, _local2);
__conveyor.addToQueue(this, deleteSquare, [_local4, _local5], ((_local2 == 0) ? 0 : (_local11)));
}
_local2++;
}
__object.setMask(__mask);
__conveyor.addToQueue(this, complete);
__conveyor.start();
}
function deleteSquare(r, c) {
MovieClip(__mask[("sq_" + r.toString()) + c.toString()]).removeMovieClip();
}
function createSquare(r, c, size, depth) {
var _local2 = __mask.createEmptyMovieClip(("sq_" + r.toString()) + c.toString(), depth);
_local2._x = c * size;
_local2._y = r * size;
_local2.lineStyle(0, 0, 0);
_local2.beginFill(16711680, 100);
com.enkord.design.Drawing.drawRectangle(_local2, 0, 0, size, size);
}
function complete() {
if (__inversation) {
__object._visible = false;
} else {
__object.setMask(null);
}
__mask.removeMovieClip();
delete __mask;
delete __conveyor;
onComplete();
}
}
Symbol 607 MovieClip [__Packages.com.enkord.effects.images.HorizontalStripeMask] Frame 0
class com.enkord.effects.images.HorizontalStripeMask extends Object
{
var __conveyor, __inversation, __object, __mask, onComplete;
function HorizontalStripeMask (object, max_area, time, iterations, orientation, mask_depth, invers) {
super();
var _local15 = time / iterations;
var _local9 = Math.round(object._height / max_area);
var _local12 = object._height / _local9;
var _local8 = (_local12 / iterations) * (invers ? -1 : 1);
var _local19 = object._parent;
var _local10 = [];
var _local14 = com.enkord.utils.MathUtils.calculateNumsBetween(0, object._height, _local9);
_local14.unshift(0);
__conveyor = new com.enkord.utils.Conveyor();
__inversation = invers;
__object = object;
__mask = _local19.createEmptyMovieClip("mask_vsm", ((mask_depth != undefined) ? (mask_depth) : (_local19.getNextHighestDepth())));
object.setMask(__mask);
__mask._x = object._x;
__mask._y = object._y;
var _local5 = 0;
while (_local5 < _local9) {
var _local4 = __mask.createEmptyMovieClip("strip" + _local5, _local5);
_local4.lineStyle(0, 0, 0);
_local4.beginFill(16711680, 100);
com.enkord.design.Drawing.drawRectangle(_local4, 0, 0, object._width, _local12);
_local4._y = _local14[_local5];
_local10.push(_local4);
if (!invers) {
if (orientation == 0) {
_local4._y = _local4._y + _local12;
}
_local4._height = 0;
}
_local5++;
}
var _local16 = -1;
while (_local16++ , _local16 < iterations) {
var _local3 = 0;
while (_local3 < _local9) {
var _local7 = _local10[_local3];
var _local6 = ((orientation == 1) ? 0 : (_local8));
__conveyor.addToQueue(_local7, function (deltaH, y_shift) {
this._height = this._height + deltaH;
this._y = this._y - y_shift;
}, [_local8, _local6]);
_local3++;
}
__conveyor.addToQueue(this, function () {
}, [], _local15);
}
__conveyor.addToQueue(this, complete);
__conveyor.start();
}
function complete() {
if (__inversation) {
__object._visible = false;
} else {
__object.setMask(null);
}
__mask.removeMovieClip();
delete __mask;
delete __conveyor;
onComplete();
}
static var UP_TO_DOWN = 1;
static var DOWN_TO_UP = 0;
}
Symbol 608 MovieClip [__Packages.com.enkord.utils.MathUtils] Frame 0
class com.enkord.utils.MathUtils extends Math
{
function MathUtils () {
super();
}
static function calculateNumsBetween(a, b, count) {
var _local3 = (b - a) / count;
var _local1 = 0;
var _local2 = [];
while (_local1++ , _local1 < count) {
_local2.push(a + (_local1 * _local3));
}
return(_local2);
}
static function deg2rad(value) {
return((value / 180) * Math.PI);
}
static function multiplicate(value, multiplier, times) {
var _local1 = value;
var _local2 = -1;
while (_local2++ , _local2 < times) {
_local1 = _local1 * multiplier;
}
return(_local1);
}
static function randomInRange(a, b) {
if (a < 0) {
var _local3 = Math.abs(a);
var _local5 = Math.round(Math.random() * (_local3 + b));
return(((_local5 < _local3) ? (-_local5) : (_local5 - _local3)));
}
if (b < 0) {
var _local1 = Math.abs(b);
var _local5 = Math.round(Math.random() * (_local1 + a));
return(((_local5 < _local1) ? (-_local5) : (_local5 - _local1)));
}
var _local5 = Math.round(Math.random() * (b - a)) + a;
return(_local5);
}
}
Symbol 609 MovieClip [__Packages.com.enkord.effects.images.VerticalStripeMask] Frame 0
class com.enkord.effects.images.VerticalStripeMask extends Object
{
var __conveyor, __inversation, __object, __mask, onComplete;
function VerticalStripeMask (object, max_area, time, iterations, orientation, mask_depth, invers) {
super();
var _local15 = time / iterations;
var _local9 = Math.round(object._width / max_area);
var _local12 = object._width / _local9;
var _local8 = (_local12 / iterations) * (invers ? -1 : 1);
var _local19 = object._parent;
var _local10 = [];
var _local14 = com.enkord.utils.MathUtils.calculateNumsBetween(0, object._width, _local9);
_local14.unshift(0);
__conveyor = new com.enkord.utils.Conveyor();
__inversation = invers;
__object = object;
__mask = _local19.createEmptyMovieClip("mask_vsm", ((mask_depth != undefined) ? (mask_depth) : (_local19.getNextHighestDepth())));
__mask._x = object._x;
__mask._y = object._y;
object.setMask(__mask);
var _local5 = 0;
while (_local5 < _local9) {
var _local4 = __mask.createEmptyMovieClip("strip" + _local5, _local5);
_local4.lineStyle(0, 0, 0);
_local4.beginFill(16711680, 100);
com.enkord.design.Drawing.drawRectangle(_local4, 0, 0, _local12, object._height);
_local4._x = _local14[_local5];
_local10.push(_local4);
if (!invers) {
if (orientation == 0) {
_local4._x = _local4._x + _local12;
}
_local4._width = 0;
}
_local5++;
}
var _local16 = -1;
while (_local16++ , _local16 < iterations) {
var _local3 = 0;
while (_local3 < _local9) {
var _local6 = _local10[_local3];
var _local7 = ((orientation == 1) ? 0 : (_local8));
__conveyor.addToQueue(_local6, function (deltaW, x_shift) {
this._width = this._width + deltaW;
this._x = this._x - x_shift;
}, [_local8, _local7]);
_local3++;
}
__conveyor.addToQueue(this, function () {
}, [], _local15);
}
__conveyor.addToQueue(this, complete);
__conveyor.start();
}
function complete() {
if (__inversation) {
__object._visible = false;
} else {
__object.setMask(null);
}
__mask.removeMovieClip();
delete __mask;
delete __conveyor;
onComplete();
}
static var LEFT_TO_RIGHT = 1;
static var RIGHT_TO_LEFT = 0;
}
Symbol 610 MovieClip [__Packages.com.enkord.effects.images.VerticalAgainstStripesMask] Frame 0
class com.enkord.effects.images.VerticalAgainstStripesMask extends Object
{
var __inversation, __mask, __object, __convCollection, __conveyor, onComplete;
function VerticalAgainstStripesMask (object, max_area, time, iterations, easy_index, orientaion, mask_depth, invers) {
super();
var all_stripes = (Math.round((object._width / 2) / max_area) * 2);
var str_width = (object._width / all_stripes);
var same_direct_stripes = (all_stripes / 2);
var he = object._height;
var x_coos = com.enkord.utils.MathUtils.calculateNumsBetween(0, object._width, all_stripes);
var target = object._parent;
var collection = [];
var create_delay = ((time * easy_index) / same_direct_stripes);
var animation_delay = ((time - (time * easy_index)) / iterations);
var heightDelta = (object._height / iterations);
__inversation = invers;
(__mask = target.createEmptyMovieClip("vas_mask", ((mask_depth != undefined) ? (mask_depth) : (target.getNextHighestDepth()))));
(__mask._x = object._x);
__mask._y = object._y;
__object = object;
x_coos.unshift(0);
__convCollection = [];
object.setMask(__mask);
heightDelta = heightDelta * (invers ? -1 : 1);
var i = 0;
while (i < all_stripes) {
var our_strip = __mask.createEmptyMovieClip("strip" + i, i);
collection.push(our_strip);
with (our_strip) {
lineStyle(0, 0, 0);
beginFill(16711680, 100);
}
com.enkord.design.Drawing.drawRectangle(our_strip, 0, 0, str_width, he);
if (!invers) {
our_strip._height = 0;
our_strip._y = our_strip._y + (((i % 2) == orientaion) ? 0 : (he));
}
our_strip._x = x_coos[i];
i++;
}
__conveyor = new com.enkord.utils.Conveyor();
var a = 0;
while (a < same_direct_stripes) {
var di = ((a % 2) == 1);
if (orientaion == ORIENTATION_DOWN) {
di = !di;
}
__conveyor.addToQueue(this, setAnimationForPair, [collection[a], collection[(all_stripes - 1) - a], iterations, animation_delay, heightDelta, di, a == (same_direct_stripes - 1)], create_delay);
a++;
}
__conveyor.start();
}
function setAnimationForPair(obj1, obj2, iterations, delay, heDelta, who1, last) {
var _local9 = new com.enkord.utils.Conveyor();
var _local8 = new com.enkord.utils.Conveyor();
__convCollection.push(_local9);
__convCollection.push(_local8);
var _local2 = 0;
while (_local2 < iterations) {
_local9.addToQueue(obj1, stripScaling, [obj1, heDelta, who1], delay);
_local8.addToQueue(obj2, stripScaling, [obj2, heDelta, !who1], delay);
_local2++;
}
if (last) {
_local8.addToQueue(this, completeHandler);
}
_local9.start();
_local8.start();
}
function stripScaling(o, he_delta, direct) {
o._height = o._height + he_delta;
if (direct) {
o._y = o._y - he_delta;
}
}
function completeHandler() {
for (var _local2 in __convCollection) {
}
delete __convCollection;
if (__inversation) {
__object._visible = false;
} else {
__object.setMask(null);
}
__mask.removeMovieClip();
delete __mask;
delete __conveyor;
onComplete();
}
var __myName = "VEA";
static var ORIENTATION_UP = 0;
static var ORIENTATION_DOWN = 1;
}
Symbol 611 MovieClip [__Packages.GameMessage] Frame 0
class GameMessage extends MovieClip
{
var createTextField, _tf, mess, _message, _color, _time, _interval, _handler;
function GameMessage () {
super();
createTextField("mess", 1, 0, 0, 1, 1);
_tf = TextField(mess);
_tf._width = 350;
_tf.autoSize = "center";
_tf.text = _message;
var _local3 = new TextFormat("Forte MT", ((_message.length > 10) ? 30 : 60), _color);
_local3.align = "center";
_tf.setTextFormat(_local3);
_tf.embedFonts = (_tf.multiline = (_tf.wordWrap = true));
_tf._alpha = 90;
_tf.selectable = false;
if (_time != undefined) {
_interval = setInterval(this, "callHandler", _time);
}
}
function callHandler() {
clearInterval(_interval);
_handler();
}
static function create(this_mc, name, depth, init_obj) {
return(GameMessage(com.enkord.utils.McFactory.create(this_mc, name, depth, init_obj, GameMessage)));
}
}
Symbol 612 MovieClip [__Packages.AnimatedLabel] Frame 0
class AnimatedLabel extends MovieClip
{
var __textFormat, __size, __bold, __length, __initInterval, __fadeToDeath, __interDelegate, __inter, __get___size, __get___label, __get___color, __get___font, __get___autoalign, __get___alphas, __get___bold, __get___textformat, __lifeTimeDelegate, __lifeInter, __get___lifetime, __get___speed, __get___amplitude, __get___iterations, __initCharsDelegate, onComplete, removeMovieClip, createEmptyMovieClip, getNextHighestDepth, __curChar, __bottomY, _x, _width, _y, _height;
function AnimatedLabel () {
super();
}
function onLoad() {
if (__textFormat == undefined) {
__textFormat = new TextFormat(__font, __size, __color, __bold);
}
__length = __label.length;
__iterationsSum = __amplitude * __iterations;
initChars();
}
function settings(speed, amplitude, lifetime, iterations, alphas, init, fadetodeath) {
_speed = (speed);
_amplitude = (amplitude);
_lifetime = (lifetime);
_iterations = (iterations);
_alphas = (alphas);
__initInterval = init;
__fadeToDeath = fadetodeath;
}
function fadeOut(int) {
__interDelegate = mx.utils.Delegate.create(this, function () {
if (this._alpha <= 0) {
clearInterval(this.__inter);
this.clearMe();
}
this._alpha = this._alpha - 5;
});
__inter = setInterval(__interDelegate, int);
}
function set _size(value) {
__size = value;
//return(__get___size());
}
function set _label(label) {
__label = label;
//return(__get___label());
}
function set _color(value) {
__color = value;
//return(__get___color());
}
function set _font(value) {
__font = value;
//return(__get___font());
}
function set _autoalign(value) {
__autoalign = value;
//return(__get___autoalign());
}
function set _alphas(value) {
__alphas = value;
__shiftAlpha = (value[1] - value[0]) / __iterations;
//return(__get___alphas());
}
function set _bold(value) {
__bold = value;
//return(__get___bold());
}
function set _textformat(value) {
__textFormat = value;
__bold = value.bold;
__size = value.size;
__font = value.font;
__color = value.color;
//return(__get___textformat());
}
function set _lifetime(value) {
__lifetime = value;
if (value > 0) {
__lifeTimeDelegate = mx.utils.Delegate.create(this, function () {
clearInterval(this.__lifeInter);
this.fadeOut(this.__fadeToDeath / 20);
});
__lifeInter = setInterval(__lifeTimeDelegate, __lifetime);
}
//return(__get___lifetime());
}
function set _speed(value) {
__speed = value;
//return(__get___speed());
}
function set _amplitude(value) {
__amplitude = ((value == 0) ? 1 : (value));
__amplitude = ((value > __animDelta) ? (__animDelta - 1) : (value));
//return(__get___amplitude());
}
function set _iterations(value) {
__iterations = ((value > 0) ? (value) : 1);
//return(__get___iterations());
}
function clearMe() {
for (var _local2 in __collection) {
__collection[_local2].removeMovieClip();
}
__collection = [];
clearInterval(__inter);
clearInterval(__lifeInter);
delete __interDelegate;
delete __lifeTimeDelegate;
delete __initCharsDelegate;
onComplete();
removeMovieClip();
}
function addOneSymbol(char) {
var _local2 = createEmptyMovieClip(char + Math.round(__curWidth).toString(), getNextHighestDepth());
_local2.createTextField("char", 1, 0, 0, 2, 2);
var _local3 = _local2.char;
_local3.embedFonts = true;
_local3.selectable = false;
_local3.autoSize = "left";
_local3.text = char;
_local3.setTextFormat(__textFormat);
_local2._x = __curWidth;
_local2._alpha = __alphas[0];
__curWidth = __curWidth + _local2._width;
if (__curChar == 0) {
__bottomY = _local2._height;
} else {
_local2._y = __bottomY - _local2._height;
}
return(_local2);
}
function initChars() {
__curChar = 0;
__collection = [];
var _local3 = -1;
while (_local3++ , _local3 < __length) {
var _local2 = __label.charAt(_local3);
__collection.push(addOneSymbol(_local2));
}
alignMe();
__inter = setInterval(mx.utils.Delegate.create(this, function () {
this.setAnimation(this.__collection[this.__curChar]);
this.__curChar++;
if (this.__curChar == this.__length) {
clearInterval(this.__inter);
this.__inter = null;
}
}), __initInterval);
}
function alignMe() {
if (__autoalign.x) {
_x = 240 - (_width / 2);
}
if (__autoalign.y) {
_y = 240 - (_height / 2);
}
}
function setAnimation(obj) {
obj.finalY = obj._y;
obj.delta = __amplitude;
obj.it = __iterations;
obj.count = 0;
obj.r = 1;
obj.rshift = 1 / __iterations;
obj.deltaShift = __amplitude / __iterations;
obj.inteR = setInterval(mx.utils.Delegate.create(obj, function (ref) {
this._alpha = this._alpha + ref.__shiftAlpha;
with (this) {
_y = finalY + ((Math.sin(delta) * delta) * r);
delta = delta - deltaShift;
r = r - rshift;
}
this.count = this.count + 1;
if (this.count == this.it) {
clearInterval(this.inteR);
}
}), __speed, this);
}
var __label = "Label Default Text";
var __color = 0;
var __font = "Tahoma";
var __autoalign = {x:true, y:true};
var __lifetime = -1;
var __speed = 20;
var __amplitude = 30;
var __iterations = 20;
var __shiftAlpha = 0;
var __alphas = [];
var __collection = [];
var __curWidth = 0;
}
Symbol 613 MovieClip [__Packages.LevelHint] Frame 0
class LevelHint extends MovieClip
{
var textFormat, __text, __get___text, __x, __y, attachMovie, getNextHighestDepth, __bg, createTextField, hint_text, _x, _y, __yDelta, onEnterFrame, _parent;
function LevelHint () {
super();
}
function onLoad() {
textFormat = new TextFormat("Tahoma", 12, 15658734);
textFormat.align = "center";
initTextField();
startAnimation();
configEvents();
}
function set _text(value) {
__text = value;
//return(__get___text());
}
function setArrowsCoo(arr1, arr2) {
arrow1Coo = arr1;
arrow2Coo = arr2;
}
function setCoo(co) {
__x = co.x;
__y = co.y;
}
function posArrow(a) {
var _local2 = this["arrow" + a.toString()];
var _local3 = this[("arrow" + a.toString()) + "Coo"];
_local2._x = _local3.x;
_local2._y = _local3.y;
var _local4 = [null, 0, 90, 180, -90];
_local2._rotation = _local4[_local3.r];
}
function initArrows() {
if ((arrow1Coo == null) || (arrow2Coo == null)) {
return(undefined);
}
var _local3 = attachMovie("HintAnimatedArrow", "arrow1", getNextHighestDepth());
var _local2 = attachMovie("HintAnimatedArrow", "arrow2", getNextHighestDepth());
posArrow(1);
posArrow(2);
}
function initTextField() {
__bg = ResizablePopUp(attachMovie("ResizablePopUp", "bg", getNextHighestDepth()));
createTextField("hint_text", getNextHighestDepth(), 20, 20, 150, 10);
var _local2 = TextField(hint_text);
_local2.autoSize = "center";
_local2.selectable = false;
_local2.wordWrap = true;
_local2.setNewTextFormat(textFormat);
_local2.text = __text;
__bg.setAttributes(0, 0, _local2._width + 60, _local2._height + 65);
}
function startAnimation() {
_x = __x;
_y = -100;
__yDelta = (__y - _y) / 10;
onEnterFrame = mx.utils.Delegate.create(this, function () {
this._y = this._y + this.__yDelta;
if (this._y >= this.__y) {
this.initArrows();
delete this.onEnterFrame;
}
});
}
function configEvents() {
_parent.events.addEventListener(MahjongTileSet.LEVEL_COMPLETE, mx.utils.Delegate.create(this, function () {
this.removeMovieClip();
}));
_parent.events.addEventListener(MahjongTileSet.GAMEZONE_CHANGED, mx.utils.Delegate.create(this, function () {
this.removeMovieClip();
}));
}
var arrow1Coo = null;
var arrow2Coo = null;
}
Symbol 614 MovieClip [__Packages.TimeOutPopUp] Frame 0
class TimeOutPopUp extends MovieClip
{
var __score, score_txt;
function TimeOutPopUp () {
super();
}
function set _score(value) {
__score = value;
//return(_score);
}
function get _score() {
return(__score || 0);
}
function onLoad() {
score_txt.text = "your score: " + _score.toString();
}
}
Symbol 615 MovieClip [__Packages.LevelCompleteFrame] Frame 0
class LevelCompleteFrame extends MovieClip
{
var __gameZoneRef, __get___gamezone, __gameResults, __get___gameResults;
function LevelCompleteFrame () {
super();
}
function set _gamezone(value) {
__gameZoneRef = value;
//return(__get___gamezone());
}
function set _gameResults(value) {
__gameResults = value;
//return(__get___gameResults());
}
}